Filed unassigned by the dev seat working #8850. Observation-class: no gate is red, nothing is broken today. This records a latent reduction in check:route-envelope's coverage that #8850's own PR creates, so it is not lost.
What was measured
#8850 moves the ADR-0112 error/fault-classification prologue out of packages/rest/src/rest-server.ts into a new packages/rest/src/error-response.ts. Two of the response write sites travel with it — sendError and handleRouteError, both res.status(...).json(resolved.body).
Measured with the checker's own scanSource, on the #8850 branch head:
| file | responses | ok | err | privateOk | stringError | siblingCode |
|---|
packages/rest/src/error-response.ts (new) | 2 | 0 | 0 | 0 | 0 | 0 |
packages/rest/src/rest-server.ts (after the move) | not pinned (dialectOnly) | — | — | — | 44 | 69 |
rest-server.ts's ratchet is unmoved — 44 / 69 before and after — because every one of its dialect sites is inside the class body, and the moved prologue contained none. pnpm check:route-envelope is green on the branch. Nothing needed editing and nothing was edited.
The gap
discover() in scripts/check-route-envelope.mjs collects a file only when its basename ends in -routes.ts or appears in OFF_CONVENTION_MODULES. error-response.ts matches neither, so the new module is invisible to the audit entirely.
Before the move, a new non-conforming error dialect written next to sendError landed in rest-server.ts and was counted by the stringError / siblingCode ratchet. After the move, the same literal written in error-response.ts is counted by nothing. The counts are 0 / 0 today, which is exactly the moment the ratchet is worth pinning.
This is the cost the checker's own header names:
The convention is the discovery surface, so anything outside it is invisible until it is named here — which is not a hypothetical cost. rest-server.ts was outside for as long as this gate has existed (#7295), while being the largest response-emitting file in the repo.
Why #8850 did not fix it in place
#8850's dispatch fixed its file surface at packages/rest/src/**, with an explicit instruction to stop on breach and explain rather than widen. scripts/check-route-envelope.mjs is outside it, so the gap is reported here instead of patched under that card.
Suggested remedy
The gate's own documented onboarding path, roughly four lines:
- add
'error-response.ts' to OFF_CONVENTION_MODULES, with a one-line reason; - add
'packages/rest/src/error-response.ts': { responses: 2, ok: 0, err: 0 } to MODULES.
Worth confirming while doing it: the conformant entries in that table are all 0 / 0 / 0, so a responses: 2 entry is the first of its shape and should be read against auditModule before being assumed legal. The alternative shape is a dialectOnly entry, which would be the wrong instrument here — this module's write-site count is stable, which is precisely what dialectOnly exists to accommodate the absence of.
Refs: #8850 (the move that creates this), #7295 (why rest-server.ts is dialectOnly), #7035 (the ratchet's named end state).
Filed unassigned by the dev seat working #8850. Observation-class: no gate is red, nothing is broken today. This records a latent reduction in
check:route-envelope's coverage that #8850's own PR creates, so it is not lost.What was measured
#8850 moves the ADR-0112 error/fault-classification prologue out of
packages/rest/src/rest-server.tsinto a newpackages/rest/src/error-response.ts. Two of the response write sites travel with it —sendErrorandhandleRouteError, bothres.status(...).json(resolved.body).Measured with the checker's own
scanSource, on the #8850 branch head:packages/rest/src/error-response.ts(new)packages/rest/src/rest-server.ts(after the move)dialectOnly)rest-server.ts's ratchet is unmoved — 44 / 69 before and after — because every one of its dialect sites is inside the class body, and the moved prologue contained none.pnpm check:route-envelopeis green on the branch. Nothing needed editing and nothing was edited.The gap
discover()inscripts/check-route-envelope.mjscollects a file only when its basename ends in-routes.tsor appears inOFF_CONVENTION_MODULES.error-response.tsmatches neither, so the new module is invisible to the audit entirely.Before the move, a new non-conforming error dialect written next to
sendErrorlanded inrest-server.tsand was counted by thestringError/siblingCoderatchet. After the move, the same literal written inerror-response.tsis counted by nothing. The counts are 0 / 0 today, which is exactly the moment the ratchet is worth pinning.This is the cost the checker's own header names:
Why #8850 did not fix it in place
#8850's dispatch fixed its file surface at
packages/rest/src/**, with an explicit instruction to stop on breach and explain rather than widen.scripts/check-route-envelope.mjsis outside it, so the gap is reported here instead of patched under that card.Suggested remedy
The gate's own documented onboarding path, roughly four lines:
'error-response.ts'toOFF_CONVENTION_MODULES, with a one-line reason;'packages/rest/src/error-response.ts': { responses: 2, ok: 0, err: 0 }toMODULES.Worth confirming while doing it: the conformant entries in that table are all
0 / 0 / 0, so aresponses: 2entry is the first of its shape and should be read againstauditModulebefore being assumed legal. The alternative shape is adialectOnlyentry, which would be the wrong instrument here — this module's write-site count is stable, which is precisely whatdialectOnlyexists to accommodate the absence of.Refs: #8850 (the move that creates this), #7295 (why
rest-server.tsisdialectOnly), #7035 (the ratchet's named end state).