Skip to main content

Module launch

Module launch 

Source
Expand description

THE LAUNCH ENTRY: the one door a deployment of a graph root goes through.

ⓘ
#[ingraph::graph]
pub struct Media {
  videos: Video,
  scenes: Scene,
}

emits, beside the options spine, Media::launch — the ruled sequence walked once, in order: VALIDATE, then CREATE, then WIRE, then IGNITE, and an App<Media> at the end of it.

The running world is the FRAMEWORK’s type and not an emitted one — every indexer’s lifecycle is the same lifecycle — so what this entry contributes is the type parameter: the root it was emitted for is what the world is App OF, which is the seat a later round’s emitted faces hang off.

§PARSE is the caller’s, and that is the framework reading no file

The sequence’s first step does not appear here, because the options arrive already typed: an application picks its format, merges whatever layers it has and hands over a MediaOptions. What this entry spends is that value, and it is spent WHOLE — the sections move into their nodes’ constructions, so a deployment’s options are consumed by the launch they describe.

§What the emission can say, and what it must be handed

A root declares a LIST: mount names and node types, in one order. That list is exactly what the create walk’s third step needs, so the node pass is emitted here in full — one Creation::node call per declared mount, in declaration order, each with its own section and its own bare-options probe.

The RESOURCES are the same kind of list, and the catalog round made them one: a root’s #[ingraph(resource)] fields say which resources exist, under which mount, and from which one source — so the entry drives them itself, before anything else is built, exactly as the ruled sequence orders it. The only ones it does NOT drive are the factory resources, whose options close over something the application holds; those stay prepare’s, which still runs before the first node.

Every other step needs a fact the root’s own declaration does not carry, and the three-author wall is why: what a node SUBSCRIBES to is written in that node’s declaration, which this derive cannot see. So the topology, the write lanes and the engines all enter as parameters, and each one is the narrowest shape that carries what it must:

stepwho states ithow it arrives
parsethe applicationalready typed, as <Root>Options
validatethe DECLARATIONS’ topology + this deployment’s enablementa Plan, whose enablement AND catalog the entry replaces with the root’s own
create — declared resourcesTHIS EMISSIONone call per resource field, from the source its declaration names
create — factory resources, slotsthe party that can NAME themprepare, driven against the walk
create — nodes AND originsTHIS EMISSIONone call per declared mount
wire + ignitethe party that can name the operators’ typeswire, handed the built nodes and the wiring walk
sources lastthe ENTRYIgnition::into_app is never the closure’s to call

§THE ORIGIN TIER is five lines, and only the CONVERGED door writes them

A #[ingraph(origin)] field names a source mounted as a HEAD whose one out-edge IS its feed. The converged door writes the whole of it: Blueprint::origin declares it, Creation::node builds it from its own section, Wiring::bridge opens its edge from the PRODUCER’s end, Wiring::enrol registers it, and Ignition::origin_kept puts it on an engine with that edge as its feed.

launch_wired writes ONE of them — the construction — and stops there, which is the same division it already keeps: the caller states the plan and holds the wiring walk, so the closure that already names the operators’ types is the party that spells the bridge. The origin therefore comes out of that door in the bag, built and unmounted.

The last row is the one worth reading twice. wire hands back an Ignition, not an App, so a caller may register bodies, teardowns and sources on it and cannot spend the moment they start: SOURCES LAST stays structural through the emitted door exactly as it is inside the ignition itself.

§THE PRE-IGNITION UNWIND is emitted here, because the values are the WALK’s

A launch that refuses before anything ignited is holding everything it has built so far, and the ruling says those values SAY their goodbyes rather than merely dropping. Nothing about that is the framework’s to do alone: the values live in this entry’s own locals, which is precisely what ownership never left the launch walk means. So the walk is emitted in fallible PHASES, each with ONE refusal arm that hands its walk and a Staging ledger to that walk’s own unwind:

phasewhat the ledger reacheswho says it
resources, prepare, the node passthe bag’s filled slotsCreation::unwind
the wiring passeach wired-but-unignited party’s operator, or the value the wiring never reachedWiring::unwind

Two shapes make that work and neither is decoration. The node bag is declared EMPTY and filled slot by slot, because a struct literal’s earlier temporaries are dropped by the very ? that abandons it — there would be nothing left to say goodbye to. And every per-mount holder is declared BEFORE the phase that fills it, so one arm reaches all of them rather than one arm per step. Each phase’s outcome is bound to a local before it is matched, because the block borrows the walk the unwind then consumes.

The IGNITION pass keeps its ?: by then the framework owns the failure — see Ignition::unwind, which states what it does and does not reach.

Structs§

LaunchEntry
One ingraph root’s launch entry, ready to emit.

Functions§

default_nodes_name
<Root>Nodes — the name the create walk’s product takes.