Skip to content

fix(goal): finish the plan before a claim ends the run, and seal a resume - #667

Merged
ion-alpha-dev merged 1 commit into
mainfrom
fix/resume-finishes-and-seals
Nov 4, 2026
Merged

ion-alpha-dev merged 1 commit into
mainfrom
fix/resume-finishes-and-seals

Conversation

@ion-alpha-dev

Copy link
Copy Markdown
Collaborator

What

Without --require-proof, a planned goal no longer ends on the model saying it is done while ledger items are still open: the claim is held and the next item is briefed. A run continued with flynn resume is now sealed when it ends.

Why

TestLiveResumeAfterAHardKill failed every time on Windows with openai:gpt-5-mini, on main and before #666. The model is briefed on one item at a time, so after a hard kill the resumed run redid its first item, said "Done", and converged with the other two items never attempted. The same thing can happen on a fresh run whenever an item's check passes quickly and the model then claims completion.

Separately, resumeRun drove the goal on the plain log with no recorder and never sealed, so flynn spine verify refused every resumed run with "has no signed record and no checkpoint".

How to verify

  • go test ./goal/ -run 'TestAClaim|TestTheProducerRunsBeforeTheRefusalDoes': a claim waits for an item nobody tried, an item whose check could not run is moved past when the claim arrives, and --require-proof still stalls.
  • go test ./mission/ -run 'TestAHeldClaim|TestAReopened|TestAFinishedPlan': the executor reopens a finished conversation on the next item, never sends a request ending on the assistant, and leaves a settled plan alone.
  • go test ./cmd/flynn/ -run 'TestAResumedRunIsSealed|TestAnInterruptedResumeIsLeftOpen'.
  • Live: FLYNN_E2E_REAL=1 FLYNN_E2E_REAL_MODEL=openai:gpt-5-mini go test ./e2e/ -run TestLiveResumeAfterAHardKill -count=3 passes 3 of 3 against a binary from this branch (0 of 3 on main).

Turning off either new rule in goal/ledgerloop.go fails its test.

Notes for reviewers

  • Behaviour change: a run without --require-proof now makes more model turns when it claims completion early, bounded by the existing repeat limit (two identical check failures move past an item) and the step budget. TestTheProducerRunsBeforeTheRefusalDoes encoded the old behaviour (claim honoured with an item never tried) and was updated so its second item is settled.
  • An item whose check could not run is abandoned only when the model claims completion, so a run still working on it keeps its chance.
  • A resume interrupted with Ctrl-C is not sealed and gets no stopped outcome, because it can be resumed again.
  • The unit tests call sealResumed directly; the live resume test is what shows resumeRun calls it.
  • Locally, osv-scanner reports GO-2026-5932 in golang.org/x/crypto 0.58.0, which is unchanged from main; its reachability pass could not run on this machine's toolchain, and govulncheck finds no reachable call. Main's CI passed on 2f7bd9b.

…sume

Without --require-proof a planned goal converged on the model's end of
turn, even with ledger items it had never attempted. The model is
briefed on one item at a time, so a run resumed after a hard kill redid
its first item, said it was done, and stopped with the rest of the plan
untouched (TestLiveResumeAfterAHardKill failed every time on Windows
with gpt-5-mini).

A completion claim in that mode is now held while an item is neither
proven nor abandoned, and the executor reopens the conversation and
briefs the next item. When the claim arrives and the open item's latest
check could not be run at all, the item is abandoned instead: a refused
check is never counted as a repeat, so holding the claim for it would
spin until the no-progress guard stalled the run. --require-proof is
unchanged and still stalls on an unproven item.

flynn resume drove the run on the plain log and never sealed it, so
flynn spine verify refused every resumed run. Resume now loads the
instance signer and seals from the durable stream, recording a stopped
outcome first. A resume interrupted with Ctrl-C is left open, since it
can be resumed again.

Signed-off-by: Ion Alpha <contact@ionalpha.io>
@codecov

codecov Bot commented Nov 3, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.74074% with 5 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
cmd/flynn/spine.go 84.21% 3 Missing ⚠️
cmd/flynn/main.go 83.33% 1 Missing ⚠️
goal/ledgerloop.go 94.44% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@ion-alpha-dev
ion-alpha-dev merged commit e2b2d18 into main Nov 4, 2026
34 checks passed
@ion-alpha-dev
ion-alpha-dev deleted the fix/resume-finishes-and-seals branch November 4, 2026 09:30
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 4, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant