Fleet dispatcher slice 5: landing detection to the front of the fleet queue (ADR 0009) #358

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

Slice 5 of the fleet dispatcher (ADR 0009 (docs/adr/0009-one-dispatcher-allocates-picks-to-slots.md), #353). Blocked on slice 2 (the loop); parallel to slices 3–4.

Landing detection — detect, do not repair (ruling D: all four cases in v1). After a run has ended, the dispatcher notices these end-state anomalies and files each as a ticket at the front of the fleet queue, with the evidence named; it never auto-repairs them (decision 5):

  1. closed-but-not-on-main (commits absent);
  2. agent-working with no live run;
  3. an un-relanded rescue branch;
  4. a green unmerged agent PR.

The existing machinery does the repair — the rescue ladder, the idle landing sweep (#114), the stranded-close reopen (#283/#328). This slice only makes the anomaly a fact at the head of the line.

Acceptance: a ticket closed with its commits absent from main is surfaced within one detection pass, with the evidence named.

Ruled by ADR 0009 / #353.

Slice 5 of the fleet dispatcher (ADR 0009 (`docs/adr/0009-one-dispatcher-allocates-picks-to-slots.md`), #353). **Blocked on slice 2 (the loop); parallel to slices 3–4.** **Landing detection — detect, do not repair** (ruling D: all four cases in v1). After a run has ended, the dispatcher notices these end-state anomalies and files each as a ticket at the **front** of the fleet queue, with the evidence named; it never auto-repairs them (decision 5): 1. closed-but-not-on-`main` (commits absent); 2. `agent-working` with no live run; 3. an un-relanded rescue branch; 4. a green unmerged agent PR. The existing machinery does the repair — the rescue ladder, the idle landing sweep (#114), the stranded-close reopen (#283/#328). This slice only makes the anomaly a fact at the head of the line. Acceptance: a ticket closed with its commits absent from `main` is surfaced within one detection pass, with the evidence named. Ruled by ADR 0009 / #353.
Author
Member

This was generated by AI during triage.

Ruled by agent under ADR 0174 — veto anytime.

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

Slice 5 is detect-not-repair landing detection on the dispatcher (decision 5 / ruling D): it files (or re-arms) a ticket at the front of the fleet queue naming the evidence, and never auto-repairs — the existing rescue ladder / idle landing sweep (#114) / stranded-close reopen (#283/#328) do the repair. It lives on the dispatcher and the .forgejo/ surface, so same session standing as its siblings.

Why a two-way door: revertible by a label change; the slice only surfaces an anomaly as a ticket — it mutates no landing state and runs no repair, so a false detection costs one spurious ticket a human can close. Reversible by reverting the commit. Not on the one-way-door list.

What proves it: the stated acceptance — a ticket closed with its commits absent from main is surfaced within one detection pass, with the evidence named. Native dependency on #355 already recorded (parallel to slices 3–4).

> *This was generated by AI during triage.* **Ruled by agent under ADR 0174 — veto anytime.** **Ruling:** `ready-for-session` (category already `enhancement`). Slice 5 is detect-not-repair landing detection on the dispatcher (decision 5 / ruling D): it files (or re-arms) a ticket at the front of the fleet queue naming the evidence, and never auto-repairs — the existing rescue ladder / idle landing sweep (#114) / stranded-close reopen (#283/#328) do the repair. It lives on the dispatcher and the `.forgejo/` surface, so same session standing as its siblings. **Why a two-way door:** revertible by a label change; the slice only *surfaces* an anomaly as a ticket — it mutates no landing state and runs no repair, so a false detection costs one spurious ticket a human can close. Reversible by reverting the commit. Not on the one-way-door list. **What proves it:** the stated acceptance — a ticket closed with its commits absent from `main` is surfaced within one detection pass, with the evidence named. Native dependency on #355 already recorded (parallel to slices 3–4).
Author
Member

close-report — ADR 0009 slice 5 landed on main (advances #358)

What landed (e8ea248, pushed to main): landing detection for the fleet dispatcher. Each allocation pass the dispatcher now runs a detection pass that notices four end-state anomalies and surfaces each at the front of the fleet queue, naming the evidence — detect, do not repair (ADR 0009 decision 5 / ruling D):

  1. stranded-close — a ticket closed with its close-report commits absent from main;
  2. working-no-run — a ticket labelled agent-working that no fresh slot report holds;
  3. unrelanded-rescue — a sandcastle/rescue-* branch whose head is not on main;
  4. unmerged-pr — a green open agent/issue-* PR (gathered only on MERGE_AUTHORITY=agent-after-green repos, where the machinery was meant to merge it — under human a green PR awaiting a person is the normal state).

The repair stays the machinery that already exists (the janitor, the idle landing sweep #114, the stranded-close reopen #283/#328, the rescue ladder, a worker). Filing is gated by the dispatcher's mode, exactly like the allocation dispatch: shadow logs each anomaly with its evidence and files nothing (decision 6a); live files a priority ticket into the anomaly's own repo — at the front of the fleet order — idempotently (a title already open is re-armed, never re-filed). Every gather fails safe: a tracker read it cannot complete surfaces nothing for that case, never a bogus front-of-queue ticket.

Design shape — a PURE core (fleet_landing_detect over one facts bundle, all four rules offline-testable) + thin fail-safe gather edges (one curl per forge read, git merge-base for reachability), new vendored fleet-landing-detect-lib.sh; the per-pass wiring in fleet-dispatch.sh is runtime glue proven at the ends. Throttled to FLEET_DISPATCH_DETECT_INTERVAL (default 120 s); its only extra on-disk state is a rebuildable throttle stamp, so decision 2's "nothing it cannot rebuild" holds. No repo name / host / product path in the lib (blast radius).

Proof — TDD, red before green, full offline suite green (107 suites, 0 failed).

  • tests/fleet-landing-detect-lib-test.sh (NEW, 38) — the four rules + the live-run / null-repo suppressions + the empty-commit phrasing + the format lines; the gather over a shimmed curl and a throwaway git repo (envelope commit parse; reachability keeps the un-landed commit and flags an unresolvable one; rescue on-/off-main; agent PRs filtered to agent/issue-* with their combined status; the label-age grace); the merge-authority gate; the file seam (shadow logs + POSTs nothing; live POSTs a priority create once, then re-arms a duplicate).
  • tests/fleet-dispatch-test.sh (+5) — the acceptance end-to-end over a real git-repo checkout + crafted forge fixtures: a ticket closed with its commits absent from main is surfaced within one detection pass, with the evidence named; a cleanly-landed close is NOT surfaced; shadow files nothing; live files one priority ticket to the anomaly's repo.

State surface — STATUS.md #353 row records slice 5; docs/journal/2026-11-18-358-landing-detect.md; docs/deploy/fleet-dispatcher.md gained a landing-detection section; fleet-landing-detect-lib.sh added to onboarding/vendor-manifest (reaches consumers at the next pin bump — pull-only, ADR 0001). The saturated STATUS budget forced compacting the CLOSED #40 post-mortem (its full diagnosis stays on the ticket + in git history).

Inert until the staged gos ADR 0009 decision 6 reserves for a human (never an agent): point each pool host's FLEET_DISPATCHER_URL at the receiver, then flip FLEET_DISPATCH_MODE=live (slice 4 / #357) — live is also when the detector files priority tickets rather than only logging them. The running self-copy sees this only at a human pin bump (.sandcastle/FACTORY_REF, GOTCHAS 4).

Ruled by agent under ADR 0174 — veto anytime. Two-way door: shadow (the default this ships) writes nothing a human must undo; turning it off is FLEET_DISPATCH_DETECT=off or stopping the process.

## close-report — ADR 0009 slice 5 landed on `main` (advances #358) **What landed** (`e8ea248`, pushed to `main`): landing detection for the fleet dispatcher. Each allocation pass the dispatcher now runs a detection pass that notices four end-state anomalies and surfaces each at the **front** of the fleet queue, **naming the evidence** — *detect, do not repair* (ADR 0009 decision 5 / ruling D): 1. **stranded-close** — a ticket closed with its close-report commits absent from `main`; 2. **working-no-run** — a ticket labelled `agent-working` that no fresh slot report holds; 3. **unrelanded-rescue** — a `sandcastle/rescue-*` branch whose head is not on `main`; 4. **unmerged-pr** — a green open `agent/issue-*` PR (gathered only on `MERGE_AUTHORITY=agent-after-green` repos, where the machinery was meant to merge it — under `human` a green PR awaiting a person is the normal state). The repair stays the machinery that already exists (the janitor, the idle landing sweep #114, the stranded-close reopen #283/#328, the rescue ladder, a worker). Filing is gated by the dispatcher's mode, exactly like the allocation dispatch: **shadow** logs each anomaly with its evidence and files nothing (decision 6a); **live** files a `priority` ticket into the anomaly's own repo — at the front of the fleet order — idempotently (a title already open is re-armed, never re-filed). Every gather fails safe: a tracker read it cannot complete surfaces nothing for that case, never a bogus front-of-queue ticket. **Design shape** — a PURE core (`fleet_landing_detect` over one facts bundle, all four rules offline-testable) + thin fail-safe gather edges (one `curl` per forge read, `git merge-base` for reachability), new vendored `fleet-landing-detect-lib.sh`; the per-pass wiring in `fleet-dispatch.sh` is runtime glue proven at the ends. Throttled to `FLEET_DISPATCH_DETECT_INTERVAL` (default 120 s); its only extra on-disk state is a rebuildable throttle stamp, so decision 2's "nothing it cannot rebuild" holds. No repo name / host / product path in the lib (blast radius). **Proof — TDD, red before green, full offline suite green (107 suites, 0 failed).** - `tests/fleet-landing-detect-lib-test.sh` (NEW, 38) — the four rules + the live-run / null-repo suppressions + the empty-commit phrasing + the format lines; the gather over a shimmed `curl` and a throwaway git repo (envelope commit parse; reachability keeps the un-landed commit and flags an unresolvable one; rescue on-/off-main; agent PRs filtered to `agent/issue-*` with their combined status; the label-age grace); the merge-authority gate; the file seam (shadow logs + POSTs nothing; live POSTs a `priority` create once, then re-arms a duplicate). - `tests/fleet-dispatch-test.sh` (+5) — the **acceptance** end-to-end over a real git-repo checkout + crafted forge fixtures: *a ticket closed with its commits absent from `main` is surfaced within one detection pass, with the evidence named*; a cleanly-landed close is NOT surfaced; shadow files nothing; live files one `priority` ticket to the anomaly's repo. **State surface** — `STATUS.md` #353 row records slice 5; `docs/journal/2026-11-18-358-landing-detect.md`; `docs/deploy/fleet-dispatcher.md` gained a landing-detection section; `fleet-landing-detect-lib.sh` added to `onboarding/vendor-manifest` (reaches consumers at the next pin bump — pull-only, ADR 0001). The saturated STATUS budget forced compacting the CLOSED #40 post-mortem (its full diagnosis stays on the ticket + in git history). **Inert until the staged gos ADR 0009 decision 6 reserves for a human** (never an agent): point each pool host's `FLEET_DISPATCHER_URL` at the receiver, then flip `FLEET_DISPATCH_MODE=live` (slice 4 / #357) — live is also when the detector files `priority` tickets rather than only logging them. The running self-copy sees this only at a human pin bump (`.sandcastle/FACTORY_REF`, GOTCHAS 4). Ruled by agent under ADR 0174 — veto anytime. Two-way door: shadow (the default this ships) writes nothing a human must undo; turning it off is `FLEET_DISPATCH_DETECT=off` or stopping the process.
matou-build-agent 2026-11-18 23:13:56 +00:00
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.

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