Case studies
#powershell#debugging#windows#electron#docker#pterodactyl#python#csharp#wpf#bash#security#cpp#git#performance#ci#nodejs#pyside6#react-native
18 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 · Story
Georgian text turned into mojibake, and I repaired it with a reversed cp1252 table
UTF-8 read as Windows-1252 turned my Georgian task titles into Latin garbage. A Latin-1 round trip cannot undo it, so the fix is cp1252's own table reversed, with guards that never touch good text.
In short
- An older version of my PowerShell scripts read UTF-8 as Windows-1252 and saved the result back as UTF-8, so Georgian text turned into Latin-looking garbage.
- A Latin-1 round trip cannot undo it, because cp1252 maps bytes 0x80-0x9F to characters outside Latin-1, and Georgian UTF-8 is full of those bytes.
- The repair is a reverse table plus two safety checks, and it runs on read, so the files heal themselves.
#encoding#utf-8#electron#powershell#georgian
·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
·5 min read

DailyBrief · Story
Letting an AI edit a real repo: its own branch, and git's stderr
The execute run refuses non-git folders and works on dailybrief/<taskid> so one checkout undoes it. Git's success messages on stderr almost killed it.
In short
- The execute run refuses any folder that is not a git repo, checks out dailybrief/<taskid> before the model starts, and forbids commit, push, reset and branch switching in its prompt.
- Because uncommitted work travels with a checkout, git checkout - drops everything the model did without touching what was already dirty.
- Git writes progress to stderr even on success, which PowerShell can treat as an error, so every git call goes through a wrapper that relaxes the error preference.
#powershell#git#ai-agents#safety
·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

DiskDesk · Story
Two things my DiskDesk release workflow got wrong in its first hour
gh release create fails when the release already exists, and $env:ProgramFiles(x86) does not mean what it looks like in PowerShell. Two small CI fixes, 14 seconds apart.
In short
- The workflow ended with gh release create, which assumes the release does not exist yet; a tag pushed by hand or a rerun breaks that assumption.
- The Inno Setup path used $env:ProgramFiles(x86) in PowerShell, whose parentheses are not part of the variable name, so it needed braces.
- The fix is two small edits, but the version guard and the workflowdispatch split around them are what keep a release honest.
#github-actions#powershell#ci#windows