Skip to content

fly lexicon: semantic lint rules (regions, guest sizing, mounts↔volumes, no secret literals) #742

Closed

Description

@lex00

Epic: #736 · Phase: 2 (breadth) · Depends on: #737, #738 · Blocks: nothing

Reviewed 2026-07-11. The region list is now available two ways: the
generated types from #737, and — for a live check in tests — mudflaps
serves GET /v1/platform/regions (a representative Fly region list).

Context

Semantic lint rules for the Fly lexicon so obvious mistakes fail at chant build, not at apply.
Mirror the gcp/aws lexicon rule catalogs. See #736 for the decisions log.

What to build (starter rule set)

  • Valid region — machine region must be a known Fly region. Validate against the region
    list generated in fly lexicon: scaffold chant-lexicon-fly (chant init lexicon + OpenAPI generate) #737 (or GET /v1/platform/regions, which mudflaps serves for tests).
  • Sane guest sizing — cpu_kind (shared/performance), cpu count, and memory_mb must be
    a valid combination per Fly's guest presets.
  • Mount references a declared volume — every machine mounts[].volume must resolve to a
    Volume in the stack (cross-file rule).
  • No secret literals — flag secret values written inline in config; they belong in secrets
    (apply-only, D7) or a reference.

Wire via lintRules() / declarativeRules() on the plugin. Give each rule a stable ID/catalog
entry; follow the audit-rule-metadata direction in #687. Tier 1 completeness (#737's
chant dev check-lexicon) requires ≥1 lint rule, so this is also what clears that gate.

Where it lives

lexicons/fly/src/lint/rules/ (mirror lexicons/gcp/src/lint/rules/); register on the plugin
from #737.

References

Acceptance criteria

  • An invalid region fails the build with a clear message + rule ID.
  • A mount pointing at an undeclared volume fails the build.
  • An inline secret literal is flagged.

Out of scope

Live/audit rules needing external resolution (a later WorkflowAuditOp-style concern).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions