Skip to content

fix(update): prevent private Node installation after authority is lost - #154334

Merged
vincentkoc merged 8 commits into
mainfrom
codex/ci-update-auxiliary-identity
Sep 21, 2026
Merged

vincentkoc merged 8 commits into
mainfrom
codex/ci-update-auxiliary-identity

Conversation

@steipete

@steipete steipete commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Private Node provisioning can start an installer before the updater's final request-identity and installation-ownership checks reject it. A refused update can therefore still begin changing its private runtime.

User Impact

An update that loses authority before installer admission leaves the private runtime untouched. Authorized provisioning continues through the existing updater and process-cleanup owners.

Why This Change Was Made

Reuse retained-service recovery's native command gate for Node provisioning. The gate holds the installer behind a private input pipe until the updater rechecks the requester and binds the child to its installation owners. Empty or malformed input refuses launch.

Node evaluates inherited NODE_OPTIONS before the gate itself. The shared owner now removes those options from the control process, sends them through the private admission input, and restores them only for the admitted payload. Canonical Windows environment precedence is preserved. Exact byte-length, UTF-8 and frame validation reject invalid input without printing private values. No new runtime option, dependency or migration.

The shared boundary adds 50 net runtime lines and removes the retained-service copy of the gate. Validation tooling adds 38 net lines, tests add 429, and documentation adds 3. The live fixture exercises actual private Node provisioning, native version/SQLite, child settlement, lease release/reacquisition, cached reuse and owned-root cleanup. Linux runs all 40 auxiliary controls; the narrow Windows mode selects 28 portable controls. It does not claim persistent custody of escaped descendants from a dead root process.

Evidence

Final candidate: ac003e46479135318897fa692ba2007f57e1d12e, retaining the signed integration of frozen main cfb4e33b8e2c8591f33369587f59154bc93ec2c3.

  • Independent source review and fresh whole-PR native P0–P2 review passed on the final head: two passes, no findings, final source verification successful.
  • The preceding 07b4e12 review found the startup-preload admission defect. Deterministic controls on that unchanged source confirmed both --require and --import wrote a preload marker despite empty-input rejection. The repaired 9c10a34 native tests cover rejected input, admitted payload-only hooks, retained-service recovery, fragmented Unicode, invalid frames, absent/empty options and Windows casing.
  • 9c10a34 → ac003e4 changes only five required braces in the auxiliary test after a CI lint failure. Conditions, assignments, order, assertions, selection, runtime, workflow and install inputs are unchanged. The executions below tested 9c10a34 and are reused with that explicit syntax-only distinction.
  • Final targeted lint: CI=1 node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.core.json src/cli/update-cli/update-command-executor-auxiliary.test.ts passed with 0 warnings / 0 errors, 38.827 seconds, outer exit 0. Native sync retained remote Git HEAD 9c10a34; its sole changed tracked file was blob 97850c06e78705edf50c99b81352080a714fd987, making its content tree equivalent to committed ac003e4. All other tracked bytes and frozen install inputs were unchanged. Formatting, diff and privacy checks pass.

Native provisioning and authorization

  • Owned Linux Testbox: exact 9c10a34, live fixture 1/1 (test 6.577 seconds, file 12.90 seconds, wrapper 13.683 seconds) and 40/40 auxiliary controls (file 29.22 seconds, wrapper 31.441 seconds), outer exit 0. The source was clean after these commands.
  • Native Windows: workflow, target and checkout all 9c10a34; live fixture 1/1 (test 76.994 seconds, file 90.96 seconds) and 28 portable controls (12 unselected; file 89.05 seconds, wrapper 94.78 seconds). Actual Node 24.19.0/SQLite, installer settlement, installation leases, cached reuse and owned-fixture cleanup passed. Outer process-namespace retention remains governed by the existing descendant-custody limitation.
  • Complete canonical CLI group: actual merge 673676456eca403fabc1797d094ce216078b2619 (9c10a34 plus 69afbbaf), 387 files / 8,891 tests passed, one file / 51 tests skipped, 690.87 seconds (wrapper 694.05 seconds), exit 0. The complete vitest.cli.config.ts ran without filters or extra arguments, with a two-worker cap and group concurrency 1. All 40 auxiliary cases executed. This is correctness proof, not a performance comparison.

Published retained-state upgrade

The same owned Linux Testbox ran one canonical pnpm test:docker:all cell, with the existing selector restricted to published-upgrade-survivor / legacy-operator-state, both baseline selectors pinned to [email protected], and restart mode auto-auth. Plan admission verified exactly one expanded lane and no tail or omitted lanes.

The actual cell passed on its first attempt in 321 seconds, outer exit 0: installed published 2026.9.4 → candidate/installed 2026.9.5, through the updater, with authenticated restart and retained operator state. Startup took 7 seconds, update/restart 183 seconds, health/readiness 1 second each and status 2 seconds. Canonical package preparation took 389 seconds and tarball integrity verification passed.

The candidate tarball was 81,273,745 bytes, SHA-256 1d678eaf2eeb975b6142c887f0a190c57c6de5c32cc42fc44f2be75b5f031fb7; its build information records commit 9c10a34d98d48f7a6a4bb26ec640b5c361154ce8. The source restored cleanly afterward. This proves the published upgrade/state path; forced private-runtime provisioning is covered by the separate native fixtures above. The task-owned lease is being stopped after the joined lint command; the holding workflow is not presented as CI proof.

CI and review disposition

The latest 9c10a34 ClawSweeper review found no code or security issue. Its before-merge and rank-up requests for real provisioning, allowed/refused admission, retained-service authority and published-state upgrade evidence are fulfilled by the receipts above.

The 9c10a34 CI wave had three distinct failures: the five curly-brace lint errors corrected here; an unchanged OpenAI transport socket-close assertion; and an unchanged staging wrapper timeout after a retained recovery lock. Independent owner inspection did not establish either latter failure's cause or justify a production patch. These remain named follow-up observations if they recur; no timeout, assertion or cleanup behavior was changed. Natural final-head CI supplies the next controls.

The lineage also includes the separately reviewed canonical packaging repair and process-group fixture repair. The new live fixture is registered exactly once in the existing infrastructure release shard, preserving exhaustive coverage. The workflow guards preserve private-proof exclusion at the Scheduled Task job boundary. Focused workflow/inventory proof passed 49/49 tests on the previously recorded exact content tree.

Historical evidence and credit

The original installer-side-effect failure and reproducer credit remain with @steipete. The author's original-head 224890b5 native/CLI reports remain attributed historical evidence. Earlier 4ff1f5c, a2267eaa and 8cad7d7 native, CLI and Docker receipts are historical after the later gate and install-input changes; current proof is above. At 4ff1f5c, focused Linux tests passed before an outer shell exit 2, and a second CLI replay lost transport and was interrupted when its obsolete owned lease was stopped. That replay remains unproven.

Status at Publication

Final ac003e4 source, independent review and targeted lint are clear. Linux/Windows native, full CLI and published retained-state upgrade proof passed at the precisely attributed behavior-equivalent sources above. Automatic final-head CI, security and ClawSweeper qualification remain pending. Later gate results or material disposition will be recorded once with their actual source; no manual duplicate native or CLI execution is needed.

Keep the private Node installer behind the existing native stdin gate until the updater revalidates requester identity and binds the child to its installation owners. Refused input can no longer let a stdin-independent installer mutate the private runtime before cancellation.
@clawsweeper

clawsweeper Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation cli CLI command changes size: S maintainer Maintainer-authored PR labels Sep 21, 2026
@steipete
steipete marked this pull request as ready for review September 21, 2026 03:06
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 21, 2026
@clawsweeper

clawsweeper Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 21, 2026, 3:56 AM ET / 07:56 UTC (Revision 7).

ClawSweeper review

What this changes

The PR makes private Node installation and retained-service commands share an admission gate that delays execution and Node startup hooks until authorization checks pass, with native validation and documentation.

Merge readiness

✅ Ready for maintainer review

This remains a useful fix that current main does not contain. No blocking defect was found, and the new, source-qualified evidence satisfies the previous authority and upgrade proof requests.

Priority: P2
Reviewed head: ac003e46479135318897fa692ba2007f57e1d12e

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused owner-level repair with substantial native and upgrade evidence and no blocking findings.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (linked_artifact): The captured Linux and Windows results exercise actual private-runtime provisioning, while real-process controls cover allowed payload hooks, refused frames, requester revocation/replacement and retained-service execution; the published-driver upgrade also passed. GitHub verifies Windows step success, and the final commit is brace-only. Raw-log access was blocked for this reviewer, without invalidating the supplied source-qualified receipts.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (linked_artifact): The captured Linux and Windows results exercise actual private-runtime provisioning, while real-process controls cover allowed payload hooks, refused frames, requester revocation/replacement and retained-service execution; the published-driver upgrade also passed. GitHub verifies Windows step success, and the final commit is brace-only. Raw-log access was blocked for this reviewer, without invalidating the supplied source-qualified receipts.
Evidence reviewed 9 items Still necessary on main: Fetched main still launches the installer directly before its beforeInput callback checks requester identity and binds the child. The PR's shared gate is therefore a meaningful remaining change. Inspection of the latest supplied release did not establish this fix as shipped.
Authority remains with the execution owner: The installer now waits behind the gate while beforeInput synchronously rechecks the original requester and binds installation ownership. The existing child owner revalidates installation leases during binding; the process runner withholds input on refusal and joins cancellation.
Preload and framing safeguards: The shared gate removes NODE_OPTIONS from its own startup environment, carries the original value through private input, validates exact byte length, UTF-8 and frame shape, and restores options only for the admitted payload. Both production callers use this owner; no dependency, permission, persisted schema or product setting is added.
Findings None None.
Security None None.

How this fits together

The updater provisions a private Node runtime when an update needs a compatible version. Its execution owner checks the requester and installation leases before allowing the installer to change files, then joins child cleanup before releasing ownership.

flowchart TD
  A[Update request] --> B[Requester and installation checks]
  B --> C[Private admission pipe]
  C --> D{Admission valid?}
  D -->|No| E[Refuse without installer effects]
  D -->|Yes| F[Restore options and run native command]
  F --> G[Join cleanup and release leases]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +50, Tests +429, Docs +3, Config +38, Other 0. Total +520 across 10 files.

View PR surface stats
Area Files Added Removed Net
Source 3 93 43 +50
Tests 4 443 14 +429
Docs 1 3 0 +3
Config 1 45 7 +38
Generated 0 0 0 0
Other 1 1 1 0
Total 10 585 65 +520

Review metrics

Metric Value Why it matters
Runtime versus validation growth Runtime +50 net lines; tests +429; validation tooling +38 Runtime growth is justified by consolidating native admission and deferring startup hooks; most added code exercises that boundary.

Technical review

Best possible solution:

Keep one shared native admission gate under the existing updater authority and cleanup owners, preserving authorized provisioning and payload environment semantics.

Do we have a high-confidence way to reproduce the issue?

Yes, source establishes the failure path: current main starts the installer before beforeInput can reject it, so a stdin-independent installer can write first. This review did not execute a current-main reproduction.

Is this the best way to solve the issue?

Yes. Reusing the retained-service gate closes the execution gap at the existing owner, and deferring NODE_OPTIONS prevents startup hooks from bypassing admission.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 11263ceb18ca.

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. The captured Linux and Windows results exercise actual private-runtime provisioning, while real-process controls cover allowed payload hooks, refused frames, requester revocation/replacement and retained-service execution; the published-driver upgrade also passed. GitHub verifies Windows step success, and the final commit is brace-only. Raw-log access was blocked for this reviewer, without invalidating the supplied source-qualified receipts.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (linked_artifact): The captured Linux and Windows results exercise actual private-runtime provisioning, while real-process controls cover allowed payload hooks, refused frames, requester revocation/replacement and retained-service execution; the published-driver upgrade also passed. GitHub verifies Windows step success, and the final commit is brace-only. Raw-log access was blocked for this reviewer, without invalidating the supplied source-qualified receipts.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove merge-risk: 🚨 compatibility: Current PR review selected no merge-risk labels.
  • remove merge-risk: 🚨 security-boundary: Current PR review selected no merge-risk labels.
  • remove status: 📣 needs proof: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: This is a bounded updater correctness fix preventing private-runtime effects after admission is refused.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (linked_artifact): The captured Linux and Windows results exercise actual private-runtime provisioning, while real-process controls cover allowed payload hooks, refused frames, requester revocation/replacement and retained-service execution; the published-driver upgrade also passed. GitHub verifies Windows step success, and the final commit is brace-only. Raw-log access was blocked for this reviewer, without invalidating the supplied source-qualified receipts.
  • proof: sufficient: Contributor real behavior proof is sufficient. The captured Linux and Windows results exercise actual private-runtime provisioning, while real-process controls cover allowed payload hooks, refused frames, requester revocation/replacement and retained-service execution; the published-driver upgrade also passed. GitHub verifies Windows step success, and the final commit is brace-only. Raw-log access was blocked for this reviewer, without invalidating the supplied source-qualified receipts.

Evidence

What I checked:

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • vincentkoc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (6 earlier review cycles)
  • reviewed 2026-09-21T03:14:59.308Z sha 224890b :: blocked before merge. :: none
  • reviewed 2026-09-21T05:28:20.962Z sha 4ff1f5c :: needs changes before merge. :: none
  • reviewed 2026-09-21T06:07:52.167Z sha a2267ea :: blocked before merge. :: none
  • reviewed 2026-09-21T06:26:00.456Z sha 8cad7d7 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-21T07:15:00.888Z sha 07b4e12 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-21T07:35:26.531Z sha 9c10a34 :: needs real behavior proof before merge. :: none

@vincentkoc vincentkoc self-assigned this Sep 21, 2026
@vincentkoc

Copy link
Copy Markdown
Member

Validation update for unchanged 224890b54d10d904fa9473bbabd69d362ee8112c:

  • Fresh full-PR P0–P2 review is clean. The shared gate remains the appropriate owner fix and composes with the landed process-runner repair in fix: prevent refused update children from proceeding on EOF #154289.
  • The existing Linux Docker job tested merge b0bef58970e2c8a531576d0ae0618c216db19d78, which includes this head and the same Node-runtime implementation. published-upgrade-survivor / legacy-operator-state passed in 241 seconds, upgrading 2026.9.4 to candidate 2026.9.5. The pinned harness runs the real updater and checks the installed candidate and retained state. This supplies the generic Linux published-driver → candidate evidence.

Still open: forced private-Node provisioning, admission, and cleanup on native Linux and Windows. The two additional original two-worker CLI replays recorded as in progress in the PR body also have no public completion receipt yet. Those are the author's stated validation commitments. Keeping the PR open for these concrete proof gaps; the generic upgrade pass does not establish forced runtime provisioning.

@openclaw-barnacle openclaw-barnacle Bot added the scripts Repository scripts label Sep 21, 2026
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Sep 21, 2026
@clawsweeper clawsweeper Bot added rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels Sep 21, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 21, 2026
@vincentkoc
vincentkoc merged commit c0ae3a7 into main Sep 21, 2026
226 of 227 checks passed
@vincentkoc
vincentkoc deleted the codex/ci-update-auxiliary-identity branch September 21, 2026 09:20
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 22, 2026
openclaw#154334)

* fix(update): gate Node provisioning on live ownership

Keep the private Node installer behind the existing native stdin gate until the updater revalidates requester identity and binds the child to its installation owners. Refused input can no longer let a stdin-independent installer mutate the private runtime before cancellation.

* test(update): prove native private Node provisioning

* fix(ci): route private Node live proof in release shards

* test(ci): preserve private Node proof isolation expectations

* fix(update): defer native preload options until admission

* test(update): satisfy native gate fixture lint

---------

Co-authored-by: Vincent Koc <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes docs Improvements or additions to documentation maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: L status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants