From docs/design-review-2026-08.md §B1.
Problem
The README quick start's happy path calls generateDidKeypair() then LocalAdapter.initialize(). Run it twice: initialize() throws (file exists). Worse, as written it mints a new identity on every run and drops the privateKey on the floor — the comment says to persist it, but the code doesn't, and there's no helper to reach for. The real first-run choreography — if db exists, open; else generate keypair, persist key durably, initialize — is delegated to every adopter on day one with no library support.
Work items
Open question
Should openOrInitialize take a lazy entityId provider (entityId: () => Promise<string>) so keypair generation only runs on the actually-new path? Avoids the quick start generating a throwaway keypair on every open.
Cross-refs: design-review-2026-08 §B1, #138 (the key's eventual use).
From
docs/design-review-2026-08.md§B1.Problem
The README quick start's happy path calls
generateDidKeypair()thenLocalAdapter.initialize(). Run it twice:initialize()throws (file exists). Worse, as written it mints a new identity on every run and drops theprivateKeyon the floor — the comment says to persist it, but the code doesn't, and there's no helper to reach for. The real first-run choreography — if db exists, open; else generate keypair, persist key durably, initialize — is delegated to every adopter on day one with no library support.Work items
LocalAdapter.openOrInitialize(opts)— existence branch inside the adapter. Keepinitialize/openfor callers who want the explicit distinction; the "prevents silent config divergence" rationale survives by havingopenOrInitializeassert identity-bearing options match on the open path (or document that they're ignored there)exportDidPrivateKeyJwk/importDidPrivateKeyJwkexist and are exported; the quick start never mentions them)Open question
Should
openOrInitializetake a lazyentityIdprovider (entityId: () => Promise<string>) so keypair generation only runs on the actually-new path? Avoids the quick start generating a throwaway keypair on every open.Cross-refs: design-review-2026-08 §B1, #138 (the key's eventual use).