Skip to content

fix: prepare frozen Knip for network-isolated OpenClaw validation - #1001

Merged
steipete merged 3 commits into
mainfrom
codex/clawsweeper-offline-knip-validation
Aug 1, 2026
Merged

steipete merged 3 commits into
mainfrom
codex/clawsweeper-offline-knip-validation

Conversation

@steipete

@steipete steipete commented Aug 1, 2026 •

Copy link
Copy Markdown
Contributor

Problem

OpenClaw root-cause issue repairs were reaching their real changed-validation gate and then failing because pnpm dlx --package [email protected] knip tried to download Knip inside ClawSweeper's deliberately network-isolated validation sandbox. For example, repair run 30695474227 reached ERR_PNPM_META_FETCH_FAIL/EAI_AGAIN instead of creating its OpenClaw pull request. A green outer workflow alone did not indicate successful repair.

Changes

  • Extract the pinned OpenClaw validation helper into its own narrow repair module.
  • Prepare only the checked-in, exactly pinned [email protected] helper when the selected changed-validation plan actually includes an OpenClaw source file scanned by Knip; docs-only repairs, disabled changed gates, and ordinary toolchain preparation never fetch it.
  • Preserve OpenClaw's 48-hour minimum release age and any stricter repository policy; install every transitive dependency directly from the committed config/openclaw-knip-6.8.0.pnpm-lock.yaml with --frozen-lockfile, and fail closed on any graph mismatch before downloaded package code can execute.
  • Populate pnpm's existing offline dlx cache from that frozen installation without running downloaded package code or package lifecycle scripts.
  • Explicitly disable package lifecycle scripts, pnpmfiles, pre/post scripts, and the global virtual store while staging the helper in the disposable validation profile outside the protected OpenClaw checkout.
  • Bind its cache into the already immutable Corepack runtime and copy it afresh into each network-isolated validation profile, preserving the real changed-gate dead-code check without granting validation network access.
  • Scope Jiti's no-filesystem-cache setting to the trusted Knip launcher only, so Knip cannot write node_modules/.cache/jiti while OpenClaw's own plugin-loader cache tests retain their normal behavior.
  • Match pnpm's registry-host encoding, including approved registries using nondefault HTTPS ports.
  • Configure pnpm 11 with its supported PNPM_CONFIG_OFFLINE=true and PNPM_CONFIG_REGISTRY variables, while preserving pnpm 10's legacy npm_config_offline=true, so either supported pnpm generation remains network-isolated and cannot silently fall back to the public registry or a fresh package download.
  • Expand NUL-delimited, ignored-file-aware untracked paths before source classification so a newly created source directory receives the same frozen helper as a modified tracked source file.
  • Reject absolute paths, . segments, and .. traversal segments in otherwise trusted mutating formatter hints.
  • Preserve standalone local review and leave OpenClaw issue-PR creation on gpt-5.6-sol / xhigh with CLAWSWEEPER_ALLOW_MERGE=0; generated OpenClaw PRs remain create-only and never enable auto-merge.

Security-boundary disposition

The frozen dependency graph is completely committed and integrity-bound; package staging uses --frozen-lockfile and rejects any mismatch before helper execution. Lifecycle scripts, pnpmfiles, pre/post scripts, and the global virtual store are disabled. Setup can write only to a disposable private profile outside the protected OpenClaw checkout. The digest-bound cache is frozen, then copied privately for each isolated validation command. Only the fixed Knip launcher disables Jiti's filesystem cache. Production pnpm is explicitly forced offline and bound to the same approved registry used during frozen setup, including custom registries and nondefault ports. The real pinned helper, the protected target checkout, and the existing plugin-loader suite were verified end to end. OpenClaw fix PRs remain create-only; no target PR receives merge or auto-merge authority.

Real behavior proof

Verified head: 2261169240cbb4d570a956c521767d7735c786ca.

The actual pinned package was installed with --frozen-lockfile, full lifecycle execution disabled, and release-age enforcement enabled; then the real OpenClaw-style pnpm check:changed gate executed real [email protected] with networking unavailable:

{
  "actualPinnedKnipExecuted": true,
  "offlineValidationSucceeded": true,
  "commands": ["pnpm check:changed"],
  "targetJitiCacheCreated": false
}

The same actual end-to-end proof also succeeds when the target repository's policy is increased to seven days:

{
  "actualPinnedKnipExecuted": true,
  "offlineValidationSucceeded": true,
  "minimumReleaseAgeMinutes": 10080,
  "frozenDependencyGraph": true
}

Separately, copying only the staged pnpm cache into a fresh profile and pointing HTTP/HTTPS/all proxies at an unreachable listener still ran the actual pinned package successfully and printed 6.8.0.

Independent execution also confirmed that real pnpm 11 runs the frozen pinned helper with PNPM_CONFIG_OFFLINE=true, while pnpm 10 reports offline mode only when the preserved legacy npm_config_offline=true accompanies it. Focused integration coverage requires both settings and the same approved registry for every isolated validation command.

Focused coverage asserts that helper setup never writes to the OpenClaw checkout, installs only its complete frozen [email protected] dependency graph, preserves the 48-hour release-age policy, rejects a tampered transitive dependency graph, works with registries on nondefault HTTPS ports, never downloads Knip for docs-only or disabled-gate validation, disables every package execution hook and the global virtual store, restores a clean private cache for each validation command, prevents Knip-only Jiti checkout writes without breaking existing plugin-loader tests, and rejects absolute/traversal formatter paths.

Verification

  • pnpm run build:all
  • pnpm run lint:repair
  • pnpm run lint:scripts
  • pnpm run format:check
  • pnpm run check:active-surface
  • pnpm run check:limits
  • Focused target-validation and process-tree-containment integration suites.
  • The existing OpenClaw src/plugins/plugin-module-loader-cache.test.ts suite: 19/19 passed with Knip's cache override scoped to Knip alone.
  • Full affected target-validation/source/workflow regression suite: 228 passed, 3 expected skips.
  • Actual real-Knip, offline, protected-checkout proof described above.
  • Independent Codex /review on the exact current head.

@clawsweeper clawsweeper Bot added proof: sufficient Contributor real behavior proof is sufficient. 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. P2 Normal priority bug or improvement with limited blast radius. merge-risk: 🚨 security-boundary 🚨 Merging this PR could weaken sandboxing, authorization, credentials, or sensitive data. labels Aug 1, 2026
@clawsweeper

clawsweeper Bot commented Aug 1, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 1, 2026, 9:37 AM ET / 13:37 UTC.

ClawSweeper review

What this changes

The PR stages an integrity-pinned Knip dependency cache for OpenClaw repair validation, allowing the existing changed-code check to run offline without downloading packages in the isolated validation profile.

Merge readiness

⚠️ Ready for maintainer review - 3 items remain

This PR remains necessary: current main still lacks the frozen Knip staging path, while the submitted change provides a bounded way for OpenClaw repair validation to run its existing changed-code check without network access. The patch has strong real-behavior proof and no discrete correctness defect found, but merging intentionally adds a committed third-party dependency graph and pnpm cache staging inside the repair validation boundary, so it needs maintainer security-boundary acceptance rather than automated landing.

Priority: P2
Reviewed head: 2261169240cbb4d570a956c521767d7735c786ca
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Strong real offline proof and focused containment coverage support a good patch, with maintainer security-boundary acceptance remaining before merge.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The PR body provides after-fix real behavior proof on head 2261169240cbb4d570a956c521767d7735c786ca: the actual pinned Knip package ran through pnpm check:changed without network access, while the target checkout remained free of the scoped Jiti cache write.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The PR body provides after-fix real behavior proof on head 2261169240cbb4d570a956c521767d7735c786ca: the actual pinned Knip package ran through pnpm check:changed without network access, while the target checkout remained free of the scoped Jiti cache write.
Evidence reviewed 6 items Current main does not contain the repair: Comparing the PR head with current main shows the new frozen Knip lockfile, helper module, validation integration, executor ordering changes, and focused tests are absent from current main; this PR therefore still owns the central fix.
Frozen staging is narrowly gated: The helper runs only for openclaw/openclaw, only when its checked-in Knip runner declares version 6.8.0, and only after the validation plan requires the OpenClaw changed-code command with a relevant source path.
Dependency staging has explicit containment controls: The staged install uses the committed lockfile with --frozen-lockfile, disables lifecycle scripts and pnpmfiles, disables the global virtual store, confines writes to the disposable profile root, then verifies generated lockfile dependency sections against the committed graph.
Findings None None.
Security None None.

How this fits together

ClawSweeper repair jobs prepare a disposable target-repository toolchain, then run selected validation commands before publishing a repair PR. For OpenClaw source changes, this patch supplies the Knip dead-code checker from a frozen private cache so the network-isolated changed-code gate can execute without modifying the protected checkout.

flowchart LR
  A[Repair candidate] --> B[Changed-file validation plan]
  B --> C{OpenClaw source gate needed?}
  C -->|Yes| D[Frozen Knip staging]
  D --> E[Private offline pnpm cache]
  C -->|No| F[Normal validation setup]
  E --> G[Isolated changed-code validation]
  F --> G
  G --> H[Repair PR decision]
Loading

Decision needed

Question Recommendation
Should ClawSweeper accept the committed, integrity-pinned Knip dependency graph and pnpm cache staging as the supported way to preserve OpenClaw’s network-isolated changed-code validation? Accept frozen staging: Approve the narrow frozen-cache design after reviewing the committed graph and containment contract; this preserves the existing real changed-code gate offline.

Why: The patch appears technically sound and is backed by real offline proof, but accepting a new third-party dependency staging mechanism inside a repair security boundary is a maintainer policy decision rather than a mechanical contributor fix.

Before merge

  • Resolve merge risk (P1) - Merging accepts an 838-line pinned third-party dependency graph and a pnpm dlx-cache layout dependency inside the repair-validation security boundary; the integrity check, lifecycle suppression, disposable-profile confinement, and offline restoration behavior must remain the accepted contract.
  • Complete next step (P2) - No mechanical repair remains; a maintainer must decide whether to accept this frozen third-party staging design in the repair-validation security boundary.
Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Patch surface 5 files affected; 1,320 added, 9 removed The functional code change is focused, but 838 added lines are the committed frozen dependency graph that requires explicit security-boundary review.
Focused regression coverage 205 test lines added The new coverage targets offline execution, lock tampering, cache isolation, registry handling, and source-path gating rather than only unit-level helper behavior.

Merge-risk options

Maintainer options:

  1. Approve the frozen validation helper (recommended)
    After auditing the committed lock graph and containment safeguards, merge the helper with its lifecycle suppression, lock verification, offline binding, and private-cache restoration intact.
  2. Pause for a different packaging boundary
    Keep this PR open only if maintainers do not want a committed third-party graph and pnpm dlx cache structure in the repair-validation trust boundary.

Technical review

Best possible solution:

Retain OpenClaw’s real changed-code validation gate, but land it only with the frozen lockfile as the sole dependency source, lifecycle-free staging outside target checkouts, per-command private cache restoration, and the focused containment coverage preserved.

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

Yes, from current source and the supplied run evidence: OpenClaw’s changed-code path uses pnpm dlx, while current main has no staged frozen Knip helper; the PR body also records an actual network-isolated before/after validation run.

Is this the best way to solve the issue?

Yes, subject to maintainer acceptance of the security boundary: preparing the exact locked helper only when the existing OpenClaw changed-code gate needs it is narrower and safer than granting network access to isolated validation or disabling the real gate.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: The patch repairs a bounded internal repair-validation failure without evidence of an immediate user-facing production outage.
  • merge-risk: 🚨 security-boundary: Merging introduces staged third-party package content and a frozen pnpm cache path into the isolated repair-validation execution boundary.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster 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 PR body provides after-fix real behavior proof on head 2261169240cbb4d570a956c521767d7735c786ca: the actual pinned Knip package ran through pnpm check:changed without network access, while the target checkout remained free of the scoped Jiti cache write.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body provides after-fix real behavior proof on head 2261169240cbb4d570a956c521767d7735c786ca: the actual pinned Knip package ran through pnpm check:changed without network access, while the target checkout remained free of the scoped Jiti cache write.

Evidence

What I checked:

  • Current main does not contain the repair: Comparing the PR head with current main shows the new frozen Knip lockfile, helper module, validation integration, executor ordering changes, and focused tests are absent from current main; this PR therefore still owns the central fix. (src/repair/pinned-openclaw-validation-helper.ts:17, 2261169240cb)
  • Frozen staging is narrowly gated: The helper runs only for openclaw/openclaw, only when its checked-in Knip runner declares version 6.8.0, and only after the validation plan requires the OpenClaw changed-code command with a relevant source path. (src/repair/pinned-openclaw-validation-helper.ts:30, 2261169240cb)
  • Dependency staging has explicit containment controls: The staged install uses the committed lockfile with --frozen-lockfile, disables lifecycle scripts and pnpmfiles, disables the global virtual store, confines writes to the disposable profile root, then verifies generated lockfile dependency sections against the committed graph. (src/repair/pinned-openclaw-validation-helper.ts:64, 2261169240cb)
  • Validation execution stays offline and refreshes a private profile: The OpenClaw validation environment binds pnpm to the approved registry, sets both supported offline environment forms, and resets the disposable cache before copying the frozen helper cache into the per-command validation profile. (src/repair/target-validation.ts:1297, 2261169240cb)
  • Focused regression coverage exercises the security-critical path: The added integration test checks frozen setup flags, separate prefetch and validation caches, cache restoration across multiple commands, lockfile-tamper rejection, offline variables, custom registry ports, docs-only avoidance, and untracked source-path handling. (test/repair/target-validation.test.ts:3630, 2261169240cb)
  • Feature-history routing: The current repair-validation surface has been repeatedly maintained by Peter Steinberger, including the recent repair-validation refactor and deterministic OpenClaw validation work; the behavior appears to build on that ownership trail. (src/repair/target-validation.ts:457, 922ebc673e12)

Likely related people:

  • Peter Steinberger: Recent current-main history shows repeated ownership of the repair-validation and deterministic OpenClaw execution paths that this PR extends. (role: recent area contributor and feature owner; confidence: high; commits: 922ebc673e12, 8ee77751965b, 30d0321d9c9c; files: src/repair/target-validation.ts, src/repair/execute-fix-artifact.ts, test/repair/target-validation.test.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Audit and explicitly accept the committed Knip graph plus pnpm cache-staging contract before landing.

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-08-01T13:10:11.515Z sha 52561c9 :: needs maintainer review before merge. :: none

@steipete

steipete commented Aug 1, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 1, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@steipete
steipete merged commit 5b0ff66 into main Aug 1, 2026
14 checks passed
@steipete
steipete deleted the codex/clawsweeper-offline-knip-validation branch August 1, 2026 13:46
azaj01 pushed a commit to azaj01/clawsweeper that referenced this pull request Sep 21, 2026
…enclaw#1001)

* fix: stage frozen OpenClaw deadcode tooling for isolated validation

* fix: reject traversal paths in mutating formatter hints

* fix: bind offline pnpm registries across supported versions

---------

Co-authored-by: Peter Steinberger <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 security-boundary 🚨 Merging this PR could weaken sandboxing, authorization, credentials, or sensitive data. P2 Normal priority bug or improvement with limited blast radius. proof: sufficient Contributor real behavior proof is sufficient. 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant