Fleet-wide queue: one head of the line across repos, dispatched when a ticket is ready #301

Open
opened 2026-10-22 05:09:53 +00:00 by ben · 6 comments
Owner

Ask (Ben, 2026-10-22)

Tickets should be picked up in the order they were filed across all consumer repos, with priority jumping the line, and a ready ticket should not wait for the next half-hour tick.

How it works today (what the Floor's "empty ticket" cards are)

  • The swarm workflow is vendored into every consumer repo and runs on its own cron (:15/:45) with one leg per pool host. So twice an hour every host receives one leg per repo (7 today); each leg takes a host slot for ~10 s, writes a ticket/run holder with no issue yet, reads its own repo's ready set, and stands down no-ready-tasks. The Floor paints that holder as a ticket card with a dash.
  • There is no cross-repo order: with ready tickets in several repos, the first legs to win the host's two slots keep them for the life of their runs; the other repos' legs queue or yield (#213's starvation yield is the only fairness rail, and it reacts after the fact).
  • Within a repo the order was drive-blockers → priority → the rest, in the tracker's newest-first order. Step 1 (landed on main 2026-10-22 with this ticket): each group is now oldest first, so the filing date is the line within a repo.
  • A ready ticket waits up to 30 min: the workflow fires on closed, the cron, and dispatch. A labeled trigger is not an option (#103): Forgejo delivers add and remove as one label_updated action with no label field, so every claim/release toggle of agent-working re-fired the workflow — 2,700 queued no-op runs on 2026-08-26.

Proposal (design conversation needed — who yields to whom)

One fleet queue watcher on a pool host (a cron tick every 1–2 min, next to backstop-tick.sh):

  1. One org-wide read: GET /repos/issues/search?owner=<org>&state=open&type=issues&labels=ready-for-agent (minus agent-working, minus blocked-by-open-dependency — the same filters as list-ready-tasks.sh).
  2. Order the fleet set: priority first, then oldest created_at; drive blockers keep their precedence inside their repo.
  3. When a host slot is free, workflow_dispatch the swarm workflow of the head ticket's repo only — the leg then runs the existing per-repo lister (now oldest-first) and claims the head. Nothing is dispatched when no slot is free, so the empty-leg noise on the Floor goes away with the cron reduced to a backstop.
  4. Legs can additionally consult the fleet head (the collector already builds this view for the Floor) and stand down when another repo holds an older/higher-priority ticket — the #213 want-file mechanism generalised from "I am starving" to "someone is ahead of me".

Interactions to rule on: the per-host leg rule (GOTCHAS 62/64), the drive-yield gate (#111), the #213 starvation yield, schedule-backstop.sh's "already covered" guard, and whether the watcher is one host's cron or every host's (claiming already makes double-dispatch harmless, only noisy).

Acceptance

  • Two repos, one ready ticket each, filed an hour apart: the older is claimed first, on whichever host has a free slot.
  • A priority ticket filed last is claimed first.
  • A newly readied ticket is claimed within ~2 min of the label, with no labeled trigger.
  • Idle ticks leave no ticket-shaped holder on any host (the Floor shows free slots), or the Floor paints a queue check as a queue check (dev-factory follow-up either way).
  • Offline tests for the watcher's ordering and dispatch decision; journal entry + STATUS row.

Filed from Ben's Floor session 2026-10-22 (step 1 oldest-first lands with this ticket's number in its commit).

## Ask (Ben, 2026-10-22) Tickets should be picked up in the order they were filed **across all consumer repos**, with `priority` jumping the line, and a ready ticket should not wait for the next half-hour tick. ## How it works today (what the Floor's "empty ticket" cards are) - The swarm workflow is vendored into every consumer repo and runs on its own cron (:15/:45) with one **leg** per pool host. So twice an hour every host receives one leg per repo (7 today); each leg takes a host slot for ~10 s, writes a `ticket`/`run` holder with no issue yet, reads **its own repo's** ready set, and stands down `no-ready-tasks`. The Floor paints that holder as a ticket card with a dash. - There is **no cross-repo order**: with ready tickets in several repos, the first legs to win the host's two slots keep them for the life of their runs; the other repos' legs queue or yield (#213's starvation yield is the only fairness rail, and it reacts after the fact). - Within a repo the order was drive-blockers → `priority` → the rest, in the tracker's **newest-first** order. Step 1 (landed on `main` 2026-10-22 with this ticket): each group is now **oldest first**, so the filing date is the line within a repo. - A ready ticket waits up to 30 min: the workflow fires on `closed`, the cron, and dispatch. **A `labeled` trigger is not an option** (#103): Forgejo delivers add and remove as one `label_updated` action with no label field, so every claim/release toggle of `agent-working` re-fired the workflow — 2,700 queued no-op runs on 2026-08-26. ## Proposal (design conversation needed — who yields to whom) One **fleet queue watcher** on a pool host (a cron tick every 1–2 min, next to `backstop-tick.sh`): 1. One org-wide read: `GET /repos/issues/search?owner=<org>&state=open&type=issues&labels=ready-for-agent` (minus `agent-working`, minus blocked-by-open-dependency — the same filters as `list-ready-tasks.sh`). 2. Order the fleet set: `priority` first, then oldest `created_at`; drive blockers keep their precedence inside their repo. 3. When a host slot is free, `workflow_dispatch` the swarm workflow of the **head ticket's repo** only — the leg then runs the existing per-repo lister (now oldest-first) and claims the head. Nothing is dispatched when no slot is free, so the empty-leg noise on the Floor goes away with the cron reduced to a backstop. 4. Legs can additionally consult the fleet head (the collector already builds this view for the Floor) and stand down when another repo holds an older/higher-priority ticket — the #213 want-file mechanism generalised from "I am starving" to "someone is ahead of me". Interactions to rule on: the per-host leg rule (GOTCHAS 62/64), the drive-yield gate (#111), the #213 starvation yield, `schedule-backstop.sh`'s "already covered" guard, and whether the watcher is one host's cron or every host's (claiming already makes double-dispatch harmless, only noisy). ## Acceptance - Two repos, one ready ticket each, filed an hour apart: the older is claimed first, on whichever host has a free slot. - A `priority` ticket filed last is claimed first. - A newly readied ticket is claimed within ~2 min of the label, with no `labeled` trigger. - Idle ticks leave no ticket-shaped holder on any host (the Floor shows free slots), or the Floor paints a queue check as a queue check (dev-factory follow-up either way). - Offline tests for the watcher's ordering and dispatch decision; journal entry + STATUS row. Filed from Ben's Floor session 2026-10-22 (step 1 oldest-first lands with this ticket's number in its commit).

This was generated by AI during triage.

Triage: enhancement + ready-for-session.

Ruled by agent under ADR 0174 — veto anytime

Ruling: this is ready-for-session, not ready-for-agent and not ready-for-human.

Why not ready-for-agent: the proposal's own surface is protected-path + host-standing work a swarm worker in a container must not touch:

  • The dispatch behaviour it changes lives in .forgejo/workflows/swarm.yml (and the closed/cron/workflow_dispatch trigger set) — .forgejo/ is a fingerprinted protected path (protected-paths-lib.sh).
  • The "fleet queue watcher" is a new cron on a pool host next to backstop-tick.sh, doing an org-wide read and workflow_dispatch — that needs a host's own cron install, dispatch credentials, and evidence directories. schedule-backstop.sh is the host-side home for exactly this class of tick.
    A session carries that standing; the swarm queue reads only ready-for-agent, so this is invisible to workers by construction.

Why not ready-for-human: none of the one-way-door list applies — no personal credentials, no security-posture widening, no member-facing trust accept, no data destruction, no non-routine spend. The design questions the ticket flags ("who yields to whom": the per-host leg rule / GOTCHAS 62/64, the #111 drive-yield gate, the #213 starvation yield, schedule-backstop.sh's already-covered guard, one-host-vs-every-host watcher) are revertible config/code calls, so the session that implements this rules them under ADR 0174 rather than escalating to Ben. Ben's veto stays asynchronous.

Why it's a two-way door: the whole change is one cron tick + ordering/dispatch logic, reversible by a later commit or by lifting the label. Claiming already makes double-dispatch harmless (only noisy), so even the one-host-vs-every-host choice is safely revertible.

What proves it: the acceptance criteria are all offline- or probe-provable, and the ticket already demands them — "Offline tests for the watcher's ordering and dispatch decision" plus the four behavioural checks (older-ticket-first across two repos, priority jumping last-filed, ~2-min claim with no labeled trigger, no ticket-shaped idle holder). Those tests are the veto surface: if the ordering/dispatch regresses, they red.

Notes for the session

  • Redundancy check (clean): no fleet/org-wide watcher exists today — no issues/search?owner= usage anywhere in the harness; swarm.yml fires strictly per-repo on :15,:45 + closed + workflow_dispatch, matching the ticket's "how it works today". This is net-new.
  • Hard constraint from the ticket's own history: no labeled trigger (#103 — Forgejo collapses add/remove into one label_updated with no label field; it caused 2,700 no-op runs on 2026-08-26). The ~2-min claim latency must come from the new short-interval watcher tick, not a label webhook.
  • Reuse, don't reinvent: the per-repo lister (list-ready-tasks.sh, now oldest-first per step 1) stays the claim path; the watcher only decides which repo's swarm.yml to dispatch. Generalise the #213 want-file mechanism ("I am starving" → "someone is ahead of me") rather than adding a second fairness rail.
  • Protected paths touched: .forgejo/workflows/swarm.yml, and a new host-side watcher alongside schedule-backstop.sh / backstop-tick.sh.
  • Close-out: journal entry (docs/journal/YYYY-MM-DD-301.md) + a STATUS.md surface row, per CLAUDE.md.
> *This was generated by AI during triage.* **Triage: `enhancement` + `ready-for-session`.** ## Ruled by agent under ADR 0174 — veto anytime **Ruling:** this is `ready-for-session`, not `ready-for-agent` and not `ready-for-human`. **Why not `ready-for-agent`:** the proposal's own surface is protected-path + host-standing work a swarm worker in a container must not touch: - The dispatch behaviour it changes lives in `.forgejo/workflows/swarm.yml` (and the `closed`/cron/`workflow_dispatch` trigger set) — `.forgejo/` is a fingerprinted protected path (`protected-paths-lib.sh`). - The "fleet queue watcher" is a **new cron on a pool host** next to `backstop-tick.sh`, doing an org-wide read and `workflow_dispatch` — that needs a host's own cron install, dispatch credentials, and evidence directories. `schedule-backstop.sh` is the host-side home for exactly this class of tick. A session carries that standing; the swarm queue reads only `ready-for-agent`, so this is invisible to workers by construction. **Why not `ready-for-human`:** none of the one-way-door list applies — no personal credentials, no security-posture widening, no member-facing trust accept, no data destruction, no non-routine spend. The design questions the ticket flags ("who yields to whom": the per-host leg rule / GOTCHAS 62/64, the #111 drive-yield gate, the #213 starvation yield, `schedule-backstop.sh`'s already-covered guard, one-host-vs-every-host watcher) are revertible config/code calls, so the session that implements this rules them under ADR 0174 rather than escalating to Ben. Ben's veto stays asynchronous. **Why it's a two-way door:** the whole change is one cron tick + ordering/dispatch logic, reversible by a later commit or by lifting the label. Claiming already makes double-dispatch harmless (only noisy), so even the one-host-vs-every-host choice is safely revertible. **What proves it:** the acceptance criteria are all offline- or probe-provable, and the ticket already demands them — "Offline tests for the watcher's ordering and dispatch decision" plus the four behavioural checks (older-ticket-first across two repos, `priority` jumping last-filed, ~2-min claim with no `labeled` trigger, no ticket-shaped idle holder). Those tests are the veto surface: if the ordering/dispatch regresses, they red. ## Notes for the session - **Redundancy check (clean):** no fleet/org-wide watcher exists today — no `issues/search?owner=` usage anywhere in the harness; `swarm.yml` fires strictly per-repo on `:15,:45` + `closed` + `workflow_dispatch`, matching the ticket's "how it works today". This is net-new. - **Hard constraint from the ticket's own history:** no `labeled` trigger (#103 — Forgejo collapses add/remove into one `label_updated` with no label field; it caused 2,700 no-op runs on 2026-08-26). The ~2-min claim latency must come from the new short-interval watcher tick, not a label webhook. - **Reuse, don't reinvent:** the per-repo lister (`list-ready-tasks.sh`, now oldest-first per step 1) stays the claim path; the watcher only decides *which repo's* `swarm.yml` to dispatch. Generalise the #213 want-file mechanism ("I am starving" → "someone is ahead of me") rather than adding a second fairness rail. - **Protected paths touched:** `.forgejo/workflows/swarm.yml`, and a new host-side watcher alongside `schedule-backstop.sh` / `backstop-tick.sh`. - **Close-out:** journal entry (`docs/journal/YYYY-MM-DD-301.md`) + a `STATUS.md` surface row, per CLAUDE.md.

Ruled by agent under ADR 0174 — routing to ready-for-human

Routing: ready-for-session → ready-for-human. Step 1 (oldest-first within a repo) is already on main (1aa946b, yours). I built the fleet queue watcher the proposal describes and offline-proved it, but I am not landing it on main or closing this — because this is your design call, and the honest ADR-0174 move is to hand you the ruling with a concrete, tested proposal in front of it.

Why human (not ready-for-agent/session-decided)

The triage comment (05:12Z) ruled the session could decide "who yields to whom" under ADR 0174. But 11 minutes later (05:23Z) you landed 1aa946b, whose own journal says the watcher's per-host-leg rule, drive yield and #213 yield are "Ben's design call, see Blocked on Ben", and whose STATUS entry says it "Needs Ben's ruling on who yields to whom … before it is built." A human's explicit, post-triage statement outranks the bot's ruling and reads as a pre-emptive veto on building it without you. ADR 0174 rule 2: when a ticket turns on a human's decision, stop that part and route to ready-for-human. So I stopped at "built and proven, dormant, as a proposal."

What I landed / preserved (all two-way doors)

  • Nothing on main beyond your step 1.
  • Branch fleet-queue-watcher-301-proposal (pushed): a complete, offline-tested implementation you can review, run, adopt (merge + wire) or discard.
    • fleet-queue-tick.sh — one org-wide issues/search read; orders priority first then oldest created_at (the only cross-repo key); walks past agent-working / open-dependency-blocked candidates (bounded by FLEET_HEAD_BUDGET); dispatches only the head ticket's repo swarm.yml by delegating to schedule-backstop.sh pointed at that repo (so the "already covered" decision reuses ONE source of truth — the in-flight/queued guard, GOTCHAS 78/#238/#588); an empty fleet dispatches nothing (idle tick → no run → no holder).
    • tests/fleet-queue-tick-test.sh — 12 offline scenarios (shimmed curl, no network): older-repo-first; priority jumps the last-filed line; head repo woken and only that one; blocked/claimed head skipped to the next; empty fleet dispatches nothing; an in-flight head-repo swarm suppresses. bash tests/fleet-queue-tick-test.sh → 12 scenarios passed.

The rulings I'd propose (so the conversation is concrete — veto any line)

  1. Every pool host runs the tick (not one host). Per-ticket claiming makes a double-dispatch harmless (a second host's leg hits the claim and stands down), only noisy; and the delegated guard with HOST_NAME cleared treats any host's in-flight leg of the head repo as "covered", so two watchers collapse onto one dispatch. Cheapest, most resilient, no single-host dependency.
  2. "A slot is free" is not tracked by the watcher. It dispatches the head repo and lets swarm.yml's existing host-capacity flock decide — both slots busy → the leg yields in seconds, the next tick re-dispatches. The watcher only ensures the dispatch goes to the head repo, fast, not to whichever repo's cron fires next.
  3. Per-host leg rule (GOTCHAS 62/64): unchanged. The watcher dispatches swarm.yml; the one-leg-per-host matrix and the per-host in-flight discrimination stay exactly as they are.
  4. Drive yield (#111) and #213 starvation yield: unchanged and still authoritative. The watcher never claims; it only wakes a repo. A reserved drive or a starved-peer want-file still makes the woken leg stand down via the existing mounts — the #213 mechanism generalises in spirit ("someone is ahead of me") without a second rail.
  5. No labeled trigger (#103): the ~2-min pickup comes from the tick interval, never a label webhook.

Residue that is genuinely yours (the live-cron rollout)

  • Wire the watcher into the host-cron render (host-state-lib.sh): a new every-host crontab line (~1–2 min), a new owned entrypoint, host-state-lib tests updated — then onboard-host install on the pool hosts. (Touches live crontabs.)
  • Reduce swarm.yml's :15,:45 cron to a pure backstop (protected path) once the watcher is primary.
  • Paint the Floor so an idle tick shows free slots (or a queue check as a queue check) — you already flagged this as a dev-factory follow-up.
  • Pick the token/host for the org-wide dispatcher (the swarm-bot token has org write; confirm that's the one you want doing fleet dispatch).

Veto anytime — relabel to ready-for-session (adopt the proposal as-is) or edit the rulings and a session will wire it.

## Ruled by agent under ADR 0174 — routing to `ready-for-human` **Routing:** `ready-for-session` → `ready-for-human`. Step 1 (oldest-first within a repo) is already on `main` (1aa946b, yours). I built the fleet queue watcher the proposal describes and offline-proved it, but I am **not landing it on `main` or closing this** — because this is **your design call**, and the honest ADR-0174 move is to hand you the ruling with a concrete, tested proposal in front of it. ### Why human (not `ready-for-agent`/session-decided) The triage comment (05:12Z) ruled the session could decide "who yields to whom" under ADR 0174. But **11 minutes later (05:23Z) you landed 1aa946b**, whose own journal says the watcher's per-host-leg rule, drive yield and #213 yield are "**Ben's design call, see Blocked on Ben**", and whose STATUS entry says it "**Needs Ben's ruling on who yields to whom … before it is built.**" A human's explicit, post-triage statement outranks the bot's ruling and reads as a pre-emptive veto on building it without you. ADR 0174 rule 2: when a ticket turns on a human's decision, stop that part and route to `ready-for-human`. So I stopped at "built and proven, dormant, as a proposal." ### What I landed / preserved (all two-way doors) - **Nothing on `main`** beyond your step 1. - **Branch `fleet-queue-watcher-301-proposal`** (pushed): a complete, offline-tested implementation you can review, run, adopt (merge + wire) or discard. - `fleet-queue-tick.sh` — one org-wide `issues/search` read; orders `priority` first then oldest `created_at` (the only cross-repo key); walks past `agent-working` / open-dependency-blocked candidates (bounded by `FLEET_HEAD_BUDGET`); dispatches **only the head ticket's repo** `swarm.yml` by delegating to `schedule-backstop.sh` pointed at that repo (so the "already covered" decision reuses ONE source of truth — the in-flight/queued guard, GOTCHAS 78/#238/#588); an **empty fleet dispatches nothing** (idle tick → no run → no holder). - `tests/fleet-queue-tick-test.sh` — 12 offline scenarios (shimmed `curl`, no network): older-repo-first; `priority` jumps the last-filed line; head repo woken and only that one; blocked/claimed head skipped to the next; empty fleet dispatches nothing; an in-flight head-repo swarm suppresses. `bash tests/fleet-queue-tick-test.sh` → `12 scenarios passed`. ### The rulings I'd propose (so the conversation is concrete — veto any line) 1. **Every pool host runs the tick** (not one host). Per-ticket claiming makes a double-dispatch harmless (a second host's leg hits the claim and stands down), only noisy; and the delegated guard with `HOST_NAME` **cleared** treats *any* host's in-flight leg of the head repo as "covered", so two watchers collapse onto one dispatch. Cheapest, most resilient, no single-host dependency. 2. **"A slot is free" is not tracked by the watcher.** It dispatches the head repo and lets swarm.yml's existing host-capacity flock decide — both slots busy → the leg yields in seconds, the next tick re-dispatches. The watcher only ensures the dispatch goes to the **head** repo, fast, not to whichever repo's cron fires next. 3. **Per-host leg rule (GOTCHAS 62/64):** unchanged. The watcher dispatches `swarm.yml`; the one-leg-per-host matrix and the per-host in-flight discrimination stay exactly as they are. 4. **Drive yield (#111) and #213 starvation yield:** unchanged and still authoritative. The watcher never claims; it only wakes a repo. A reserved drive or a starved-peer want-file still makes the woken leg stand down via the existing mounts — the #213 mechanism generalises in spirit ("someone is ahead of me") without a second rail. 5. **No `labeled` trigger (#103):** the ~2-min pickup comes from the tick interval, never a label webhook. ### Residue that is genuinely yours (the live-cron rollout) - Wire the watcher into the host-cron render (`host-state-lib.sh`): a new every-host crontab line (~1–2 min), a new owned entrypoint, host-state-lib tests updated — then `onboard-host install` on the pool hosts. (Touches live crontabs.) - Reduce `swarm.yml`'s `:15,:45` cron to a pure backstop (protected path) once the watcher is primary. - Paint the Floor so an idle tick shows free slots (or a queue check as a queue check) — you already flagged this as a dev-factory follow-up. - Pick the token/host for the org-wide dispatcher (the swarm-bot token has org write; confirm that's the one you want doing fleet dispatch). Veto anytime — relabel to `ready-for-session` (adopt the proposal as-is) or edit the rulings and a session will wire it.
Author
Owner

Ruling (Ben, 2026-10-22)

One ticket per run. Each ticket, on close, asks for any dependant ticket; otherwise it gets the next in line from the queue.

What that changes in the proposal above:

  • Run length. maxIterations: 3 → 1 in main.mts. A run is one slot, one sandbox, one worker, one ticket. The fleet order holds exactly, because every ticket passes through the watcher's choice — no run claims its own repo's second and third tickets ahead of an older ticket elsewhere.
  • The "on close" step is the D5 self-rearm (report_self_rearm in report-lib.sh), which today re-dispatches its own repo whenever its own ready list is non-empty. It becomes:
    1. GET /repos/{owner}/{repo}/issues/{n}/blocks on the ticket just closed → the open issues it was blocking (Forgejo carries the repository per entry, so cross-repo dependants count). Keep those that are ready-for-agent, not agent-working, with every other blocker closed. If any: workflow_dispatch that ticket's repo with the ticket number as an input; the leg's lister puts that ticket first.
    2. Otherwise ask the fleet queue (points 1–2) for the head and dispatch the head's repo.
    3. Nothing ready → stand down; the watcher cron picks up tickets that become ready later.
  • Human closes already fire the swarm's closed trigger; the same rule applies in that leg: dependants of the closed ticket first, then the fleet order.
  • Point 4 is dropped. With one-ticket runs there is no mid-run to consult the fleet head from.

Reading to confirm: a dependant beats a priority ticket in another repo (dependants first, then the queue, as worded). Cost per ticket: one dispatch + one leg (~10–20 s observed) on top of the sandbox the ticket already got.

## Ruling (Ben, 2026-10-22) > One ticket per run. Each ticket, on close, asks for any dependant ticket; otherwise it gets the next in line from the queue. What that changes in the proposal above: - **Run length.** `maxIterations: 3` → `1` in `main.mts`. A run is one slot, one sandbox, one worker, one ticket. The fleet order holds exactly, because every ticket passes through the watcher's choice — no run claims its own repo's second and third tickets ahead of an older ticket elsewhere. - **The "on close" step is the D5 self-rearm** (`report_self_rearm` in `report-lib.sh`), which today re-dispatches its own repo whenever its own ready list is non-empty. It becomes: 1. `GET /repos/{owner}/{repo}/issues/{n}/blocks` on the ticket just closed → the open issues it was blocking (Forgejo carries the repository per entry, so cross-repo dependants count). Keep those that are `ready-for-agent`, not `agent-working`, with every *other* blocker closed. If any: `workflow_dispatch` that ticket's repo with the ticket number as an input; the leg's lister puts that ticket first. 2. Otherwise ask the fleet queue (points 1–2) for the head and dispatch the head's repo. 3. Nothing ready → stand down; the watcher cron picks up tickets that become ready later. - **Human closes** already fire the swarm's `closed` trigger; the same rule applies in that leg: dependants of the closed ticket first, then the fleet order. - **Point 4 is dropped.** With one-ticket runs there is no mid-run to consult the fleet head from. Reading to confirm: a dependant beats a `priority` ticket in another repo (dependants first, then the queue, as worded). Cost per ticket: one dispatch + one leg (~10–20 s observed) on top of the sandbox the ticket already got.

This was generated by AI during triage.

Ruled by agent under ADR 0174 — veto anytime.

This headless triage pass saw #301 as untriaged — it carries agent-working + enhancement and no triage-state label, so preflight-triage.sh (the source-of-truth predicate) surfaces it. Reconstructing the timeline, that's because of a deliberate maintainer action at 07:23Z, not a gap:

  • 05:13Z bot → ready-for-session
  • 05:15Z a session claimed it (agent-working), built + offline-proved the fleet-queue-watcher proposal
  • 05:38Z bot → ready-for-human (released the claim) because the "who yields to whom" design call looked like a human-decision gate
  • 07:09Z you posted a full design ruling (one ticket per run — maxIterations: 3→1 in main.mts; the "on close" step becomes the D5 self-rearm in report-lib.sh doing a /blocks dependant-first dispatch then the fleet head; point 4 dropped)
  • 07:23Z you removed ready-for-human and hand-added agent-working

Ruling: resting triage state is ready-for-session (category enhancement, kept). Your 07:09Z ruling dissolved the human-decision gate that justified ready-for-human — you made the design calls (run length, yield rules, the self-rearm shape). What remains is executable, and it's session-standing work, not swarm-worker work: it edits main.mts, .forgejo/workflows/swarm.yml (a fingerprinted protected path), report-lib.sh, and wires a host cron — none of which a containerised ready-for-agent worker may touch. So ready-for-session, matching the original 05:13Z triage before the (now-cleared) gate.

Why this is a two-way door: the label is additive and fully reversible, and the change itself is one cron tick + ordering/dispatch/self-rearm logic, revertible by a later commit. It's provable by the offline suite the proposal already carries (tests/fleet-queue-tick-test.sh, 12 scenarios) plus the acceptance checks in the body. None of the one-way-door list applies.

What I did — minimal and non-destructive: I added ready-for-session and touched none of your labels — agent-working stays exactly as you set it. A ready-for-session ticket carrying agent-working is the normal shape of a claimed session ticket, so this is coherent, and it stops #301 reading as untriaged on every future pass.

Two things to flag for your veto:

  1. The 07:23Z agent-working is hand-set with no backing claim (no claim-marker comment from a run after it). janitor_sweep re-arms an agent-working ticket whose claim it can't prove live — and it re-arms to ready-for-agent, which would be the wrong lane for this work (swarm worker vs. the protected paths above) and would conflict with the ready-for-session I just set. If you meant agent-working as a transient "I'm on it" marker, fine; if you want it to rest, ready-for-session alone is the stable state.
  2. If instead you're actively driving a session on this right now, nothing here disturbs that — leave both labels; the branch fleet-queue-watcher-301-proposal from the 05:38Z session plus your 07:09Z ruling are the starting contract.

Veto anytime — drop ready-for-session, or relabel as you see fit.

> *This was generated by AI during triage.* **Ruled by agent under ADR 0174 — veto anytime.** This headless triage pass saw #301 as untriaged — it carries `agent-working` + `enhancement` and **no triage-state label**, so `preflight-triage.sh` (the source-of-truth predicate) surfaces it. Reconstructing the timeline, that's because of a deliberate maintainer action at 07:23Z, not a gap: - 05:13Z bot → `ready-for-session` - 05:15Z a session claimed it (`agent-working`), built + offline-proved the fleet-queue-watcher proposal - 05:38Z bot → `ready-for-human` (released the claim) because the "who yields to whom" design call looked like a human-decision gate - **07:09Z you posted a full design ruling** (one ticket per run — `maxIterations: 3→1` in `main.mts`; the "on close" step becomes the D5 self-rearm in `report-lib.sh` doing a `/blocks` dependant-first dispatch then the fleet head; point 4 dropped) - **07:23Z you removed `ready-for-human` and hand-added `agent-working`** **Ruling:** resting triage state is **`ready-for-session`** (category `enhancement`, kept). Your 07:09Z ruling *dissolved* the human-decision gate that justified `ready-for-human` — you made the design calls (run length, yield rules, the self-rearm shape). What remains is executable, and it's session-standing work, not swarm-worker work: it edits `main.mts`, `.forgejo/workflows/swarm.yml` (a fingerprinted protected path), `report-lib.sh`, and wires a host cron — none of which a containerised `ready-for-agent` worker may touch. So `ready-for-session`, matching the original 05:13Z triage before the (now-cleared) gate. **Why this is a two-way door:** the label is additive and fully reversible, and the change itself is one cron tick + ordering/dispatch/self-rearm logic, revertible by a later commit. It's provable by the offline suite the proposal already carries (`tests/fleet-queue-tick-test.sh`, 12 scenarios) plus the acceptance checks in the body. None of the one-way-door list applies. **What I did — minimal and non-destructive:** I **added `ready-for-session`** and **touched none of your labels** — `agent-working` stays exactly as you set it. A `ready-for-session` ticket carrying `agent-working` is the normal shape of a claimed session ticket, so this is coherent, and it stops #301 reading as untriaged on every future pass. **Two things to flag for your veto:** 1. The 07:23Z `agent-working` is **hand-set with no backing claim** (no claim-marker comment from a run after it). `janitor_sweep` re-arms an `agent-working` ticket whose claim it can't prove live — and it re-arms to **`ready-for-agent`**, which would be the wrong lane for this work (swarm worker vs. the protected paths above) and would conflict with the `ready-for-session` I just set. If you meant `agent-working` as a transient "I'm on it" marker, fine; if you want it to rest, `ready-for-session` alone is the stable state. 2. If instead you're actively driving a session on this right now, nothing here disturbs that — leave both labels; the branch `fleet-queue-watcher-301-proposal` from the 05:38Z session plus your 07:09Z ruling are the starting contract. Veto anytime — drop `ready-for-session`, or relabel as you see fit.

#301 design analysis — ADR 0174 agent (session-runner on matou-workstation), 2026-10-22. Ruled by agent under ADR 0174 — veto anytime.

This ticket is flagged "design conversation needed — who yields to whom" and sits under Blocked on Ben in STATUS.md. Step 1 (the ready list is oldest-first within each group) was the only unambiguous two-way-door slice, and it landed with this ticket's filing commit (1aa946b). The watcher itself turns on a set of fairness rulings reserved for a human — ADR 0005 reserves capacity/fairness judgements for a person, and ADR 0174 rule 2 stops at a one-way door. So this session did the two-way-door work that remains: proved the mechanism against the live forge, caught a gap in the proposal, and reduced each open question to a single pick — then relabelled ready-for-human. Each decision below is phrased so a ruling is one choice.

Feasibility, proven live (2026-10-22)

  1. The org-wide read works — but owner=Matou over-captures. GET /repos/issues/search?owner=Matou&state=open&type=issues&labels=ready-for-agent&limit=50 returned 27 ready tickets across repos, each carrying repository.full_name, created_at and labels — enough to order the whole fleet in one call. Gap in the proposal (step 1): the search also returns repos that are not swarm consumers — e.g. Matou/coa had 4 ready tickets in the probe, and coa has no vendored swarm.yml to dispatch. The watcher MUST intersect the org read with the actual consumer set, never dispatch to any Matou repo wearing the label. See D0.

  2. Dispatch is cheap and storm-safe. The swarm workflow has no concurrency group (cancel-in-progress: false, no group: — GOTCHAS 64 = UnlimitedConcurrency, .forgejo/workflows/swarm.yml:42), so a dispatch never queues behind another run; a leg that lands on a busy host yields in seconds on the heavy-slot flock (GOTCHAS 62). Storm protection is already the flocks + closed-only trigger + ready-set debounce + per-ticket claiming (GOTCHAS 32/35). Repeated/overlapping dispatches are tolerable by design — the cost is noise, not safety.

  3. The dispatch call already exists. schedule-backstop.sh:176-179 does POST /actions/workflows/swarm.yml/dispatches {"ref":"main"} per repo, guarded by (a) an in-flight read of actions/tasks (waiting/running/started-in-window, per-host name match — GOTCHAS 62 / #238) and (b) a queued-run read of actions/runs?status=waiting (GOTCHAS 78). The watcher should reuse this path per head repo, never reimplement the guard.

Decisions for Ben (each a single pick)

D0 — Consumer-set filter (new, from finding 1). The watcher dispatches only repos that are swarm consumers.

  • Recommend: feed it the consumer list host-side — the same list backstop-tick.sh already loops over — and intersect it with the org read. No product strings in the harness (CLAUDE.md); the list is host/identity config.

D1 — What "the head's repo" actually buys. Dispatch is per-repo and fans to every host as per-host legs (GOTCHAS 62); the watcher can only choose WHICH repo to wake, not which ticket — the woken repo's list-ready-tasks.sh (now oldest-first) picks the head ticket. So "fleet head" = the repo whose head ticket is fleet-first; dispatch it, the leg claims it.

  • Recommend: accept this — no new claim path, the per-repo lister stays the within-repo scheduler.
  • Residue to rule: the proposal says "drive blockers keep their precedence inside their repo." Fleet-wide, does a drive blocker in repo B jump an older plain head in repo A? (a) fleet order is purely priority then created_at, drive-blocker precedence stays strictly within-repo; (b) drive blockers are a fleet-global top tier above priority. Recommend (a) — a drive blocker already front-runs its own repo's queue, and the repo is dispatched by its head's fleet rank.

D2 / D5 — "When a slot is free" = which host, and one watcher or every host's. Slots are per-host flocks (host-capacity-lib.sh, 2 by default); a dispatch wakes all hosts; the host with a free slot claims, others yield cheaply. So "dispatch when a slot is free" cannot target a host — it means "dispatch when SOME consumer-serving host has a free heavy slot."

  • Option A (recommend): every pool host runs the watcher on its own cron; each dispatches the fleet head only when ITS OWN heavy pool has a free slot (a local flock probe — no new cross-host state). Double-dispatch across hosts is deduped by the backstop's in-flight/queued guards down to ~one run. Matches the per-host-leg philosophy (each host decides for itself, GOTCHAS 62); no single point of failure; reuses the host-capacity read, which already excludes drive-reserved capacity (D3).
  • Option B: one designated host (e.g. the Floor host elitebook-03) runs the watcher and reads a fleet-aggregated free-slot view (the collector already builds host occupancy for the Floor). Fewer dispatches, but a SPOF and a new cross-host read.
  • Ruling needed: A (resilient, noisier) vs B (quiet, SPOF). I recommend A — the guards make the noise cheap and it has no SPOF.

D3 — Drive-yield gate (#111). A drive reservation holds host capacity; a dispatched leg already yields to it mid-run (list-ready-tasks.sh:47-52 answers [] on /run/host-signals/drive-wanted). Under Option A the watcher's local free-slot probe reads the same host_capacity pool the drive reserves (exclusive, or slot-1 under drive-exclusive slot), so a drive already shows as "no free slot."

  • Recommend: no new logic — just require the watcher's free-slot probe to BE the host_capacity read, not a naive count.

D4 — #213 generalisation (the deepest call). Today #213 is reactive: a repo writes a want-file after 3 starved ticks (swarm-yield-signal.sh); peers' legs answer [] and free the slot (list-ready-tasks.sh:75-85). Step 4 proposes generalising to "someone is ahead of me": a leg consults the fleet head and stands down if another repo holds the older/higher ticket.

  • Risk: strict fleet-order yield can idle slots. A host has 2 heavy slots but the ceiling is one worker per host per repo (GOTCHAS 62); if the fleet head and the next-in-line are the SAME repo, the second slot can't take that repo and, under strict yield, won't take the next repo either → underutilisation.
  • Options: (a) v1 ships ordering only — reactive #213 stays the safety net, and the watcher's dispatch order already delivers fleet order at pickup; (b) proactive fleet yield gating only the last free slot (always run the fleet head, fill remaining slots with next-in-fleet-order, never idle); (c) strict fleet yield.
  • Recommend (a) for v1, (b) as a fast-follow once the watcher is proven. (b)/(c) need the fleet head mirrored into every sandbox (the #111/#213 host-signals mechanism generalised) — more moving parts, best landed after the watcher exists.

D6 — The :15/:45 cron and the Floor empty-leg noise. The watcher (1–2 min) becomes the primary pickup; the ticket wants the cron reduced "to a backstop" so the empty holders stop. But those holders are the per-host legs each writing a ticket/run holder (run-swarm.sh:190, ref=run) before standing down no-ready-tasks — they come from EVERY scheduled run. The watcher only dispatches a repo with a ready head AND a free slot, so watcher-driven runs rarely stand down empty; the empty holders come from the unconditional :15/:45 cron.

  • Options: (a) keep the cron as a pure backstop (unchanged cadence) — empty holders persist and the Floor paints them (the ticket itself flags this as a "dev-factory follow-up either way"); (b) lengthen/remove the swarm cron, leaning on the watcher + backstop-tick.sh + report_self_rearm.
  • Recommend: land the watcher first with the cron unchanged (purely additive, fully revertible), measure, then decide (b) as a follow-up. Cutting the cron before the watcher is proven is the risky, hard-to-revert half.

Why not just a labeled trigger (settled, not re-opened)

#103 / GOTCHAS 32: Forgejo delivers a label add and a label remove as one label_updated action with no label field, firing on every agent-working toggle — 2,700 no-op runs on 2026-08-26 (swarm.yml:3-12). The watcher's polling cron is the accepted alternative; it honours this by polling, never triggering.

  • Older of two claimed first → D1 ordering (org-wide created_at ascending).
  • priority filed last claimed first → list-ready-tasks priority tier + fleet priority-first.
  • Readied within ~2 min, no labeled trigger → watcher cron 1–2 min, polling (see #103).
  • Idle ticks leave no holder → D6 (the human-gated / follow-up AC — recommend a separate dev-factory follow-up).
  • Offline tests + journal + STATUS row → part of the build, once the above are ruled.

Why human

The build turns on rulings reserved for a human (ADR 0005: capacity/fairness judgements; ADR 0174 rule 2): D2/D5 (every-host vs one-host watcher and how free-slot is read), D4 (reactive vs proactive fleet yield and the slot-utilisation trade-off), and D6 (whether/when to cut the :15/:45 cron). These shape the whole mechanism and interact with the per-host leg rule (GOTCHAS 62/64), the #111 drive yield and the #213 peer yield; building before the ruling risks churn and a storm-class regression — the very #103 / GOTCHAS 78 failure mode this ticket is careful about. The two-way-door work is done: feasibility proven against the live forge, the consumer-set gap caught (D0), and each question reduced to a pick. Relabelled ready-for-session → ready-for-human.

(D0 is also fileable as a standalone follow-up regardless of the larger ruling — the watcher cannot be correct without it.)

**#301 design analysis — ADR 0174 agent (session-runner on matou-workstation), 2026-10-22. Ruled by agent under ADR 0174 — veto anytime.** This ticket is flagged **"design conversation needed — who yields to whom"** and sits under *Blocked on Ben* in `STATUS.md`. Step 1 (the ready list is oldest-first within each group) was the only unambiguous two-way-door slice, and it landed with this ticket's filing commit (`1aa946b`). The watcher itself turns on a set of fairness rulings reserved for a human — ADR 0005 reserves capacity/fairness judgements for a person, and ADR 0174 rule 2 stops at a one-way door. So this session did the **two-way-door work that remains**: proved the mechanism against the live forge, caught a gap in the proposal, and reduced each open question to a single pick — then relabelled `ready-for-human`. Each decision below is phrased so a ruling is one choice. ## Feasibility, proven live (2026-10-22) 1. **The org-wide read works — but `owner=Matou` over-captures.** `GET /repos/issues/search?owner=Matou&state=open&type=issues&labels=ready-for-agent&limit=50` returned 27 ready tickets across repos, each carrying `repository.full_name`, `created_at` and `labels` — enough to order the whole fleet in one call. **Gap in the proposal (step 1):** the search also returns repos that are **not swarm consumers** — e.g. `Matou/coa` had 4 ready tickets in the probe, and coa has no vendored `swarm.yml` to dispatch. The watcher MUST intersect the org read with the actual consumer set, never dispatch to any Matou repo wearing the label. See **D0**. 2. **Dispatch is cheap and storm-safe.** The swarm workflow has **no concurrency group** (`cancel-in-progress: false`, no `group:` — GOTCHAS 64 = `UnlimitedConcurrency`, `.forgejo/workflows/swarm.yml:42`), so a dispatch never queues behind another run; a leg that lands on a busy host yields in seconds on the heavy-slot flock (GOTCHAS 62). Storm protection is already the flocks + `closed`-only trigger + ready-set debounce + per-ticket claiming (GOTCHAS 32/35). Repeated/overlapping dispatches are tolerable *by design* — the cost is noise, not safety. 3. **The dispatch call already exists.** `schedule-backstop.sh:176-179` does `POST /actions/workflows/swarm.yml/dispatches {"ref":"main"}` per repo, guarded by (a) an in-flight read of `actions/tasks` (waiting/running/started-in-window, per-host name match — GOTCHAS 62 / #238) and (b) a queued-run read of `actions/runs?status=waiting` (GOTCHAS 78). The watcher should **reuse this path per head repo**, never reimplement the guard. ## Decisions for Ben (each a single pick) **D0 — Consumer-set filter (new, from finding 1).** The watcher dispatches only repos that are swarm consumers. - *Recommend:* feed it the consumer list host-side — the same list `backstop-tick.sh` already loops over — and intersect it with the org read. No product strings in the harness (CLAUDE.md); the list is host/identity config. **D1 — What "the head's repo" actually buys.** Dispatch is per-repo and fans to every host as per-host legs (GOTCHAS 62); the watcher can only choose WHICH repo to wake, not which ticket — the woken repo's `list-ready-tasks.sh` (now oldest-first) picks the head ticket. So "fleet head" = the repo whose head ticket is fleet-first; dispatch it, the leg claims it. - *Recommend:* accept this — no new claim path, the per-repo lister stays the within-repo scheduler. - *Residue to rule:* the proposal says "drive blockers keep their precedence inside their repo." Fleet-wide, does a drive blocker in repo B jump an older plain head in repo A? (a) fleet order is purely `priority` then `created_at`, drive-blocker precedence stays strictly within-repo; (b) drive blockers are a fleet-global top tier above `priority`. *Recommend (a)* — a drive blocker already front-runs its own repo's queue, and the repo is dispatched by its head's fleet rank. **D2 / D5 — "When a slot is free" = which host, and one watcher or every host's.** Slots are per-host flocks (`host-capacity-lib.sh`, 2 by default); a dispatch wakes all hosts; the host with a free slot claims, others yield cheaply. So "dispatch when a slot is free" cannot target a host — it means "dispatch when SOME consumer-serving host has a free heavy slot." - **Option A (recommend):** every pool host runs the watcher on its own cron; each dispatches the fleet head only when ITS OWN heavy pool has a free slot (a local flock probe — no new cross-host state). Double-dispatch across hosts is deduped by the backstop's in-flight/queued guards down to ~one run. Matches the per-host-leg philosophy (each host decides for itself, GOTCHAS 62); no single point of failure; reuses the host-capacity read, which already excludes drive-reserved capacity (D3). - **Option B:** one designated host (e.g. the Floor host `elitebook-03`) runs the watcher and reads a fleet-aggregated free-slot view (the collector already builds host occupancy for the Floor). Fewer dispatches, but a SPOF and a new cross-host read. - *Ruling needed:* A (resilient, noisier) vs B (quiet, SPOF). I recommend **A** — the guards make the noise cheap and it has no SPOF. **D3 — Drive-yield gate (#111).** A drive reservation holds host capacity; a dispatched leg already yields to it mid-run (`list-ready-tasks.sh:47-52` answers `[]` on `/run/host-signals/drive-wanted`). Under Option A the watcher's local free-slot probe reads the same `host_capacity` pool the drive reserves (exclusive, or slot-1 under `drive-exclusive slot`), so a drive already shows as "no free slot." - *Recommend:* no new logic — just require the watcher's free-slot probe to BE the `host_capacity` read, not a naive count. **D4 — #213 generalisation (the deepest call).** Today #213 is reactive: a repo writes a want-file after 3 starved ticks (`swarm-yield-signal.sh`); peers' legs answer `[]` and free the slot (`list-ready-tasks.sh:75-85`). Step 4 proposes generalising to "someone is ahead of me": a leg consults the fleet head and stands down if another repo holds the older/higher ticket. - *Risk:* strict fleet-order yield can **idle slots**. A host has 2 heavy slots but the ceiling is one worker per host per repo (GOTCHAS 62); if the fleet head and the next-in-line are the SAME repo, the second slot can't take that repo and, under strict yield, won't take the next repo either → underutilisation. - *Options:* (a) v1 ships **ordering only** — reactive #213 stays the safety net, and the watcher's dispatch order already delivers fleet order at pickup; (b) proactive fleet yield gating only the **last** free slot (always run the fleet head, fill remaining slots with next-in-fleet-order, never idle); (c) strict fleet yield. - *Recommend (a) for v1, (b) as a fast-follow* once the watcher is proven. (b)/(c) need the fleet head mirrored into every sandbox (the #111/#213 host-signals mechanism generalised) — more moving parts, best landed after the watcher exists. **D6 — The :15/:45 cron and the Floor empty-leg noise.** The watcher (1–2 min) becomes the primary pickup; the ticket wants the cron reduced "to a backstop" so the empty holders stop. But those holders are the per-host legs each writing a `ticket/run` holder (`run-swarm.sh:190`, `ref=run`) before standing down `no-ready-tasks` — they come from EVERY scheduled run. The watcher only dispatches a repo with a ready head AND a free slot, so watcher-driven runs rarely stand down empty; the empty holders come from the unconditional :15/:45 cron. - *Options:* (a) keep the cron as a pure backstop (unchanged cadence) — empty holders persist and the Floor paints them (the ticket itself flags this as a "dev-factory follow-up either way"); (b) lengthen/remove the swarm cron, leaning on the watcher + `backstop-tick.sh` + `report_self_rearm`. - *Recommend:* land the watcher first with the cron **unchanged** (purely additive, fully revertible), measure, then decide (b) as a follow-up. Cutting the cron before the watcher is proven is the risky, hard-to-revert half. ## Why not just a `labeled` trigger (settled, not re-opened) #103 / GOTCHAS 32: Forgejo delivers a label add and a label remove as one `label_updated` action with no `label` field, firing on every `agent-working` toggle — 2,700 no-op runs on 2026-08-26 (`swarm.yml:3-12`). The watcher's polling cron is the accepted alternative; it honours this by polling, never triggering. ## Acceptance mapping (how the recommended design meets each AC) - *Older of two claimed first* → D1 ordering (org-wide `created_at` ascending). - *`priority` filed last claimed first* → `list-ready-tasks` priority tier + fleet priority-first. - *Readied within ~2 min, no `labeled` trigger* → watcher cron 1–2 min, polling (see #103). - *Idle ticks leave no holder* → **D6** (the human-gated / follow-up AC — recommend a separate dev-factory follow-up). - *Offline tests + journal + STATUS row* → part of the build, once the above are ruled. ## Why human The build turns on rulings reserved for a human (ADR 0005: capacity/fairness judgements; ADR 0174 rule 2): **D2/D5** (every-host vs one-host watcher and how free-slot is read), **D4** (reactive vs proactive fleet yield and the slot-utilisation trade-off), and **D6** (whether/when to cut the :15/:45 cron). These shape the whole mechanism and interact with the per-host leg rule (GOTCHAS 62/64), the #111 drive yield and the #213 peer yield; building before the ruling risks churn and a storm-class regression — the very #103 / GOTCHAS 78 failure mode this ticket is careful about. The two-way-door work is done: feasibility proven against the live forge, the consumer-set gap caught (D0), and each question reduced to a pick. Relabelled `ready-for-session` → `ready-for-human`. *(D0 is also fileable as a standalone follow-up regardless of the larger ruling — the watcher cannot be correct without it.)*
Author
Owner

Built and landed on main — ea10102 (ADR 0007, docs/journal/2026-10-22-301-landed.md)

Ben's ruling, as code:

  • One ticket per run. main.mts maxIterations: 1.
  • The fleet queue watcher (fleet-queue.sh over fleet-queue-lib.sh, vendored) runs from a host cron every two minutes (queue-schedule in the host registry → <home>/factory-cron/fleet-queue-tick.sh). When the host has a free pooled slot, no drive reservation and no dispatch in flight, it runs every registered repo's OWN list-ready-tasks.sh in parallel, merges them, orders fleet-wide (priority/drive blocker → created_at → number), promotes the dependants of recently closed tickets (Forgejo blocks, any repo), caches the order on the host, and workflow_dispatches the head's repo with inputs.ticket + inputs.host.
  • One dispatch is one run on one host. The other hosts' legs stand down on inputs.host before any slot; the dispatched leg works exactly inputs.ticket (mirrored into the sandbox as /run/host-signals/fleet-pick; the lister answers it or []) or stands down fleet-pick-gone.
  • On close, dependants first. The self-rearm calls the tick after-close <slug> <n>: close recorded on the host, dependants promoted, the pick dispatched to the same host with no slot gate. A closed-event leg records the close too, so a human's close promotes on the next tick.
  • Cron and closed legs are backstops reading the host cache: head elsewhere → fleet-head-elsewhere; head here → work it; no cache → the pre-#301 path. The slot holder is written only once a leg has a ticket, so idle ticks leave no "empty ticket" card on the Floor.

The design analysis's picks, as built: D0 the fleet is the host registry's repo set (no org-wide search, so no coa over-capture); D1 the watcher picks the ticket, not just the repo; D2/D5 every host watches for itself and dispatches to itself; D3 the watcher probes the same pool the drive reserves; D4 the #213 yield stands as it was (the cache gate adds the proactive half); D6 the :15/:45 cron stays as a backstop.

Tests: tests/fleet-queue-lib-test.sh (37), tests/fleet-queue-test.sh (22), new cases in the lister, schedule-lib, report-lib, run-swarm-stages, run-swarm-drive-yield, onboard-lib and host-state-lib suites; the full offline loop is green. No Actions API read (the #28 ratchet holds).

Rollout — owed, pull-only, human (relabelled ready-for-human)

  1. Bump each consumer's FACTORY_REF and this repo's self-pin to ea10102+.
  2. Re-render each consumer's swarm.yml (onboard.sh workflows …) — the dispatch inputs and the host stand-down.
  3. Re-run onboard-host enrol on each pool host — the queue-schedule cron line and the generated fleet-queue-tick.sh.

Until a host is re-enrolled its legs run the pre-#301 path; until a consumer is re-rendered a dispatch for it fires every host's leg (today's behaviour). Acceptance (older ticket first across repos, priority last-filed first, ~2 min pickup, no empty holders) is checkable live once all three are done.

## Built and landed on `main` — `ea10102` (ADR 0007, `docs/journal/2026-10-22-301-landed.md`) Ben's ruling, as code: - **One ticket per run.** `main.mts` `maxIterations: 1`. - **The fleet queue watcher** (`fleet-queue.sh` over `fleet-queue-lib.sh`, vendored) runs from a host cron every two minutes (`queue-schedule` in the host registry → `<home>/factory-cron/fleet-queue-tick.sh`). When the host has a free pooled slot, no drive reservation and no dispatch in flight, it runs every registered repo's OWN `list-ready-tasks.sh` in parallel, merges them, orders fleet-wide (`priority`/drive blocker → `created_at` → number), promotes the dependants of recently closed tickets (Forgejo `blocks`, any repo), caches the order on the host, and `workflow_dispatch`es the head's repo with **`inputs.ticket` + `inputs.host`**. - **One dispatch is one run on one host.** The other hosts' legs stand down on `inputs.host` before any slot; the dispatched leg works exactly `inputs.ticket` (mirrored into the sandbox as `/run/host-signals/fleet-pick`; the lister answers it or `[]`) or stands down `fleet-pick-gone`. - **On close, dependants first.** The self-rearm calls the tick `after-close <slug> <n>`: close recorded on the host, dependants promoted, the pick dispatched to the same host with no slot gate. A `closed`-event leg records the close too, so a human's close promotes on the next tick. - **Cron and `closed` legs are backstops** reading the host cache: head elsewhere → `fleet-head-elsewhere`; head here → work it; no cache → the pre-#301 path. The slot holder is written only once a leg has a ticket, so idle ticks leave no "empty ticket" card on the Floor. The design analysis's picks, as built: D0 the fleet is the host registry's repo set (no org-wide search, so no `coa` over-capture); D1 the watcher picks the **ticket**, not just the repo; D2/D5 every host watches for itself and dispatches to itself; D3 the watcher probes the same pool the drive reserves; D4 the #213 yield stands as it was (the cache gate adds the proactive half); D6 the :15/:45 cron stays as a backstop. Tests: `tests/fleet-queue-lib-test.sh` (37), `tests/fleet-queue-test.sh` (22), new cases in the lister, schedule-lib, report-lib, run-swarm-stages, run-swarm-drive-yield, onboard-lib and host-state-lib suites; the full offline loop is green. No Actions API read (the #28 ratchet holds). ## Rollout — owed, pull-only, human (relabelled `ready-for-human`) 1. Bump each consumer's `FACTORY_REF` and this repo's self-pin to `ea10102`+. 2. Re-render each consumer's `swarm.yml` (`onboard.sh workflows …`) — the dispatch inputs and the host stand-down. 3. Re-run `onboard-host enrol` on each pool host — the `queue-schedule` cron line and the generated `fleet-queue-tick.sh`. Until a host is re-enrolled its legs run the pre-#301 path; until a consumer is re-rendered a dispatch for it fires every host's leg (today's behaviour). Acceptance (older ticket first across repos, `priority` last-filed first, ~2 min pickup, no empty holders) is checkable live once all three are done.
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/dev-factory#301
No description provided.