Skip to content

The Claim: a Run or Spec run marks its issue in-progress - #291

Merged
JacobStephens2 merged 3 commits into
issue-212from
issue-280
Oct 1, 2026
Merged

JacobStephens2 merged 3 commits into
issue-212from
issue-280

Conversation

@JacobStephens2

Copy link
Copy Markdown
Owner

Summary

The Claim: a Run or a Spec run labels its issue in-progress, in place of ready-for-agent, once its preflight checks pass and before its worktree is created.

 run(issue, started_by)
   preflight checks, Tickets, Issue branch selection, Base branch check
   launch pull
+  if started_by.makes_claim()        # not a Ticket's Run in a Spec run, not a Base fix
+    claim::make(issue)               # a failure stops the Run here, before any work
   create the worktree
   Spec run, or the implement session
claim::make(issue)
  read the issue's labels
  if in-progress and not ready-for-agent
    return                            # already Claimed: no request
  create in-progress in the repository, if it lacks it
  one PUT: the labels kept, minus ready-for-agent, plus in-progress
  • An Architect run's dispatch goes through the same run, so the Architect plan ends architect-plan and in-progress.
  • github::set_labels_adding is now the one home for "these labels, plus those, in one request", shared with the Architect run's mark-ready step.
  • The README has a section on the Claim, and its Architect run section says the dispatched plan is in-progress. thirdshift help has a paragraph on it too.
  • The fake gh needed nothing new. The test support gained repo_has_labels, repo_labels and gh_fails.

Evidence

  • Before: the new cases fail on issue-212, for example:

    a_fresh_run_claims_the_issue_in_place_of_ready_for_agent_and_keeps_its_other_labels
      left: ["bug", "ready-for-agent", "architecture"]
     right: ["bug", "architecture", "in-progress"]
    

    After: cargo test --no-fail-fast passes in full (104 unit tests and every integration test file), with cargo fmt --check and cargo clippy --all-targets -- -D warnings clean.

End-to-end cases, one per acceptance criterion:

Criterion Test
Fresh Run swaps ready-for-agent, keeps other labels fresh_run: a_fresh_run_claims_the_issue_in_place_of_ready_for_agent_and_keeps_its_other_labels
No ready-for-agent still adds in-progress fresh_run: a_run_on_an_issue_with_no_ready_for_agent_label_still_claims_it
One request, before the worktree fresh_run: the_claim_is_made_in_one_request_before_the_worktree_is_created
Spec run Claims the Spec, Tickets untouched spec_run: a_spec_run_claims_the_spec_and_its_tickets_runs_change_no_label
Base fix changes no label base_fix: a_base_fix_changes_no_label_on_its_issue_while_the_run_claims_its_own
Architect dispatch Claims the plan, keeps architect-plan architect_run: the single-Ticket, Spec and failed-dispatch cases
Label created when missing fresh_run: the_in_progress_label_is_created_when_the_repository_lacks_it, and its counterpart for a repository that has it
Preflight stop changes no label preflight: a_run_stopped_by_a_preflight_check_changes_no_label, a_spec_run_stopped_by_a_preflight_check_changes_no_label
Continuation on a Claimed issue changes nothing continuation: a_continuation_on_an_issue_already_claimed_leaves_its_labels_as_they_are
Claim that can't be made stops before any work fresh_run: a_run_whose_claim_cannot_be_made_stops_before_any_work_naming_the_cause

Merge Danger

Door: two-way

Reverting the commit stops new Claims. Issues already labelled in-progress keep the label until someone removes it by hand.

Blast Radius: labels

  • Every Run and Spec run started on an Issue URL now writes to the issue's labels and may create the in-progress label in the repository. That is three more gh calls before the worktree, and a gh failure there now fails the Run.
  • Nothing takes in-progress off yet, by design: releasing and removing it is the next Ticket. Until then the label stays on issues after their Run ends, closed ones included.

Unaddressed findings

Standards

  • docs/agents/triage-labels.md and AGENTS.md don't mention in-progress. Pickup runs: thirdshift takes ready-for-agent issues on its own #212 puts that doc change with what ready-for-agent means on a Spec, which is outside this Ticket.
  • fn label_in_progress carries only [`make`], its failure as `gh` gave it as its doc. I renamed it from swap_labels, but left the behaviour documented on make, as child_run::start_from and its neighbours do.

Spec

  • thirdshift help describes the Claim, which The Claim: a Run or Spec run marks its issue in-progress #280 doesn't ask for. Kept: Pickup runs: thirdshift takes ready-for-agent issues on its own #212's story 50 asks for it, and help's Architect run paragraph would otherwise leave out what the dispatch does to the plan's labels.
  • New stderr lines, labelling #<n> in-progress[, in place of ready-for-agent], which The Claim: a Run or Spec run marks its issue in-progress #280 doesn't specify. Kept: every other label change thirdshift makes has a progress line.
  • A Continuation on an issue not yet Claimed Claims it, which The Claim: a Run or Spec run marks its issue in-progress #280 doesn't state. Kept: it follows from "however the run was started", and is tested.
  • A label added to the issue between the read and the PUT is dropped. Not fixed: one request that also removes a label needs the full set, and the Architect run's mark-ready step has the same window.
  • If creating the label succeeds and the PUT fails, the repository keeps a new, unused in-progress label. Not fixed: the next Run uses it, and deleting it would be a second request that can fail too.
  • No case for a failing gh issue view inside the Claim. The fake fails calls by their first two arguments, so that one would fail the preflight check first. The label list, label create and PUT failures are covered, and all four share one error path.
  • The README says thirdshift doesn't take in-progress off yet, while CONTEXT.md's Claim entry describes the release. Left: the README describes what this branch does, and the next Ticket adds the release.

Closes #280

🤖 Generated with Claude Code

JacobStephens2 and others added 3 commits October 1, 2026 17:52
…f ready-for-agent

Once its preflight checks pass and before its worktree is created, a Run or
a Spec run that is not a child Run swaps the issue's ready-for-agent for
in-progress in one request, keeping its other labels and creating the label
if the repository lacks it. A Ticket's Run in a Spec run and a Base fix make
none, and an issue already Claimed is left as it is. A Claim that can't be
made stops the Run before any work.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… Claim on StartedBy, the selection test off the Claim's calls, more Claim cases

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@JacobStephens2
JacobStephens2 merged commit 289806a into issue-212 Oct 1, 2026
13 checks passed
@JacobStephens2
JacobStephens2 deleted the issue-280 branch October 1, 2026 18:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant