APP_VERSION: 0.9.0
src/game/contracts/manifest.jsstays the executable contract Source of Truth.docs/PRODUCT.mdstays the product Source of Truth.docs/traceability/*stays derived evidence only.
- Manifest-first stays active.
- State updates stay patch-only.
- Kernel stays the only write authority for gameplay state.
- UI and renderer stay read-only against gameplay state.
- No nondeterministic entropy such as
Math.random()orDate.now()is allowed in reducer or sim step.
src/kernel/*: deterministic kernel, patching, persistence, RNG and validation.src/game/contracts/*: state, action, mutation, gate, lifecycle and shared runtime identifiers.src/game/runtime/*: canonical gameplay runtime entrypoints for reducer and sim-step wiring.src/game/sim/*: active legacy runtime plus reusable deterministic algorithms.src/game/render/*: canonical renderer and worker renderer.src/game/ui/*: current UI shell and dispatch-only runtime interaction.src/game/viewmodel/*: read-only gameplay presentation labels and UI-derived view helpers.src/app/*: boot, runtime loop and crash surfaces.tools/llm/*: dev-only LLM adapters, read models and gate tooling. Runtime code must not import them.
- Foundation eligibility now belongs to
src/game/runtime/foundationEligibility.js;src/game/sim/foundationEligibility.jsis compatibility-only. - Fog read-model shaping now belongs to
src/game/viewmodel/fogIntel.js;src/game/render/fogOfWar.jsis render-only again. - Lage-panel read helpers now belong to
src/game/viewmodel/lageStats.jsinstead of being embedded inside the UI renderer. - Reducer phase checks now belong to
src/game/sim/gates/phaseGates.js; the reducer consumes them instead of owning phase gating inline. - Worker order parsing and patch builders now belong to
src/game/sim/commands/orderCommands.js; reducer order handling stays behaviorally unchanged. - Grid and mask primitives now belong to
src/game/sim/grid/index.js; reducer placement and visibility logic consumes them instead of defining adjacency helpers inline. - Active worker order execution now belongs to
src/game/runtime/processActiveOrderRuntime.js, with movement/navigation support insrc/game/runtime/orderNavigation.js;simStepPatchdelegates instead of owning the state machine inline. - Shared alive/role/mask counting helpers now belong to
src/game/runtime/stateCounts.js; reducer and win-condition code consume the same counting logic instead of drifting in parallel. - Infra candidate-mask cloning and committed-anchor checks now belong to
src/game/runtime/infraRuntime.js; reducer infra-path setup consumes that runtime helper instead of owning the infra staging helpers inline. src/game/sim/worldPresets.js,src/game/sim/mapspec.js, andsrc/game/sim/worldgen.jsnow act as stable public facades; preset catalog/runtime, MapSpec compile logic, and world generation internals live behind them in dedicated submodules.- Founder connectivity checks are now consolidated in
src/game/sim/grid/index.js(areIndicesConnected8) and consumed by both runtime foundation eligibility and phase gates, removing duplicate 8-neighbor connectivity logic.
- Legacy compatibility routes may still exist in code, but they are non-target and scheduled for removal from active runtime truth.
- Legacy
PLACE_COREline remains non-mainline. - Canonical mainline now uses a fixed 10s Phase-0 overview before
RUN_ACTIVE. - MapSpec compile wiring is now active without deleting live legacy flows.
- Action lifecycle metadata now marks every action as
stable,rename,deprecatedornew_slice_a. SET_MAPSPECandSET_MAP_TILEare now active reducer paths; the remaining RTS placeholders stay no-op until their slices land.- Replacement planning is machine-readable in contracts and human-readable in
docs/traceability/.
- UI runtime uses a modular structure:
ui.js,ui.input.js,ui.builder.js,ui.orders.js,ui.stats.js, andui.constants.js. - The interface is strictly divided into two areas: a minimal left sidebar for essential RTS metrics (
ui.stats.js) and the main interaction canvas. - Top bars, headers, and floating panels are completely removed.
- Interaction on the grid remains 100% canvas-based. All feedback strings are statically defined in
ui.constants.js(UI_STRINGS). - Inspect mode is not part of canonical MVP mainline.
- Default web persistence now keeps
mapalongsidemeta;worldandsimstill reset on reload. - Builder
tilePlansurvives reload and is re-applied only through the normalGEN_WORLDcompile path. - Builder-specific regression coverage now includes phase gating,
SET_MAP_TILEroundtrip, and persisted reload recovery.
- Boot now imports directly from
src/game/manifest.js,src/game/runtime/index.js,src/game/render/renderer.js, andsrc/game/ui/ui.js. - Operative reducer path remains
src/game/sim/reducer/index.js. src/game/sim/reducer.jsremains the compatibility facade.src/game/runtime/index.jsremains the stable public sim-step surface even though active order execution now delegates into runtime helper modules.src/game/sim/worldPresets.js,src/game/sim/mapspec.js, andsrc/game/sim/worldgen.jsremain the stable path-pinned surfaces consumed by runtime and tests.- Boot still dispatches
GEN_WORLD, but world boot now compiles throughmap.spec. - Renderer orchestration in
src/app/main.jsandsrc/game/render/renderer.jsremains canonical and reusable. - Top-level
mapstate is now a live deterministic compile input, not just scaffold. - Legacy preset actions now sync through the same MapSpec compile path.
- Builder tile edits now follow the same deterministic
SET_MAP_TILE -> GEN_WORLDcompile path as full MapSpec updates.
actionSchemacontains both live legacy actions and active Slice B MapSpec actions.PLACE_CELLhas been retired from the active contract surface;PLACE_WORKERnow carries the founder-placement runtime path.patternCatalogandpatternBonusesare no longer part of the live state schema or sim gate;mutatorDraftis the current mutation draft surface.mutationMatrixremains authoritative for allowed writes.simGateremains authoritative for/world/*and/sim/*patch validation.dataflowexposes dispatch sources plus lifecycle and planned writes.actionLifecycleis the canonical replacement ledger for action migration.
- Reuse generic deterministic algorithms.
- Rewrite product vocabulary and gameplay surfaces.
- Delete only after replacement wiring, reducer migration and test migration are complete.
High-value reuse candidates:
src/game/sim/cellPatterns.jssrc/game/sim/patterns.jssrc/game/sim/worldAi.jssrc/game/sim/reducer/winConditions.jssrc/game/render/renderer.jssrc/app/main.js
- Entry and preflight remain mandatory before writes.
- Determinism and replay tests remain the hard truth line.
- New migration tests must prove scaffold actions are safe before reducer wiring lands.
- Legacy paths may be removed only after a test proves the replacement path has assumed the responsibility.
src/kernel/: deterministic store, patching, validation, persistence, RNG.
src/app/: bootstrap and runtime orchestration.src/kernel/: deterministic engine and state-write authority.src/game/: runtime gameplay, manifest, contracts, renderer, UI and viewmodels.tests/: determinism, contract and migration guards.tools/: test runners, evidence tooling and dev-only LLM helpers.docs/: SoT docs and derived traceability.