|
82 | 82 | * |
83 | 83 | * - **a record trigger** — the start node's `config.objectName` (the trigger |
84 | 84 | * object a record-change run's row belongs to) names an undeclared object; |
| 85 | + * - **a record trigger that names no object** — the trigger kind is |
| 86 | + * `record_change` and the start node names no `config.objectName`: the |
| 87 | + * record-change trigger then registers its hook with no object filter |
| 88 | + * (`record-change-trigger.ts`), so it fires on a write to ANY object, one the |
| 89 | + * stack does not declare included, and hands that row; |
85 | 90 | * - **a time-relative sweep** — the start node's `config.timeRelative.object` |
86 | 91 | * (`TimeRelativeTriggerSchema`; its own key, independent of `objectName`, and |
87 | 92 | * the object whose rows the sweep hands each run) is undeclared; |
|
130 | 135 | * its `context.record`. A parent's own `record` VARIABLE is not handed on — |
131 | 136 | * the child gets the parent's context, not its variables. Read to a fixpoint. |
132 | 137 | * |
133 | | - * ## The runtime publish gate stands down (#22636 is the carrier) |
| 138 | + * ## The runtime publish gate stands down, by design |
134 | 139 | * |
135 | 140 | * The same pass runs at the runtime publish gate on a flow write, and there the |
136 | 141 | * per-write snapshot carries the written flow alone beside `objects` / |
|
139 | 144 | * `map` node could hand this flow any record. A false 422 on the only door a |
140 | 145 | * Studio tenant has is worse than the gap, so this one judgment stands down there |
141 | 146 | * ({@link perWriteSnapshotEntrance}); every other expression verdict at that door |
142 | | - * is unchanged, and `objectstack validate` judges under the rule above. #22636 |
143 | | - * widens that snapshot to carry flows and actions; when it lands, this |
144 | | - * stand-down goes. |
| 147 | + * is unchanged, and `objectstack validate` judges under the rule above. |
| 148 | + * |
| 149 | + * ⛔ Not a hold-out awaiting a wider snapshot. Who launches a flow and what |
| 150 | + * record it is handed are read from OTHER items of the stack, so this is a |
| 151 | + * whole-stack judgment, and it belongs to `objectstack validate` (ADR-0109 |
| 152 | + * Decision §3's boundary); the runtime publish gate judges the written item |
| 153 | + * against the four collections it carries. The snapshot stays as it is: ruling |
| 154 | + * `5791822697` on #19527 (item 3: `RuntimeStackContext` / `CONTEXT_STACK_KEYS` |
| 155 | + * are unchanged, because every gated write pays for what they carry), held for |
| 156 | + * this judgment by ruling `6104584601` on #22636 (letter B). |
145 | 157 | */ |
146 | 158 |
|
147 | 159 | import { firstUndeclaredReference, parseCelToAst, SCOPE_ROOTS } from '@objectstack/formula'; |
@@ -380,6 +392,10 @@ export function flowCelEntrances( |
380 | 392 | if (triggerObject && undeclared(triggerObject)) { |
381 | 393 | open(name, `its trigger object '${triggerObject}' (start config.objectName) is not declared in this stack, so the record's keys are not in hand`); |
382 | 394 | } |
| 395 | + if (kind === 'record_change' && !triggerObject) { |
| 396 | + // No object filter on the hook: any object's write fires it and hands its row. |
| 397 | + open(name, `its record trigger '${String(config.triggerType)}' names no object (start config.objectName), so it fires on a write to any object and the record's keys are not in hand`); |
| 398 | + } |
383 | 399 | const sweep = config.timeRelative && typeof config.timeRelative === 'object' ? (config.timeRelative as AnyRec) : undefined; |
384 | 400 | const sweepObject = sweep ? nameOf(sweep.object) : undefined; |
385 | 401 | if (sweepObject && undeclared(sweepObject)) { |
@@ -466,7 +482,9 @@ export function flowCelEntrances( |
466 | 482 | /** |
467 | 483 | * The runtime publish gate's entrance: none visible. Its per-write snapshot |
468 | 484 | * carries the written flow alone (module note), so this one judgment stands down |
469 | | - * there until #22636 widens the snapshot. |
| 485 | + * there, by design: it is a whole-stack judgment, `objectstack validate`'s, and |
| 486 | + * the snapshot is not widened for it (rulings `5791822697` item 3 and |
| 487 | + * `6104584601`, module note). |
470 | 488 | */ |
471 | 489 | export function perWriteSnapshotEntrance(): FlowCelEntrance { |
472 | 490 | return { |
|
0 commit comments