Skip to content

feat(AC-235): append-only context mutation log with checkpoint replay#369

Merged
jayscambler merged 2 commits intomainfrom
feat/ac-235-mutation-log
Mar 13, 2026
Merged

feat(AC-235): append-only context mutation log with checkpoint replay#369
jayscambler merged 2 commits intomainfrom
feat/ac-235-mutation-log

Conversation

@jayscambler
Copy link
Copy Markdown
Contributor

Summary

  • Adds knowledge/mutation_log.py with MutationEntry, Checkpoint, and MutationLog for auditable, append-only context mutation tracking
  • JSONL-backed per-scenario log at knowledge/<scenario>/mutation_log.jsonl
  • Checkpoint support for marking last-known-good state and replaying only subsequent mutations
  • Log bounding/truncation that preserves checkpoint integrity
  • Audit summary generation for operator visibility
  • ArtifactStore.mutation_log property for unified access

Closes AC-235

What changed

File Change
src/autocontext/knowledge/mutation_log.py New — MutationEntry, Checkpoint, MutationLog
src/autocontext/storage/artifacts.py Add mutation_log property
tests/test_mutation_log.py New — 29 tests

Test plan

  • 29 new tests covering append/read, checkpoints, replay, truncation, filtering, audit summary, ArtifactStore integration
  • Full suite: 3250 passed, 46 skipped, 0 failures
  • Ruff clean, mypy clean

Add JSONL-backed append-only mutation log for auditing and replaying
context changes per scenario. New knowledge/mutation_log.py provides:
- MutationEntry dataclass for typed mutation events (schema_change,
  lesson_added/removed, playbook_updated, notebook_updated, run_outcome)
- MutationLog with append/read/filter operations on JSONL files
- Checkpoint creation and retrieval for last-known-good state
- Replay from checkpoint with optional type filtering
- Log bounding/truncation preserving checkpoints
- Audit summary for operator visibility
- ArtifactStore.mutation_log property for unified access
@linear
Copy link
Copy Markdown

linear bot commented Mar 13, 2026

@jayscambler jayscambler merged commit 5d9ad03 into main Mar 13, 2026
4 checks passed
@jayscambler jayscambler deleted the feat/ac-235-mutation-log branch March 13, 2026 22:12
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