Repository navigation
Description
Epic: #736 · Phase: 0 · Depends on: nothing · Blocks: #738, #739, #741, #742, #743
Reviewed 2026-07-11 for cold-handoff. chant has a first-class scaffolder
(chant init lexicon) and ageneratePipeline/check-lexiconworkflow — use
those, don't hand-mirror another lexicon. The local-test target (mudflaps)
now exists and is built from the same OpenAPI spec this issue generates from.
Context
First issue of the Fly apply-path epic (#736 — read it for the decisions log). Stand up the
@intentius/chant-lexicon-fly package and generate typed Machines-API models so every later
issue builds on real types. The generated types are the shared vocabulary for #738 (resources),
#739 (flyApply), and #742 (lint).
Decisions that constrain this (from #736)
- D4 — TypeScript, in
lexicons/fly, package@intentius/chant-lexicon-fly. - D6 — types generated from the OpenAPI 3.0.1 spec
https://docs.machines.dev/spec/openapi3.json, cross-checked againstsuperfly/fly-go.
What to build
-
Scaffold with the built-in command (do NOT hand-copy another lexicon):
chant init lexicon fly # → lexicons/fly, package @intentius/chant-lexicon-fly cd lexicons/fly && npm install
This generates a compilable
LexiconPluginwith all four required lifecycle methods
(generate/validate/coverage/package) plusserializer,codegen/,spec/,lsp/
stubs,package.json,tsconfig, ajustfile, and tests. It mirrors the AWS lexicon.
Derived names: pluginflyPlugin, serializerflySerializer, rule prefixFLY.
Ref:chant init lexicon,
Scaffold a Lexicon. -
Point
src/spec/fetch.tsat the OpenAPI spec — fetch (with cache)
https://docs.machines.dev/spec/openapi3.json. (Swagger copy:/swagger/doc.json.) -
Write
src/spec/parse.ts— an OpenAPI-3 parser producing oneParsedResultper
Machines-API schema (Machine, MachineConfig, App, Volume, …). This is the bulk of the work.ParsedResultcontract + thegeneratePipelinecallbacks (fetchSchemas,parseSchema,
createNaming,generateRegistry,generateTypes,generateRuntimeIndex) are documented in
Implement Generate.- Peer to mirror:
lexicons/aws/src/spec/parse.ts+lexicons/aws/src/codegen/generate.ts
(aws parses the CloudFormation spec; fly parses OpenAPI — sameParsedResultcontract, different
input format). NOTE:lexicons/gcpparses Config Connector CRDs, so it is not the parser
peer, only a structural reference.
-
Generate + verify field fidelity:
chant dev generate # → src/generated/{index.ts,index.d.ts,lexicon.json}Cross-check generated field names against
superfly/fly-gomachine_types.go/
volume_types.go(instance_id,metadata, state constants) — these are the exact JSON tags
mudflapsmirrors, so a mismatch here would break both the applier and the emulator target. -
Wire it in: add
"fly"to the consuming project'schant.config.ts
lexicons: [...](that is how a lexicon is loaded — resolution is by short name to the
@intentius/chant-lexicon-flypackage, not a central registry), then
chant dev onboard flyto wire CI / Docker smoke / npm publish.
Where it lives
lexicons/fly/{package.json,tsconfig.json,justfile}, lexicons/fly/src/{index.ts,plugin.ts,serializer.ts},
lexicons/fly/src/spec/{fetch.ts,parse.ts}, lexicons/fly/src/codegen/{generate.ts,package.ts,naming.ts},
lexicons/fly/src/generated/ (output). The scaffolder creates this layout.
References
- Authoring: Scaffold,
Generate,
Completeness Checklist. LexiconPlugininterface:packages/core/src/lexicon.ts(the 4 required methods).- Parser/pipeline peer:
lexicons/aws/src/{spec/parse.ts,codegen/generate.ts}. Structure peer:lexicons/gcp. - Oracle:
github.com/superfly/fly-go(machine_types.go,volume_types.go). Spec:https://docs.machines.dev/spec/openapi3.json. - Local-test target (already built):
github.com/INTENTIUS/mudflaps— a stateful flaps
emulator (v0.3.0, public imageghcr.io/intentius/mudflaps) generated from the same OpenAPI
spec. fly lexicon: chant-side flaps wrapper (boot the mudflaps image for local tests) #740 now only tracks the chant-sideflapsUp/Downwrapper, not the emulator itself.
Acceptance criteria
-
chant init lexicon flyscaffolds andlexicons/flycompiles. -
chant dev generateproduces committed Machine/App/Volume types insrc/generated/from
openapi3.json, with field names matchingsuperfly/fly-go. - A project with
lexicons: ["fly"]inchant.config.tsloads it;chant listresolves the lexicon. -
chant dev check-lexicon lexicons/flypasses Tier 1 (required checks).
Out of scope
Resource authoring (#738), the flyApply applier (#739), lint rules (#742). The emulator itself
(#740) already exists as mudflaps; only its chant-side wrapper remains.
Activity
[-]fly lexicon: chant-lexicon-fly package + LexiconPlugin skeleton (types from Machines API OpenAPI)[/-][+]fly lexicon: scaffold chant-lexicon-fly (chant init lexicon + OpenAPI generate)[/+]fly lexicon: scaffold chant-lexicon-fly + flaps wrapper (#737 groundw…
fly: complete OpenAPI-driven generator for Core-3 resources (#737) (#750
lex00 commentedon Jul 11, 2026
Complete OpenAPI-driven generator landed — #750 (merged).
Rather than clone the aws/CFN generator, this is modeled on k8s, because the Fly Machines OpenAPI spec has no resource marker (136 schemas, ~62 RPC DTOs + config fragments + macaroon/token plumbing). So it's a curated generator: spec-driven shapes, human-curated resource selection.
Core-3 resources generated:
Fly::Machines::{App,Machine,Volume}— writable props from eachCreate*Request, read-only attributes from the response schema, and thefly.MachineConfigref-graph walked into 35 typed property-type classes soMachine.configis fully typed (Machines-JSON-shaped — settles the fly.toml-vs-Machines-JSON question in favor of mirroring the wire API, the k8s precedent).npm run generate→ 3 resources + 35 property types;types-compile, 10 package tests, and check-lexicon Tier 1 all pass.Remaining under this epic:
flyApplyover these resources (FLY_API_TOKEN auth).fly: App + Machine serializer emitting flaps create bodies (#738) (#751)
lex00 commentedon Jul 11, 2026
Scaffold + complete OpenAPI generator landed (#750). generate → 41 curated resources (App/Machine/Volume/IPAddress/Certificate/Secret) + property-type graph, all spec-driven. Serializer (#738/#751), applier (#739/#753), and breadth (#741/#754) all merged on top.