Skip to content

docs(agents): show the targeted-vitest spelling and refuse the bare separator - #11425

Merged
os-steve merged 1 commit into
mainfrom
claude/issue-10166-targeted-test-spelling
Aug 24, 2026
Merged

docs(agents): show the targeted-vitest spelling and refuse the bare separator#11425
os-steve merged 1 commit into
mainfrom
claude/issue-10166-targeted-test-spelling

Conversation

@os-steve

@os-steveos-steve commented Aug 23, 2026

Copy link
Copy Markdown
Collaborator

Part of #10166 — this lands triage's parts (1) and (2). It deliberately does not land the PreToolUse hook (A) or the os-verify-lock.sh refusal line (B) that the 2026-08-21 PM ruling adopted; triage's 2026-08-22 re-scope excluded tooling from this card, so those remain unimplemented and the card stays open for them.

⚠️ Governed surface — do not queue

Both files are governed (.claude/**, AGENTS.md). This PR stays draft and waits for a human merge: no ready flip, no auto-merge, no merge queue.

The defect

os-dev.md rule 3 named pnpm --filter <pkg>, vitest --maxWorkers=2 and turbo --concurrency=2without ever showing how they join. A gap that forces an invention is worse than a wrong statement, because every reader invents the same wrong thing — and npm semantics supply --.

Measured, on @objectstack/types (13 test files, test script is exactly vitest run)

spellingresult
pnpm --filter <pkg> test -- --maxWorkers=2 src/keyset-walk.test.tsbanner echoes vitest run -- --maxWorkers=2 … · 13 files / 362 tests · exit 0
whole suite, no pattern at all13 files / 362 tests — byte-identical to the "targeted" run above
pnpm --filter <pkg> test --maxWorkers=2 src/keyset-walk.test.ts1 file / 12 tests / 285ms
pnpm --filter <pkg> exec vitest run --maxWorkers=2 src/keyset-walk.test.ts1 file / 12 tests / 399ms
pnpm exec vitest run src/keyset-walk.test.ts from the package cwd1 file / 12 tests / 269ms
pnpm exec vitest run -- src/keyset-walk.test.ts (stray --, no package script)13 files / 362 tests

The last row matters: the exec route our own docs recommend is swallowed identically. Nothing about avoiding the package script protects you — the separator does.

The card's unverified half: --maxWorkers=2 was swallowed too

Probed against the exact parser (vitest 4.1.10 → cac 7.0.0, resolved from vitest's own tree; the earlier note on the card said 6.7.14):

["run","--maxWorkers=2","src/keyset-walk.test.ts"] options.maxWorkers = 2 args = ["src/keyset-walk.test.ts"] options['--'] = []
["run","--","--maxWorkers=2","src/keyset-walk.test.ts"] options.maxWorkers = undefined args = [] options['--'] = ["--maxWorkers=2","src/keyset-walk.test.ts"]

Both directions confirmed in vitest itself: an unknown flag before the separator throws CACError: Unknown option `--thisFlagDoesNotExist` (exit 1); the same flag after it exits 0 with no error, and a --filesOnly sitting after it is ignored as well (362 test lines listed instead of a file list).

Every run that used the -- spelling had no worker cap. The concurrency discipline was inert in the same breath as the file filter.

Net-zero, because both homes are at zero-headroom ratchets

check:pm-skill-ratchet sets each ceiling at the landed line count: os-dev.md 405/405, AGENTS.md 961/961. Raising a ceiling requires a maintainer ruling quoted in the PR, and this PR has none — so the fix is a rewrite, not an addition (os-dev.md stays at exactly 405, AGENTS.md at 961). That also follows the ratchet header's own instruction: "provenance is one line, stories live on cards, not in operational text." The measurements above therefore live here and on the card, not in the agent definition.

A first draft added a full Toolchain traps entry with the mechanism (+13 lines) and was rejected by the ratchet. The landed rule carries the spelling and the refusal; the mechanism stays on the card.

Why this spelling and not the one triage named

Triage named pnpm exec vitest run <file> "from the right cwd". Verified — it works (row 5). The rule documents pnpm --filter <pkg> exec vitest run --maxWorkers=2 <file> instead, because it is the strict superset: it needs no cd, and agent bash calls in this container reset cwd between invocations, so a cwd-dependent spelling would reintroduce exactly the form-scoping defect this card is about. Both were measured; the more robust one is documented.

Scope

Gates

All 12 families derived by node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack (no path arguments) green at 685883f. Repo-wide pnpm lint is CI's: both changed files report isPathIgnored: true from eslint's own flat config (2 files submitted, 0 linted, 0 rule results), so no untouched file's verdict can move.

Generated by Claude Code


Generated by Claude Code

…eparator
`os-dev.md` rule 3 named `pnpm --filter <pkg>`, `--maxWorkers=2` and
`--concurrency=2` without ever showing how they join, so every reader had to
invent the join and npm semantics supplied `--`. Measured: the separator makes
vitest discard the file pattern AND `--maxWorkers`, the whole package suite
runs, and it exits 0 — a false green that reads as the narrow run that was
asked for.
Rule 3 now carries the literal working command and refuses the separator.
`AGENTS.md`'s dev-server parenthetical ("flags after `--` are forwarded") is
re-scoped, since what pnpm forwards is the separator itself.
Both files sit at zero-headroom line ratchets, so this is a net-zero rewrite:
the measurements stay on the card, per the ratchet's own rule that stories live
on cards and not in operational text.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015ahemw8RcTgqtxrj15PEZx
@claudeclaudeBot added the skip-changeset PR has no user-facing published change; bypasses the changeset gate label Aug 23, 2026
@github-actionsgithub-actionsBot added the documentation Improvements or additions to documentation label Aug 23, 2026
@os-steve
os-steve marked this pull request as ready for review August 24, 2026 09:52
@os-steve
os-steve added this pull request to the merge queueAug 24, 2026
Merged via the queue into main with commit bde3072Aug 24, 2026
28 of 30 checks passed
@os-steve
os-steve deleted the claude/issue-10166-targeted-test-spelling branch August 24, 2026 10:01
os-steve added a commit that referenced this pull request Aug 24, 2026
…mmands
`pnpm --filter <pkg> test` with its arguments after a bare separator runs the
WHOLE package suite. pnpm forwards the separator verbatim into the child argv
and vitest's cac parser then discards everything after it, options and
positionals alike, in silence — the file pattern and `--maxWorkers` die
together, the suite passes, and it reads exactly like the narrow run that was
asked for.
#11425 landed the corrected spelling in the instruction files. That is
discipline; this is the mechanical half. Both mechanism layers were re-measured
on this tree rather than recalled, each with a control: pnpm and npx forward the
separator, npm and turbo strip it, and vitest 4.1.10 turns `CACError: Unknown
option` (exit 1) into no output at all (exit 0) when the same flag moves behind
the separator.
The violating population is EMPTY today, so the gate is built to say that out
loud rather than print a bare "0 violations": it reports how many separators it
JUDGED (6 on this tree), refuses a tree whose roots, corpus or workspace
derivation went blind, and carries its non-vacuity in `--self-test`, which
drives this same sweep RED over a temp tree on disk.
Five of those six judged separators are forms a naive bare-`--` selector would
have RED and every one is correct as written — this workflow's own turbo dogfood
shard and the three documented `pnpm dev -- --fresh` spellings — so the rule is
vitest-BOUND, with the vitest-backed script names derived from the workspace
instead of typed in.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015ahemw8RcTgqtxrj15PEZx
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentationImprovements or additions to documentationsize/xsskip-changesetPR has no user-facing published change; bypasses the changeset gate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@os-steve@claude