Fleet dispatcher slice 1: the host slot report (ADR 0009) #354

Closed
opened 2026-11-18 20:09:52 +00:00 by matou-build-agent · 3 comments

Slice 1 of the fleet dispatcher (ADR 0009 (docs/adr/0009-one-dispatcher-allocates-picks-to-slots.md), #353).

The host slot report. Define the report shape — the full slot state a pool host emits — shared with fleet-tui's collector so there is one description of a host's slots, and wire the three send points of ruling A:

  • a run takes a slot;
  • a run ends (the end-of-ticket action);
  • the host's two-minute tick (the periodic floor that keeps the picture correct when a host dies without sending an end event).

Dispatches nothing — this slice only produces the reports the dispatcher (slice 2) will consume. Offline-tested (both-ends contract tests for the report shape; main.mts inline pollers can't run in the offline bash suite).

Two-way door, workable now. Reuses fleet-queue-lib.sh idioms; no product literals in harness files (CLAUDE.md blast radius).

Ruled by ADR 0009 / #353.

Slice 1 of the fleet dispatcher (ADR 0009 (`docs/adr/0009-one-dispatcher-allocates-picks-to-slots.md`), #353). **The host slot report.** Define the report shape — the full slot state a pool host emits — shared with `fleet-tui`'s collector so there is one description of a host's slots, and wire the three send points of ruling A: - a run **takes** a slot; - a run **ends** (the end-of-ticket action); - the host's two-minute **tick** (the periodic floor that keeps the picture correct when a host dies without sending an end event). Dispatches nothing — this slice only produces the reports the dispatcher (slice 2) will consume. Offline-tested (both-ends contract tests for the report shape; `main.mts` inline pollers can't run in the offline bash suite). Two-way door, workable now. Reuses `fleet-queue-lib.sh` idioms; no product literals in harness files (CLAUDE.md blast radius). Ruled by ADR 0009 / #353.
Author
Member

This was generated by AI during triage.

Ruling: ready-for-human (category already enhancement).

Slice 1 defines the host slot-report shape (shared with fleet-tui's collector, fleet-tui/collector.py) and wires the three send points of ADR 0009 ruling A — slot taken, run ended (the end-of-ticket seam), the two-minute tick — into the harness scheduler (fleet-queue-lib.sh idioms, the tick in .forgejo/workflows/swarm.yml). It dispatches nothing.

Codebase check. Nothing like this exists yet (grep for slot[-_ ]report across the shell/py/mts sources is empty), matching ADR 0009's "nothing here is built". No .out-of-scope/ entry resembles it. The reused pieces (fleet-queue-lib.sh, fleet-tui/collector.py) are present. The slice is offline-testable as its body states (both-ends contract tests for the report shape; main.mts inline pollers are out of the bash suite's reach).

Why human

The human residue is Ben's acceptance of the proposed ADR 0009 central-allocator posture — the authorization to begin building the dispatcher at all. ADR 0009 is status proposed ("nothing here is built"); #353 reserves for Ben "accepting or vetoing the proposed central-allocator posture and authorising the staged rollout gos", and the decomposition journal (docs/journal/2026-11-18-353-slices.md) states the slices were filed enhancement-only "so nothing builds toward an un-accepted posture" and that "On acceptance, label #354 onto a work lane and the slice DAG carries the build." #354 is the designated acceptance gate: it is the DAG root (#355 depends on it), so labelling it onto a work lane is what releases the whole slice chain.

This is the same shape as the #357 ruling: under ADR 0174 I rule technical two-way doors myself, and slice 1's code is textbook two-way (additive, reversible by revert/label change, offline-provable, consumes nothing, on no one-way-door list). But I do not override a decision the deciding human has explicitly reserved for himself in a standing (here, proposed) ADR. The residue is the authorization to act on an unaccepted proposal, not a technical door. That residue sits squarely on Ben. The ready-for-session label this ticket briefly carried at creation was deliberately removed (20:18:38, this same session) to realize exactly that hold.

On acceptance (what releases this): relabel #354 off ready-for-human onto a work lane. Per the protected paths it touches (fleet-queue-lib.sh — vendored byte-identical to every consumer, CLAUDE.md blast radius — and .forgejo/workflows/swarm.yml), the lane is ready-for-session, not ready-for-agent (the swarm queue reads only ready-for-agent; this must not reach a swarm worker). That matches the sibling slices.

Flag for Ben (not actioned here). The sibling slices #355/#356/#358 are currently ready-for-session and #357 ready-for-human, whereas the decomposition journal's stated intent was to hold all slices off work lanes until acceptance. They are harmless in place — each is DAG-blocked behind #354, so none can be worked until slice 1 lands — but if you want the journal's "hold until acceptance" posture to read consistently on the tracker, #355/#356/#358 want dropping back to enhancement-only too. I have left the already-triaged siblings untouched rather than revert another triage ruling unasked.

> *This was generated by AI during triage.* **Ruling:** `ready-for-human` (category already `enhancement`). Slice 1 defines the host slot-report shape (shared with `fleet-tui`'s collector, `fleet-tui/collector.py`) and wires the three send points of ADR 0009 ruling A — slot taken, run ended (the end-of-ticket seam), the two-minute tick — into the harness scheduler (`fleet-queue-lib.sh` idioms, the tick in `.forgejo/workflows/swarm.yml`). It dispatches nothing. **Codebase check.** Nothing like this exists yet (grep for `slot[-_ ]report` across the shell/py/mts sources is empty), matching ADR 0009's "nothing here is built". No `.out-of-scope/` entry resembles it. The reused pieces (`fleet-queue-lib.sh`, `fleet-tui/collector.py`) are present. The slice is offline-testable as its body states (both-ends contract tests for the report shape; `main.mts` inline pollers are out of the bash suite's reach). ## Why human The human residue is **Ben's acceptance of the proposed ADR 0009 central-allocator posture** — the authorization to *begin building the dispatcher at all*. ADR 0009 is status **proposed** ("nothing here is built"); #353 reserves for Ben "accepting or vetoing the proposed central-allocator posture and authorising the staged rollout gos", and the decomposition journal (`docs/journal/2026-11-18-353-slices.md`) states the slices were filed `enhancement`-only "so nothing builds toward an un-accepted posture" and that **"On acceptance, label #354 onto a work lane and the slice DAG carries the build."** #354 is the designated acceptance gate: it is the DAG root (#355 depends on it), so labelling it onto a work lane is what releases the whole slice chain. This is the same shape as the #357 ruling: under ADR 0174 I rule *technical* two-way doors myself, and slice 1's code is textbook two-way (additive, reversible by revert/label change, offline-provable, consumes nothing, on no one-way-door list). But I do not override a decision the deciding human has explicitly reserved for himself in a standing (here, proposed) ADR. The residue is the *authorization to act on an unaccepted proposal*, not a technical door. That residue sits squarely on Ben. The `ready-for-session` label this ticket briefly carried at creation was deliberately removed (20:18:38, this same session) to realize exactly that hold. **On acceptance (what releases this):** relabel #354 off `ready-for-human` onto a work lane. Per the protected paths it touches (`fleet-queue-lib.sh` — vendored byte-identical to every consumer, CLAUDE.md blast radius — and `.forgejo/workflows/swarm.yml`), the lane is **`ready-for-session`**, not `ready-for-agent` (the swarm queue reads only `ready-for-agent`; this must not reach a swarm worker). That matches the sibling slices. **Flag for Ben (not actioned here).** The sibling slices #355/#356/#358 are currently `ready-for-session` and #357 `ready-for-human`, whereas the decomposition journal's stated intent was to hold *all* slices off work lanes until acceptance. They are harmless in place — each is DAG-blocked behind #354, so none can be worked until slice 1 lands — but if you want the journal's "hold until acceptance" posture to read consistently on the tracker, #355/#356/#358 want dropping back to `enhancement`-only too. I have left the already-triaged siblings untouched rather than revert another triage ruling unasked.
Owner

ADR 0009 was accepted by Ben on 2026-11-18 (see #353). This slice is now queued: ready-for-session, and its dependency on the epic #353 is removed so the open tracking ticket does not block it. Protected-path surface, same lane as slices 2, 3 and 5.

ADR 0009 was accepted by Ben on 2026-11-18 (see #353). This slice is now queued: `ready-for-session`, and its dependency on the epic #353 is removed so the open tracking ticket does not block it. Protected-path surface, same lane as slices 2, 3 and 5.
Author
Member

Close report — ADR 0009 slice 1: the host slot report

Landed on main as 993d238 (push mode). This slice produces the host slot reports the dispatcher (slice 2, #355) will consume; it dispatches nothing and is inert until a host declares FLEET_DISPATCHER_URL.

What landed

  • fleet-slot-report-lib.sh (new, vendored) — builds one host slot report and pushes it to the dispatcher over the mesh, best-effort. The per-slot shape is deliberately the shape fleet-tui already keeps (snapshot._slots → collector._host_rows/_holder): {n, path, state (free|busy|unknown), issue, iteration, holder{kind, repo, worker, since, pid, pid_alive, ref}}, wrapped with {report_version, event, host, now, drive_reserved, ended}. One description of a host's slots, shared with the collector — no second parser.

    • Slot truth is the flock read from /proc/locks without taking a lock (the #138 lesson that moved fleet-tui's probe off grab-and-release); the holder sidecar is only a label beside a held lock (GOTCHAS 42), ignored beside a free one — exactly as snapshot._slots does. issue resolves from a numeric ref or the in-sandbox claim sink (claimed.log, #350, single-pick only).
    • No product literal: host from the env, slots from HOST_CAPACITY_SLOTS, dispatcher address host-declared (FLEET_DISPATCHER_URL, empty = no-op). FLEET_SLOT_REPORT_VERSION pins the shape (the probe.py/collector SNAPSHOT_VERSION precedent).
  • The three send points of ruling A wired:

    • take — run-swarm.sh, right after the slot's holder write.
    • end — fleet-queue.sh after-close/rearm (the end-of-ticket self-rearm seam), carrying the finishing ticket (ended, ADR decision 5).
    • tick — fleet-queue.sh tick, emitted before the slot gate so a busy host still reports its held slots (the periodic report that keeps the dispatcher correct when a host dies without an end event).

Proof

  • tests/fleet-slot-report-lib-test.sh — 34 checks over a crafted /proc/locks, fake holder sidecars and a shimmed curl: shape + version, state derivation (busy/free/unknown, orphan held-no-holder, stale-holder-beside-free-lock), issue resolution from ref and claimed.log (ambiguous → null), the end report naming the finishing ticket, the drive reservation surfacing, and the push (no-op without a URL; POST with bearer to the declared URL; a non-2xx swallowed).
  • tests/fleet-slot-report-contract-test.sh — 12 checks, the both-ends contract: the real bash producer's report feeds fleet-tui's own collector._host_rows/_run_rows unchanged. (run-swarm.sh's inline take emit rides main.mts and can't run in the offline bash suite, so the shape is proven at both ends instead.)
  • Full offline suite green: 102 passed, 0 failed (for t in tests/*.sh onboarding/tests/*.sh). tests/run-swarm-stages-test.sh line ceiling moved 200→202 for the one sourced lib + one delegated fleet_slot_report_emit take call (logic in the lib, not inline).
  • onboarding/tests/vendor-manifest-coverage-test.sh green (the new lib classified in vendor-manifest); docs-budget-test.sh green (STATUS back under budget).

Audit

Ruled by agent under ADR 0174 — veto anytime. Two-way door throughout: a new reversible library + delegated call sites, all offline-provable, dispatching nothing and inert until a host sets FLEET_DISPATCHER_URL (ADR 0009 decision 6's shadow stage). No one-way door touched — no credentials, no security-posture change, no data destruction, no spend. The central-allocator posture remains Ben's to accept on #353 (ready-for-human); this slice only adds the inert producer that decision 6(a) shadow needs regardless.

Journal: docs/journal/2026-11-18-354-slot-report.md. STATUS #353 blocker updated. Next: slice 2 (#355), the dispatcher that consumes these reports.

## Close report — ADR 0009 slice 1: the host slot report Landed on `main` as `993d238` (push mode). This slice **produces** the host slot reports the dispatcher (slice 2, #355) will consume; it **dispatches nothing** and is inert until a host declares `FLEET_DISPATCHER_URL`. ### What landed - **`fleet-slot-report-lib.sh`** (new, vendored) — builds *one* host slot report and pushes it to the dispatcher over the mesh, best-effort. The per-slot shape is deliberately the shape `fleet-tui` already keeps (`snapshot._slots` → `collector._host_rows`/`_holder`): `{n, path, state (free|busy|unknown), issue, iteration, holder{kind, repo, worker, since, pid, pid_alive, ref}}`, wrapped with `{report_version, event, host, now, drive_reserved, ended}`. One description of a host's slots, shared with the collector — no second parser. - Slot truth is the flock read from `/proc/locks` **without taking a lock** (the #138 lesson that moved `fleet-tui`'s probe off grab-and-release); the holder sidecar is only a label beside a held lock (GOTCHAS 42), ignored beside a free one — exactly as `snapshot._slots` does. `issue` resolves from a numeric `ref` or the in-sandbox claim sink (`claimed.log`, #350, single-pick only). - No product literal: host from the env, slots from `HOST_CAPACITY_SLOTS`, dispatcher address host-declared (`FLEET_DISPATCHER_URL`, empty = no-op). `FLEET_SLOT_REPORT_VERSION` pins the shape (the `probe.py`/collector `SNAPSHOT_VERSION` precedent). - **The three send points of ruling A** wired: - `take` — `run-swarm.sh`, right after the slot's holder write. - `end` — `fleet-queue.sh` `after-close`/`rearm` (the end-of-ticket self-rearm seam), carrying the finishing ticket (`ended`, ADR decision 5). - `tick` — `fleet-queue.sh` tick, emitted **before** the slot gate so a busy host still reports its held slots (the periodic report that keeps the dispatcher correct when a host dies without an end event). ### Proof - `tests/fleet-slot-report-lib-test.sh` — 34 checks over a crafted `/proc/locks`, fake holder sidecars and a shimmed curl: shape + version, state derivation (busy/free/unknown, orphan held-no-holder, stale-holder-beside-free-lock), issue resolution from `ref` and `claimed.log` (ambiguous → null), the `end` report naming the finishing ticket, the drive reservation surfacing, and the push (no-op without a URL; POST with bearer to the declared URL; a non-2xx swallowed). - `tests/fleet-slot-report-contract-test.sh` — 12 checks, the **both-ends contract**: the real bash producer's report feeds `fleet-tui`'s own `collector._host_rows`/`_run_rows` unchanged. (`run-swarm.sh`'s inline `take` emit rides `main.mts` and can't run in the offline bash suite, so the shape is proven at both ends instead.) - Full offline suite green: **102 passed, 0 failed** (`for t in tests/*.sh onboarding/tests/*.sh`). `tests/run-swarm-stages-test.sh` line ceiling moved 200→202 for the one sourced lib + one delegated `fleet_slot_report_emit take` call (logic in the lib, not inline). - `onboarding/tests/vendor-manifest-coverage-test.sh` green (the new lib classified in `vendor-manifest`); `docs-budget-test.sh` green (STATUS back under budget). ### Audit **Ruled by agent under ADR 0174 — veto anytime.** Two-way door throughout: a new reversible library + delegated call sites, all offline-provable, dispatching nothing and inert until a host sets `FLEET_DISPATCHER_URL` (ADR 0009 decision 6's shadow stage). No one-way door touched — no credentials, no security-posture change, no data destruction, no spend. The central-allocator *posture* remains Ben's to accept on #353 (`ready-for-human`); this slice only adds the inert producer that decision 6(a) shadow needs regardless. Journal: `docs/journal/2026-11-18-354-slot-report.md`. STATUS #353 blocker updated. Next: slice 2 (#355), the dispatcher that consumes these reports.
matou-build-agent 2026-11-18 21:39:27 +00:00
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.

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