Skip to content

fix(release): reject incomplete legacy npm install trees - #152186

Merged
RomneyDa merged 2 commits into
mainfrom
fix/release-legacy-install-validation
Sep 18, 2026
Merged

RomneyDa merged 2 commits into
mainfrom
fix/release-legacy-install-validation

Conversation

@RomneyDa

@RomneyDa RomneyDa commented Sep 18, 2026 •

Copy link
Copy Markdown
Member

Related: #151657, #151696

What Problem This Solves

Fixes release validation accepting a legacy npm tarball whose shrinkwrap omits a required runtime dependency, as happened with [email protected] and @openclaw/ai.

User Impact

Future validation using this tooling rejects incomplete install trees before they can qualify for npm publication. This does not change published packages, release versions, or channel tags. The July branch's packaging repair is already covered by #151696.

Why This Change Was Made

The prepared-artifact path packed the root directly, bypassing the older AI-lock repair. Existing legacy shrinkwrap checks verified identity and policy but not dependency coverage. A local consumer that explicitly installs the prepared AI package—and a separately repacked Docker image—can mask the omission; npm exit status alone was insufficient.

One shared check now compares the actual packed package manifest with the shrinkwrap's root dependency declarations and package entries. It rejects missing declarations/entries, mismatched specs, workspace links, and dev-only runtime entries, while preserving optional dependency semantics and modern packages without shrinkwraps.

  • The artifact producer checks before writing package-bundle.json, so Full Release Validation cannot acquire a newly prepared incomplete artifact.
  • Tarball qualification repeats the check through the existing release-check contents gate, protecting verification of previously prepared raw artifacts too.
  • Neither path repairs or rewrites the frozen archive. Fix the candidate and generate fresh evidence.

This is structural validation of exact npm bytes, not a new clean global-install or published-updater smoke lane. That broader lane should reuse the existing candidate registry and avoid top-level dependency overlays and Docker repacks.

Evidence

  • The new missing-dependency regressions fail on the original producer and tarball checker; both previously accepted the incomplete lock. They pass with this fix.
  • 139 focused tests passed across npm-prepared-bundle.test.ts and check-openclaw-package-tarball.test.ts.
  • Downloaded the actual public 2026.7.33 and 2026.7.1-2 root/AI tarballs. Exercised prepareNpmPackageBundle with those immutable archives as the pack output (no package code executed):
    • 2026.7.33: npm-shrinkwrap.json is missing declared dependency @openclaw/ai; no package-bundle.json emitted.
    • 2026.7.1-2: accepted, preserving the root archive's SHA-256.
  • Changed-file checks passed, including script/test typechecks, scoped lint, formatting, and repository guards.
  • Independent structured review found no actionable P0/P1 issues.
  • No new clean global-install/update smoke or full release workflow was run; the real-artifact proof above exercises the producer admission boundary.

PR CI follow-up

PR CI runs these regression tests through its existing tooling test shards; no separate workflow is needed. The first CI run exposed an existing publication-workflow fixture's explicit copy list missing the newly imported helper. Added that one fixture dependency and reran 16 focused workflow tests, covering all 13 failed cases; all passed. This follow-up changes test setup only, not production checks. CI reruns on the updated head.

@clawsweeper

clawsweeper Bot commented Sep 18, 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.

@RomneyDa
RomneyDa marked this pull request as ready for review September 18, 2026 22:00
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation scripts Repository scripts size: S maintainer Maintainer-authored PR labels Sep 18, 2026
@clawsweeper clawsweeper Bot added 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. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 18, 2026
@clawsweeper

clawsweeper Bot commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 18, 2026, 6:27 PM ET / 22:27 UTC (Revision 2).

ClawSweeper review

What this changes

The PR makes release preparation and tarball qualification reject legacy npm shrinkwraps that omit or misdescribe required runtime dependencies.

Merge readiness

✅ Ready for maintainer review

Still useful: current main lacks this validation, and the related merged repair targets the July release branch. No actionable introduced defects remain in this review.

Priority: P2
Reviewed head: 5334868b06fed55a1b71224070890597a2c03d6a

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused shared guard with relevant real-artifact evidence and regression coverage; no blocking defect was identified.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): The captured body reports the production bundle preparer rejecting the actual defective 2026.7.33 archive before descriptor creation and accepting 2026.7.1-2 without changing its hash; this supports the changed structural admission boundary, not a full install or updater claim.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The captured body reports the production bundle preparer rejecting the actual defective 2026.7.33 archive before descriptor creation and accepting 2026.7.1-2 without changing its hash; this supports the changed structural admission boundary, not a full install or updater claim.
Evidence reviewed 9 items Shared structural validation: The helper checks required root declarations, matching packed specs, installed package records, and non-link/non-dev runtime versions; optional dependency overrides are excluded.
Admission before descriptor creation: Preparation reads the actual packed manifest and shrinkwrap, invokes the shared guard before hashing and writing package-bundle.json, and does not repair archive contents.
Qualification also checks frozen archives: The tarball checker invokes the same guard. The existing preflight contents job runs release-check.ts against the prepared tarball, whose verifier invokes this checker.
Findings None None.
Security None None.

How this fits together

Release tooling prepares npm archives and qualifies their contents before publication. This check compares the packed dependency manifest with the legacy shrinkwrap before the archive receives release evidence.

flowchart TD
  A[Packed npm archive] --> B[Read package manifest]
  B --> C{Legacy shrinkwrap present?}
  C -->|Yes| D[Check required dependency declarations and entries]
  D -->|Invalid| E[Reject release evidence]
  D -->|Valid| F[Continue preparation and qualification]
  C -->|No| F
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +102, Docs +7, Other +47. Total +156 across 7 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 3 102 0 +102
Docs 1 7 0 +7
Config 0 0 0 0
Generated 0 0 0 0
Other 3 47 0 +47
Total 7 156 0 +156

Review metrics

None.

Technical review

Best possible solution:

Keep one shared structural check at preparation and qualification, preserving frozen archive bytes and requiring defective candidates to be regenerated.

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

Yes, at source level: current-main preparation and qualification can accept a shrinkwrap missing a declared runtime dependency. The published-artifact comparison supports the mechanism; this read-only review did not execute tests.

Is this the best way to solve the issue?

Yes. Sharing the check between the existing producer and contents verifier closes the identified gap without rewriting packages or creating another qualification owner.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: This is a bounded release-validation repair that prevents incomplete legacy packages from qualifying without changing installed user state.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The captured body reports the production bundle preparer rejecting the actual defective 2026.7.33 archive before descriptor creation and accepting 2026.7.1-2 without changing its hash; this supports the changed structural admission boundary, not a full install or updater claim.
  • proof: sufficient: Contributor real behavior proof is sufficient. The captured body reports the production bundle preparer rejecting the actual defective 2026.7.33 archive before descriptor creation and accepting 2026.7.1-2 without changing its hash; this supports the changed structural admission boundary, not a full install or updater claim.

Evidence

What I checked:

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)
  • steipete: 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 (1 earlier review cycle)
  • reviewed 2026-09-18T22:06:44.616Z sha 08d5983 :: needs maintainer review before merge. :: none

@RomneyDa
RomneyDa enabled auto-merge (squash) September 18, 2026 22:31
@RomneyDa
RomneyDa merged commit dde76b5 into main Sep 18, 2026
154 of 155 checks passed
@RomneyDa
RomneyDa deleted the fix/release-legacy-install-validation branch September 18, 2026 22:40
vincentkoc added a commit that referenced this pull request Sep 18, 2026
…pr-149099-main-20260918

* commit '795e460278d4f8f41545dc8b4a66da1d12defd90': (1902 commits)
  refactor(slack): share Markdown preparation (#149129)
  fix(tooling): release completed PR operations with exited loaders (#152209)
  fix(release): allow stable npm bootstrap under an operator soak waiver (#152206)
  fix(daemon): avoid false restart timeouts during slow startup (#151387)
  feat: read agent documents from a host-owned workspace (#150584)
  improve(startup): skip redundant single-agent directory checks (#152192)
  test(ui): await board widget readiness before size reports (#152198)
  perf(browser): move dashboard event discovery to SQLite worker (#151952)
  improve(auth): reduce pauses during concurrent credential reads (#152140)
  improve(ui): load older chat history in smaller pages (#152093)
  fix(release): reject incomplete legacy npm install trees (#152186)
  refactor: share current-conversation binding row serialization (#152134)
  test(tooling): preserve Node and terminal fixture ownership under Bun (#152187)
  fix(sqlite): service worker admission through retained path aliases (#152190)
  improve: reduce CPU work for long CLI reasoning streams (#152191)
  chore(ui): refresh control ui locales (#152196)
  test(subagents): align lifecycle retries with durable completion owners (#152184)
  perf(gateway): defer participant maps for owned sessions (#152097)
  refactor(stream): share auxiliary queue overflow handling (#149282)
  fix(test): execute CLI fixture preloads on Node and Bun (#152076)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 19, 2026
…2186)

* fix(release): reject incomplete legacy npm install trees

* test(release): include shrinkwrap guard in workflow fixtures
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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: S 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.

1 participant