enroll: approve-decline-live — the human gate's acts over HTTP and the device-add surfaces mounted #206

Closed
opened 2026-07-30 23:20:14 +00:00 by ben · 2 comments
Owner

Parent

Device-add spec #13 (P2-S4/S5 — approve-enroll-land, the human gate). Gap audit 2026-07-30 (post #191–#195 sweep of the composition roots and both app shells). Filed per the #191–#195 precedent: a close-out blocker of #183 found while preparing the run, confirmed by Ben.

What's true today

  • The ledger's Approve and Decline verbs are real and tested server-side. The pending strip reads live (#184). But the two acts have no transport at any layer: no endpoint in the spec, and the dashboard client fails loud by design (ADR 0100's honest posture — "a separate slice"). This is that slice.
  • The device-add mint + codes-ledger surfaces (#151) ride the production composition real but unmounted — their mount home was left a needs-design decision that was never taken.

What to build

  1. Spec endpoints for the two acts on the pending projection, served as a thin projection over the ledger's existing verbs — no seam change.
  2. The dashboard client's acts replace the fail-loud throws; an approve advances the card to approved honestly (approved ≠ enrolled — the honest split), a decline carries its reason.
  3. The device-add surfaces mount per the human ruling this ticket carries.

Acceptance criteria

  • Given a device on the pending strip, When the operator approves, Then the act lands over HTTP on the real ledger and the card advances to approved — enrolled only when the device actually lands
  • Given a decline with a reason, Then the row leaves the pending list and the reason is recorded
  • Given the mount ruling, When the operator navigates there, Then mint → code → call-in watch runs end-to-end from the UI

Task manifest

task: enroll:approve-decline-live
implements_seam: "enroll Operator face Approve/Decline (ADR 0055/0097) over HTTP — no seam change"
interface: "the pending strip's acts + the mounted device-add surfaces"
seam: "the enroll integration test grown over the two acts + a live-HTTP vitest driving approve/decline"
acceptance:
  - given: a pending call-in; when: approve/decline over HTTP; then: the real ledger verb lands and the strip reflects it honestly
depends_on: [control-plane:compose-enroll]
out_of_scope: [device-side transport (its own slice), decline/crash-resume detail screens]
needs_human_decision: ["where the device-add mint + codes-ledger surfaces mount (Fleet drill-in vs Settings vs own tab) — the deferred needs-design ruling"]

Blocked by

Blocks

#183 — leg B·2 ("both approved" happens here).

## Parent Device-add spec #13 (P2-S4/S5 — approve-enroll-land, the human gate). Gap audit 2026-07-30 (post #191–#195 sweep of the composition roots and both app shells). Filed per the #191–#195 precedent: a close-out blocker of #183 found while preparing the run, confirmed by Ben. ## What's true today - The ledger's Approve and Decline verbs are real and tested server-side. The pending strip reads live (#184). But the two acts have **no transport at any layer**: no endpoint in the spec, and the dashboard client fails loud by design (ADR 0100's honest posture — "a separate slice"). This is that slice. - The device-add mint + codes-ledger surfaces (#151) ride the production composition real but unmounted — their mount home was left a needs-design decision that was never taken. ## What to build 1. Spec endpoints for the two acts on the pending projection, served as a thin projection over the ledger's existing verbs — no seam change. 2. The dashboard client's acts replace the fail-loud throws; an approve advances the card to `approved` honestly (approved ≠ enrolled — the honest split), a decline carries its reason. 3. The device-add surfaces mount per the human ruling this ticket carries. ## Acceptance criteria - [ ] Given a device on the pending strip, When the operator approves, Then the act lands over HTTP on the real ledger and the card advances to approved — enrolled only when the device actually lands - [ ] Given a decline with a reason, Then the row leaves the pending list and the reason is recorded - [ ] Given the mount ruling, When the operator navigates there, Then mint → code → call-in watch runs end-to-end from the UI ## Task manifest ```yaml task: enroll:approve-decline-live implements_seam: "enroll Operator face Approve/Decline (ADR 0055/0097) over HTTP — no seam change" interface: "the pending strip's acts + the mounted device-add surfaces" seam: "the enroll integration test grown over the two acts + a live-HTTP vitest driving approve/decline" acceptance: - given: a pending call-in; when: approve/decline over HTTP; then: the real ledger verb lands and the strip reflects it honestly depends_on: [control-plane:compose-enroll] out_of_scope: [device-side transport (its own slice), decline/crash-resume detail screens] needs_human_decision: ["where the device-add mint + codes-ledger surfaces mount (Fleet drill-in vs Settings vs own tab) — the deferred needs-design ruling"] ``` ## Blocked by - #200 ## Blocks #183 — leg B·2 ("both approved" happens here).
Author
Owner

Ruling taken (Ben, 2026-07-30): the device-add surfaces mount on the Fleet tab — the Fleet drill-in option. Recorded as DDR 0109 (docs/adr/0109-design-device-add-mounts-fleet.md, commit fcb3ccc).

This confirms the design as drawn: p2-device-add-cli.mermaid already names S1 "Fleet → Add device", and DDR 0093/0101 §1 already make the Fleet tab the home of device-lifecycle standing surfaces. Settings rejected (operational act, not configuration); a new tab barred (ADR 0094's closed set). No flow or wireframe amendment needed.

The needs_human_decision in the manifest is resolved — this ticket is now pure wiring (endpoints for approve/decline + mount the built #151 surfaces at their drawn home). Re-labelled ready-for-agent; still blocked by #200 via the native dependency.

**Ruling taken (Ben, 2026-07-30): the device-add surfaces mount on the Fleet tab** — the Fleet drill-in option. Recorded as **DDR 0109** (`docs/adr/0109-design-device-add-mounts-fleet.md`, commit `fcb3ccc`). This confirms the design as drawn: `p2-device-add-cli.mermaid` already names S1 "Fleet → Add device", and DDR 0093/0101 §1 already make the Fleet tab the home of device-lifecycle standing surfaces. Settings rejected (operational act, not configuration); a new tab barred (ADR 0094's closed set). No flow or wireframe amendment needed. The `needs_human_decision` in the manifest is resolved — this ticket is now pure wiring (endpoints for approve/decline + mount the built #151 surfaces at their drawn home). Re-labelled `ready-for-agent`; still blocked by #200 via the native dependency.
Author
Owner

Done — landed on origin/main as b74049e (sandcastle: enroll:approve-decline-live #206).

What shipped:

  1. Transport for the two acts — POST /api/v1/enroll/pending/{id}/approve and .../decline project over the real ledger's Operator verbs (controlapi.EnrollActsService + WithEnrollPendingActs), no seam change. Approve mints the grant and spends the code, advancing the request to Approved (joining), never straight to Enrolled (the honest split, story 20); Decline records the reason on the Closure (ADR 0097). The pending strip read (#184) broadens to {pending, approved} so the approved card stays visible as joining. Wired to the one enroll ledger in the whole composition; fail-loud at rest.
  2. Dashboard client — the two fail-loud throws (enrollClient.ts) become real postEnrollApprove/postEnrollDecline POSTs. Approve honestly returns 503 where no community CA is wired (enroll.ErrNoCA, ADR 0111 — wiring the CA into production is #210's separate follow-up).
  3. Mount (DDR 0109) — the device-add mint + codes-ledger surfaces (#151) mount on the Fleet tab: FleetSurface opens DeviceAddSurface / EnrollmentCodesSurface in place from the DF list's "+ Add device" / "Enrollment codes", and "+ New code" in the ledger switches to mint over the same mount — mint → code → call-in runs end-to-end from Fleet.

Evidence: internal/controlapi/enroll_integration_test.go (grown over the two acts: approve advances / decline records reason / no-CA 503 / terminal 409); control-plane/cmd/control-plane/compose_enroll_test.go (TestComposeEnroll_WholeActsOverRealLedger + resting fail-loud); dashboard/tests/unit/pendingActsLive.test.ts (live-HTTP vitest driving approve/decline through the strip) + fleet.test.ts (Fleet-tab mount tests). OpenAPI spec + generated client regenerated (ADR 0037). Dashboard suite 697 green; Go seam verified by CI (no local Go toolchain, #198). Unblocks #183 leg B·2 (both approved). STATUS.md updated (header + milestone log).

Done — landed on `origin/main` as `b74049e` (`sandcastle: enroll:approve-decline-live #206`). **What shipped:** 1. **Transport for the two acts** — `POST /api/v1/enroll/pending/{id}/approve` and `.../decline` project over the real ledger's Operator verbs (`controlapi.EnrollActsService` + `WithEnrollPendingActs`), no seam change. Approve mints the grant and spends the code, advancing the request to **Approved (joining), never straight to Enrolled** (the honest split, story 20); Decline records the reason on the `Closure` (ADR 0097). The pending strip read (#184) broadens to `{pending, approved}` so the approved card stays visible as joining. Wired to the one enroll ledger in the whole composition; fail-loud at rest. 2. **Dashboard client** — the two fail-loud throws (`enrollClient.ts`) become real `postEnrollApprove`/`postEnrollDecline` POSTs. Approve honestly returns **503** where no community CA is wired (`enroll.ErrNoCA`, ADR 0111 — wiring the CA into production is #210's separate follow-up). 3. **Mount (DDR 0109)** — the device-add mint + codes-ledger surfaces (#151) mount on the **Fleet tab**: `FleetSurface` opens `DeviceAddSurface` / `EnrollmentCodesSurface` in place from the DF list's "+ Add device" / "Enrollment codes", and "+ New code" in the ledger switches to mint over the same mount — mint → code → call-in runs end-to-end from Fleet. **Evidence:** `internal/controlapi/enroll_integration_test.go` (grown over the two acts: approve advances / decline records reason / no-CA 503 / terminal 409); `control-plane/cmd/control-plane/compose_enroll_test.go` (`TestComposeEnroll_WholeActsOverRealLedger` + resting fail-loud); `dashboard/tests/unit/pendingActsLive.test.ts` (live-HTTP vitest driving approve/decline through the strip) + `fleet.test.ts` (Fleet-tab mount tests). OpenAPI spec + generated client regenerated (ADR 0037). Dashboard suite 697 green; Go seam verified by CI (no local Go toolchain, #198). Unblocks #183 leg B·2 (both approved). STATUS.md updated (header + milestone log).
ben closed this issue 2026-07-31 06:31:08 +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/idss#206
No description provided.