Skip to content

Commit 55e7cec

Browse files
os-zhuangclaude
andauthored
docs(skills): an unevaluable hook condition aborts the write (#4775) (#4883)
skills/objectstack-data/references/data-hooks.md had been updated for #4770 and #4784 but still closed with the pre-17 failure mode — an undeclared key leaves the condition "logged at WARN and treated as false". #4775 replaced that: an unevaluable condition now aborts the operation. This is the AI-authoring reference for hooks, so the stale sentence pointed the wrong way on the axis that matters — it told an author a typo is a soft failure, and it downgraded the two bullets above it (previous is unbound on inserts and multi:true writes; has() is not a null guard) from "this breaks your write" to "this quietly disables your hook". Swept the rest of skills/ and .claude/skills/ against the same rc.2 window; nothing else was stale. Docs-only; releases nothing. Claude-Session: https://claude.ai/code/session_01AaegKY1Y7GqTb8CKMm5GLC Co-authored-by: Claude <noreply@anthropic.com>
1 parent d51bed2 commit 55e7cec

2 files changed

Lines changed: 46 additions & 2 deletions

File tree

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
---
3+
4+
Docs-only: the `objectstack-data` skill's hook reference taught the pre-17
5+
failure mode for an unevaluable `condition`.
6+
7+
`skills/objectstack-data/references/data-hooks.md` had been updated for #4770
8+
(the condition reads the record, not the payload) and #4784 (`previous` is
9+
bound), but its closing bullet still said an undeclared key leaves the condition
10+
"logged at WARN and treated as false" — the behaviour #4775 replaced. An
11+
unevaluable condition now **aborts the operation**.
12+
13+
This is the AI-authoring reference for hooks, so the stale sentence pointed the
14+
wrong way on the one axis that matters: it told an author a typo is a soft
15+
failure. It also silently downgraded the two bullets above it — `previous` is
16+
unbound on inserts and on `multi: true` writes, and `has()` is not a null guard —
17+
from "this breaks your write" to "this quietly disables your hook".
18+
19+
Replaced with a callout carrying the #4775 rule and the reason the two outcomes
20+
had to split (a `before*` guard swallowed into `false` lets writes through; an
21+
audit hook swallowed into `false` drops records — opposite failures), plus the
22+
practical authoring consequence.
23+
24+
Swept the rest of `skills/` and `.claude/skills/` against the same rc.2 window;
25+
nothing else was stale. `objectstack-automation` already documents #4343's
26+
`script`-node retirements, `objectstack-query` already carries the #4286
27+
`cursor` / `joins` / `windowFunctions` prescriptions, and
28+
`objectstack-formula` already documents #4649 fail-closed predicates and #4763's
29+
build-time `has()` rejection.
30+
31+
Releases nothing.

skills/objectstack-data/references/data-hooks.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,8 +260,21 @@ in neither). So:
260260
`has(record.spent) && record.spent > record.budget` still faults on
261261
`null > null`. `has()` answers "is this key declared at all", which is a
262262
question about your spelling, not about your data.
263-
- An **undeclared** key (a typo) stays unevaluable: the condition is logged at
264-
WARN and treated as false.
263+
264+
⚠️ **An unevaluable condition ABORTS the operation (#4775).** A typo'd key
265+
(`record.stauts`), a `previous` reference on an insert, or a comparison CEL has
266+
no overload for does **not** degrade to "the hook did not fire" — it **fails the
267+
write**. Until protocol 17 the gate emitted a `logger.warn` and returned `false`,
268+
which is why the two bullets above are load-bearing rather than stylistic: a
269+
`before*` guard swallowed into `false` silently let writes through, and an audit
270+
hook swallowed into `false` silently dropped records. Those are opposite
271+
failures, so "the condition said no" and "the platform could not work out what
272+
the condition says" are now different outcomes and the second one is loud.
273+
274+
Practical consequence when authoring: spell keys against the object's **declared**
275+
fields, and never reach for `previous` in a hook that can fire on insert or on a
276+
`multi: true` write — that mistake used to cost you a hook that quietly never
277+
ran, and now costs you every write the hook is attached to.
265278

266279
#### `onError` — Error Handling
267280

0 commit comments

Comments
 (0)