Repository navigation
Record the verdict when publication decides it; pin contract v1.0.4 (#390) - #392
Merged
Merged
Conversation
The engine now writes an attempt's verdict (outcome plus a short reason) durably into the attempt checkpoint as soon as the publisher returns, before the result comment is confirmed, the issue released or the workspace cleaned up, and emits `outcome_recorded` at that moment, once per attempt. Finalization announces the outcome only when no verdict was recorded (an attempt interrupted before publication returned, or an older checkpoint). A Retained Attempt now keeps that verdict: - `recovery release` finalizes with the recorded verdict instead of inferring one from the workspace, and its release comment names it. - `recovery retry` and startup reconciliation after a restart republish towards the recorded verdict. When that cannot be done safely, or the publisher answers another outcome, retry answers not fulfilled and reconciliation keeps the attempt retained (`recorded_verdict_held`). - Without a recorded verdict, today's inference is unchanged, including the rule from #84 that an unpublished branch is never a success. ADR 0010 records the decision and its relation to #84. CONTEXT.md gains "Recorded verdict" and "Retained Attempt", and the harness docs describe the earlier `after-outcome` hold. The harness test for `recovery release` loses its xfail marker. The pinned producer suite v1.0.3 now passes every verdict check of `recovery-release`. Its last step still fails, because it expects a claim to open without a `release` verb; that is reported upstream as lbacik/agent-operator-contract#39. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
v1.0.4 opens the later Claim of the recovery-release scenario through `set-issue` and `release`, as every other scenario does (lbacik/agent-operator-contract#39). With the recorded verdict in place, the producer suite now passes recovery-release. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Fixes #390
The engine now records an attempt's verdict when publication decides it, and no recovery path recomputes it afterwards (contract §14). With the suite pinned at v1.0.4, the
producerjob passesrecovery-release.Changes
verdictfield) and the outcome into the archive record. This happens before the result-comment check, the issue release and cleanup. Only the first recording counts. Old checkpoints without the field read as "no recorded verdict".outcome_recordedonce per attempt. It is emitted at the recording moment._commit_finalizationemits it only when no verdict was recorded, so an attempt interrupted before publication returned still announces its outcome once. The Contract Event order is unchanged.recovery releasefinalizes with the recorded verdict andlifecycle_state: released. The confirmed release comment names the verdict and--saved-at. It is followed by a plain release (neverround-finished), and the branch is retained.recovery retryrepublishes towards the recorded verdict and finalizes with it. It answersnot_fulfilledand keeps the hold when the verdict is unreachable or the publisher answers another outcome. Two cases are unreachable: ahandoffwhose note is gone, and acompletethe checkpoint no longer shows as publishing, which would push the branch first.infrastructure_errorascomplete. When the verdict cannot be reached, the attempt stays retained for the operator and the engine emitsrecorded_verdict_held.docs/conformance-harness.mdnow says theafter-outcomehold takes effect before the result comment is confirmed.pyproject.tomlnamesagent-operator-contractv1.0.4. That release fixes recovery-release scenario expects a claim to open without a release verb agent-operator-contract#39: the last step ofrecovery-releaseused to expect a Claim without areleaseverb, and it now opens the later Claim withset-issuefollowed byrelease. Harness protocol stays 1.1.uv.lockis gitignored, so only the local lockfile was regenerated. It namesrev=v1.0.4#5e17e8c.tests/test_recorded_verdict.pycovers release, retry, restart and once-only emission. The checkpoint tests cover the new field. Thexfailis removed fromtest_recovery_release_finalizes_a_retained_attempt. One event-order test now expectsoutcome_recordedbefore the error-limit halt. Two retry tests now advance the checkpoint topublishing, as the production publisher does, because the fake publisher does not.Verification
--require-allwith all capabilities: 41 PASS, exit 0, includingrecovery-retryandrecovery-release.--capabilities "": 41 PASS, exit 0.recovery-release(a later eligible issue must open a claim after the release). Every verdict check already passed.tests/test_conformance_harness.pyand the contract tests on v1.0.4: 128 passed.uv run pytestlocally on macOS: 2017 passed, 10 failed. The 10 (test_attempt_processes.py,test_control_offline.py) fail identically on a cleanmainon that machine.🤖 Generated with Claude Code