Broker: a DEVICE-rent fault hook (the rehearsal-rentfail twin) so #1451 leg 14 device-fails-gateway-stands is deterministically drivable #1473

Closed
opened 2026-09-14 17:16:29 +00:00 by matou-build-agent · 3 comments

The broker needs a DEVICE-rent fault hook — the twin of the gateway rehearsal-rentfail slug

Split out of #1451 (the two-machine build drive). Its leg 14 — device-fails-gateway-stands — wants a deterministic added-device failure so the drive can prove the build stands the gateway up and hands over past a failed machine (DDR 0241 dec 4, #1461), showing the failed fleet-device card with its fault and no RUNNING pill, the community still usable.

Why the ticket's mechanism doesn't work. #1451 leg 14 specifies "rent the added device into a region the snapshot does not span (GOTCHAS #220 makes this deterministic)". But GOTCHAS #220's own rule makes an out-of-span region a claim-stage refusal the offer never lists — offer.regions = DO available ∩ the gateway snapshot's own regions[] (one region, syd1, today), and a pick is re-validated against that same intersection at rent time. So the founding rent picker cannot offer an out-of-span region for the drive to select through the UI; there is no deterministic device-reach failure to drive.

The fix (mirrors the gateway path). The gateway rent-fails-clean honesty leg is deterministic because the broker recognises a host whose slug starts with rehearsal-rentfail and, after a real Create, Destroys the box and returns a 502 stage provision (ADR 0047, broker/internal/broker/rentals.go; app/tests/e2e/fixtures/rented.ts RENTFAIL_PREFIX). Add the device twin: the broker's device-rent (#1460, POST /v1/devices/rent) recognises a rehearsal-fault device name/slug and refuses at reach with a named provision/reach-stage error, no half-rented box (ADR 0047). Then #1451's leg 14 asserts:

  • device:<id>:reach red with the broker's refusal (a remedy, not a hang);
  • the gateway rows green, finish runs;
  • the hand-off shows the failed fleet-device card with its fault and no RUNNING pill;
  • the community is usable (a sign-in leg).

Scope: broker Go change + a broker deploy (matou-ops), plus un-fixmeing leg 14 in journey.v2-fleet.spec.ts. Out of #1451's drive-authoring scope; #1451's leg 14 is carried as an honest test.fixme pointing here.

Ruled/filed by agent under ADR 0174 (a follow-up split per session rule 1 — file follow-ups rather than scope-creep the drive ticket).

## The broker needs a DEVICE-rent fault hook — the twin of the gateway `rehearsal-rentfail` slug Split out of **#1451** (the two-machine build drive). Its leg 14 — `device-fails-gateway-stands` — wants a *deterministic* added-device failure so the drive can prove the build stands the gateway up and hands over past a failed machine (DDR 0241 dec 4, #1461), showing the failed `fleet-device` card with its fault and no RUNNING pill, the community still usable. **Why the ticket's mechanism doesn't work.** #1451 leg 14 specifies "rent the added device into a region the snapshot does not span (GOTCHAS #220 makes this deterministic)". But GOTCHAS #220's own rule makes an out-of-span region a **claim-stage refusal the offer never lists** — `offer.regions` = DO available ∩ the gateway snapshot's own `regions[]` (one region, `syd1`, today), and a pick is re-validated against that same intersection at rent time. So the founding rent picker **cannot offer** an out-of-span region for the drive to select through the UI; there is no deterministic device-reach failure to drive. **The fix (mirrors the gateway path).** The gateway `rent-fails-clean` honesty leg is deterministic because the broker recognises a host whose slug starts with `rehearsal-rentfail` and, after a real Create, Destroys the box and returns a 502 stage `provision` (ADR 0047, `broker/internal/broker/rentals.go`; `app/tests/e2e/fixtures/rented.ts` `RENTFAIL_PREFIX`). Add the **device** twin: the broker's device-rent (#1460, `POST /v1/devices/rent`) recognises a rehearsal-fault device name/slug and refuses at reach with a named `provision`/`reach`-stage error, no half-rented box (ADR 0047). Then #1451's leg 14 asserts: - `device:<id>:reach` red with the broker's refusal (a remedy, not a hang); - the gateway rows green, `finish` runs; - the hand-off shows the failed `fleet-device` card with its fault and **no** RUNNING pill; - the community is usable (a `sign-in` leg). **Scope:** broker Go change + a broker deploy (matou-ops), plus un-`fixme`ing leg 14 in `journey.v2-fleet.spec.ts`. Out of #1451's drive-authoring scope; #1451's leg 14 is carried as an honest `test.fixme` pointing here. Ruled/filed by agent under ADR 0174 (a follow-up split per session rule 1 — file follow-ups rather than scope-creep the drive ticket).
Author
Member

This was generated by AI during triage.

Triage: enhancement + ready-for-session

Ruled by agent under ADR 0174 — veto anytime.

The ruling: enhancement, ready-for-session. Not needs-design, not redundant, not a one-way door.

Claim verified against the tree (HEAD):

  • The gateway rehearsal-rentfail honesty hook exists — broker/internal/broker/rentals.go recognises the prefix (strings.HasPrefix(slug, "rehearsal-rentfail"), ~L387/L418) and returns a provision-stage 502 after a real create+destroy; the Go model to mirror is TestGateway_RentFailHostIs502WithStage in http_rent_test.go.
  • The device twin does not exist: Rentals.RentDevice (rentals.go:492) has no rehearsal-fault recognition — only the ordinary destroy-on-error path. So this is not already-implemented.
  • The dependency is shipped: POST /v1/devices/rent (#1460, now closed) is live in http.go — no open blocker, no depends_on added.
  • Leg 14 is a genuine test.fixme (journey.v2-fleet.spec.ts:630) whose own message names exactly this missing broker hook.
  • No .out-of-scope/ entry resembles this; nothing prior-rejected.

Why a two-way door. Revertible by a later commit/label change; the broker Go hook is provable by a Go unit test mirroring the gateway rentfail test, and the leg by the live v2-fleet drive. It touches none of the one-way-door list: the fault prefix is a test-only branch on an already-authorised device-rent path (widens no surface, loosens no auth), no personal credentials, no member-facing trust accept, no data destruction; the drive rents-then-destroys lab droplets (routine lab spend). The broker deploy to matou-ops is a live-infra op with an established rollback pattern (ADR 0174 rule 1).

Why ready-for-session, not ready-for-agent. The work terminates in a broker deploy to matou-ops and its proof is leg 14 of the live v2-fleet drive (real helper + live broker + two real droplets). Both need an interactive session's standing — matou-ops deploy access and the live drive rail — which the swarm queue (ready-for-agent-only) deliberately excludes. This matches its parent #1451 and sibling #1450, both ready-for-session. Once the broker Go change lands on main, the deploy-pending rail carries the install/close per its normal broker-tree flow.

Actionable, and well-specified. Add the device-rent fault twin to RentDevice mirroring the gateway hook (a real create, then destroy, then a named provision/reach-stage *ProvisionError — no half-rented box, ADR 0047), with a Go unit test on the TestGateway_RentFailHostIs502WithStage model; add the device rentfail fixture helper alongside RENTFAIL_PREFIX/rentfailSlug; un-fixme leg 14 and assert device:<id>:reach red, gateway rows green + finish, the failed fleet-device card with its fault and no RUNNING pill, and a usable community (sign-in).

> *This was generated by AI during triage.* ## Triage: `enhancement` + `ready-for-session` **Ruled by agent under ADR 0174 — veto anytime.** **The ruling:** `enhancement`, `ready-for-session`. Not `needs-design`, not redundant, not a one-way door. **Claim verified against the tree (HEAD):** - The gateway `rehearsal-rentfail` honesty hook exists — `broker/internal/broker/rentals.go` recognises the prefix (`strings.HasPrefix(slug, "rehearsal-rentfail")`, ~L387/L418) and returns a `provision`-stage 502 after a real create+destroy; the Go model to mirror is `TestGateway_RentFailHostIs502WithStage` in `http_rent_test.go`. - The **device** twin does **not** exist: `Rentals.RentDevice` (rentals.go:492) has no rehearsal-fault recognition — only the ordinary destroy-on-error path. So this is not already-implemented. - The dependency is shipped: `POST /v1/devices/rent` (#1460, now **closed**) is live in `http.go` — no open blocker, no `depends_on` added. - Leg 14 is a genuine `test.fixme` (`journey.v2-fleet.spec.ts:630`) whose own message names exactly this missing broker hook. - No `.out-of-scope/` entry resembles this; nothing prior-rejected. **Why a two-way door.** Revertible by a later commit/label change; the broker Go hook is provable by a Go unit test mirroring the gateway rentfail test, and the leg by the live v2-fleet drive. It touches none of the one-way-door list: the fault prefix is a **test-only** branch on an already-authorised device-rent path (widens no surface, loosens no auth), no personal credentials, no member-facing trust accept, no data destruction; the drive rents-then-destroys lab droplets (routine lab spend). The broker deploy to matou-ops is a live-infra op with an established rollback pattern (ADR 0174 rule 1). **Why `ready-for-session`, not `ready-for-agent`.** The work terminates in a **broker deploy to matou-ops** and its proof is **leg 14 of the live v2-fleet drive** (real helper + live broker + two real droplets). Both need an interactive session's standing — matou-ops deploy access and the live drive rail — which the swarm queue (`ready-for-agent`-only) deliberately excludes. This matches its parent #1451 and sibling #1450, both `ready-for-session`. Once the broker Go change lands on main, the `deploy-pending` rail carries the install/close per its normal broker-tree flow. **Actionable, and well-specified.** Add the device-rent fault twin to `RentDevice` mirroring the gateway hook (a real create, then destroy, then a named `provision`/`reach`-stage `*ProvisionError` — no half-rented box, ADR 0047), with a Go unit test on the `TestGateway_RentFailHostIs502WithStage` model; add the device rentfail fixture helper alongside `RENTFAIL_PREFIX`/`rentfailSlug`; un-`fixme` leg 14 and assert `device:<id>:reach` red, gateway rows green + `finish`, the failed `fleet-device` card with its fault and no RUNNING pill, and a usable community (`sign-in`).
Author
Member

Ruled by agent under ADR 0174 — veto anytime. The two-way, provable half of this ticket is landed on main (7df3d0e0); the one-way residue is routed to a human.

What landed (two-way, proven)

  • Broker Go device-fault hook (broker/internal/broker/rentals.go): RentDevice now recognises a community whose slug starts with deviceRehearsalFaultPrefix (rehearsal-devfail) and, after a REAL Create, Destroys the box and returns a provision-stage *ProvisionError (errRehearsalDeviceFault) — the honest no-half-rented-device path (ADR 0047), the exact twin of the gateway rehearsal-rentfail slug. The transient image-lookup fault is decoupled as the gateway's is (#752, errRehearsalDeviceFaultNoLiveCreate).
    • The prefix DIFFERS from the gateway's on purpose. A founding on a rehearsal-devfail-<token> slug stands its GATEWAY up for real (Rent does not match rehearsal-rentfail) while only the ADDED device faults — DDR 0241 dec 4's build-stands-past-a-fault. This is what makes leg 14 (device-fails-gateway-stands) deterministically drivable, resolving the GOTCHAS #220 dead-end (an out-of-span region is a claim-stage refusal the picker never offers).
  • TS primitive: DEVFAIL_PREFIX / devfailSlug in app/tests/e2e/fixtures/rented.ts — the RENTFAIL_PREFIX / rentfailSlug twin, a per-drive rehearsal-devfail-<token> slug the picker never blocks.
  • Leg 14's test.fixme note in journey.v2-fleet.spec.ts rewritten to record the landed hook and name the gated remainder.
  • STATUS.md header entry added in the same commit.

Proof

  • TestDevice_RehearsalFaultSlugFailsCleanAtProvision (broker/internal/broker/http_device_test.go) — red→green (confirmed red with the hook reverted): 502 stage provision, a real create-then-destroy, no ledger lease, and the gateway rented under the SAME host still standing.
  • Full broker suite + go vet + gofmt -l clean.
  • rented.test.ts 24/24 (incl. a devfail slug does NOT trip the gateway hook); vue-tsc + eslint clean; playwright --list still collects the spec (1 drive + 2 fixmes).

Commit: 7df3d0e0.

Why human

The ticket's own scope names two steps this one-shot session on matou-workstation cannot take — both one-way / gated doors:

  1. Deploy the broker carrying this hook to matou-ops (broker.idss.nz). A production infra deploy to shared Matou infrastructure is outside a two-way door and outside this host's standing. Until it lands, a live drive finds no hook.
  2. Author + un-fixme the live leg 14 variant and run its two-box LIVE green — a founding on devfailSlug that stands the gateway and faults the added device, asserting device:<id>:reach red with the broker's refusal, the gateway rows green, finish runs, the hand-off shows the failed fleet-device card with its fault and NO running pill, and the community is usable (a sign-in leg). The two-box live green (KVM + live broker + DO) is the rehearsal-executor frontier, not a one-shot session's to run.

Step 2 is gated behind step 1 (un-fixme-ing before the deploy would red the next live v2-fleet run). Relabelled ready-for-human.

**Ruled by agent under ADR 0174 — veto anytime.** The two-way, provable half of this ticket is landed on `main` (`7df3d0e0`); the one-way residue is routed to a human. ## What landed (two-way, proven) - **Broker Go device-fault hook** (`broker/internal/broker/rentals.go`): `RentDevice` now recognises a community whose slug starts with `deviceRehearsalFaultPrefix` (`rehearsal-devfail`) and, after a REAL Create, Destroys the box and returns a `provision`-stage `*ProvisionError` (`errRehearsalDeviceFault`) — the honest no-half-rented-device path (ADR 0047), the exact twin of the gateway `rehearsal-rentfail` slug. The transient image-lookup fault is decoupled as the gateway's is (#752, `errRehearsalDeviceFaultNoLiveCreate`). - **The prefix DIFFERS from the gateway's on purpose.** A founding on a `rehearsal-devfail-<token>` slug stands its GATEWAY up for real (`Rent` does not match `rehearsal-rentfail`) while only the ADDED device faults — DDR 0241 dec 4's build-stands-past-a-fault. This is what makes leg 14 (device-fails-gateway-stands) *deterministically drivable*, resolving the GOTCHAS #220 dead-end (an out-of-span region is a claim-stage refusal the picker never offers). - **TS primitive:** `DEVFAIL_PREFIX` / `devfailSlug` in `app/tests/e2e/fixtures/rented.ts` — the `RENTFAIL_PREFIX` / `rentfailSlug` twin, a per-drive `rehearsal-devfail-<token>` slug the picker never blocks. - **Leg 14's `test.fixme` note** in `journey.v2-fleet.spec.ts` rewritten to record the landed hook and name the gated remainder. - **STATUS.md** header entry added in the same commit. ## Proof - `TestDevice_RehearsalFaultSlugFailsCleanAtProvision` (`broker/internal/broker/http_device_test.go`) — **red→green** (confirmed red with the hook reverted): 502 stage `provision`, a real create-then-destroy, no ledger lease, and the gateway rented under the SAME host still standing. - Full broker suite + `go vet` + `gofmt -l` clean. - `rented.test.ts` 24/24 (incl. a devfail slug does NOT trip the gateway hook); `vue-tsc` + eslint clean; `playwright --list` still collects the spec (1 drive + 2 fixmes). Commit: `7df3d0e0`. ## Why human The ticket's own scope names two steps this one-shot session on matou-workstation cannot take — both one-way / gated doors: 1. **Deploy the broker carrying this hook to matou-ops** (`broker.idss.nz`). A production infra deploy to shared Matou infrastructure is outside a two-way door and outside this host's standing. Until it lands, a live drive finds no hook. 2. **Author + un-fixme the live leg 14 variant and run its two-box LIVE green** — a founding on `devfailSlug` that stands the gateway and faults the added device, asserting `device:<id>:reach` red with the broker's refusal, the gateway rows green, `finish` runs, the hand-off shows the failed `fleet-device` card with its fault and NO running pill, and the community is usable (a `sign-in` leg). The two-box live green (KVM + live broker + DO) is the rehearsal-executor frontier, not a one-shot session's to run. Step 2 is gated behind step 1 (un-fixme-ing before the deploy would red the next live v2-fleet run). Relabelled `ready-for-human`.
Owner

Closed 2026-10-21 (Ben's ruling): folded into the drive checklist #2055 — the live proof this ticket still owed is now a checklist item there, to be carried by the next drives on the latest versions. A proof that fails on the drive becomes a NEW ticket; this one is not reopened.

Closed 2026-10-21 (Ben's ruling): folded into the drive checklist #2055 — the live proof this ticket still owed is now a checklist item there, to be carried by the next drives on the latest versions. A proof that fails on the drive becomes a NEW ticket; this one is not reopened.
ben 2026-10-21 21:50:26 +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.

Dependencies

No dependencies set.

Reference
Matou/idss#1473
No description provided.