Repository navigation
Description
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 imageghcr.io/intentius/mudflaps, 42 endpoints, all
the lease/nonce + version-churn + transient-state fidelity, CI green). This
issue is now only the chant-sideflapsUp/Downwrapper 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 -fThe 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(overrideMUDFLAPS_ADDR); health atGET /_mudflaps/healthreturns
{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/psanswer501. - Fidelity already done: lease +
fly-machine-lease-nonceconflict, synchronous version churn
(instance_id, prior versionreplaced), transient-state timing,/wait(version+
repeatablestate, 408). SoflyApply's lease-conflict-retry and wait-on-new-version paths
are exercised by the real emulator.
Reuse / references
- Shared helper: core: shared emulatorLifecycle helper (dedupe floci*.ts; fly wrapper reuses it) #746 (
emulatorLifecyclein@intentius/chant/op). Prior shape:lexicons/gcp/src/op/activities/floci-gcp.ts. - Emulator repo (facts, health/endpoints):
github.com/INTENTIUS/mudflaps(README +api-coveragedocs).
Acceptance criteria
-
flapsUp/Downare a spec overemulatorLifecycle(core: shared emulatorLifecycle helper (dedupe floci*.ts; fly wrapper reuses it) #746);flapsUpbootsghcr.io/intentius/mudflaps, waits for/_mudflaps/health, returns an endpoint. -
flyApply(fly lexicon: flyApply — direct flaps REST applier (endpoint-overridable, owned-only prune, leases) #739) completes create →/waitstarted → update → destroy against it, offline. -
flapsDowntears the container down; the same op targets real Fly by dropping the endpoint override. - Pins a specific mudflaps image tag (not a floating
latest) for reproducible tests.
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
[-]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)[/+]lex00 commentedon Jul 10, 2026
🚀 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 thelexicons/flyflapsUp/Downwrapper are tracked here.[-]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)[/+]core: shared emulatorLifecycle helper; migrate floci*.ts to adapters (#…
fly lexicon: scaffold chant-lexicon-fly + flaps wrapper (#737 groundw…
lex00 commentedon Jul 11, 2026
The wrapper landed in #748 (
lexicons/fly/src/op/activities/flaps.ts, built onemulatorLifecycle#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.fly: flyApply — direct flaps REST applier with leases, wait, owned-on…
lex00 commentedon Jul 11, 2026
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.
fly: deploy Op + local-fly starter example (#744) (#759)