Technology · Discipline

Reversible infrastructure mutation

Edits that touch several services happen in one rollback-protected transaction, and every create has a symmetric delete. The function generator is the worked example.

FAFO Core Function ForgeRust estate, link-time registrationAtomic file layer
Create
crategatewaycontrol planecompletiondocs
Delete, the mirror image

One operation across five parts

FAFO Core and Function Forge lets an agent add a function to a working multi-service estate, and I wanted every such change to be undoable exactly. Creating a function adds a crate and edits four other parts of the estate in one operation.

Applying one create
After the failure
1 crate2 gateway3 control plane4 completion5 docs
Illustrative: the fourth edit fails (orange).

Each edit runs through an atomic file layer with its own rollback per integration, so a failure halfway leaves the estate as it was and a function cannot end up registered in one service and missing from another.

Delete built with create

I built the exit path with the entry path. The generator writes every edit at a known landmark in its target file, and delete finds those landmarks and reverses each edit, which makes reversal exact. Regenerating over an existing function is refused unless forced, because it would overwrite the developer zone that holds the function's logic. The generator creates functions, and changes to an existing one are edits inside its zone.

One target file
create writes at a landmark; delete removes exactly this
developer zone: the function's logic; regeneration stops here unless forced
a second landmark edit

Functions register at link time, so an incompletely wired function fails the build and no runtime registry can drift.

One human step

The privileged step needed a person: the restart that puts the function to work. Build and restart are separate steps, and only the restart needs a human. See Tools that build tools, under governance.

compile the function
compile the control plane
compile the gateway
a person restarts
light: safe to repeat or undo · dark: the one human step
The rebuild never restarts a service, because restarting the gateway from inside an MCP call would cut off the agent that asked.

I design changes to a working system so they can be undone exactly, and I put the human decision on the one step where undo stops being free.

The generator works on my own estate's source tree and build.