Skip to content

One label-edit module changes an issue's labels for the Claim, the Sweep and the Architect plan and idea - #366

Merged
JacobStephens2 merged 2 commits into
mainfrom
issue-365
Oct 4, 2026
Merged

JacobStephens2 merged 2 commits into
mainfrom
issue-365

Conversation

@JacobStephens2

Copy link
Copy Markdown
Owner

Summary

The Claim, the Sweep, and the Architect plan and idea now name only the labels to take off and the labels to put on. The new Edit in src/labels.rs handles the rest.

 Claim::make / release / remove_if_closed, sweep, mark_plan_ready, label_idea
-  github::issue_labels
-  github::ensure_labels   (only for the concept's own label)
-  Labels::swapped
-  github::set_labels | github::remove_label
-  github::*_label_command
+  Edit::read(issue, off, on) | Edit::of(issue, labels, off, on)
+    .takes_off(label) / .puts_on(label) / .labels()   # progress lines stay where they were
+    .apply()
+  labels::by_hand(issue, off, on)                      # needs no read
Edit::apply
  request(labels, off, on)     # private seam, unit-tested
    nothing changes, ignoring case        -> no request
    one label off, none on                -> DELETE, as the issue spells it
    otherwise                             -> ensure_labels(missing on-labels) then PUT
  • Marking a plan ready still runs its checks first, and a failed check still changes no label. The labels it writes now come from a read made after the interrupt check.
  • ready-for-agent and needs-triage are now added to a repository that lacks them, with their descriptions.
  • One behaviour follows from the DELETE rule. A Claim on an issue that is already in-progress and still carries ready-for-agent now DELETEs ready-for-agent. It used to PUT the labels back. The issue's other labels therefore keep their order: tests/continuation.rs was updated for this.

Evidence

  • Before: the Architect plan run onto a repository with only needs-triage and Architect-Plan wrote ready-for-agent with no description, and created no labels.
    After: marking_a_plan_ready_adds_ready_for_agent_with_its_description_to_a_repository_that_lacks_it and labelling_an_idea_adds_needs_triage_with_its_description_to_a_repository_that_lacks_it pass. a_repository_that_has_the_architect_plan_label_keeps_it_as_it_is now expects one gh label create ready-for-agent.
  • New unit tests in labels::tests cover no request, a single DELETE as the issue spells the label, a PUT with missing labels added first, case-insensitive off and on, a label in both off and on, and the by-hand commands.
  • cargo test, cargo clippy --all-targets and cargo fmt --check all pass.

Merge Danger

Door: two-way

A revert restores the old label handling. The repository labels the new code creates, ready-for-agent and needs-triage, are harmless.

Blast Radius: labels

Every label change thirdshift makes now goes through one path. A bug in Edit would affect Claims, the Sweep and the Architect run together. Progress lines, warnings and by-hand commands are unchanged.

Unaddressed findings

Standards

  • Unit tests assert on the private Request enum: the issue specifies this internal seam ("a pure private function, unit-tested in the labels module").
  • Edit::labels() widens the interface: the issue asks for it explicitly ("what the issue's labels were").
  • Data Clumps (off/on travel together; by_hand could be a method): the issue specifies by_hand as a separate function that needs no read. Bundling off and on into a type would add a type with no rule of its own.
  • Duplicated Code in remove_if_closed and sweep: the shared part is three lines, and the two handle failure differently (retry and warn vs. a warning per issue).
  • Repeated Switches on the Claim's two flags: each branch prints a progress line that must stay word for word as it is today, so the branches can't be collapsed.

Spec

  • No scenario test that a label added during the plan's checks survives: the issue doesn't ask for one, and the fake gh has no hook for changing labels in the middle of a run.

Closes #365

🤖 Generated with Claude Code

JacobStephens2 and others added 2 commits October 4, 2026 15:01
The Claim, the Sweep and the Architect plan and idea name the labels to
take off and put on, and the labels module's Edit owns the read, the
choice of request, adding missing labels to the repository, and the
by-hand commands. Marking a plan ready writes from a read made after its
checks, and ready-for-agent and needs-triage are now added to a
repository that lacks them, with their descriptions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A label both taken off and put on is put on, the Claim's release labels
are named for what they are, and two doc comments read right.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@JacobStephens2
JacobStephens2 merged commit b108c41 into main Oct 4, 2026
13 checks passed
@JacobStephens2
JacobStephens2 deleted the issue-365 branch October 4, 2026 19:26
@JacobStephens2 JacobStephens2 mentioned this pull request Oct 5, 2026
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.

One label-edit module changes an issue's labels for the Claim, the Sweep and the Architect plan and idea

1 participant