Skip to content

fix: pinned-base tests fail without a cached pnpm runtime - #1260

Merged
steipete merged 1 commit into
mainfrom
steipete/offline-baseline-preparation
Aug 27, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/offline-baseline-preparation

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Resolves a problem where six pinned-base validation tests fail on pnpm distribution resolution instead of reaching their intended check.js assertions when the host does not have the fixture's pinned pnpm version in the disposable offline cache. The failure was independently reproduced on unchanged baseline 5cb6777eea2da37e2c2481e15215c2f8be9c774f.

Why This Change Was Made

These dependency-free fixtures deliberately use installTargetDeps: false, so the fixtures own supplying their executable. A scoped adapter uses the existing withMockCommand / mockCommandBinEnv boundary to run the actual fixture check.js in the real validator's working directory and environment. It rejects unexpected invocations and forwards the child's output and exit status; it does not manufacture the expected lint diagnostic or mock reproduction/classification.

The pnpm pin, existing assertions, production preparation, disposable profiles, and offline containment remain unchanged. The first existing case additionally checks the pinned HEAD, independent checkout, offline flags, fresh HOME/cache/Corepack directories across two reproductions, and cleanup. Production LOC: +0/-0. Tests: +99/-34 in one file.

User Impact

Developers can run the pinned-base reproduction tests without depending on their installed pnpm version or a pre-warmed distribution cache. There is no production behavior or public API change.

OpenClaw Bay Impact

None. This changes only local test-fixture execution, not review publication, queues, telemetry, dashboards, or data contracts.

Documentation Impact

Reviewed AGENTS.md, CONTRIBUTING.md, and docs/repair/README.md. Their preparation and containment contracts remain accurate; no documentation or changelog change is needed for this test-only repair.

Evidence

The original six cases failed before this repair and pass afterward. The full adjacent pinned-base group passes on the committed head with external networking denied. The changed file passes formatting, lint, and git diff --check; fresh isolated Codex reviews before commit and on the committed branch against origin/main both reported no accepted/actionable findings in their default P0 scope.

The local full pnpm run check was also attempted and is not green: 3,703 passed, 46 failed, 9 skipped. Forty-two failures match the separately reproduced inherited Git-pruning defect; two other fixtures still try to resolve host pnpm; one live-proof test cannot access the host tmux socket under the stricter outer sandbox; and one setup-deadline test times out at an earlier Git identity inspection. Those failures are not hidden, skipped, or folded into this patch. Exact-head hosted CI remains a landing gate.

Real Behavior Proof

Revision: f8536584ad1bc26f50f5d81a08cafd669ad10f49 (same reviewed test patch; relevant validation files are unchanged on current base ff813ac2fa76d853d8a9129e6763d09624cafe72).

Claim and exercised surface: the six affected fixtures now execute their real check.js through reproduceValidationFailureAtPinnedBase and the production contained command runner, without resolving an external pnpm distribution. Real local Git repositories exercise partial clones, historical blob hydration, comparison refs, SHA-256 object format, checkout-hook rejection, and adjacent fail-closed cases.

Environment: macOS, Node 24.19.0, repository pnpm 11.10.0. Dependencies were prepared offline with zero downloads. The focused proof adds an outer macOS sandbox denying non-loopback networking and restricts Git transports to local files; production isolation is not relaxed.

Build command:

env PNPM_CONFIG_OFFLINE=true npm_config_offline=true COREPACK_ENABLE_NETWORK=0 pnpm run build:all

Focused proof command:

/usr/bin/sandbox-exec -p '(version 1) (allow default) (deny network*) (allow network-bind (local ip "localhost:*")) (allow network-inbound (local ip "localhost:*")) (allow network-outbound (remote ip "localhost:*"))' /usr/bin/env PNPM_CONFIG_OFFLINE=true npm_config_offline=true COREPACK_ENABLE_NETWORK=0 GIT_ALLOW_PROTOCOL=file node --test --test-reporter=tap '--test-name-pattern=^pinned-base ' test/repair/target-validation.test.ts

Observed result and trace: before the repair, all six selected cases stopped at Failed to resolve @pnpm/[email protected] in package mirror …, before src/base.ts:1: lint failed. After the repair, the actual scripts emit that lint diagnostic, and the existing partial-clone/ref/object-format/hook assertions succeed. The first case also emits a pinned-base-profile observation from inside check.js; assertions verify the pinned HEAD, separate disposable cwd and profiles, both offline flags, and removal after each run. The adjacent group, including its independent-runtime and fail-closed cases, finishes:

1..11
# tests 11
# pass 11
# fail 0
# cancelled 0
# skipped 0

Limits: this is executable fixture/reproduction proof, not integration proof for downloading or installing the external pnpm distribution. No production runtime changed. macOS proof does not establish Linux namespace availability; the existing platform-specific containment tests retain their platform limits. The separate local full-gate failures above remain disclosed.

Run actual check.js in dependency-free fixtures through the existing command seam, retaining offline containment.
@clawsweeper

clawsweeper Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@clawsweeper clawsweeper Bot added 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. labels Aug 27, 2026
@clawsweeper

clawsweeper Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 27, 2026, 3:27 AM ET / 07:27 UTC.

ClawSweeper review

What this changes

The PR makes six pinned-base validation fixtures supply a scoped pnpm command adapter so their real check scripts run without a host-cached pnpm distribution.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep open: this is a focused, still-unique test repair with convincing before/after runtime evidence and no blocking patch defect found; the exact-head hosted check remains the landing gate.

Priority: P2
Reviewed head: f8536584ad1bc26f50f5d81a08cafd669ad10f49

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused test-only repair with strong runtime evidence; hosted exact-head validation remains to finish.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): The PR body provides an exact-revision offline runtime command, a before/after failure distinction, and passing output from the affected pinned-base fixture group.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The PR body provides an exact-revision offline runtime command, a before/after failure distinction, and passing output from the affected pinned-base fixture group.
Evidence reviewed 5 items Focused PR surface: The submitted commit changes only the pinned-base cases and adds a scoped test helper; no production source file is changed.
Existing command seam: Pinned-base reproduction skips dependency preparation when requested, then executes the allowed validation command in its disposable checkout; the patch exercises that existing path rather than changing it.
Override behavior: The contained command runner resolves command-specific binary overrides from its environment, so the fixture adapter reaches the normal contained-command boundary.
Findings None None.
Security None None.

Live Verification

Command: pnpm run build:repair && node --test --test-reporter=tap --test-name-pattern='^pinned-base ' test/repair/target-validation.test.ts

Result: FAIL (failed) — step 1 expect_output # pass 11: expected terminal output was not visible within 30 seconds: "# pass 11"

$ tsc -p tsconfig.repair.json
TAP version 13
# node:internal/modules/esm/resolve:271
#     throw new ERR_MODULE_NOT_FOUND(
#           ^
# Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/tmp/clawsweeper-live-proof-1260-MMarMG/target/dist/clawsweeper.js' imported from /tmp/clawsweeper-live-proo
f-1260-MMarMG/target/test/helpers.ts
#     at finalizeResolution (node:internal/modules/esm/resolve:271:11)
#     at moduleResolve (node:internal/modules/esm/resolve:865:10)
#     at defaultResolve (node:internal/modules/esm/resolve:992:11)
#     at \#cachedDefaultResolve (node:internal/modules/esm/loader:701:20)
#     at \#resolveAndMaybeBlockOnLoaderThread (node:internal/modules/esm/loader:721:38)
#     at ModuleLoader.resolveSync (node:internal/modules/esm/loader:759:56)
#     at \#resolve (node:internal/modules/esm/loader:683:17)
#     at ModuleLoader.getOrCreateModuleJob (node:internal/modules/esm/loader:603:35)
#     at ModuleJob.syncLink (node:internal/modules/esm/module_job:163:33)
#     at ModuleJob.link (node:internal/modules/esm/module_job:253:17) {
#   code: 'ERR_MODULE_NOT_FOUND',
#   url: 'file:///tmp/clawsweeper-live-proof-1260-MMarMG/target/dist/clawsweeper.js'
# }
# Node.js v24.19.0
# Subtest: test/repair/target-validation.test.ts
not ok 1 - test/repair/target-validation.test.ts
  ---
  duration_ms: 133.744758
  type: 'test'
  location: '/tmp/clawsweeper-live-proof-1260-MMarMG/target/test/repair/target-validation.test.ts:1:1'
  failureType: 'testCodeFailure'
  exitCode: 1
  signal: ~
  error: 'test failed'
  code: 'ERR_TEST_FAILURE'
  ...
1..1
# tests 1
# suites 0
# pass 0
# fail 1
# cancelled 0
# skipped 0
# todo 0
# duration_ms 141.823449

Assertions:

  • FAIL expect_output: # pass 11

How this fits together

The repair lane recreates validation failures at a pinned base in a disposable checkout, then classifies the resulting command output before deciding whether a repair is safe. This patch affects only the fixture-side command used to exercise that reproduction path.

flowchart LR
  A[Repair validation request] --> B[Pinned-base reproducer]
  B --> C[Disposable base checkout]
  C --> D[Contained validation command]
  D --> E[Captured failure output]
  E --> F[Repair classification]
Loading

Before merge

  • Resolve merge risk (P1) - The PR body reports that the local full check is not green for disclosed inherited failures, so the in-progress exact-head hosted pnpm check should complete successfully before merge.
  • Complete next step (P2) - No repair dispatch is needed because the submitted focused patch has no concrete actionable review finding; await the existing hosted check result.
Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Production versus test delta production +0/-0, tests +99/-34 in 1 file The patch is contained to the targeted repair-validation fixture and does not alter runtime behavior.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep the fixture-only adapter and land it once the exact-head hosted checks confirm the focused reproduction remains stable.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Keep the fixture-only adapter and land it once the exact-head hosted checks confirm the focused reproduction remains stable.

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

Yes, source and the submitted before/after trace establish the path: dependency-free pinned-base fixtures skip setup and otherwise resolve the host pnpm before reaching their check script.

Is this the best way to solve the issue?

Yes. The scoped adapter uses the existing command-resolution seam, executes the actual fixture check script, and leaves production preparation and containment unchanged.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P2: The patch repairs developer validation reliability with limited blast radius and no production behavior change.
  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR body provides an exact-revision offline runtime command, a before/after failure distinction, and passing output from the affected pinned-base fixture group.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The PR body provides an exact-revision offline runtime command, a before/after failure distinction, and passing output from the affected pinned-base fixture group.

Label justifications:

  • P2: The patch repairs developer validation reliability with limited blast radius and no production behavior change.
  • 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 (terminal): The PR body provides an exact-revision offline runtime command, a before/after failure distinction, and passing output from the affected pinned-base fixture group.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body provides an exact-revision offline runtime command, a before/after failure distinction, and passing output from the affected pinned-base fixture group.

Evidence

What I checked:

  • Focused PR surface: The submitted commit changes only the pinned-base cases and adds a scoped test helper; no production source file is changed. (test/repair/target-validation.test.ts:2086, f8536584ad1b)
  • Existing command seam: Pinned-base reproduction skips dependency preparation when requested, then executes the allowed validation command in its disposable checkout; the patch exercises that existing path rather than changing it. (src/repair/target-validation.ts:220, ff813ac2fa76)
  • Override behavior: The contained command runner resolves command-specific binary overrides from its environment, so the fixture adapter reaches the normal contained-command boundary. (src/command.ts:88, ff813ac2fa76)
  • Real behavior proof: The PR body records an offline macOS run at the submitted revision: the prior fixtures stopped while resolving pnpm, while the revised pinned-base group ran its actual check scripts and reported 11 passing tests. (f8536584ad1b)
  • Feature-history routing: History identifies Peter Steinberger as the current change author and a repeated contributor to this test surface; recent history also includes Vincent Koc on the same file. (test/repair/target-validation.test.ts:8889, f8536584ad1b)

Likely related people:

  • steipete: Git history shows six contributions on the target-validation test path, including the scoped adapter in this PR. (role: current test-surface contributor; confidence: high; commits: f8536584ad1b, 5cb6777eea2d; files: test/repair/target-validation.test.ts, src/repair/target-validation.ts)
  • Vincent Koc: Recent history records work on the same target-validation test file, making this a useful secondary routing contact. (role: recent adjacent contributor; confidence: medium; commits: afe976209aa5; files: test/repair/target-validation.test.ts)

Rank-up moves

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

  • Allow the exact-head hosted pnpm check to finish before merge because the disclosed local full-suite failures are outside this patch.

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.

@steipete
steipete merged commit 71df3a1 into main Aug 27, 2026
18 checks passed
@steipete
steipete deleted the steipete/offline-baseline-preparation branch August 27, 2026 07:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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