Repository navigation
The Claim owns its lifecycle, tested in-process behind a seam - #383
Merged
Merged
Conversation
The Claim module is made, then ended once with the goal the run reached or none for a Failed run, and decides there whether to remove, keep or release the Claim. It reaches GitHub, origin, the interrupt flag and progress lines through a private Outside seam with an OnGitHub adapter and an in-memory fake, so its rules, the retry while interrupted included, have unit tests. End-to-end tests that only checked a Claim rule give way to them, one per wiring path staying. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Tests assert only on the calls and labels the fake records, not on the Claim's private fields; the issue's state crosses the seam as a named struct; the private Claim record is Claimed; the Merged unit test checks the labels left. 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 Claim now handles its whole lifecycle. The Run makes it, then hands it the goal the run reached, or none for a Failed run. The Claim decides what that means.
Progress lines, warnings and the requests sent are unchanged.
Evidence
gh,gitandclaude, and the retry while interrupted could only be reached by sending a signal to a real process.After: 19 unit tests in
claim::testsuse the in-memory fake and cover making the Claim, ending it as Merged, Ready for review and Failed, the warnings with their commands to run by hand, and a failed step tried once more while interrupted. For example:cargo test(32 suites, all pass),cargo clippy --all-targetsandcargo fmt --checkare all clean.Merge Danger
Door: two-way
This is a refactor inside one module plus its single caller. Nothing persistent or user-facing changes.
Blast Radius: labels
If the wiring were wrong, issue labels (
in-progress,ready-for-agent) could be left wrong at the end of a Run or a Spec run. The wiring tests that remain cover making, keeping, releasing and removing the Claim.Unaddressed findings
Standards
retry_if_interruptedrepeatsinterrupt::retry_if_interrupted): the Claim's copy has to ask the seam whether the run was interrupted, and it passes the same&mutoutside to both the step and that question. Sharing one helper would mean closures that borrow the seam twice, while the helper itself is only two lines.delivery.rskeeps the original.Option<Goal>,None= Failed): the issue chose this on purpose: "The outcome is given as the Goal reached, or none for a Failed run."Claim::endwrapsClaimed::end): this split lets unit tests useClaimedwithout aGitfor the Launch directory.Claimonly binds the production adapter.fail_ifuses only the first entry per call: this is test-only and no test sets the same call to fail twice.Spec
an_issue_github_closed_after_the_merge_has_its_claim_removed_toomainly checks that the Delivery skipsgh issue closeon an issue GitHub has already closed. That is not a Claim rule, so it stays.in-progresslabel in the repository stay infresh_run.rs: they check howEditadds a missing label to the repository, which is a labels rule rather than a Claim rule, and the fake can't reach it.Closes #382
🤖 Generated with Claude Code