Skip to content

Each Pass owns its lifecycle, from its gates to the run it dispatches, tested in-process behind the Pass seam - #417

Merged
JacobStephens2 merged 7 commits into
mainfrom
issue-413
Oct 5, 2026
Merged

JacobStephens2 merged 7 commits into
mainfrom
issue-413

Conversation

@JacobStephens2

@JacobStephens2 JacobStephens2 commented Oct 5, 2026 •

Copy link
Copy Markdown
Owner

Each Pass, an Architect run or a Pickup run, now owns its whole lifecycle in its own module, from its gates to the Spec run or Run it dispatches, generic over the Pass seam. Behaviour is unchanged.

Closes #413

Summary

The entry point's Pass arms shrink to the command's start, the Pass, and the command's finish:

 main::pickup
   command start
-  pickup::run                 # gates, skip, Harness check, start
-  Asks::of_ready_issue
-  run::run_to_end
+  pickup::run                 # lock + preflight, builds LaunchAndGitHub
+    run_through<impl Outside> # gates → skip | step → check_harness → started → dispatch
   command finish
 main::architect
   command start
-  architect::run              # gates … review worktree, Sessions, conclude
-  if PlanReady && !plan_only: step, Asks::of_architect_plan, run::run_to_end
+  architect::run              # start time, lock + preflight, builds LaunchAndGitHub
+    run_through<impl Outside> # gates → skip | check_harness → started → pull?
+                              #   → interrupted? → review(conclude) → step → dispatch unless plan-only
   command finish

The Pass seam (src/pass.rs) grows the calls a Pass makes outside itself beyond GitHub. They are skipped, check_harness, started, pull, review<T> (the conclusion runs inside the session) and dispatch(Dispatch). The production adapter OnGitHub is renamed LaunchAndGitHub. It builds the dispatched run's Asks from the command's flags and the User config, on the checked Harness. InMemory records every call in the one ordered calls list, so a single assertion checks a whole Pass's order.

Evidence

  • Before: each ordering rule was testable only end-to-end, through a whole thirdshift pickup or thirdshift architect run against the fake gh, git and claude binaries. Examples: a skipped Pass makes no Harness check, and the dispatch comes after the label swap.
    After: in-process unit tests through InMemory in src/pickup.rs and src/architect.rs, for example:
    pickup(ready 9, harness failing) → Err, calls == [Closed, Open(in-progress), ReadySearch, Step("taking Ready issue #9 …"), HarnessCheck]
    architect(plan reviewed)        → calls end [… Edit{swap}, Step("dispatching the plan …"), DispatchPlan{40, "main"}]
    
    Five end-to-end tests that only checked one such rule are removed. The ones covering the lock, the preflight checks, the Run notification, the Factory skills and the review's worktree, flags reaching the dispatched run, and the dispatched run's ending are kept. cargo test passes (535 unit tests plus the end-to-end suites), and cargo clippy --all-targets is clean.

Merge Danger

Door: two-way

This is an internal refactor with no change to config, labels, logs or outputs. Reverting it is a plain revert.

Blast Radius: Passes

Every cron-driven thirdshift pickup and thirdshift architect goes through the new path. The risk is a subtle drift in the order of stderr lines or log records. The review found one: the review's starting line came before the Factory skills were linked. It is fixed in ea3e380.

Unaddressed findings

Standards

  • Outside trait widens to ~14 methods (Divergent Change): skipped. The Spec decides on one seam for both Passes so that a single ordered call list covers a whole Pass.
  • The choice of Asks lives in the production adapter, untested by InMemory: skipped. The Spec puts it there: the Pass decides whether and what to dispatch, the adapter decides how, and the Asks rules keep their own tests.
  • review<T> generic over one caller (Speculative Generality): skipped. The Spec makes it generic so that the seam module names no Architect type.
  • Duplicated lock-and-adapter prologue in pickup::run and architect::run, with the lock skip recorded outside the seam: skipped. The Spec records the lock skip before any adapter exists, and the two prologues differ in their error handling (? against a failed review).
  • flags, config and harness travel together (Data Clumps): skipped. They are the adapter's fields and are bundled there once.
  • Call::Started(Option<u64>) re-switches on Work: skipped. It is a test-only projection that keeps assertions short.
  • The names run_through and up_to_the_dispatch: skipped. <name>_through is the codebase's convention, as the Spec requires.
  • pull: bool and plan_only: bool side by side (Primitive Obsession): skipped. They are private fields with doc comments, and the reviewer judged them acceptable.

Spec

  • Only 5 of the ~140 end-to-end tests are removed: skipped. The Tickets remove only those that checked a single Pass rule now unit-tested. The rest cover the production adapter and the composition, for example a Model that claude refuses, through the real Harness check.
  • review takes an extra starting progress line, not in the Spec's call shape: kept. It lets the line come after the worktree and the Factory skills are ready, as on main.
  • InMemory::review returns its scripted Session log even on failure, while the real adapter returns it only if the file exists: kept. It is a scripted fake, and the tests script exactly what they assert.

Tickets

🤖 Generated with Claude Code

JacobStephens2 and others added 7 commits October 5, 2026 04:38
…hind the Pass seam (#414)

The Pass seam grows calls to record a skip and a start, check the Harness
and dispatch an issue, and its production adapter is renamed Launch and
GitHub. Everything in a Pickup run after its lock runs in run_through,
generic over the seam, and the entry point no longer builds Asks or calls
run_to_end for one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…le call list

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A Pickup run owns its lifecycle to its dispatch, tested in-process behind the Pass seam
…s behind the Pass seam (#415)

The Pass seam grows a pull of the Launch directory's Base branch and the
Architecture review session, which runs its conclusion inside the session
and returns its result with the Session log. Everything in an Architect run
after its lock and preflight checks runs in run_through, generic over the
seam: the gates, the Harness check, the start, the pull, the review and the
plan's dispatch, unless plan-only. The entry point no longer builds Asks or
calls run_to_end for one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ktree, and clearer names

The Pass seam's review call hands on the review's starting line once its
worktree is ready, as before, so it follows the worktree's lines and is
not printed when the worktree can't be made. The Architect run's outcome
past its skip is Ran, the step before the dispatch is up_to_the_dispatch,
and the tests no longer reach calls by position.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An Architect run owns its lifecycle to its dispatch, tested in-process behind the Pass seam (#415)
…tory skills, and shared test helpers beside InMemory

The Architecture review's starting line is handed on inside the session
again, once the Factory skills are linked, as on main. The repository and
the ready-for-review Ending the Pass tests share move beside InMemory, and
Call::Dispatch is named DispatchReadyIssue beside DispatchPlan.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@JacobStephens2
JacobStephens2 marked this pull request as ready for review October 5, 2026 09:36
@JacobStephens2
JacobStephens2 merged commit 862f767 into main Oct 5, 2026
13 checks passed
@JacobStephens2
JacobStephens2 deleted the issue-413 branch October 5, 2026 09:43
@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.

Each Pass owns its lifecycle, from its gates to the run it dispatches, tested in-process behind the Pass seam

1 participant