Repository source: docs/plans/browser_keychain/browser_keychain_step1_solution_assessment.md
Debug mode: enabled
Effort study: railspike-effort / v3/browser_keychain; cycle ledger. Standing P2 enrollment; parent v3/local_pull_simple.
Extended estimates: enabled
Cycle estimate: 0.70
Original Query
"that is so cool! good call on saving the previous key, too. can you actually look at how pollyanna handled changing keys? i think it has a good system." Then: "yes, please write step 1 and push it, and write a prompt block for a new chat with it" (Ilya, 2026-11-28).
Understood Intent
A browser should remember every key it has held for this site and let the member switch between them, instead of overwriting the active key. Pollyanna does this, and the "previous key" slot from #457 is a first, one-slot version of it.
How pollyanna does it (default/template/js/crypto2.js, profile.js, select_key.template):
Whenever a key becomes active,
setPrivateKeyFromTxt()first adds it to a keychain (AddPrivateKey()):pk0,pk1, … in a localStorage store, labeled with the username, without duplicates.The active key is a separate set of fields (
privatekey,publickey,fingerprint,avatar), so switching changes only which key is in use.A Select key menu on the profile page lists the keychain by name, with the current key selected; choosing one makes it active.
Sign Out clears only the active key, so the keychain survives. A planned Undo ("you can undo for 10 seconds") has a button in the template but no code behind it.
Where v3 is today. One active key (forum_pki_*). Four things replace or remove it:
making a key;
restoring a backup (overwrites with no copy);
Connect on a local clone (since #457, copies the old key to a one-slot
forum_pki_previous_*);Clear this key on Account (has an Undo, but kept only in memory, so a reload loses it).
Problem Statement
Changing the key in a browser loses the old one, or keeps it in a single slot, so a member who uses two keys or replaces one by mistake has to find a backup file.
Concepts touched
All options: key backups (changed: a restore no longer overwrites); key handoff (changed: Connect adds to the keychain instead of
forum_pki_previous_*); new concept browser keychain.Options A and C: private key access and key retirement (reused; removing a key from a browser is not retiring it on the server, and the page has to say so).
Solution Options
Option A: A keychain beside the active key, with switch and remove
Estimate: 0.70
Driver: switching keys signs the session out and in again, and touches saved message copies and open tabs. Uncertainty: medium; how much of browser_signing.js assumes one key.
Every key that becomes active (made, restored, handed over by Connect, or switched back to) is first added to a forum_pki_keychain list in this browser: fingerprint, username, armored keys and when it was added, without duplicates. Account lists the keychain with the active key marked. Each other key has Use this key, which makes it active and signs in with it. Remove from this browser deletes a key from both the keychain and the active slot, with an Undo that survives a reload for a short time. Clear this key becomes that removal.
Pros: nothing is lost by replacing a key, in any of the four paths. Switching between two accounts, or between an old and a new key, takes one click. On a shared computer, removing a key really removes it. It replaces both one-slot mechanisms (
forum_pki_previous_*and the in-memory Undo).Cons: more private keys sit in localStorage, unencrypted like the active one is today. Switching needs care with signed-in sessions, saved message copies and other open tabs.
Option B: Keep one slot, make it consistent
Estimate: 0.25 Driver: wiring restore and Clear into the slot. Uncertainty: low.
Keep forum_pki_previous_* and use it everywhere a key is replaced: restore and Clear also fill it, and Account offers Switch back to <name> …ABCD. The Clear Undo is read from that slot, so it survives a reload.
Pros: small, and closes the gap where a restore silently loses the old key.
Cons: only one key back; a second replacement still loses the first. No real switching between accounts.
Option C: Pollyanna's model as it is
Estimate: 0.50 Driver: the keychain and a switcher. Uncertainty: medium.
Keep every key in a keychain and add a key switcher, as Option A does. But Clear, like pollyanna's Sign Out, only empties the active key and leaves the keychain alone; there is no remove.
Pros: closest to the system Ilya likes; switching is easy and nothing is ever lost.
Cons: on a shared or borrowed computer, Clear no longer gets a key off the machine, which is what members expect it to do today. Fixing that later means adding Option A's remove anyway.
Recommendation
Option A. It keeps what makes pollyanna's system good, a keychain separate from the active key with a switcher, and adds the removal pollyanna planned but never finished. It also fits PRINCIPLES.md (source unavailable) ("Private keys stay in the member's browser"): keys stay in this browser, the member chooses which one is in use, and removal is explicit.
Retires: forum_pki_previous_* from #457, migrated into the keychain on first load, and the in-memory Clear Undo.
For Step 2 to settle:
Where the switcher lives: Account only, or also the header's identity menu.
What switching does to saved message copies.
How other open tabs learn about a switch.
Whether a keychain entry can carry a label of the member's own.
Vertical-slice viability: on Account, a member with key X restores key Y from a backup. Both are listed, Y marked active. Use this key on X signs in as X. Remove from this browser on Y removes it, a reload still offers Undo, and after the Undo window it is gone from localStorage.
— Claude · 2026-11-28 UTC · Model: claude-opus-5-5
Enhancement Requests
None yet.
Study Checkpoint
2026-11-28T18:15Z; scope v1; starting revision 95b38ed4; R1 (hashes not re-verified); P2 standing enrollment, parent v3/local_pull_simple. Claude, single exposed rater. Not a pristine intake: written right after building forum_pki_previous_* (#457).
Intake and Step 1 handoff: 0.70 projected total, Option A (Option B 0.25, Option C 0.50; not additive). Not hours or measured labor; no approval to advance.