feat(cli): lint wrong flow-value interpolation syntax (double-brace / bare $ref) (#1315)#1920
Merged
Conversation
… bare $ref) (#1315) Second AI-authoring guardrail in lintFlowPatterns (after #1874). Flow node VALUES interpolate with SINGLE braces; AI/human authors carry over two wrong syntaxes from the formula template dialect / other platforms: - `{{ai_reply}}` double-brace — verified no flow node executor uses `{{ }}`, so it's unambiguously wrong in a flow value (it's the formula/template-field dialect). Warn → use `{var}`. - bare `$source.id` — a `$`-prefixed reference written as a literal (not interpolated). Warn → wrap as `{source.id}` / `{$User.Id}`. Precise/low-false-positive: braced `{$User.Id}` and currency `$5.00` are NOT flagged (the `$`-rule requires a letter after `$` and a non-`{` lead char); CEL condition/expression keys are skipped (not template values); advisory only, never fails the build. +6 unit tests; CLI suite 396; example-crm/app-todo/ showcase build with zero spurious warnings. Refs #1315 (closed — semantics were consistent; this is the build-time safety net that catches the wrong-syntax mistakes from its repro). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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:
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Second AI-authoring guardrail in
lintFlowPatterns(after #1874/#1918), serving the project's core goal: catch the mistakes AI authors keep making, at build time.What it catches
Flow node values interpolate with single braces (
{var}/{record.id}/{$User.Id}). Two wrong syntaxes authors carry over (straight from #1315's repro):body: '{{ai_reply}}'{{ }}flow-double-brace-interpolationticket: '$source.id'$ref.fieldis a literal, not interpolatedflow-bare-dollar-referenceBoth warnings name the fix (
{var}/{source.id}).Precision (verified zero false-positives on real metadata)
{record.title}, braced{$User.Id}, currency literals ($5.00/Total $5— the$-rule requires a letter after$and a non-{lead char), and CELcondition/expressionkeys (skipped — they're predicates, not templates).@objectstack/clisuite 396 pass;example-crm/app-todo/showcasebuild with 0 spurious warnings.Context
#1315 is closed (the framework's flow-value semantics are already consistent — single-brace
interpolate()); this is the build-time safety net that catches the wrong-syntax mistakes from its repro, instead of letting them silently produce[object Object]/ literal$source.idat runtime.🤖 Generated with Claude Code