Skip to content

Add the S8 rollback-for-exhaustion supplement and retain sandbox profiles - #301

Merged
elanthus merged 9 commits into
mainfrom
feat/s8-rollback-supplement
Nov 23, 2026
Merged

elanthus merged 9 commits into
mainfrom
feat/s8-rollback-supplement

Conversation

@elanthus

Copy link
Copy Markdown
Owner

Two owner decisions from 2026-11-22 on the S8 review. This PR is stacked on #300 and targets its branch; retarget it to main after #300 merges. Nothing here is executed against a counted qualification, and no verdict is declared.

Why

Step 6 of the rehearsal asks preparation to refuse a rollback toward exhausted B. In the executed rehearsal the rollback lineage rule refused first, with candidate_id: null, and it would have refused the same way if B had capacity left. Repeating that sequence cannot separate the two causes. The review also found that the five worker records kept profile digests but not the profile bytes.

Rollback-for-exhaustion supplement

pixelgym/platform/s8_rollback_supplement.py adds the scenario rollback-exhaustion-supplement-v1:

  1. Register A and B.
  2. Approve and deploy B, complete the golden episode, and probe until the cap seals at 24.
  3. Approve and explicitly deploy A. The step records that B is the rollback target before any rollback is requested.
  4. Request a rollback. Preparation selects B, sends its contract smoke, and refuses because B's cap is exhausted. The step records B's candidate ID, the StatefulLoadError, the deployment.rollback_failed audit event naming B, A's unchanged deployment ID, B's unchanged count, and the smoke sends before and after.
  5. Stop everything; the final pointer still selects A.

Expected durable sends: qualification 77, B 24, smoke 3 (deploy B, deploy A, and the refused rollback's preparation), A 0; total 104 of the 111 campaign cap.

prepare --scenario rollback-exhaustion-supplement-v1 writes a plan that names the scenario and requires an approval document with a matching scenario field. The full rehearsal's approval has no such field, so neither approval can stand in for the other. run, verify, and report read the scenario from the plan.

The scenario subclasses the rehearsal driver and duplicates the golden-episode and cap-probe loops instead of refactoring the executed steps, so the full rehearsal's step code is unchanged apart from reading its step order from the instance.

Sandbox-profile retention

  • The Darwin launcher exposes the exact profile text it hands to sandbox-exec.
  • The S8 driver stores it in the private state directory as worker-profiles/<sha256>.sb and records profile_retained on each worker event.
  • Verification refuses a missing, altered, or unreferenced profile.
  • Runs sealed before this change carry no retention field and verify exactly as before.

Owner decision recorded

The owner accepts the existing unit regressions as coverage for a live episode that crosses a deployment change. The S7 proposal and the S8 driver doc record this as an explicit exception to integrated evidence.

Checks

  • The November rehearsal state still verifies with this code, and its report renders to the same SHA-256 (d3a1d99b28cea8fd30214599e526a927efcab63ec8bc2804b40e8f06cfaaa2b1).
  • Local preflight on 2209899e: a self-review by the agent that wrote the change recorded no findings. Lint, format, and mypy pixelgym passed. Fast suite counts are in the comment below.
  • Opt-in tests/integration/test_s8_rehearsal_local.py with the real Darwin sandbox, run at e69439bf: 2 passed in 69.57 s. It covers the full rehearsal with five retained profiles and the supplement with two.

Limits

  • The supplement has not run against a counted qualification. Running it needs the owner's approval of a fresh S7 qualification (77 fake sends) and a signed approval document carrying the scenario field.
  • A worker that preparation starts and then discards, such as the one behind the refused rollback, is not the active worker and leaves no proof or profile.
  • Profile retention covers S8 worker events only. The S7 qualification's own workers still record digests without bytes.
  • The November rehearsal's profile bytes were never captured and cannot be recovered from the digests.
  • Unit tests use an unenforced local launcher and are not isolation evidence.

This is an audit trail; it replaces neither CI nor a human review.

The Darwin launcher now exposes the exact profile text it hands to
sandbox-exec. The S8 driver stores it in the private state directory, named
by its digest, records whether each worker event's profile was retained, and
verification checks the stored bytes against the recorded digests. Runs sealed
before this change carry no retention field and verify exactly as before.
The full rehearsal's rollback toward exhausted B was refused by the rollback
lineage rule, so it did not show the exhaustion check. The supplement exhausts
B, explicitly deploys A so that B is the eligible rollback target, then
requests a rollback. Preparation selects B and refuses because its cap is
exhausted; A stays active. Expected sends: B 24, smoke 3, A 0.

The plan and the owner approval must both name the scenario, so neither
approval can stand in for the other. Verification, sealing, and the report
are reused; the full rehearsal's outputs are unchanged. Not executed against
a counted qualification.
@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

Next included review available in 26 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available. Your 55 included PR review attempts over the past 7 days set your current allowance at 2 reviews per hour.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: c445485b-f484-40b6-9714-464d66f9a74c
Commits

Reviewing files that changed from the base of the PR and between fb4a6dd and 0d64b65.

Files selected for processing: 10

  • docs/platform-design.md
  • docs/s7-serving-demo-proposal.md
  • docs/s8-rehearsal.md
  • pixelgym/platform/policy_subprocess.py
  • pixelgym/platform/s8_rehearsal.py
  • pixelgym/platform/s8_rollback_supplement.py
  • scripts/s8_rehearsal.py
  • tests/integration/test_s8_rehearsal_local.py
  • tests/unit/platform/test_s8_rehearsal.py
  • tests/unit/platform/test_s8_rollback_supplement.py
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@elanthus

Copy link
Copy Markdown
Owner Author

Fast suite in the local preflight run on 2209899e: 3787 passed, 6 skipped in 316.52 s.

@claude

claude Bot commented Nov 22, 2026

Copy link
Copy Markdown

Code review

No high-confidence issues found. Checked correctness, edge cases, security, and repository-specific requirements.

Reviewed pixelgym/platform/s8_rollback_supplement.py, the scenario/lifecycle_steps/expected_sends plumbing added to prepare()/bind_approval()/Rehearsal in pixelgym/platform/s8_rehearsal.py, the sandbox-profile retention path (retain_profile, verify_retained_profiles, the new profile_text field on LaunchedPolicyWorker/PolicyWorkerLauncher in policy_subprocess.py), and the CLI wiring in scripts/s8_rehearsal.py. Traced the step-ordering guard, the backward-compatible handling of pre-retention lifecycle.json/verification.json records (no profile_retained key), the cap-probe arithmetic against the documented 20-action golden episode and 24-send cap, and the worker-proof bookkeeping that intentionally omits a proof for the discarded rollback worker. All of it is internally consistent with the PR's own description and the documented AGENTS.md/CLAUDE.md human-gate requirements (no verdict asserted, owner approval required and schema-bound to the scenario, no secrets or credentials introduced).

… checks

- The preparer raises StatefulLoadError for several causes, and the audit row
  keeps no message for it. The supplement step and inspect_supplement now also
  require the exhaustion message recorded in the sealed lifecycle, so a worker
  that failed to start on B is not recorded as refused by exhaustion.
- A newer full rehearsal with a required OS sandbox must have retained every
  worker profile, as the supplement already requires; runs sealed before
  retention carry no key and verify as before.
- verify_retained_profiles refuses a malformed digest, a symlinked directory,
  and entries that are not regular files with ValueError.

Regressions cover each case and fail against the previous code.
@elanthus
elanthus changed the base branch from fix/s8-strict-recovery-verify to main November 23, 2026 00:13
@elanthus
elanthus merged commit 636eb85 into main Nov 23, 2026
8 checks passed
@elanthus
elanthus deleted the feat/s8-rollback-supplement branch November 23, 2026 18:10
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.

1 participant