Skip to content

Spec: keep working Ready issues - a Failure limit for pickup and a Command limit for Passes - #1579

Merged
JacobStephens2 merged 24 commits into
mainfrom
issue-1564
Oct 29, 2026
Merged

JacobStephens2 merged 24 commits into
mainfrom
issue-1564

Conversation

@JacobStephens2

@JacobStephens2 JacobStephens2 commented Oct 28, 2026 •

Copy link
Copy Markdown
Owner

Summary

Pickup keeps working Ready issues while healthy pull requests wait for review. Passes share a repository up to the Day shift's Command limit.

Command on an Issue URL → hold one slot; always run
Pass → count slots and take one atomically; skip at pass.command_limit (default 1)
  Architect / Security → also hold the lock of its kind and use its own review worktree
  Pickup → Sweep, clear handled failures, count open agent-failed issues
    at pickup.failure_limit (default 3) → skip, listing counted issues
    otherwise → reserve a Ready issue; if reserved elsewhere, try the next
  dispatch → reserve published plans/fixes before marking Ready; child shares parent's slot
Ending → add agent-failed only for a failed run that keeps its Claim
  • Ready or merged pull requests, a held Self-merge, a Stop and a released Claim do not add agent-failed. Failed Spec runs and Security fixes count; failure labelling finishes after interruption. Hand-back, takeover, closure and the next Claim clear the label.
  • Slots are per repository and machine; the operating system frees them after any process exit. Different Pass kinds may overlap, with one Architect run and one Security run, in <repo>-architect and <repo>-security. Origin reservations protect every dispatch; the pending-fix gate remains under the Security lock.
  • Old and new binaries preserve exclusive access across an update: every newer Pass shares the legacy lock for its lifetime, and all newer Passes skip while an older Pass holds it exclusively, even above a Command limit of 1.
  • pickup.limit is accepted and ignored with a warning naming pickup.failure_limit; the Activity log records it once per change. Both new settings are positive whole numbers. Setup, the guide, generated manual, GLOSSARY, ADRs, README and hand-written site pages describe the full workflow. [resources] remains the protection across repositories.

Evidence

Seams under test: the thirdshift CLI against fake GitHub and Harness executables (exit status, printed skips, labels, Activity log, overlapping Commands and origin reservations), the legacy Pass-lock protocol, and the existing Pickup decision and User-config seams.

  • Before: cargo test --test pickup_run an_older_pass_stays_excluded_until_the_last_overlapping_new_pass_ends -- --exact failed: an older Pass acquired the legacy lock while the second Pickup run was live: Ok(()).
    After: the retained regression passes. Each newer Pass holds a shared legacy lock until it ends.
  • Before: the follow-up's older-first reproduction failed: an older Pass restarted while the newer Pickup run was live: Ok(()).
    After: the retained an_older_pass_cannot_restart_while_a_newer_pickup_is_live regression first verifies that the newer Pickup skips until the older Pass ends, then verifies that an older Pass cannot restart beside it. Both regressions passed together (cargo test --test pickup_run older_pass -- --nocapture: 2 passed).
  • The Standards finding is addressed by shared concurrency handshakes and reservation queries in tests/support/concurrency.rs; agent work stays at each test's call site.

RUST_TEST_THREADS=3 scripts/affected-tests main PASS: 51 site tests, including manual regeneration and browser checks; the full Rust suite (cargo test, nextest unavailable) passed 3,435 tests, with 74 ignored and no failures. The Rust check took 2,998.38s, including 46.67s of test-target compilation with cached dependencies. /usr/bin/time -p measured 3,087.22s for the complete selector on this host. cargo fmt --check and git diff --check also passed.

Host setup for this run: Python 3.11 on PATH, socat installed, and PLAYWRIGHT_BROWSERS_PATH pointing to the installed Chromium cache. The earlier browser-path failure was corrected before the successful complete run; the previous PR body's sandbox/Python failures are resolved.

Merge Danger

Door: two-way

No data migration. Slot files only matter while locked; reverting restores the former Claim limit and Pass lock. The legacy lock path is retained.

Blast Radius: scheduling

All Passes use the new admission rule. Replace pickup.limit with pickup.failure_limit on each host; raise pass.command_limit to overlap newer Passes. Overlapping Pickup runs may exceed the Failure limit by at most the Command limit minus one. Skip messages change, including the count and limit and the older-binary compatibility reason. Older binaries reject a config containing the new [pass] section.

Review coverage

Both independent axes read all 59 changed files, including generated site/docs/index.html, and the removed src/pickup/reservation.rs contents. No generated output was excluded. No changed file was left unread. Final reports and finding counts are in .thirdshift-review-Mgq3BB/standards.md, spec.md and summary.json in the review worktree.

Unaddressed findings

Standards

None. The one Duplicated Code judgment was addressed by sharing the concurrent-agent handshake, release and origin-reservation query.

Spec

None. The one legacy-lock lifetime finding was addressed for both startup orderings, with retained regression tests and matching guide/ADR updates.

Security

None confirmed in the diff from pinned merge base a04baf04c5226ca61df43aceae0cfc18b5b9ff1e through local head 4825472dac028b825aba6a352b2d30825d31b8b6, including supporting code. This guidance-mode review traced the Command limit and Pass locks, origin reservations and Ready-issue trust checks, Claim endings, review worktree ownership, and private Security fix publication. No source fixes were made.

Validation completed across RUST_TEST_THREADS=3 scripts/affected-tests main and resumed Rust integration-target runs on the unchanged head: 51 site tests and all selected Rust tests passed (74 Rust tests ignored). The selector's warm cargo test run took 2,426.17s before Release fixtures reached the isolated 256-task cap. Release and subsequent targets passed after raising that bounded cap to 512; unfinished targets were resumed after the sandbox lifetime ended. The final eight-target run passed in 1,042.30s, including 5m 01s of compilation. All target execution used isolated local fixtures, cached dependencies, and no external network.

Closes #1564

Security review outcome

No unaddressed introduced findings.

Tickets

Built with codex codex-cli 0.162.0 · gpt-6.1-sol · xhigh

JacobStephens2 and others added 19 commits October 28, 2026 18:49
…1570)

A Pickup run that loses the origin reservation, or whose selection went
stale once reserved, releases any reservation of its own and searches again
past that issue in pickup.order. It is skipped only once no Ready issue it
can reserve is left, with exit 0 and no Run notification.
…ation in race

Standards S1, S3, S4, S7, S8 and Spec P1, P2.
Each live Command on a repository holds a slot, an advisory file lock the
operating system frees when its process ends. A Pass counts the held slots
and takes one under a short lock; a Ticket run, Spec run or Custom process
started with an issue takes one without counting, so it is never refused.
Each Pass also tries the pre-Command-limit lock, so old and new binaries
keep each other out at command_limit = 1. Architect runs, Security runs and
issue-less Custom processes still keep the repository to themselves.

Closes #1571
… review

A Pass that holds the pre-Command-limit lock also holds a marker, so a lock
held without the marker is an older thirdshift's Pass and counts as one more
Command at any limit. The limit-1 message is chosen in one place, hold_slot
warns for itself, and a Custom process with an issue now makes a Pickup run
skip at the default limit, as every live Command does.
Pickup moves on to the next Ready issue when it loses a reservation
A Failed ticket run or Failed spec run that keeps its Claim labels its
issue agent-failed, whatever started it; a held Self-merge, a Stop, a
released Claim and a needs-info ending add nothing. A Pickup run counts
open agent-failed issues against pickup.failure_limit (default 3),
after taking the label off issues the Day shift handed back or took
over; the Sweep clears it from closed issues and the next Claim takes it
off. Pull requests waiting for review no longer hold Pickup back.

An old pickup.limit is accepted and ignored, with a warning on stderr
naming pickup.failure_limit, recorded in the Activity log once per
change. ADR 0026 records the decision.

Closes #1569
- Quiet skips still print a User config warning, such as an ignored
  pickup.limit, on stderr, once.
- Every Claim ending goes through Claim::end; HeldClaim ends with an
  Ending, and a bug not reproduced ends with needs-info even after a Stop.
- Share labels::joined, name pickup's clear_and_count_failures, and
  bind the Claim-stays result where it is read.
- ADR 0026 and the glossary: taking over leaves no needs-triage, and a
  failed release gets no agent-failed. The guide notes Custom processes
  (#1583).
# Conflicts:
#	docs/guide.md
#	site/docs/index.html
#	src/pickup.rs
Command limit: Pickup runs share a repository up to [pass] command_limit
Brings in #1570: Pickup moves on to the next Ready issue when it loses
a reservation. Resolved against the Failure limit:

- src/pickup.rs: the module doc keeps both the agent-failed clearing and
  the search past unreservable issues; AtFailureLimit uses the shared
  write_numbers helper; #1570's tests expect the Failure limit gate's
  calls (CLOSED, CLOSED_FAILED, FAILED) in place of the Claim limit's.
- docs/guide.md, site/docs/index.html: the skip paragraph takes #1570's
  wording for reserved or stale selections, with the Failure limit.
… never two of a kind (#1572)

An Architect run and a Security run each take a slot up to the Command
limit and hold a lock of their kind, so a second of the same kind is
skipped, saying why. Each reviews in a worktree of its own, <repo>-architect
or <repo>-security, so neither's stale disposal removes the other's live
worktree. Each reserves the plan or fix it dispatches on origin before
marking it ready, as a Pickup run reserves its Ready issue, and releases it
the same way. An issue-less Custom process takes no lock of a kind and
counts only toward the Command limit. An Architect run or a Security run is
skipped beside an older thirdshift's Pass, whose kind it can't tell.
Correct the site's Custom process line and the code navigation index,
the stale Pickup and Architect comments, rename PassKind::word to slug,
build the reservation ref in one place, and record in ADR 0014 why a
review worktree of each kind is never live when found. Test an Architect
run beside an issue-less Custom process, and keep the launch-check
failure test on a dispatch the reservation commit no longer pre-empts.
Brings in the Command limit (#1571, pass.command_limit) alongside this
branch's Failure limit. Conflicts kept both: UserConfig carries
pickup_failure_limit and command_limit, the ignored pickup.limit warning
sits beside the pass.command_limit parser, and each side's tests stay.
The guide, code navigation and generated site docs now say a Pass takes
a slot at the Command limit, then counts agent-failed issues against the
Failure limit, with no Claim limit left.
Failure limit: Pickup counts agent-failed issues, not Claims
Brings in the Failure limit (#1569): Pickup counts agent-failed issues,
not Claims.

Conflicts resolved, keeping both intents:
- docs/guide.md: Pickup step 2 keeps this branch's wording (no Pass keeps
  the repository to itself any more); steps 3 and 4 take the Failure limit
  and the agent-failed Sweep.
- docs/code-navigation.md: the Claim and Failure limit rows from #1569,
  with the reservation at src/reservation.rs and the PassKind lock from
  this branch.
- src/pickup.rs: the module comment names the Failure limit and the
  agent-failed clearing, and a reservation held by any run, Pickup,
  Architect or Security.
- site/docs/index.html regenerated from docs/guide.md.
Mixed Passes: an Architect run and a Security run beside Pickup runs, never two of a kind
- A Pass skipped at the Command limit names the Commands running and the
  limit at every limit, the default included (story 30); a same-kind skip
  says which kind is running. A hand-started Ticket run filling the only
  slot no longer reads as "another Pass is already running".
- The guide, README and site pages no longer say a Pass skips beside any
  other Command; above a limit of 1 it skips at the limit, or beside
  another of its kind. The guide's User config examples list
  [pass] command_limit and pickup.failure_limit in place of pickup.limit.
- pickup.failure_limit's comment uses the Spec's wording.
- One reservation ref builder; stale comments in pickup.rs, main.rs,
  ADR 0009 and ADR 0026; no launch.rs re-export of command_limit types;
  the stop ending in Claimed::end no longer shadows the Claim ending.
@JacobStephens2
JacobStephens2 marked this pull request as ready for review October 29, 2026 05:49
…e: OAuth session expired and could not be refreshed)

2026-10-29T06:49:14Z, host orchestrate.etadventures.com. Uncommitted work at the time of failure is included in this commit.
@JacobStephens2
JacobStephens2 marked this pull request as draft October 29, 2026 06:49
@JacobStephens2
JacobStephens2 marked this pull request as ready for review October 29, 2026 15:26
Preserve the Failure and Command limits and shared dispatch reservations alongside the updated site disclosures, host indicator, and quota guidance.
Preserve the Failure limit skip assertions alongside timestamp evidence in status JSON. Regenerate the user manual from the merged guide.
@JacobStephens2
JacobStephens2 merged commit 76ef539 into main Oct 29, 2026
18 checks passed
@JacobStephens2
JacobStephens2 deleted the issue-1564 branch October 29, 2026 20:12
@JacobStephens2 JacobStephens2 mentioned this pull request Oct 30, 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.

Spec: keep working Ready issues - a Failure limit for pickup and a Command limit for Passes

1 participant