Skip to content

Production economy mechanism: design decision record

This page records where production, consumption, and military supply belong in Canwu and why. Read it if you are deciding whether a new economic rule belongs in your application, in an optional extension, or in the simulation core.

Production, consumption, and military supply are built as optional extensions above canwu-api. Grain, factories, prices, armies, and historical resource maps stay in extensions, content packs, and host applications; the simulation core keeps only generic settlement.

  1. A host fixture. Celestial Mandate, a downstream strategy game built on Canwu, first checked the boundary with a synthetic fixture against the Canwu 0.6 public API, using only host-owned plugins and no core change.
  2. A running loop. The replaceable canwu-economy-reference integration runs a fourteen-month grain loop that uses real routing and transport types (cargo run -p canwu-economy-reference --example grain_loop).
  3. Two independent consumers. canwu-production and the force-supply reference consumer (canwu-force-supply-reference) own different lifecycles yet use the same accounts, reservations, allocation, transfers, and fulfillment. Two independent users of one lifecycle were the condition for extracting a shared extension.
  4. Scarcity and price-pressure reads. The reference integration adds evidence-based local scarcity and price-pressure projections. They are read models; a full market simulation is outside this delivery.

With that condition met, canwu-resource and canwu-production became publishable optional extensions. canwu-force-supply-reference and canwu-economy-reference remain unpublished, replaceable integrations.

Owner Owns
Simulation core Admission, time and phase order, reservation allocation, declared reads and writes, atomic commit, rollback, evidence, visibility, persistence, and replay
canwu-resource Resource definitions, units, accounts, protected floors, demands, reservations, allocation, transfers, consumption, loss, and fulfillment
canwu-production Processes, production sites, facilities, capacity, work orders, work in progress, execution, projects, and output settlement
canwu-transport and canwu-movement Itinerary, leg, custody-handoff, and capacity records (canwu-transport) and their lifecycle: movement orders, leg settlement, and capacity pools (canwu-movement). In-transit cargo balance, loss, acceptance, return, and destination credit stay in canwu-resource.
Population, production, and military domains Forming demands and using exact fulfillment outcomes; each writes only its own state
Historical content Places, deposits, processes, facilities, institutions, parameters, and provenance, with no special write path

Production sits above the conserved-resource layer. It owns versioned processes, work orders, work in progress, maintenance, and facilities, and hands output back to canwu-resource for crediting.

What it would take to move something into the core

Section titled “What it would take to move something into the core”

This delivery adds no simulation-core query API and moves no domain rules into the core. A future full market, money, property, universal construction, or combat system would need the same kind of proof: independent consumers that share its lifecycle, plus a public-API fixture that fails without a core change. An architecture diagram alone is not enough.

  • Historical goods, deposits, agricultural calendars, and era parameters.
  • A national price used as the truth about physical stock.
  • Automatic local capability from building levels, production methods, or technology unlocks.
  • A reachable route treated as a booking, departure, arrival, or usable delivery.
  • Transport execution records treated as the source of truth for cargo balance and loss.

See Production, resources, and transport: who owns what and the production, resources, and military supply case.