Skip to content

Commit 2381c19

Browse files
qq9340100claude
andauthored
docs(spec): HookEvent 枚举注释不再声称批量写把行级谓词放在 input (#5899) (#5964)
枚举注释里「row-scoping predicate carried in `input`」与同文件 200 行外的 `HookContextSchema.input` 契约表(":340" 起,PR #5668 落地 #5273 时写下的 「NOT reachable from `input` at all」)自相矛盾。引擎从不在写路径的 HookContext.input 上放谓词,它在引擎内部 OperationContext.ast(#2982)。 改为与契约表一致的措辞,并把读者指向该表与其钉子测试 packages/objectql/src/hook-input-shape-contract.test.ts。主句(批量写触发同名 事件、没有 *Many 事件)保留。纯注释订正,未触及 .describe()、键或类型。 Claude-Session: https://claude.ai/code/session_011M7UwH25Unfi73UHim7ajY Co-authored-by: Claude <noreply@anthropic.com>
1 parent 07f1822 commit 2381c19

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

packages/spec/src/data/hook.zod.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,16 @@ export const HookEvent = z.enum([
134134

135135
// Write — before/after per mutation kind. These fire on BOTH single-id and
136136
// bulk (`multi: true`) writes: a bulk update/delete runs the SAME
137-
// `beforeUpdate`/`beforeDelete`/`afterUpdate`/`afterDelete` with the
138-
// row-scoping predicate carried in `input` (there is no per-cardinality
139-
// `*Many` event — one write event covers one row or many, Salesforce's
140-
// bulk-first model). See #3195.
137+
// `beforeUpdate`/`beforeDelete`/`afterUpdate`/`afterDelete` (there is no
138+
// per-cardinality `*Many` event — one write event covers one row or many,
139+
// Salesforce's bulk-first model). The row-scoping predicate is NOT reachable
140+
// from `input` on those write events: it lives on the engine-internal
141+
// `OperationContext.ast` (#2982) so that the filters middleware composes onto
142+
// it, where no handler can widen it — scope a bulk batch through
143+
// `options.where` at the CALLER, or work per row on the `after*` events. Full
144+
// per-event shapes in the `HookContextSchema.input` contract table below,
145+
// pinned against the real engine by
146+
// `packages/objectql/src/hook-input-shape-contract.test.ts`. See #3195.
141147
'beforeInsert', 'afterInsert',
142148
'beforeUpdate', 'afterUpdate',
143149
'beforeDelete', 'afterDelete',

0 commit comments

Comments
 (0)