ci: heavy swarm jobs run with no host-capacity slot — adopt matou-app's host-slot-wait.sh (matou-app#285 / #268 rollout) #135

Closed
opened 2026-09-04 23:51:43 +00:00 by ben · 3 comments
Owner

Rollout of Matou/matou-app#268 to this repo, from the shared-runner starvation incident in Matou/matou-app#285.

Problem

This repo's heavy ci jobs run runs-on: swarm with no host-capacity slot: seam (ci.yml:24). The swarm label is a shared 8-core pool (matou-workstation + elitebook-03). On 2026-09-02 idss seam forked ~15 vitest workers, host load reached 25/8 with swap 100 % exhausted, and a matou-app swarm worker died with WorktreeTimeoutError (a git worktree add took >30 s). matou-app's own heavy jobs already ride a pooled slot (bash .sandcastle/host-slot-wait.sh 1800 <cmd>), so its discipline cannot bound host load while sibling jobs don't.

Ask

  1. Copy .sandcastle/host-slot-wait.sh from Matou/matou-app (main) into this repo's .sandcastle/ — it is repo-local there (NOT in FACTORY_MANIFEST) and depends only on the vendored host-capacity-lib.sh, which this repo already has. Keep the file byte-identical to matou-app's so a later promotion into the factory core is a no-op.
  2. In .forgejo/workflows/ci.yml, wrap the heavy command of each swarm job above as bash .sandcastle/host-slot-wait.sh 1800 <existing command> (one pooled slot, bounded 1800 s camp, then give up with a clear message — see the matou-app ci.yml checks job for the exact shape and comments). Raise timeout-minutes to cover the camp (matou-app uses 105 = 2×30 min camp + checks).
  3. Do not touch swarm.yml / triage.yml / resume-asks.yml — those take slots inside the vendored scripts already.

Acceptance

  • Each listed job's heavy step runs under host-slot-wait.sh; with both pool slots busy the job waits (up to 1800 s) rather than co-running.
  • bash .sandcastle/check-harness-drift.sh stays green (no vendored file edited).
  • ci green on the PR.
Rollout of Matou/matou-app#268 to this repo, from the shared-runner starvation incident in Matou/matou-app#285. ## Problem This repo's heavy ci jobs run `runs-on: swarm` with **no host-capacity slot**: `seam` (ci.yml:24). The `swarm` label is a shared 8-core pool (matou-workstation + elitebook-03). On 2026-09-02 idss `seam` forked ~15 vitest workers, host load reached 25/8 with swap 100 % exhausted, and a matou-app swarm worker died with `WorktreeTimeoutError` (a `git worktree add` took >30 s). matou-app's own heavy jobs already ride a pooled slot (`bash .sandcastle/host-slot-wait.sh 1800 <cmd>`), so its discipline cannot bound host load while sibling jobs don't. ## Ask 1. Copy `.sandcastle/host-slot-wait.sh` from Matou/matou-app (`main`) into this repo's `.sandcastle/` — it is repo-local there (NOT in FACTORY_MANIFEST) and depends only on the vendored `host-capacity-lib.sh`, which this repo already has. Keep the file byte-identical to matou-app's so a later promotion into the factory core is a no-op. 2. In `.forgejo/workflows/ci.yml`, wrap the heavy command of each swarm job above as `bash .sandcastle/host-slot-wait.sh 1800 <existing command>` (one pooled slot, bounded 1800 s camp, then give up with a clear message — see the matou-app ci.yml `checks` job for the exact shape and comments). Raise `timeout-minutes` to cover the camp (matou-app uses 105 = 2×30 min camp + checks). 3. Do not touch swarm.yml / triage.yml / resume-asks.yml — those take slots inside the vendored scripts already. ## Acceptance - Each listed job's heavy step runs under `host-slot-wait.sh`; with both pool slots busy the job waits (up to 1800 s) rather than co-running. - `bash .sandcastle/check-harness-drift.sh` stays green (no vendored file edited). - ci green on the PR.

Re-routed to the session lane by a sandcastle agent iteration (run 3074) — not blocked on a decision, blocked on who is allowed to make the edit.

Why an agent iteration cannot do this ticket

Every part of #135 lands in a protected path:

  • Task 1 creates .sandcastle/host-slot-wait.sh
  • Task 2 edits .forgejo/workflows/ci.yml

Under the repo's standing Rule 9, .sandcastle/ and .forgejo/ are protected: a before/after tree-fingerprint wraps each agent run and rolls back and fails the run for any protected path it creates, deletes, or changes. So a sandcastle agent physically cannot land this — the fingerprint would revert both files. There is no non-protected slice to "continue without it"; the whole ticket is a harness/machinery change.

Rule 9's prescription for a needed machinery change is the session lane (ready-for-session), which is the mechanism permitted to edit protected paths. I did not file a duplicate issue because #135 already fully specifies the change (copy matou-app's byte-identical host-slot-wait.sh, wrap the seam heavy step as bash .sandcastle/host-slot-wait.sh 1800 <cmd>, raise timeout-minutes to cover the 1800 s camp).

Label change

  • removed ready-for-agent
  • added ready-for-session

No agent-working label or swarm-claim comment was present, so there is no claim to release. A session can pick this up as-is.

Re-routed to the session lane by a sandcastle agent iteration (run 3074) — not blocked on a decision, blocked on **who is allowed to make the edit**. ## Why an agent iteration cannot do this ticket Every part of #135 lands in a **protected path**: - Task 1 creates `.sandcastle/host-slot-wait.sh` - Task 2 edits `.forgejo/workflows/ci.yml` Under the repo's standing Rule 9, `.sandcastle/` and `.forgejo/` are protected: a before/after tree-fingerprint wraps each agent run and **rolls back and fails the run** for any protected path it creates, deletes, or changes. So a sandcastle agent physically cannot land this — the fingerprint would revert both files. There is no non-protected slice to "continue without it"; the whole ticket is a harness/machinery change. Rule 9's prescription for a needed machinery change is the **session lane** (`ready-for-session`), which is the mechanism permitted to edit protected paths. I did not file a duplicate issue because #135 already fully specifies the change (copy matou-app's byte-identical `host-slot-wait.sh`, wrap the `seam` heavy step as `bash .sandcastle/host-slot-wait.sh 1800 <cmd>`, raise `timeout-minutes` to cover the 1800 s camp). ## Label change - removed `ready-for-agent` - added `ready-for-session` No `agent-working` label or `swarm-claim` comment was present, so there is no claim to release. A session can pick this up as-is.

Landed by the idle landing sweep (#114): this agent PR was green but its worker left no close-report — killed after opening the PR. The sweep merged it; closes #135 closes the issue.

Landed by the idle landing sweep (#114): this agent PR was green but its worker left no close-report — killed after opening the PR. The sweep merged it; `closes #135` closes the issue.

Close-report — verified landed and green (advances #135)

The two-way-door work for #135 is on main and proven. This session found it already merged (PR #137, commit 88fabbf) but the issue left open — the PR's closes #135 keyword never fired, so the runner re-picked it. Nothing further to build; verifying and closing.

What landed

  • .sandcastle/host-slot-wait.sh — copied byte-identical from Matou/matou-app main (3116 bytes; diff against the live raw file is clean), repo-local (NOT in FACTORY_MANIFEST), depends only on the already-vendored host-capacity-lib.sh. A later promotion into the factory core stays a no-op.
  • .forgejo/workflows/ci.yml — the seam job's whole heavy block (pnpm install --frozen-lockfile / pnpm -r typecheck / pnpm -r test) now runs as bash .sandcastle/host-slot-wait.sh 1800 bash -c '…': ONE pooled slot, bounded 1800 s camp, then give up loudly (exit 75) rather than co-run. Event-driven job, so a camp (not a yield) is correct — a yield would lose the run. timeout-minutes raised 30 → 60 to cover the camp.
  • Commit touched exactly ci.yml, host-slot-wait.sh, STATUS.md — swarm.yml / triage.yml / resume-asks.yml untouched (they already take slots inside the vendored scripts).

Proof (acceptance)

  • Heavy step rides host-slot-wait.sh (bounded 1800 s) — with both pool slots busy the job waits, not co-runs.
  • bash .sandcastle/check-harness-drift.sh → OK (exit 0), no vendored file edited.
  • ci / seam green on the PR (run 3143) and on the post-merge push to main (run 3162).

Commits: 88fabbf (seam), merge 2546fc4 (PR #137).

Ruled by agent under ADR 0174 — veto anytime. Proven by the byte-diff, the drift check, and the two green seam runs above.

## Close-report — verified landed and green (advances #135) The two-way-door work for #135 is on `main` and proven. This session found it already merged (PR #137, commit `88fabbf`) but the issue left open — the PR's `closes #135` keyword never fired, so the runner re-picked it. Nothing further to build; verifying and closing. ### What landed - `.sandcastle/host-slot-wait.sh` — copied **byte-identical** from `Matou/matou-app` `main` (3116 bytes; `diff` against the live raw file is clean), repo-local (NOT in `FACTORY_MANIFEST`), depends only on the already-vendored `host-capacity-lib.sh`. A later promotion into the factory core stays a no-op. - `.forgejo/workflows/ci.yml` — the `seam` job's whole heavy block (`pnpm install --frozen-lockfile` / `pnpm -r typecheck` / `pnpm -r test`) now runs as `bash .sandcastle/host-slot-wait.sh 1800 bash -c '…'`: ONE pooled slot, bounded 1800 s camp, then give up loudly (exit 75) rather than co-run. Event-driven job, so a camp (not a yield) is correct — a yield would lose the run. `timeout-minutes` raised 30 → 60 to cover the camp. - Commit touched exactly `ci.yml`, `host-slot-wait.sh`, `STATUS.md` — `swarm.yml` / `triage.yml` / `resume-asks.yml` untouched (they already take slots inside the vendored scripts). ### Proof (acceptance) - Heavy step rides `host-slot-wait.sh` (bounded 1800 s) — with both pool slots busy the job waits, not co-runs. - `bash .sandcastle/check-harness-drift.sh` → **OK** (exit 0), no vendored file edited. - `ci / seam` **green** on the PR (run 3143) and on the post-merge push to `main` (run 3162). Commits: `88fabbf` (seam), merge `2546fc4` (PR #137). Ruled by agent under ADR 0174 — veto anytime. Proven by the byte-diff, the drift check, and the two green seam runs above.
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
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/coa#135
No description provided.