Repository navigation
Commit a900841
fix(rest): /discovery no longer contradicts itself — services.*.route follows the mounted paths (#17399)
* fix(rest): mirror the mounted paths onto discovery's `services.*.route`
`/discovery` states each service address twice — `routes.X` and
`services.Y.route` — and the REST discovery handler rewrote only the first
half to the paths this server mounts. A deployment that moved a prefix got a
document that contradicted itself, with the `services` half addressing a path
nothing is mounted on.
The `services` half is now written as a projection of the finished `routes`
map, key by key, so the two cannot state different answers whatever a future
substitution does to `routes`. Three guards keep a default deployment
byte-identical: only a slot the producer emitted, only one that already
declares a route, and only from a route key that survived the pass.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DapQyvYrFb1MxSYe7BL2nt
* test(rest): reduce the #9292 per-request pin past the mount projection
`discovery-per-request-protocol.test.ts` compares the served document's
`services` map against the raw `getDiscovery()` of the environment's own
protocol, to prove `/discovery` follows the REQUEST's kernel. Mirroring the
mounted paths onto `services.*.route` adds a handler overlay to that value:
on a scoped request `services.data.route` now reads
`/api/v1/environments/tenant-a/data`, which the producer — who cannot see a
mount — will never say.
`substance()` already reduces `capabilities` to its `enabled` bits for exactly
this reason ("those overlays are a different contract with its own pins"). The
same reduction now applies to the route VALUE, keeping the kernel-determined
fact the pin is about: whether the slot advertises an address at all. The
overlay itself is pinned next door in
`discovery-services-route-follows-mount.test.ts`, against `routes.X` in the
same served document.
⛔ Nothing is skipped, disabled or quarantined: all four `toEqual` /
`not.toEqual` halves still run, and the negative halves still separate the
three protocols.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DapQyvYrFb1MxSYe7BL2nt
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 93447bb commit a900841
4 files changed
Lines changed: 489 additions & 1 deletion
File tree
- .changeset
- packages/rest/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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
122 | 135 | | |
123 | 136 | | |
124 | 137 | | |
125 | 138 | | |
126 | 139 | | |
127 | 140 | | |
128 | 141 | | |
129 | | - | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
130 | 149 | | |
131 | 150 | | |
132 | 151 | | |
| |||
0 commit comments