Repository navigation
The Spec run owns its lifecycle to its Delivery, tested in-process behind its seam - #420
Merged
Merged
Conversation
…hind its seam (#419) The Spec run's seam grows the Spec PR's last landing, which returns its URL, the Spec PR's URL if open, the put-back of the Tickets checklist and the Delivery, given its Opening and a step before ready that takes the seam. run_through holds every rule from the Ticket loop to the ending: the Spec review's Opening, the put-back before ready, the checklist shown again after a failed Delivery, and the Failed spec run of a failed landing, which now asks the seam whether it was interrupted. The real adapter owns the worktree, the Delivery and the Spec PR, and hands the first two over when the Delivery starts. The entry point only resumes the Spec PR, builds the adapter and calls run_through. The two end-to-end tests on the checklist being put back are replaced by in-process ones. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…landing, and a Delivery failing before the put-back Telling the Spec PR the last Ticket landed is part of the landing, so if it fails, the Failed spec run is built explicitly too, asking the seam whether it was interrupted. The scripted Delivery can fail in its opening session, before the put-back, and a test shows the checklist again then. The Opening's kind in tests is SPEC_REVIEW, and a shorter test name. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged
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
The Spec run's whole lifecycle, from the Ticket loop to its ending, now lives in one function,
run_through. It reaches everything outside itself through the Spec run's seam.The seam (
Outside) gainslanded -> String,spec_pr_url,put_backanddeliver(opening, before_ready: FnOnce(&mut Self)). When the Delivery starts, the adapter takes the worktree and the Delivery out of theirOptions and lends itself to the put-back.Evidence
Before: only the end-to-end Spec run tests checked the Spec review's Opening, the put-back before ready, the checklist shown again after a failed Delivery, and the Spec PR's URL on a failed landing.
After: these in-process tests use the scripted fake:
Two end-to-end tests are deleted because their assertions are now covered in-process:
the_spec_review_writes_the_spec_pr_body_and_the_checklist_is_put_back_after_ita_failed_spec_review_that_rewrote_the_body_has_the_checklist_put_back_in_the_draftThe exact final body is still asserted end-to-end by
a_spec_review_whose_resume_ends_with_killed_background_work_still_delivers_the_spec_pr.cargo testpasses in full andcargo clippy --all-targetsis clean.Merge Danger
Door: two-way
A refactor with no behaviour change: stderr, the Spec PR, the notification and exit codes are unchanged.
Blast Radius: Spec runs
Unaddressed findings
Standards
FailedRunduplicatesFrom<anyhow::Error>: skipped. The spec asks for the Failed spec run to be built explicitly, reading the interrupt through the seam, not through that conversion.spec, base, branch: skipped. The spec's decision is that the lifecycle takes these as plain arguments.SpecPr: skipped. The spec decides on one seam carrying exactly these methods, andlandedreturning the URL.Options withexpect, andspec/base_fix/harnesscopied out of the stored Delivery: skipped. TheOptionhand-over is the spec's chosen design. The copies avoid borrowing the Delivery the adapter must later give away.deliverbuildsReachedandFailedRunwith the same constants: skipped. The duplication is two lines of test data and reads clearly.Spec
None skipped.
Closes #419
🤖 Generated with Claude Code