Skip to content

fly: Machines contract + mudflaps coverage check (parity with Sprites/spritzer) - #819

Merged
lex00 merged 1 commit into
mainfrom
feat/machines-contract-coverage
Jul 12, 2026
Merged

lex00 merged 1 commit into
mainfrom
feat/machines-contract-coverage

Conversation

@lex00

@lex00 lex00 commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Why

spritzer got a contract ⊆ implemented-paths coverage check in #808 T3. mudflaps had no equivalent — even though it carries roadmap endpoints (machines/{id}/signal, /exec, /ps) that answer 501. This adds the mudflaps twin so both emulators have a parallel, roadmap-aware coverage check.

Surfaced from the question "does mudflaps still have roadmap items?" — yes, three; and its README is stale, still listing volumes/secrets/certs/IP as 501 when the code now implements them.

What

  • machines-contract.ts — MACHINES_CONTRACT: the 22 flaps endpoints flyApply calls (apps, machines, leases, wait, volumes, ip_assignments, certificates, secrets), derived from fly-apply.ts's URL builders + http() method pairings.
  • machines-contract.test.ts (CI): covers the applier's resource ops, well-formed methods/paths, and a drift anchor — every contract path segment must appear in fly-apply.ts.
  • machines-contract.docker.integration.test.ts (docker-gated, FLY_DOCKER=1): boots the pinned mudflaps, reads /_mudflaps/health, asserts contract ⊆ implemented and that flyApply depends on none of mudflaps' roadmap (501) endpoints.

Validation

  • Unit test green; docker coverage test run live against the pinned mudflaps image — full coverage, zero roadmap dependency.
  • Full fly suite green (27 files).

Both Fly emulators now have the symmetric check: Sprites ⊆ spritzer (#815) and Machines ⊆ mudflaps (this).

…/spritzer)

spritzer got a contract ⊆ implemented-paths coverage check in #808 T3; mudflaps
had no equivalent even though it carries roadmap endpoints (machines/{id}/signal,
/exec, /ps) that answer 501. Add the mudflaps twin.

- machines-contract.ts: MACHINES_CONTRACT — the 22 flaps endpoints flyApply calls
  (apps, machines, leases, wait, volumes, ip_assignments, certificates, secrets),
  with a param-normalizing helper.
- machines-contract.test.ts (CI): covers the applier's resource ops, well-formed
  methods/paths, and — the drift anchor — every contract path segment appears in
  fly-apply.ts, so a changed applier endpoint forces a contract update.
- machines-contract.docker.integration.test.ts (docker-gated): boots the pinned
  mudflaps, reads /_mudflaps/health, asserts the contract ⊆ implemented AND that
  flyApply depends on none of mudflaps' roadmap (501) endpoints.

Verified live against the pinned mudflaps image: full coverage, no roadmap
dependency. Note: mudflaps' README is stale — it lists volumes/secrets/certs/IP
as 501, but the code now implements them; only signal/exec/ps remain roadmap.
@lex00
lex00 merged commit 94842ec into main Jul 12, 2026
5 checks passed
@lex00
lex00 deleted the feat/machines-contract-coverage branch July 12, 2026 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant