Skip to main content

Module layout

Module layout 

Source
Expand description

Space is a graph before it is a coordinate (spec-0049 §3, §4.2) — pipeline stages 2 and 3.

Two campaign stage documents land here, and neither holds a single coordinate:

  • geometry-brief — the machine-readable half of the whole map’s written brief: facts[], each a number with a name. Stage 4’s identity checks bind a site plan to these (spec-0049 §4.2); this round lands the document and nothing reads it yet, which is stated rather than implied.
  • layout-graph — the campaign’s space as a graph: places, the connections between them, the authored critical path, and where each quest beat happens. The topology carries the global guarantees and is checked as an object of its own, cheaply, before geometry exists to make it expensive.

§What makes the ordering structural rather than prose

spec-0049 §7 enumerates four inversions the design must make uncompilable. The one this module owns is graph before mission, and §7 is honest that it is representable: a graph with no beats[] and no gating validates against quest documents it never references. What it is not is silently green. Two teeth, both here:

  1. DW0817 states its beat binding, and a zero beat binding is printed as a zero — a critical path over an unbound graph is a route through nothing and says so.
  2. DW0818’s reverse direction: the moment quests exist, every place-bound beat must bind to a node. A graph is free to arrive before the mission; it is not free to arrive after it and ignore it.

§The gating vocabulary is deliberately NOT crate::gate::Gate

An edge’s EdgeGating names flags and a quest, which is what the campaign’s one gate names too — so the question is owed an answer rather than a convention. A Gate is a runtime object: emission evaluates it against an acting player, and GateConsumer::evaluates_per_player is what makes a player-scoped datum’s readability decidable. A layout-graph edge is evaluated by nothing at run time — the graph emits no command, no function and no scoreboard — so making it a gate consumer would push a never-emitted object into machinery whose whole subject is emission, and every proof written about “the gates of this campaign” would then be reasoning about a claim instead of about a thing the server runs.

It is also narrower on purpose. The closure below is monotone (§3.2), so a negative flag term and a numeric comparison are terms it cannot decide; a surface an author may write and no proof honours is worse than one that is not there. What an edge states is therefore a projection of the campaign’s runtime gating into topology — and DW0818 is what keeps it a projection rather than a second vocabulary: every flag it names must be one some effect really sets, and every quest it names must exist.

Determinism (ADR-0006): every set and map here is a BTreeSet/BTreeMap and every walk is over a slice in document order.

Structs§

Beat
Where one quest beat happens.
BriefFact
One fact from the whole map’s written brief: a number with a name.
Closure
The monotone reachability closure of a layout graph.
EdgeGating
What a body must already hold for a connection to be passable.
GeometryBriefContent
The geometry-brief stage document’s payload.
Grants
What each place hands a body, derived from the campaign’s own quest documents — the grant half of §3.2’s loop.
LayoutBinding
What a run’s map-pipeline checks bound to — stages 2, 3 and 4.
LayoutGraphContent
The layout-graph stage document’s payload: the campaign’s space as a graph, stated before any coordinate exists.
Node
A place: a room, a courtyard, an arena, a stretch of shore, a cavern.
Station
A named place inside a node (spec-0052 §3).

Enums§

Direction
Which way a one-way connection runs.
Edge
A connection between two places.
Grant
One thing a body can be holding: a produced flag, or a completed quest.
OpensFrom
Which side of a barred connection can open it.
StationKind
What shape a station is (spec-0052 §3) — a cell to stand a body at, or a volume with a block that seals and clears.

Constants§

DW_CRITICAL_PATH
DW0817: the authored critical path does not hold.
DW_GRAPH_MALFORMED
DW0814: the layout graph is not a graph — a duplicate id, an endpoint naming no place, a self-loop, an entry that is not a node.
DW_GRAPH_MISSION
DW0818: the graph names quest-side state that does not exist, or a place-bound beat has no place.
DW_NODE_UNREACHED
DW0816: a node the closure never reaches.
DW_ONE_WAY_STRANDS
DW0819: a one-way edge strands.
DW_PACING
DW0822: the pacing measurement — a projection, printed with no threshold.
DW_SHORTCUT_NO_LOOP
DW0820: a shortcut closes no loop.
DW_STATION_DUPLICATE
DW0870: two stations claim one name (spec-0052 §7.2).
DW_STATION_KIND
DW0871: a reference demands a shape the station is not (spec-0052 §7.3).
DW_STATION_RESERVED
DW0869: a station takes a name in the engine’s own namespace (spec-0052 §7.1).

Functions§

check
Every check the layout documents owe at validation tier.
reachability
The graph’s reachability proofs — a place a body can never reach (DW0816), an authored critical path that does not hold (DW0817), and a one-way connection that strands (DW0819).