Skip to content

fix(lint,cli): the flow-template-path rule reaches os lint and os compile, not just os validate (#3583, #3810) - #3874

Merged
os-zhuang merged 1 commit into
mainfrom
claude/flow-template-paths-reference-integrity-suite
Jul 28, 2026
Merged

fix(lint,cli): the flow-template-path rule reaches os lint and os compile, not just os validate (#3583, #3810)#3874
os-zhuang merged 1 commit into
mainfrom
claude/flow-template-paths-reference-integrity-suite

Conversation

@os-zhuang

Copy link
Copy Markdown
Contributor

Why

validateFlowTemplatePaths was wired by hand into os validate and nowhere else. That is precisely the drift REFERENCE_INTEGRITY_RULES exists to end (#3583 §5 D5): the same stack, checked by a different rule subset depending on which command the author happened to run.

It became a real gap after #3861 gave the rule a gating severity. A {record.<path>} token in a CRUD node's filter that names an unknown field — or hops through an un-expanded relation — makes the runtime refuse the node (#3810). os validate failed on it; os lint and os compile never looked. A CI job running either one would build and ship a flow that cannot execute.

What changed

The rule is now a suite member. It meets the suite's own stated admission criterion: a {record.<field>} token is a name written in metadata, resolved against the bound object's declared fields. One line in REFERENCE_INTEGRITY_RULES reaches all three commands, and the hand-wiring in validate.ts is deleted rather than duplicated.

The suite's doc comment now records why this member carries both severities, so the next reader doesn't assume the suite is warning-only.

Verification

Stack-shape parity, checked before moving the call site. The suite is handed three different shapes: raw config (os lint), and schema-parsed result.data (os validate / os compile) — while the rule's old call site used normalizeStackInput output. If those disagreed, the move would silently change coverage. Ran all three shapes across app-todo, app-crm and app-showcase: they agree finding-for-finding.

End-to-end on the real showcase stack:

before after
os validate / lint / compile on the clean stack pass pass (4 pre-existing traversal warnings still print, still advisory)
same, with one filter token corrupted to {record.idd} only validate exits 1 all three exit 1
  • packages/lint suite green: 515 passed, including a new suite test asserting a filter-position finding survives as error (the suite's only flow-sourced error, so it pins that both severities pass through).
  • validate.ts typecheck: 0 errors. ESLint clean on all changed files.
  • The example file corrupted for the gating test was restored; working tree contains only the three intended files.

Also fixed, in the same file

On a clean run, os validate --json never reported the reference-integrity suite's warnings. refWarnings was assembled, printed to the console, and included in the failure payload — but omitted from the success-path warnings array.

Adding this rule to the suite would have silently dropped its warnings from --json for JSON consumers, so refWarnings now appears there. That also surfaces the other five rules' warnings that were being discarded. Same shape of bug as the dropped errors #3861 fixed: computed, then thrown away.

Compatibility

No authoring change. Any stack that passes os validate today passes all three commands after this. What changes is that os lint and os compile stop accepting a flow whose filter the runtime already refuses.


Generated by Claude Code

…compile` (#3583, #3810)

`validateFlowTemplatePaths` was wired by hand into `os validate` and nowhere
else — the drift `REFERENCE_INTEGRITY_RULES` exists to end (#3583 §5 D5): one
stack, a different rule subset depending on which command the author ran.

It mattered more once #3861 gave the rule a gating severity. A `{record.<path>}`
token in a CRUD node's `filter` naming an unknown field, or hopping through an
un-expanded relation, makes the runtime REFUSE the node (#3810). `os validate`
failed on it; `os lint` and `os compile` did not look, so a CI job running
either one built and shipped a flow that cannot execute.

The rule is now a suite member — it meets the suite's own admission criterion,
since a `{record.<field>}` token is a name resolved against the bound object's
declared fields. One line reaches all three commands; the hand-wiring in
`validate.ts` is deleted rather than duplicated.

Checked the three stack shapes the suite is handed before moving the call site:
raw `config` (lint), `normalizeStackInput` output, and schema-parsed
`result.data` (validate/compile), across all three example apps. They agree
finding-for-finding, so the move does not change what is reported.

End-to-end on app-showcase: all three commands pass unchanged on the real stack,
and with one filter token corrupted to `{record.idd}` all three exit 1 — where
previously only `validate` did.

Also fixed in the same file: on a clean run `os validate --json` never reported
the suite's warnings. `refWarnings` was assembled, printed, and included in the
FAILURE payload, but omitted from the success-path `warnings` array — so adding
the rule to the suite would have silently dropped its warnings for JSON
consumers. Same bug shape as the dropped errors #3861 fixed: computed, then
discarded.

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

vercel Bot commented Jul 28, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
objectstack Ignored Ignored Jul 28, 2026 1:25pm

Request Review

@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 2 package(s): @objectstack/cli, @objectstack/lint.

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

  • content/docs/ai/skills-reference.mdx (via packages/cli)
  • content/docs/api/client-sdk.mdx (via @objectstack/cli)
  • content/docs/api/data-flow.mdx (via @objectstack/cli)
  • content/docs/api/environment-routing.mdx (via @objectstack/cli)
  • content/docs/api/error-catalog.mdx (via @objectstack/cli)
  • content/docs/automation/hook-bodies.mdx (via packages/cli, @objectstack/lint)
  • content/docs/deployment/backup-restore.mdx (via @objectstack/cli)
  • content/docs/deployment/cli.mdx (via @objectstack/cli)
  • content/docs/deployment/self-hosting.mdx (via @objectstack/cli)
  • content/docs/getting-started/your-first-project.mdx (via @objectstack/cli)
  • content/docs/kernel/runtime-services/data-service.mdx (via packages/cli)
  • content/docs/kernel/runtime-services/index.mdx (via packages/cli)
  • content/docs/permissions/authentication.mdx (via @objectstack/cli)
  • content/docs/permissions/authorization.mdx (via @objectstack/lint)
  • content/docs/plugins/packages.mdx (via @objectstack/cli)
  • content/docs/protocol/kernel/plugin-spec.mdx (via @objectstack/cli)
  • content/docs/protocol/kernel/realtime-protocol.mdx (via @objectstack/cli)
  • content/docs/releases/implementation-status.mdx (via @objectstack/cli)
  • content/docs/releases/v16.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.

@github-actions github-actions Bot added documentation Improvements or additions to documentation tests tooling size/m and removed documentation Improvements or additions to documentation tests tooling labels Jul 28, 2026
@os-zhuang
os-zhuang marked this pull request as ready for review July 28, 2026 13:37
@os-zhuang
os-zhuang merged commit fd7cfde into main Jul 28, 2026
16 checks passed
@os-zhuang
os-zhuang deleted the claude/flow-template-paths-reference-integrity-suite branch July 28, 2026 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants