rehearsal-cycle.sh: DRIVE_EXCLUSIVE=all|slot per-host knob (dev-factory ADR 0003, per-host drive exclusivity) #706
Labels
No labels
agent-blocked
agent-working
autopilot
bug
deferred
deploy-pending
enhancement
landing-pr
model-haiku
model-opus
model-sonnet
needs-design
needs-info
needs-triage
no-triage
out-of-scope
priority
ready-for-agent
ready-for-human
ready-for-session
rehearsal-183
snapshot-pending
standing-drive
wayfinder:grilling
wayfinder:map
wayfinder:prototype
wayfinder:research
wayfinder:task
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Matou/idss#706
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Ask
rehearsal-cycle.shcurrently always excludes everything heavy on the hostfor a drive's whole run (
host_capacity_acquire_exclusiveover both pooledslots + the session-runner lock + the repo's healer lock — ADR 0184). Make
that a per-host knob instead of the only mode:
DRIVE_EXCLUSIVE=all|slot, read from the environment (set in the host's ownrehearsal-env.sh, the file already sourced by the cron line ahead ofrehearsal-cycle.sh— seeonboarding/README.md'stoken-sync.ymlnote inMatou/dev-factoryfor the existing precedent of a host-local, untracked envfile in this role).
all(default, unset falls back here): today's exact behaviour —host_capacity_acquire_exclusive /tmp/matou-swarm.lock /tmp/matou-host-slot-2.lock /tmp/matou-session-runner.lock /tmp/matou-healer-Matou-idss.lock, byte-identical to the current callright after
host_capacity_drive_reserveinscripts/rehearsal-cycle.sh.slot:host_capacity_acquire_heavy(one pooled slot, first-fit) —scripts/lib/host-capacity-lib.shalready has this primitive, no changeneeded there. The drive's own
/tmp/matou-rehearsal-drive.lockis alreadyheld earlier in the script and stays as-is. Session-runner and the healer
are deliberately NOT excluded under this mode.
No new primitive is needed in
host-capacity-lib.sh— bothhost_capacity_acquire_heavyandhost_capacity_acquire_exclusivealreadyexist and are already tested (
scripts/tests/host-capacity-lib-test.sh).This ticket is purely the
rehearsal-cycle.shcall-site branch plus itsoffline test.
Why
elitebook-03(8 CPU / 14 GB, ~12 GB free) starved standing-drive #657 for43 consecutive
*/2ticks (86 min, 2026-08-22) behind ordinary dev-factoryswarm workers, while sitting at load ≈0.2 the whole time — the drive itself
then ran GREEN in 11½ minutes. ADR 0184's all-four-locks exclusivity was
sized for
matou-workstation(4 vCPU / 7 GB, also the product dev server);it does not fit a headroom host like
elitebook-03, where a drive (Playwrightfit comfortably in observed free RAM. Full reasoning and the RAM numbers:
Matou/dev-factoryADRdocs/adr/0003-drive-exclusivity-is-a-per-host-knob.md(ticket
Matou/dev-factory#25).Acceptance
rehearsal-cycle.shbranches onDRIVE_EXCLUSIVEright where it currentlycalls
host_capacity_acquire_exclusive; unset/allis byte-identical totoday.
scripts/tests/) proves both modes:allcalls the four-lock exclusive acquire exactly as before;
slotcalls theone-slot heavy acquire and does NOT touch the session-runner or healer
locks.
DRIVE_EXCLUSIVE=slotset inelitebook-03'srehearsal-env.sh(a human/session step, not this ticket's own scope), aready drive fires within one
*/2tick while one dev-factory worker isrunning on that host.
Ruled by agent under ADR 0174 — veto anytime. Two-way door: a per-host env
knob defaulting to today's exact behaviour, provable by an offline test.
Triage
Category: enhancement
Verification: redundancy check —
DRIVE_EXCLUSIVEdoes not exist inrehearsal-cycle.shtoday; the call site still unconditionally uses the four-lock exclusive acquire. No.out-of-scope/entry matches. No UX flow/wireframe is referenced (not design-tier work). No## Why humanline and nothing on the ADR 0174 one-way-door list — this is a per-host env knob defaulting to today's exact behaviour, provable by an offline test, so it's a two-way door: agent-actionable.Agent Brief
Category: enhancement
Summary: Make the rehearsal drive's host-capacity exclusivity mode a per-host knob (
DRIVE_EXCLUSIVE=all|slot) instead of always acquiring full exclusivity.Current behavior:
The rehearsal drive cycle always acquires full host exclusivity before running a drive — it holds the pooled-slot lock, the session-runner lock, and the repo's healer lock simultaneously, for the drive's entire run. This is sized for a small/shared host, but starves ordinary work on a larger host that has enough headroom to run a drive alongside other work.
Desired behavior:
The exclusivity mode is controlled by a
DRIVE_EXCLUSIVEenvironment variable, read at the point the cycle currently acquires exclusivity:all(the default): identical behavior to today — full exclusivity across all four locks (pooled slots + session-runner + healer).slot: acquire only one pooled capacity slot (the existing single-slot, first-fit, non-blocking primitive) — session-runner and the healer lock are deliberately left unexcluded. The drive's own drive-lock (already acquired earlier in the flow) is unaffected either way.Both underlying primitives already exist and are already tested; this is purely a branch at the existing call site, controlled by the new env var.
Key interfaces:
DRIVE_EXCLUSIVEright where it currently does the unconditional exclusive acquire.Acceptance criteria:
DRIVE_EXCLUSIVEunset orallproduces byte-identical lock acquisition to today (all four locks, exclusive).DRIVE_EXCLUSIVE=slotacquires exactly one pooled capacity slot and does NOT touch the session-runner or healer locks.Out of scope:
DRIVE_EXCLUSIVE=slotin any specific host's environment config — that's a separate operational step, not part of this change.swarm-claim host=elitebook-distributed-server-03 run=9298
(automated multi-host claim — lowest live claim id works this ticket)
close-report for #706 — status
success✅ close-report gates passed — every claim verified against main; issue closed.
envelope