|
| 1 | +--- |
| 2 | +"@objectstack/runtime": major |
| 3 | +--- |
| 4 | + |
| 5 | +feat(runtime)!: action params are enforced by default, and the opt-in is gone (#3438, ADR-0104 D2) |
| 6 | + |
| 7 | +A request bag that violates an action's declared `params[]` — a missing |
| 8 | +`required` param, a value outside its `options`, a scalar where `multiple` |
| 9 | +declares an array, a non-id where a `reference` declares one, or a key the |
| 10 | +action never declared — is now **rejected before the handler runs**: |
| 11 | +`400 VALIDATION_FAILED` on REST, a thrown error on MCP. It used to be logged |
| 12 | +and passed through. |
| 13 | + |
| 14 | +```diff |
| 15 | +- OS_ACTION_PARAMS_STRICT_ENABLED=1 # removed — enforcement is the default |
| 16 | ++ OS_ALLOW_LAX_ACTION_PARAMS=1 # escape hatch: warn and pass, as before |
| 17 | +``` |
| 18 | + |
| 19 | +**What breaks.** Only calls that were *already* wrong. The declaration was a |
| 20 | +complete contract that informed nothing but the client dialog, so a bag the |
| 21 | +server accepted could still have been silently ignored by the handler — which |
| 22 | +is exactly how a correctly-intended `reference: 'sys_user'` degraded into a |
| 23 | +paste-a-UUID box (#3405) with a success envelope on top. Those calls now fail |
| 24 | +loudly instead of quietly. Actions declaring no `params` are untouched, and the |
| 25 | +dispatcher's own `recordId` / `objectName` are allowlisted |
| 26 | +(`ACTION_PARAM_BUILTIN_KEYS`), so the keys dispatch itself merges in were never |
| 27 | +candidates for the unknown-key error. |
| 28 | + |
| 29 | +**Fixing a rejection** takes one edit at the call site: the message names the |
| 30 | +offending param and the declared list. If an integration you cannot reach in |
| 31 | +time is affected, set `OS_ALLOW_LAX_ACTION_PARAMS=1` to restore the old |
| 32 | +pass-through — the violation still logs once per action, so the drift stays |
| 33 | +visible rather than becoming invisible again. |
| 34 | + |
| 35 | +**Why 17.0 rather than a warn window in 17 and the flip in 18.** R3 asked for |
| 36 | +warn-then-error, and ADR-0104's 2026-07-30 addendum declined it on the merits |
| 37 | +rather than postponing. What a violation strands is a **caller**, not data: the |
| 38 | +rejection reaches a developer or an agent who can fix it in one edit, no stored |
| 39 | +row is made unwritable, and the escape hatch makes it reversible in a restart. |
| 40 | +Deferring that by a major would have charged every deployment a second upgrade |
| 41 | +ceremony — 16→17 is already a substantial, tested migration — to postpone a |
| 42 | +break that costs one edited call. v17 already carries harsher zero-window |
| 43 | +flips (`allowExport` unset now means denied; an undeclared action handler 404s |
| 44 | +with no opt-out at all), so holding the milder change to a stricter standard |
| 45 | +would have been inconsistent rather than cautious. |
| 46 | + |
| 47 | +For AI and MCP callers specifically — the population D2 was built for — a 400 |
| 48 | +is corrective feedback consumed in-loop, while a server-side warning is |
| 49 | +feedback nobody ever reads. |
| 50 | + |
| 51 | +D1's value-shape half went the opposite way for the opposite reason: it rejects |
| 52 | +on the basis of **stored data**, which an author cannot edit their way out of, |
| 53 | +so it stays gated per deployment on that deployment's own migration evidence. |
0 commit comments