Repository navigation
One Architect run per repository at a time, with a skipped outcome - #254
Merged
Merged
Conversation
An Architect run takes, without waiting, an OS advisory lock keyed by the repository once its preflight checks pass, and holds it until its process exits, the run it dispatches included. One started while the lock is held is skipped: it says so on stderr, prints nothing on stdout, does nothing else and exits 0, and still sends its Run notification, with the outcome skipped and the reason. A review worktree a killed Architect run left is removed by the next one, so a kill leaves nothing to clean up. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d for how an Architect run ended, the worktree says only what it knows The kill case now starts the next Architect run while the killed one's session is still going, so it would notice a lock a child process kept. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 1, 2026
Closed
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.
Closes #247
Summary
Only one Architect run per repository runs at a time on a machine. One started while another is still running, its dispatched Spec run or Run included, is skipped: exit
0, one progress line, nothing else.~/.thirdshift/architect-locks/<owner>/<repo>.lock, lower-cased as GitHub compares names. The file is never deleted and means nothing unless locked; the operating system releases the lock when the process ends for any reason.architect::Outcomeis nowSkipped(Skipped)orReviewed(Reviewed);Reviewedholds the three endings a review had before. The open-plan Ticket can add its skip as a secondSkippedvariant.thirdshift help, the README (new "One at a time" section, replacing the "start one at a time" advice) and the Run notification glossary entry describe the rule.Seam under test: the
thirdshiftbinary through thearchitect_runend-to-end tests, with the fakeclaudeandgh. The harness gainsScenario::run_until, which returns aHeldRunthe test can signal, kill or finish, andrun_and_signalis now built on it.Evidence
Before: with the first Architect run held mid-review, the second failed on the worktree:
and after a
kill -KILLof the first, a new one failed the same way.After:
cargo testpasses, all targets, 0 failed. The new end-to-end cases intests/architect_run.rs(56 pass, 7 new):The three concurrency cases were run five more times in a row without a failure.
cargo clippy --all-targetsandcargo fmt --checkare clean.Unaddressed findings
Review was
/thirdshift:code-reviewagainstissue-237. Addressed: the lock function now returns the held file (S1, in part),reviewedrenamed where it can hold a skip (S2), oneOutcome::name()for the notification's outcome word and one match less (S3), the worktree module no longer narrates the Architect run's rule (S4), anassert_skipped_as_already_runninghelper (S6), and the kill case no longer releases the orphaned session before the next run starts (C3).Standards
std::mem::forget, not carried tomainas a guard. The Spec says it is held until the process exits; leaking it at the one place that takes it says exactly that, and carrying a guard out throughResult<Outcome, FailedRun>would bend that return type for no behaviour.try_run_lockrepeats the open-and-lock shape ofGit::lock. Two short call sites that differ in the parts that matter (try, not wait; under~/.thirdshift, not the git directory); a shared helper would be mostly parameters.Repo::slugbesideIssueUrl::repo_slug.repo.repo_slug()would stutter; only its doc comment was corrected.Spec
originmust not get two locks.notification.rs, and the end-to-end case covers the same line.git ls-remoteandgit fetch. That is Nightly Architect runs: a cron recipe, and an Architect run that is safe to schedule #237's order: preflight checks, then the lock.Merge Danger
Door: two-way
Reverting restores the old behaviour; the lock files left under
~/.thirdshift/architect-locks/are inert.Blast Radius: Architect-runs
Every
thirdshift architectnow takes the lock, and fails before any work if~/.thirdshiftcan't be written or the filesystem refuses advisory locks. A second Architect run that used to fail on the worktree now exits0. A directory at<repo>-architectthat is a registered worktree of the clone is force-removed at the start of a review. Runs and Spec runs on an Issue URL are untouched.🤖 Generated with Claude Code