Repository navigation
feat(openclaw-id): define accountless node enrollment - #193980
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. |
50f4ce3 to
7d63dc5
Compare
|
Codex review: needs maintainer review before merge. What this changesThis PR defines accountless node invitations, owner-approved node membership, signed Discovery contracts, and enrollment links. Example: Enroll a Linux node named Build node declaring system.run and compare verification code 168017.
Review scores
ProductKind: Feature · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This maintainer-authored PR is a useful, coherent protocol stage with no remaining correctness findings; the newly published traces resolve the previous proof blockers. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe portable protocol package validates signed invitations and membership changes, produces authority state and signed-snapshot bodies, and leaves persistence, transport admission, and pairing effects to Gateway and Discovery consumers. flowchart LR
Owner[Owner device or recovery kit] --> Authority[Protocol authority]
Node[Headless node] --> Redemption[Signed redemption]
Redemption --> Authority
Authority --> Pending[Pending approval]
Pending --> Authority
Authority --> Snapshot[Signed membership snapshot]
Snapshot --> Consumers[Gateway and Discovery consumers]
Technical reviewBest possible solution: Land this bounded protocol stage using the recorded coordinated consumer cutover, with runtime connectivity delivered by the downstream stack. Do we have a high-confidence way to reproduce the issue? This is a protocol feature; the supplied exact-head Gateway output demonstrates the repaired migration and stage authority behavior without executing target code during this review. Is this the best way to solve the issue? The change is a coherent first stage that reuses existing signature verification, membership sequencing, retention, and persistence owners while keeping runtime enrollment with its consumers. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against f1c5af0f6bc3. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +960, Tests +662, Docs +259, Config +11, Other +4. Total +1896 across 39 files. Added test files: 2. 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. Review metrics
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 (2 earlier review cycles)
Reviewed November 8, 2026, 11:31 AM ET / 16:31 UTC (Revision 3). |
57baf78 to
8f6b458
Compare
84d94f6 to
5eb5e40
Compare
dfa0d58 to
8751edc
Compare
5eb5e40 to
c2a19d6
Compare
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Related: #192352
What Problem This Solves
Headless nodes need an accountless, owner-approved identity and bootstrap contract before they can reach a claw through the OpenClaw ID relay and tunnel.
User Impact
This PR defines the protocol layer only; it does not yet enable node connectivity in the running product. Nodes get a separate W-only key class, never owner or member privileges. All changes revise the unshipped v1-draft in place.
Stack dependency: this now targets
main. Gateway, Discovery and node-host consumers follow in the implementation stack. A minimal existing Gateway consumer repair refuses accountless member-redemption mail withaudience_mismatchthrough the normal settlement/acknowledgment path; valid member handling is unchanged. Test fixtures initialize the new empty draft state and preserve their concrete human-sender types. Persisted-state initialization and snapshot re-signing are included at the startup migration boundary. Full node dispatch and runtime connectivity remain in the following stack.Why This Change Was Made
NodeInviteCapplus a proof key registers directly at the Gateway. W-signedNodeRedemptionproves the invite and becomes pending, admitting nothing.add_nodeandremove_node, denial and peer revocation use the existing membership authority. Nodes have listing seqs, limits, inactivity clocks and pairing-cleanup events; snapshots carrynode_peer_keys.--discovery-url(or deployment configuration) supplies the separate Discovery origin; clients never infer it from the hostname/relay and never weaken pin verification.The simplification pass reused owner verification, sequences, invite proof-key derivation, retention, strict schema combinators and signature transport. Node-specific lifetime enforcement leaves member policy unchanged. This remains a protocol stage: Gateway/UI/runtime enforcement follows in the stack.
The owner-reviewed flow now includes a shared six-digit
nodeVerificationCodebound to the claw, invite, W and signedNodeDescription. The terminal and dialog show the same code; the owner compares it and explicitly clicks Approve. Opening the dialog never approves automatically. The signed description declares display name, platform, commands and caps under strict size/count limits; it is retained with pending and approved nodes, but is not standalone authority. First-connect command/capability auto-approval is bounded to subsets of what the owner approved; additions use normal capability approval. Node invite creators default to 10 minutes; registration enforces a strict one-hour maximum.Evidence
pnpm install --frozen-lockfile: independent physical worktree install passed; donor checkout unchanged.pnpm test packages/openclaw-id-protocol --maxWorkers=1: 169 tests / 25 files passed after the owner-approval UX additions (4.03s Vitest, 7.38s wrapper).pnpm tsgo:core: passed.node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.core.json packages/openclaw-id-protocol/src: passed, 67 files.Fresh independent read-only review of the UX delta found no verified P0–P2 findings and independently reproduced code vector
168017. Canonical production types and strict package types (including tests), lint, format, MDX, line caps, test allocation and whitespace checks passed.Protocol boundary coverage includes forged/wrong-key and mailbox approval refusal, pending-only redemption, owner capability/sequence checks, node/human key separation in both directions, limits, denial, removal events, revocation replay, inactivity, strict links and W-signed request path binding. Deployed Gateway/Discovery enforcement and real tunnel traffic remain named integration gates for the following stack, not claims made by these tests.
Stack conflict repair: rebased onto
90a2c765e10799dce65c5cffc2539b878a46f71a, preserving both the base’s signedprotocolsand this change’snode_peer_keyssnapshot fields. Regenerated deterministic vectors; protocol suite, canonical production typecheck, test-line ratchet and whitespace checks passed again. The range-diff contains only the combined snapshot schema context and regenerated signatures.Combined independent Astra review at
30d3f15ac8bec96419d9641ffb76a587de3ded41: no verified P0–P2 findings. This closes the earlier missing-review gap by covering the accountless member-mail refusal together with all UX additions. Source inspection traced refusal settlement, subsequent-message processing, acknowledgment and cursor persistence; human redemption behavior is unchanged. The reviewer also independently reproduced code168017. Existing passing test/type/lint evidence was reused, not rerun by the reviewer. No code changes were required.Vendor portability follow-up at
84d94f697987e0ed145f7edb3be0edd257080d59: replacedURLSearchParams.keys()iteration withforEachpair counting; the existing exactly-once known-field checks still reject duplicates and unknown keys. Addedtsconfig.portable.jsonand its documented command, checking package source with ES2023 + DOM and no Node ambient types or DOM.Iterable. ES2022 alone fails on pre-existing Array.toSorted usage; no unrelated array behavior was changed. The local compiler includes iterable DOM declarations, so Discovery/loader vendor builds remain the final consumer-compiler gate. All 169 protocol tests, portable types, focused lint, 7-file MDX check, format, source line cap and whitespace checks passed. Independent Astra review found no verified P0–P2 findings and confirmed equivalent parser guards across 43 cases. Test allocation remains 565 (no new test lines).November 6 stack rebase
Replayed only the three owned protocol/UX/portability commits onto rewritten base
8f6b45814afd1a3aa6b241a4908ec6c0d7b6504a. New head:5eb5e40cdfa31e691fae575a1bd792bc3d9c1758. Retained the base RootReset types, strict validation, verifier and vectors alongside the node contracts; snapshots retain both protocols and node_peer_keys. Regenerated signed fixtures with buildStatementVectors. Protocol suite: 187 tests / 26 files passed; portable typecheck andpnpm tsgo:corepassed. Focused lint, seven-file MDX check, formatting and whitespace checks passed. Independent Astra conflict-resolution review found no verified P0–P2 findings and verified preservation of base reset/pin vectors and original feature vectors. Pushed using an exact expected-head lease on84d94f697987e0ed145f7edb3be0edd257080d59. No downstream branches changed.November 7 main landing candidate
Head
c2a19d6ce7125afa2c3622c38441fc55d6102742, rebased onto mainf8b1a6ba3d8d7a29fd44529fa3833229e61f6261; protocol remains v1-draft revised in place. Base approval-subtree restrictions and loader code-delivery trust assumptions are retained. Signed vectors regenerated with the canonical builder (no final byte changes).Fresh independent Astra/high full review found one P1: previously persisted linked claws lacked the new unsigned node collections, breaking normal owner reconnect and snapshot publication. Fixed at the existing startup migration boundary before authority is exposed; preserves membership, listing sequences, signed binding/certificates, initializes only missing maps and schedules a newly signed snapshot. Regression reproduced the exact isNode TypeError before the fix and passes afterward. Independent correction review cleared the P1 with no new verified P0–P2 findings.
Validation: protocol 196 tests / 27 files passed; Gateway OCID consumers 251 passed, 10 skipped / 44 files; UI protocol consumers 24 / 5 files passed. After the migration correction, migration/authority/publisher/persistence siblings 30 / 4 files passed. Portable ES2023+DOM typecheck, canonical
pnpm tsgo:core(rerun after repair), scoped lint, formatting, seven-document MDX and whitespace checks passed. Test-line ratchet has 30 lines slack with the allocation unchanged; source line-cap ratchet passed for 28 changed source files. Discovery deployment, node runtime/transport/UI and full live tunnel proof remain downstream; the new regression exercises Gateway authority load and local snapshot construction, not live Discovery publication. No main or child branches changed.PR is ready at d6f0b8f; hosted CI for this head completed successfully (run 42388517226). No inherited failure exception is claimed. Prior native preparation was at c2a19d6; review guard and artifacts for the comment-only correction are validated at this exact head (zero findings). No merge has been submitted. The coordinator withdrew the native-CLI merge route: this lane will stop after CI evidence and handoff; Josh will perform the final squash or name an approved writer.
CI correction (comment-only)
Run 42387608117 at
c2a19d6ce7125afa2c3622c38441fc55d6102742completed with a PR-causedchecks-fast-baseline-ratchetsfailure: the existing node-key SAFETY comment inauthority/allowlist.tswas above the chain instead of adjacent to the assertion. This is not an inherited failure. Commitd6f0b8f7c9b2d594a44c524adbe52aeec294071bmoves only that comment, without changing executable code. The exact assertion-safety ratchet reproduced red before and passed after; formatting and diff whitespace passed. Existing independent behavior review and focused tests apply to unchanged executable code; new hosted CI completed successfully as recorded below.Final CI handoff — November 7
Exact head and pre-squash restacking anchor:
d6f0b8f7c9b2d594a44c524adbe52aeec294071bonopenclaw-517/node-protocol. Hosted CI run 42388517226 completed successfully at this head, includingchecks-fast-baseline-ratchetsandopenclaw/ci-gate. The current combinedopenclaw/ci-gate, dependency-review and security-sensitive-review statuses are SUCCESS (gate publication). No inherited failures or exception are claimed. One older PR-context run was cancelled; its successor completed successfully.Exact-head review artifacts validated with zero findings; the earlier independent behavioral review remains applicable because the final correction only repositions an existing comment. Prior native preparation remains recorded at
c2a19d6ce7125afa2c3622c38441fc55d6102742, not the final head. This lane has no merge authority and has submitted no merge request. Merge remains blocked on an approved writer: Josh handles the final squash or names an approved route. Downstream owners should restack from the full anchor above after the squash; no child branches were changed.Review repair and cross-stack evidence — November 8
Current head and restacking anchor:
a1038c7f22c6a92f2fb705df5e3adb4f6b7464f0. This supersedes the previous final-CI handoff above; that green CI belongs to the prior head. Hosted CI for this head passed: 61 checks passing, 0 failing, 0 pending. Eight earlier failures were GitHubAPI rate limit exceeded for installationerrors in scan/security API steps (opengrep itself reported 0 findings), not PR-caused; all passed on rerun (OpenGrep attempt 3, CodeQL Critical Quality attempt 3, CodeQL attempt 2). No merge or child-branch mutation is authorized.node_redemptionnow produces an explicitunsupportedrefusal through normal settlement before acknowledgment and cursor persistence. All unhandled kinds use the same fail-closed fallback; neither redemption nor authority submission is invoked. This restores the original mailbox dispatch/settlement intent. Reader-boundary regression reproduced zero refusal callbacks on the old code and passes after repair. Final mailbox/authority run: 16 tests / 2 files passed, 11.23s Vitest / 18.14s wrapper; node regression 5ms. Core types, focused lint, formatting, assertion-safety and test-line gates, MDX and whitespace checks passed. New allocation records exactly 69 regression lines.f8b1a6ba3d8d7a29fd44529fa3833229e61f6261protocol APIs was saved through the unchanged SQLite writer without node maps. Two separate real source-Gateway processes proved startup/cold restart, readiness 200, authenticated status/People RPCs, owner/operator-member resolution, inactive-key maintenance, expired-invite sweeping, durable map initialization, preserved signed credentials, and cryptographically verified snapshots delivered to a local HTTP mirror. Both exited cleanly. Minimal isolated source Gateway, not an installed stable-release upgrade or model/channel test.not_direct; approval without pending redemption is refusedinvite_not_pending. This PR is not a blanket prohibition on node authority writes. The consuming Gateway still resolves no node principal, omits W from its tunnel allowlist, rejects token fallback withopenclaw_id_not_admitted, and creates no pairing.4fc18ce33e9763b25f01c7ece2f1643c6de10634plus node-host feat(node-host): connect nodes over the OpenClaw ID tunnel #193982 at5771dc00ae185442c456c6899c015cc31e6eb058, composed only in a detached proof checkout. Real Gateway service, SQLite, native iroh child, private ingress and node candidate passed: approved W reacheshello-okwith node-only pairing; pending/foreign/revoked W are denied before ingress, Gateway requests or pairing mutations; operator escalation/owner API/token fallback denied; live revocation closes transport and removes pairing. 1 composition test passed, 7.579s test / 30.17s wrapper. These enforcement owners are the downstream PRs, not feat(openclaw-id): define accountless node enrollment #193980 alone. Local QUIC only; no hosted relay or CLI enrollment claim.96927c6ee6955ed8061ee344700f169ca0cc1e16,test/nodes.test.tsre-run locally: 13/13 passed, 5.66s. Local Worker/D1 tests verify identical descriptor 403 for unknown/pending/removed/foreign and owner/member-only W, bearer-owner 401, and revalidation of stored signature/claw/binding/signer. Approved current node receives descriptor. Unmerged, undeployed test evidence, not live staging or the composed-stack descriptor route.d6f0b8f7c9b2d594a44c524adbe52aeec294071bto this repair: no P0–P2 findings. Local ClawSweeper checkout was dirty; autoreview helper failed authentication, so no successful helper review is claimed. Hosted ClawSweeper re-review at this head resolved both earlier findings and reported no new findings.Retained finding / limitation: during startup/mailbox overlap, an accepted root approval reached authority seq 5 while the publication receipt remained seq 4 with
publish_pending:falseafter a 90-second observation. A deterministic owner-level reproduction demonstrates a compatible lost-request window inpublication-retry.tsaround awaitingsetPending(false). The publication owner is unchanged from the PR base, but identical baseline runtime failure has not been established; this is not an inherited-CI exception or a claim of successful automatic convergence. Recovery reconciled accepted writes without replay, restarted and explicitly published a verified seq-6 snapshot containing both nodes. The narrow mailbox repair does not fix this separate publication finding. It is fixed separately in #195261, now merged tomainasdec19a6acb83e8a961d2df5a4ec7e1d53d88171b(red/green regression against the production retry owner; deterministic reproduction now publishes[1, 2]). This PR does not touchpublication-retry.ts.Inspectable proof output — November 8
Sanitized terminal output from the runs summarized above. Synthetic state only; no addresses, keys, credentials, private endpoints or phone numbers. Raw logs and state stay private.
Existing-claw upgrade, cold restart and stage-authority proof (source Gateway, PR head
a1038c7; base fixture fromf8b1a6b)The
Error: expected startup publication was not producedline and thepublication-late-request-reproductionresult are the publication lost-request finding fixed in #195261. The final node consumer proof restarted confirmed state without replaying either approval.tunnel.state: unavailableis expected: the native iroh binding was not built for this run, so it makes no QUIC/relay claim.Composed-stack final-effect proof (Gateway #194001
4fc18ce33e9763b25f01c7ece2f1643c6de10634+ node host #1939825771dc00ae185442c456c6899c015cc31e6eb058, common ancestord6f0b8f7c9b2d594a44c524adbe52aeec294071b)Real Gateway OCID service, SQLite authority/pairing stores, supervised native iroh tunnel child, private ingress and node host, over local direct QUIC.
*Effects: 0means no private-ingress request, no Gateway HTTP/WS request or upgrade, and no pairing-store change after the admission attempt.{"phase":"setup","nativeBinding":true,"gatewayService":"production","authorityStore":"SQLite","ownerRpc":true} {"case":"pending","tunnel":"terminal_not_admitted","ingressEffects":0,"gatewayEffects":0,"pairingEffects":0} {"case":"foreign","tunnel":"terminal_not_admitted","ingressEffects":0,"gatewayEffects":0,"pairingEffects":0} {"case":"approved","tunnel":"admitted","gateway":"hello-ok","pairing":"openclaw-id-node","roles":["node"],"scopes":[],"commands":["system.run"]} {"case":"node-privilege-escalation","ownerTokenPresented":true,"operatorConnect":"rejected","ownerApi":403,"operatorHttp":401,"cookiesIssued":false,"pairingEffects":0} {"case":"revoke-live-approved","nativeConnection":"terminal_revoked","pairing":"removed"} {"case":"revoked-reconnect","tunnel":"terminal_not_admitted","ingressEffects":0,"gatewayEffects":0,"pairingEffects":0} {"phase":"cleanup","clientsStopped":true,"transportsClosed":true,"gatewayClosed":true} {"testFilesPassed":1,"testsPassed":1,"caseTestMs":7579,"vitestSeconds":26.08,"wrapperSeconds":30.17,"exitCode":0}Descriptor disclosure: Discovery #6 at
96927c6ee6955ed8061ee344700f169ca0cc1e16,npm test -- test/nodes.test.ts: 13/13 passed (local Worker/D1 tests of an unmerged, undeployed PR).Rollout: coordinated cutover with Discovery and the loader
node_peer_keysis a required field of the signedMembershipSnapshot, and the Gateway always publishes it (empty when there are no nodes). Every strict v1-draft consumer rejects both unknown and missing fields, so this is a hard cutover, the same treatment the earlierprotocolsfield received. This PR lands together with two companion PRs, each vendoring this PR's protocol at exactlya1038c7f22c6a92f2fb705df5e3adb4f6b7464f0(written by each repository'sscripts/sync-protocol.mjs; vendoredsrcverified identical to this commit):f377f33c4ca9: rebased onto Discoverymain, mergeable and clean. Full suite and typecheck pass; PR CItestpassed anddeploywas skipped. No D1 migration or configuration change.9de6778f7a90: no loader source changes needed; fixtures now sign new-shape snapshots, and a new end-to-end test enrolls a recovery kit against a snapshot that lists a node key. Unit tests 108/108; PR CItestpassed anddeploywas skipped. The five local Playwright failures also fail identically on loadermain.Sequence: merge this PR, then Discovery#6 and claw-loader#10 (each deploys to staging on push to
main), then update Labs Gateways. Between the Discovery deploy and a Gateway's update, that Gateway's snapshot publications are refused and its existing relay entry remains; node access fails closed until a new-shape snapshot is published. Rollback reverts all three and requires Gateways to republish old-shape snapshots.