Repository navigation
feat(cli): lint the record-change date-equality time anti-pattern at build (#1874) - #1918
Merged
Merged
Conversation
…build (#1874) The templates are AI-authored, so the highest-leverage fix for the "time-relative rule never fires" class is a build-time guardrail that catches the exact mistake, not a new trigger primitive (the robust cron+range pattern already exists). `objectstack build` now emits an advisory WARNING when a `record-*` flow's start condition compares a date field for EQUALITY against a time function (`end_date == daysFromNow(60)`, `today() != ...`) — valid CEL, but it only fires if the record is written on that exact day, so unattended "N days before" rules never run. The warning steers the author to a daily SCHEDULE trigger + range query. Range operators (>=/<=) and non-time equality are NOT flagged; the lint never fails the build (guides, doesn't break legal metadata). New `lint-flow-patterns.ts` + 7 unit tests (flag equality both sides / Expression envelope; do-not-flag range / non-time / schedule trigger). Wired into compile.ts as advisory warnings (mirrors widget-binding warnings). CLI suite 383. Refs #1874 (the declarative time-relative trigger feature + the cross-repo template fixes remain separate; this is the AI-authoring guardrail). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
📓 Docs Drift CheckThis PR changes 1 package(s): 15 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:
|
This was referenced Jun 15, 2026
Merged
os-zhuang
added a commit
that referenced
this pull request
Jun 23, 2026
fix(ai-chat): route AI-built apps by packageId, not the app name (ADR-0048) (#1918) objectui@aa50dc07f55ba8328f5858695678b9f4c67c81f4
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #1874.
Framing: this targets the core problem, not the literal feature
The templates are AI-authored, and preventing AI authoring mistakes is the project's core goal. The robust capability for time-relative rules already exists (daily SCHEDULE trigger + range query), so the high-leverage fix for "renewal_alert never fires" is not a new trigger primitive — it's a build-time guardrail that catches the exact mistake the author (AI or human) keeps making, in the same "make silently-wrong metadata loud at build" vein as #1877 / #1870 / #1876.
What it does
objectstack buildnow emits an advisory WARNING when arecord-*flow's start condition compares a date field for EQUALITY against a time function:…and points the author at the robust shape: a daily schedule trigger + a range query (
get_recordwhereend_dateBETWEEN{TODAY()}and{TODAY()+N}).Precision (low false-positive by design)
==/!=) adjacent todaysFromNow/daysAgo/today/now/date/datetime, either side, onrecord-*triggers; string or Expression-envelope conditions.>=/<=— the correct building block), non-time-field equality, or schedule-trigger conditions.Tests
New
lint-flow-patterns.ts+ 7 unit tests (both equality forms, envelope condition; range/non-time/schedule false-positive guards).@objectstack/clisuite 383 pass; example builds clean (no spurious warnings).Scope note
This does not implement #1874's declarative time-relative trigger (a future DX feature needing real API design — multi-threshold windows, per-record fan-out, indexed queries for scale, Studio authoring), nor the cross-repo template fixes. It's the AI-authoring guardrail, which is the part that pays off now.
🤖 Generated with Claude Code