Skip to content

feat: clean-restart attempt isolation — CCRM retry-contamination fix (#972) - #978

Merged
tcconnally merged 2 commits into
mainfrom
feat/perseus-972-retry-isolation
Aug 16, 2026
Merged

feat: clean-restart attempt isolation — CCRM retry-contamination fix (#972)#978
tcconnally merged 2 commits into
mainfrom
feat/perseus-972-retry-isolation

Conversation

@tcconnally

Copy link
Copy Markdown
Collaborator

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:
    • transactional checkpoints: digest-sealed context snapshots at attempt boundaries (snapshot_context/verify_snapshot);
    • fence on failure: build_retry_context restores 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;
    • contamination events — digest-sealed, replayable (verify_isolation_event);
    • attempt-budget allocation — the paper's closed form T* = sqrt(B·log(1/(1−ε1))/log(1/(1−ε0))) with derivation inputs for audit;
    • seeded CCRM simulation — IID vs contaminated cascade vs clean restart at the ~7.1x cascade ratio: IID overestimates pass@3 by 10.63pp, clean restart recovers all of it (clean-restart dominance in simulation). The paper's SWE-bench numbers: 17.4pp overestimate, cascade ratio 7.1.
  • benchmark/retry-isolation/ — offline seeded gate: overestimate ≥ 8pp, recovery ≥ 8pp, closed-form exactness, fence demo with quarantine verification. All gates PASS.
  • CI — new retry-isolation-bench job. Docs + CHANGELOG included.

Composes with #968: fenced failure summaries feed TRACE attribution as explicit dissatisfaction signals.

Test Plan

Closes #972

Hermes Research 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
@tcconnally
tcconnally merged commit a33591e into main Aug 16, 2026
19 checks passed
@tcconnally
tcconnally deleted the feat/perseus-972-retry-isolation branch August 16, 2026 15:07
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.

feat(context): clean-restart attempt isolation to stop retry contamination (CCRM 2605.08563)

1 participant