Skip to content

Add aggregate content-capture report to burn diagnose (closes #79)#174

Merged
willwashburn merged 4 commits intomainfrom
feat/issue-79-diagnose-aggregate-report
Apr 28, 2026
Merged

Add aggregate content-capture report to burn diagnose (closes #79)#174
willwashburn merged 4 commits intomainfrom
feat/issue-79-diagnose-aggregate-report

Conversation

@willwashburn
Copy link
Copy Markdown
Member

@willwashburn willwashburn commented Apr 28, 2026

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 per burn run.
  • --json emits { adapters: [{ adapter, sessions, sessionsWithToolCalls, gappedSessions, orphanToolCalls, degradedPct }, ...], contentMode }.
  • Existing burn diagnose <session-id> path is untouched (same output, same exit codes, same --json shape).
  • When the content store is 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 build clean
  • pnpm run test — full suite (673 tests, all green) including 6 new cases in packages/cli/src/commands/diagnose.test.ts:
    • zero-gap ledger across multiple adapters
    • codex sessions with tool calls but no tool_result records → gappedSessions = 2, orphanToolCalls = 3, degradedPct = 100
    • human-readable table includes the spec'd columns + 100.0%
    • RELAYBURN_CONTENT_STORE=hash-only zeroes the gap fields and emits the explanatory note
    • per-session path with a missing session id still exits 1 with the existing message
    • empty ledger renders the "no sessions" note
  • Smoke test: burn diagnose and burn diagnose --json against an empty ledger produce the expected zero-row report.

🤖 Generated with Claude Code


Open in Devin Review

`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>
devin-ai-integration[bot]

This comment was marked as resolved.

willwashburn and others added 3 commits April 28, 2026 09:21
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>
@willwashburn willwashburn merged commit 2b429e7 into main Apr 28, 2026
1 of 2 checks passed
@willwashburn willwashburn deleted the feat/issue-79-diagnose-aggregate-report branch April 28, 2026 20:48
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.

Aggregate parser content-capture gaps in burn diagnose

1 participant