Validate project invariants declared in flow.toml.
This command checks the [invariants] section and reports violations in changed code.
# Check all local changes vs HEAD
f invariants
# Check only staged changes
f invariants --stagedforbidden: disallowed patterns in added diff lines.deps.approved: unapproved dependencies inpackage.jsonsections (dependencies,devDependencies,peerDependencies).files.max_lines: changed files exceeding the configured line limit.
Set in flow.toml:
mode = "off": disable checks.mode = "warn": print findings, exit success.mode = "block": fail command when blocking findings exist.
[invariants]
mode = "block"
architecture_style = "layered monorepo, event-driven core"
non_negotiable = [
"no inline imports",
"no any types unless justified",
]
forbidden = [
"git add -A",
"git reset --hard",
]
[invariants.terminology]
"pi-ai" = "LLM abstraction layer"
"pi-agent" = "stateful agent runtime"
[invariants.deps]
policy = "approval_required"
approved = ["@sinclair/typebox", "@reatom/core"]
[invariants.files]
max_lines = 300f commit runs the invariant gate during commit-with-check flow.
- In
mode = "block", commits are blocked on invariant warnings/critical findings. - Invariant context and findings are injected into AI review prompts.