Wire Final PR verify and Abort on phase failure#24
Merged
Conversation
After Iterations stop, run the Final Agent prompt (disclosing Partial Progress when max iterations left work queued) and require an open PR for the Run branch before succeeding.
Match the issue #11 "when there was work" gate so MaxIterations 0 (or any empty done path) does not invoke Final or require a PR.
Failed Implement/Review, missing commits, and timeouts now restore the Ticket to Ready for Agent, reset to the restore point, and return a clear Abort error so the Run does not continue.
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.
Summary
Closes the Run loop endgame that the stub Final left open: after successful Iterations, Ship now runs a real Final Agent phase and requires an open PR for the Run branch (
HasOpenPRviagh). On Implement/Review failure, missing commits, or timeout, the Run Aborts (restore Ticket to Ready for Agent, undo that Ticket's commits, stderr + exit non-zero) and does not continue.Also skips Final when no Iteration succeeded, and discloses Partial Progress in the Final prompt when the Run stops at max iterations with Ready work remaining.
Linked issues
RISK
UndoToRestorePointresets Ticket commits; a buggy restore-point capture could drop more history than intended. Assumes a clean/ship-controlled tree (documented MVP assumption).in-progresslabels (low for merge, annoying for ops):Donecloses the issue but does not clearin-progress; closed Tickets can still show as claimed in label filters.QA — stress-test plan for a human
Happy path
go test ./...(already green on this branch).go build -o ship ./cmd/ship.ready-for-agentTicket, run./shipand confirm stdout shows Iterations, then Final, and that a PR appears for the Run branch (gh pr list --head <branch>).gh pr viewbody/links match Done Tickets when Final opens the PR.Edges / failure cases
ready-for-agent, branch HEAD rewinds to the restore point, stderr containsAbort:, exit code non-zero, no further Tickets/Final.--max-iterations 1while multiple Ready Tickets exist; Final prompt/path should treat Partial Progress../shipshould printNo Ready for Agent Ticketsand exit 0 without creating a branch/PR.Out of scope
in-progress(known label hygiene gap; not part of Final phase: PR side-effect verify and Partial Progress #11/Abort: restore Ticket, undo commits, stderr, timeouts #12 acceptance).Made with Cursor