Skip to content

fix(release): preserve plugin scan provenance - #164789

Merged
RomneyDa merged 14 commits into
mainfrom
fix/plugin-artifact-scan-provenance
Oct 4, 2026
Merged

RomneyDa merged 14 commits into
mainfrom
fix/plugin-artifact-scan-provenance

Conversation

@RomneyDa

@RomneyDa RomneyDa commented Oct 4, 2026 •

Copy link
Copy Markdown
Member

Problem

Exact plugin npm artifact qualification in FRV 37178811468 rejected two reviewed shipped files:

  • ACPX's dist/mcp-proxy.mjs was assigned the package-wide setup layout because the tarball also contains .setup chunks.
  • iMessage's generated dist/.setup/sanitize-outbound-3MLljgtY.mjs reported one bundled helper exec() finding already reviewed from the failed artifact.

Solution

  • Classify each scanner finding from its own file path (source, dist, or dist/.setup) instead of assigning one package-wide layout.
  • Migrate existing reviewed keys to their actual per-file layouts.
  • Qualify the iMessage helper only when its normalized path, rule, count, and full frozen-candidate file SHA-256 all match.

Shared scanner behavior is unchanged from main. The 2026.9.9 candidate SHA remains unchanged, and changed bytes at the reviewed path fail closed.

Evidence

Exact-head focused proof is posted in the PR comments: scripts types pass, 11/11 owner tests pass, and the exact frozen-candidate iMessage tarball scan passes. No full local CI was run.

@clawsweeper

clawsweeper Bot commented Oct 4, 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 commented Oct 4, 2026

Copy link
Copy Markdown
Member Author

Post-push focused proof on exact head 0a7737663fd:

pnpm test src/skills/security/scanner.test.ts test/scripts/plugin-npm-security-scan.test.ts --maxWorkers=1
2 Vitest shards passed
56 tests passed
2.35s test wall (2.64s command wall)

The first run correctly exposed one stale package-wide-layout test assumption. The pushed follow-up moved its finding into dist so it still proves source allowances cannot qualify dist findings while the new mixed-layout regression proves each file owns its layout.

No full local CI was run.

@github-actions

github-actions Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Security-sensitive guard cleared

Current revision: 717fd6f7edb5549ce21fd8db29fa2aec94b97126

This PR no longer changes files in the maintainer security-review tier.

Separate CODEOWNERS requirements still apply to security policy and enforcement files.

@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. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 4, 2026
@clawsweeper

clawsweeper Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed October 4, 2026, 5:27 AM ET / 09:27 UTC (Revision 12).

ClawSweeper review

What this changes

The PR classifies plugin release security findings by each file’s location and binds one reviewed iMessage helper exception to its exact file bytes.

Merge readiness

✅ Ready for maintainer review

This PR remains useful: current main still assigns one layout to the entire package. The earlier scanner findings are resolved by removing those changes, and the narrowed patch has no identified blocking defect.

Priority: P2
Reviewed head: 717fd6f7edb5549ce21fd8db29fa2aec94b97126

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, maintainable repair with relevant artifact-run evidence and no remaining correctness finding.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (terminal): The recorded exact-head scan exercises the production tarball-scanning owner against the frozen iMessage artifact and reports 992 scanned files with one reviewed finding accepted. Focused tests supplement this with changed-byte rejection and mixed-layout coverage. No stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The recorded exact-head scan exercises the production tarball-scanning owner against the frozen iMessage artifact and reports 992 scanned files with one reviewed finding accepted. Focused tests supplement this with changed-byte rejection and mixed-layout coverage. No stored-data contract changes.
Evidence reviewed 9 items Pinned introduced change: The merge-base-to-head diff changes only the release scanner and its tests. Layout selection moves from package inventory to each finding; migrated allowances retain their limits, and the new iMessage allowance requires a full SHA-256 match.
Current main still needs the repair: The fetched main scanner still chooses setup, dist, or source once for the whole package and lacks the sanitizer digest qualification. No existing configuration or alternate supported path repairs this release-gate classification.
Previous scanner blockers resolved: The shared scanner source and tests have no introduced delta. Historical import-recognition and execution-detection findings therefore do not apply to the current patch.
Findings None None.
Security None None.

How this fits together

OpenClaw’s plugin release gate scans the exact npm tarball before uploading it as an immutable publication artifact. It compares critical findings with reviewed allowances and rejects unexpected findings.

flowchart TD
  A[Plugin npm tarball] --> B[Validate package and archive]
  B --> C[Scan runtime files]
  C --> D[Classify each finding by file location]
  D --> E[Check reviewed limits and required digest]
  E --> F[Reject unexpected findings]
  E --> G[Qualify immutable release artifact]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +53, Other +19. Total +72 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 55 2 +53
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 32 13 +19
Total 2 87 15 +72

Review metrics

Metric Value Why it matters
New reviewed qualification 1 exception; limit 1; full SHA-256 required The added qualification rejects different file bytes and additional critical findings.

Technical review

Best possible solution:

Keep release qualification in the existing exact-tarball scanner, with file-specific allowances and byte-bound exceptions while preserving critical detection.

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

Yes, source establishes the layout defect: a tarball containing a setup chunk assigns setup layout to a reviewed dist file. The mixed-layout regression exercises that trigger; this review did not run tests.

Is this the best way to solve the issue?

Yes. Repairing classification in the existing release scanner and binding the helper allowance to exact bytes avoids changing shared detection or creating a competing qualification path.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. The recorded exact-head scan exercises the production tarball-scanning owner against the frozen iMessage artifact and reports 992 scanned files with one reviewed finding accepted. Focused tests supplement this with changed-byte rejection and mixed-layout coverage. No stored-data contract changes.

Label justifications:

  • P2: This is a bounded release-tooling repair for false rejection of reviewed plugin artifacts.
  • 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 (terminal): The recorded exact-head scan exercises the production tarball-scanning owner against the frozen iMessage artifact and reports 992 scanned files with one reviewed finding accepted. Focused tests supplement this with changed-byte rejection and mixed-layout coverage. No stored-data contract changes.
  • proof: sufficient: Contributor real behavior proof is sufficient. The recorded exact-head scan exercises the production tarball-scanning owner against the frozen iMessage artifact and reports 992 scanned files with one reviewed finding accepted. Focused tests supplement this with changed-byte rejection and mixed-layout coverage. No stored-data contract changes.

Evidence

What I checked:

  • Pinned introduced change: The merge-base-to-head diff changes only the release scanner and its tests. Layout selection moves from package inventory to each finding; migrated allowances retain their limits, and the new iMessage allowance requires a full SHA-256 match. (scripts/plugin-npm-security-scan.mts:304, 717fd6f7edb5)
  • Current main still needs the repair: The fetched main scanner still chooses setup, dist, or source once for the whole package and lacks the sanitizer digest qualification. No existing configuration or alternate supported path repairs this release-gate classification. (scripts/plugin-npm-security-scan.mts:253, 0986d87938b1)
  • Previous scanner blockers resolved: The shared scanner source and tests have no introduced delta. Historical import-recognition and execution-detection findings therefore do not apply to the current patch. (src/skills/security/scanner.ts, 717fd6f7edb5)
  • Production release boundary: The plugin publication workflow invokes this scanner on the preflight manifest’s exact tarball before immutable artifact upload. Archive inspection validates package paths, rejects duplicate entries, and supplies actual file bytes to the scanner. (.github/workflows/plugin-npm-release.yml:927, 717fd6f7edb5)
  • Exact-head artifact evidence: The captured comment fix(release): preserve plugin scan provenance #164789 (comment) reports the frozen-candidate iMessage artifact passing on the reviewed head: 992 files scanned, one reviewed critical finding, and tarball SHA-256 3cabd66aeb2f1ae34c0a9a43dbf9126d972270190a1a9ccfd92d3e65a357148e. It also reports a passing scripts typecheck and 11/11 focused tests in 844ms. This is contributor-recorded evidence; this read-only review did not execute it. (717fd6f7edb5)
  • Qualification rejection boundary: The new allowance admits at most one dangerous-exec finding at the normalized iMessage sanitizer path, and requires file digest 34833261f1e012015e6e28f35903d78f77efcfdac68f924310b8a3761264878b. Changed bytes fail the digest comparison; additional findings fail the count limit. The focused test exercises changed-byte rejection through the tarball scanner. (scripts/plugin-npm-security-scan.mts:322, 717fd6f7edb5)

Likely related people:

  • RomneyDa: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • vincentkoc: 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 (11 earlier review cycles; latest 8 shown)
  • reviewed 2026-10-04T06:14:01.993Z sha cc79ff2 :: blocked before merge. :: [P1] Preserve token-adjacent ESM import recognition | [P1] Recognize member calls with whitespace after the dot
  • reviewed 2026-10-04T06:33:01.636Z sha 5dccaac :: blocked before merge. :: [P1] Preserve detection of methods extracted from child_process
  • reviewed 2026-10-04T07:08:45.238Z sha 5dccaac :: blocked before merge. :: [P1] Preserve detection of methods extracted from child_process | [P1] Distinguish complex member receivers from bare execution calls
  • reviewed 2026-10-04T07:27:05.892Z sha 1188e50 :: blocked before merge. :: [P1] Preserve exec detection after namespace destructuring
  • reviewed 2026-10-04T07:49:50.058Z sha 0dfcb52 :: blocked before merge. :: [P1] Preserve exec detection across comma-separated declarations
  • reviewed 2026-10-04T08:07:36.094Z sha 9bb62a5 :: blocked before merge. :: [P1] Preserve exec detection after another declaration in the same list
  • reviewed 2026-10-04T08:27:19.637Z sha ada7a6e :: blocked before merge. :: none
  • reviewed 2026-10-04T09:14:21.675Z sha 717fd6f :: needs maintainer review before merge. :: none

@RomneyDa

RomneyDa commented Oct 4, 2026

Copy link
Copy Markdown
Member Author

Addressed the two ClawSweeper blockers at 4af9de334aa0bc4a6519cb9e76cf0a991850b3e2:

  • retained dangerous-exec detection for destructured dynamic child_process imports and inline require("child_process").spawn(...) receivers;
  • migrated the five stale package-wide setup allowance keys to their per-file dist/source owners without widening any limit;
  • added focused regressions for both scanner forms and a mixed-layout Google Meet artifact.

Focused proof after the push:

pnpm test src/skills/security/scanner.test.ts test/scripts/plugin-npm-security-scan.test.ts --maxWorkers=1
2 Vitest shards passed, 57 tests passed, 2.62s test wall

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Oct 4, 2026
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. labels Oct 4, 2026
@RomneyDa

RomneyDa commented Oct 4, 2026

Copy link
Copy Markdown
Member Author

Completed the remaining ClawSweeper cutover at cc79ff2c9066bc6652005eff0e077e359fb4b24c:

  • dynamic namespace and mixed default/named child_process imports retain critical execution findings;
  • default-as-namespace specifiers and inline dynamic-import receivers are also treated as proven process sources;
  • Raft’s final stale setup allowance is migrated to dist with the same limit;
  • focused regressions cover the new import forms and a mixed-layout Raft artifact.

Focused proof after the push:

pnpm test src/skills/security/scanner.test.ts test/scripts/plugin-npm-security-scan.test.ts --maxWorkers=1
2 Vitest shards passed, 58 tests passed, 2.51s test wall

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@RomneyDa

RomneyDa commented Oct 4, 2026

Copy link
Copy Markdown
Member Author

Resolved the latest syntax-coverage findings at 511f24bd8a131229c7128e22bdad07e11c6d9707:

  • compact named/renamed and namespace imports retain proven child_process bindings;
  • member calls with whitespace after the dot retain their namespace receiver;
  • the focused proof initially caught an inline-receiver branch-order regression on 843ebf4a803; the one-line owner fix was pushed immediately at 511f24bd8a1, then the same proof passed.

Focused proof on the current head:

pnpm test src/skills/security/scanner.test.ts test/scripts/plugin-npm-security-scan.test.ts --maxWorkers=1
2 Vitest shards passed, 58 tests passed, 4.26s test wall

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@RomneyDa

RomneyDa commented Oct 4, 2026

Copy link
Copy Markdown
Member Author

Exact-head proof for 9bb62a53d16:

pnpm tsgo:core
passed

pnpm test src/skills/security/scanner.test.ts test/scripts/plugin-npm-security-scan.test.ts --maxWorkers=1
2 Vitest shards passed
59 tests passed
6.68s suite wall

The pushed follow-up addresses the exact Revision 8 delimiter gap: namespace-destructured method collection accepts a following declaration-list comma, so const { exec } = cp, marker = 0; exec(...) retains its critical finding. The same owner-boundary regression now covers the stronger syntax form and fails on the prior PR head, while the unrelated bundled-exec negative control remains green.

No full local CI was run.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Oct 4, 2026
@RomneyDa

RomneyDa commented Oct 4, 2026

Copy link
Copy Markdown
Member Author

Exact-head proof for ada7a6e44d0:

pnpm tsgo:scripts
passed

pnpm test test/scripts/plugin-npm-security-scan.test.ts --maxWorkers=1
1 Vitest shard passed
11 tests passed
2.48s suite wall

The PR is now narrowed to the release-tooling owner. Shared scanner source/tests are byte-identical to the PR merge base, eliminating the false-negative syntax risk from Revisions 1–8. The remaining change classifies each finding by its own file layout and qualifies exactly one observed iMessage finding at dist/.setup/sanitize-outbound-<hash>.mjs with limit 1. The regression proves the scanner still emits that finding and the exact path normalization/allowance admits it; changed bytes or an additional finding remain rejected.

No full local CI was run.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Oct 4, 2026
@clawsweeper clawsweeper Bot added 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. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 4, 2026
@RomneyDa

RomneyDa commented Oct 4, 2026

Copy link
Copy Markdown
Member Author

Exact-head proof for 717fd6f7edb:

  • pnpm tsgo:scripts — passed
  • pnpm test test/scripts/plugin-npm-security-scan.test.ts --maxWorkers=1 — 11/11 passed (Vitest duration 844ms)
  • Exact frozen-candidate iMessage artifact scan — passed: 992 files scanned, 1 reviewed critical finding, tarball SHA-256 3cabd66aeb2f1ae34c0a9a43dbf9126d972270190a1a9ccfd92d3e65a357148e
  • The reviewed helper qualification is now bound to the frozen artifact file's full SHA-256; the owner test proves changed bytes at the same normalized path are rejected.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Oct 4, 2026
@RomneyDa
RomneyDa merged commit 1464bc6 into main Oct 4, 2026
116 checks passed
@RomneyDa
RomneyDa deleted the fix/plugin-artifact-scan-provenance branch October 4, 2026 09:45
@RomneyDa

RomneyDa commented Oct 4, 2026

Copy link
Copy Markdown
Member Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 5, 2026
* fix(release): preserve plugin scan provenance

* test(release): align plugin scan layout proof

* fix(release): preserve scanner coverage

* fix(security): complete process import provenance

* fix(security): cover inline process imports

* fix(security): preserve compact process syntax

* fix(security): retain inline process receivers

* fix(security): preserve member execution detection

* fix(security): preserve extracted process calls

* fix(security): narrow complex exec receivers

* fix(security): preserve namespace destructuring

* fix(security): cover declaration lists

* fix(release): qualify exact helper finding

* fix(release): bind helper finding to artifact bytes
RomneyDa added a commit that referenced this pull request Oct 13, 2026
* fix(release): preserve plugin scan provenance

* test(release): align plugin scan layout proof

* fix(release): preserve scanner coverage

* fix(security): complete process import provenance

* fix(security): cover inline process imports

* fix(security): preserve compact process syntax

* fix(security): retain inline process receivers

* fix(security): preserve member execution detection

* fix(security): preserve extracted process calls

* fix(security): narrow complex exec receivers

* fix(security): preserve namespace destructuring

* fix(security): cover declaration lists

* fix(release): qualify exact helper finding

* fix(release): bind helper finding to artifact bytes

(cherry picked from commit 1464bc6)
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. 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