Skip to content

test: guard multi-project Vitest cache ownership - #133554

Merged
steipete merged 1 commit into
mainfrom
steipete/stoic-lamarr-60e143
Aug 30, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/stoic-lamarr-60e143

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Related: checkout-owned Vitest cache isolation (#132867).

Additional instructions

This is a same-repository, maintainer-editable branch.

What Problem This Solves

Adds maintainer-requested behavioral regression coverage for the existing shared-leaf Vitest cache workaround. Vitest 4.1.11 can repeatedly discard project transforms when invocation metadata lives elsewhere; merely making a global marker current can instead leave an unselected project's transforms stale.

Current OpenClaw configuration already co-locates root metadata and project transforms. The existing tests protect checkout isolation and configuration shape, but do not prove reuse and later-project freshness across a lockfile transition.

Why This Change Was Made

Exercise the actual createProjectShardVitestConfig and createScopedVitestConfig cache settings through real Vitest CLI children in one temporary namespace. Warm two projects, change a fixture-owned lockfile and synthetic external-plugin generation, run A twice, then B twice. Assert actual transform counts and independently check the executed dependency-generation export. Continue with a source edit and a project-alias change to ensure ordinary invalidation still works.

The existing child launcher is shared by both ownership tests. Its 15-second child deadline is unchanged. No dependency, production cache policy, heap, retry, pool, isolation, or worker-budget change; no metadata rewrite or custom cache-key override. This does not implement the separate compiled-worker campaign or repair Vitest's generic separated-root contract.

User Impact

No operator/runtime behavior changes. Developers gain a guard against accidentally separating cache validity from transforms or allowing stale transforms in a later-selected project.

Production LOC: +0/-0. Test LOC: +151/-19 (net +132), one test file.

Evidence

  • Negative control: temporarily omit only the generated root cache settings, retaining project settings. The new test fails on repeated A with actual cumulative transforms [3, 1] versus expected [2, 1]. The mutation was removed. This is an intentional negative control, not a claim that current main is broken.
  • Positive proof: 131 tests passed across the performance, project-composition, and scoped-config files. Independently repeated on Node 24.20.0 after the authoring run on Node 26.8.1; final owner-file authoring rerun also passed 10/10.
  • New case: nine joined Vitest children and fourteen executed version assertions. Counts: seed/warm [1,1]; lock transition/A repeat [2,1]; later B/B repeat [2,2]; A source edit [3,2]; alias edit/repeat [4,3].
  • Formatting and git diff --check passed. Source-only scripts lint exited 0. Fresh Codex autoreview returned scoped-clean at its default P0 threshold; parent manual review also completed.

Focused command (the outer cache is proof-owned; the inner test has its own independent temporary cache):

OPENCLAW_VITEST_FS_MODULE_CACHE_PATH="$PWD/.artifacts/vitest-cache-regression-pr/outer-cache-parent" node scripts/run-vitest.mjs test/vitest-performance-config.test.ts test/vitest-projects-config.test.ts test/vitest-scoped-config.test.ts --reporter=verbose
node_modules/.bin/oxfmt --check test/vitest-performance-config.test.ts
node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.scripts.json scripts

Local validation gap: after fast-forwarding this checkout, installed grammy remains 1.45.1 while main pins 1.46.0. Root-test typechecking reports eight existing Telegram type errors (RichMessageButton and newer update/message variants), none in the changed file. Dependencies were deliberately left untouched. Exact-head CI with the pinned install must pass typechecking and all required gates before merge. An initial lint invocation using the root tsconfig hit the same declaration-preparation failure; the correct source-only scripts lane subsequently exited 0.

@clawsweeper

clawsweeper Bot commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added size: S maintainer Maintainer-authored PR labels Aug 30, 2026
@steipete
steipete marked this pull request as ready for review August 30, 2026 21:19
@steipete steipete self-assigned this Aug 30, 2026
@clawsweeper clawsweeper Bot added 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. labels Aug 30, 2026
@clawsweeper

clawsweeper Bot commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 30, 2026, 5:26 PM ET / 21:26 UTC.

ClawSweeper review

What this changes

This PR adds a real child-Vitest regression that verifies shared cache reuse, lock-transition invalidation, and freshness of a later-selected project.

Merge readiness

⚠️ Ready for maintainer review - 1 item remains

Keep open. The PR adds a distinct regression guard for the existing cache policy and introduces no actionable correctness or security defect; its exact-head CI is still running.

Priority: P3
Reviewed head: 3266d12e41e616dab4d6e41406423f232ea3289e

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused test-only patch with a credible real-process scenario and no identified correctness defect, pending exact-head CI completion.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored, test-only PR records real child-Vitest runs in its body; no user-facing runtime behavior changes require contributor proof.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored, test-only PR records real child-Vitest runs in its body; no user-facing runtime behavior changes require contributor proof.
Evidence reviewed 6 items Introduced regression coverage: The PR-introduced test invokes both configuration builders in a temporary multi-project workspace, changes the recognized lock input, and asserts selected-project transform reuse plus later-project freshness.
Current cache owner: Current fetched main enables the filesystem cache and uses the supplied path or a checkout-owned default leaf; the test supplies its fixture-owned path to the real child processes.
Shared configuration boundary: The aggregate builder carries shared test settings into project runs, while the scoped builder starts from the same shared configuration; exercising both catches divergence between their cache settings.
Findings None None.
Security None None.

How this fits together

OpenClaw’s Vitest configuration assigns filesystem-cache locations for developer test runs. This test launches real Vitest children with the project and scoped configuration builders, then observes transform reuse and invalidation through fixture output.

flowchart LR
  A[Developer test command] --> B[Vitest configuration builders]
  B --> C[Filesystem cache location]
  C --> D[Project A and Project B]
  D --> E[Vitest transform cache]
  E --> F[Transform and freshness assertions]
Loading

Before merge

  • Resolve merge risk (P1) - Before merge, read the omitted latest ClawSweeper comment and let exact-head CI finish; this checkout could not independently inspect the pinned Vitest implementation because dependencies are absent and GitHub DNS was unavailable.
Agent review details

Security

None.

PR surface

Tests +132. Total +132 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 151 19 +132
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 151 19 +132

Review metrics

Metric Value Why it matters
Production versus test delta production +0/-0; tests +151/-19 The branch adds regression coverage only and does not alter OpenClaw runtime cache policy.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep the real-child-process regression as the cache-policy guard, with the shared configuration builders remaining the single source of cache settings.
  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 real-child-process regression as the cache-policy guard, with the shared configuration builders remaining the single source of cache settings.

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

Not applicable: this PR adds a guard for an existing test-tooling invariant rather than reporting a current product defect.

Is this the best way to solve the issue?

Yes. It exercises the existing aggregate and scoped configuration builders through real child Vitest processes, rather than duplicating cache-key logic in a unit-only fixture.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P3: This is developer-only regression coverage with no operator or product-runtime behavior change.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored, test-only PR records real child-Vitest runs in its body; no user-facing runtime behavior changes require contributor proof.

Label justifications:

  • P3: This is developer-only regression coverage with no operator or product-runtime behavior change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored, test-only PR records real child-Vitest runs in its body; no user-facing runtime behavior changes require contributor proof.

Evidence

What I checked:

  • Introduced regression coverage: The PR-introduced test invokes both configuration builders in a temporary multi-project workspace, changes the recognized lock input, and asserts selected-project transform reuse plus later-project freshness. (test/vitest-performance-config.test.ts:187, 3266d12e41e6)
  • Current cache owner: Current fetched main enables the filesystem cache and uses the supplied path or a checkout-owned default leaf; the test supplies its fixture-owned path to the real child processes. (test/vitest/vitest.performance-config.ts:57, 08d09c4d9704)
  • Shared configuration boundary: The aggregate builder carries shared test settings into project runs, while the scoped builder starts from the same shared configuration; exercising both catches divergence between their cache settings. (test/vitest/vitest.project-shard-config.ts:10, 3266d12e41e6)
  • Dependency signal: The changed test directly executes Vitest, and the repository pins Vitest 4.1.11; this establishes the dependency contract relevant to the regression. (package.json:2165, 3266d12e41e6)
  • History and routing: History and shortlog identify steipete as the dominant recent contributor on the cache-config test surface. The relevant blame is a shallow boundary, so it is not treated as introduction proof. (test/vitest/vitest.performance-config.ts:34, 7fa0bd178fdf)
  • Review limitation: This read-only checkout has no node_modules, and GitHub/DNS access was unavailable, so the Vitest implementation and the omitted latest bot comment could not be independently inspected here.

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

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

  • Read the latest ClawSweeper rank-up list and let the in-progress exact-head CI complete before merge.

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

Copy link
Copy Markdown
Contributor Author

Land-ready evidence for 3266d12e41e616dab4d6e41406423f232ea3289e: CI run 33336113509 completed successfully, including the actual openclaw/ci-gate. The older draft run's skipped gate is excluded.

Native main-baseline/PR-head review is complete; review-validate-artifacts passes with READY FOR /prepare-pr, valid issue validation, and zero findings. ClawSweeper's latest review and Rank-up list were read; exact-head CI is now complete. Direct installed Vitest 4.1.11 cache-owner inspection covers its reported dependency-inspection gap.

OPENCLAW_VITEST_FS_MODULE_CACHE_PATH="$PWD/.artifacts/vitest-cache-regression-pr/outer-cache-parent" node scripts/run-vitest.mjs test/vitest-performance-config.test.ts test/vitest-projects-config.test.ts test/vitest-scoped-config.test.ts --reporter=verbose
node_modules/.bin/oxfmt --check test/vitest-performance-config.test.ts
node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.scripts.json scripts
git diff --check 50b675ffe1768daec52fbcc5fb01042310c81667...HEAD
node scripts/watch-pr-ci.mjs 133554 3266d12e41e616dab4d6e41406423f232ea3289e
scripts/pr review-validate-artifacts 133554

Focused proof: 131 passed independently on Node 26 and Node 24; final owner rerun 10/10. Omitting only fixture root cache settings fails repeated A at [3,1] versus [2,1]; the mutation is removed. This negative control protects correct current-main behavior.

The local typecheck remains failed because installed grammy 1.45.1 differs from the 1.46.0 pin. Successful hosted test types, production types, core type stripes, and lint, using the normal frozen-lockfile setup, resolve that evidence gap without local dependency changes.

Production +0/-0; tests +151/-19. No source/dependency changes during readiness. Stopped before prepare-run and merge-run; final landing decision remains with the parent maintainer.

@steipete
steipete merged commit 8506c68 into main Aug 30, 2026
196 checks passed
@steipete
steipete deleted the steipete/stoic-lamarr-60e143 branch August 30, 2026 21:42
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Aug 30, 2026
* origin/main: (55 commits)
  test: include v2026.8.1 release navigation (#133581)
  fix: stop cloud work before unrelated provider inspection finishes (#133476)
  fix(e2e): keep delete fixture target-compatible (#133526)
  fix(release): detect optional target E2E capability (#133525)
  fix(package): publish readable dist inventory (#133549)
  docs: add complete v2026.8.1 maintainer change index (#133585)
  fix(browser): preserve contextless worker and iframe sessions (#133571)
  fix(voice): discover configured provider candidates (#133507)
  refactor(ui): simplify chat rendering and lifecycle state (#133567)
  test: reduce maturity fixture cleanup time (#133566)
  improve: speed up legacy imports and transcript replacement (#133546)
  docs: add draft v2026.8.1 release notes (#133557)
  test: guard multi-project Vitest cache ownership (#133554)
  fix(memory): clarify default agent scope in command help (#133560)
  fix(clawdock): keep credentials out of diagnostic output (#133547)
  refactor(ui): avoid redundant presence work in avatar lists (#133548)
  fix(agents): recognize internal requester completion replies (#133543)
  fix: prevent duplicate queued user messages in chat clients (#133542)
  chore(ui): refresh control ui locales (#133544)
  fix(beam): restart delivery when the receiver changes (#133533)
  ...
vincentkoc added a commit to shojikumaru/openclaw that referenced this pull request Aug 30, 2026
…cked-delivery

* origin/main:
  test: include v2026.8.1 release navigation (openclaw#133581)
  fix: stop cloud work before unrelated provider inspection finishes (openclaw#133476)
  fix(e2e): keep delete fixture target-compatible (openclaw#133526)
  fix(release): detect optional target E2E capability (openclaw#133525)
  fix(package): publish readable dist inventory (openclaw#133549)
  docs: add complete v2026.8.1 maintainer change index (openclaw#133585)
  fix(browser): preserve contextless worker and iframe sessions (openclaw#133571)
  fix(voice): discover configured provider candidates (openclaw#133507)
  refactor(ui): simplify chat rendering and lifecycle state (openclaw#133567)
  test: reduce maturity fixture cleanup time (openclaw#133566)
  improve: speed up legacy imports and transcript replacement (openclaw#133546)
  docs: add draft v2026.8.1 release notes (openclaw#133557)
  test: guard multi-project Vitest cache ownership (openclaw#133554)
  fix(memory): clarify default agent scope in command help (openclaw#133560)
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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