Case studies
#powershell#debugging#windows#electron#docker#pterodactyl#python#csharp#wpf#bash#security#cpp#git#performance#ci#nodejs#pyside6#react-native
8 posts · #powershell
Clear filters·5 min read

DailyBrief only worked on my disk, so I split install from per-user data
The packaged exe held my own OneDrive path and the pipeline rewrote the app's HTML page. One env var, DAILYBRIEF_DATA, now separates a read-only install from each Windows user's data.
In short
- A packaged build pointed at one hardcoded project path, and the daily pipeline also rewrote the app's own HTML page with each day's plan.
- I separated an install root (read-only, shared) from a data folder under the user's app data, chosen once in main.js and passed to every script as DAILYBRIEFDATA.
- Running a script by hand without the variable still works, because the data folder falls back to the script folder.
#electron#packaging#powershell#architecture
·6 min read

DailyBrief rebuilt every project card every 30 minutes, so I added a fingerprint cache
Most projects had not changed between runs, yet git log and a TODO scan ran for all of them. The hard parts were a fingerprint git status alone could not provide, and PowerShell 5.1 array quirks.
In short
- discover-projects.ps1 rebuilt every project card from scratch on each 30 minute run, including git history and a TODO scan.
- Each card now gets a fingerprint (HEAD, branch, dirty list plus the mtimes of the dirty files). If it matches the last run, the expensive fields are reused and the cheap ones are recomputed.
- Reusing a card is only safe if it serializes exactly like a fresh one, and PowerShell 5.1 made that harder than the cache itself.
#powershell#caching#git#performance
·6 min read

Removing a work folder in DailyBrief no longer triggers a full disk rescan
Saving the work-folder list used to rescan every root, even when I only removed one. The fix compares the effective root sets before and after and rescans only when a folder was gained.
In short
- Every save of the work-folder list cleared the cache and started a project discovery run plus a monitor run, including saves that only removed or switched off a folder.
- The handler now builds the effective root set before and after the save and rescans only if the new set contains a root the old one lacked.
- A removal now just saves, and the UI says its projects leave the list at the next scan, within 30 minutes.
#electron#nodejs#performance#powershell
·5 min read

DailyBrief's eval harness: real model runs on a data copy, judged by pure functions
I could not tell whether a prompt change improved the daily brief. The harness runs the real pipeline on a copy of my data and judges it with unit-tested checks, including one for terse caveman prose.
In short
- npm run eval runs the real pipeline against a temp copy of the user's data and judges the output with plain functions, so a prompt change can be measured instead of eyeballed.
- The judging code is pure and unit-tested; it checks the brief's shape, forbidden task titles, trend-only warnings, unknown task ids and terse "caveman" prose.
- The real data folder is only read, and a before/after fingerprint warns if anything in it changed during the run.
#testing#llm#evals#powershell#nodejs
·5 min read

DailyBrief's board file only grew, so I added a daily compactor that moves, never deletes
Every AI run in DailyBrief reads kanban.json, and that file only ever appended. A 169-line PowerShell script now moves old notes and finished tasks into an archive once a day, losslessly.
In short
- kanban.json was append-only, and every digest and AI check re-read all of it, so each run cost more than the last.
- core/compact-kanban.ps1 moves old aiNotes and tasks finished or deleted more than 30 days ago into kanban-archive.json, once a day, under the board lock.
- Nothing is deleted: items move whole with their comments and ids, the script is idempotent, and it writes the archive before it shrinks the board.
#powershell#electron#json#performance#data-retention
·5 min read

A publish step that never worked, because headless Claude has no Artifact tool
DailyBrief asked a headless CLI run to use a tool it does not have. The rewrite builds the markdown in PowerShell, serializes every argument itself and treats the model's reply as untrusted.
In short
- The old publisher told a headless claude -p run to use the Artifact tool, which a headless session does not have, so it never worked.
- The new one builds the markdown in PowerShell, serializes every tool argument itself, and gives a small model only the job of passing them on.
- Everything the model returns is treated as untrusted: the doc link is stored only if it is plausible, and the body id only if it matches an id pattern.
#claude-cli#powershell#automation#llm
·6 min read

Parallel AI checks kept overwriting my kanban board, so I added a lock and a merge
Several AI runs and the page saved the same kanban.json, and the last writer won. A shared lock file was not enough, so saves became a three-way merge.
In short
- Parallel AI checks and the user's own board saves all did read-modify-write on the same kanban.json, so the last writer dropped everyone else's changes.
- I added one lock file that both Node and PowerShell take, and a three-way merge so a page save is merged with what the scripts wrote meanwhile instead of overwriting it.
- If the lock cannot be taken, nothing is written and the user sees an error, because an unlocked write is exactly the bug being fixed.
#electron#concurrency#file-locking#powershell
·13 min read

DailyBrief: a personal AI advisor on the desktop with PowerShell
A 391 MB digest, a mojibake fix that never worked, and a 30k-token baseline cut to 1.2k: the real bugs behind DailyBrief, a desktop AI advisor built on PowerShell and a headless Claude CLI.
In short
- The unit of planning is the project, not the folder: a registry rebuilt every 30 minutes with no AI involved.
- Scripts gather and compress activity into a small digest, the model returns a small JSON patch, and a script applies it.
- A stripped claude -p session cut the recorded per-call baseline from about 30k tokens to about 1.2k.
#ai#powershell#electron#claude