·5 min read
Four kanban cards shared one repo, so every one got the same evidence
Four cards on my kanban board pointed at the same repo, and every one of them was handed the same evidence: the same 187 changed files, the same 8 commits, and a "top five" that was nothing but hashed build output. I pressed check on the board, watched a dollar of model time go by, and nothing changed. Either the model said nothing, or it closed a task off a neighbour's commit. From the board both failures looked identical.
- Project
- DailyBrief
- Date
- Aug 2026
- Stack
- PowerShell, Electron, Claude CLI, git
- Commit
- 09b27d4
What the digest looked like
DailyBrief's check script builds a JSON digest for each open task and hands it to the model. The digest holds recent file changes, a git diff since the last baseline, and the task's own checklist. That works when one task owns one folder. It falls apart when a repo has four live cards, for example "InfoCommand.php mail driver" and "InvoiceHistory filter" in the same project. Every card got the same git diff --name-only, the same commit subjects, the same dirty entries. Nothing in that text separated one task from another.
The top five files were worse. One npm build rewrites every hashed bundle under assets\, and those paths were sorting to the top by timestamp. The five slots went to files that said nothing about any task.
Attribute the evidence to the task
A task already says what it is about. Its title and checklist contain file names, class names and column names. So the script extracts those:
$pats = @(
'[A-Za-z][A-Za-z0-9_\-]{2,}\.(?:blade\.php|tsx|ts|jsx|js|php|vue|py|go|rb|cs|java|kt|scss|css|json|md|ps1|sql|yaml|yml)',
'\b[A-Z][a-z0-9]+(?:[A-Z][a-z0-9]+)+\b',
'\b[a-z][a-z0-9]*_[a-z0-9_]{2,}\b'
)The first pattern catches InfoCommand.php and DeployHistory.tsx. The second catches CamelCase names. The third catches snake_case names such as deploy_logs. Those keywords are then matched, case-insensitively, against the folder's changed files, its dirty entries, and the file list of every new commit.
The last one matters because of commit subjects like feat(billing): a bilingual invoice. That subject names no file, so a commit can only be tied to a task through what it touched. The script now runs git show --pretty=format: --name-only for each of the new commits and keeps the file list next to the subject.
The result goes into the digest in three fields:
mine = @{ files = $myFiles; commits = $myCommits }
related = @($nearFiles | Select-Object -First 6)
sharesFolder = $sharedmine holds exact keyword hits, strong enough to close a task on. related holds the same names with the extension dropped, so Invoice.php also reaches InvoiceController.php. That is too loose to close a task, but worth showing as a hint, and the stem must be at least five characters. sharesFolder is true when more than one live card watches the same folder. A task alone in its folder still owns everything that folder does.
Closing a task now needs a hit
Before, a model could return done: true for a task and the script applied it. Now the script decides, in the same pass where the digest is built:
if (($myFiles.Count -gt 0 -or $myCommits.Count -gt 0) -or (-not $shared -and $hasFolderSignal)) {
$evidenceIds[[string]$t.id] = $true
}When the patch comes back, done is refused unless the task's id is in that set, and the log gets a [warn] refused done for ... line. A comment saying "this is finished" still closes the card outright, because that is the user's own word and not a guess.
What the fix uncovered
Most of the commit is the list of bugs the attribution work exposed.
The baseline moved too early. A check re-baselined every task's folder while building the digest. The first run consumed the evidence and every later run saw an empty diff. The baseline now moves after the patch is applied, and only for tasks the patch spoke about. In the code that is a loop over a $touched list at the very end of the save.
The noise filter matched nothing. According to the commit message, the filter reached the file as [\/], a character class that matches forward slashes. No Windows path contains one, so assets\bundle.hash.js counted as evidence. The current version normalizes separators before matching:
function Is-Noise([string]$path) {
return (([string]$path).Replace([char]92, '/') -match $NOISE_RE)
}The list now also excludes storage, logs and compiled views. The comment I left above it says a character class of escaped backslashes is one escaping layer away from silently matching nothing.
A fenced reply threw away a whole run. If the model answered with the JSON in a fenced block instead of writing the patch file, the run applied nothing. Recover-JsonFromLog now takes the JSON from the run's own reply and logs it as [info], not [warn], because the patch did land. The ask and ideas runs had no recovery at all and now share it.
A bare filename was the model's to resolve. {{OUT}}, {{PATCH}} and {{DIGEST}} are absolute paths now. One ideas run had written its answer into the project folder it was reasoning about.
Two UI bugs rode along. A closed card's badge counted ticked subtasks raw and showed 0/6 next to its own 100% progress bar. And a packaged install and a dev run share one localStorage but keep separate journals, so each replayed the other's problems on every launch; the "seen" marker is now keyed by data folder.
What I took from it
The model was never the weak part. I had given it a digest in which four different questions had one answer, and then I was surprised that the answers were useless. Splitting evidence per task is cheap. It is a few regexes and a git show per commit. Gating the irreversible action, closing a card, on that evidence in script code and not in the prompt is what keeps a confident wrong answer from changing the board.
I also stopped trusting a filter I had not tested against a real path of the platform it runs on.
#powershell#git#ai-agents#debugging#windows
Keep reading
Have a project in mind?