docs(cli): stamp the vitest mock-target census, and name all three mocked workspace packages - #13936
Merged
Merged
Conversation
…cked workspace packages The `server.deps.external` COSTS paragraph told the next editor to re-check whether a package they externalise is mocked here, then named its census in the present tense: three targets, one of them a workspace package. There are eight targets over eleven sites, and three of them are workspace packages (`@objectstack/cloud-connection`, `@objectstack/platform-objects/plugin`, `@objectstack/lint`) — so the re-check's own starting point said that externalising a workspace package was free of mock conflicts. Comment-only. Stamped with the commit it was taken on, matching the convention this file adopted after #12499 and re-used by #13872's import-term section. Also records the case trap that makes a naive `vi\.(do)?mock\(` grep drop every `vi.doMock` site — a third of the census, silently. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UngCYXF98BVpYA9hfz6NYk
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-steve
marked this pull request as ready for review
August 31, 2026 17:56
os-steve
enabled auto-merge
August 31, 2026 17:56
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.
Fixes #13873
The defect
The
server.deps.externalCOSTS paragraph inpackages/cli/vitest.config.tsends bytelling the next editor that "a package added here later must be re-checked for both"
— mockability and coverage instrumentation. It then supplied that re-check's starting
point as a present-tense census: three mock targets, exactly one of them a workspace
package (
@objectstack/cloud-connection).Re-measured on
55519d5036: eight distinct targets over eleven sites, andthree of them are workspace packages. A reader doing the re-check the sentence asks
for, on the authority of the sentence itself, would conclude that externalising a
workspace package is free of mock conflicts in this package. It is not — externalising
@objectstack/lintor@objectstack/platform-objects/pluginbreaks the file that mocksit, with an error pointing at that test rather than at the config entry that caused it.
Same shape as #12529 on this very file: a document that sends the reader to the right
place and then tells them what they will find, so they do not look.
The re-measured census
Taken on
55519d5036, 2026-08-31. Elevenvi.mock/vi.doMocksites, eight targets:../utils/optional-package.js../../utils/api-client.js../../utils/schema-migrate.js../../utils/secret-reference-union.jsnode:fs/promises@objectstack/cloud-connection@objectstack/platform-objects/plugin@objectstack/lintAll three
@objectstack/*targets are declaredworkspace:*inpackages/cli/package.json— verified, not assumed.
The other half of the claim is still true, and the zero is not vacuous
The paragraph also claims
packages/clihas novi.mockof@objectstack/types— the onepackage the entry below actually externalises. That half holds, and it was checked with a
positive control rather than accepted: the same instrument does find three
@objectstack/*mock targets, and
@objectstack/typesis genuinely reachable here — ten test files import it,across both
@objectstack/typesand@objectstack/types/node— so the zero is a real zeroand not a zero over an absent dependency.
#13873 published this reproduce command:
It returns six targets, not the eight in the card's own table. The regex cannot match
vi.doMock(— capital M — so it silently drops all fourdoMocksites, which are exactlythe two targets missing from its output:
../utils/optional-package.jsand@objectstack/cloud-connection. The second of those is the only workspace package thestale parenthesis did name.
This is not an artifact of the file moving today. Re-run at
f532630d02, the commit thecard was filed on, the command still returns 6 while the card's table says 8 — so the table
was taken by some other means and the published command never reproduced it.
That is the same defect class as the paragraph being fixed, one level up, so the fix records
the correct spelling and the trap alongside the census.
Fix shape chosen: (2), the stamped census — because this file already has that convention
The card offered two shapes: drop the enumeration and give the reader the command, or keep
the census and stamp it with the commit it was taken on.
Shape (2), for three reasons:
required: the block PR test(cli): attribute the suite's import term per file, and price the trade #13872 landed 20 minutes before this work carries the stamp in its
own header —
## THE \import` TERM, ATTRIBUTED PER FILE (pnpm --filter @objectstack/cli testis a ~24-minute serialized run, and on a shared agent container it holds the verify lock for the whole of it #13504) — f532630, 2026-08-31— and the older suite-cost section carries the same idea inline (ONE STATED COMMIT —2f665a1, re-measured 2026-08-26 (
packages/cli/vitest.config.ts's suite-cost section is a 2026-08-20 measurement whose population changed under it — and it carries two inconsistent file/test vintages in adjacent sections #12499)). The new census header copies that shape exactly:## THE MOCK-TARGET CENSUS ([finding] packages/cli/vitest.config.ts says this package has three vi.mock targets — there are eight, and two more are workspace packages the same paragraph tells you to re-check #13873) — 55519d5, 2026-08-31`. No second stampingformat was invented.
is only safe once the command is right, and the obvious spelling under-reports by a third
of the census including a workspace package. The fix therefore carries the corrected
command inside the stamped section, as the instrument the stamp points at — not as a
replacement for the census.
packages/cli/vitest.config.ts's suite-cost section is a 2026-08-20 measurement whose population changed under it — and it carries two inconsistent file/test vintages in adjacent sections #12499: a datesays when someone looked, a commit says what they looked at, and only the second can be
re-checked. A stamped census that goes stale still tells the truth about what it was a
census of.
What #13872's new block contains, and whether it already covered this
It does not. #13872 added 117 lines in two pure insertions: a supersession note near the old
suite-cost header, and a new section attributing the suite's
importterm per file. Itmeasures where the import cost sits, refuses "externalise more workspace
dist/" as aspeed fix, and restates that widening
server.deps.externalkeeps its #11775 resolutionwarrant while having no speed warrant. It never touches the mock-target census — the COSTS
paragraph was only shifted down, not edited. What it did supply is the stamping shape copied
here, and the scope boundary this PR stays inside.
Scope
Comment-only.
server.deps.external's contents are unchanged, and nothing here argues thatanything should be externalised — #13504's measurement found no speed warrant, and #11775's
resolution warrant is untouched.
Verification
Comment-only, proven mechanically.
git diff -U0is 45 changed lines, of which 2 arefile headers; the count of changed lines that are not comments is 0, and the detector was
positive-controlled by feeding it an executable line (returns 1). Blob hash moved
f288aee5fde9753d69b8f8116774a2212a16bc0d->07d443b7be0dccc6532ef2494d1408dde9f9fd86.No ablation applies — nothing executable changed.
Suite shape undisturbed (the positive control this change owes, since this file decides
the whole suite's shape):
pnpm --filter @objectstack/cli exec vitest list --filesOnly— exit 0 before and after,221 files both times, and the sorted lists are byte-identical (
diffempty). The fullsuite was deliberately not re-run for a comment change; that exclusive-lock cost is precisely
what #13504 measured.
Gates — union derived by
node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack --commandson the final head
e8b3c7cbdf(change set derived by the script itself: 1 path, untracked 0):18 of 19 green by their own verdict lines. One NOT MEASURED, in the gate's own words:
node scripts/check-test-completeness.mjs— exit 3: "PREREQUISITE NOT MET — this gategrades a saved
turbo run testlog, and no log was named. … Arrived here from the gatefamily
scripts/pm/dispatch-gates.mjsderives? That list names this script with NOargument, which is this branch. There is no local log to hand it, so the local reading for
this gate is NOT MEASURED. ⛔ It is not a red, and there is nothing here to fix."
pnpm check:dual-build-cjs-loadsfirst returned the same class of non-verdict (exit 3,"PREREQUISITE NOT MET … ⛔ This is NOT a pass: nothing was measured"); it was then given
what it needed —
turbo run buildover./packages/*,./examples/*^...and./packages/*/*, both exit 0 — and re-run to a real green: "✓ check:dual-build-cjs-loads —102 published require entry point(s) across 66 package(s) load; 610 emitted CommonJS file(s)
parse."
Also run, beyond the derived union:
pnpm lint(repo-wideeslint . --no-inline-config, the always-runs tail) — exit 0, 73s.Run in full, so no narrowing needs defending.
pnpm --filter @objectstack/cli typecheck— exit 0, script name echoed (tsc --noEmit),so this is not the zero-match false green.
tsc --listFilesshowsthe program is 1317 files and
packages/cli/vitest.config.tsis not among them (0 hits,against a control file that returns 1). The measurement that does cover this file is the
vitest listcontrol above — vitest loads and evaluates this config to resolve it.Changeset:
skip-changeset, measured rather than assumed.npm pack --dry-run --jsoninpackages/cliships novitest.config*and no.test.ts;package.jsondeclaresfiles: ["dist", "README.md", "CHANGELOG.md"], so this file can never ship whatever the buildstate. A comment in a test config publishes nothing.
No
skills/**path is touched, so no published-skill line-count budget applies.Generated by Claude Code
Generated by Claude Code