Skip to content

fix(lint): flag every never-firing record--prefixed trigger token, incl. record-change (#3427)#3469

Draft
os-zhuang wants to merge 1 commit into
mainfrom
claude/record-change-lifecycle-binding-kobc1m
Draft

fix(lint): flag every never-firing record--prefixed trigger token, incl. record-change (#3427)#3469
os-zhuang wants to merge 1 commit into
mainfrom
claude/record-change-lifecycle-binding-kobc1m

Conversation

@os-zhuang

Copy link
Copy Markdown
Contributor

Summary

Closes the record-change "declared ≠ enforced" trap found while building the record-after-write lint (#3467).

The engine routes any record--prefixed triggerType to the record-change trigger (triggerType.startsWith('record-')), which then maps it to ObjectQL hooks via triggerTypeToHookEvents. Tokens that don't match the firing grammar record-{before,after}-{create,insert,update,delete,write} — a typo like record-after-updated, a phase-less bare noun like record-change (which the Studio picker offered as "Record changed (any)"), or a bad phase like record-during-update — bind to the trigger but map to no hook, so the flow never fires, with only a runtime warn.

This generalizes the flow-trigger-unknown-event rule (shipped in #3467) to flag all such never-firing record--prefixed tokens at os validate time, not just the record-(before|after)-<bad-op> subset. Warning severity, unchanged.

Why trim record-change, not implement it

record-change reads as "fire on any change (create/update/delete)". I deliberately did not implement it: doing so would silently activate any previously-dead record-change flow in existing apps on upgrade — a surprising behavior change. Trimming closes the trap with no runtime behavior change and keeps the trigger grammar clean (record-<phase>-<op> + the write union). The companion objectui PR removes record-change from the Studio flow picker so it can't be authored there; this lint catches any hand-written one. (Broader multi-event unions remain tracked by #3457.)

Tests

validate-flow-trigger-readiness suite updated: record-change and record-during-update now flagged; the canonical firing tokens (incl. record-after-write) still pass; non-record triggerTypes (schedule/api/manual) untouched. Full @objectstack/lint suite green.

Changeset

@objectstack/lint: patch.

Related

#3427, #3446, #3467 (the record-after-write feature + the original lint rule), #3457 (deferred multi-event decision), and the companion objectui PR (Studio picker).


Generated by Claude Code

…`record-change` (#3427)

Generalizes the `flow-trigger-unknown-event` rule to flag any `record-`-prefixed
`triggerType` that isn't a valid firing token
(`record-{before,after}-{create,insert,update,delete,write}`), not just
`record-(before|after)-<bad-op>` typos. This closes the `record-change` trap
(the engine routes it to the record-change trigger, which maps it to no hook so
it never fires) at `os validate` time, and also covers bad-phase tokens like
`record-during-update`. Warning severity, unchanged.

Companion objectui change removes `record-change` from the Studio flow picker.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018939yJ413zG3irLzcTtqaa
@vercel

vercel Bot commented Jul 24, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
spec Ready Ready Preview, Comment Jul 24, 2026 4:39pm

Request Review

@github-actions github-actions Bot added documentation Improvements or additions to documentation tests tooling labels Jul 24, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 1 package(s): @objectstack/lint.

1 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:

  • content/docs/permissions/authorization.mdx (via @objectstack/lint)

Advisory only. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs origin/main → pass the list as args.docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/s tests tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants