Repository navigation
Releasing a Claim, and removing it when thirdshift closes the issue - #294
Merged
Merged
Conversation
…ue closed A Run or a Spec run that fails with nothing on origin to take over, no Issue branch or Spec branch and no pull request, puts its issue's labels back as they were before the Claim. A Merge run takes in-progress off once the issue is closed. Either failing is a warning naming the command to run by hand. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… labels path, clearer names in the Claim, more release cases, the Self-merge's glossary entry Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
src/claim.rs: the Claim a run makes and releases, from this branch, beside is_on, which the Pickup run asks whether an issue carries a Claim. The two branches each lifted the same label test out of label_in_progress; it stays one function under this branch's name, has_label, and is_on is what asks about in-progress. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 1, 2026
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
What becomes of a Claim when the Run or Spec run that made it ends, decided in one place (
runinsrc/run.rs), with the label work insrc/claim.rs:Neither can fail the run: a failure is a
warning:line naming the command to run by hand, and an interrupt doesn't stop them. A Ticket's Run and a Base fix make no Claim, so they release and remove nothing.Seam tested: the
thirdshiftbinary against the fakeghand fakeclaude(the existing one). The fakeghgainsgh api --method DELETE repos/<repo>/issues/<n>/labels/<label>.Supporting moves:
warn→progress::warnandretry_if_interrupted→interrupt::retry_if_interrupted, now that the Claim uses them too;Git::on_originshared withWorktree::delete_from_origin.Evidence
a_failed_run_that_pushed_nothing_releases_its_claima_merge_run_ends_with_the_issue_closed_and_its_claim_removedcargo test→ 655 passed, 0 failed;cargo clippy --all-targets -- -D warningsandcargo fmt --checkclean.failed_run:a_failed_run_that_pushed_nothing_releases_its_claimready-for-agentbefore, none gainedfailed_run:a_released_claim_gives_no_ready_for_agent_to_an_issue_that_had_noneorigin: releasedfailed_run:an_interrupted_run_that_left_nothing_on_origin_releases_its_claimfailed_run:a_failed_run_that_pushed_its_issue_branch_keeps_its_claimfresh_run:a_run_that_ends_with_its_pr_ready_for_review_keeps_its_claimspec_run:a_spec_run_that_left_no_spec_branch_on_origin_and_no_spec_pr_releases_the_specs_claim,a_failed_spec_run_whose_spec_branch_is_on_origin_keeps_the_specs_claim,a_failed_spec_run_that_left_a_spec_pr_keeps_the_specs_claimin-progressmerge_run:a_merge_run_ends_with_the_issue_closed_and_its_claim_removedspec_run:a_merge_run_of_a_spec_ends_with_the_spec_closed_and_its_claim_removedwarning:with the commandmerge_run:a_failed_claim_removal_still_exits_as_merged_with_a_warningMerge Danger
Door: two-way
Reverting restores "the label stays, whatever the outcome". Labels already put back or removed on real issues stay as they are, and can be relabelled by hand.
Blast Radius: labels
Every Run and Spec run that makes a Claim now makes one to three more
ghcalls when it ends merged or failed. A wrong release would make an issueready-for-agentagain, which matters once a Pickup run exists to take it; until then the label is only read by people.Three choices worth a look in review:
needs-info) survives. An issue whosein-progresssomeone took off during the run is left alone.in-progressis removed after a Self-merge whether thirdshift or GitHub closed the issue, and stays if the issue is still open because closing it failed.origin, so its Claim is released while its work sits in the kept worktree. That is the rule as written; the README says so, and that the local Issue branch stops the next Run on that machine at the pre-flight checks.Unaddressed findings
Standards
src/claim.rs). The two facts are independent, each with its own undo (takein-progressoff; putready-for-agentback). An enum of their four combinations would need the same matches in the same three places.add_label_commandhas no function counterpart, so the by-hand command can drift from the code. The code releases with onePUTof every label, which a by-hand command can't spell without knowing the issue's other labels;POSTof the one label is the by-hand equivalent. The path is now shared (labels_path), and the doc comment says why they differ.run_in_worktreetakes nine parameters. It follows the five othertoo_many_argumentssites around it; bundlingissue, base, goal, base_fix, logsis a refactor ofimplementandspec_run::runtoo, beyond this Ticket.Spec
in-progress", and a merge into the default branch is the case where GitHub closes it.in-progresswas taken off is left alone, beyond "puts the labels back as they were". Kept: writing back the old list would wipe aneeds-infosomeone added during a Spec run that lasts hours, and make the issueready-for-agentagain.warning:naming commands, which the issue asks for only on removal after a merge. Kept: without it a release that failed would be silent, and the issue strandedin-progresswith no hint.a_spec_run_claims_the_spec_and_its_tickets_runs_change_no_labelalready ends ready for review and asserts the Spec isin-progress; a Run now has its own named case.Closes #281
🤖 Generated with Claude Code