Skip to content

fix(release): publish plugins with scoped dependency forks - #159124

Merged
RomneyDa merged 3 commits into
mainfrom
fix/npm-lock-scoped-policy-collision
Sep 27, 2026
Merged

RomneyDa merged 3 commits into
mainfrom
fix/npm-lock-scoped-policy-collision

Conversation

@RomneyDa

@RomneyDa RomneyDa commented Sep 26, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Fixes official plugin publication stopping before registry mutation when a package combines a parent-scoped dependency fork with a different workspace default, or when dependency-owned shrinkwrap data bypasses the workspace's intended runtime graph.

User Impact

Release tooling can generate and verify plugin package locks with legitimate scoped dependency forks while rejecting or repairing dependency shrinkwrap graphs that violate workspace policy. The repair is generic: it contains no Zalouser, tough-cookie, or release-version special case.

Why This Change Was Made

The runtime-only planner previously promoted a scoped fork to a global npm override, conflicting with the workspace's explicit root default. It also treated a successfully generated lockfile as sufficient even when dependency-owned shrinkwrap metadata caused npm to place versions outside the effective workspace policy.

The canonical fix keeps explicit workspace defaults authoritative, derives exact runtime selections for transitive workspace ranges, and validates the resolved package-lock graph with npm Arborist-compatible override selection and Node placement resolution. Offending dependency shrinkwraps are disabled and npm is rerun to a fixed point, including when one repair exposes another violation. Validation covers dependency, optional-dependency, and peer edges; npm aliases; exact and range constraints; scoped and wildcard selectors; and Git, hosted-Git, file, directory, tag, and remote specs.

Production delta is +417/-52 lines (net +365) in scripts/generate-npm-package-lock.mts; tests are +672/-1 (net +671). The production growth implements the previously missing owner boundary for npm placement, scoped override selection, shrinkwrap attribution, and fixed-point repair rather than adding a consumer guard or package-specific workaround. No user path was removed.

Evidence

  • Pre-fix frozen 2026.8.33 reproduction failed with overrides.tough-cookie conflicts with pnpm lock policy; the same Zalouser generation command passes at this head.
  • node scripts/run-vitest.mjs test/scripts/generate-npm-package-lock.test.ts test/package-manager-config.test.ts — 82/82 passed (67 + 15).
  • node scripts/check-changed.mjs -- scripts/generate-npm-package-lock.mts test/scripts/generate-npm-package-lock.test.ts — all selected gates passed, including generation and verification of all 102 npm package-lock surfaces, formatting, tsgo, lint, dead-export scans, and repository guards.
  • The integration fixture proves valid scoped hoists survive; broad, nested, peer, and fixed-point violations are repaired; optional precedence is respected; and Git/file/hosted URL/alias contracts are classified correctly.
  • npm 11.13.0 Arborist's OverrideSet selection and dependency edge precedence, plus hosted-git-info URL classification, were inspected directly before implementing the contract.
  • Fresh exact-head AutoReview — scoped-clean, with no accepted or actionable findings.
  • git diff --check — passed.

No user-visible UI change; screenshot proof is not applicable.

@RomneyDa
RomneyDa marked this pull request as ready for review September 26, 2026 19:32
@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: S labels Sep 26, 2026
@RomneyDa

Copy link
Copy Markdown
Member Author

Land-ready evidence for exact head a9d32e161a16261bd34c573ca79b97a92de6b259:

  • Root cause: runtime-only lock planning promoted a scoped fork into a global derived override, conflicting with the explicit workspace default before plugin publication.
  • Owner/fix: scripts/generate-npm-package-lock.mts now keeps explicit workspace roots authoritative, preserves scoped forks, and excludes multi-policy dependencies from single-version post-generation checks.
  • Regression: the new workspace-root plus parent-scoped-fork fixture failed before the fix with overrides.forked conflicts with pnpm lock policy; it passes at this head.
  • node scripts/run-vitest.mjs test/scripts/generate-npm-package-lock.test.ts test/package-manager-config.test.ts — 63/63 passed.
  • node scripts/check-changed.mjs -- scripts/generate-npm-package-lock.mts test/scripts/generate-npm-package-lock.test.ts — passed, including all 102 npm package-lock surfaces.
  • Frozen 2026.8.33 extensions/zalouser reproduction — package lock validated.
  • AutoReview (Codex, P0/P1) — scoped-clean.
  • Exact-head CI — run 36266415532, green.
  • OPENCLAW_TESTBOX=1 scripts/pr prepare-run 159124 — passed; the wrapper accepted exact-head hosted CI, so no separate Testbox run was dispatched.
  • Production/test delta: +15 net tooling lines / +42 test lines. The production growth records the missing workspace-policy ownership boundary; no package-specific exception was added.
  • Proof gaps: none for this release-tooling path; UI proof is not applicable.

@RomneyDa

Copy link
Copy Markdown
Member Author

@clawsweeper review

@clawsweeper

clawsweeper Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 26, 2026
@clawsweeper

clawsweeper Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 26, 2026, 6:25 PM ET / 22:25 UTC (Revision 3).

ClawSweeper review

What this changes

The branch changes OpenClaw’s release lock generator to retain workspace dependency defaults alongside scoped forks, validate npm’s resolved graph, and repair conflicting dependency shrinkwraps, with regression tests.

Merge readiness

⛔ Blocked before merge - 2 items remain

Keep this PR open. Current main still has the reported override-merging behavior, and the revised branch now tests the final generated lock through the generator entry point. The remaining merge requirement is to record the expanded test file’s measured cost.

Priority: P2
Reviewed head: ddc01a9c04a82c37ae1d7ddaeb0618778e61239c

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The revised patch has meaningful generator-boundary coverage and no confirmed correctness defect; test cost still needs to be recorded.
Proof confidence 🐚 platinum hermit (4/6) Not applicable: The MEMBER-authored PR is exempt from the contributor proof gate. Its test exercises the production generator with npm and a local registry, while the body reports a successful frozen-plugin run; this review did not observe that run’s terminal output. Generated locks are temporary release artifacts, and no stored-data contract changes.
Patch quality 🐚 platinum hermit (4/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 contributor proof gate. Its test exercises the production generator with npm and a local registry, while the body reports a successful frozen-plugin run; this review did not observe that run’s terminal output. Generated locks are temporary release artifacts, and no stored-data contract changes.
Evidence reviewed 8 items Current-main behavior: Current main merges derived version overrides with workspace overrides in the older planner and lacks the new resolved-graph validation.
Introduced repair: The introduced patch keeps explicit workspace root overrides authoritative and validates the resolved lock after each npm regeneration.
Generator-boundary regression: The new integration fixture invokes the production generator against a local registry and asserts the final lock for scoped hoists and shrinkwrap repairs. This addresses the earlier review’s test-boundary concern.
Findings None None.
Security None None.

How this fits together

Release preflight feeds plugin manifests, workspace override policy, and the pnpm lock into the npm lock generator. The generated npm-format locks validate publishable packages and feed release dependency evidence.

flowchart LR
  A[Plugin manifest] --> D[Npm lock generator]
  B[Workspace overrides] --> D
  C[Pnpm lock] --> D
  D --> E[Resolved graph validation]
  E --> F[Package lock]
  F --> G[Release dependency evidence]
Loading

Before merge

  • Resolve merge risk (P1) - The materially expanded test file has no recorded one-worker wall time or CI seconds, leaving its recurring CI cost unmeasured under repository policy.
  • Complete next step (P2) - Record the expanded test file’s measured one-worker wall time and CI seconds in the PR body before merge.
Agent review details

Security

None.

PR surface

Tests +671, Other +365. Total +1036 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 672 1 +671
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 417 52 +365
Total 2 1089 53 +1036

Review metrics

Metric Value Why it matters
Production and test growth production +365 net, tests +671 net The PR explains production growth as resolved-graph policy and repair logic; the larger test expansion makes cost measurement relevant.
Integration fixture 4 generator runs in 1 test Each run invokes npm, so this fixture can materially affect the test file’s wall time.

Merge-risk options

Maintainer options:

  1. Record test cost (recommended)
    Add the test file’s measured one-worker wall time and CI seconds to the PR body so the release-tooling CI cost can be assessed before merge.

Technical review

Best possible solution:

Keep the release generator as the owner of scoped lock policy and resolved-graph validation, with a measured CI cost for its npm-backed regression coverage.

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

Yes, from source: current main can combine a derived global pin with a different workspace root default, and the PR describes a frozen plugin-publication reproduction. This read-only review did not execute it.

Is this the best way to solve the issue?

Yes. Repairing the release generator and asserting its final npm lock addresses the owning boundary; current main has no equivalent resolved-graph check.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.

Label justifications:

  • P2: This repairs a bounded release-tooling failure for publishable plugins.
  • merge-risk: 🚨 automation: The PR changes release lock validation and adds repeated npm-backed test work whose CI cost has not been recorded.
  • 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. Not applicable: The MEMBER-authored PR is exempt from the contributor proof gate. Its test exercises the production generator with npm and a local registry, while the body reports a successful frozen-plugin run; this review did not observe that run’s terminal output. Generated locks are temporary release artifacts, and no stored-data contract changes.

Evidence

What I checked:

  • Current-main behavior: Current main merges derived version overrides with workspace overrides in the older planner and lacks the new resolved-graph validation. (scripts/generate-npm-package-lock.mts:662, 547bb312f409)
  • Introduced repair: The introduced patch keeps explicit workspace root overrides authoritative and validates the resolved lock after each npm regeneration. (scripts/generate-npm-package-lock.mts:668, ddc01a9c04a8)
  • Generator-boundary regression: The new integration fixture invokes the production generator against a local registry and asserts the final lock for scoped hoists and shrinkwrap repairs. This addresses the earlier review’s test-boundary concern. (test/scripts/generate-npm-package-lock.test.ts:971, ddc01a9c04a8)
  • Release boundary: Release preflight calls the generator for all npm locks; the release documentation identifies npm-format locks as dependency evidence. (scripts/release-preflight.mts:63, ddc01a9c04a8)
  • Test-cost policy: Repository guidance requires measured one-worker wall time for materially changed test files and CI seconds once available. Neither measurement appears in the captured PR body. Public docs: docs/help/testing/writing-tests.md. (docs/help/testing/writing-tests.md:93, ddc01a9c04a8)
  • Dependency contract: The installed npm 11.19.0 Arborist package identifies npm/cli as its source repository. Its OverrideSet selects matching edge rules using the incoming dependency spec; this corroborates the contract being modeled, though it is not the exact npm 11.13.0 source cited in the PR body. (workspaces/arborist/lib/override-set.js:83)

Likely related people:

  • Dallin Romney: 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 (2 earlier review cycles)
  • reviewed 2026-09-26T19:56:21.274Z sha a9d32e1 :: blocked before merge. :: [P1] Keep the root pin check outside its scoped exception
  • reviewed 2026-09-26T20:29:28.561Z sha a85c800 :: blocked before merge. :: [P3] Move the scoped-name test to the generator boundary

@clawsweeper clawsweeper Bot added status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 26, 2026
@RomneyDa

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

The head has moved to ddc01a9c04a82c37ae1d7ddaeb0618778e61239c with behavioral changes that address the prior blocked review and subsequent AutoReview findings: full resolved-graph validation, dependency/optional/peer placement, Arborist-compatible scoped override selection, dependency shrinkwrap attribution with fixed-point regeneration, range and alias identity validation, and Git/file/hosted spec handling. Fresh exact-head local proof is 82/82 focused tests, all 102 package-lock surfaces, frozen 2026.8.33 Zalouser reproduction, changed gates, and scoped-clean AutoReview.

@clawsweeper

clawsweeper Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Sep 26, 2026
@RomneyDa
RomneyDa enabled auto-merge (squash) September 27, 2026 02:58
@RomneyDa
RomneyDa merged commit 2e09d9e into main Sep 27, 2026
112 checks passed
@RomneyDa
RomneyDa deleted the fix/npm-lock-scoped-policy-collision branch September 27, 2026 02:58
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 27, 2026
…159124)

* fix(release): preserve scoped npm lock policy

* fix(release): retain scoped shrinkwrap checks

* fix(release): verify repaired npm lock graphs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: XL 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