Skip to content

fly lexicon: chant-side flaps wrapper (boot the mudflaps image for local tests) #740

Closed

Description

@lex00

Epic: #736 · Phase: 1 (spine) · Depends on: #746 (shared helper) · Blocks: #744

Reviewed 2026-07-11 — retargeted. The emulator is done: mudflaps
shipped v0.3.0 (public image ghcr.io/intentius/mudflaps, 42 endpoints, all
the lease/nonce + version-churn + transient-state fidelity, CI green). This
issue is now only the chant-side flapsUp/Down wrapper that boots that
image for local testing. The historical "build the emulator" plan is archived
at the bottom.

Goal

A thin Docker-lifecycle activity in lexicons/fly that boots the mudflaps container,
health-checks it, and returns its endpoint so flyApply (#739) can run its full loop offline —
no Fly account, no token. This is the Fly analogue of how lexicons/gcp consumes the external
floci-gcp image.

What to build (lexicons/fly/src/op/activities/flaps.ts)

Build on the shared emulatorLifecycle helper (#746) — a spec, NOT a hand-rolled lifecycle (do
not copy floci-gcp.ts; that near-duplication is what #746 removes):

const flaps = emulatorLifecycle({
  name: "chant-mudflaps",
  image: "ghcr.io/intentius/mudflaps:0.3.0",  // pin a tag
  containerPort: 4280,
  healthPath: "/_mudflaps/health",
});
export const flapsUp = flaps.up;      // docker run + health poll → { endpoint }
export const flapsDown = flaps.down;  // docker rm -f

The returned endpoint feeds flyApply's FLY_FLAPS_BASE_URL / endpoint option (D3). If #746
hasn't landed yet, mirror floci-gcp.ts as a stopgap and migrate — but prefer landing #746 first.

Concrete facts about the target (verified against mudflaps v0.3.0)

  • Public, anonymously pullable: docker pull ghcr.io/intentius/mudflaps:0.3.0.
  • Listens on :4280 (override MUDFLAPS_ADDR); health at GET /_mudflaps/health returns
    {status, version, implemented[], unimplemented[]}.
  • Implements apps, machines (full lifecycle incl. suspend/cordon/metadata), wait, leases,
    volumes, secrets (apply-only), ip_assignments, certificates, /v1/platform/regions, machine
    /versions, and org-scoped listing. signal/exec/ps answer 501.
  • Fidelity already done: lease + fly-machine-lease-nonce conflict, synchronous version churn
    (instance_id, prior version replaced), transient-state timing, /wait (version +
    repeatable state, 408). So flyApply's lease-conflict-retry and wait-on-new-version paths
    are exercised by the real emulator.

Reuse / references

Acceptance criteria

Out of scope

Any change to the emulator itself — mudflaps is its own repo with its own backlog. If a test
needs behavior mudflaps lacks, file it there.


Archived: the original "build the emulator" plan (delivered as `mudflaps`)

The emulator was built as a standalone Go repo (github.com/INTENTIUS/mudflaps, MIT) so it
imports superfly/fly-go types directly and cannot drift from the wire contract — a stateful
fake no schema mock (Prism/WireMock) can be. It models the machine state machine, lease/nonce
concurrency, version churn, and /wait, generated from docs.machines.dev/spec/openapi3.json.
All of that is complete and tested; nothing here remains to do in chant beyond the wrapper above.

Activity

  1. added
    enhancement
    on Jul 10, 2026
  2. changed the title [-]fly lexicon: standalone fake-flaps emulator (net-new local target; NOT part of Floci)[/-] [+]fly lexicon: mudflaps — standalone stateful fake-flaps emulator (new repo; NOT Floci, NOT a Prism mock)[/+] on Jul 10, 2026
  3. lex00 commented on Jul 10, 2026

    @lex00
    ContributorAuthor

    🚀 The emulator repo is live: https://github.com/INTENTIUS/mudflaps — Go, MIT, CI green, distroless image, mkdocs doc site. Scaffold implements the store + machine state advancer + lease/nonce + /wait; remaining fidelity work (lease-conflict edge cases, version churn, transient-state timing) and the lexicons/fly flapsUp/Down wrapper are tracked here.

  4. changed the title [-]fly lexicon: mudflaps — standalone stateful fake-flaps emulator (new repo; NOT Floci, NOT a Prism mock)[/-] [+]fly lexicon: chant-side flaps wrapper (boot the mudflaps image for local tests)[/+] on Jul 11, 2026
  5. lex00 commented on Jul 11, 2026

    @lex00
    ContributorAuthor

    The wrapper landed in #748 (lexicons/fly/src/op/activities/flaps.ts, built on emulatorLifecycle #746, tested). Leaving this open: the remaining acceptance criterion — flyApply completes create → /wait → update → destroy against it — needs #739 to exist to exercise the loop.

  6. lex00 commented on Jul 11, 2026

    @lex00
    ContributorAuthor

    chant-side flaps wrapper landed: lexicons/fly/src/op/activities/flaps.ts (emulatorLifecycle over ghcr.io/intentius/mudflaps:0.3.0, port 4280). In active use booting the live emulator for the #739/#741 integration tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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