codeburn/src/guard
AgentSeal ad471f3d8c feat(act): realized savings measurement (codeburn act report) (#606)
Capture a trailing-14-day before-baseline when a fix is applied and
re-measure it against the post-apply window so optimize can show realized
numbers next to estimates.

- ActionBaseline (windowDays, capturedAt, estimatedTokens, sessions, metrics)
  persisted by runAction; captured in the optimize --apply flow and at guard
  install time.
- codeburn act report [--json]: applied, not-undone actions older than 3 days,
  re-running the detectors over apply-date-to-now (capped 30 days). Per-kind
  realized deltas: MCP/archive tokens-per-session times saved sessions with
  reverted-by-user detection; read-edit deficit reduction; guard yield split
  labeled correlation. Bash cap is marked not measurable (result sizes are not
  retained). Low confidence under 20 post-window sessions or past a 2x volume
  shift. Realized numbers rounded down, estimate kept visible.
- optimize gains one header line only when a measured action exists, and
  appends "(previously applied <date>, re-flagged)" to re-triggered findings.
  No change for users with no applied actions.

Reuses scanAndDetect helpers over a date-bounded range; exports the token
constants and read/edit tool sets rather than duplicating the math.
2026-07-03 13:04:37 +02:00
..
cli.ts feat(act): realized savings measurement (codeburn act report) (#606) 2026-07-03 13:04:37 +02:00
flags.ts feat(guard): opt-in session-time hook pack for Claude Code (#605) 2026-07-03 11:54:04 +02:00
hooks.ts fix(guard): dedupe streaming message copies in the incremental cost fold 2026-07-03 12:32:46 +02:00
settings.ts feat(guard): opt-in session-time hook pack for Claude Code (#605) 2026-07-03 11:54:04 +02:00
store.ts fix(guard): dedupe streaming message copies in the incremental cost fold 2026-07-03 12:32:46 +02:00
usage.ts fix(guard): dedupe streaming message copies in the incremental cost fold 2026-07-03 12:32:46 +02:00