Repository navigation
test(vitest): one shared root preset for the 18 identical package configs (#26092 part 2) - #26267
Conversation
…disarm The 18 byte-identical package vitest configs re-export vitest.preset.mts at the repo root, which carries disableConsoleIntercept: true and its rationale once. check-console-intercept-disarm judges a bare re-export of the root preset by the preset's own source, so the gate stays and still reds every re-exporter by name if the preset loses the setting. turbo's test task takes the preset as an input so an edit to it reruns the suites. Claude-Session: https://claude.ai/code/session_01EaorEqkvnJBed5uX9BjSUG Co-authored-by: Claude <noreply@anthropic.com>
vitest.preset.mts (arriving with the vitest half of the base split) is a test input outside every package; list it in the core filter beside the two tsconfig bases so a diff confined to it still runs Test Core. Claude-Session: https://claude.ai/code/session_01EaorEqkvnJBed5uX9BjSUG Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift Check
What this run could not see
Coarse fallback — 40 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): |
席位核对 · ACCEPT · devx seat 2 · 2026-10-26T18:05ZSeat
Generated by Claude Code |
Requested by Steve · project thread
Fixes #26092
This is PR 2 of 2, the vitest half. PR 1, the tsconfig half, was #26203 and is merged.
Clause-②: no
Metadata-protocol: none
What changes
vitest.preset.mts(new, repo root) holds the one setting the 18 byte-identical package configs carried,test.disableConsoleIntercept: true, with its rationale once. It is a plain object, notdefineConfig(...): the root package declares no vitest dependency, so importingvitest/configthere resolves only through pnpm hoisting and adds a TS2307 to the root program (root DEBT measured 26 to 27 with the import, 26 without).0d3c266a...) become a copyright line, one comment line andexport { default } from 'REL/vitest.preset.mts';.scripts/check-console-intercept-disarm.mjs. The card's premise that the gate "reads the effective config; it goes green by construction" does not hold: the gate greps each config's comment- and literal-masked source for the setting, and with the preset alone it went red on all 18 (measured by the handoff thread). The gate is kept and learns one narrow shape: a package-root config whose only statement is a bare re-export of the rootvitest.preset.mtsis judged by the preset's source, with the same disarm, re-arm and projects checks, and the finding names the re-export. A config that imports the preset and wraps or merges it is not recognised and must still carry the setting itself. Five self-test cases added (battery floor 11 to 16).turbo.json: thetesttask'sinputsgain$TURBO_ROOT$/vitest.preset.mts, so an edit to the preset re-runs the re-exporting suites instead of replaying cache.scripts/check-cross-package-test-inputs.mjs:TURBO_ROOT_FILE_INPUTSgainsvitest.preset.mts(its self-test pins the set of repo-root files turbo.json declares as inputs and went red on the new input without it)..github/workflows/ci.yml: thecorefilter listsvitest.preset.mtsbeside the two tsconfig bases, so a diff confined to the preset still starts Test Core.node scripts/check-ci-filter-parity.mjsand its--self-testboth exit 0 with the line (it is not judged a leftover).Verification (head c382986, on main 81bba6c)
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackderived 107 commands on this head; all 107 ran, each exit captured before any pipe: 107 exit 0.--ranreconciliation (record carries every exit code): 107 derived, 107 run, 0 NOT-MEASURED, 0 UNRUN. Prerequisites first: clone unshallowed, every non-ui package built (76/76 tasks).node scripts/check-console-intercept-disarm.mjs --self-test:self-test OK: 15 cases + real-tree population floor(the five new cases among them); the scan:OK: 77 vitest-running package(s), every one disarms console interception at the package root.node scripts/check-ci-filter-parity.mjsand--self-test: exit 0.turbo run test --forceover all 18 re-exporting packages: 81/81 turbo tasks successful (dependency builds included); all 301 test files passed (driver-turso: 95 files, 34 tests skipped by its own environment guards). The same 18 also passed with this patch on maindf8aac41f2before the rebase. The suites were not re-run without the patch: every one passes with it, so none moved from pass to fail.md5sum ... | sort | uniq -c) counts whole lines, hash plus path, so it prints 1 for any tree. Counting hashes only (awk '{print $1}'beforesort | uniq -c), the top count is 13: identical copies of the one-line preset re-export, which the card allows. The other 5 re-exporters differ only in the relative depth. The remaining duplicate pairs predate this card (thecreate-objectstackblank template'ssrc/distcopy;knowledge-memory/knowledge-ragflow).disableConsoleIntercept: truereds the gate on all 18 re-exporters (exit 1); restored (hash-checked), exit 0.Landing
Tier H:
.github/workflows/ci.ymlis a governed surface. This PR stays a draft until a GOVERNED_APPROVERS approval; the owning seat lands it after that.No changeset (
skip-changeset): the diff touches package vitest configs, a root config file,turbo.json,ci.ymland repo-internal gate scripts; no package'sfiles[]ships a vitest config.Acceptance notes
vitest.config.tslets a stale@objectstack/coredist decide its verdicts — #7668 fixed one, nothing stops the next #7849 (a package with tests and no vitest config tests a stale dist): the preset makes the fix a one-line config. A package with unit tests and novitest.config.tslets a stale@objectstack/coredist decide its verdicts — #7668 fixed one, nothing stops the next #7849 remains open; this PR does not address it.check-console-intercept-disarm.mjsstill reads "its comment-masked source must set..."; the preset route is documented at the new constant only. A one-sentence header update could follow.维护者速读(草稿)
vitest.preset.mts(只含disableConsoleIntercept: true);对应门禁学会认这种转出;turbo 测试输入和 ci.yml 的 core 过滤各加一行预设文件。.github/workflows/ci.yml,需要你批准(APPROVED review)后席位才能入队。Generated by Claude Code