Commit 3b4834e
committed
test(client): close the route audit's reverse direction — every SDK URL must match a route some surface mounts (#3642)
The capstone of the #3563 audit. The dispatcher (#3563), REST (#3587) and
service-mount (#3636) ledgers all run server → client: enumerate what a
surface mounts, demand a reviewed disposition, and for `sdk` rows demand
the named client method exists. None asked the reverse question — does
the URL the client BUILDS match anything a server MOUNTS? — so a method
could name a real function, carry a green ledger row, and 404 everywhere.
That shipped four times, found one at a time by hand: analytics.explain
and analytics.meta (#3584), meta.getView (#3611), and i18n.getTranslations
/ getFieldLabels (#3636) — the last pair having carried green `sdk` rows
since tranche 1.
client-url-conformance.test.ts drives every method on a real client with
a recording fetch and matches each captured URL against the UNION of all
four ledgers (a union, not an intersection — a route mounted by one
surface is still reachable). A real drive rather than a hand-written
"method X targets route Y" table: such a table is an assertion ABOUT the
code that the code can drift away from, which is the very failure being
fixed. Mutation-checked — re-injecting the #3636 dialect bug fails the
suite.
The sweep's own completeness is asserted, because that is the part that
rots silently:
- every method is driven or declared NON_HTTP with a reason, so a new
SDK method cannot escape coverage;
- a driven method emitting ZERO requests fails — stale placeholder args
are exactly how a sweep stops covering anything while staying green;
- a URL containing undefined / [object Object] fails, so a placeholder
that is accepted but wrong cannot masquerade as coverage;
- the __api-endpoint `(unmatched)` catch-all is excluded from the
pattern set, since treating it as a pattern would match every URL and
make the suite vacuous.
196 of ~219 methods matched. Two bounds are reported rather than papered
over: /api/v1/cloud/* (23 projects.* methods) is served by the sibling
cloud repo — this repo's dispatcher explicitly refuses those paths — so
it is exempt by prefix and bounded from both ends, with a non-projects
method reaching it failing the suite (#3655); and 60 of ~196 matched
calls rest only on a `**` prefix claim rather than a resolvable route, 54
of them on `* /auth/**`, a count the guard ratchets so it can only shrink
(#3656).
No runtime change: a guard, plus the ledger-header and audit-doc notes
recording what it does and does not cover.
Refs #3642, #3563, #3587, #3636.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K35y3ovfWtCkBHYFCqUfAt1 parent f1a8114 commit 3b4834e
4 files changed
Lines changed: 466 additions & 7 deletions
File tree
- .changeset
- docs/audits
- packages
- client/src
- runtime/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
195 | 195 | | |
196 | 196 | | |
197 | 197 | | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
202 | 239 | | |
203 | 240 | | |
204 | 241 | | |
| |||
211 | 248 | | |
212 | 249 | | |
213 | 250 | | |
214 | | - | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
215 | 254 | | |
216 | 255 | | |
217 | 256 | | |
0 commit comments