Repository navigation
Description
Epic: #736 · Phase: 1 (spine) · Depends on: #737 · Blocks: #739, #744
Reviewed 2026-07-11. Resources compose the generated types from #737
(the OpenAPI-generatedMachine/App/Volumeclasses), not hand-rolled
shapes. The serializer's output can be validated end-to-end by POSTing it to
themudflapsemulator (#740), which accepts the real create bodies.
Context
Typed App and Machine resources + the serializer that turns them into flaps request
bodies. This is the minimal resource set #739 (applier) and #744 (example) reconcile. See #736
for the decisions log. Structure peer: lexicons/gcp (resource classes + serializer); but the
resource types come from #737's generated output, not hand-written.
Decisions that constrain this (from #736)
- D2 — every managed Machine carries
metadata: { "managed-by": "chant", <stack/env key> }. - D6 — build resources on the generated types from fly lexicon: scaffold chant-lexicon-fly (chant init lexicon + OpenAPI generate) #737, not hand-rolled shapes.
What to build
Appresource — org slug + app name (the ownership boundary).Machineresource — the generatedMachineConfig/LaunchMachineInputshape from fly lexicon: scaffold chant-lexicon-fly (chant init lexicon + OpenAPI generate) #737:
image,guest(cpu_kind / cpus / memory_mb),region,env,restart,services,
mounts,checks, andmetadata.- Serializer (the plugin's
serializerfrom fly lexicon: scaffold chant-lexicon-fly (chant init lexicon + OpenAPI generate) #737) emitting the create bodies:
POST /v1/apps(app) andPOST /v1/apps/{app}/machines(machine). Stamp the D2 ownership
marker on every Machine. Mirrorlexicons/gcp/lexicons/awsserializer structure.
Where it lives
lexicons/fly/src/ (resource authoring surface over the generated types) + the plugin
serializer (lexicons/fly/src/serializer.ts) from #737.
References
- Generated types: from fly lexicon: scaffold chant-lexicon-fly (chant init lexicon + OpenAPI generate) #737 (
src/generated/), cross-checked againstsuperfly/fly-go
machine_types.go/volume_types.go. - Body shapes:
openapi3.jsonpathsPOST /v1/apps,POST /v1/apps/{app}/machines. - Serializer peer:
lexicons/gcp/lexicons/awsserializer; docs
Create a Serializer.
Acceptance criteria
-
AppandMachineare authorable in.tsand discovered bychant build. - The serializer's create body validates against
openapi3.json— and round-trips against
mudflaps(POSTsucceeds,GETreturns the same machine). - The
managed-by: chantmarker is present on every serialized Machine.
Out of scope
Volumes / IPs / certs / secrets (#741); the apply loop (#739); lint (#742).
Activity
fly: App + Machine serializer emitting flaps create bodies (#738) (#751)
fly: flyApply — direct flaps REST applier with leases, wait, owned-on…
fly: formalize ownership convention via the #686 seam (#743) (#755)
fly: chant import support — parser, generator, live-export (closes #770…