Skip to content

Commit bf05fa7

Browse files
os-helpclaude
andauthored
fix(spec): correct HookSchema.condition @example from SQL to canonical CEL (#7235)
The @example on HookSchema.condition ("status = 'active' AND amount > 1000") was SQL where the slot is canonical CEL (ADR-0058 D1) -- it does not compile, uses bare `status`/`amount` refs instead of the `record` namespace, and contradicts the .describe() one line below, which already spells the correct form. Fixed the @example to match the .describe()'s own illustration (`record.status == 'closed' && record.amount > 1000`), picking `closed` over the issue's `active` for consistency with the .describe(). Also deletes the now-unnecessary HookSchema.condition entry from EXEMPT_EXAMPLES in packages/lint/scripts/check-doc-formula-expressions.mjs -- the gate treats an exemption sitting over a now-clean example as an error, so leaving it would go red. Cross-surface waiver for this touch: domain:spec-tooling seat, issue #7175 comment at 2026-08-10T02:03Z. Fixes #7175 Claude-Session: https://claude.ai/code/session_016R9de1FqP7NvwKvqXi92Gh Co-authored-by: Claude <noreply@anthropic.com>
1 parent 1f6ed16 commit bf05fa7

2 files changed

Lines changed: 4 additions & 17 deletions

File tree

packages/lint/scripts/check-doc-formula-expressions.mjs

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -490,22 +490,9 @@ const EXPRESSION_SLOT_TYPES =
490490
* reflow while dying with the example it excuses.
491491
*/
492492
const EXEMPT_EXAMPLES = [
493-
{
494-
file: 'packages/spec/src/data/hook.zod.ts',
495-
slot: 'HookSchema.condition',
496-
source: "status = 'active' AND amount > 1000",
497-
// NOT a partial snippet — a real defect, of exactly the #6641 class, found by
498-
// this gate's own stock pass (#6763). It is SQL where the slot is CEL, and it
499-
// contradicts the `.describe()` on the very next line, which spells the same
500-
// idea as P`record.status == "closed" && record.amount > 1000`. Bare `status`
501-
// and `amount` would resolve to nothing even after the operators were fixed.
502-
// Exempted rather than corrected only because `packages/spec/src/**` belongs
503-
// to the spec-surface seat and #6763 landed in spec-tooling; filed for
504-
// transfer as #7175. Delete this entry with that fix — leaving it behind is
505-
// itself an error (the "unnecessary" direction above), so the cleanup cannot
506-
// be forgotten silently.
507-
reason: 'REAL DEFECT pending cross-seat fix (#7175) — SQL `=`/`AND` and bare refs in a record-scoped CEL slot',
508-
},
493+
// Empty: the HookSchema.condition entry (#7175) was deleted once the example
494+
// was corrected to canonical CEL — leaving it would itself be an error (an
495+
// exemption over a now-clean example is the "unnecessary" direction above).
509496
];
510497

511498
/** `packages/spec/src/**` sources, sorted. */

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ export const HookSchema = lazySchema(() => strictObject(
233233
* If provided and evaluates to FALSE, the hook is skipped entirely.
234234
* Useful for filtering by record data without writing handler code.
235235
*
236-
* @example "status = 'active' AND amount > 1000"
236+
* @example "record.status == 'closed' && record.amount > 1000"
237237
*/
238238
condition: ExpressionInputSchema.optional().describe('Predicate (CEL); hook runs only when TRUE. e.g. P`record.status == "closed" && record.amount > 1000`'),
239239

0 commit comments

Comments
 (0)