Skip to content

improve(test): share compiled Crabbox wrapper fixtures - #188403

Merged
roboclaw-bot merged 1 commit into
mainfrom
test-health/crabbox-wrapper
Oct 30, 2026
Merged

roboclaw-bot merged 1 commit into
mainfrom
test-health/crabbox-wrapper

Conversation

@roboclaw-bot

@roboclaw-bot roboclaw-bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator

What Problem This Solves

The Crabbox wrapper suite repeatedly copies thousands of immutable compiled files into temporary checkouts, adding filesystem work to a test priced at 173 seconds in the CI timing inventory.

User Impact

No user-visible change. Sharing immutable compiled fixture files removes repeated byte copies while preserving existing coverage. The corrected passing samples do not demonstrate a wall-time speedup.

Why This Change Was Made

Share compiled entrypoints and chunks with hard links, falling back to the existing copy operation when links are unavailable. Each checkout retains its own paths and cleanup ownership. Reuse the same fixture construction for the setup executable.

Production code, test cases, assertions, timeouts, and platform conditions are unchanged. Test lines decrease by six. The scalar is lowered to the exact tracked total, 6,295,757; the previous scalar already contained slack.

Evidence

test/scripts/crabbox-wrapper.test.ts, same host, command, and one worker. Only successful runs enter the medians:

Version Observation Wall (s) Vitest (s) Filesystem output (blocks)
Before 1 250.75 248.93 20,468,480
Before 3 201.48 199.38 20,071,616
Before 4 (detached original base) 193.67 189.89 4,291,008
Before Passing median 201.48 199.38 20,071,616
After 1 199.79 197.95 3,779,112
After 2 205.93 204.18 8,492,360
After 3 205.36 203.56 3,920,600
After Passing median 205.36 203.56 3,920,600

The corrected passing-baseline wall median is 201.48 s, versus 205.36 s after: 3.88 s slower (1.9%). Vitest medians are 199.38 s → 203.56 s, 4.18 s slower (2.1%). These observations do not establish wall-time savings. Ranges overlap (before 193.67–250.75 s; after 199.79–205.93 s), and host load and cache conditions vary; there is no guaranteed CI saving. CI has not yet retimed this change.

Failed observation, preserved separately and excluded from successful-run medians:

Version Observation Wall (s) Vitest (s) Outcome
Before 2 288.30 286.16 1 failed, 283 passed, 1 skipped; exit 1

The failure was transports verified source and dependencies (provider=blacksmith-testbox, shallow=false, scenario=transport): the fixture's local git clone exceeded its unchanged 10-second deadline (ETIMEDOUT, SIGTERM, observed 11,132 ms). Source inspection places this failure in fixture setup before wrapper invocation. The same case passed in original baseline observations 1 and 3, the added original-base observation 4, and all three after runs. The cause remains unresolved; a passing replay is not a repair. No timeout, assertion, or case was changed to obtain the added passing observation.

All six successful runs pass 284 tests, with one existing Windows-only case skipped by its unchanged platform condition. Baseline observation 4 ran at original base 5ed4aa230f8996b7747f654c5bf26ad2e2a8860a in a detached worktree with a separate frozen dependency installation, pnpm store, temporary directory, XDG cache/data directories, and Vitest module cache. The new paths use the same filesystem as the original observations. The measured command includes its one-time pinned Bun cache download. The samples were not interleaved, and cache/host differences limit timing attribution. No tests were deleted; deleted-test → covering-test mapping: none. No shared test-support module changed, so there are no additional importing test files to run.

Per-case profiling identifies CLI startup, source transport, and real child-tree cancellation as the remaining costs. First-baseline test bodies sum to 215.68 s; setup/runner account for roughly 33 s. The test module imports in about 95 ms. The wrapper exposes no in-process command API, so this change retains the actual subprocess contracts rather than introducing a production seam.

The bundle has 5,442 files totaling 138,620,769 bytes; 5,440 are shared by hard links in the relocated fixture. For passing runs, median /usr/bin/time -v filesystem output decreases from 20,071,616 to 3,920,600 blocks (80.5%). These counters also vary substantially: the added baseline produces 4,291,008 blocks, below after observation 2's 8,492,360; the ranges overlap. This is an observed median output reduction, not a guaranteed CI saving.

Validation:

  • timeout 900 pnpm install --frozen-lockfile — passed.
  • Original observations and the added original-base observation: OPENCLAW_VITEST_FS_MODULE_CACHE_PATH=<proof-dir>/vitest-cache-crabbox-wrapper timeout 600 /usr/bin/time -v pnpm test test/scripts/crabbox-wrapper.test.ts --maxWorkers=1 --reporter=verbose. Original observations 2–3 and added baseline observation 4 also enable OPENCLAW_VITEST_IMPORT_DURATIONS=1 OPENCLAW_VITEST_PRINT_IMPORT_BREAKDOWN=1. Added baseline installation: timeout 900 pnpm install --frozen-lockfile --store-dir <isolated-store> — passed; installation time is outside the test timing.
  • Scoped typecheck: timeout 300 node scripts/run-tsgo.mjs -p <proof-dir>/tsconfig-crabbox-wrapper.json --incremental --tsBuildInfoFile <proof-dir>/tsconfig-crabbox-wrapper.tsbuildinfo — passed. The temporary config extends test/tsconfig/tsconfig.test.root.json, selects this test plus declaration files, and resolves installed Node types.
  • Scoped lint: timeout 180 node scripts/run-oxlint.mjs --tsconfig <proof-dir>/tsconfig-crabbox-wrapper.json test/scripts/crabbox-wrapper.test.ts — passed.
  • timeout 60 pnpm format:check test/scripts/crabbox-wrapper.test.ts and git diff --check — passed.
  • timeout 120 pnpm check:test-lines-ratchet --base 5ed4aa230f8996b7747f654c5bf26ad2e2a8860a — passed. File: 6,684 → 6,678 lines; repository: 6,295,763 → 6,295,757 lines.
  • gh pr view 159315 --json files — touches only extensions/crabbox/src/crabbox-worker-provider.test.ts; that file is untouched here.
  • pr-simplify completed. Local autoreview (Codex, P0–P2) reviewed the final candidate against base 5ed4aa230f8996b7747f654c5bf26ad2e2a8860a, with the full test and shim fixture as evidence: scoped-clean, no findings. Reviewed code is committed as 9e1068aa27d82a1995aeff555616eeb2b633151d. Local ClawSweeper is unavailable; hosted ClawSweeper has acknowledged this PR and will report when review starts. No duplicate request was sent.

CI checked once in this phase at 2026-10-30 14:07:46 UTC: run 41068654859 is in_progress on exact head 9e1068aa27d82a1995aeff555616eeb2b633151d; 2 jobs passed (including security-fast), 13 were running, and 28 were skipped, with no failed jobs observed. openclaw/ci-gate is pending. Comments/reviews contain only the ClawSweeper acknowledgment, with no review findings or inline comments. No CI rerun or merge was requested.

Credit

Requested by Peter Steinberger for the OpenClaw test-health loop.

Work sessions

@clawsweeper

clawsweeper Bot commented Oct 30, 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.

@roboclaw-bot roboclaw-bot changed the title perf(test): share compiled crabbox wrapper fixtures improve(test): share compiled Crabbox wrapper fixtures Oct 30, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:feature Preliminary submission classification; full source review pending. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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 clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Oct 30, 2026
@clawsweeper

clawsweeper Bot commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR shares immutable compiled Crabbox fixtures through hard links, retains copying as a fallback, and lowers the test-line baseline.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused test-only improvement supported by repeated suite results and passing exact-head CI, with timing limitations stated accurately.
Proof confidence 🐚 platinum hermit (4/6) This maintainer-authored test-only refactor changes fixture construction; the supplied suite results exercise relocated compiled entry points, and no production behavior requires separate live proof.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Test only · Worth it: Yes · Fix scope: Complete
User problem: Repeated relocation of immutable compiled fixtures creates avoidable filesystem work during the Crabbox wrapper suite.
Reason: The maintainer-authored change removes repeated copying with a small shared helper and preserves existing coverage; its value does not depend on claiming a runtime speedup.

Merge readiness

✅ Ready for maintainer review

Keep this PR open: it makes a focused, useful test-fixture improvement, and the reviewed diff has no actionable findings.

Priority: P3
Reviewed head: 9e1068aa27d82a1995aeff555616eeb2b633151d

Before merge

None.

Findings

None.

Agent review details

How this fits together

The Crabbox wrapper suite compiles wrapper and setup entry points, relocates their shared chunks into isolated fixtures, and launches subprocesses to verify routing, transport, and cleanup.

flowchart TD
  A[Wrapper and setup sources] --> B[Shared esbuild compilation]
  B --> C[Immutable entry points and chunks]
  C --> D[Hard links or copy fallback]
  D --> E[Isolated fixture directories]
  E --> F[Subprocess contract tests]
Loading

Technical review

Best possible solution:

Use the existing fixture owner to share immutable compiled files while preserving relocation paths, cleanup, and the copy fallback.

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

This is a test-only refactor; source inspection confirms repeated compiled-file copying, and no target code was executed during this review.

Is this the best way to solve the issue?

The change removes redundant byte copies through the existing helper, preserves fallback behavior, and adds no unnecessary production machinery.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Lazy compiled fixture relocation keeps the original intent (35ee06f: Relocate exact compiler outputs while preserving lazy imports and embedded schemas after earlier missing-schema and readiness failures.)
  • Shared compilation and setup isolation keeps the original intent (c647ce7: Compile real, setup, and stubbed entry points together while preserving real source production and lazy chunks.)
  • Setup fixture relocation keeps the original intent (fix: avoid duplicate Crabbox fixture builds #166188: Avoid duplicate dependency compilation while keeping the setup executable in its isolated directory.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Shakker: Raw commit 69db9ee adds test/scripts/crabbox-wrapper.test.ts:1713 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 69db9ee39a4c; files: test/scripts/crabbox-wrapper.test.ts)

PR surface

Tests -6, Other 0. Total -6 across 2 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 20 26 -6
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 1 1 0
Total 2 21 27 -6

Labels

Label changes:

  • add P3: This is test-fixture maintenance with no production behavior change or demonstrated urgent user impact.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P3: This is test-fixture maintenance with no production behavior change or demonstrated urgent user impact.
  • 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.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 30, 2026, 10:27 AM ET / 14:27 UTC.

@roboclaw-bot
roboclaw-bot merged commit cf448bc into main Oct 30, 2026
111 checks passed
@roboclaw-bot
roboclaw-bot deleted the test-health/crabbox-wrapper branch October 30, 2026 14:42
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

Merged via squash.

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

Labels

P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS 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