Uh oh!
There was an error while loading. Please reload this page.
docs(devx): make the vitest worker-cap citation two-way - #12566
Merged
Conversation
`packages/cli/vitest.config.ts`'s maxWorkers bullet ended by saying worker allocation is "decided in `ci.yml`", naming only turbo's outer --concurrency. Since #11958 vitest's inner pool is bounded too, by a host-sized cap computed in `scripts/vitest-worker-cap.mjs`. The export sits five lines above the turbo flag in the same ci.yml run: block, so the bullet sent readers to the exact place the cap lives and told them what they would find — the one-way citation the cap script's own header depends on. The bullet's outer claim is left intact; only its scope word is repaired. The cap script's census is corrected from 40/41 to 41/42 and now carries the commit it was counted on. Comment text only in both files; no executable byte changes. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UjujZN219uFzBhSYfMykCd
Contributor
📓 Docs Drift Check
What this run could not see
Coarse fallback — 23 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): |
os-litant
marked this pull request as ready for review
August 26, 2026 11:21
Uh oh!
There was an error while loading. Please reload this page.
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 freeto 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.
Fixes#12529
Comment text only, in two files. No executable byte changes: every added and removed
line in the diff is comment text, checked mechanically rather than by eye
(
git diff -U0 | grep -E '^[+-]' | grep -vE '^(\+\+\+|---)' | grep -vE '^[+-]\s*(//|\*|/\*\*)'returns nothing). No
maxWorkers/pool/poolOptionsblock was added anywhere, the capscript's arithmetic is untouched, and
.github/workflows/**,package.jsonandturbo.jsonare not in the diff.
The defect, and why it was worse than an omission
packages/cli/vitest.config.ts'smaxWorkersbullet closed with:.github/workflows/ci.yml:575ispnpm turbo run test $FILTERS --concurrency=4 --summarize --log-order=stream— the flag that bullet paraphrases, and it is correct. Five linesabove it, in the same
run:block and under a six-line comment explaining it,.github/workflows/ci.yml:570is:So since #11958 the bullet did not merely omit vitest's inner-pool cap. It sent the reader to
the exact place that cap lives and told them what they would find there, so a reader who
followed the citation walked past line 570 on the authority of line 215. Meanwhile
scripts/vitest-worker-cap.mjs's own header namespackages/clias the repo's single mentionof pool sizing — the newer document pointing back at the older one, with nobody re-reading the
older one to check that it still held.
Both
ci.yml:570and:575were re-verified on this branch's base (52a982388) beforeanything was written; both still read as above.
What changed
packages/cli/vitest.config.ts— the bulletThe outer claim is left intact.
--concurrency=4is right, and turbo's outer fan-outreally is a property of the shard; only the scope word moved, to: That OUTER fan-out — how
many package
testtasks run at once — is a property of the shard, decided inci.yml.Rewriting the true half would have been a regression dressed as a fix.
Three paragraphs follow it: the inner pool and where its bound comes from, why the old
phrasing was durable, and one measured consequence for anyone who still wants the lever.
The cap's call sites are deliberately not enumerated there. There are five —
package.json:13,ci.yml:570,ci.yml:1150,rerun-safety-nightly.yml:98and:128,re-derived here with
git grep -n VITEST_MAX_WORKERS— and a list of call sites inside apackage config is the next thing to rot, which is the whole defect this PR repairs. The
comment states the mechanism and cites the script, which is single-source and carries its own
reasoning.
scripts/vitest-worker-cap.mjs— the census sentenceIts number only. The sentence is not hedged, weakened or made symmetric: apart from its count
it is accurate, and the new pointer travels in one direction (the CLI comment gains one).
Numbers re-derived here, not adopted
52a982388vitest.config.tsfiles in the repopackages/cli/vitest.config.ts, still a COMMENTTwo independent methods agree on 42 (
git ls-tree -r --name-only HEADandgit ls-files,both filtered on the exact basename), and the filter was reverse-checked against a term known
present in the same population rather than a substring of the term under test.
The qualitative half of the script's premise still holds, so this is a drift and not a
flip. A deliberately wider sweep than the one that produced the count
(
maxWorkers|minWorkers|poolOptions|singleThread|singleFork|maxThreads|minThreads|maxForks|minForks|fileParallelism|pool|isolate)finds only two other hits in the whole population, and neither is pool sizing:
packages/qa/dogfood/vitest.config.tssetsisolate: false, which governs module-registryreuse per file and not how many workers exist, and
packages/services/service-datasource/vitest.config.tsuses the word "pool" in prose about adatabase connection pool. So the cap is still the only inner bound.
The rot is also dated rather than assumed:
40/41was written atd18bc3277(2026-08-25 13:57Z) and was correct then — the population was 41 at that commit — and
packages/services/service-automation/vitest.config.tslanded at15249270f(2026-08-25 17:22Z), three hours later. The repaired sentence therefore carries the commit it
was counted on, and states the pair exactly once in that file, which is what its own header
(lines 35–39 / 72–80 of the sibling file) asks the next writer for.
One addition beyond the card's literal surface, flagged for review
The last of the three new paragraphs records something the card did not ask for, and it is
easy to strike if unwanted. Vitest applies
VITEST_MAX_WORKERSto the resolved config, sothe exported cap overwrites a declared
maxWorkersrather than being bounded by it — whichmeans a pin added to this file would read as taken and do nothing in exactly the runs that
matter. It is included because without it the repaired bullet leaves the opposite impression,
that a local pin would compose with the cap.
Observed on vitest 4.1.10 with a positive control, not read off the source: a real
vitest.config.tsdeclaringtest: { maxWorkers: 8 }resolves to8with the variable unsetand to
2underVITEST_MAX_WORKERS=2. The control leg is what makes the second reading mean"the env var won" instead of "the declaration was ignored generally".
Verification
Gate families derived from the real change set with
node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack(no paths passed — thescript takes the change set from the merge base itself), which matched 20 families. All 20
were run, plus
check:nul-bytes.The union below was run after the final commit, on
HEAD adb0979ddwith 0 uncommittedpaths (the runner prints its own
git rev-parse --short HEAD), throughscripts/pm/os-verify-lock.sh, which endedVERDICT command-exit 0 · held the lock 163s.Exit codes were captured before any pipe. 21 of 21 exit 0, and the verdict lines quoted
below are the gates' own, not a bare
$?:No narrowing was claimed anywhere. Repo-wide
pnpm lint(eslint . --no-inline-config,the whole tree, not the touched files) was run on the same commit and exits 0 with no
findings.
red.
check:i18nandcheck:i18n-coverageinitially exited 1 in about a second each, withPREREQUISITE NOT MET — the workspace CLI is not builtand thenCOULD NOT MEASURE — 1 of 12 config(s) failed to lint. Both gates say in their own output that nothing was checked, sothose runs are not measurements and are not reported as passes. They are green above only
after
turbo run build(71/71 tasks, exit 0) made them able to run at all — the second onehad to surface and clear two separate unbuilt packages before all 12 configs linted.
Changeset —
skip-changeset, and the rule it was measured againstMeasured rather than assumed.
pr-automation.yml'schangeset-checkjob counts.changeset/*.mdfiles added against the merge base with no path filter, so every PRneeds either a changeset or the
skip-changesetlabel; andlint.yml's own note on the labelprescribes it for a PR that "releases nothing".
This PR releases nothing, and that is a property of the files rather than a judgement:
@objectstack/clipublishes["dist","README.md","CHANGELOG.md"], sopackages/cli/vitest.config.tsships to no consumer, andscripts/vitest-worker-cap.mjsisrepo-root tooling that belongs to no package. Both edits are comment text, so no published
byte moves either way. ⇒
skip-changeset.Generated by Claude Code