Skip to content

fix(install): admit git main runtimes by the source engine contract - #187627

Closed
Yuaneen wants to merge 1 commit into
openclaw:mainfrom
Yuaneen:fix/git-install-source-engines-187613
Closed

Yuaneen wants to merge 1 commit into
openclaw:mainfrom
Yuaneen:fix/git-install-source-engines-187613

Conversation

@Yuaneen

@Yuaneen Yuaneen commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

Fixes #187613

What Problem This Solves

A Git install of main (--install-method git --version main) upgrades a Node runtime that already satisfies the checked source's engine and SQLite requirements. resolve_node_package_engine returns early for every non-npm install, so NODE_PACKAGE_ENGINE keeps the published-package fallback (>=24.22.1 <25 || >=26.12.1), and node_binary_is_supported applies it unconditionally. Node 24.21.0 is therefore rejected for a main checkout that declares >=24.16.0 <25 || >=26.1.0, and the installer tries to provision a new runtime.

Why This Change Was Made

For git + main, runtime admission now uses the checked source's own floors, built from the installer's existing NODE_24_MIN_* / NODE_26_MIN_* constants, instead of the published-package fallback. Pinned Git refs keep the fallback on purpose: their engines may still be stricter than main's, so the installer must not assume every ref is relaxed. The npm path is untouched and still resolves the selected package's requirement.

User Impact

A Git main install on Node 24.16–24.21 no longer triggers an unnecessary Homebrew or nvm Node upgrade. npm installs and pinned Git release refs keep enforcing the published engines.

Evidence

Observed result first — the new regression test fails on the base installer and passes with the fix:

$ node scripts/run-vitest.mjs test/scripts/install-sh.test.ts --run -t "engine contract"

# base installer
FAIL  install.sh > admits a Git main runtime by the checked source's engine contract
AssertionError: expected 'verdict=1\nengine=>=24.22.1 <25 || >=...' to contain 'verdict=0'

# with the fix
Tests  2 passed (git main -> verdict=0, pinned v2026.10.8 -> verdict=1)

The test sources the real scripts/install.sh and calls resolve_node_package_engine + node_binary_is_supported with a fake node reporting 24.21.0; the SQLite probe is stubbed because the decision under test is engine admission, not the capability probe. The pinned-ref case is the control that keeps the published floor.

Full file: 223 passed | 1 skipped | 1 failed. The one failure (does not emit before args when npmrc min-release-age computes a before cutoff) fails identically on the unmodified base checkout and is unrelated to this change.

What was not tested: a full installer run against real Homebrew/nvm, and the PowerShell installer path.

AI Assistance

This PR is AI-assisted. Used grep, git show, and the installer test harness to trace the runtime-admission path and reproduce the rejection. The implementer understands the code: Git main admission now derives its engine range from the same source floors the installer already declares, while pinned refs and npm keep the published-package requirement. All evidence above comes from real local runs.

@clawsweeper

clawsweeper Bot commented Oct 29, 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.

@Yuaneen
Yuaneen marked this pull request as ready for review October 29, 2026 11:32
@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: XS labels Oct 29, 2026
@clawsweeper clawsweeper Bot added the clawsweeper:intake:bug Preliminary submission classification; full source review pending. label Oct 29, 2026
@clawsweeper

clawsweeper Bot commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge.

What this changes

This PR uses source compatibility floors for explicit Git-main installations while retaining stricter admission for npm and pinned Git refs.

Example: Install current main with SQLite-capable Node 24.21.0 using --install-method git --version main.

  • Before: The installer rejects Node and attempts to provision a replacement.
  • After: The installer retains the compatible runtime.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) A useful, focused repair with two actionable defects and only mocked after-fix evidence.
Proof confidence 🧂 unranked krab (1/6) Real behavior proof is necessary before merge. See Before merge.
Patch quality 🦪 silver shellfish (2/6) 2 actionable review findings remain.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: A Git-main installation unnecessarily replaces a runtime that already satisfies current source compatibility and SQLite requirements.
Reason: Restoring target-specific runtime admission follows the documented compatibility policy and avoids unnecessary changes to users' Node installations.

Regression provenance

Regression provenance — suspected predecessor, not a causality claim: source commit cccc856b82f7 by Jason (Json); no PR verified.

Possible regression — probable (reviewed change; failure trace). No predecessor PR is attributed.

Merge readiness

⛔ Blocked before merge - 3 items remain

Keep this PR open: it repairs a verified installer regression, but incorrectly admits runtimes for retained older checkouts and prints incomplete Node version requirements.

Priority: P2
Reviewed head: d1db1454a6db85352bf93fa53fa438b066b599ac

Before merge

  • Add real behavior proof - The contributor demonstrates resolve_node_package_engine and node_binary_is_supported through tests with a fake Node version and a stubbed SQLite check; supply redacted terminal output or logs from the standalone installer retaining real Node 24.21.0, preserving stricter retained-source requirements, and upgrading an existing latest-stable installation with settings intact. After adding proof, update the PR body, then request a new review with @clawsweeper re-review. The PR author or someone with repository write access can request it.
  • Honor the engine of a retained local main checkout (P2) - With an existing local main at 6c00e67, run --install-method git --version main --no-git-update using SQLite-capable Node 24.21.0. This assignment admits the runtime using today's relaxed floors, but checkout_git_openclaw_ref deliberately leaves local main unre-based when GIT_UPDATE=0. That retained package requires >=24.22.1 <25 || >=26.12.1 and its preinstall rejects the admitted runtime, whereas the base installer would provision a compatible replacement. Account for the source actually retained before relaxing engine admission.
  • Include both Node major versions in the requirement label (P3) - The new label evaluates to '16.0+ or 1.0+' because it starts with the minor-version constants. If Git-main runtime selection still fails, ensure_default_node_active_shell and finish_linux_node_install now print an incorrect requirement such as 'Active Node.js must be 16.0+ or 1.0+'. Include the 24 and 26 major components so the diagnostic identifies the supported versions.

Findings

  • [P2] Honor the engine of a retained local main checkout — scripts/install.sh:1632-1633
  • [P3] Include both Node major versions in the requirement label — scripts/install.sh:1634

Tests

  • Missing end-to-end proof: Supply an after-fix standalone installer trace with real Node 24.21.0 and SQLite, including retained-checkout handling and a latest-stable upgrade preserving settings.
Agent review details

How this fits together

The Bash installer resolves runtime requirements before selecting Node and preparing the Git checkout, then passes the chosen runtime to dependency installation and the build.

flowchart TD
  A[Installer options] --> B[Resolve Node requirements]
  B --> C[Check version and SQLite]
  C --> D[Retain or provision Node]
  D --> E[Select or retain Git checkout]
  E --> F[Install dependencies and build]
Loading

Technical review

Best possible solution:

Use the compatibility contract of the source actually selected or retained through the existing admission owner, and print complete Node version requirements.

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

Current main deterministically applies the strict npm fallback to Git main, and the linked issue supplies a real-runtime standalone reproduction; this read-only review executed no target code.

Is this the best way to solve the issue?

Target-aware admission is the right focused repair, but the requested ref name alone does not establish the engine contract of an existing checkout that the installer retains.

Full review comments:

  • [P2] Honor the engine of a retained local main checkout — scripts/install.sh:1632-1633
    With an existing local main at 6c00e67, run --install-method git --version main --no-git-update using SQLite-capable Node 24.21.0. This assignment admits the runtime using today's relaxed floors, but checkout_git_openclaw_ref deliberately leaves local main unre-based when GIT_UPDATE=0. That retained package requires >=24.22.1 <25 || >=26.12.1 and its preinstall rejects the admitted runtime, whereas the base installer would provision a compatible replacement. Account for the source actually retained before relaxing engine admission.
    Confidence: 0.98
  • [P3] Include both Node major versions in the requirement label — scripts/install.sh:1634
    The new label evaluates to '16.0+ or 1.0+' because it starts with the minor-version constants. If Git-main runtime selection still fails, ensure_default_node_active_shell and finish_linux_node_install now print an incorrect requirement such as 'Active Node.js must be 16.0+ or 1.0+'. Include the 24 and 26 major components so the diagnostic identifies the supported versions.
    Confidence: 1

Overall correctness: patch is incorrect
Overall confidence: 0.98

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 3f1e9b42591a.

Provenance checked

  • Target-package engine admission changes intended behavior with a stated reason (5598c3d: Prevent installation of published packages on runtimes rejected by their preinstall engine checks.)
  • Source compatibility floors keeps the original intent (4a5ec82: Separate runtime compatibility from recommended security patches while preserving explicit package requirements and SQLite safety.)
  • SQLite capability admission keeps the original intent (bf6f74b: Require lossless SQLite round trips rather than relying solely on a runtime version label.)

Testing

Proof path: unit tests only.

Security

None.

Evidence

Acceptance criteria:

  • bash -n scripts/install.sh
  • node scripts/run-vitest.mjs test/scripts/install-sh.test.ts test/scripts/install-git-ref.test.ts test/scripts/standalone-installers.test.ts --maxWorkers=1
  • git diff --check
  • Verify regression tests fail on the reviewed head for the retained-source mismatch and incomplete requirement label, then pass after repair.

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 5598c3d adds scripts/install.sh:1627 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 5598c3d76bcb; files: scripts/install.sh)
  • RoboClaw: Raw commit 4a5ec82 adds scripts/install.sh:76 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 4a5ec828b19c; files: scripts/install.sh)
  • Vincent Koc: Raw commit f33ab24 adds scripts/install.sh:1596 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: f33ab243cf82; files: scripts/install.sh)

PR surface

Tests +34, Other +9. Total +43 across 2 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 34 0 +34
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 10 1 +9
Total 2 44 1 +43

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #187613
Summary: This PR is the open fixing candidate for the canonical Git-main runtime-admission report.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Labels

Label changes:

  • add P2: The verified regression affects the advanced Git-install workflow and causes avoidable runtime provisioning.
  • add merge-risk: 🚨 compatibility: The changed admission can accept Node 24.21.0 for an intentionally retained older checkout whose package requires Node 24.22.1 or newer.
  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦪 silver shellfish.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Label justifications:

  • P2: The verified regression affects the advanced Git-install workflow and causes avoidable runtime provisioning.
  • merge-risk: 🚨 compatibility: The changed admission can accept Node 24.21.0 for an intentionally retained older checkout whose package requires Node 24.22.1 or newer.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦪 silver shellfish.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 29, 2026, 7:49 AM ET / 11:49 UTC.

@Yuaneen

Yuaneen commented Oct 29, 2026

Copy link
Copy Markdown
Contributor Author

Closing this PR — @steipete's #187635 supersedes it with the better fix: it reads the selected checkout's package.json engines (so older refs are judged by their own contract instead of a branch-name special case) and covers both the Bash and PowerShell installers. Thanks for picking this up.

@Yuaneen Yuaneen closed this Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clawsweeper:intake:bug Preliminary submission classification; full source review pending. scripts Repository scripts size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Git main installer upgrades a runtime that passes source and SQLite requirements

1 participant