Add aggregate content-capture report to burn diagnose (closes #79)#174
Merged
willwashburn merged 4 commits intomainfrom Apr 28, 2026
Merged
Add aggregate content-capture report to burn diagnose (closes #79)#174willwashburn merged 4 commits intomainfrom
willwashburn merged 4 commits intomainfrom
Conversation
`burn diagnose` (no positional arg) now walks the ledger and emits a per-adapter content-capture gap table: total sessions, sessions with ≥1 tool call, gapped sessions, orphan tool-call count, and degraded%. Mirrors the gap-detection semantics of `countToolCallGaps` (the helper that drives the per-invocation ingest warning from #75) but as a permanent, queryable surface — a user re-running `burn` later still sees the underlying degradation rather than a single warning that already fired. The existing `burn diagnose <session-id>` path is untouched. `--json` emits `{ adapters: [...], contentMode }`. When the content store is `hash-only` / `off`, the gap signal is omitted with an explanatory note so we don't mislead the user about whether content was captured or simply not stored. Adapters with no sessions in the ledger are omitted entirely. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Single-package work belongs only in that package's CHANGELOG per AGENTS.md §Changelog. Move the #79 entry from the root CHANGELOG to packages/cli/CHANGELOG.md [Unreleased]. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…e-aggregate-report # Conflicts: # packages/cli/CHANGELOG.md
Resolved conflicts in packages/cli/CHANGELOG.md and packages/cli/src/cli.ts. CHANGELOG.md: kept both [Unreleased] entries (the diagnose aggregate report from this branch and the waste --findings entry from main) and preserved the new [0.40.0] section for `burn archive vacuum`. cli.ts: kept the optional `[<session-id>]` form for `burn diagnose` (the whole point of this PR) and adopted `[--findings]` from main on the waste help line. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Summary
burn diagnose(no positional arg) walks the ledger and emits a per-adapter content-capture gap table — total sessions, sessions with tool calls, gapped sessions, orphan tool-call count, and degraded%. Permanent, queryable surface for the gap that the per-invocation ingest warning from Surface silent parser content-capture gaps at ingest time (#59) #75 only flags once perburnrun.--jsonemits{ adapters: [{ adapter, sessions, sessionsWithToolCalls, gappedSessions, orphanToolCalls, degradedPct }, ...], contentMode }.burn diagnose <session-id>path is untouched (same output, same exit codes, same--jsonshape).hash-only/off, the gap signal is omitted with an explanatory note rather than misleading the user about whether content was captured or simply not stored. Adapters with no sessions are omitted entirely.Closes #79.
Test plan
pnpm run buildcleanpnpm run test— full suite (673 tests, all green) including 6 new cases inpackages/cli/src/commands/diagnose.test.ts:tool_resultrecords →gappedSessions = 2,orphanToolCalls = 3,degradedPct = 100100.0%RELAYBURN_CONTENT_STORE=hash-onlyzeroes the gap fields and emits the explanatory noteburn diagnoseandburn diagnose --jsonagainst an empty ledger produce the expected zero-row report.🤖 Generated with Claude Code