Skip to content

Weeding: Architect runs that follow each other as soon as the last plan is merged - #332

Merged
JacobStephens2 merged 21 commits into
mainfrom
issue-311
Oct 3, 2026
Merged

JacobStephens2 merged 21 commits into
mainfrom
issue-311

Conversation

@JacobStephens2

@JacobStephens2 JacobStephens2 commented Oct 3, 2026 •

Copy link
Copy Markdown
Owner

Weeding: a crontab line runs thirdshift architect base <branch> every few minutes with merge.always. This Spec makes that line safe and quiet. It adds no new command, daemon or flag, so ADR 0009 stands.

Closes #311

Summary

The Architect run's skip checks, in order. The first one that applies is reported:

 architect
   notification checks            # a broken setup still fails here, exit 1
   preflight checks
   lock held?            -> skipped (nothing on stdout)
   open architect-plan?  -> skipped (URL of each plan)
+  architect-idea + needs-triage open? -> skipped (URL of each idea)
+  Ready issue (the Pickup run's own search)? -> skipped (its URL)
   Architecture review
     plan  -> mark ready, dispatch
-    idea / already filed -> no label change
+    idea / already filed -> add architect-idea + needs-triage in one swap, keeping other labels
+                            (if labelling fails, the run fails with one notification carrying the cause)
-  Run notification, skipped included
+  Run notification, unless skipped
 src/
+├── ready.rs        # the Ready issue search, moved out of pickup.rs, shared by both runs
 ├── pickup.rs       # calls ready::first; behaviour unchanged
 ├── architect.rs    # new label ARCHITECT_IDEA, skips IdeasWaiting and ReadyIssue, label_idea
 ├── notification.rs # takes the Reviewed outcome only; the Skipped body is gone
 └── main.rs         # help text; a skipped run sends no notification
 README.md           # Weeding section, the two new skips, notification and crontab updates
 docs/adr/0009-*     # Consequences: a skipped Architect run sends no notification

The Architect run looks for a Ready issue through ready::first, the same search the Pickup run uses, with no Sweep and no Claim limit. So the two runs can't disagree about whether work is waiting. Any triage decision releases an Architect idea: taking needs-triage off (label checks ignore case) or closing the issue.

Evidence

  • Before: a */5 Architect line sent a "skipped" email on every pass. A review with no Strong candidate filed a new, weaker needs-triage idea on each pass. A Ready issue could lose the repository to an Architect run.
    After: cargo test passes in full, and cargo clippy --all-targets is clean. New end-to-end tests in tests/architect_run.rs check the real binary against the fake gh, the fake claude and the Resend stand-in:

    open idea labelled needs-triage   -> skipped before review, URL on stdout, reason on stderr
    idea triaged (any case) / closed  -> not skipped
    idea filed / already filed        -> architect-idea + needs-triage put on it, other labels kept
    labelling fails                   -> run fails, one notification with the cause
    Ready issue                       -> skipped, URL printed
    claimed / unsettled / blocked     -> not skipped
    open plan + waiting idea          -> plan reported
    skipped run, email or email.always -> no email; broken notification setup still exits 1
    lock held                         -> no gh call made
    

    These three tests flip, as the Spec asked: the skipped-run notification test, the open-plans notification test, and the idea half of the open-idea test.

Merge Danger

Door: two-way

Reverting the PR restores the old behaviour. The only thing left on GitHub would be the architect-idea label on ideas filed in the meantime, and that label does nothing once the change is reverted.

Blast Radius: scheduled-Architect-runs

  • Nightly Architect users no longer get an email on a skipped night.
  • A ready-for-agent issue that is a Ready issue, on a repository with no Pickup line, now keeps Architect runs from starting. The README warns about this.
  • Pickup runs are unchanged. Their search moved to ready.rs without any change in behaviour.

Unaddressed findings

Standards

  • Possible Duplicated Code, mark_plan_ready and label_idea: skipped. The two share only the final swap. The plan side runs its own checks and drops needs-triage first, so a shared helper would have to take parameters for those differences.
  • Possible Repeated Switches, skip reasons matched in run, urls() and Display: skipped. The enum has four variants and each match is short. A trait or a table would hide more than it saves.

Spec

  • Scope creep: the README's whole crontab replaces the nightly Architect line with a --plan-only Weeding line: skipped. This was settled in the README Weeding section and sample crontab line #328 review: a repository runs one Architect line or the other, and the README says how to swap the nightly line back in.
  • Scope creep: label_idea checks for an interrupt first: skipped. It follows how mark_plan_ready handles an interrupt, and an interrupt is something a person does on purpose.
  • A Ready-issue skip prints the search's lines on passed-over issues as well as its one reason line: skipped. The Spec asks for the Pickup run's search to be reused, and that search prints these lines. The README documents them.

Tickets

🤖 Generated with Claude Code

JacobStephens2 and others added 20 commits October 3, 2026 03:11
Move the Pickup run's search for the lowest-numbered Ready issue into
its own module, ready::first, so that an Architect run can later ask the
same question. The Sweep and the Claim limit stay in the Pickup run.
No behaviour changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Either skip, already running or an open Architect plan, now sends none
when asked, so a crontab line can start an Architect run every few
minutes for Weeding. The notification's checks still come first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…any run (#324)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…326)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… skip, README wording (#325)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Share the Ready issue search between the Pickup run and the Architect run
An Architect idea pauses Architect runs until it is triaged
Brings in the Architect idea skip (#326). README conflicts resolved to
keep #325's rule, that a skipped Architect run sends no Run notification,
for the new skip reason too: the skipped-email subject and body lines
from origin/issue-311 are dropped, and the schedule paragraph lists the
waiting Architect idea among the skip reasons.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A skipped Architect run sends no Run notification
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… too (#327)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A skipped Architect run now sends no Run notification (#325), so the
Ready issue skip (#327) sends none either: the README and the
architect() doc comment keep the Ready issue among the skip reasons and
take #325's no-email wording.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A Ready issue goes ahead of an Architect run
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…th merge.always, a plan whose run failed (#328)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
README Weeding section and sample crontab line (#328)
…ther a notification goes (#311)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@JacobStephens2
JacobStephens2 marked this pull request as ready for review October 3, 2026 08:38
@JacobStephens2
JacobStephens2 merged commit ed102fe into main Oct 3, 2026
13 checks passed
@JacobStephens2
JacobStephens2 deleted the issue-311 branch October 3, 2026 08:46
@JacobStephens2 JacobStephens2 mentioned this pull request Oct 3, 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.

Weeding: Architect runs that follow each other as soon as the last plan is merged

1 participant