Repository navigation
Commit 8e9abd9
test(runtime): route-ledger conformance checks that every route the dispatcher plugin mounts has a ledger row (#26565)
<!-- claude-projects-attribution: {"github_login":"os-project-manager"}
-->
_Requested by **Leehom** · [project
thread](https://claude.ai/code/project/chan_01TenzsRopZj4jMbvjX8uz1X?thread=cmsg_01TenzsRopZj4jMbvjX8uz1XFTvndcbx3e4rrGbDvfcLXh)_
Fixes #26513
## What changes
`packages/runtime/src/route-ledger.conformance.test.ts` gains a
per-route arm: **every route `dispatcher-plugin.ts` mounts on its host
`IHttpServer` must have a `ROUTE_LEDGER` row.** The mounted side is
recorded, never typed: the plugin's own `start()` runs against a
recording server (the same technique as
`automation-api-contract-mounts.test.ts`), and the recorded `VERB /path`
list is the population. No count is written anywhere.
- **Composition.** One start, in the plugin's widest composition, so as
few mounts as possible go unobserved: no REST plugin on the kernel (the
plugin keeps `/discovery`; it cedes that route when REST is present), a
serveable `analytics` service (the capability-conditional `/analytics`
routes mount), and `scoping.enableProjectScoping: true` under the
default `projectResolution: 'auto'` (every environment-scoped twin
mounts beside its unscoped route). The other compositions are strict
subsets. A vacuity test asserts the boot actually reached those three
branches.
- **Matching.** An exact `VERB /api/v1/pattern` row, or a `* /prefix/**`
family row whose base the mount sits at or under. That is the same
reading the live-mount parity gate gives a wildcard row. A scoped twin
answers to its unscoped row, because the plugin mounts it by calling the
same registrar with the scoped base and `dispatch()` strips the scope
before routing.
- **Not exercised:** routes a service emits at runtime on the
`ai:routes` hook. They are dynamic by construction, and the `* /ai/**`
family row speaks for them. The plugin's own `/ai/*` mounts are
recorded.
- **Why this enumeration.** It is the cheapest complete one: it needs no
booted server and no production listing method, and it observes every
registration the plugin makes. The measured mount table is 124 routes.
No `@objectstack/runtime` code changes; this PR adds no listing method.
- **#17041 references.** The three dead `#17041` pointers (the
`route-ledger.ts` census header, this suite's header,
`scripts/check-route-ledger-census.mjs`) are re-pointed to #26513, and
each says what the new arm does and does not cover. **#17041's open
question is left as it is**: whether the ledger should be checked per
route *beyond what the plugin mounts* stays an open maintainer question,
now tracked at #26513.
- **`check-route-ledger-census` stays.** Whether it retires is #26431's
call, after this lands. It is still the only per-row guard for the rows
the arm cannot see (next section).
- The `route-ledger.ts` top header said this suite fails "when an entry
claims a client method that does not exist". That direction lives in the
client package's guards, so the sentence now says so.
## Why
Deleting a single mid-ledger row left this suite green. Only the
hand-kept row count noticed, and that count is the transcription-pin
shape #26431 retires.
## What the arm guards, measured
Per-row ablation over the recorded mount table: **71 of 105 rows** now
red this suite when deleted. The other 34 cannot, because they have no
mount of their own spelling:
- routes only `dispatch()` answers behind a catch-all host (the hono
adapter's `app.all(prefix/*)`): every `/meta` and `/data` row,
`/share-links`, `/security/suggested-bindings`, `/ui/view`;
- doors a plugin serves from the raw app on a self-hosted kernel:
`/approvals/act`, `/webhooks/redeliver`,
`/automation/hooks/:flowName/:hookId`;
- the two `servedBy` specializations: `POST /actions/global/:action`,
`POST /actions/_activation/:object/:action`;
- family rows (`* /auth/**`, `* /apps/**`, `* /share-links/**`) and `GET
/mcp/skill`, which `* /mcp/**` absorbs.
1 parent 71a4b4e commit 8e9abd9
3 files changed
Lines changed: 152 additions & 27 deletions
File tree
- packages/runtime/src
- scripts
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
23 | | - | |
| 22 | + | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
29 | | - | |
| 28 | + | |
| 29 | + | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
42 | 51 | | |
43 | 52 | | |
44 | 53 | | |
45 | | - | |
| 54 | + | |
46 | 55 | | |
| 56 | + | |
47 | 57 | | |
48 | 58 | | |
49 | 59 | | |
| |||
93 | 103 | | |
94 | 104 | | |
95 | 105 | | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
96 | 209 | | |
97 | 210 | | |
98 | 211 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | | - | |
14 | | - | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
295 | 296 | | |
296 | 297 | | |
297 | 298 | | |
298 | | - | |
299 | | - | |
300 | | - | |
301 | | - | |
302 | | - | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
303 | 309 | | |
304 | 310 | | |
305 | 311 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
36 | 39 | | |
37 | 40 | | |
38 | 41 | | |
| |||
51 | 54 | | |
52 | 55 | | |
53 | 56 | | |
54 | | - | |
| 57 | + | |
55 | 58 | | |
56 | 59 | | |
57 | 60 | | |
58 | 61 | | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
65 | 71 | | |
66 | 72 | | |
67 | 73 | | |
| |||
0 commit comments