Repository navigation
feat(openclaw-id): members can recover access with a recovery kit - #200145
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesThis PR adds member recovery kits, same-account browser admission, and owner notifications with retained recovery history. Example: Mira saves a recovery kit, then clears her only approved browser's site data.
Review scores
ProductKind: Feature · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-directed feature adds useful recovery beyond current main, and the previous blocking finding is fixed; no new blocking defect was verified. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe shared protocol verifies signed membership changes; the Gateway serializes admission and SQLite persistence, then exposes owner-only evidence to the Control UI and Access plugin. flowchart LR
A[Member browser and kit] --> B[Discovery mailbox]
B --> C[Gateway membership authority]
C --> D[Shared protocol verification]
C --> E[SQLite claw store]
C --> F[Owner notices and People page]
Technical reviewBest possible solution: Retain the existing membership authority as the sole admission owner, with recovery-only credentials and atomically persisted owner evidence. Do we have a high-confidence way to reproduce the issue? This is a feature addition; current main supports owner-assisted browser approval but has no member recovery-kit registration or admission path. Is this the best way to solve the issue? The implementation extends existing signed membership operations and persistence rather than introducing a competing admission owner, and the latest repair removes unnecessary projection work. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 809b07c08b20. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +679, Tests +1342, Docs +172, Other +15. Total +2208 across 61 files. Added test files: 5. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (4 earlier review cycles)
Reviewed November 16, 2026, 7:51 PM ET / November 17, 2026, 00:51 UTC (Revision 5). |
33fccfd to
c923202
Compare
c923202 to
3e7e9f0
Compare
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
3e7e9f0 to
d6c591f
Compare
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Merged via squash.
|
…enclaw#200145) * feat(openclaw-id): add recovery-only member device keys * refactor(openclaw-id): isolate immediate member recovery admission * feat(openclaw-id): retain member recovery use notices * feat(openclaw-id): make recovery history actionable * fix(openclaw-id): clarify recovery use notifications * fix(openclaw-id): classify recovery notices by current admission * chore(openclaw-id): format combined recovery and approval contracts * fix: repair member recovery assertion and import boundaries * fix(openclaw-id): retain canonical recovery browser labels * docs(openclaw-id): add sanitized historical recovery proof * test(openclaw-id): consolidate recovered device assertions * fix(ui): measure boot assets with the shipped gzip level selection * fix(openclaw-id): align recovery views with current role controls * test(openclaw-id): account for folded compression parity coverage * test(openclaw-id): separate recovery page coverage after main rebase * test(openclaw-id): remove unused page import after extraction * fix(openclaw-id): skip recovery projection on bookkeeping writes
Related: OCF-552 (Linear) · companion PRs: openclaw/discovery#19, openclaw/claw-loader#38
What Problem This Solves
Fixes: a member who loses every approved browser (site data cleared, new machine) cannot get back into the claw without the owner.
User Impact
User impact: a member can save a recovery kit and later use it to add a new browser to their own account, with the same identity and role. The owner is notified immediately: a toast naming the member and browser, an Inbox item linking to that browser with Remove, and a retained recovery history. Kit use is notify-only (owner's decision); the owner can remove the browser or the member at any time.
Why This Change Was Made
Each member can hold one recovery-only Ed25519 key, listed under the member and never admitted as a tunnel peer. It can only sign
add_member_devicefor that same current member account: no role change, no owner capability, no other account. Removing the member kills the kit; replacing the kit invalidates the old one without removing browsers it already admitted. Admission and the owner-only history record commit atomically. The owner's "used their recovery kit" notice is attributed to the current admission, not any historical record for the same browser key.Targets main. OCF-551 has landed. This branch is rebased onto main
13a0a3e7edff877b24f76f9a263952a61268eccd, preserving main's custom role controls and role-change validation alongside recovery behavior. Landing order remains openclaw → discovery → claw-loader. Discovery and loader protocol snapshots still matchc923202e7b8bbyte-for-byte; this rebase did not change protocol bytes.Includes #200241. Its gzip-parity fix is folded into this PR: emitted boot assets and normalized budget measurements share selection of the smallest gzip at levels 10/11/12. No performance budgets or normalization rules were raised or changed. The performance gate passes with the included fix; this is no longer a dependency waiting to land separately.
Evidence
ClawSweeper P2 repair —
11a19d4abb75da2de290724fplus the regression: four label cases failed becauserecordDiscoveryandrecordSeeneach projected devices. The regression requires two actual storage writes and zero projection/fingerprint calls; it cannot pass by skipping the commits.da2de290724fplus repair patch SHA-2569b81a5993b6f6ea698f78fd2af6a22d5501adf5bd7d7e8b16e729883e09425b3, now committed as11a19d4abb75. Independent Astra review of the three-file repair found no verified P0–P2 findings.local-container,node:24.22.1-trixie, digestsha256:f1e034976f948cf212ef1f659c12e5dd58ac7eab947831813e81a62401ca38be, 8 CPUs/24 GiB: red leasecbx_e14a7141ab8d, runrun_a6a4fe36eab78b64934fe1f151d83473(expected exit 1); green leasecbx_71efc7760f32, runrun_a3f1058ee0df53b119be446a81a08797(exit 0). Both stopped. Scripts apply the named patch in the disposable container, after frozen pnpm installation; no host suites.db541b7fc095fdffba031a43689c629de0aa6121. The same unchanged test passed in three nearby hosted main runs; shared bootstrap changes mean unchanged test source alone does not establish inherited failure or flakiness. A bounded same-container comparison (three whole-file runs each at current-mainfd8d012d70c786b8fa33fbe296c9709f5238d2e7and repaired head11a19d4abb75) was launched, but result collection is blocked: Studio SSH became unreachable and the single reconnect also timed out. Pass/fail counts and this run’s cleanup are unknown; do not infer flake or inherited failure. The detached run will need reconciliation when the host is reachable. No hosted CI rerun requested. Next-head hosted result: all tenchecks-ui-e2ejobs succeeded in run 43989901712 at11a19d4abb75; the coordinator also confirmedchat-selection-to-mainpassed. Theda2de290failure did not recur at the next head. This is not evidence establishing a flake or inherited failure. A/B remains pending because Studio is offline, confirmed by the coordinator via Tailscale; its log is~/crabbox-proof/ocf552-p2-ab.log. No further access attempts or alternative-host runs will be made until the coordinator reports that Studio is back. Lease and task-checkout cleanup remain unverified and pending.Historical main-retarget validation — previous head
da2de290724fda2de290724f8d15becc098b900aa02d41e18989; Discovery twilio: rewrite typing indicator with direct API calls and robust retry #19:2df5189678b4004a99f5e6a01f80aa7e4b6b3203; loader PM2/Production Deployment Failure #38:27efca221154d5d3260e22908b195065db4520f9. All three targetmain.c923202e7b8b, so no vendor resync was needed.3374686a12ce8fbbbc684b5d923bb0cf3ab25455: 265 protocol tests, 31 focused Gateway tests and 95 UI/parity tests passed. Baseline ratchets, additional boundary checks, max-lines, assertion safety, controller checks, plugin import boundaries, core/UI/extension type checks andpnpm ui:check-performance:base 13a0a3e7edff877b24f76f9a263952a61268eccdall passed. Leasecbx_c6ef5bddc7f3, runrun_c440fcfae57c3078ec3330b86b7262e2, exit 0.da2de290724f: scoped extension lint, both People page suites (34 tests), test-line and line-cap ratchets passed. The only delta after the broad pass removes an unused test import and decreases its allocation by one; production source and test assertions are unchanged. Leasecbx_f0a53f601e23, runrun_1acfecd3a2ab41b2ff8c23132bc5af4f, exit 0.cbx_92e09c997309at20ee16ea1ac0additionally passed the two browser test files (2 + 2 tests); that whole run was not green because the later-repaired line cap failed. First-run path/worker setup and test-allocation failures are not counted as passes. After the split, the unused import was caught by hosted lint and removed; the exact-head run above verifies the repair.local-container,node:24.22.1-trixie, image digestsha256:f1e034976f948cf212ef1f659c12e5dd58ac7eab947831813e81a62401ca38be, 8 CPUs / 24 GiB, frozen pnpm install and two test workers. Launch:crabbox run --provider local-container --local-container-image node:24.22.1-trixie --local-container-cpus 8 --local-container-memory 24g --no-hydrate --timing-json --shell -- 'bash core-checks.sh'(final run:bash final-checks.sh). Each receipt reportsleaseStopped: true; final container inspection was empty.Historical data-model compatibility and restart proof (pre-rebase)
Passed in a Crabbox Linux container on the Studio, using candidate
3e7e9f0faf7ac585a82aa5431657e0131eac271cand actual mainbd25e9ef60cc886dc6c0512927bf1cf425e364dfas the database producer. No product files or dependencies changed. A temporary harness occupied the existingclaw-store.persistence.test.tsworker-test entry only inside the disposable container; each revision compiled and used its own state worker throughnode scripts/test-projects.mts.writeStoredClaw, canonical profile persistence, and the core plugin-state API: synthetic membership with an admitted member browser, 8 existing logical plugin-state rows, one profile, and an unrelated sentinel. Main closed the DB before the candidate received its state directory.recoveryUsesprojections, withmember_recovery_kitprovenance. That is data/projection proof for the owner notice's input, not a new rendered-toast screenshot or browser E2E.Execution provenance:
local-container; lease:cbx_6c7099fbc653; run:run_b484c8bc58a93538cf2cd5250c345baa(no hosted run URL supplied).node:24.22.1-trixie; runtime image/digest:sha256:f1e034976f948cf212ef1f659c12e5dd58ac7eab947831813e81a62401ca38be; 8 CPUs / 24 GiB requested.crabbox run --provider local-container --local-container-image node:24.22.1-trixie --local-container-cpus 8 --local-container-memory 24g --no-hydrate --timing-json --shell -- 'bash ocf-552-compat-run.sh'.OCF552_DB_PHASE=createat the main SHA, thenOCF552_DB_PHASE=upgradeandOCF552_DB_PHASE=restartat the candidate SHA, each withnode scripts/test-projects.mts src/gateway/openclaw-id/claw-store.persistence.test.ts. Frozen-lockfile installs; maximum two test workers. Harness SHA-256:e75c00fa62223f5def6631b29ac57015e87a9c31566ab3a1481d955f93167f99; runner SHA-256:8ac9e3d643a3e9c4a680837294b77534885ac51eb4e617036019b411a120e788.leaseStopped: true; no Crabbox containers remained on inspection. Task source checkout removed after evidence collection; no live Gateway or shared state was used.@retained.namespace prefix. Both were corrected in the harness only, then the entire three-phase proof passed from a fresh container. Both earlier leases stopped.Sanitized result (counts and booleans only):
{"mainRows":8,"profiles":1,"initialOldRowsUnchanged":8,"untouchedRowsRetained":6,"schemaUnchanged":true,"kitSurvivesReopen":true,"blankAndDuplicateCanonicalLabels":true,"historySurvivesReopen":true,"freshProcessKitAndHistoryPersisted":true,"deviceAndOwnerHistoryLabelsMatch":true}Historical live evidence (redacted)
Evidence README and frozen-revision provenance
These are historical checkpoint-resumed runs, not final-head or uninterrupted live proof. Save/wipe/recovery and toast use loader
fc880c29; retained history uses4f76bb64. Inbox and wipe are script assertions, not screenshots. The README includes boolean-only results and exact core/Discovery revisions. The artifacts do not establish the later canonical-label fix or persistent-storage UI.November 16 follow-up
Earlier published heads (superseded for core by the revision above): core
c923202e7b8b, Discoverya986ad1a6ac0, loader1bc561fd1b1f. Rebased on OCF-551 core8b0ce1f85d90, Discoveryc36205e9c85c, loader41f5f48f2fe0. Independent integration review found no verified P0–P2 findings; all 56 loader and 90 Discovery vendored upstream files match core byte-for-byte.CI repairs: documented four assertion invariants, moved the recovery-use type to a leaf contract to break the import cycle, and routed the browser test through the shared UI fixture instead of a private core import. No admission behavior change.
Exact repaired-head local checks: assertion-safety against the new 551 base, all 19 boundaries, full guards-architecture, 265 protocol tests, 36 focused protocol/Gateway tests, 25 fixture tests, two browser E2E tests, production/test types and scoped lint pass.
Earlier live proof below remains evidence at its named historical heads; no new live run was needed for comment-only protocol and import-boundary changes.
Real-behaviour proof on an isolated Gateway on fsn1 with production loader/Discovery and native iroh, at the historical live-proof code heads (core
33fccfd09827, loaderfc880c29cd1d, discovery903765ca6ca7): invite → save kit → wipe browser site data → recover with the kit (same signed profile, account and operator role; new browser key with recovery provenance) → owner toast, Inbox item and history. Another member's kit and a removed member's kit are refused; history is retained. On the stacked branch, local owner deny and local owner approval after a measured 40s wait also passed. Harness interruptions (selector fixes, one rate-limit window) are recorded; it was not one uninterrupted run. All proof services and synthetic issuer sessions were cleaned up.Independent reviews per repo and of the 551 rebase; all verified findings fixed with fail-first regressions; final review no P0–P2.
Core: 265 protocol, 381 Gateway, 89 identity and focused UI tests; types and lint.
Historical stacked test-line result: 1256/1257 against the 551 base. Superseded by the passing main-based result above; no stacked-allowance shortfall remains.
Gaps: Chromium only end to end (WebKit X25519 key-import issue tracked as OCF-553). Kit replacement while a request is in flight and interrupted-mail cases are unit-tested, not live.
🦞 Made with OpenClaw