Filed unassigned and ungraded by the dev seat implementing #14356, session session_01D47qPfEWVPmhguWgBZCi5N, from PR #15582. Observation class: no runtime consequence, nothing regressed, nothing here blocks anything. Severity not judged.
A dedup search over this repo found no card for it; the only hit for the dedup query was #14503, which is about the packages read routes and is unrelated — it is also the control that shows the search was answering rather than returning an empty read.
What was measured
#14356 and its triage both name three files in packages/rest that build a response through a local makeRes() typed any and assert on a mirrored res.statusCode / res.body that the helper maintains off status / json:
packages/rest/src/analytics-dataset-dimension-gate.test.ts
packages/rest/src/meta-public-book-grant.test.ts
packages/rest/src/rest-batch-size-cap.test.ts
There is a fourth, and it is inside packages/rest/src/rest.test.ts — the very file #14356 is about. Measured on the merge base of PR #15582:
packages/rest/src/rest.test.ts, describe('RestServer - object API exposure (apiEnabled / apiMethods)')
function makeRes() {
const res: any = { statusCode: 200, body: undefined };
res.status = vi.fn((c: number) => { res.statusCode = c; return res; });
res.json = vi.fn((b: any) => { res.body = b; return res; });
res.setHeader = vi.fn(); res.write = vi.fn(); res.end = vi.fn();
return res;
}
async function invoke(rest: any, method: string, path: string, params: any, body?: any) {
const route = rest.getRoutes().find((r: any) => r.method === method && r.path === path);
if (!route) throw new Error(...);
const res = makeRes();
await route.handler({ method, params, query: {}, body: body ?? {} }, res);
return res;
}
Its assertions read the mirror, not the spies: expect(res.statusCode).toBe(404) and expect(res.body.code).toBe('OBJECT_API_DISABLED').
Two things follow, and they are separable.
1. The census that named three files is short by at least one, and the miss is structural. The three were found per file, by the file's own local makeRes. This one is a makeRes in a file that already had 26 other response fixtures of a completely different shape, so it does not read as "a makeRes file" at a glance. There are around 45 makeRes helpers in the package; the narrow claim worth carrying is the one about mirrors, and enumerating those has so far been done by hand.
2. After PR #15582, this is the ONE remaining unchecked route.handler call in rest.test.ts. That PR types the enclosing binding at the seven sites #14356 is about, so route.handler checks both arguments at each of them. It deliberately does not touch this one: invoke(rest: any, ...) keeps the call unchecked, and typing it would red the response for the same reason as the other three files — a makeRes mirror does not satisfy IHttpResponse, and swapping in src/http-response-test-builder.ts would change what the tests assert rather than change the fixture, because a mirror keeps only the LAST status where mock.calls keeps every one. That is exactly the fence #14356's triage put around the other three, and it applies here unchanged.
Why this is a card and not a note
Whoever eventually takes "convert the mirrored makeRes fixtures" — the card #14356's triage says that is its own card, with its own reading of each assertion — will work from the list of three. This one is not on it, it is in a different file from the other three, and it is the one that a reader of rest.test.ts is most likely to assume is already covered because the rest of that file now is.
Re-check
cd packages/rest
grep -n 'function makeRes' src/rest.test.ts
grep -n 'statusCode' src/rest.test.ts | head
grep -c 'await route.handler' src/rest.test.ts # 1 on PR #15582's head, and it is this one
Refs
Nothing here is measured as regressing, and the tests involved pass today.
Generated by Claude Code
Filed unassigned and ungraded by the dev seat implementing #14356, session
session_01D47qPfEWVPmhguWgBZCi5N, from PR #15582. Observation class: no runtime consequence, nothing regressed, nothing here blocks anything. Severity not judged.A dedup search over this repo found no card for it; the only hit for the dedup query was #14503, which is about the packages read routes and is unrelated — it is also the control that shows the search was answering rather than returning an empty read.
What was measured
#14356 and its triage both name three files in
packages/restthat build a response through a localmakeRes()typedanyand assert on a mirroredres.statusCode/res.bodythat the helper maintains offstatus/json:packages/rest/src/analytics-dataset-dimension-gate.test.tspackages/rest/src/meta-public-book-grant.test.tspackages/rest/src/rest-batch-size-cap.test.tsThere is a fourth, and it is inside
packages/rest/src/rest.test.ts— the very file #14356 is about. Measured on the merge base of PR #15582:Its assertions read the mirror, not the spies:
expect(res.statusCode).toBe(404)andexpect(res.body.code).toBe('OBJECT_API_DISABLED').Two things follow, and they are separable.
1. The census that named three files is short by at least one, and the miss is structural. The three were found per file, by the file's own local
makeRes. This one is amakeResin a file that already had 26 other response fixtures of a completely different shape, so it does not read as "amakeResfile" at a glance. There are around 45makeReshelpers in the package; the narrow claim worth carrying is the one about mirrors, and enumerating those has so far been done by hand.2. After PR #15582, this is the ONE remaining unchecked
route.handlercall inrest.test.ts. That PR types the enclosing binding at the seven sites #14356 is about, soroute.handlerchecks both arguments at each of them. It deliberately does not touch this one:invoke(rest: any, ...)keeps the call unchecked, and typing it would red the response for the same reason as the other three files — amakeResmirror does not satisfyIHttpResponse, and swapping insrc/http-response-test-builder.tswould change what the tests assert rather than change the fixture, because a mirror keeps only the LAST status wheremock.callskeeps every one. That is exactly the fence #14356's triage put around the other three, and it applies here unchanged.Why this is a card and not a note
Whoever eventually takes "convert the mirrored
makeResfixtures" — the card #14356's triage says that is its own card, with its own reading of each assertion — will work from the list of three. This one is not on it, it is in a different file from the other three, and it is the one that a reader ofrest.test.tsis most likely to assume is already covered because the rest of that file now is.Re-check
Refs
IHttpResponseliterals in packages/rest are green because nothing checks them — and 5 of them for a different reason than #13454 recorded #14356 — the card this was found from; its body names the three mirrored files.IHttpResponseliterals — they were masked by the request literals, not absent #13454 —src/http-response-test-builder.tsand the argument stated once: one record, not two.Nothing here is measured as regressing, and the tests involved pass today.
Generated by Claude Code