shell: codes-ledger-both-surfaces — one enrollment-codes ledger, two views #36

Closed
opened 2026-07-25 04:54:51 +00:00 by ben · 1 comment
Owner

Parent

Feature spec: #22 (shell).

What to build

The enrollment-codes ledger as it appears on both surfaces — the operator app (A4, docs/ux/wireframes/shell/shell-a4-enrollment-codes-ledger.html) and the web dashboard (DF2, docs/ux/wireframes/shell/shell-df2-enrollment-codes-dashboard-ledger.html) — as one ledger read two ways. Each surface lists every code with its masked value, scope, status (active / used / expired / revoked), created-by attribution, and expiry, read through enroll's Operator face ListCodes with CodeView.CreatedBy. This is ADR 0097's one additive enroll amendment: shell reads, enroll owns; A4 and DF2 are two views of the one ledger, not two stores. By the never-empty rule (DDR 0095), the ledger opens with founding's spent gateway code — the first node enrolled through the one mechanism (ADR 0028) — never a blank table.

Shell never becomes a second minting path: "+ New code" begins device-add's in-flow generation (edge A4 → P2-S1 / DF2 → P2-S1) — MintCode stays device-add's. "Revoke" on an active code runs enroll's RevokeCode (the house-key discipline; edge A4 → A4 self-loop, ADR 0097). When a code's state changes, both windows reflect the one enroll ledger.

Note: this slice carries the additive enroll read (ADR 0097) — ListCodes + CodeView.CreatedBy, recorded in docs/seams/agent-control-plane.md in the established additive style; nothing confirmed moves. Buildable against a faked enroll adapter.

Acceptance criteria

  • (story 21) Given the code ledger, When A4 (app) or DF2 (dashboard) renders, Then it lists each code with its masked value, scope, status (active/used/expired/revoked), created-by attribution, and expiry — read through enroll's Operator-face ListCodes with CodeView.CreatedBy (ADR 0097's one additive enroll amendment); shell reads, enroll owns.
  • (story 21 / story 30) Given the never-empty rule (DDR 0095), When the ledger renders, Then it opens with founding's spent gateway code (the first node enrolled through the one mechanism, ADR 0028) — never a blank table.
  • (story 22) Given A4/DF2, When I choose "+ New code", Then device-add's in-flow generation begins (edge A4 → P2-S1 / DF2 → P2-S1) — shell never mints; When I choose "Revoke" on an active code, Then enroll's RevokeCode runs (the house-key discipline; edge A4 → A4 self-loop, ADR 0097).
  • (story 22) Given the ledger appears on both surfaces, When a code's state changes, Then both windows reflect the one enroll ledger (A4 and DF2 are two views of one truth, not two stores).

Blocked by

  • #29 — DF2 mounts in the dashboard frame
  • #28 — A4 opens from the app home (HO → A4)
  • #26 — the enroll seam (with the additive ListCodes + CreatedBy)

Task manifest

task: shell:codes-ledger-both-surfaces
implements_flow: shell
implements_edge: HO→A4, DF→DF2, A4→A4 (revoke), A4→P2-S1, DF2→P2-S1
wireframe:
  - docs/ux/wireframes/shell/shell-a4-enrollment-codes-ledger.html
  - docs/ux/wireframes/shell/shell-df2-enrollment-codes-dashboard-ledger.html
interface: enroll's Operator face — ListCodes returning CodeView (masked value, scope, status, expiry, the additive CreatedBy attribution) and RevokeCode; shell reads both surfaces from this one ledger and never mints (MintCode stays device-add's)
seam: enroll ledger-read tests (ListCodes/CreatedBy) — faked enroll adapter; asserts both-surface rendering with CreatedBy, the never-empty spent founding-code row, the never-mint routing to device-add, RevokeCode on active codes, and one-ledger-two-views consistency
acceptance:
  - given: the code ledger
    when: A4 or DF2 renders
    then: each code lists masked value, scope, status, created-by attribution, and expiry via ListCodes + CodeView.CreatedBy; shell reads, enroll owns
  - given: the never-empty rule
    when: the ledger renders
    then: it opens with founding's spent gateway code, never a blank table
  - given: A4/DF2
    when: I choose "+ New code" or "Revoke"
    then: "\"+ New code\" begins device-add's generation (shell never mints); \"Revoke\" runs enroll's RevokeCode (A4 \u2192 A4 self-loop)"
  - given: the ledger on both surfaces
    when: a code's state changes
    then: both windows reflect the one enroll ledger (two views, not two stores)
depends_on: [ui-kit-mount-slot-contract, app-side-shell, bootstrap:enroll-seam]
out_of_scope: [MintCode / code generation (device-add's P2-S1), the enroll seam's own truth (its spec), the Fleet list and app homes that route here (own slices)]
needs_human_decision: []
## Parent Feature spec: #22 (shell). ## What to build The enrollment-codes ledger as it appears on both surfaces — the operator app (**A4**, `docs/ux/wireframes/shell/shell-a4-enrollment-codes-ledger.html`) and the web dashboard (**DF2**, `docs/ux/wireframes/shell/shell-df2-enrollment-codes-dashboard-ledger.html`) — as one ledger read two ways. Each surface lists every code with its masked value, scope, status (active / used / expired / revoked), **created-by attribution**, and expiry, read through `enroll`'s Operator face `ListCodes` with `CodeView.CreatedBy`. This is ADR 0097's one additive `enroll` amendment: shell reads, `enroll` owns; A4 and DF2 are two views of the one ledger, not two stores. By the never-empty rule (DDR 0095), the ledger opens with founding's spent gateway code — the first node enrolled through the one mechanism (ADR 0028) — never a blank table. Shell never becomes a second minting path: "+ New code" begins device-add's in-flow generation (edge A4 → P2-S1 / DF2 → P2-S1) — `MintCode` stays device-add's. "Revoke" on an active code runs `enroll`'s `RevokeCode` (the house-key discipline; edge A4 → A4 self-loop, ADR 0097). When a code's state changes, both windows reflect the one `enroll` ledger. Note: this slice carries the additive `enroll` read (ADR 0097) — `ListCodes` + `CodeView.CreatedBy`, recorded in `docs/seams/agent-control-plane.md` in the established additive style; nothing confirmed moves. Buildable against a faked `enroll` adapter. ## Acceptance criteria - [ ] (story 21) Given the code ledger, When A4 (app) or DF2 (dashboard) renders, Then it lists each code with its masked value, scope, status (active/used/expired/revoked), created-by attribution, and expiry — read through `enroll`'s Operator-face `ListCodes` with `CodeView.CreatedBy` (ADR 0097's one additive `enroll` amendment); shell reads, `enroll` owns. - [ ] (story 21 / story 30) Given the never-empty rule (DDR 0095), When the ledger renders, Then it opens with founding's spent gateway code (the first node enrolled through the one mechanism, ADR 0028) — never a blank table. - [ ] (story 22) Given A4/DF2, When I choose "+ New code", Then device-add's in-flow generation begins (edge A4 → P2-S1 / DF2 → P2-S1) — shell never mints; When I choose "Revoke" on an active code, Then `enroll`'s `RevokeCode` runs (the house-key discipline; edge A4 → A4 self-loop, ADR 0097). - [ ] (story 22) Given the ledger appears on both surfaces, When a code's state changes, Then both windows reflect the one `enroll` ledger (A4 and DF2 are two views of one truth, not two stores). ## Blocked by - #29 — DF2 mounts in the dashboard frame - #28 — A4 opens from the app home (HO → A4) - #26 — the `enroll` seam (with the additive `ListCodes` + `CreatedBy`) ## Task manifest ```yaml task: shell:codes-ledger-both-surfaces implements_flow: shell implements_edge: HO→A4, DF→DF2, A4→A4 (revoke), A4→P2-S1, DF2→P2-S1 wireframe: - docs/ux/wireframes/shell/shell-a4-enrollment-codes-ledger.html - docs/ux/wireframes/shell/shell-df2-enrollment-codes-dashboard-ledger.html interface: enroll's Operator face — ListCodes returning CodeView (masked value, scope, status, expiry, the additive CreatedBy attribution) and RevokeCode; shell reads both surfaces from this one ledger and never mints (MintCode stays device-add's) seam: enroll ledger-read tests (ListCodes/CreatedBy) — faked enroll adapter; asserts both-surface rendering with CreatedBy, the never-empty spent founding-code row, the never-mint routing to device-add, RevokeCode on active codes, and one-ledger-two-views consistency acceptance: - given: the code ledger when: A4 or DF2 renders then: each code lists masked value, scope, status, created-by attribution, and expiry via ListCodes + CodeView.CreatedBy; shell reads, enroll owns - given: the never-empty rule when: the ledger renders then: it opens with founding's spent gateway code, never a blank table - given: A4/DF2 when: I choose "+ New code" or "Revoke" then: "\"+ New code\" begins device-add's generation (shell never mints); \"Revoke\" runs enroll's RevokeCode (A4 \u2192 A4 self-loop)" - given: the ledger on both surfaces when: a code's state changes then: both windows reflect the one enroll ledger (two views, not two stores) depends_on: [ui-kit-mount-slot-contract, app-side-shell, bootstrap:enroll-seam] out_of_scope: [MintCode / code generation (device-add's P2-S1), the enroll seam's own truth (its spec), the Fleet list and app homes that route here (own slices)] needs_human_decision: [] ```
Author
Owner

Done in commit 044def2.

The enrollment-codes ledger read onto both surfaces as one ledger, two views — the operator app's A4 (app/src/components/shell/EnrollmentCodesScreen.vue) and the web dashboard's DF2 (dashboard/src/components/shell/EnrollmentCodesSurface.vue) — both mounting the SAME shared CodesLedgerScreen.vue over the SAME CodesLedgerSource (the narrow view of enroll's Operator face: ListCodes with CodeView.CreatedBy + RevokeCode), in the UI kit at packages/ui-kit/src/codesLedger.ts + .../components/CodesLedgerScreen.vue.

Acceptance:

  • (story 21) A4/DF2 render each code with masked value · scope · status (active/used/expired/revoked) · created-by attribution · expiry, read through ListCodes + CreatedBy — shell reads, enroll owns. ✅
  • (story 21/30) Never-empty (DDR 0095): opens on founding's spent gateway code (ADR 0028), never a blank table — enroll's truth, not a shell fabrication. ✅
  • (story 22) "+ New code" begins device-add's in-flow generation (edges A4/DF2 → P2-S1; MintCode stays device-add's); "Revoke" on an active code runs enroll's RevokeCode (A4 → A4 self-loop). ✅
  • (story 22) Two views of one truth, not two stores: both surfaces share one CodesLedgerSource, so a revoke through one is the same ledger the other re-reads. ✅

Evidence: 19 new tests — packages/ui-kit/tests/unit/codesLedger.test.ts (13, incl. one-ledger-two-views consistency + founding-only never-blank case), dashboard/tests/unit/enrollmentCodes.test.ts (3), app/tests/unit/enrollmentCodes.test.ts (3). vue-tsc + eslint clean across ui-kit/dashboard/app. STATUS.md updated (header + milestone log). The additive enroll read (ADR 0097) was already recorded in docs/seams/agent-control-plane.md by #26; nothing confirmed moved.

Out of scope and untouched: MintCode / code generation (device-add's), the enroll seam's own truth, the Fleet list / app homes that route here.

Done in commit `044def2`. The enrollment-codes ledger read onto **both surfaces** as **one ledger, two views** — the operator app's **A4** (`app/src/components/shell/EnrollmentCodesScreen.vue`) and the web dashboard's **DF2** (`dashboard/src/components/shell/EnrollmentCodesSurface.vue`) — both mounting the SAME shared `CodesLedgerScreen.vue` over the SAME `CodesLedgerSource` (the narrow view of `enroll`'s Operator face: `ListCodes` with `CodeView.CreatedBy` + `RevokeCode`), in the UI kit at `packages/ui-kit/src/codesLedger.ts` + `.../components/CodesLedgerScreen.vue`. **Acceptance:** - (story 21) A4/DF2 render each code with masked value · scope · status (active/used/expired/revoked) · created-by attribution · expiry, read through `ListCodes` + `CreatedBy` — shell reads, `enroll` owns. ✅ - (story 21/30) Never-empty (DDR 0095): opens on founding's spent gateway code (ADR 0028), never a blank table — enroll's truth, not a shell fabrication. ✅ - (story 22) "+ New code" begins device-add's in-flow generation (edges A4/DF2 → P2-S1; MintCode stays device-add's); "Revoke" on an active code runs `enroll`'s `RevokeCode` (A4 → A4 self-loop). ✅ - (story 22) Two views of one truth, not two stores: both surfaces share one `CodesLedgerSource`, so a revoke through one is the same ledger the other re-reads. ✅ **Evidence:** 19 new tests — `packages/ui-kit/tests/unit/codesLedger.test.ts` (13, incl. one-ledger-two-views consistency + founding-only never-blank case), `dashboard/tests/unit/enrollmentCodes.test.ts` (3), `app/tests/unit/enrollmentCodes.test.ts` (3). `vue-tsc` + eslint clean across ui-kit/dashboard/app. STATUS.md updated (header + milestone log). The additive `enroll` read (ADR 0097) was already recorded in `docs/seams/agent-control-plane.md` by #26; nothing confirmed moved. Out of scope and untouched: MintCode / code generation (device-add's), the `enroll` seam's own truth, the Fleet list / app homes that route here.
ben closed this issue 2026-07-25 10:56:04 +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#36
No description provided.