~ knotless Search/
↑↓ move↵ open⇧↵ all results
0
0

Stewards hold recovery keys to a group's identity

Merged
Merged chadtmiller.com asked to merge into main from chadtmiller.com/group-host:host/recovery

What changes

Recovery keys. listRecoveryKeys, addRecoveryKey and removeRecoveryKey (recovery.rs, docs/design/recovery.md) let a group's admins put a steward's did:key among its rotation keys, ahead of the host's. The group's identity is then never the host's alone: whoever holds such a key can take the DID elsewhere even if this host disappears.

  • A group holds at most four keys, the host's among them.
  • Keys added earlier keep their rank.
  • The host's own key can't be taken off.
  • Once a steward has taken the host's key off, the host says NotController instead of changing anything.

A deleted group's DID. Deleting a group no longer tombstones a DID that holds a steward's key. The DID stays the steward's to bring back elsewhere, and deleteGroup says whether it ended it.

The console. The settings page lists the keys, and adds or takes one off, for those who configure the group.

Why

This is step 8's second part. The prototype's recovery.ts puts a steward's key ahead of the host's in the same way. Keeping the host's key last means a steward's operation always outranks the host's within PLC's recovery window.

How it was checked

tests/recovery.rs covers:

  • keys going in ahead of the host's and coming off again, with the activity log;
  • each refusal (InvalidKey, AlreadyAdded, TooManyKeys, HostKey, UnknownKey, Forbidden);
  • NotController, once the host holds no key or the DID is ended;
  • a deleted group's DID left to its steward.

These are the prototype's recovery.test.ts cases. A new e2e flow adds a key on the settings page and takes it off. just cov is at 100% locally.

Shortcomings

Who holds a key is recorded only as who added it. The host can't tell whether a key is still held, or held safely.

🤖 Generated with Claude Code

Approved

This adds listRecoveryKeys, addRecoveryKey and removeRecoveryKey, which keep the host's key last in the group's PLC rotation keys. It also makes deleteGroup leave a DID alone when a steward's key is on it, and adds a settings-page section, a design page and tests. I read every changed file and found nothing that must change.

  • Rank and limits: the rank, the four-key limit, the HostKey, UnknownKey and AlreadyAdded refusals, and NotController all behave as the body says.
  • Concurrency: two concurrent edits sign over the same previous op, so PLC rejects the second one. That surfaces as an internal error, not as corrupted keys.
  • Lexicons: the three lexicons were already on main, so the web imports resolve.
  • e2e helper: the P-256 didKey() helper in harness/e2e/pages.mjs encodes correctly (multicodec 0x1200, compressed point, base58btc).
  • Checks: check passed. test and web were still queued, and e2e was still running, when I read them. I didn't see their results.

One thing to weigh, not a blocker: anyone with group.configure can remove a steward's key that someone else added, and can add their own. The body's "Shortcomings" covers who holds a key, but not this. A line in docs/design/recovery.md saying so would help.

Merged as 5d6ec60