Repository navigation
fix(node): keep paired credentials after service enrollment - #168653
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review in progressClawSweeper is reviewing this revision. This supersedes any previous blocked status. |
|
@clawsweeper review |
|
🦞👀 Re-review progress:
|
|
Codex review: needs maintainer review before merge. What this changesThis PR preserves paired-node authentication across service enrollment and adds an explicit service flag for intentional environment credentials. Example: A node paired with gateway.example:18789 restarts with OPENCLAW_GATEWAY_TOKEN=unrelated-gateway-token.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open for landing: current main retains the credential-selection bug, the updated evidence resolves the previous review blockers, and no actionable introduced defect was found. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe connect CLI enrolls a node; the service planner records restart arguments and environment, and the node runner delegates credential refresh and authentication to GatewayClient. flowchart LR
A[Connect CLI] --> B[Saved node pairing]
B --> C[Service planner]
C --> D[Node runner]
B --> D
D --> E[GatewayClient]
E --> F[Gateway authentication]
Technical reviewBest possible solution: Land the shared paired-credential selection repair with its documented explicit environment override. Do we have a high-confidence way to reproduce the issue? Current-main source establishes the credential-displacement path, and the body supplies real baseline authentication failures; this read-only review did not rerun them. Is this the best way to solve the issue? Sharing saved-endpoint eligibility between runtime and service planning fixes both affected producers while preserving GatewayClient token refresh, retargeting, and explicit shared authentication. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 8d1c7bcbce48. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +53, Tests +98, Docs +22. Total +173 across 12 files. Added test files: 0. View PR surface stats
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 (1 earlier review cycle)
Reviewed October 10, 2026, 6:17 PM ET / 22:17 UTC (Revision 2). |
8a906bd to
dded84b
Compare
|
@clawsweeper re-review The body now contains the completed ambient-source matrix, sanitized allowed/denied authentication traces, the published v2026.9.9 → candidate upgrade cells for both joined and explicit shared-token setups, and exact-head revoked-device command-dispatch rejection. The published planner instrumentation is disclosed (unchanged shipped bytes plus only an export). Final head dded84b has green CI and a fresh LAND review; the final authorization proof used an independently built frozen checkout of that head. No OS-supervisor claim is made. |
|
🦞👀 Re-review progress:
|
## What Problem This Solves Fixes node services installed through `npx openclaw connect <join-url> --service` or `npx openclaw node install` pointing at npm's disposable `_npx` cache. ## User Impact The one-paste command installs the selected OpenClaw release into a durable npm prefix under the node's state directory before writing the service. Removing npm's exec cache no longer removes the service's executable. Installation prints the package version, chosen runtime, service command, and a fresh-npx node update command. ## Why This Change Was Made The service argument resolver previously used the running package's resolved path. #167905 fixes pnpm's replaceable store-generation paths by selecting its existing stable link; npm exec has no stable link to select. This preserves that pnpm behavior and adds node-install promotion through the existing npm update owners (`resolveGlobalInstallTarget`, `runGlobalPackageUpdateSteps`, and their staged publication/rollback/cleanup). There is one `<state-dir>/npm` prefix, not a prefix per release. The normal state-directory/profile resolver chooses its location. Run `npx -y openclaw@latest node install --force` on the node to update it, retaining the same profile/state-directory settings. An exact version or `@beta` can replace `@latest`. Reinstalling an already-selected version repairs damaged package files. No new settings or package manager. This does not change `openclaw update` or its existing co-located Gateway selection behavior. Node auto-update still follows the node's npm channel, not the connected Gateway's version/build. The rebase preserves #168653's paired-credential filtering and explicit `--auth-from-env` service argument. No overlap with Pash/Sarah changes. ## Evidence Final code: `27b447dc07b737126124ff8847f2059cb8a4f921`. Packaged live proof ran on `292bd19fe934ecf4ee4e3b20b00a03a1b08f7933`; production feature code and docs are unchanged since that proof. The final revision only corrects regression-test platform handling and rebases onto green main. - **Before:** the regression on baseline `e40606fdea96135758ec5bc0b1a355d08ead0c7e` selected `.npm/_npx/.../node_modules/openclaw/dist/index.js`. In the live isolated replay, published `[email protected]` completed real join-URL enrollment; deleting its npm exec cache made the saved command exit 1 with `MODULE_NOT_FOUND`. - **After:** the canonical self-contained package passed `scripts/package-openclaw-for-docker.mjs --skip-build --allow-unreleased-changelog` and its tarball inventory/import-graph integrity check. Real `npm exec --package=<candidate.tgz> -- openclaw connect <join-url> --service` promoted that selected package into the node's state-owned npm prefix. Both actual launchd and systemd generators selected the durable entrypoint. After removing `_npx`, executing the persisted command as a separate process connected to the isolated Gateway. The published driver's device identity and node settings were unchanged. - **Upgrade and repair:** seeded the durable prefix with published `[email protected]`, retained the enrolled node state, and invoked the candidate through fresh npx with `--profile upgrade node install --force`. The prefix became the candidate version. Overwriting its `dist/index.js` and repeating the same command restored the exact original file bytes. The runtime, device identity, and node settings remained unchanged; the repaired persisted command connected after deleting `_npx` again. The prefix contained only `bin` and `lib`, with one `openclaw` package rather than per-release directories. - **Package identity:** the unpublished candidate shares the version string `2026.9.9` with the public release. An isolated loopback npm registry served the canonical candidate tarball for that version, while forwarding dependency requests to npm. This prevents accidentally testing promotion of the older public package with the same version string; no product behavior was mocked. - **Focused checks:** 50 tests passed across `src/commands/node-daemon-install-npx.test.ts`, `src/commands/node-daemon-install-helpers.test.ts`, and `src/cli/node-cli/daemon.test.ts`. The new regression uses actual generators and executes their commands after cache deletion. The final portability correction keeps systemd coverage on non-Windows platforms and reads launchd artifacts only on macOS. That corrected regression passed (1.285 s test execution), and the `core-test-commands` type graph passed. Its unchanged durable-path assertion failed on the baseline as expected (pueue 2903). - **Changed checks:** formatting, conflict/line-count/assertion/SQLite/mock-export ratchets, config docs, plugin boundaries, dependency guards, and the core type graph boundary passed. The prior head's local core typecheck stopped on unrelated `channel-presence-policy.ts:519` TS6133; the branch is now rebased onto the main fix rather than carrying a separate repair. - **Independent review:** LAND on exact final head `27b447dc07b737126124ff8847f2059cb8a4f921`, including the corrected test, updater-step adapter, and paired-auth preservation. Sanitized live results: ```text before-cache-deleted: exit 1 (MODULE_NOT_FOUND) after: /state/npm/lib/node_modules/openclaw/dist/index.js node host gateway connected: ws://127.0.0.1:<isolated-port> upgrade: 2026.9.8 -> candidate 2026.9.9 sameVersionRepair: true runtimePreserved: true pairingAndSettingsPreserved: true connectedAfterCacheDeletion: true ``` **Native-supervisor limitation:** supervisor activation was not verified. Native service installation reaches the existing systemd user-session/profile guards in the unprivileged container; macOS refuses native installation from an isolated HOME. The proof runs actual generated service arguments as a separate live node, not under an activated OS supervisor. Launchd XML was decoded in Linux and passed through the production generated-environment resolver; the macOS regression exercises the actual plist reader. No HOME-guard bypass, privileged container, existing Gateway, or real laptop installation was used. **CI:** [final-head run 38097819645](https://github.com/openclaw/openclaw/actions/runs/38097819645) passed, including production types, test types, lint, source contracts, and the corrected Linux regression. All applicable PR checks finished with no failure, cancellation, or pending check. The final head is rebased onto green main; no inherited failure waiver or SDK budget change is needed. ClawSweeper is **ready, 5/6**, and the independent reviewer returned **LAND**, both on `27b447dc07b737126124ff8847f2059cb8a4f921`. ## Bounded cost Only npx-backed node installation needs an additional npm installation. It uses one state-owned prefix and the existing updater's staging, verification, rollback, and cleanup; it does not accumulate per-version prefixes. Reuse verifies the installed package and advertised content inventory, so a same-version damaged package is repaired. Ordinary node execution and model/session paths are unchanged. Non-npx installation adds only entrypoint inspection and installation diagnostics. Source +104/-2, tests +88/-0, docs +34/-0; net +224 across seven files. The growth reuses the existing package updater rather than adding another installation or state owner. ## Merge Danger Two-way code change, with a durable npm installation left in the selected node state directory if reverted. A revert restores the old npx service-install behavior; it does not remove an already installed package. Blast radius is headless node service installation and its printed diagnostics; Gateway installation and pnpm launcher resolution are unchanged. Co-authored-by: Ayaan Zaidi <[email protected]>
…#168653) ## What Problem This Solves Fixes paired nodes failing to authenticate after `openclaw connect <join-url> --service` when the machine already has credentials for another Gateway. ## User Impact A node reconnecting to its saved Gateway uses its paired device token instead of an unrelated Gateway token or password from the machine's environment, configuration, or state-directory `.env`. Paired service installations no longer persist those ambient credentials. Intentional shared-token/password connections remain supported through `openclaw node run --auth-from-env` and `openclaw node install --auth-from-env --force`. This exposes the existing foreground override and records that explicit choice for installed services. If it displaces an available paired credential, the warning names the selected environment variable, never its value. No new configuration keys or token migration are introduced. ## Why This Change Was Made The node credential owner already recognized a saved pairing but still treated every populated `OPENCLAW_GATEWAY_TOKEN` / `OPENCLAW_GATEWAY_PASSWORD` as an explicit override. The service planner also persisted those ambient values. Environment variables loaded from `env.vars` or the state-directory `.env` therefore had the same effect as an intentional override. The runtime and service planner now share the same saved-endpoint eligibility check. Default reconnects leave device-token selection and refresh with `GatewayClient`; explicit shared auth uses the existing environment-only path. GatewayClient's trusted-endpoint retry policy is unchanged. This retains the intent of [openclaw#31122](openclaw#31122) (intentional service environment credentials survive restarts), [openclaw#136253](openclaw#136253) (a co-located Gateway must not displace paired-node auth), and [openclaw#159360](openclaw#159360) (expired fallback setup codes may only resume the saved pairing; no expired bootstrap or shared-auth fallback). ## Evidence - On baseline `d1abe907cb7`, an isolated Gateway issued a real join URL and a second isolated machine state completed bootstrap pairing through `connect --service`. The first handshake of the restarted real install-plan command failed authentication for process-env token, process-env password, config `env.vars`, and state-directory `.env`. All four sources were persisted into the service environment. CWD `.env` was already blocked by workspace policy; plain co-located `gateway.auth.*` was already correctly skipped. - The repaired replay connected on the first handshake for all six sources, without persisting any ambient token/password. The explicit `--auth-from-env` shared-token control also connected, retained its selected credential in the generated service environment, and retained the explicit service argument. | Credential source | Baseline first handshake | Repaired first handshake | Repaired ambient credential persisted | | --- | --- | --- | --- | | Process token | Auth rejection | Connected | No | | Process password | Auth rejection | Connected | No | | Config `env.vars` token | Auth rejection | Connected | No | | State-directory `.env` token | Auth rejection | Connected | No | | CWD `.env` token | Connected (already blocked) | Connected | No | | Co-located `gateway.auth.*` | Connected (already skipped) | Connected | No | | Explicit shared-token flag | — | Connected | Yes, intentionally | Sanitized authentication excerpts (ephemeral port replaced): ```text baseline, ambient token: node host gateway connect failed: unauthorized: gateway token mismatch (provide gateway auth token) candidate, ambient token: node host gateway connected: ws://127.0.0.1:<isolated-port> candidate, explicit shared-token override: node host: --auth-from-env selects OPENCLAW_GATEWAY_TOKEN instead of the paired device token node host gateway connected: ws://127.0.0.1:<isolated-port> ``` - **Published-driver × candidate proof:** npm `[email protected]` performed real enrollment and generated service plans for both a join-enrolled node carrying unrelated ambient credentials and an intentional shared-token node without a cached device token. Candidate Doctor migrated their published schema 19 state to schema 20, then the candidate install planner/restart path connected both: the first using its paired token without retaining ambient auth; the second using the explicitly persisted shared token and `--auth-from-env`. Device identity, durable node settings, and the co-located Gateway settings were preserved in both cells. - The no-cache shared-auth fixture used the published production auth-store owner to remove only its local node-token cache after the published connection; its identity and Gateway-side pairing remained intact. No raw database edits were used. - **Revocation/final-effect proof on frozen head `dded84b33f34516638a4d2cad8b748be58521734`:** an explicitly approved `system.which` invocation returned `{"bins":{"true":"/usr/bin/true"}}`. After `devices revoke --role node`, restarting the same node with the valid shared Gateway token still present in its environment failed with `AUTH_DEVICE_TOKEN_MISMATCH`; the node never completed hello, and the real invocation returned `{"ok":false,"error":{"type":"cli_error","message":"node pairing changed while invocation was active"}}`. Device identity was unchanged. The live assertions completed; the initial report formatter rejected the CLI's trailing diagnostic footer, so the retained leading JSON objects were independently decoded and asserted. ```text node host gateway connect failed: unauthorized: device token mismatch (rotate/reissue device token) node host gateway reconnect paused after close (1008): unauthorized: device token mismatch (rotate/reissue device token) detail=AUTH_DEVICE_TOKEN_MISMATCH; waiting for operator action ``` - The runner regression failed on baseline for all three nonempty ambient credential combinations. The install-plan regression failed because ambient auth was persisted and the explicit service flag was absent. - Six focused owner suites passed: runner, node runtime/install plan, install helper, node registration/lifecycle, and connect CLI. Existing GatewayClient and candidate-connection suites also passed, including trusted retry and refusal to retry untrusted token mismatches. - Independent adversarial review returned **LAND** on final head `dded84b33f3`. `git range-diff` confirmed the two commits are patch-identical to the pre-rebase reviewed/proven version `8a906bd94e3`; the published-driver cells ran before that rebase, and the final authorization proof ran against a separately built, frozen checkout of `dded84b33f3`. **Proof limitation:** the production canonical-home guard correctly refuses an OS-service installation under an isolated temporary HOME. The accepted isolation proof therefore executes the real `buildNodeInstallPlan` output (persisted command and environment) as the second process, against a live isolated Gateway. This is not a claim of exercising an actual OS supervisor. No existing Gateway, node service, or laptop installation was modified. The published planner is private in the shipped bundle. Its isolation harness loaded a byte-identical copy of the shipped daemon chunk with **only** `export { buildNodeInstallPlan };` appended; authentication, service planning, and guards were not changed. Original chunk: 12,991 bytes, SHA-256 `7d67af30e747f36ea91d87f7b00fffb16ca7111e13dd1d4ce6195812b6de55da`. The actual published CLI performed enrollment. The temporary exported copy was removed afterward. Final exact-head CI is **green**: [run 38089699521](https://github.com/openclaw/openclaw/actions/runs/38089699521). The previous inherited boundary failure was fixed on `main`, and this branch was rebased onto that fix. Local changed checks passed formatting, ratchets, core types, and core-test types, then stopped on pre-existing unrelated model-auth/solid-lint dead exports; the final hosted gates passed. ## Bounded cost The runtime reuses the existing saved-endpoint/token eligibility read; only the explicit environment-override path additionally checks whether its warning displaces a pairing. Service installation adds bounded read-only checks of existing node state, identity, and token. No new tables, polling, retries, model calls, or background services are introduced. The new install-plan cases took 26 ms of test execution in the focused run; the six-suite invocation took 325.65 seconds including cold worker compilation. Co-authored-by: Ayaan Zaidi <[email protected]>
…w#168644) ## What Problem This Solves Fixes node services installed through `npx openclaw connect <join-url> --service` or `npx openclaw node install` pointing at npm's disposable `_npx` cache. ## User Impact The one-paste command installs the selected OpenClaw release into a durable npm prefix under the node's state directory before writing the service. Removing npm's exec cache no longer removes the service's executable. Installation prints the package version, chosen runtime, service command, and a fresh-npx node update command. ## Why This Change Was Made The service argument resolver previously used the running package's resolved path. openclaw#167905 fixes pnpm's replaceable store-generation paths by selecting its existing stable link; npm exec has no stable link to select. This preserves that pnpm behavior and adds node-install promotion through the existing npm update owners (`resolveGlobalInstallTarget`, `runGlobalPackageUpdateSteps`, and their staged publication/rollback/cleanup). There is one `<state-dir>/npm` prefix, not a prefix per release. The normal state-directory/profile resolver chooses its location. Run `npx -y openclaw@latest node install --force` on the node to update it, retaining the same profile/state-directory settings. An exact version or `@beta` can replace `@latest`. Reinstalling an already-selected version repairs damaged package files. No new settings or package manager. This does not change `openclaw update` or its existing co-located Gateway selection behavior. Node auto-update still follows the node's npm channel, not the connected Gateway's version/build. The rebase preserves openclaw#168653's paired-credential filtering and explicit `--auth-from-env` service argument. No overlap with Pash/Sarah changes. ## Evidence Final code: `27b447dc07b737126124ff8847f2059cb8a4f921`. Packaged live proof ran on `292bd19fe934ecf4ee4e3b20b00a03a1b08f7933`; production feature code and docs are unchanged since that proof. The final revision only corrects regression-test platform handling and rebases onto green main. - **Before:** the regression on baseline `d1abe907cb7cfa63aeee7168099fabc81dd8309a` selected `.npm/_npx/.../node_modules/openclaw/dist/index.js`. In the live isolated replay, published `[email protected]` completed real join-URL enrollment; deleting its npm exec cache made the saved command exit 1 with `MODULE_NOT_FOUND`. - **After:** the canonical self-contained package passed `scripts/package-openclaw-for-docker.mjs --skip-build --allow-unreleased-changelog` and its tarball inventory/import-graph integrity check. Real `npm exec --package=<candidate.tgz> -- openclaw connect <join-url> --service` promoted that selected package into the node's state-owned npm prefix. Both actual launchd and systemd generators selected the durable entrypoint. After removing `_npx`, executing the persisted command as a separate process connected to the isolated Gateway. The published driver's device identity and node settings were unchanged. - **Upgrade and repair:** seeded the durable prefix with published `[email protected]`, retained the enrolled node state, and invoked the candidate through fresh npx with `--profile upgrade node install --force`. The prefix became the candidate version. Overwriting its `dist/index.js` and repeating the same command restored the exact original file bytes. The runtime, device identity, and node settings remained unchanged; the repaired persisted command connected after deleting `_npx` again. The prefix contained only `bin` and `lib`, with one `openclaw` package rather than per-release directories. - **Package identity:** the unpublished candidate shares the version string `2026.9.9` with the public release. An isolated loopback npm registry served the canonical candidate tarball for that version, while forwarding dependency requests to npm. This prevents accidentally testing promotion of the older public package with the same version string; no product behavior was mocked. - **Focused checks:** 50 tests passed across `src/commands/node-daemon-install-npx.test.ts`, `src/commands/node-daemon-install-helpers.test.ts`, and `src/cli/node-cli/daemon.test.ts`. The new regression uses actual generators and executes their commands after cache deletion. The final portability correction keeps systemd coverage on non-Windows platforms and reads launchd artifacts only on macOS. That corrected regression passed (1.285 s test execution), and the `core-test-commands` type graph passed. Its unchanged durable-path assertion failed on the baseline as expected (pueue 2903). - **Changed checks:** formatting, conflict/line-count/assertion/SQLite/mock-export ratchets, config docs, plugin boundaries, dependency guards, and the core type graph boundary passed. The prior head's local core typecheck stopped on unrelated `channel-presence-policy.ts:519` TS6133; the branch is now rebased onto the main fix rather than carrying a separate repair. - **Independent review:** LAND on exact final head `27b447dc07b737126124ff8847f2059cb8a4f921`, including the corrected test, updater-step adapter, and paired-auth preservation. Sanitized live results: ```text before-cache-deleted: exit 1 (MODULE_NOT_FOUND) after: /state/npm/lib/node_modules/openclaw/dist/index.js node host gateway connected: ws://127.0.0.1:<isolated-port> upgrade: 2026.9.8 -> candidate 2026.9.9 sameVersionRepair: true runtimePreserved: true pairingAndSettingsPreserved: true connectedAfterCacheDeletion: true ``` **Native-supervisor limitation:** supervisor activation was not verified. Native service installation reaches the existing systemd user-session/profile guards in the unprivileged container; macOS refuses native installation from an isolated HOME. The proof runs actual generated service arguments as a separate live node, not under an activated OS supervisor. Launchd XML was decoded in Linux and passed through the production generated-environment resolver; the macOS regression exercises the actual plist reader. No HOME-guard bypass, privileged container, existing Gateway, or real laptop installation was used. **CI:** [final-head run 38097819645](https://github.com/openclaw/openclaw/actions/runs/38097819645) passed, including production types, test types, lint, source contracts, and the corrected Linux regression. All applicable PR checks finished with no failure, cancellation, or pending check. The final head is rebased onto green main; no inherited failure waiver or SDK budget change is needed. ClawSweeper is **ready, 5/6**, and the independent reviewer returned **LAND**, both on `27b447dc07b737126124ff8847f2059cb8a4f921`. ## Bounded cost Only npx-backed node installation needs an additional npm installation. It uses one state-owned prefix and the existing updater's staging, verification, rollback, and cleanup; it does not accumulate per-version prefixes. Reuse verifies the installed package and advertised content inventory, so a same-version damaged package is repaired. Ordinary node execution and model/session paths are unchanged. Non-npx installation adds only entrypoint inspection and installation diagnostics. Source +104/-2, tests +88/-0, docs +34/-0; net +224 across seven files. The growth reuses the existing package updater rather than adding another installation or state owner. ## Merge Danger Two-way code change, with a durable npm installation left in the selected node state directory if reverted. A revert restores the old npx service-install behavior; it does not remove an already installed package. Blast radius is headless node service installation and its printed diagnostics; Gateway installation and pnpm launcher resolution are unchanged. Co-authored-by: Ayaan Zaidi <[email protected]>
What Problem This Solves
Fixes paired nodes failing to authenticate after
openclaw connect <join-url> --servicewhen the machine already has credentials for another Gateway.User Impact
A node reconnecting to its saved Gateway uses its paired device token instead of an unrelated Gateway token or password from the machine's environment, configuration, or state-directory
.env. Paired service installations no longer persist those ambient credentials.Intentional shared-token/password connections remain supported through
openclaw node run --auth-from-envandopenclaw node install --auth-from-env --force. This exposes the existing foreground override and records that explicit choice for installed services. If it displaces an available paired credential, the warning names the selected environment variable, never its value. No new configuration keys or token migration are introduced.Why This Change Was Made
The node credential owner already recognized a saved pairing but still treated every populated
OPENCLAW_GATEWAY_TOKEN/OPENCLAW_GATEWAY_PASSWORDas an explicit override. The service planner also persisted those ambient values. Environment variables loaded fromenv.varsor the state-directory.envtherefore had the same effect as an intentional override.The runtime and service planner now share the same saved-endpoint eligibility check. Default reconnects leave device-token selection and refresh with
GatewayClient; explicit shared auth uses the existing environment-only path. GatewayClient's trusted-endpoint retry policy is unchanged.This retains the intent of #31122 (intentional service environment credentials survive restarts), #136253 (a co-located Gateway must not displace paired-node auth), and #159360 (expired fallback setup codes may only resume the saved pairing; no expired bootstrap or shared-auth fallback).
Evidence
On baseline
e40606fdea9, an isolated Gateway issued a real join URL and a second isolated machine state completed bootstrap pairing throughconnect --service. The first handshake of the restarted real install-plan command failed authentication for process-env token, process-env password, configenv.vars, and state-directory.env. All four sources were persisted into the service environment. CWD.envwas already blocked by workspace policy; plain co-locatedgateway.auth.*was already correctly skipped.The repaired replay connected on the first handshake for all six sources, without persisting any ambient token/password. The explicit
--auth-from-envshared-token control also connected, retained its selected credential in the generated service environment, and retained the explicit service argument.env.varstoken.envtoken.envtokengateway.auth.*Sanitized authentication excerpts (ephemeral port replaced):
[email protected]performed real enrollment and generated service plans for both a join-enrolled node carrying unrelated ambient credentials and an intentional shared-token node without a cached device token. Candidate Doctor migrated their published schema 19 state to schema 20, then the candidate install planner/restart path connected both: the first using its paired token without retaining ambient auth; the second using the explicitly persisted shared token and--auth-from-env. Device identity, durable node settings, and the co-located Gateway settings were preserved in both cells.dded84b33f34516638a4d2cad8b748be58521734: an explicitly approvedsystem.whichinvocation returned{"bins":{"true":"/usr/bin/true"}}. Afterdevices revoke --role node, restarting the same node with the valid shared Gateway token still present in its environment failed withAUTH_DEVICE_TOKEN_MISMATCH; the node never completed hello, and the real invocation returned{"ok":false,"error":{"type":"cli_error","message":"node pairing changed while invocation was active"}}. Device identity was unchanged. The live assertions completed; the initial report formatter rejected the CLI's trailing diagnostic footer, so the retained leading JSON objects were independently decoded and asserted.dded84b33f3.git range-diffconfirmed the two commits are patch-identical to the pre-rebase reviewed/proven version8a906bd94e3; the published-driver cells ran before that rebase, and the final authorization proof ran against a separately built, frozen checkout ofdded84b33f3.Proof limitation: the production canonical-home guard correctly refuses an OS-service installation under an isolated temporary HOME. The accepted isolation proof therefore executes the real
buildNodeInstallPlanoutput (persisted command and environment) as the second process, against a live isolated Gateway. This is not a claim of exercising an actual OS supervisor. No existing Gateway, node service, or laptop installation was modified.The published planner is private in the shipped bundle. Its isolation harness loaded a byte-identical copy of the shipped daemon chunk with only
export { buildNodeInstallPlan };appended; authentication, service planning, and guards were not changed. Original chunk: 12,991 bytes, SHA-2567d67af30e747f36ea91d87f7b00fffb16ca7111e13dd1d4ce6195812b6de55da. The actual published CLI performed enrollment. The temporary exported copy was removed afterward.Final exact-head CI is green: run 38089699521. The previous inherited boundary failure was fixed on
main, and this branch was rebased onto that fix. Local changed checks passed formatting, ratchets, core types, and core-test types, then stopped on pre-existing unrelated model-auth/solid-lint dead exports; the final hosted gates passed.Bounded cost
The runtime reuses the existing saved-endpoint/token eligibility read; only the explicit environment-override path additionally checks whether its warning displaces a pairing. Service installation adds bounded read-only checks of existing node state, identity, and token. No new tables, polling, retries, model calls, or background services are introduced. The new install-plan cases took 26 ms of test execution in the focused run; the six-suite invocation took 325.65 seconds including cold worker compilation.