panel-unlock 4/7 — the app door relays the sealed passcode, panel sign-ins only (#1929) #1933

Closed
opened 2026-09-27 19:09:45 +00:00 by matou-build-agent · 3 comments

Parent

  • Spec: #1929 — panel unlock (story 8, 9, 10)
  • Symptom ticket: #1886 · Wayfinder map: #1293
  • Design: ADR 0282 d.6, DDR 0246 d.6 · flow docs/ux/flows/panel-unlock.mermaid

What to build

The bridge's app door learns to carry a sealed passcode from a steward's
phone to their control-panel tab — and nothing else about it changes.

  • A panel sign-in code carries the tab's sealing public key (ek=). An
    ordinary service sign-in code never does.
  • The wallet's existing present route accepts an optional sealed box for such
    challenges only. The door stores ciphertext only, bound to that one
    challenge.
  • The existing status poll hands the ciphertext out exactly once, then
    deletes it. A second ask gets nothing.
  • The arm is single-use and dies with its challenge (the door's existing
    two-minute life, DDR 0246 d.6). A box for a different challenge, a second box
    for the same one, or a box arriving after expiry is refused.
  • The door never holds plaintext, and a relayed box never appears on any sign-in
    that is not to the panel.

This ticket also records the mechanism. ADR 0282 d.6 reads as though one tab
spans the act; it does not — the door page is the bridge's at id.<apex>, the
panel is admin.<apex>, and the hop through the gate's callback is a full
navigation
that kills any key the door page minted. Ruled with Ben at the spec's
seam gate: the unlock line arms the wallet for that one sign-in challenge, and
the panel tab mints the sealing keypair and completes the handover (5/7). One
tap, no second scan, memory only, and no secret in any URL or history entry.
Write that amendment into ADR 0282 in this ticket's PR, and update STATUS.M in the
same commit (CLAUDE.md's rule).

Acceptance criteria

  • Given a sign-in code minted for the control panel, when it is served, then it carries the tab's sealing public key; and given a code for any other service, then it carries none.
  • Given a panel challenge with a sealing key, when the wallet posts a sealed passcode with its presentation, then the door stores the ciphertext only, bound to that challenge.
  • Given a stored ciphertext, when the tab's status poll collects it, then it is returned once and deleted; and when polled again, then nothing is returned and no error leaks whether one ever existed.
  • Given an ordinary service sign-in, when a sealed box is posted, then it is refused and nothing is stored or relayed.
  • Given a box naming a different challenge, a second box for the same challenge, or a box after the challenge expired, when it is posted, then it is refused.
  • Given a challenge that expires with an uncollected ciphertext, when it dies, then the ciphertext dies with it.
  • Given any of the above, then no plaintext passcode is ever held, logged or persisted by the door.
  • ADR 0282 carries the armed-consent amendment; STATUS.md updated in the same commit.
  • Proven at the existing app-door seam with an injected verifier — no live KERIA.

Blocked by

  • #1910 — conflict-avoidance: it rewrites internal/idp read sites this ticket also touches (confirmed with Ben at ticketing; there is no semantic dependency).

Task manifest

task: app-door-passcode-relay
implements_flow: panel-unlock
implements_edge: A2u "hands over the passcode sealed to the tab's key; the bridge relays the ciphertext once and deletes it"
wireframe: docs/ux/wireframes/wallet-signin/ws-s1-sign-in-app-door.html   # the code carries the sealing key
interface: |
  # app door, additive and panel-only:
  #   code/qr/challenge:  + ek=<tab X25519 public key>   (panel destinations only)
  #   present:            + sealed_passcode (optional, panel challenges only)
  #   status:             + handover, returned ONCE then deleted
  # ciphertext only, bound to one challenge, dies with it
seam: internal/idp/appdoor_seam_test.go
acceptance:
  - given: a panel sign-in code
    when: it is served
    then: it carries the tab's sealing key; a service code carries none
  - given: a stored ciphertext
    when: the status poll collects it
    then: it is returned once and deleted
  - given: an ordinary service sign-in
    when: a sealed box is posted
    then: it is refused and nothing is stored
depends_on: [1910]
out_of_scope: [the panel's completion of the handover (5/7), the wallet side (matou-app), sign-out-everywhere (6/7)]
needs_human_decision: []

Ticketed by /to-tickets from spec #1929; granularity, blocking edges and cross-repo filing confirmed with Ben 2026-09-27.

🤖 Generated with Claude Code

https://claude.ai/code/session_015es4bpK4qRqZhrRYQBWCiY

## Parent - **Spec:** [#1929 — panel unlock](https://git.matou.nz/Matou/idss/issues/1929) (story 8, 9, 10) - **Symptom ticket:** #1886 · **Wayfinder map:** #1293 - **Design:** ADR 0282 d.6, DDR 0246 d.6 · flow `docs/ux/flows/panel-unlock.mermaid` ## What to build The bridge's **app door** learns to carry a sealed passcode from a steward's phone to their control-panel tab — and nothing else about it changes. - A **panel** sign-in code carries the tab's **sealing public key** (`ek=`). An ordinary service sign-in code never does. - The wallet's existing present route accepts an **optional sealed box** for such challenges only. The door stores **ciphertext only**, bound to that one challenge. - The existing status poll hands the ciphertext out **exactly once**, then **deletes** it. A second ask gets nothing. - The arm is **single-use** and dies with its challenge (the door's existing two-minute life, DDR 0246 d.6). A box for a different challenge, a second box for the same one, or a box arriving after expiry is refused. - The door never holds plaintext, and a relayed box never appears on any sign-in that is not to the panel. **This ticket also records the mechanism.** ADR 0282 d.6 reads as though one tab spans the act; it does not — the door page is the bridge's at `id.<apex>`, the panel is `admin.<apex>`, and the hop through the gate's callback is a **full navigation** that kills any key the door page minted. Ruled with Ben at the spec's seam gate: the unlock line **arms** the wallet for that one sign-in challenge, and the **panel tab** mints the sealing keypair and completes the handover (5/7). One tap, no second scan, memory only, and **no secret in any URL or history entry**. Write that amendment into ADR 0282 in this ticket's PR, and update STATUS.M in the same commit (CLAUDE.md's rule). ## Acceptance criteria - [ ] **Given** a sign-in code minted for the control panel, **when** it is served, **then** it carries the tab's sealing public key; **and given** a code for any other service, **then** it carries none. - [ ] **Given** a panel challenge with a sealing key, **when** the wallet posts a sealed passcode with its presentation, **then** the door stores the **ciphertext only**, bound to that challenge. - [ ] **Given** a stored ciphertext, **when** the tab's status poll collects it, **then** it is returned **once** and deleted; **and when** polled again, **then** nothing is returned and no error leaks whether one ever existed. - [ ] **Given** an ordinary service sign-in, **when** a sealed box is posted, **then** it is refused and nothing is stored or relayed. - [ ] **Given** a box naming a different challenge, a second box for the same challenge, or a box after the challenge expired, **when** it is posted, **then** it is refused. - [ ] **Given** a challenge that expires with an uncollected ciphertext, **when** it dies, **then** the ciphertext dies with it. - [ ] **Given** any of the above, **then** no plaintext passcode is ever held, logged or persisted by the door. - [ ] ADR 0282 carries the armed-consent amendment; STATUS.md updated in the same commit. - [ ] Proven at the existing app-door seam with an injected verifier — no live KERIA. ## Blocked by - #1910 — conflict-avoidance: it rewrites `internal/idp` read sites this ticket also touches (confirmed with Ben at ticketing; there is no semantic dependency). ## Task manifest ```yaml task: app-door-passcode-relay implements_flow: panel-unlock implements_edge: A2u "hands over the passcode sealed to the tab's key; the bridge relays the ciphertext once and deletes it" wireframe: docs/ux/wireframes/wallet-signin/ws-s1-sign-in-app-door.html # the code carries the sealing key interface: | # app door, additive and panel-only: # code/qr/challenge: + ek=<tab X25519 public key> (panel destinations only) # present: + sealed_passcode (optional, panel challenges only) # status: + handover, returned ONCE then deleted # ciphertext only, bound to one challenge, dies with it seam: internal/idp/appdoor_seam_test.go acceptance: - given: a panel sign-in code when: it is served then: it carries the tab's sealing key; a service code carries none - given: a stored ciphertext when: the status poll collects it then: it is returned once and deleted - given: an ordinary service sign-in when: a sealed box is posted then: it is refused and nothing is stored depends_on: [1910] out_of_scope: [the panel's completion of the handover (5/7), the wallet side (matou-app), sign-out-everywhere (6/7)] needs_human_decision: [] ``` --- *Ticketed by `/to-tickets` from spec [#1929](https://git.matou.nz/Matou/idss/issues/1929); granularity, blocking edges and cross-repo filing confirmed with Ben 2026-09-27.* 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_015es4bpK4qRqZhrRYQBWCiY
matou-build-agent 2026-09-27 20:17:15 +00:00
Author
Member

close-report for #1933 — status success

✅ close-report gates passed — every claim verified against main; issue closed.

envelope
{
  "issue": 1933,
  "status": "success",
  "commits": [
    "1f6a245a"
  ],
  "changed_files": [
    "internal/idp/appdoor.go",
    "internal/idp/appdoor_seam_test.go",
    "docs/adr/0282-the-app-sign-in-hands-the-control-panel-the-stewards-passcode.md",
    "STATUS.md"
  ],
  "tests": [
    {
      "command": "nix develop .#go-ci --command go test ./internal/idp/ -count=1",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci --command go build ./...",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci --command gofmt -l internal/idp/appdoor.go internal/idp/appdoor_seam_test.go",
      "exit_code": 0
    }
  ],
  "criteria": {
    "a panel sign-in code carries the tab's sealing key; a service code carries none": "appdoor.go handleChallenge sets d.SealingKey only when d.Service==panelServiceName and ?ek= given; buildAppDeepLink adds ek=; proven by TestSeam_AppDoor_PanelCodeCarriesSealingKey_ServiceCodeDoesNot",
    "on a panel challenge with a sealing key the wallet's sealed passcode is stored as ciphertext only, bound to that challenge": "handlePresent stores body.SealedPasscode via markVerified onto that rec's handover; proven by TestSeam_AppDoor_PanelHandoverRelayedOnceThenDeleted (incl. bound-to-one-challenge)",
    "the status poll returns the ciphertext once and deletes it; a second poll returns nothing and leaks no error": "handleStatus verified branch calls takeHandover (returns once then clears); appStatus.Handover omitempty; proven by TestSeam_AppDoor_PanelHandoverRelayedOnceThenDeleted second-poll assertions",
    "an ordinary service sign-in refuses a sealed box and stores/relays nothing": "handlePresent refuses (400) when SealedPasscode set and rec has no SealingKey; proven by TestSeam_AppDoor_SealedBoxRefusedWithoutASealingKey (service + no-ek panel)",
    "a box for a different challenge, a second box for the same one, or a box after expiry is refused": "second box hits consumed 'spent' (409), post-expiry hits expiry 'expired' (410), bound-to-one proven by a different challenge's status carrying no handover; TestSeam_AppDoor_SecondBoxAndBoxAfterExpiryRefused + PanelHandoverRelayedOnceThenDeleted",
    "a challenge that expires with an uncollected ciphertext takes it with it": "takeHandover drops the box when now>ExpiresAt; proven by TestSeam_AppDoor_UncollectedHandoverDiesWithTheChallenge",
    "no plaintext passcode is ever held, logged or persisted by the door": "the door only ever handles SealedPasscode (ciphertext) and relays it verbatim; no plaintext field exists; handover stored as ciphertext, never logged",
    "ADR 0282 carries the armed-consent amendment; STATUS.md updated in the same commit": "docs/adr/0282-*.md gains the 'd.6 is not one tab' amendment; STATUS.md prepends the #1933 DONE entry — both in commit 1f6a245a",
    "proven at the existing app-door seam with an injected verifier, no live KERIA": "all tests use fakeVerifier at internal/idp/appdoor_seam_test.go"
  },
  "summary": "The app door carries a sealing key on control-panel codes only, relays a steward's sealed passcode once then deletes it, and refuses any box off a keyed panel challenge — all at the app-door seam.",
  "blockers": []
}
**close-report** for #1933 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1933, "status": "success", "commits": [ "1f6a245a" ], "changed_files": [ "internal/idp/appdoor.go", "internal/idp/appdoor_seam_test.go", "docs/adr/0282-the-app-sign-in-hands-the-control-panel-the-stewards-passcode.md", "STATUS.md" ], "tests": [ { "command": "nix develop .#go-ci --command go test ./internal/idp/ -count=1", "exit_code": 0 }, { "command": "nix develop .#go-ci --command go build ./...", "exit_code": 0 }, { "command": "nix develop .#go-ci --command gofmt -l internal/idp/appdoor.go internal/idp/appdoor_seam_test.go", "exit_code": 0 } ], "criteria": { "a panel sign-in code carries the tab's sealing key; a service code carries none": "appdoor.go handleChallenge sets d.SealingKey only when d.Service==panelServiceName and ?ek= given; buildAppDeepLink adds ek=; proven by TestSeam_AppDoor_PanelCodeCarriesSealingKey_ServiceCodeDoesNot", "on a panel challenge with a sealing key the wallet's sealed passcode is stored as ciphertext only, bound to that challenge": "handlePresent stores body.SealedPasscode via markVerified onto that rec's handover; proven by TestSeam_AppDoor_PanelHandoverRelayedOnceThenDeleted (incl. bound-to-one-challenge)", "the status poll returns the ciphertext once and deletes it; a second poll returns nothing and leaks no error": "handleStatus verified branch calls takeHandover (returns once then clears); appStatus.Handover omitempty; proven by TestSeam_AppDoor_PanelHandoverRelayedOnceThenDeleted second-poll assertions", "an ordinary service sign-in refuses a sealed box and stores/relays nothing": "handlePresent refuses (400) when SealedPasscode set and rec has no SealingKey; proven by TestSeam_AppDoor_SealedBoxRefusedWithoutASealingKey (service + no-ek panel)", "a box for a different challenge, a second box for the same one, or a box after expiry is refused": "second box hits consumed 'spent' (409), post-expiry hits expiry 'expired' (410), bound-to-one proven by a different challenge's status carrying no handover; TestSeam_AppDoor_SecondBoxAndBoxAfterExpiryRefused + PanelHandoverRelayedOnceThenDeleted", "a challenge that expires with an uncollected ciphertext takes it with it": "takeHandover drops the box when now>ExpiresAt; proven by TestSeam_AppDoor_UncollectedHandoverDiesWithTheChallenge", "no plaintext passcode is ever held, logged or persisted by the door": "the door only ever handles SealedPasscode (ciphertext) and relays it verbatim; no plaintext field exists; handover stored as ciphertext, never logged", "ADR 0282 carries the armed-consent amendment; STATUS.md updated in the same commit": "docs/adr/0282-*.md gains the 'd.6 is not one tab' amendment; STATUS.md prepends the #1933 DONE entry — both in commit 1f6a245a", "proven at the existing app-door seam with an injected verifier, no live KERIA": "all tests use fakeVerifier at internal/idp/appdoor_seam_test.go" }, "summary": "The app door carries a sealing key on control-panel codes only, relays a steward's sealed passcode once then deletes it, and refuses any box off a keyed panel challenge — all at the app-door seam.", "blockers": [] } ``` </details>
Author
Member

Follow-up (no change owed here): verified against the code you landed — the door stores and relays ek= and sealed_passcode as opaque strings with no format validation, which is the right call and leaves the contents free for the two ends to settle. They are now settled on #1934 (the tab's Decrypter side) and matou-app#663 (the wallet's Encrypter side): ek= carries an Ed25519 verkey qb64 and sealed_passcode a CESR qb64 X25519_Cipher_Salt (1AAH), both produced by signify-ts's exported Encrypter/Decrypter — crypto_box_seal itself is not exported, but signify's own Controller already seals a bran exactly this way.

Two cosmetic notes, neither worth reopening:

  1. appChallengeDescriptor.SealingKey's doc comment says "throwaway X25519 PUBLIC key". With the signify route it is an Ed25519 verkey that Encrypter converts to X25519 itself. Worth a wording fix whenever that file is next touched.
  2. panelServiceName = "the control panel" makes panel-ness a comparison of display strings (d.Service == panelServiceName). Safe today because both sides are the same constant, but it means a rewording or an i18n pass would silently stop the sealing key riding panel codes. The wallet does not depend on it — for that side, the presence of ek is the signal.

🤖 Generated with Claude Code

https://claude.ai/code/session_015es4bpK4qRqZhrRYQBWCiY

**Follow-up (no change owed here):** verified against the code you landed — the door stores and relays `ek=` and `sealed_passcode` as **opaque strings** with no format validation, which is the right call and leaves the contents free for the two ends to settle. They are now settled on **#1934** (the tab's `Decrypter` side) and **matou-app#663** (the wallet's `Encrypter` side): `ek=` carries an Ed25519 **verkey qb64** and `sealed_passcode` a CESR qb64 `X25519_Cipher_Salt` (`1AAH`), both produced by `signify-ts`'s exported `Encrypter`/`Decrypter` — `crypto_box_seal` itself is not exported, but signify's own `Controller` already seals a bran exactly this way. Two cosmetic notes, neither worth reopening: 1. `appChallengeDescriptor.SealingKey`'s doc comment says *"throwaway X25519 PUBLIC key"*. With the signify route it is an Ed25519 verkey that `Encrypter` converts to X25519 itself. Worth a wording fix whenever that file is next touched. 2. `panelServiceName = "the control panel"` makes panel-ness a comparison of **display strings** (`d.Service == panelServiceName`). Safe today because both sides are the same constant, but it means a rewording or an i18n pass would silently stop the sealing key riding panel codes. The wallet does not depend on it — for that side, the presence of `ek` is the signal. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_015es4bpK4qRqZhrRYQBWCiY
Author
Member

Retro (no work owed here — #1957 carries it): the relay that shipped is the mechanism ADR 0282's amendment replaced.

This ticket's body described armed consent — "the unlock line arms the wallet for that one sign-in challenge, and the panel tab mints the sealing keypair and completes the handover" — because the plain reading of d.6 has a hole: the door page is at id.<apex>, the panel at admin.<apex>, and the hop between them is a full navigation that destroys any key the door page minted.

But the acceptance criteria encoded the pre-amendment shape, and that is what got built and verified:

  • handleChallenge reads ?ek= at mint time, so the key is whatever the sign-in code carried;
  • the wallet seals during approve to that key (useSignin.ts's sealPasscode(verkey), matou-app#663, where link.ts says ek is "present ONLY" on the sign-in link);
  • status hands the ciphertext to whoever polls that challenge.

Every one of those is correct against the criteria, and the seam tests prove them. The gap is that no route accepts a sealing key from the panel after the sign-in, and nothing answers "did this sign-in arm a handover?" — so the panel, which never minted the key the box is sealed to, cannot open it. The armed mechanism is in the ADR text and in this ticket's prose, and in no code.

Worth noting for #1940/#1943: neither gate would have caught this. Gate 6 checks that declared symbols are implemented; gate 8 checks that a changed area's suite ran. Both passed honestly. The thing that drifted is the criteria map, which is free text no gate reads — the ticket said one mechanism and asked for another.

Ruled by Ben, 2026-09-28: keep sign-in-armed. The fix is not to collapse the sign-in path into the scan-a-code shape (which would cost a second scan on every fresh sign-in, the thing d.2 rejected). #1957 now carries the three-party build; this ticket stays closed.

🤖 Generated with Claude Code

https://claude.ai/code/session_015es4bpK4qRqZhrRYQBWCiY

**Retro (no work owed here — #1957 carries it): the relay that shipped is the mechanism ADR 0282's amendment replaced.** This ticket's body described **armed consent** — *"the unlock line **arms** the wallet for that one sign-in challenge, and the **panel tab** mints the sealing keypair and completes the handover"* — because the plain reading of d.6 has a hole: the door page is at `id.<apex>`, the panel at `admin.<apex>`, and the hop between them is a full navigation that destroys any key the door page minted. But the **acceptance criteria encoded the pre-amendment shape**, and that is what got built and verified: - `handleChallenge` reads `?ek=` at **mint time**, so the key is whatever the sign-in code carried; - the wallet seals **during approve** to that key (`useSignin.ts`'s `sealPasscode(verkey)`, matou-app#663, where `link.ts` says `ek` is *"present ONLY"* on the sign-in link); - `status` hands the ciphertext to whoever polls that challenge. Every one of those is correct against the criteria, and the seam tests prove them. The gap is that **no route accepts a sealing key from the panel after the sign-in**, and nothing answers *"did this sign-in arm a handover?"* — so the panel, which never minted the key the box is sealed to, cannot open it. The armed mechanism is in the ADR text and in this ticket's prose, and in no code. **Worth noting for #1940/#1943:** neither gate would have caught this. Gate 6 checks that declared symbols are implemented; gate 8 checks that a changed area's suite ran. Both passed honestly. The thing that drifted is the **`criteria` map**, which is free text no gate reads — the ticket said one mechanism and asked for another. **Ruled by Ben, 2026-09-28: keep sign-in-armed.** The fix is not to collapse the sign-in path into the scan-a-code shape (which would cost a second scan on every fresh sign-in, the thing d.2 rejected). #1957 now carries the three-party build; this ticket stays closed. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_015es4bpK4qRqZhrRYQBWCiY
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#1933
No description provided.