Reference — stage-gate transitions and prerequisites
The 9-gate ladder and per-gate prerequisite map. State machine source: packages/energy/src/stage-gates/transitions.ts.
Gate sequence
land → energy → permits → substation → turbines → finance → build → energize → tenantSTAGE_GATE_ORDER exports this as a readonly array from @dmtr/energy/schemas.
Prerequisite map
Each row lists the gates that must be complete before the target gate can be entered.
| Target gate | Prerequisites |
|---|---|
land | (none) |
energy | land |
permits | land, energy |
substation | land |
turbines | energy |
finance | land, energy, permits |
build | finance, substation, turbines |
energize | build |
tenant | energize |
Status values
not_started · informal · committed · in_progress · complete · blocked
A gate must reach complete before its dependents can advance. blocked is informational and does not change prerequisites — it surfaces a development hold for the operator.
Regression rule
canAdvanceTo returns { allowed: false } for any transition where the target gate index is less than the current gate index. The state machine never permits regression. To represent a setback (e.g., a permit denial), advance the current gate's status to blocked rather than moving back.
Code
import { canAdvanceTo, applyTransition, PREREQUISITES } from "@dmtr/energy/stage-gates";
const decision = canAdvanceTo(slot.stage_gate, "finance");
// { allowed: false, reason: "Cannot advance to finance: prerequisite gates not complete: [permits]." }
const next = applyTransition(slot.stage_gate, "permits", "complete", "2026-09-01T00:00:00Z");
// returns a new StageGateState — throws if transition is disallowedAPI
POST /v1/energy/slots/{slot_id}/advance with body { "gate": "...", "status": "..." } returns the updated slot. 409 on disallowed transitions.
GET /v1/energy/stage-gates returns the canonical sequence and prerequisite map for client-side validation.
Reference — SiteClass + FuelClass + CarbonClass enums
Authoritative enum lists for site class, fuel class, carbon class, chip class, latency class, tenant use class, power quality, and compliance requirements.
Patient Energy Zero — Pampa JV (Vaca Muerta)
End-to-end reference implementation: a 200 MW associated-gas slot in Vaca Muerta, walked from land-secured through tenant-signed, with decomposition, settlement math, and a 4(a)(7) sublease.