Repository navigation
Node test files run with node --test in repos that use vitest (#4586) - #4626
Merged
Merged
Conversation
The pre-merge test check handed root .js/.mjs/.cjs files that load node:test to the repo vitest, which finds no suite in them and fails, so /ship stopped at finish. detectRunner now gives files that all load node:test node --test ahead of vitest and jest (bun still runs them), and planRuns splits them out of the root group. Reported by @eoin-obrien in #4586. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
A JS test that loads vitest or @jest/globals beside node:test stays with that runner. Review-Finding: p1/specialist-batched#1 reader=testing Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Import text inside a template literal no longer decides which runner a JS test gets. Review-Finding: p2/outside-voice#1 reader=outside-voice Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
|
😎 This pull request was merged. |
Merged
capy-ai Bot
added a commit
that referenced
this pull request
Nov 21, 2026
- Habits from nine teams, written into gstack. (#4585) - Three more habits from teams that run evals. (#4602) - The /ship conductor trial plan gives its real-problem judge one more attempt on fresh labels after it missed its agreement bar twice, and stops the trial incomplete if it misses again (GST-3003). (#4611) - The /ship conductor trial plan now stops a trial only at the final remote-gate refusal, gives both arms the same note that the brief overrides team rules, and counts every report the no-gstack arm returns (GST-3003). (#4609) - The /ship conductor trial plan now ends a trial at the remote gate when its case base isn't main, gives the no-gstack arm a test runner, and audits every trial for exposure to the plan (GST-3003). (#4605) - The /ship conductor trial plan now runs an uncounted pilot in every arm before its counted trials and takes one planned look at half the cases (GST-3003). (#4587) - gstack's own use on Capy can be counted, and is kept out of real-use numbers. (#4576) - Free Tests shards finish closer together. (#4578) - The weekly test-time recording can land again on its own. (#4581) - The job-log tree.json step's recommended sleep is long enough for real runners. (#4589) - Pull requests no longer wait on the Trunk flaky-test upload, and the quick tier's flaky passes now reach Trunk. (#4579) - Windows Setup E2E finishes sooner on install changes. (#4575) - Skills no longer stop on Codex when they clean up temp files. (#4612) - /review on Codex with OpenAI models no longer holds back a review that ran its adversarial pass. (#4622) - Crew threads on Capy now check in at 500M own tokens, standing threads rotate at 250M and any subagent past 50M gets a look, half the old lines, because Capy's token counts read about half what they did before 2026-11-15. (#4582) - gstack no longer offers to add a `## Skill routing` section to your project's CLAUDE.md. (#4629) - The README and docs no longer say gstack makes your agent fix more bugs. (#4598) - `/eval-plan` now writes eval plans that waste less money. (#4591) - /cso checks every folder above a source file before it looks at the file, so it never looks through a symlinked folder. (#4592) - Plan reviews no longer read a /design-review audit summary as the branch's design doc. (#4623) - Node's built-in test files now run with `node --test` in repos that use vitest or jest. (#4626) - A quarantined test that the runner skipped now fails the run instead of passing it. (#4590) - A flaky free test is fixed: the spawnSync overflow check no longer fails about once an hour on CI. (#4613) - Free Tests runs its shards on 16-core runners. (#4600) - /office-hours asks for ground truth first. (#4468) - Every startup session ends with a dated test. (#4468) - /plan-tune's dream cycle now logs each send of your typed answers to Anthropic. (#4621) - Landing a ready PR no longer depends on a hand-copied gate decision, and the ready note, release PR and squash message say the right thing. (#4596) - /ship no longer asks for a fresh review because of a stacked parent that main already had. (#4580) - Results PRs with large captured agent sessions can be reviewed. (#4574) - /ship no longer stalls on review notes a reviewer already cleared, counts review rounds the way the review policy reads them, and keeps security findings out of the PR body. (#4595) - /ship's review readers are now told never to stop processes they didn't start. (#4607) - /ship's review no longer stops when Capy's own drive sync database grows past 100 MB. (#4606) - /ship's preflight now honors your repository's time limit for rerunning CI-skipped tests, and tells you when a fresh worktree needs its packages installed. (#4608) - The slowest free test file is now six files. (#4588) - Step 11.5 keeps a reviewed head current across base-only merges. (#4577) - On a Capy install, only the owner's opt-in sends telemetry. (#4597) - New page: working across agent systems. (#4583) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Test files that use Node's built-in test runner (
node:test) now run withnode --testin repos whose package.json declares vitest or jest, so /ship's pre-merge test check stops failing on them.Before, a root
.js,.mjsor.cjsfile that loadsnode:testwas handed to vitest, which found no tests and failed every PR that touched one. Reported by @eoin-obrien in #4586.Nothing to do.
What changed
A node:test file in a vitest repo now gets
node --testinstead of vitest.In a pnpm monorepo whose root package.json declares vitest, /ship stopped at its finish step on every PR that touched a root
node:testscript test: the check ran that file under vitest, vitest found no suite, and the run failed. The runner detection now looks at the file itself. A.js,.mjsor.cjstest that loadsnode:testat the start of a line (animport, a bare import or arequire) runs as its ownnode --testgroup from the repo root, while vitest and jest files keep their runner. A file that also loads vitest or@jest/globalsstays with that runner, and import text inside comments, strings or template literals doesn't count. Bun repos are unchanged becausebun testrunsnode:testfiles itself, and a runner declared in.gstack/pregate.jsonstill takes every file.One existing assertion changed on purpose. The "negative controls … keep today's plan" test pinned the fixture file
test/util.test.js, which requiresnode:test, to vitest in a root-vitest repo. That expectation was the #4586 bug itself, so it now expects vitest for the vitest file andnode --testfor the node:test file.No outside code was carried over. The issue's fixture was rebuilt from scratch in the new test.
Why
/ship should only fail for a real test failure. A repo mixing vitest with Node's own test runner is common in pnpm monorepos, and today every PR in such a repo that touches one of those files stops at the finish step for a reason that has nothing to do with the change.
Blast radius
Only runner detection for JS test files changes:
detectRunnerandplanRunsinlib/pregate/checks/lanes.ts(read at lines 53-66 and 233-300). Repos that declare a runner, bun repos, and files that don't loadnode:testget the same plan as before; the existing bun-repo and declared-runner tests pin that, and the 93 focused tests in the selection, Dart and Rust suites pass.Pre-Landing Review
Two full review passes, one fix round, and one granted follow-up check. The first pass found that a
.jsfile importing both vitest andnode:testwent tonode --test; that was fixed. A second-model review then found the fix misread import text inside template literals; that was fixed under one granted follow-up check, which came back clean. Remaining items are below the blocking floor and listed under Review notes.Review notes
Below the blocking floor (advisory, informational, test-gap or wording items); recorded here and not fixed in this PR.
sf-89c56ae1f58fsecurity finding, details recorded privatelylib/pregate/checks/lanes.ts:205A jest-globals or mocha file that imports node:test helpers is still routed to node --test; pre-existing before the fix.lib/pregate/checks/lanes.ts:203Dynamic import('vitest') is not seen by the exclusion; rare and fails loudly.lib/pregate/checks/lanes.ts:203The template-literal strip does not handle nested templates: a node:test file whose template holds a nested template with line-start vitest import text still goes to vitest.Exploratory QA
Five probes against a scratch repo (root package.json declaring vitest), run through the real
planRuns: anode:test.mjsfile getsnode --testand a.tsvitest file keeps vitest;node --testthen runs that file and passes (1 test); a.jsfile importing both vitest andnode:testwent tonode --testbefore the first fix and stays on vitest after it; anode:testfile holding generated vitest text in a template literal getsnode --testat the first commit and after the second fix, and went to vitest only at the head between them. No probe was blocked or skipped.Eval Results
No prompt-related files changed, so evals were skipped.
TODOS
No TODO items completed in this PR.
Documentation
Status: updated. One factual edit, no blockers.
Scope: committed diff bd77c8c..9ae8c3a on fix/pregate-node-test-files-run-with-node (
lib/pregate/checks/lanes.ts,test/pregate-selection.test.ts,changelog.d/fix-pregate-node-test-files-run-with-node.md); no staged, unstaged or untracked changes.Documentation health:
docs/pregate.md: Updated. Therunnerrow now says.js/.mjs/.cjstests that loadnode:test(and not vitest or@jest/globals) run throughnode --testfrom the repo root even in vitest or jest repos, while bun repos keepbun test.changelog.d/fix-pregate-node-test-files-run-with-node.md: Current.Coverage debt: the new node:test runner detection is covered by reference docs only (the
docs/pregate.mdrunner row); there is no how-to, which is fine for internal detection behavior. No diagram drift.Tests
bun test test/pregate-selection.test.ts test/pregate-dart.test.ts test/pregate-rust.test.ts: 93 pass, 0 fail at the final tree.lanes.tschange removed (0 pass, 1 fail) and passes with it.test/pregate-environment.test.tswas left out of the local run: its "a guard whose binary is missing" case times out at 5 s on the 4-core build machine, on main bd77c8c too (2 of 2 runs). CI runs the full suite.Agent notes
Agent notes
Refs #4586
Refs p1/specialist-batched#1
Refs p2/outside-voice#1
REVIEW_LOOP: passes=2 blocking_found=1 deferred=0 noted=4 fixed=2 scope=frozen ledgers_read=4 fix_checks=1 dispatches=6
Gate edits: none detected (2 listed, 1 read; patterns: RH-1,RH-3,RH-4,RH-12,RH-13,RH-14,RH-15,RH-16; unlisted idioms: none)
Second-model review: openai/gpt-6.1-sol, completed (one blocker, fixed under grant a-297338dfb7a8)
Scoped read of the post-review docs edit (docs/pregate.md): clean
Approved: yes (record r-e9e663370312). The full approval record stays private.
Plan: exempt: bug fix with a failing-first test (R4, R65)
Plan check: exempt bug fix
🤖 Generated with Claude Code