Skip to content

Hold after-outcome past finish-attempt, find grown archives, replay the halt (#384) - #387

Merged
lbacik merged 1 commit into
mainfrom
fix/issue-384-harness-holds-archive-halt
Nov 10, 2026
Merged

lbacik merged 1 commit into
mainfrom
fix/issue-384-harness-holds-archive-halt

Conversation

@lbacik

@lbacik lbacik commented Nov 10, 2026

Copy link
Copy Markdown
Owner

Fixes #384

Makes sealed-after-outcome, export-torn-read and halt-records-last-halt pass in the producer suite.

Changes

  • finish-attempt keeps an after-outcome hold. It clears only a hold that blocks the model execution (after-claim, native-phase) and returns once the engine waits with the outcome recorded. The next release waits until status shows the attempt finished, so its sealed event is already there.
  • grow-archive finds the archive of a contract Attempt ID. It uses the engine's own find_run_directory, skips Sealed archives and never grows attempt.json.
  • The halted Contract Event survives a restart. A start seeds the Contract Event buffer from the durable halt record before anything else is emitted, in production main and in the harness. No record seeds nothing.

Deviations from the brief

  • The after-outcome hold moved from the publisher gate to right after outcome_recorded. At the gate the outcome was not in the archive record yet, so the scenario could not pass there.
  • One extra engine change: attempts show and attempts list now carry an outcome already in the archive record for the active Attempt (attempt_history.py). Without it the suite cannot see the outcome while held. In production an active Attempt can briefly show its outcome while finalization still writes.
  • test_harness_smoke_reaches_every_state now uses an after-claim hold; it relied on the old behaviour.

Verification

  • Producer suite in Docker, both variants (--require-all with all capabilities, and --capabilities ""): 37 PASS, 4 FAIL. The three target scenarios pass. The four failures (recovery-retry, recovery-release, errors-reset, offline-reads) fail identically on main, where 7 failed; they are out of scope here, so the producer job stays red.
  • uv run pytest locally on macOS: 1972 passed, 10 failed. The 10 (test_attempt_processes.py, test_control_offline.py) fail identically on a clean main on that machine.

Open points

  • The halt record is never erased, so halted is replayed on every later start, not only the first one, with its original time. This matches last_halt.
  • halt issued while the engine waits in an after-outcome hold fails (the old publisher gate behaved the same), and an after-outcome hold survives an engine restart until the next release.

🤖 Generated with Claude Code

…he halt (#384)

Three producer-suite scenarios failed: sealed-after-outcome,
export-torn-read and halt-records-last-halt.

- finish-attempt removed every hold, so an after-outcome hold never
  applied. It now clears only a hold that blocks the model execution and
  returns once the engine waits with the outcome recorded. The hold moved
  from the publisher gate to right after outcome_recorded: at the gate the
  outcome was not in the archive record yet. release then waits until
  status shows the attempt finished, so its sealed event is there.
- The live summary of an active Attempt dropped an outcome already in the
  archive record. attempts show and list now carry it, so an Attempt reads
  active and unsealed with its outcome while finalization still writes.
- grow-archive matched the contract Attempt ID against the sanitised
  directory name and never found it. It now uses the engine's own
  find_run_directory, skips Sealed archives and never grows attempt.json.
- The halted Contract Event died with the in-memory buffer. A start now
  seeds the buffer from the durable halt record, before anything else is
  emitted, so recent_events stays oldest first. No record seeds nothing.

Fixes #384

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@lbacik
lbacik merged commit e61fdea into main Nov 10, 2026
6 of 7 checks passed
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.

Producer suite: after-outcome hold, grow-archive lookup and halted event across restart

1 participant