Skip to content

fly lexicon: App + Machine typed resources + serializer (machine-config / fly.toml) #738

Closed

Description

@lex00

Epic: #736 · Phase: 1 (spine) · Depends on: #737 · Blocks: #739, #744

Reviewed 2026-07-11. Resources compose the generated types from #737
(the OpenAPI-generated Machine/App/Volume classes), not hand-rolled
shapes. The serializer's output can be validated end-to-end by POSTing it to
the mudflaps emulator (#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)

What to build

  1. App resource — org slug + app name (the ownership boundary).
  2. Machine resource — the generated MachineConfig / LaunchMachineInput shape 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, and metadata.
  3. Serializer (the plugin's serializer from fly lexicon: scaffold chant-lexicon-fly (chant init lexicon + OpenAPI generate) #737) emitting the create bodies:
    POST /v1/apps (app) and POST /v1/apps/{app}/machines (machine). Stamp the D2 ownership
    marker on every Machine. Mirror lexicons/gcp/lexicons/aws serializer 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

Acceptance criteria

  • App and Machine are authorable in .ts and discovered by chant build.
  • The serializer's create body validates against openapi3.json — and round-trips against
    mudflaps (POST succeeds, GET returns the same machine).
  • The managed-by: chant marker is present on every serialized Machine.

Out of scope

Volumes / IPs / certs / secrets (#741); the apply loop (#739); lint (#742).

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