Files
jschoubben 9a41add136 showcase: a module that exercises everything a module can be
Written so the module system has something that proves itself rather than a claim
about what it supports, and guarded by a test in the catalogue's own suite so it
cannot quietly stop exercising things.

Nine of the host's eleven resource kinds, all three artifact kinds including the
one that compiles, all three ways a module's code can run, and all four things
that code can be: tools, an event consumer, a provisioner, and processes.

Two absences that are findings rather than gaps. `action` is refused to modules
outright — the link may not carry a command to run (ADR 0005), so a module that
needs something done ships a program that reconciles, which is what a run-once
process is. `service` puts an EXISTING unit into a state and installs none, which
is right for software shipping its own; code the mesh built has no unit until the
mesh writes one, and that is a process.

And it no longer picks its own port. ADR 0038 says a module cannot know what else
is on the machine it was assigned to, and names exactly the trap this fell into:
the number written three times — listens, serves, a container's ports — agreeing
only because one person wrote all three, with nothing checking. So it says what
it needs and the mesh assigns the number.

Claude-Session: https://claude.ai/code/session_01D6qtiYU3P9jk3pnAXyAFyx
2026-09-15 12:58:30 +02:00

12 lines
586 B
TypeScript

// showcase's run-once step — a `process` with run-once, run to completion at install.
//
// **What follows it is gated on it finishing.** A migration that did not happen must not be
// followed by the thing that needed it, which is why a step is a mode rather than a daemon that
// exits.
import { mkdirSync, writeFileSync } from "node:fs";
const where = process.env.SHOWCASE_STATE ?? "/var/lib/showcase";
mkdirSync(where, { recursive: true });
writeFileSync(`${where}/installed`, `${new Date().toISOString()}\n`);
console.log(`[showcase] step complete, wrote ${where}/installed`);