Skip to content

feat: add context compaction analysis - #230

Merged
Siddhant-K-code merged 1 commit into
mainfrom
feat/compaction-analysis
Aug 16, 2026
Merged

Siddhant-K-code merged 1 commit into
mainfrom
feat/compaction-analysis

Conversation

@Siddhant-K-code

Copy link
Copy Markdown
Owner

Summary

  • add agent-strace compaction to detect provider-reported context drops and estimate discarded-context cost
  • diff retained versus likely-dropped goals, constraints, decisions, reads, and modified files per conversation sidechain
  • compare pre/post-compaction lint and tool behavior, including re-reads, loops, exploration, and context saturation
  • add post-compaction-regression to agent-strace lint
  • add live pre-compaction Markdown checkpoints with per-stream, O(1) watcher state and retention cleanup
  • preserve Claude JSONL usage, compaction summaries, and stable sidechain identity during import
  • document analysis, checkpoint privacy, flags, and interpretation; bump the package to 0.89.0

Closes #217

Verification

  • python -m unittest tests.test_compaction tests.test_jsonl_import -v (36 passed)
  • Ona test task (1,765 Python tests passed; 3 VS Code tests passed)
  • python -m py_compile src/agent_trace/compaction.py src/agent_trace/jsonl_import.py
  • git diff --check

Co-authored-by: Codex <noreply@openai.com>
@Siddhant-K-code

Copy link
Copy Markdown
Owner Author

Independent review completed against the integrated diff.

Review findings fixed before opening this PR:

  • preserved real Claude JSONL usage and compaction summaries instead of relying on synthetic request data
  • isolated detection, diffs, behavior windows, and watcher state by conversation sidechain
  • excluded estimated payload sizes from compaction reporting, pricing, and startup checkpoints
  • replaced the live watcher rescan with O(1) per-stream request/response state, including interleaved responses
  • included modified-file context and the full registered lint delta without recursive lint execution
  • removed boundary-summary overwrite and checkpoint-retention edge cases

No blocking findings remain. The reviewed revision passes 1,765 Python tests and 3 VS Code extension tests.

@Siddhant-K-code
Siddhant-K-code merged commit cb29046 into main Aug 16, 2026
5 checks passed
@Siddhant-K-code
Siddhant-K-code deleted the feat/compaction-analysis branch August 16, 2026 18:14
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.

feat: compaction analysis - detect, diff, and measure behavior change across context compaction events

1 participant