panel unlock: the identity module mints the sealing key only once libsodium is ready, and a mint or load that fails is a visible fault — the second live walk's silent locked seat (GOTCHAS #376) #2015

Merged
ben merged 1 commit from session/mint-after-sodium-ready into main 2026-09-30 03:44:45 +00:00
Owner

The second live steward-unlock walk (Ben, Whakatōhea Demo, 2026-09-30, app 0.8.4 on release 2d54833b, with #2008 in). Refs #1936.

What Ben saw

The unlock hop now runs end to end: the sign-in page's unlock face, the app's unlock card, back to the panel. And Members still landed locked, plain PU-M0, nothing said. The same after a first sign-in with the unlock line on.

What the log showed

  • admin GET /api/v1/panel/handover 200 size=60 — the capability, read once (#2008's race fix works).
  • The app polling GET /login/app/handover/key for the full two minutes (#696 works).
  • No POST /login/app/handover from the browser, ever. The fault is between the capability read and the request.

The cause (GOTCHAS #376)

The step between is minting the panel's sealing key. idssKeriMintSealingKey was synchronous, and main.ts "pre-warmed libsodium" with void ready() at module load so the mint would be safe "by the time the panel calls it". The panel calls it the moment loadStewardBundle resolves — the script's onload — which is before that init finishes. new Signer() throws:

TypeError: libsodium.randombytes_buf is not a function

Reproduced in plain Node: the same call succeeds after await ready(). runHandover minted outside its try, so the rejection escaped, phone.phase never left idle, and the steward saw the plain locked seat. The unit tests never caught it because vitest's setup initialises libsodium before any test runs.

The fix

  • Module: PageSealingKey.mintWhenReady() awaits ready() itself; the mounted mintSealingKey verb resolves a promise. The pre-warm stays as a head start only.
  • Panel: runHandover awaits the mint, and everything between "armed" and the request (loading the module, minting) sits inside the try. A module that fails to load or to mint is PU-M0x cause 1 ("your app didn't finish unlocking"), never a silent PU-M0.

Tests

  • Session: an async mint still completes the handover; a mint that throws lands on no-handover with nothing bound at the door; a module that fails to load lands there too. All three fail on main.
  • App: mintWhenReady mints without the caller awaiting ready(); the mount test now expects a promise from the mounted verb.
Check Result
dashboard vitest 166 files, 2213 passed, 2 skipped
vue-tsc --noEmit (dashboard + app) clean
app unit suite all pass except one pre-existing failure on main (tests/e2e/fixtures/idip.test.ts, S6i shipped-row-shape) — untouched
keri-web bundle build builds
eslint on touched files clean

After this

Needs a testing release (it changes the served keri-web.js and the dashboard). No app release needed. Then the walk again; still proven at the unit seam only, #1936 stays open.

🤖 Generated with Claude Code

https://claude.ai/code/session_01WgMdPvssS1d7W1v2dL7bcH

The second live steward-unlock walk (Ben, Whakatōhea Demo, 2026-09-30, app 0.8.4 on release `2d54833b`, with #2008 in). Refs #1936. ## What Ben saw The unlock hop now runs end to end: the sign-in page's unlock face, the app's unlock card, back to the panel. And Members **still landed locked**, plain PU-M0, nothing said. The same after a first sign-in with the unlock line on. ## What the log showed - `admin GET /api/v1/panel/handover 200 size=60` — the capability, read **once** (#2008's race fix works). - The app polling `GET /login/app/handover/key` for the full two minutes (#696 works). - **No `POST /login/app/handover` from the browser, ever.** The fault is between the capability read and the request. ## The cause (GOTCHAS #376) The step between is minting the panel's sealing key. `idssKeriMintSealingKey` was synchronous, and `main.ts` "pre-warmed libsodium" with `void ready()` at module load so the mint would be safe "by the time the panel calls it". The panel calls it the moment `loadStewardBundle` resolves — the script's `onload` — which is before that init finishes. `new Signer()` throws: ``` TypeError: libsodium.randombytes_buf is not a function ``` Reproduced in plain Node: the same call succeeds after `await ready()`. `runHandover` minted outside its try, so the rejection escaped, `phone.phase` never left `idle`, and the steward saw the plain locked seat. The unit tests never caught it because vitest's setup initialises libsodium before any test runs. ## The fix - **Module:** `PageSealingKey.mintWhenReady()` awaits `ready()` itself; the mounted `mintSealingKey` verb resolves a promise. The pre-warm stays as a head start only. - **Panel:** `runHandover` awaits the mint, and everything between "armed" and the request (loading the module, minting) sits inside the try. A module that fails to load or to mint is PU-M0x cause 1 ("your app didn't finish unlocking"), never a silent PU-M0. ## Tests - Session: an async mint still completes the handover; a mint that throws lands on `no-handover` with nothing bound at the door; a module that fails to load lands there too. All three fail on main. - App: `mintWhenReady` mints without the caller awaiting `ready()`; the mount test now expects a promise from the mounted verb. | Check | Result | |---|---| | `dashboard` vitest | 166 files, 2213 passed, 2 skipped | | `vue-tsc --noEmit` (dashboard + app) | clean | | `app` unit suite | all pass except one pre-existing failure on main (`tests/e2e/fixtures/idip.test.ts`, S6i shipped-row-shape) — untouched | | keri-web bundle build | builds | | eslint on touched files | clean | ## After this Needs a `testing` release (it changes the served `keri-web.js` and the dashboard). No app release needed. Then the walk again; still proven at the unit seam only, #1936 stays open. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01WgMdPvssS1d7W1v2dL7bcH
panel unlock: the identity module mints the sealing key only once libsodium is ready, and a mint or load that fails is a visible fault — the second live walk's silent locked seat (GOTCHAS #376)
Some checks failed
ci / seam (pull_request) Failing after 7m4s
ci / publish (pull_request) Has been skipped
ci / publish-broker (pull_request) Has been skipped
ci / deploy-broker (pull_request) Has been skipped
fee1231f44
Whakatōhea Demo, 2026-09-30, app 0.8.4 on release 2d54833b: the unlock hop
ran end to end and Members still landed locked with nothing said. The
capability was read once, the app polled the key route for two minutes,
and no POST /login/app/handover ever left the browser. The step between
was the mint: synchronous, relying on a void ready() pre-warm at module
load, called by the panel the moment the script had loaded — before the
init finished. new Signer() throws "libsodium.randombytes_buf is not a
function" (reproduced in plain Node); runHandover minted outside its try,
so the throw escaped and the phase never left idle.

- PageSealingKey.mintWhenReady awaits ready(); the mounted verb resolves it.
- The panel awaits the mint; a module that fails to load or mint lands on
  PU-M0x cause 1, never a silent PU-M0.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WgMdPvssS1d7W1v2dL7bcH
ben merged commit b76bcc87ee into main 2026-09-30 03:44:45 +00:00
Sign in to join this conversation.
No reviewers
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.

Dependencies

No dependencies set.

Reference
Matou/idss!2015
No description provided.