Skip to content

feat(ROT-1): survivor re-wrap pure core (rotate-on-revoke)#122

Merged
th3-br41n merged 1 commit into
mainfrom
feat/rot-1-survivor-rewrap
Jul 8, 2026
Merged

feat(ROT-1): survivor re-wrap pure core (rotate-on-revoke)#122
th3-br41n merged 1 commit into
mainfrom
feat/rot-1-survivor-rewrap

Conversation

@th3-br41n

Copy link
Copy Markdown
Contributor

First rung of the 0.3.0 headline — F-286 rotate-on-revoke (design doc 73). This is the piece with no existing code: the 10.11 RoutingRotationCoordinator.rotate is built but has no caller because nothing mints + re-wraps a new DEK. ROT-1 is that re-wrap, factored pure.

rewrapDekForSurvivors(newDek, members, entityId, type?) → one HPKE member-wrap of DEK′ per surviving device:

  • Inactive (revoked) members are excluded by the active filter — after revokeAccess sets their row inactive, resolveCurrentMembers still lists them but they get no wrap. The removed member can never be in the set — the forward-secrecy guarantee, property-tested.
  • A survivor with no device x25519 (pre-collection-sharing grant) is reported in skipped so ROT-3 can re-share, not silently drop.
  • De-dupes by device key; binds each wrap to the entity id.

Pure — no DEK minting (that's EntityDekStore, ROT-2), no doc mutation, no I/O.

+7 property tests, including real-crypto round-trips: a survivor opens DEK′ with their device secret; the revoked member's secret cannot open any survivor wrap; a wrap won't open under another entity id. Collab + credentials suites green (233); typecheck + lint clean.

Part of the 0.3.0 "Trustworthy collaboration" train. Next: ROT-2 (mint DEK′ + re-seal snapshot + drive the rotation coordinator). The hard /security-review + /pentester gate is ROT-4, before the train cuts.

🤖 Generated with Claude Code

First rung of F-286 (design doc 73) — the piece with no existing code.
On revoke, forward secrecy needs the entity DEK rotated and re-wrapped for
the members who REMAIN, never the one removed. `rewrapDekForSurvivors`
takes a freshly-minted DEK′ + the entity's current members (post-revoke)
and produces one HPKE member-wrap of DEK′ per surviving device:

- Inactive (revoked) members are excluded by the `active` filter — the
  removed member can never appear in the wrap set (the forward-secrecy
  guarantee).
- A survivor whose grant carried no device x25519 (pre-collection-sharing)
  is reported in `skipped` so ROT-3 can re-share rather than silently drop.
- De-dupes by device key.

Pure: no DEK minting (EntityDekStore, ROT-2), no doc mutation, no I/O.
+7 property tests incl. real-crypto round-trips: survivor opens DEK′ with
their device secret; the revoked member's secret CANNOT open any survivor
wrap; entity-bound (a wrap won't open under another entity id).

This is the trigger the built-but-uncalled 10.11 RoutingRotationCoordinator
.rotate needs; ROT-2 wires mint + snapshot re-seal + the coordinator.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@th3-br41n th3-br41n merged commit 25f4fec into main Jul 8, 2026
3 checks passed
@th3-br41n th3-br41n deleted the feat/rot-1-survivor-rewrap branch July 8, 2026 21:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant