Files
d5aa6d1a1f feat(engine): autopilot ledger — capture findings + skip provably-wasteful agent calls (#57)
* docs(spec): engine-native cross-engagement memory (the ledger)

Design for auto-capturing cross-target hunt memory from the engine's
structured state.json at existing phase transitions, with recall that feeds
back into surface ranking (+ negative memory to prune dead classes).
Original design on our engine; replaces the dangling vendored memory commands.

Co-Authored-By: Claude Opus 4.8 <[email protected]>

* docs(spec): scope ledger to Option A — autopilot token-saving only

Cut the interactive recall->ranking loop (marginal value, complexity in the
engine hot path). Scope memory to the autonomous hunt loop: capture confirmed
findings + negatives, then skip provably-wasteful agent calls (known-confirmed
carry-forward + dead-class) in token-saving modes only. Coverage-safe:
--paranoid ignores memory, skips are gated + logged, unseen classes never skipped.

Co-Authored-By: Claude Opus 4.8 <[email protected]>

* docs(plan): autopilot ledger implementation plan (6 tasks, TDD)

Co-Authored-By: Claude Opus 4.8 <[email protected]>

* feat(engine): add autopilot ledger store + capture (record_finding/record_run)

* feat(engine): ledger skip_decision (known-confirmed/dead-class) + rollup + gc CLI

* feat(engine): capture confirmed findings + run rollup into the ledger

* feat(engine): gated ledger skip filter in hunt loop + --use-memory flag

* docs(commands): rewrite memory commands to the autopilot ledger

* docs(autopilot): drop second stale hunt-memory/audit.jsonl reference

* docs(surface): replace hunt-memory terminology with ledger

* docs(credits): ledger is original work, not vendored

* docs(credits): fix command counts — 15 shipped vs 12 vendored

* fix(engine): guard capture I/O + rotate under a stable lockfile (final review)

Finding 1: memory.record_finding/record_run calls in validate()/report()
now wrap in try/except so a ledger I/O error (unwritable dir, disk full)
logs and continues instead of aborting the run after state.json was saved.

Finding 2: _append() now acquires an exclusive flock on a stable
<path>.lock file BEFORE calling _rotate_if_needed, closing the
cross-process rename race where two engines could interleave rotation.

* docs(usage): document --use-memory autopilot flag (ledger shipped)

Mark the 'per-engagement memory' next-iteration as delivered; add the
--use-memory usage + the /autopilot mode mapping and coverage-safety note.

Co-Authored-By: Claude Opus 4.8 <[email protected]>

---------

Co-authored-by: Sachin Sharma <[email protected]>
Co-authored-by: Claude Opus 4.8 <[email protected]>
2026-08-09 01:09:16 +05:30
..