Repository navigation
Run the working-tree snapshot test alone, after every other test file - #146
Merged
Merged
Conversation
The release Verify step on d906bda went red in test/conformance/working-tree-is-clean.test.ts: its "before" git status held .cosyte-usage-stdout/ and its "after" one did not. That directory is written and removed by the README usage case in test/docs-content.test.ts, which Vitest ran in parallel with the snapshot. Two more files write into the tree for a moment the same way: the tsup build docs-content spawns (tsup.config.bundled_<hash>.mjs) and the phi-scan override-gate case (phi-scan-overrides.md). Earlier Release runs passed on the same test, so this was a race, not a regression. vitest.config.ts now splits the suite into two projects. The snapshot file has its own project with a later sequence.groupOrder, so it starts only after the rest of the suite has finished; every other file still runs in parallel. The assertion is unchanged. The include globs move onto the first project because extends: true concatenates include arrays. Measured: a probe test that holds a transient path in the repo root until the conformance run starts reproduces the CI failure on main and never overlaps the run with this change. In a full run the snapshot file starts 1.3 s after the last other file ends; 43 files, 1369 passed, 1 skipped, as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.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.
Why main is red
The Release workflow's Verify step on
d906bda(run 37705238602) failed intest/conformance/working-tree-is-clean.test.ts:That test compares
git statusof the real working tree before and after a conformance run. The.cosyte-usage-stdout/directory belongs to a different file: the README usage case intest/docs-content.test.tswrites it and removes it inafterAll. Vitest runs test files in parallel, so the "before" snapshot saw the directory and the "after" one did not. Two more files write into the tree briefly in the same way: thetsupbuild that docs-content spawns (tsup.config.bundled_<hash>.mjsat the root) and the phi-scan override-gate case (it appends to the trackedphi-scan-overrides.md, then restores it). The Release runs befored906bdapassed on the same test, so this is a race, not a regression.The fix
vitest.config.tsnow has two projects:suite: every test file except the snapshot test,sequence.groupOrder: 0, still in parallel.working-tree: onlytest/conformance/working-tree-is-clean.test.ts,sequence.groupOrder: 1. Vitest starts this group only after the first group has finished, so nothing else writes to the tree while the snapshot is taken.The assertion is unchanged, and no test is skipped, deleted or loosened. The include globs move onto the first project because
extends: trueconcatenatesincludearrays. Set at the root, they pulled the whole suite into the second project, and a first draft of this change caught that.documentation/agent-notes.mdgets a short paragraph in the AC-9 section that points at the config.No changeset: nothing under
src/changes, and no published surface moves.Verification
mainit fails AC-9 with the same shape as CI. With this change the probe never overlaps the run, and AC-9 passes.pnpm typecheck,lint,test,build,attw, all green. Also green:test:coverage(all directory gates),format:check,check:no-emdash,check:no-internal-refs,check:agent-notes,phi-scan.Harness-Task: 1
🤖 Generated with Claude Code