Repository navigation
feat(compaction): L5 auto-compact hardening — breaker + recovery (M4.… - #30
Merged
Merged
Conversation
…5 / v4) The final layer and v4 closeout: two production guardrails around the semantic auto-compact (the irreversible last resort). Circuit breaker — a summarizer failure no longer crashes the run: it is caught, counted, and falls back to deterministic compaction for that turn. After maxL5Failures consecutive failures (default 3) the L5 path is disabled for the rest of the run, so a flapping summarizer can never spin forever (the ~250K-calls-a-day class of incident). Marks query.l5_failure / query.l5_circuit_open. Post-compact recovery — the semantic recap REPLACES the stale region, so the model can forget which files it just touched. After the auto_compact stage actually runs, the loop appends a recovery note (formatPostCompactRecovery) listing the recently touched files, tracked from Read/Edit/Write tool_uses. Append-only (cache-friendly). Marks query.post_compact_recovery. (L5 suppression by collapse already shipped in M4.4.) Framing: myagent's deterministic reclaim is the always-on last resort; the LLM auto-compact stays opt-in but is now guarded — the faithful realization of CC's "auto-compact on by default" given that a default LLM call would break offline determinism. - core: QueryOptions.maxL5Failures; breaker-wrapped auto_compact stage; trackRecentFiles + exported formatPostCompactRecovery; recovery injection gated on ranStages including "auto_compact". - tests: recovery-note format unit; breaker integration (3 throws -> circuit open, run survives + completes); recovery integration (mark carries the latest file). - docs: CLAUDE.md query-loop step 7 + v4 roadmap M4.5 delivered; roadmap banner marks the whole v4 track complete. 241 tests pass (+3); all 10 eval tasks green, fingerprint unchanged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…5 / v4)
The final layer and v4 closeout: two production guardrails around the semantic auto-compact (the irreversible last resort).
Circuit breaker — a summarizer failure no longer crashes the run: it is caught, counted, and falls back to deterministic compaction for that turn. After maxL5Failures consecutive failures (default 3) the L5 path is disabled for the rest of the run, so a flapping summarizer can never spin forever (the ~250K-calls-a-day class of incident). Marks query.l5_failure / query.l5_circuit_open.
Post-compact recovery — the semantic recap REPLACES the stale region, so the model can forget which files it just touched. After the auto_compact stage actually runs, the loop appends a recovery note (formatPostCompactRecovery) listing the recently touched files, tracked from Read/Edit/Write tool_uses. Append-only (cache-friendly). Marks query.post_compact_recovery. (L5 suppression by collapse already shipped in M4.4.)
Framing: myagent's deterministic reclaim is the always-on last resort; the LLM auto-compact stays opt-in but is now guarded — the faithful realization of CC's "auto-compact on by default" given that a default LLM call would break offline determinism.
241 tests pass (+3); all 10 eval tasks green, fingerprint unchanged.