fix(telemetry): a backlog declaration the report can actually read - #780
Merged
Conversation
The `by_backlog` axis rests on one file per task folder, `backlog-link.json`, and
nothing checked that the file was readable. Of the three this repository held, two
carried `writtenAt` and `writtenBy` while `task-backlog-adapter.ts` reads
`written_at` and `written_by`, so those two parsed as nothing at all.
Measured on the real sink before the fix, 30 days:
{"backlog":"#694"} 4
{"declaration":"unreadable"} 130
{"declaration":"none"} 2918
and after it, the same window and the same records:
{"backlog":"#746"} 133
{"backlog":"#694"} 4
{"declaration":"none"} 2918
The axis was never broken — it reported `unreadable` truthfully, on its own row,
exactly as `TaskBacklogDeclaration` requires of a file it cannot parse. What was
missing is anything that reads that row before a person does.
Both wrong files were written by `aidd-orchestrator:01-sdlc`, which
`01-frame.md` tells to carry the resolved ticket so that "whichever of Spec or
Plan first creates the delivery folder can declare it there". It wrote the file
itself instead, and took the field names from the TypeScript interface rather
than from what either skill teaches. The guard, not a fourth copy of the JSON
block, is the durable answer: a third skill inventing a fourth spelling now fails
here rather than in a report nobody reads.
The guard restates the reader's rule, because the reader is a `cli/` module and
this is a repository script test; the second case is what keeps that restatement
honest, asserting the same three names are the ones `aidd-pm:04-spec` and
`aidd-dev:01-plan` actually teach.
Mutations run, both killed: a declaration put back in camelCase, and a skill that
stops teaching one of the three fields.
373 repository script tests pass, 0 broken links in 798 files.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VWNxk63AGKkqE8HRqHLjGp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The
by_backlogaxis rests on one file per task folder —backlog-link.json— and nothing checked that the file was readable. Of the three this repository held, two carriedwrittenAt/writtenBywhilecli/src/infrastructure/adapters/task-backlog-adapter.ts:30readswritten_at/written_by. Those two parsed as nothing.Measured on the real sink, 30 days
Before:
After, same window, same records:
The axis was never broken
It reported
unreadabletruthfully, on its own row, exactly asTaskBacklogDeclarationrequires of a file it cannot parse — never folded into "declared nothing". What was missing is anything that reads that row before a person does.Both wrong files were written by
aidd-orchestrator:01-sdlc. Its own01-frame.mdtells it to carry the resolved ticket so that "whichever of Spec or Plan first creates the delivery folder can declare it there". It wrote the file itself instead, and took the field names from the TypeScript interface rather than from what either skill teaches.The guard is the durable answer rather than a fourth copy of the JSON block in the orchestrator's own reference: a third skill inventing a fourth spelling now fails here, not in a report nobody reads.
The guard
Two cases. The first asserts every tracked
backlog-link.jsoncarries the three fields the reader looks for, in the spelling it looks for them. The second asserts those same three names are whataidd-pm:04-specandaidd-dev:01-planactually teach — because the reader is acli/module and this is a repository script test, so the rule is restated here, and a restatement drifting from the lesson is exactly what produced the two bad files.Mutations run, both killed:
373 repository script tests pass, 0 broken links in 798 files.
🤖 Generated with Claude Code
https://claude.ai/code/session_01VWNxk63AGKkqE8HRqHLjGp