device-add: code-lifecycle-and-errors — Redeem, revoke, and the code error taxonomy #48
Labels
No labels
agent-blocked
agent-working
autopilot
bug
deferred
deploy-pending
enhancement
landing-pr
model-haiku
model-opus
model-sonnet
needs-design
needs-info
needs-triage
no-triage
out-of-scope
priority
ready-for-agent
ready-for-human
ready-for-session
rehearsal-183
snapshot-pending
standing-drive
wayfinder:grilling
wayfinder:map
wayfinder:prototype
wayfinder:research
wayfinder:task
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Depends on
Reference
Matou/idss#48
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Parent
Feature spec: #13 (device-add).
What to build
Everything that makes a code honest before a device ever pairs. The operator can revoke an unspent code (the
RevokeCodeseam amendment) so a code that leaked or went stale stops working — and when a request is already in flight on that code, revoking closes it (Closure: Revoked) and the agent performs the same teardown a decline would. On the code screen (P2-S2) the revoke affordance is the operator's control; on the app's Join with a code screen (P3-S2) redemption is where the device owner meets the error taxonomy.Redeem is non-consuming: reading a code to see what you're joining never spends it. Each typed outcome maps to its own device-end message — a mistyped code says "no such code — retype" and the same code can be tried again; an expired code says "was valid, past expiry — get a fresh code" (distinct from a typo); a consumed code gives the already-spent outcome; and a code already bound to a different device gives the in-use outcome. A revoked code returns the "contact the operator" outcome, distinct from both expiry and typo.
This slice implements the
enrollseam's device-facingRedeem(returning the typed outcome) and the Operator face'sRevokeCode, plus the in-flight Closure delivery. It carries the non-consuming and typo behaviour of story 8; the branded display of a valid redemption is app-join-happy's.Acceptance criteria
Blocked by
Task manifest
Done in
def5a9c. Built the device-endjoinorchestrator's first slice (ADR 0057) — the join state machine that lives in the agent and only there (internal/join/), driven at its single test seam against the realenrollcontrol-plane ledger + clock (#26) with faked VM-manager / self-remover teardown below.What shipped
Orchestrator.Redeem(code)— non-consuming read mappingenroll's error taxonomy to one typedRedeemOutcomeeach:valid/unknown(retype) /expired/revoked/consumed/in-use. A taxonomy error is a typed outcome (nil error); only a transport/programming fault returns an error. Valid carries the raw P3-S2 material — its branded render is app-join-happy's.AwaitDecision(id)— the in-flight watcher: long-polls a paired request and, when the operator'sRevokeCode(enroll's Operator face) closes it withClosure{Revoked}, runs the same teardown a decline runs — full install self-removes (SelfRemover), VM-mode guest removed (VMManager, ADR 0056) — chosen byClosure.SelfRemove.Acceptance → tests (
internal/join/join_test.go, 8 seam tests, all green):revokedoutcome distinct from expiry+typo; revoke-in-flight → Closure Revoked + same-as-decline teardown (full and VM modes).bound, re-read rejoins same request); typo → "no such code — retype", same code retried successfully.go/vet/gofmt/golangci-lintclean. STATUS.md +docs/slices/device-add.yaml(status: done) updated in the same commit.Out of scope (their own slices): branded valid screen + pair/approve/confirm continuation (app-join-happy), decline entry point (decline-and-resume), standing codes-ledger UI (shell), thin P3-S2 socket UI (its own layer — ADR 0053/0057: Vue renders states, it does not decide them).
idss-rental-expires-tag on a LIVE rental once the broker actually deploys (#741's broker half is merged but not installed) #745