docs(rest): the mirrored makeRes() census states a property, not a list of three - #16528
Merged
Merged
Conversation
… of three The census in `src/http-response-test-builder.ts` named three files. Measured over this package's 187 test files, the population that matches its own stated property -- builds an `any`-typed mirror and asserts on `res.statusCode` / `res.body` -- is 76. The list was also wrong about one of the three it did name: `analytics-dataset-dimension-gate` contains no `makeRes`, because its fixture is spelled `mockRes`. Both errors have one cause: the population was enumerated by HELPER NAME, and the helper name is the one thing about this shape that varies -- only 30 of the 76 spell it `makeRes`. A hand-list keyed on it can only go stale silently, so replace it with the property, the command that derives it, and a non-zero control (18 files that DO define a `makeRes` and are correctly excluded, their double being spy-only or closure-capture with no mirror to read). The same three-name list was mirrored in `test-typecheck-debt.json`'s authored `_note`, which regeneration preserves verbatim and so would never have corrected; fix it there too. `src/rest.test.ts` holds one fixture of each kind and gets a pointer at the mirrored one, which is the fixture a reader of that file is likeliest to assume is already covered because the rest of the file now is. Comment-only; no behaviour change, no assertion converted. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YFY46JydE1gMxQG1TqBcMZ
Contributor
📓 Docs Drift Check
What this run could not see
Coarse fallback — 13 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): |
os-sales
marked this pull request as ready for review
September 7, 2026 07:43
os-sales
enabled auto-merge
September 7, 2026 07:43
os-sales
deleted the
claude/issue-15584-makeres-census-fourth-instance
branch
September 7, 2026 08:10
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 #15584
The mirrored-fixture census in
packages/rest/src/http-response-test-builder.tsnamed three files. The card reports a fourth, insiderest.test.ts. That fourth instance is real and is confirmed below — but appending it would have replaced one false roster with another.Measured against the roster's own stated property — a local
any-typed fixture that mirrorsstatus/jsonontores.statusCode/res.body, asserted on instead of the spies — the real population is 76 of this package's 187 test files.The roster was not short by one. It was short by 73, and it was independently wrong about one of the three names it did carry.
What was measured
At
a5eccf925, overpackages/rest/src/*.test.ts:makeResmakeResand are correctly excludedrest.test.tsin the census (the card's fourth instance)analytics-dataset-dimension-gate.test.tscontains the stringmakeResmockResOne command, and it is now in the docblock so a reader re-derives instead of trusting a sentence:
Extracted verbatim out of the committed file and run, it prints
76.Both errors have one cause. The population was enumerated by HELPER NAME, and the helper name is the one thing about this shape that varies — only 30 of the 76 spell it
makeRes; the rest spell itmockResor inline it. That is also why the roster's own third name failed its own stated property. A hand-list keyed on the one varying attribute can only go stale silently, so a fourth name would have inherited the defect rather than repaired it.The census had TWO carriers, not one
The same three-name list was mirrored in
packages/rest/test-typecheck-debt.json's_note. That field is authored andcheck:test-typecheck --updatepreserves it verbatim (the gate's own#12624pin asserts exactly that), so regeneration would never have corrected it. Fixing only the docblock would have left the identical false roster in place one file away. Corrected in the same edit.What this PR deliberately does NOT do
⛔ No assertion is converted, and the unchecked
route.handlercall is left unchecked. The fence from #14356's triage applies unchanged: a mirror does not satisfyIHttpResponse, and a mirror keeps only the LAST status wheremock.callskeeps every one, so swapping in the builder would change what the tests assert rather than change the fixture. That is a decision per assertion, and it stays its own card. Confirmed still true here:invoke()inrest.test.tscarries that file's onlyroute.handlercall whose enclosing binding is untyped.⛔ No new CI gate. A ratchet over 76 files, with the conversion decision still open, would be a gate with no permitted repair. What replaces the hand-list is the property, the derivation command and a non-zero control — not a new red.
Reader-facing half
rest.test.tsgets a pointer comment at the mirrored fixture. The card's argument is that this is the instance a reader of that file is likeliest to assume is already covered because the rest of the file now is; the comment says it is a mirror, points at the census, and names the untyped call site. That file usefully holds one fixture of each kind — themakeResunderdescribe('export handler')captures status in a closure and is correctly outside the census — which is the concrete reason to state a property rather than a filename.Verification
Comment-only: every changed line in the two
.tsfiles is a comment line (git diff | grep -v '^[+-]\s*\(\*\|//\)'is empty), and the only non-.tschange is one authored JSON prose string.pnpm --filter '@objectstack/rest^...' build—VERDICT command-exit 0pnpm --filter @objectstack/rest exec vitest run— Test Files 187 passed (187) · Tests 3182 passed (3182),VERDICT command-exit 0pnpm --filter @objectstack/rest typecheck—VERDICT command-exit 0;check:test-typecheck: OK — 0 file(s) / 0 error(s) / 0 pinned signature(s), and its self-test confirms the run "preserves an authored_noteverbatim"node scripts/pm/dispatch-gates.mjs --commandswith no paths — asserted against the script's own Reconciliation total of 47; the separate Artifact rosters block of 39 run alongside itScope narrowed and declared:
turbo ls --affectednames 19 packages, becausepackages/restis a dependency of many. The change cannot reach any of them:src/index.tsis untouched,http-response-test-builder.tsis not imported by the bundle entry (tsup entry issrc/index.ts), and a comment-only edit emits nothing. Local verification is therefore scoped topackages/rest; CI runs the full affected set.Changeset
skip-changeset.packages/restpublishes["dist","README.md","CHANGELOG.md"]. Two of the three changed files are test-layer and never reachdist(the builder is not imported bysrc/index.ts; the other is a.test.ts), the third is not in the published list at all, and the whole diff is comments. Nothing published changes, so there is no user-visible change to describe.验收备注
#15416holdspackages/rest/src/rest-server.tsunder a hard serial. This PR does not touch that file; the census surface and its do not intersect.Generated by Claude Code