ADR: a rehearsal drive takes one pooled slot on a host with headroom — per-host exclusivity instead of ADR 0184's all-four-locks acquire #25

Closed
opened 2026-08-23 03:27:28 +00:00 by matou-build-agent · 2 comments

Symptom (2026-08-22)

rehearsal-cycle.sh acquires /tmp/matou-swarm.lock, /tmp/matou-host-slot-2.lock, /tmp/matou-session-runner.lock and the repo healer lock all-or-nothing (host_capacity_acquire_exclusive, ADR 0184 in idss: "a drive must coexist with nothing heavy on the host"). On the workstation, #657 became ready at 14:38Z and skipped 43 consecutive ticks (86 min) — host capacity busy … skipped N consecutive tick(s) — behind dev-factory workers of 39, 45 and 56 min. The drive itself then ran GREEN in 11½ min. All-time on that host: 318 skipped drive ticks.

The #663/#664 reservation only stops new claims; it cannot shorten a worker already running, so a drive's wait is bounded by the longest worker in flight, and the exclusivity makes that bound apply to every slot rather than one.

Why the ruling no longer fits

ADR 0184 sized exclusivity for a 4 vCPU / 7 GB host that is also the product dev server (mongo, quasar dev, KERIA, any-sync). elitebook-03 is 8 CPU / 14 GB with ~12 GB free and ran at load 0.2 through the whole episode. A drive there is a Playwright session plus SSH to a droplet; it does not need the host to itself. Since the review both runners were rebalanced (workstation capacity 1, elitebook capacity 2), which caps the workstation's worst case at one worker's length — still 4–5× the drive.

Ask (a ruling, then a small change)

  1. An ADR here (own sequence) that makes drive exclusivity a per-host knob: DRIVE_EXCLUSIVE=all|slot in the host's rehearsal-env.sh. all = today's four-lock acquire (default, byte-identical). slot = host_capacity_acquire_heavy (one pooled slot) plus the drive's own /tmp/matou-rehearsal-drive.lock; session-runner and healer are not excluded.
  2. host-capacity-lib.sh gains nothing new — the primitives exist; the consumer switch lives in idss rehearsal-cycle.sh (that half is an idss ticket once the ruling lands; link it here).
  3. Document the RAM reasoning: slot is only safe where a drive + one worker + the base services fit — note the number in the ADR so the next host enrolment (#6) can set the knob from facts.

Acceptance

  • ADR merged; DRIVE_EXCLUSIVE documented in onboarding's host-enrolment notes.
  • idss follow-up filed for the rehearsal-cycle.sh switch with its offline test.
  • Live on elitebook-03 with slot: a drive fires within one */2 tick of becoming ready while one swarm worker is running on that host.

Related: the claim-ordering ticket (drive blockers first) and STATUS.md's "Host capacity" row.

## Symptom (2026-08-22) `rehearsal-cycle.sh` acquires `/tmp/matou-swarm.lock`, `/tmp/matou-host-slot-2.lock`, `/tmp/matou-session-runner.lock` and the repo healer lock all-or-nothing (`host_capacity_acquire_exclusive`, ADR 0184 in idss: "a drive must coexist with nothing heavy on the host"). On the workstation, #657 became ready at 14:38Z and skipped **43 consecutive ticks (86 min)** — `host capacity busy … skipped N consecutive tick(s)` — behind dev-factory workers of 39, 45 and 56 min. The drive itself then ran GREEN in 11½ min. All-time on that host: 318 skipped drive ticks. The #663/#664 reservation only stops *new* claims; it cannot shorten a worker already running, so a drive's wait is bounded by the longest worker in flight, and the exclusivity makes that bound apply to **every** slot rather than one. ## Why the ruling no longer fits ADR 0184 sized exclusivity for a 4 vCPU / 7 GB host that is also the product dev server (mongo, quasar dev, KERIA, any-sync). elitebook-03 is 8 CPU / 14 GB with ~12 GB free and ran at load 0.2 through the whole episode. A drive there is a Playwright session plus SSH to a droplet; it does not need the host to itself. Since the review both runners were rebalanced (workstation capacity 1, elitebook capacity 2), which caps the workstation's worst case at one worker's length — still 4–5× the drive. ## Ask (a ruling, then a small change) 1. An ADR here (own sequence) that makes drive exclusivity a **per-host knob**: `DRIVE_EXCLUSIVE=all|slot` in the host's `rehearsal-env.sh`. `all` = today's four-lock acquire (default, byte-identical). `slot` = `host_capacity_acquire_heavy` (one pooled slot) **plus** the drive's own `/tmp/matou-rehearsal-drive.lock`; session-runner and healer are not excluded. 2. `host-capacity-lib.sh` gains nothing new — the primitives exist; the consumer switch lives in idss `rehearsal-cycle.sh` (that half is an idss ticket once the ruling lands; link it here). 3. Document the RAM reasoning: `slot` is only safe where a drive + one worker + the base services fit — note the number in the ADR so the next host enrolment (#6) can set the knob from facts. ## Acceptance - ADR merged; `DRIVE_EXCLUSIVE` documented in `onboarding`'s host-enrolment notes. - idss follow-up filed for the `rehearsal-cycle.sh` switch with its offline test. - Live on elitebook-03 with `slot`: a drive fires within one `*/2` tick of becoming ready while one swarm worker is running on that host. Related: the claim-ordering ticket (drive blockers first) and STATUS.md's "Host capacity" row.
Author
Member

Ruled by agent under ADR 0174 — veto anytime.

Ruling: drive exclusivity becomes a per-host DRIVE_EXCLUSIVE=all|slot
knob rather than ADR 0184's fixed all-four-locks acquire being the only
mode. all (default) reproduces ADR 0184's host_capacity_acquire_exclusive
over both pooled slots + session-runner + healer locks byte-identical; slot
uses the already-existing host_capacity_acquire_heavy pooled-slot
primitive plus the drive's own /tmp/matou-rehearsal-drive.lock, excluding
neither session-runner nor the healer. host-capacity-lib.sh needs no new
primitive — both already exist and are already tested.

Why this is a two-way door: the default (all) is byte-identical to
today's behaviour on every host that doesn't set the knob — matou-workstation
(4 vCPU/7 GB, also the product dev server) keeps it. The opt-in (slot) is a
plain env var set in a host-local file
(elitebook-03's rehearsal-env.sh), reversible by flipping it back. No
vendored file in this repo changed (host-capacity-lib.sh untouched), so no
consumer needs a re-vendor for this ruling alone. Proof: full ADR at
docs/adr/0003-drive-exclusivity-is-a-per-host-knob.md
(commit 3a97461), with the RAM reasoning per host recorded so the next
host enrolment (#6) can set the knob from facts.

Scope kept to what's a two-way door from this repo: the ADR + docs +
following up. The CONSUMER half (rehearsal-cycle.sh reading the knob) is
idss's own code, not vendored here — filed as Matou/idss#706. Setting the
knob live on elitebook-03 and landing that idss code are named residue,
not claimed done here (see close-report below).

Ruled by agent under ADR 0174 — veto anytime. **Ruling:** drive exclusivity becomes a per-host `DRIVE_EXCLUSIVE=all|slot` knob rather than ADR 0184's fixed all-four-locks acquire being the only mode. `all` (default) reproduces ADR 0184's `host_capacity_acquire_exclusive` over both pooled slots + session-runner + healer locks byte-identical; `slot` uses the already-existing `host_capacity_acquire_heavy` pooled-slot primitive plus the drive's own `/tmp/matou-rehearsal-drive.lock`, excluding neither session-runner nor the healer. `host-capacity-lib.sh` needs no new primitive — both already exist and are already tested. **Why this is a two-way door:** the default (`all`) is byte-identical to today's behaviour on every host that doesn't set the knob — `matou-workstation` (4 vCPU/7 GB, also the product dev server) keeps it. The opt-in (`slot`) is a plain env var set in a host-local file (`elitebook-03`'s `rehearsal-env.sh`), reversible by flipping it back. No vendored file in this repo changed (`host-capacity-lib.sh` untouched), so no consumer needs a re-vendor for this ruling alone. Proof: full ADR at `docs/adr/0003-drive-exclusivity-is-a-per-host-knob.md` (commit `3a97461`), with the RAM reasoning per host recorded so the next host enrolment (`#6`) can set the knob from facts. **Scope kept to what's a two-way door from this repo:** the ADR + docs + following up. The CONSUMER half (`rehearsal-cycle.sh` reading the knob) is idss's own code, not vendored here — filed as `Matou/idss#706`. Setting the knob live on `elitebook-03` and landing that idss code are named residue, not claimed done here (see close-report below).
Author
Member

Close report

Landed (3a97461, pushed to origin/main):

  • docs/adr/0003-drive-exclusivity-is-a-per-host-knob.md — the ruling: per-host
    DRIVE_EXCLUSIVE=all|slot knob, RAM reasoning for matou-workstation (stays
    all) and elitebook-03 (slot-safe at ~12 GB free / load ≈0.2 through
    the #657 episode).
  • onboarding/README.md — host-enrolment note documenting the knob under
    "What this does not cover, and why", for the next host enrolment (#6).
  • STATUS.md — header + "Host capacity" row + milestone log entry.
  • No host-capacity-lib.sh change: both primitives the two modes need
    (host_capacity_acquire_heavy, host_capacity_acquire_exclusive) already
    existed and are already covered by tests/host-capacity-lib-test.sh.

Proof: full offline suite green (for t in tests/*.sh onboarding/tests/*.sh; ... bash "$t") both before and after landing —
docs-only change, no lib/test edited, one transient unrelated flake on a
shared-host /tmp collision (claude-call-guards-test.sh) that reran green
immediately, consistent with the existing /tmp/matou-drive-wanted
real-reservation hazard session-runner-test.sh's own comments already
document. Rebased cleanly onto #31 (b4e865a, landed concurrently by
another worker mid-session) with a manual conflict resolution in STATUS.md
preserving both entries.

Follow-up filed: Matou/idss#706 — rehearsal-cycle.sh branches on
DRIVE_EXCLUSIVE, with its own offline test (both modes). This is idss-owned
code (rehearsal-cycle.sh was never vendored into this repo's harness), so
it's out of this ticket's — and this repo's — reach.

Named residue, not claimed done:

  • The idss consumer switch (Matou/idss#706) itself.
  • Setting DRIVE_EXCLUSIVE=slot live in elitebook-03's rehearsal-env.sh
    — a host config step for a human once #706 lands.
  • This ticket's own third acceptance line ("live on elitebook-03 … a drive
    fires within one tick") is therefore not yet provable — it depends on both
    of the above, which are sequenced after this ruling by design (the ADR's
    own point 2). Closing this ticket on the ADR + documentation + follow-up
    filing, per its own "Ask" §1/§3 scope; the live acceptance rides
    Matou/idss#706.

Closing.

## Close report **Landed** (`3a97461`, pushed to `origin/main`): - `docs/adr/0003-drive-exclusivity-is-a-per-host-knob.md` — the ruling: per-host `DRIVE_EXCLUSIVE=all|slot` knob, RAM reasoning for `matou-workstation` (stays `all`) and `elitebook-03` (`slot`-safe at ~12 GB free / load ≈0.2 through the #657 episode). - `onboarding/README.md` — host-enrolment note documenting the knob under "What this does not cover, and why", for the next host enrolment (`#6`). - `STATUS.md` — header + "Host capacity" row + milestone log entry. - No `host-capacity-lib.sh` change: both primitives the two modes need (`host_capacity_acquire_heavy`, `host_capacity_acquire_exclusive`) already existed and are already covered by `tests/host-capacity-lib-test.sh`. **Proof:** full offline suite green (`for t in tests/*.sh onboarding/tests/*.sh; ... bash "$t"`) both before and after landing — docs-only change, no lib/test edited, one transient unrelated flake on a shared-host `/tmp` collision (`claude-call-guards-test.sh`) that reran green immediately, consistent with the existing `/tmp/matou-drive-wanted` real-reservation hazard `session-runner-test.sh`'s own comments already document. Rebased cleanly onto `#31` (`b4e865a`, landed concurrently by another worker mid-session) with a manual conflict resolution in `STATUS.md` preserving both entries. **Follow-up filed:** `Matou/idss#706` — `rehearsal-cycle.sh` branches on `DRIVE_EXCLUSIVE`, with its own offline test (both modes). This is idss-owned code (`rehearsal-cycle.sh` was never vendored into this repo's harness), so it's out of this ticket's — and this repo's — reach. **Named residue, not claimed done:** - The idss consumer switch (`Matou/idss#706`) itself. - Setting `DRIVE_EXCLUSIVE=slot` live in `elitebook-03`'s `rehearsal-env.sh` — a host config step for a human once `#706` lands. - This ticket's own third acceptance line ("live on elitebook-03 … a drive fires within one tick") is therefore not yet provable — it depends on both of the above, which are sequenced after this ruling by design (the ADR's own point 2). Closing this ticket on the ADR + documentation + follow-up filing, per its own "Ask" §1/§3 scope; the live acceptance rides `Matou/idss#706`. Closing.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Matou/dev-factory#25
No description provided.