Commit 429ec1e
fix(runtime): consume the caller-scope load verdict at the flow and script action doors (#16854)
* fix(runtime): consume the caller-scope load verdict at the flow and script action doors
`loadActionSubjectRecord` computes one `recordLoadDenied` verdict for every
action door, and exactly one door consumed it as a refusal — the declarative
update. The flow door and the script/body door spread it into the context as a
field and proceeded, so MCP `run_action` on a `type: 'flow'` action answered
`ok: true` and started a persisted run for a `recordId` the caller cannot read,
and identically for an id that names nothing at all.
Both remaining doors now consume the verdict on both surfaces (REST `/actions`
and the MCP `run_action` bridge) through one shared refusal,
`refuseDeniedSubjectLoad`, placed before the automation run is created and
before a trusted body is entered. The envelope is the shared not-found one
(`RECORD_NOT_FOUND`, 404), so an unreadable row and an id that names nothing
stay one answer. Record-less and new-record actions never attempt a load, so
their verdict can never be `true` and their stamp behaviour is unchanged.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015QE8qk46e5CHJxyQEUjbf8
* test(runtime): re-point the action fixtures the door refusal moved
Nine assertions across six files dispatched a row-scoped action with a
`recordId` against a double that answered every read with `[]`, so the
caller-scope subject load never delivered and the door now refuses. Four rigs
answer the by-id pre-load instead — their subject is the elevated `ctx.api`
binding, the mounted route's auth gate, handler-key addressing and flow
dispatch, none of which is the load. Two fixtures pinned the branch this card
closes and are re-pinned: a degraded engine with no `find` now fails closed on
a row-scoped call (404, never a 500) and still runs the record-less one, and
the flow route's "seeds recordId even when the record never loaded" case is
split into the refusal it now is plus the new-record invocation it conflated.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015QE8qk46e5CHJxyQEUjbf8
* test(runtime): bind the two new dispatch responses through a local, so the type-check debt ledger does not grow
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015QE8qk46e5CHJxyQEUjbf8
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 12babac commit 429ec1e
11 files changed
Lines changed: 849 additions & 96 deletions
File tree
- .changeset
- packages/runtime/src
- domains
| 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
63 | 69 | | |
64 | 70 | | |
65 | 71 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
105 | 121 | | |
106 | 122 | | |
107 | 123 | | |
| |||
247 | 263 | | |
248 | 264 | | |
249 | 265 | | |
250 | | - | |
251 | | - | |
252 | | - | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
253 | 270 | | |
254 | 271 | | |
255 | 272 | | |
256 | 273 | | |
257 | 274 | | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
258 | 290 | | |
259 | 291 | | |
260 | 292 | | |
| |||
0 commit comments