rag
Technical notes on web development, DevOps, and AI integration.
6 articles
- 02:42testing
Zero Percent Coverage While Every Test Passes
Moving tests to a centralized tree makes per-package coverage read zero percent; one -coverpkg flag on the coverage mode restores the number.
TL;DR: Moving Go tests into a centralized external package caused coverage to drop to 0.0% even though everything still passes, because go test only instruments the package under test by default. The fix is the -coverpkg flag, which tells the tool which packages to measure. Execution and coverage are separate paths, so CI needs no changes.
#go#coverage#testing - 23:57devops
Move an Oversized Folder to Block Storage with a Symlink
A 14G backup folder filled the root disk. The move-to-block-storage-with-symlink pattern relieves disk pressure without deleting backup data.
TL;DR: When the root disk hit 95 percent, the culprit was a 14GB WordPress plugin backup folder. Instead of deleting it, the fix moved the folder intact to block storage and left a symlink at the old path, dropping usage to 44 percent. Verify file counts, use absolute paths, and persist the mount in fstab to avoid dangling links.
#linux#rsync#symlink - 00:39frontend
React Duplicate Keys from localStorage: My Two-Layer Fix
Legacy localStorage ids collided in my React chat. Here is the reindex plus seeding fix that silenced the duplicate key error.
TL;DR: A React "duplicate key" warning came from legacy localStorage chat data holding duplicate turn ids, plus a counter effect that read stale values and minted collisions. The fix: reindex every restored turn to 0..n-1 and seed the next id inside the restore effect itself. Lesson: treat persisted data as untrusted and normalize it at the boundary.
#react#localstorage#typescript - 11:37tooling
DeepSeek Login Died Between Sessions. Three Scripts Fixed It.
Re-logging into DeepSeek via VNC every week got old. I transferred the whole session into Camofox instead: cookies, token, keepalive.
TL;DR: DeepSeek sessions in Camofox died because logging in means two layers: HttpOnly cookies and a localStorage userToken for Bearer API calls. Importing cookies alone patched half the state, so the login page persisted. Three scripts merge cookies into Playwright's storage-state.json, inject the wrapped token, and poll every five minutes to confirm the session.
#automation#playwright#deepseek - 21:57ai
Query Rewriting: The Small Brain Before Agent Search
Told to search for "nano banana", an agent without query rewriting gets two worlds of meaning. Here are the 5 rewrite patterns I installed.
TL;DR: The author's fix for ambiguous agent searches: expand every query into five variants—literal, contextual, English, industry synonym, full question—before searching. All five run and merge, so "nano banana" resolves correctly as Google's image model rather than a fruit. The approach costs almost nothing—no extra API calls—though the author honestly admits no benchmark data exists yet.
#query-rewriting#ai-agent#rag - 20:07ai
The follow-up question my AI chat couldn't answer
Chat follow-up questions without server sessions: history lives in localStorage, gets resent per ask, and the backend rebuilds the prompt under a char budget.
#fastapi#llm#stateless