Original sources · POC — architecture & contracts
Step 5b checklist — setup code & multi-mandate
Summarised in: Status & testing · Open questions
Step 5b — implementation checklist
Not frozen — update freely as work lands. Unlike contracts.md, this file's job is to
track how far step 5b's implementation has gotten, not to define the wire format itself. The
design is fixed in contracts.md §9 (Contract H), outil-local/spec.md
§3.1/§4.1/§5, and platform/spec.md §B5/§B5bis/A4 —
this file just turns that design into checkable, resumable work. Linked from the build-order
table in contracts.md §0 and architecture.md §12.1 (row 5b) so it's reachable from "the
main list" either way.
Done 2026-09-25. Every item below implemented and live-verified against the real stub + real PDS (Boot jar) — not just unit tests. Full detail in the memory body / commit; summary:
Platform — stub
-
POST /mandatesalso mints a setup code atomically (§9.1 step 2, §5.3) — response gainssetup_code/setup_redeem_url/setup_code_expires_at.setup_redeem_urlis built from the request's ownHostheader, not a fixed config value, so it's correct under both host and compose-net addressing without a new env var. -
POST /setup-codes/:code/redeem(§5.9, §9.2) — 200/404/410, burns on success - setup-codes in-memory
Map, same pattern aslinkSessions -
GET /mandates?itsme_sub=response gainsprovider_id+agent_labelper row (§5.6) - audit event
SETUP_CODE_REDEEMEDwired into the Trace Plateforme (§5.7) - tests: redeem happy path, double-redeem →
404, past-TTL →410, unknown code →404, atomic minting onPOST /mandates— 5 newnode:testcases, 34/34 green
Platform — SPA
- mandate form (
/mandate/new): pre-submit collision check —GET /mandates?itsme_sub=, filter byagent_label(any provider) +status:VALID+ not expired (§9.4) - collision prompt: Replace / Change label / Cancel — no "keep both" option (§B5)
- "Replace" calls
POST /mandates/:jti/revokeon the oldjtibefore proceeding - default
agent_labelchanged to<provider-name>-<firstname>(wasclaude-desktop-<firstname>) (§B5) — waits for both the itsme identity and the loaded provider record so the default is never re-derived out from under a human's own edit - success screen shows both onboarding paths: one-line
setupcommand, and the raw config block captioned with the exact<agent_label>/config.jsonfolder it belongs in (§B5) - new §B5bis accordion: Claude Desktop / Claude Code / GitHub Copilot CLI panels, secrets
never shown (only
NP_MANDATE=<agent_label>+ the launch command) -
ng buildclean,tsc --noEmitclean; API-level verification of the exact response shapes the new UI code consumes (no headless browser available in this sandbox — same constraint noted for step 7's original build)
Outil Local
-
init --force: enumerates${NP_HOME}/*/config.json, decodes each token'sact.sub/exp(no signature check needed), prints the "N mandates will break" warning, requires interactiveyunless--yes(§3.1) — O-1b/c/d/e all live-verified - new
setup <redeem-url>subcommand: refuses withoutagent.key;POSTs the URL; on 200, slugifiesagent_labeland writes${NP_HOME}/<slug>/config.json(mode 0600, always overwrites that one folder); on 404/410/network-error, refuses with a named reason (§5) — U-1 through U-7 all live-verified against the real stub -
runtimeconfig loading rewritten for theNP_HOME/NP_MANDATEsplit (§4.1): zero folders → refuse; one folder → use it; many folders + noNP_MANDATE→ refuse and list them;NP_MANDATE=<name>→ use that folder or refuse if missing; both env vars set still wins outright, bypassing folder resolution entirely (manual-testing escape hatch, spec §4.1) — O-6/O-7/O-8 all live-verified -
index.tswired for thesetupsubcommand - manual test pass (this module's convention — MANUAL-TESTING.md, no automated suite): O-1b/c/d/e, U-1 through U-7, O-6/O-7/O-8 — all live-verified, not just reasoned about
-
MANUAL-TESTING.md+README.mdupdated to match
Cross-cutting
- end-to-end smoke test: real mandate minted on the running stub (real PDS account-link
assertion, not a fake) → real
setup→ real outil-localruntime(NP_MANDATEselecting the setup-written folder) → a realtools/call get_balanceagainst the real PDS jar succeeded, correct balance data back (€12 802,50, Sofie's seed row) -
contracts.mdrow5bflipped to ✅ done
Deferred — noted, not blocking this step
- No hot-reload: a running outil-local process doesn't notice
config.jsonbeing replaced underneath it — the AI client has to be restarted to pick up a new mandate. Matches how these clients already expect MCP server config changes to be picked up; revisit only if it becomes an actual friction point in the demo. - Dashboard doesn't yet visually group "these rows are the same client over time" now that
agent_labelexists per row — cheap future polish, not needed for the POC.