Skip to content

os validate runs none of the flow authoring lints, so a build-failing flow passes validate #3782

Description

@os-zhuang

Found while making flow-runas-unscoped blocking in #3760.

lintFlowPatterns has exactly one call site — packages/cli/src/commands/compile.ts:411. os build inherits it (build.ts extends Compile), but os validate does not run it at all.

That was tolerable while every flow-lint finding was advisory. Since #3760 one of them (flow-runas-unscoped) fails the build, so the surfaces now disagree:

os validate → clean
os build → fails

os validate is documented as the read-only superset of os build's gates (see the comment at validate.ts:566, which says the security-posture check is "the same gate `os compile`/`os build`" runs), so this is a real "validate says OK, build fails" trap — worst for CI setups that gate on validate.

Fix: run lintFlowPatterns in validate.ts alongside the other 3x gates, failing on severity: 'error' and printing the rest as warnings — mirroring what compile.ts now does.

Why it wasn't done in #3760: wiring the lint into validate surfaces all its rules there for the first time, including the advisory ones, which is a behavior change for existing projects beyond that PR's scope.

Refs #3760, #1874.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions