Skip to content

fix(release): accept valid multi-version plugin locks - #159376

Merged
RomneyDa merged 1 commit into
mainfrom
fix/npm-lock-enforced-policy
Sep 27, 2026
Merged

RomneyDa merged 1 commit into
mainfrom
fix/npm-lock-enforced-policy

Conversation

@RomneyDa

@RomneyDa RomneyDa commented Sep 27, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Fixes: extended-stable plugin publication rejects valid packages when pnpm resolves multiple versions of a transitive dependency on separate runtime branches.

User Impact

User impact: release publication accepts valid multi-version plugin graphs while continuing to enforce explicit workspace override policy. There is no runtime or candidate-source change.

Why This Change Was Made

Lock-derived overrides are npm placement hints, not authored workspace policy. The generator still gives npm those hints, but post-install shrinkwrap repair and rejection now enforce only pnpm-workspace.yaml overrides. A shared scoped-policy lookup merges every authored selector matching the installed parent version, preserving exact, ranged, and overlapping child rules in both planning and validation. This keeps Zalouser's explicit global/scoped tough-cookie rules strict without treating memory-lancedb's legitimate Node type branches as a global conflict.

Evidence

  • Reproduced the publication failure from workflow run https://github.com/openclaw/openclaw/actions/runs/36290304240 against frozen candidate f773aa06a1a93b36b050f1a3f4b57d3d91311541.
  • node scripts/run-vitest.mjs test/scripts/generate-npm-package-lock.test.ts — 67/67 passed. The generator-path regression fails on the merged behavior, covers inferred multi-version branches, and preserves overlapping exact/ranged authored child policies.
  • OPENCLAW_VITEST_MAX_WORKERS=1 node scripts/run-vitest.mjs test/scripts/generate-npm-package-lock.test.ts — 67/67 passed in 10.37s wall time (8.60s Vitest duration).
  • node scripts/check-changed.mjs -- scripts/generate-npm-package-lock.mts test/scripts/generate-npm-package-lock.test.ts — passed, including all 102 npm lock validations and both TypeScript graphs.
  • Exact-head CI check-npm-lock completed in 171s: https://github.com/openclaw/openclaw/actions/runs/36293823243/job/108549414267. The changed-test selector did not schedule this test file separately; the lock-specific lane is the relevant CI cost measurement.
  • Frozen-candidate extensions/memory-lancedb and extensions/zalouser package-lock generation both pass with this tooling head.
  • Fresh AutoReview at P0/P1: no accepted/actionable findings.

Production delta: +43 net lines. The added boundary names the authoritative policy source; one shared scoped-policy lookup keeps planning and validation aligned for every authored selector matching a pinned parent. The test covers the multi-version inferred-placement distinction plus exact, ranged, and overlapping authored child policies.

@clawsweeper

clawsweeper Bot commented Sep 27, 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 27, 2026 03:23
@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: S labels Sep 27, 2026
@RomneyDa
RomneyDa force-pushed the fix/npm-lock-enforced-policy branch from 54a02c0 to 41989e6 Compare September 27, 2026 04:16
@RomneyDa

Copy link
Copy Markdown
Member Author

Addressed the generated ClawSweeper review's rank-up move on exact head 41989e653df959d913b9d62407fb65870bf58414:

  • replaced the helper-only check with a generator-boundary registry fixture;
  • proved the regression fails on the merged behavior by falsely rejecting the newer branch as an authored override violation;
  • kept inferred pnpm rules as npm placement hints while enforcing authored workspace policy;
  • preserved exact, ranged, and overlapping scoped child policies through one shared planner/validator lookup;
  • asserted every expected forked, blocked, and leaf branch in the generated lock;
  • revalidated frozen extensions/memory-lancedb and extensions/zalouser against candidate f773aa06a1a93b36b050f1a3f4b57d3d91311541;
  • passed 67/67 focused tests, all 102 npm lock validations, both TypeScript graphs, lint/dead-export scans, and a fresh P0/P1 AutoReview.

Maintainer decision: npm may choose placement among versions approved by the frozen pnpm graph, but authored workspace overrides, scoped child rules, final version membership, and integrity remain mandatory.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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 27, 2026
@clawsweeper

clawsweeper Bot commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 27, 2026, 12:37 AM ET / 04:37 UTC (Revision 2).

ClawSweeper review

What this changes

The branch changes release lock generation to accept multiple pnpm-approved transitive versions while enforcing authored workspace overrides, and extends the local-registry regression test.

Merge readiness

✅ Ready for maintainer review

Keep open: the reported release-publication failure remains in current main, this PR offers a distinct repair, and I found no supported blocking defect. The earlier request for test-cost measurements has been answered.

Priority: P2
Reviewed head: 41989e653df959d913b9d62407fb65870bf58414

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The focused repair has meaningful generator-boundary coverage and reported candidate validation, with no supported blocking finding.
Proof confidence 🐚 platinum hermit (4/6) Not applicable: The member-authored PR is exempt from the external-contributor proof gate. Its body reports after-fix frozen-candidate generation for two plugins and exact-head lock CI; the review did not inspect generated artifacts. No stored-data format changes.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The member-authored PR is exempt from the external-contributor proof gate. Its body reports after-fix frozen-candidate generation for two plugins and exact-head lock CI; the review did not inspect generated artifacts. No stored-data format changes.
Evidence reviewed 7 items Introduced repair: The introduced diff changes post-install enforcement to read authored workspace overrides and retains inferred overrides as npm placement hints.
Current main still needs the repair: Current main still validates the generated lock against the combined inferred override map. Its generator and test files are unchanged from the PR merge base.
Regression coverage: The changed generator-boundary fixture checks authored exact and ranged child rules, then checks that a graph with two inferred versions generates a lock.
Findings None None.
Security None None.

How this fits together

OpenClaw release tooling reads the pnpm lock and workspace policy, asks npm to generate package-lock mirrors for publishable packages, and validates those mirrors before release dependency evidence is produced.

flowchart LR
  A[Pnpm lock] --> C[Release lock generator]
  B[Workspace overrides] --> C
  C --> D[Npm lock placement]
  D --> E[Override and integrity checks]
  E --> F[Release dependency evidence]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +103, Other +43. Total +146 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 107 4 +103
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 56 13 +43
Total 2 163 17 +146

Review metrics

Metric Value Why it matters
Production and test growth production +43 net lines; tests +103 net lines The PR explains the production growth as a shared policy lookup, and the added test exercises lock generation.
Focused validation cost 10.37s single-worker wall; 171s lock CI lane These PR-body measurements answer the prior review request for the changed test's cost.

Technical review

Best possible solution:

Keep authored override enforcement and final pnpm version and integrity checks in the release lock generator while allowing valid npm placement across approved versions.

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

Yes. The frozen candidate and current-main generator provide a specific reproduction path, and the PR adds a generator-boundary case; this read-only review did not execute it.

Is this the best way to solve the issue?

Yes. The repair stays in the release lock generator, distinguishes authored policy from placement hints, and retains the final dependency checks.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against aad795bf312a.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: The fix addresses a concrete release-publication failure for a limited set of plugin dependency graphs.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The member-authored PR is exempt from the external-contributor proof gate. Its body reports after-fix frozen-candidate generation for two plugins and exact-head lock CI; the review did not inspect generated artifacts. No stored-data format changes.

Evidence

What I checked:

  • Introduced repair: The introduced diff changes post-install enforcement to read authored workspace overrides and retains inferred overrides as npm placement hints. (scripts/generate-npm-package-lock.mts:1552, 41989e653df9)
  • Current main still needs the repair: Current main still validates the generated lock against the combined inferred override map. Its generator and test files are unchanged from the PR merge base. (scripts/generate-npm-package-lock.mts:1512, aad795bf312a)
  • Regression coverage: The changed generator-boundary fixture checks authored exact and ranged child rules, then checks that a graph with two inferred versions generates a lock. (test/scripts/generate-npm-package-lock.test.ts:1371, 41989e653df9)
  • Final dependency guard: After npm generation, the unchanged final guard checks package version membership and available integrity hashes against the pnpm lock. (scripts/generate-npm-package-lock.mts:1665, 41989e653df9)
  • Release contract: Release dependency archives contain npm-format locks for downstream packaging, and the documented consumption path carries workspace overrides into npm. Public docs: docs/reference/RELEASING.md. (docs/reference/RELEASING.md:103, aad795bf312a)
  • After-fix validation and prior review follow-up: The PR body reports successful frozen-candidate generation for memory-lancedb and zalouser, 67 focused tests, 102 npm lock validations, a successful exact-head check-npm-lock job, and the single-worker and CI timings requested in the previous review. These are reported results; this read-only review did not rerun them.

Likely related people:

  • RomneyDa: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Peter Steinberger: 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-27T04:22:31.065Z sha 41989e6 :: blocked before merge. :: none

@RomneyDa

Copy link
Copy Markdown
Member Author

Resolved both remaining ClawSweeper cost-evidence items on exact head 41989e653df959d913b9d62407fb65870bf58414:

  • single-worker focused test: 67/67 passed in 10.37s wall time (OPENCLAW_VITEST_MAX_WORKERS=1; Vitest duration 8.60s);
  • exact-head check-npm-lock: 171s (job);
  • the changed-test selector did not schedule test/scripts/generate-npm-package-lock.test.ts separately, so the lock-specific CI lane is the relevant CI cost measurement.

The PR body now records both measurements. No code or test behavior changed.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@RomneyDa
RomneyDa merged commit 1261218 into main Sep 27, 2026
118 checks passed
@RomneyDa
RomneyDa deleted the fix/npm-lock-enforced-policy branch September 27, 2026 04:40
@RomneyDa

Copy link
Copy Markdown
Member Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal backlog priority with limited blast radius. 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