Repository navigation
Description
Part of #2934 (Phase A, task 5).
Its scope depends on the Phase A task 3 ruling (if heavy suites move to hosted draft runs, this shrinks to whatever stays local), Its priority and preemption policy were ruled on #2938 (2026-10-25): preemption within the caller's own subtree, only to admit a red-main fix.
Context
Several agents on one host each run long system-wide suites. The host chokes, suites hit their timeouts, and agents skip the checks to proceed (see #2934). The only coordination today is per workspace: ensureWorkspaceLease (scripts/workspace-lease.mjs:183) serializes overlapping commands in the same checkout and announces "Acquiring exclusive workspace output access". Separate worktrees on the same host do not coordinate at all, so five worktrees can start five native suites at once.
Product and test deadlines must not be raised to absorb contention (docs/decisions/ci-utility.md, "Local feedback and authoritative proof").
Agents run under an orchestrator agent, one per person, and the orchestrator must be able to make room for a red-main fix (see the #2934 orchestration rules). Its decisions have to go through a deterministic command with durable state, so an orchestrator that crashes or loses context leaves nothing inconsistent, and a worker running without an orchestrator still gets an admission limit.
Scope
- A host-wide admission limit for heavy local test commands (native, runtime-host, browser and integrated categories, and any test file over a declared duration), shared across worktrees on one machine.
- A command that would exceed the limit waits, printing the holders and its queue position, instead of starting and timing out.
- The wait is recorded as a
wait-started/wait-finishedpair with reasonother(or a new reason, if the throughput doc is amended) throughscripts/ci-timings.ts record(docs/process/ci-throughput.md:78-109). - The ledger records each slot's holder process, worker ID, orchestrator ID and priority class; ownership is checked by process liveness as
processIdentity/liveAncestordo (scripts/workspace-lease.mjs:46-69), and a dead holder's slot is reclaimed. - A
preempt <slot> --reason <reason>command signals the holder's process group to cancel, lets its cleanup run (mounts, tmpfs, sandboxes, timers) within a bounded grace period, then kills it. The preempted run is recorded aspreempted. The command refuses a slot outside the caller's orchestrator subtree. - Admission has priority classes: a command run for a PR declared as a red-main fix (per the Phase A task 2 ruling) is admitted ahead of every queued ordinary command; it does not preempt running ones.
- The limit defaults from the host's CPU count and can be overridden by an environment variable documented in the environment documentation.
Out of scope
- Changing any test deadline or timeout.
- Hosted CI scheduling.
- Cross-subtree preemption; another orchestrator's holder only yields through queue priority.
- Preemption for any reason other than admitting a red-main fix (ci: decide integration lanes for proof-system changes and red-main fixes #2938 ruling).
- Fast checks run by default
check:pr.
Acceptance criteria
- With the limit set to 1, two heavy commands started from two worktrees run one after the other, and neither times out; proven by a test that starts both and fails before the change.
- A crashed holder's slot is reclaimed, proven by a test that kills a holder.
- With the limit set to 1 and one ordinary command queued, a red-main-fix command started later is admitted first when the running holder finishes; proven by a test that fails before the change.
- A preempted holder's cleanup runs before the slot is reassigned, and the run is recorded as
preempted; proven by a test whose holder registers a cleanup marker. preemptrefuses a slot held under a different orchestrator ID; proven by a test.- With no orchestrator running, two heavy commands are still limited by the host slots.
- The wait appears as a recorded event pair.
Verification
Focused tests for the admission module, plus a restored mutation receipt that removes the limit and shows the concurrency test fail.
Contract impact
None.
2026-10-25: #2938 ruled on preemption; this issue now waits only on #2939.
2026-10-25: #2939 ruled; no remaining blocker.
Activity
schlessera commentedon Nov 2, 2026
Claimed as part of working epic #2934 end to end (claim token
wi-20261102-fd2d2f21). Order chosen for earliest queue-velocity benefit: #2938+#2939 rulings first (they unlock hosted draft feedback), then the red-main/merge-path chain (#2942, #2940, #2944); #2943, #2941 and #2937 run in parallel since they touch disjoint code. Intended branch:feat/2943-host-admission.feat(ci): admit heavy local test commands through a host-wide ledger
docs(process): document host admission and its environment
fix(ci): admit check:pr --full only after its prerequisite refusals
feat(ci): admit heavy local test commands through a host-wide ledger
docs(process): document host admission and its environment
41 remaining items
fix(ci): admit check:pr --full only after its prerequisite refusals
fix(ci): keep host admission inherited across replaced environments a…
fix(ci): leave no shared directory behind for a test process's privat…
feat(ci): admit heavy local test commands through a host-wide ledger
docs(process): document host admission and its environment
fix(ci): admit check:pr --full only after its prerequisite refusals
fix(ci): keep host admission inherited across replaced environments a…
fix(ci): leave no shared directory behind for a test process's privat…
feat(ci): admit heavy local test commands through a host-wide ledger
docs(process): document host admission and its environment
fix(ci): admit check:pr --full only after its prerequisite refusals
fix(ci): keep host admission inherited across replaced environments a…
fix(ci): leave no shared directory behind for a test process's privat…
feat(ci): record check:pr outcomes for one merge path and admit heavy…