Repository navigation
Deepen Delivery's stage into one module that records both Recovery and the Command record - #866
Merged
Merged
Conversation
…mand record Delivery's steps and the Repair loop now name each stage they enter through their Outside seam, and one table in src/delivery/stage.rs maps it to the Stopped at: stage and, where there is one, the Command record stage. The adapters stop setting stages by hand. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Address the review: the opening's kind, its catch-up from origin and its stage all follow from OpeningSession, the Tracker reads its table once, and the Security hold's tracker method says what it does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Open
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
Delivery now owns its stage in one module. Delivery's steps and the Repair loop name each stage they enter through their
Outsideseam. One table maps each stage to theStopped at:stage and, where there is one, the Command record stage. The adapters no longer set stages by hand.Stopped at:The adapters' work moves into the steps and the loop:
The Repair budget gate enters a Repair loop round rather than a Repair session. Exhausted repairs start no session, so they still record no "Repair" Command record stage, as on main. A Security hold still reports
Stopped at: Security reviewthroughTracker::stop_at_security_review, without recording anything.The tests go at these seams:
stage::Tracker(inline tests insrc/delivery/stage.rs), with the in-memoryRecordedadapter. They check the table, the collapsing of a repeated stage and the Security hold.Outside, through itsScripteddouble. The double keeps astageslist apart from its call log, so the existing call-sequence assertions are unchanged.Outside, through itsScripteddouble, which keeps astageslist the same way.Evidence
The new inline tests pass. Each one's expected stage comes from the issue's table:
Scripteddouble ignored stages (fn stage(&mut self, _: Stage) {}), and no test covered the mapping between the two vocabularies.cargo testpasses in full: all 52 test binaries ok.cargo clippy --all-targetsandcargo fmt --checkare clean. No integration test changed.Merge Danger
Door: two-way
This is a behaviour-preserving refactor with no persisted format change. The table reproduces main's pairs, and the Spec reviewer traced every failure point against main.
Blast Radius: status
If a pair were wrong,
thirdshift status, the Console and theStopped at:line of a Failed run's ending would show the wrong stage. It would not change what a Run does.Review
The review used
thirdshift-code-reviewwith main as the fixed point. Neither axis reported a finding that says behaviour is wrong. Fixed after the review:Openingdata clump.kind,stageandcatch_up_from_originare now one fact,OpeningSession.Tracker::new.security_holdis renamedstop_at_security_review.delivery::Stageis narrowed topub(super).Every changed file was read by both reviewers.
Unaddressed findings
Standards
InWorktree::stageandRunOutside::stageare untested). Those adapters are the single lineself.tracker.enter(stage)over a real worktree and GitHub, which inline tests cannot drive. The issue's "Inline tests cover" list asks for the table at the module's own seam and the stage order at bothScripteddoubles. Both are done.outside.stage(X)with its call. The issue's decision "The steps name the stages; the adapters stop" settles this.stage(SelfMerge)intake_to_goal(src/delivery/repair_loop.rs,outside.stage(Stage::SelfMerge)beforeoutside.merge). The issue requires the call ("The loop calls it before: … the Self-merge"), and its decision "Keep the stage recording idempotent and call it on every entry" covers the repeat.Stagetypes (Mysterious Name). The issue's first criterion says the module "owns a DeliveryStageenum". The type is nowpub(super), so onlysrc/delivery/sees it.Stage::records()returns an unnamed tuple. It is private tosrc/delivery/stage.rs, used once inTracker::enter, and its doc comment names both halves.stageadapters. The issue requires them: "InWorktreeandRunOutsideimplementstageonce each, by entering the tracker."stopped_atfree function into the tracker. Recognising aSecurityHolderror stays insrc/delivery.rs, besidefail'skeep_readycheck on the same error types. The tracker offers the one-case method the issue asks for.Spec
Delivery::deliver.deliverseeds its tracker withTracker::new(opening.session.stage(), CommandLog), the sameOpeningSession::stagethe test helper uses, so the two cannot drift apart. Driving the realdeliverneeds a real worktree and GitHub. The issue's list of inline tests is met.Closes #865
🤖 Generated with Claude Code
Built with claude · claude-opus-5-5 · medium
Security review outcome
No unaddressed introduced findings.