feat: clean-restart attempt isolation — CCRM retry-contamination fix (#972) - #978
Merged
Conversation
added 2 commits
August 16, 2026 14:53
CCRM borrow (arXiv:2605.08563): attempt-scoped context isolation for multi-attempt workloads. Failed attempts contaminate retry context (~7.1x more error-prone per step); this adds the fix. - digest-sealed transactional context snapshots at attempt boundaries - fence on failure: restore pre-attempt snapshot + inject bounded structured failure summary; failed turns quarantined (fail-closed on leak) - contamination events digest-sealed for observability - attempt-budget allocation via the paper's closed form T* = sqrt(B*log(1/(1-eps1))/log(1/(1-eps0))) - seeded CCRM simulation reproduces the paper's shape: IID overestimates pass@3 by >= 8pp; clean restart recovers it - offline benchmark wired into CI
…engine suites crossed the drift tolerance
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.
Summary
Implements #972 — clean-restart attempt isolation (CCRM arXiv:2605.08563 borrow), the retry-contamination fix for multi-attempt workloads.
src/perseus/retry_isolation.py— deterministic, stdlib-only:snapshot_context/verify_snapshot);build_retry_contextrestores the pre-attempt snapshot + injects a bounded structured failure summary (attempt, step, kind, error — hard token cap); failed turns are quarantined and the builder fails closed if any leak into the restored context;verify_isolation_event);T* = sqrt(B·log(1/(1−ε1))/log(1/(1−ε0)))with derivation inputs for audit;benchmark/retry-isolation/— offline seeded gate: overestimate ≥ 8pp, recovery ≥ 8pp, closed-form exactness, fence demo with quarantine verification. All gates PASS.retry-isolation-benchjob. Docs + CHANGELOG included.Composes with #968: fenced failure summaries feed TRACE attribution as explicit dissatisfaction signals.
Test Plan
tests/test_retry_isolation.py— 17 tests (snapshots, quarantine, budget cap, closed form, seeded simulation, replay)Closes #972