Skip to content

chore(telemetry): clean up what release 1 left on next - #1053

Merged
blafourcade merged 9 commits into
nextfrom
chore/telemetry-r1-cleanup
Oct 17, 2026
Merged

blafourcade merged 9 commits into
nextfrom
chore/telemetry-r1-cleanup

Conversation

@blafourcade

@blafourcade blafourcade commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

🎯 What & why

Cleans up what the telemetry release 1 work left on next: code for a ledger format no release wrote, probes and history in task folders, docs that drifted from the code, and two weak guard tests. Each audit item is one commit. Net: 44 files, +153 / -2043, 17 files deleted.

🛠️ How it works

Commit Audit item What
82a69d14 4 (deterministic-tokens history) Deletes phase-1..9.md and context/mutation-proofs.md (-1,338 lines). plan.md keeps the phase list, without links. spec.md and context/target.md stay.
d67ff80d 3 (executable code in task folders) Deletes context/prototype/ (check.py, fixtures), memory-bench.mjs and the draft usage-record-contract.md (-255 lines). The docs that cited them say they were removed. The bench's measured RSS figures stay in the transcripts evidence.md.
d5666503 2 (monthly ledger) Removes <YYYY-MM>.jsonl handling from usage-ledger-adapter.ts. A window is now a test on each day file, and holdsADayOf / inWindow are gone. The month cases are removed from the tests and the contract.
e3294700 5, 7, 8 (wrong or stale docs) Fixes unrecognised_shapes in the usage contract, the "When there is nothing" diagnosis and the agent axis in 01-usage, telemetry.md (task only from aidd telemetry task, restated rules turned into pointers), status in cli.md, and the three telemetry hooks in docs/ARCHITECTURE.md.
bb0514d2 6 (envelope defined three times) Cuts the field list in the usage contract to a pointer to envelope.md, plus what only the contract says. The axis values and the filters' order move into the reference.
c649282a 10 (statuses) ledger-by-day/contract.md goes from in-progress to done, and deterministic-tokens/spec.md from framed to done.
32814a0f #1051 review nits t.mock.method(String.prototype, "indexOf") replaces the hand-patched prototype. An upper-case id in a multi-line session array covers the i flag on ANY_UUID.
4b3ab65d slim task-folder policy Recorded once, in backlog.md. The Supports row and the existing Relations bullet are rewritten, with no new section.

Monthly ledger: why it is dead.

Tests changed, not only deleted (item 2).

  • ledger-upkeep.property, report-figures.property and report-window.property kept their starting-store dimension. It is now "days an earlier ingest wrote, unfolded" instead of "a month file", so the coverage of a pre-existing store stays.
  • stored-usage-migration.property lost its October-is-monthly flag. Its docstring already says "as cli-v5.5.0 left them".
  • The unsettled-partition ingest test and the forget test now use a day name.

Guard change inside item 5.

  • scripts/__tests__/architecture-doc-matches-the-tree.test.js allowed exactly one script per plugin row, which is how the table came to name only prompt-gate.cjs.
  • It now checks that the Runs cell equals every script the plugin's hooks.json runs, and that each script exists.
  • Red against the old table: actual: [ 'hooks/prompt-gate.cjs' ], expected: [ 'hooks/catch-up.cjs', 'hooks/prompt-gate.cjs', 'hooks/session-start.cjs' ].

🧪 How to verify

  • pnpm exec lefthook run pre-commit --all-files exits 0.

  • pnpm exec lefthook run pre-push --all-files:

    • knip is green;
    • cli suite: Test Files 522 passed | 1 skipped, Tests 6787 passed | 1 skipped.
  • Bundle (pnpm build): 700.6 KB on origin/next, 699.8 KB on this branch.

  • Test-first:

    • The adapter test reads only day files, and leaves a month's name, ... alone failed before the change with skippedLines: 1, damaged: {"2026-10"}, and passes after it.
    • Hand mutation: deleting the window test in load turns 4 adapter tests red.
  • Same store, same report. Steps:

    1. In a sandbox (HOME, XDG_CONFIG_HOME, AIDD_USER_CONFIG_DIR, AIDD_TELEMETRY_DIR, CLAUDE_CONFIG_DIR in temp dirs, GIT_CONFIG_NOSYSTEM=1), npm i @ai-driven-dev/[email protected].
    2. aidd telemetry on, then backdate the consent, the same way the e2e tests do.
    3. Ingest the repository's cli/tests/fixtures/claude-usage transcripts with 5.5.0.
    4. Copy the store, then run report --json with the origin/next build on one copy and this branch's build on the other.

    Result, for no period, --from 2026-10-07 --to 2026-10-07 and --axis day: the reports are byte-identical, and so are the stores they leave behind.

    Limit: the fixture store is one day and 4 records.

  • Guard nits, by hand mutation:

    • ANY_UUID without i turns reads every session array ..., whatever the case of its ids red.
    • continue instead of return on an unclosed array turns stops at the first unclosed session key ... red.

⚠️ Heads-up

  • Not done:
  • Dropped from the audit:
    • "done and implemented make two columns" is wrong: kanban/src/domain/models/progress-status.ts maps implemented and reviewed to Done.
  • Kanban gaps, not fixed here:
    • framed, approved and superseded are unmapped and land in the unknown column.
    • Both status edits are sub-documents under a plan.md already in Done, so the board does not move.
    • deterministic-tokens/context/ still holds three docs with no status, so it remains a stray unknown card.
  • Text mentions left as history (not links):
    • transcripts-are-read-as-a-stream/review.md still cites memory-bench.mjs lines.
    • The Decisions of deterministic-tokens/plan.md cite "phase 6 task 5" and "phase 4 task 3.2".
  • Mutation: Stryker was not run locally; CI ran the telemetry mutation shards. Item 2 deletes a dead branch and inlines the window test; the hand mutation above covers the line that changed.
  • aidd-dev:01-plan still generates phase-N.md files, which the new task-folder policy folds into plan.md. Changing that skill is a product decision left to the maintainer; plugins/aidd-dev is untouched.
  • Audit item 9 (fallback key), out of scope: fix(telemetry): one call, one key; one repository, one id #1049 dropped the timestamp from the requestless key. A copy written under another session id would still not fold, and the Residual limits table does not say so.

🔗 Linked issue

None. Found by the R1 telemetry cleanup audit.

✅ I certify

  • I DO CERTIFY I READ EACH LINE OF THE PULL REQUEST BECAUSE I AM A SOFTWARE ENGINEER, NOT A AI PUPPY.

🤖 Generated with Claude Code

https://claude.ai/code/session_01VWNxk63AGKkqE8HRqHLjGp

blafourcade and others added 9 commits October 17, 2026 18:21
…on log

The nine phase files and the per-commit mutation log narrate how release 1 was built. The work merged; git history keeps them. plan.md keeps the phase list without links, spec.md and context/target.md stay as the why.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VWNxk63AGKkqE8HRqHLjGp
…lders

The Python prototype readers and their fixtures, the memory bench and the draft usage record sat in task folders: run by nothing, and the draft duplicated the usage contract. The docs that cited them now say they were removed, and keep the figures the bench measured.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VWNxk63AGKkqE8HRqHLjGp
Only builds of next between #993 and #1032 wrote <YYYY-MM>.jsonl; cli-v5.5.0, the first release with the ledger, already writes one file per day, and cli-v5.4.0 had no ledger. The adapter no longer reads, splits or removes a month's file, so a window is a test on each day file. The month cases leave the tests; the property tests keep their earlier-store dimension as days written by an earlier ingest.

A store written by cli-v5.5.0 reports byte for byte as before, with no period, with --from/--to and by day, and is left with the same bytes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VWNxk63AGKkqE8HRqHLjGp
- usage contract: run.unrecognised_shapes counts unreadable lines and assistant lines with a bad usage or no id, session or time; a line with no message.usage is no call and counts nowhere.
- envelope reference: the empty-report diagnosis names coverage.records, and says a run field speaks only for the read that printed it.
- 01-usage description lists the agent axis.
- CLI telemetry memory: task and ticket come only from aidd telemetry task; restated rules become pointers to the contract.
- CLI memory lists telemetry status.
- ARCHITECTURE names the three telemetry hook scripts. Its guard allowed one script per plugin, which is how the table drifted: it now checks the Runs cell against every script the plugin's hooks.json runs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VWNxk63AGKkqE8HRqHLjGp
The usage contract restated every envelope field the 01-usage envelope reference already defines, and every new field had to change both. The contract now points at the reference and keeps only what it alone says: the version 1 note, the refusal object, the text report's anonymous label, the bounded read and that no path leaves. The reference gains the axis values and the filters' order, which only the contract listed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VWNxk63AGKkqE8HRqHLjGp
ledger-by-day's contract still said in-progress and deterministic-tokens' spec said framed, a status the board maps to unknown; both pull requests merged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VWNxk63AGKkqE8HRqHLjGp
- The scan count spies String.prototype.indexOf with t.mock.method, restored by the runner, instead of patching the prototype by hand.
- A session array holding an upper-case id: dropping the i flag on ANY_UUID now fails a test.

Both mutations were applied by hand and turned the named test red.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VWNxk63AGKkqE8HRqHLjGp
A folder holds contract.md, plan.md with its phases folded in, and evidence.md. The review lives in the pull request, probes stay in the scratchpad, and the parent document goes to done when the pull request merges. Recorded where the backlog memory already describes task documents, replacing its plans, specs and reviews wording.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VWNxk63AGKkqE8HRqHLjGp
@blafourcade
blafourcade marked this pull request as ready for review October 17, 2026 17:21
@blafourcade
blafourcade requested a review from a team as a code owner October 17, 2026 17:21
@blafourcade
blafourcade merged commit 7876341 into next Oct 17, 2026
31 checks passed
@blafourcade
blafourcade deleted the chore/telemetry-r1-cleanup branch October 17, 2026 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant