Commit 9b459b7
fix(rest): compile the data doors' protocol requests against the declared contract (#16071)
* fix(rest): compile the data doors' request literals against the declared protocol contract
The DELETE and PATCH data handlers dispatched through `p.deleteData({…} as any)` /
`p.updateData({…} as any)`, which erased TypeScript's check of the assembled request
against `DeleteDataRequest` / `UpdateDataRequest`. A sweep found the same erasure in
two forms across 22 protocol-dispatch sites in this file, not two.
The casts were load-bearing, as filed: `environmentId` and `context` are passed at
these call sites and are members of no data request schema. Neither belongs in one:
`environmentId` is the transport routing key already ruled out of the protocol request
shape (2026-08-18, #9741), and `context` is the SERVER-DERIVED execution context whose
caller-supplied form is a privilege escalation the ingress deletes unconditionally. So
both are declared on a typed envelope beside the ruled `TransportScopedMetaRequest`,
and every other member of every literal is now compiled against the spec contract.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D47qPfEWVPmhguWgBZCi5N
* test(rest): record the execctx census mention move, and add the changeset
The `ServerScopedDataRequest` doc-comment names `resolveExecCtx` to say where its
`context` member comes from, which moves the census's prose-mention control from 98
to 99. The invocation-site control is UNCHANGED at 77 — no consumer was added, moved
or removed — which is the split that census exists to keep visible, and the entry
records it in the block's house style.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D47qPfEWVPmhguWgBZCi5N
* docs(permissions): re-anchor the system-context census citations after the line shift
Pure line rot, applied with the gate's own `--fix`: the typed-envelope declaration and
its imports sit near the top of `rest-server.ts`, so every `isSystem` citation below
them moved by a constant +86. No prose, no row and no verdict changed — only the
`file:line` anchors. `check-system-context-census` was verified GREEN at the merge base
first, so this is a shift this branch caused rather than one it inherited.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D47qPfEWVPmhguWgBZCi5N
* docs(permissions): restore the sharing-rule-service anchors the merge reverted
1 parent 64011dd commit 9b459b7
4 files changed
Lines changed: 191 additions & 52 deletions
File tree
- .changeset
- content/docs/permissions
- packages/rest/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
| 67 | + | |
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
106 | | - | |
| 106 | + | |
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
| |||
158 | 158 | | |
159 | 159 | | |
160 | 160 | | |
161 | | - | |
| 161 | + | |
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
| |||
199 | 199 | | |
200 | 200 | | |
201 | 201 | | |
202 | | - | |
| 202 | + | |
203 | 203 | | |
204 | 204 | | |
205 | 205 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
309 | 309 | | |
310 | 310 | | |
311 | 311 | | |
312 | | - | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
313 | 328 | | |
314 | 329 | | |
315 | 330 | | |
| |||
378 | 393 | | |
379 | 394 | | |
380 | 395 | | |
381 | | - | |
| 396 | + | |
382 | 397 | | |
383 | 398 | | |
384 | 399 | | |
| |||
0 commit comments