Repository navigation
fix(release): reject incomplete legacy npm install trees - #152186
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. |
|
Codex review: needs maintainer review before merge. Reviewed September 18, 2026, 6:27 PM ET / 22:27 UTC (Revision 2). ClawSweeper reviewWhat this changesThe 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 Review scores
Verification
How this fits togetherRelease 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
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests +102, Docs +7, Other +47. Total +156 across 7 files. View PR surface stats
Review metricsNone. Technical reviewBest 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. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
…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) ...
…2186) * fix(release): reject incomplete legacy npm install trees * test(release): include shrinkwrap guard in workflow fixtures
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.
package-bundle.json, so Full Release Validation cannot acquire a newly prepared incomplete artifact.release-checkcontents gate, protecting verification of previously prepared raw artifacts too.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
npm-prepared-bundle.test.tsandcheck-openclaw-package-tarball.test.ts.2026.7.33and2026.7.1-2root/AI tarballs. ExercisedprepareNpmPackageBundlewith those immutable archives as the pack output (no package code executed):2026.7.33:npm-shrinkwrap.json is missing declared dependency @openclaw/ai; nopackage-bundle.jsonemitted.2026.7.1-2: accepted, preserving the root archive's SHA-256.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.