Skip to content

feat(cli): lint wrong flow-value interpolation syntax (double-brace / bare $ref) (#1315)#1920

Merged
os-zhuang merged 1 commit into
mainfrom
feat/interp-syntax-lint
Jun 15, 2026
Merged

feat(cli): lint wrong flow-value interpolation syntax (double-brace / bare $ref) (#1315)#1920
os-zhuang merged 1 commit into
mainfrom
feat/interp-syntax-lint

Conversation

@os-zhuang

Copy link
Copy Markdown
Contributor

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):

Author wrote Reality Lint
body: '{{ai_reply}}' double-brace is the formula/template-field dialect, not flow values — verified no flow node executor uses {{ }} flow-double-brace-interpolation
ticket: '$source.id' a bare $ref.field is a literal, not interpolated flow-bare-dollar-reference

Both warnings name the fix ({var} / {source.id}).

Precision (verified zero false-positives on real metadata)

  • Not flagged: correct single-brace {record.title}, braced {$User.Id}, currency literals ($5.00 / Total $5 — the $-rule requires a letter after $ and a non-{ lead char), and CEL condition/expression keys (skipped — they're predicates, not templates).
  • Never fails the build — advisory only.
  • @objectstack/cli suite 396 pass; example-crm / app-todo / showcase build 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.id at runtime.

🤖 Generated with Claude Code

… 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>
@github-actions github-actions Bot added documentation Improvements or additions to documentation tests tooling size/m labels Jun 15, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

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

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

  • content/docs/concepts/cloud-artifact-api.mdx (via packages/cli)
  • content/docs/concepts/implementation-status.mdx (via @objectstack/cli)
  • content/docs/concepts/packages.mdx (via @objectstack/cli)
  • content/docs/getting-started/cli.mdx (via @objectstack/cli)
  • content/docs/getting-started/quick-start.mdx (via @objectstack/cli)
  • content/docs/guides/authentication.mdx (via @objectstack/cli)
  • content/docs/guides/client-sdk.mdx (via @objectstack/cli)
  • content/docs/guides/hook-bodies.mdx (via packages/cli)
  • content/docs/guides/packages.mdx (via @objectstack/cli)
  • content/docs/guides/project-scoping.mdx (via @objectstack/cli)
  • content/docs/guides/runtime-services/data-service.mdx (via packages/cli)
  • content/docs/guides/runtime-services/index.mdx (via packages/cli)
  • content/docs/guides/skills.mdx (via packages/cli)
  • content/docs/protocol/objectos/plugin-spec.mdx (via @objectstack/cli)
  • content/docs/protocol/objectos/realtime-protocol.mdx (via @objectstack/cli)

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.

@vercel

vercel Bot commented Jun 15, 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 Jun 15, 2026 3:21pm

Request Review

@os-zhuang
os-zhuang merged commit 266c0f8 into main Jun 15, 2026
14 checks passed
@os-zhuang
os-zhuang deleted the feat/interp-syntax-lint branch June 15, 2026 15:22
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/m tests tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant