Skip to content

[CI] Keep native watcher contracts in Node and reset runtime test caches - #26315

Merged
nwparker merged 2 commits into
mainfrom
nwparker/runtime-test-correctness
Oct 7, 2026
Merged

nwparker merged 2 commits into
mainfrom
nwparker/runtime-test-correctness

Conversation

@nwparker

@nwparker nwparker commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

Full test runs exposed two runtime-contract problems: shuffled tests could inherit a repository-key cache from an earlier case, and a real native filesystem-watcher test ran under Bun rather than the app's Node runtime. This fixes those boundaries while retaining every test and assertion.

What Changed

Three added lines in two existing files:

  • The runtime fixture calls the existing _resetCanonicalRepoKeyCacheForTests seam with its other mocks. Existing cleanup hooks and within-case production cache reuse remain intact.
  • The existing Node runtime registry includes the one real @parcel/watcher contract. Its event assertions, eight-second delivery deadline, 300ms absence check, newline-path cases and native cleanup stay unchanged. Pure watcher-policy tests stay in the ordinary project.

Why

The fixture's mock reset and cache reset need the same lifetime. Reusing the existing reset seam fixes the cold-probe assumption directly. The native watcher belongs in the app's actual runtime, consistent with the agreed native-contract policy. Disabling the production cache, weakening assertions, changing real deadlines or retrying failures would conceal the evidence.

Testing

Repository-cache correctness before and after, across the complete 22-file/1,669-case cohort:

Optimizer-off control source and seed Bun coordinator Node coordinator
Before a576c0bc, seed 104729 1,668 passed, one stock Windows skip Same
Before a576c0bc, seed 130363 1,667 passed, one failed, one stock skip Same
After cache reset 30bc964e, seed 104729 1,668 passed, one stock Windows skip Same
After cache reset 30bc964e, seed 130363 1,668 passed, one stock Windows skip Same

The original failed run and corrected qualification are both first attempts. Original case identities match exactly: in each old failing control, only “OrcaRuntimeService routes local WSL project worktree drift probes through runtime git options” changes failed→passed. All other statuses match; the precise stock skip is “lists drive roots for a server-root browse.” The cohort includes one separate public-binding check. Four additional optimizer-enabled arms pass the same cohort; those qualify a separate experiment and provide no speedup claim for this fix.

Native-watcher observations are preserved separately:

Observation Runtime Native result
Display-clock full CI, source bcce34b Bun One passed, 368ms
Radix full CI, source 6b4fef3 Bun One failed after 8,023ms
Ten-shard full CI, source 0146cef Bun One passed, 370ms
Four isolated after qualifications Actual Node through both coordinators All four runs: 36 passed, no failures or skips
Complete combined PR integration, source 5b47b23a Actual Node One passed, 377ms

The unchanged watcher missed a source path within its existing deadline in the failed run. The passing observations prevent claiming a categorical Bun defect, and these limited observations do not establish a reliability improvement. This is a runtime-contract correction; it makes no speedup claim.

All original cohort identities, statuses, stock isolation, six setups, four workers, source fingerprints and natural-close/process guards are verified independently. Cache-reset compatibility uses fsModuleCache=false; full CI retains stock caching. Native contracts run only in isolated Linux ARM CI with ORCA_BACKGROUND_LAUNCH=1. Formatting, Node typecheck, changed-code quality and normal commit hooks pass. Combined normal shipping commit 71fa4b2116319b1ae4c8f8be274b9bebad2cfcb7, rebased onto the merged ten-shard rollout 00984ccb, changes only the two target files. The 196 upstream paths added or changed since the original base remain intact, including the newer SQLite contract registry. Formatting, Node typecheck and changed-code quality passed again after rebasing. The complete ten-shard PR suite passed; earlier focused measurements keep their original source labels. Each target byte matches its separately qualified normal donor commit (f5a3abc8 registry, 30bc964e fixture). Full PR CI and current-head review are recorded below.

Complete integration: run 37680622381, tested merge 5b47b23a93de5400fd2f405a20f1f64bd5b426df, parents 00984ccb and shipping head 71fa4b21. All ten shards, selection evidence and final verification pass; all 35 current-head contexts are terminal, with no failures. Package jobs were skipped for this two-file change and are not claimed as package validation.

Actual uploaded assignments, fresh canonical discovery and raw module completion records agree: 11,715 physical files exactly once, 11,575 passed files and 140 stock skipped files; 112,984 passed cases, three expected failures and 1,052 stock skips, with zero failed cases, unhandled errors or omitted failures. Every physical file from the immediately preceding qualified c0256db7 integration remains enrolled, with identical aggregate case counts. Actual runtime markers show 10,581 ordinary Bun files, 1,133 Node runtime files and one Node measurement file. The real watcher runs in node-runtime and passes in 377ms. The lifecycle .spec.ts file is imported fixture support rather than a separately discovered test; its exact shipping bytes and all runtime suites are preserved. Stock CI artifacts provide module-level counts and runtime markers, not a complete named-case map, so full-suite case identity parity is not inferred from totals.

The exact tested merge preserves incoming main except the two intended files, and both match their shipping bytes. Of the 55 existing stored source guards, only the intended Node runtime registry differs from the preceding qualified integration; all other guarded paths retain identical bytes.

Linked Issue

N/A — maintainer follow-up to measured full-suite and shuffle failures.

Visual Proof

N/A — test fixture cleanup and runtime routing only; no application UI change.

Review

Independent source and actual cache-reset raw-report reviews are clear. All four native qualifications retain identical 36-case identity/status maps. Actual completion records keep the watcher in node-runtime/node-runtime for both Bun seeds and node/forks for both Node seeds; pure policy and sequencing counterexamples stay ordinary. Independent raw source/config/process gates and a separate root raw-map check pass. Combined integration passes. CodeRabbit's review covers exact head 71fa4b21, reports no actionable comments, and has no review threads. Its generic documentation advisory for the existing resetRuntimeTestMocks function is acknowledged: the function name and reset calls state its scope clearly, so no redundant docstring is added.

Agent skill upstream boundary

  • Not applicable; no upstream skill source or assets.

Notes

Production native, WSL and SSH repository-cache ownership and folder-workspace behavior are unchanged. Native watcher routing applies on macOS, Linux and Windows and retains the existing Windows filename guard. New runtime observations are from Linux ARM CI; no macOS or Windows app testing is claimed.

Checklist

  • Explained observed failures, resulting boundaries, mechanism and alternatives.
  • Retained all original cases, assertions, native cleanup and real waits.
  • Recorded passing and failing before results without a performance or reliability claim.
  • Formatting, typecheck, changed-code quality and normal hooks pass.
  • Four actual watcher qualifications recorded.
  • Combined full PR integration recorded.
  • Current-head actionable bot feedback addressed; generic documentation advisory explicitly acknowledged.

@coderabbitai

coderabbitai Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: dade4c7f-499d-4e7c-8c6c-2f731962dcd1
📥 Commits

Reviewing files that changed from the base of the PR and between 00984cc and 71fa4b2.

📒 Files selected for processing (2)
  • config/scripts/vitest-node-runtime-files.mjs
  • src/main/runtime/orca-runtime-test-lifecycle.spec.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

The Node runtime test include list now includes filesystem-watcher-ignore-real.test.ts. Runtime test mock cleanup now resets the canonical repository-key cache before resetting pending worktree removals.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to 71fa4

This change adjusts test routing and cache cleanup; the inspected configuration supports the intended Node execution, and no concrete regression is established. No code-review blocker remains.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly summarizes both primary changes: routing native watcher contracts to Node and resetting runtime test caches.
Description check ✅ Passed The description is complete and directly matches the template. It explains the changes, rationale, testing evidence, visual impact, review status, compatibility considerations, and checklist results. …
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@nwparker
nwparker merged commit 7b26725 into main Oct 7, 2026
35 checks passed
@nwparker nwparker changed the title Keep native watcher contracts in Node and reset runtime test caches [CI] Keep native watcher contracts in Node and reset runtime test caches Oct 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant