control-plane: compose-enroll — register the built enroll faces in the composition root #200

Closed
opened 2026-07-30 23:19:57 +00:00 by ben · 1 comment
Owner

Parent

Device-add spec #13. 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

  • WithEnroll (#151: the codes ledger — mint/list/revoke — and the install config, ADR 0054/0097) and WithEnrollPending (#184: the pending projection) are built and integration-tested, but neither is registered in the control plane's composition root. STATUS.md twice defers this to "the compose ticket's job" (the #128→#155 precedent) — this is that ticket, it had never been filed.
  • In production every /enroll/* route 404s: no code can mint, no pending device can be listed. The dashboard's live device-add clients (#151/#184) point at nothing.

What to build

Register both faces per the ADR 0107 whole-or-resting discipline: the whole composition serves them over the real enroll ledger with the real EnrollConfig (community domain / release channel read from the config repo's vars, ADR 0054); the resting composition keeps the honest resting answers. Extend the composition seam tests to prove both branches.

Acceptance criteria

  • Given the whole composition, When the codes face is driven, Then mint→list→revoke and the install config serve the real ledger over HTTP
  • Given the whole composition, When a device calls in, Then the pending projection lists it with its real probed fields
  • Given the resting composition, When the same routes are driven, Then the honest resting answers — never a fake (ADR 0100)

Task manifest

task: control-plane:compose-enroll
implements_seam: "enroll seam Operator face (ADR 0055/0097) + EnrollConfig (ADR 0054) + ADR 0107 whole-or-resting"
interface: "the control plane's enroll routes, live in production"
seam: "the composition seam tests, extended over both branches"
acceptance:
  - given: the whole composition; when: the enroll routes are driven; then: real ledger + real config serve — mint, list, revoke, pending, config
depends_on: []
out_of_scope: [approve/decline acts (their own slice), device-side transport (its own slice), surface mounting]
needs_human_decision: []

Blocks

#183 — leg B·2 (no enrollment code can mint without it).

## Parent Device-add spec #13. 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 - `WithEnroll` (#151: the codes ledger — mint/list/revoke — and the install config, ADR 0054/0097) and `WithEnrollPending` (#184: the pending projection) are built and integration-tested, but neither is registered in the control plane's composition root. STATUS.md twice defers this to "the compose ticket's job" (the #128→#155 precedent) — this is that ticket, it had never been filed. - In production every `/enroll/*` route 404s: no code can mint, no pending device can be listed. The dashboard's live device-add clients (#151/#184) point at nothing. ## What to build Register both faces per the ADR 0107 whole-or-resting discipline: the whole composition serves them over the real enroll ledger with the real `EnrollConfig` (community domain / release channel read from the config repo's vars, ADR 0054); the resting composition keeps the honest resting answers. Extend the composition seam tests to prove both branches. ## Acceptance criteria - [ ] Given the whole composition, When the codes face is driven, Then mint→list→revoke and the install config serve the real ledger over HTTP - [ ] Given the whole composition, When a device calls in, Then the pending projection lists it with its real probed fields - [ ] Given the resting composition, When the same routes are driven, Then the honest resting answers — never a fake (ADR 0100) ## Task manifest ```yaml task: control-plane:compose-enroll implements_seam: "enroll seam Operator face (ADR 0055/0097) + EnrollConfig (ADR 0054) + ADR 0107 whole-or-resting" interface: "the control plane's enroll routes, live in production" seam: "the composition seam tests, extended over both branches" acceptance: - given: the whole composition; when: the enroll routes are driven; then: real ledger + real config serve — mint, list, revoke, pending, config depends_on: [] out_of_scope: [approve/decline acts (their own slice), device-side transport (its own slice), surface mounting] needs_human_decision: [] ``` ## Blocks #183 — leg B·2 (no enrollment code can mint without it).
Author
Owner

Done in f57f673 (on origin/main).

Registered both enroll faces in the control planes composition root:

  • Whole composition serves the codes face (WithEnroll) and the pending strip (WithEnrollPending) over the ONE real *enroll.Ledger — the same instance the fleet-state projection and Overview already read (no second reader) — with a real EnrollConfig: community_domain = the gateway apex (/get, ADR 0054/0113), release_channel = a compiled-in generic Matou app channel (https://releases.matou.nz/app; the app is never community-specific, ADR 0054).
  • Resting composition answers honestly (ADR 0100/0107): restingEnroll returns empty codes/pending reads and an honest config (no apex -> empty community domain), and fails loud on mint/revoke rather than fabricate a code no durable ledger holds. No route 404s.

Acceptance:

  1. Whole codes face: mint->list->revoke + install config over HTTP against the real ledger — proven by TestComposeEnroll_WholeServesRealLedgerAndConfig.
  2. Whole pending: a called-in+paired device lists with its real probed hostname — TestComposeEnroll_WholeListsRealPendingDevice.
  3. Resting: honest empty reads + honest config + fail-loud acts, never a fake — TestComposeEnroll_RestingAnswersHonestly.

Evidence: control-plane/cmd/control-plane/compose_enroll_test.go (composition seam over both branches, driven over HTTP), plus the wiring in compose.go / whole_composition.go / resting_composition.go / main.go.

Unblocks #183 leg B.2.

NB: verified by careful review only — the Sandcastle sandbox still has no Go toolchain (issue #198), so go build/vet/test could not run here.

Done in f57f673 (on origin/main). Registered both enroll faces in the control planes composition root: - **Whole composition** serves the codes face (`WithEnroll`) and the pending strip (`WithEnrollPending`) over the ONE real `*enroll.Ledger` — the same instance the fleet-state projection and Overview already read (no second reader) — with a real `EnrollConfig`: `community_domain` = the gateway apex (`/get`, ADR 0054/0113), `release_channel` = a compiled-in generic Matou app channel (`https://releases.matou.nz/app`; the app is never community-specific, ADR 0054). - **Resting composition** answers honestly (ADR 0100/0107): `restingEnroll` returns empty codes/pending reads and an honest config (no apex -> empty community domain), and fails loud on mint/revoke rather than fabricate a code no durable ledger holds. No route 404s. Acceptance: 1. Whole codes face: mint->list->revoke + install config over HTTP against the real ledger — proven by `TestComposeEnroll_WholeServesRealLedgerAndConfig`. 2. Whole pending: a called-in+paired device lists with its real probed hostname — `TestComposeEnroll_WholeListsRealPendingDevice`. 3. Resting: honest empty reads + honest config + fail-loud acts, never a fake — `TestComposeEnroll_RestingAnswersHonestly`. Evidence: `control-plane/cmd/control-plane/compose_enroll_test.go` (composition seam over both branches, driven over HTTP), plus the wiring in `compose.go` / `whole_composition.go` / `resting_composition.go` / `main.go`. Unblocks #183 leg B.2. NB: verified by careful review only — the Sandcastle sandbox still has no Go toolchain (issue #198), so `go build/vet/test` could not run here.
ben closed this issue 2026-07-31 04:41:16 +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#200
No description provided.