Faction Architecture Inventory

This inventory captures the active faction boundary for the current pre-alpha faction rollout. It records what exists today, names the temporary compatibility shims, and points later phases at focused checks. It does not define the final faction catalog shape.

Compatibility Boundary

Faction work is pre-alpha and does not preserve compatibility with old replay artifacts, persisted match-history replay payloads, compact snapshot versions, or old protocol payloads. Later phases may break those formats when they add explicit faction identity. Preserve current live gameplay behavior for the existing faction unless a later phase explicitly changes it.

Active Faction Boundary Sources

This document owns the active faction lifecycle taxonomy and the current catalog-id status table. server/crates/rules/src/faction.rs owns catalog facts, loadouts, and ability availability. server/src/lobby/faction_validation.rs owns lifecycle admission. docs/design/protocol.md owns wire vocabulary and payload shapes, and docs/design/server-sim.md owns the Game API and sim boundary wording.

plans/archive/faction/* files are historical-only evidence from the earlier faction rollout. They are not active checker inputs and must not be treated as lifecycle policy unless a future plan explicitly copies a rule back into an active design document. Guard scripts may check that the archive exists and is named as historical, but they must not read archived phase files as the source of current faction truth.

Catalog Id Statuses

Lifecycle status is explicit and separate from catalog existence:

Faction id or pathStatusCurrent lifecycle policy
kriegsiaplayableDefault faction for missing non-replay requests. Supported by normal human lobby, AI seats, dev starts, self-play defaults, replay/branch records, match-history replay, post-match replay, spectator metadata, and local prediction when version/build metadata is compatible.
ekatplayableHidden from the normal lobby faction selector while its existing catalog, Lab palette, and internal wire selection remain available. Explicit playable validation accepts it for start/replay-capable contexts, and schema 3 replay records plus replay-branch metadata may carry it. Public AI seat creation has no faction selector and still defaults to kriegsia; current local prediction is disabled when the local player is ekat.
cultivatorsplayableEconomy-first catalog: Nexus (shared ResourceDepot), Portal, Three Dao Pavilion, Tournament Grounds, Proving Grounds, Shop, Serf, Novice, the three distinct Dao Adept kinds, Steel Mine and Oil Pumpjack. Portal is a dedicated 3x3 building that produces Novices. Standard economy loadout without Riflemen; human beta/local selector enabled, normal playable lifecycle policy applies. No new AI profile; prediction remains unsupported.
phase2_empty_fixturetest-fixture-onlyCatalog and loadout exist for explicit Rust/test fixture coverage. It is rejected by normal lobby, AI, replay, branch, dev scenario, self-play, match-history, and post-match paths unless the caller uses the TestFixture validation context or a direct lower-level sim test helper that deliberately owns the fixture.
plans/archive/faction/*historical-onlyArchived phase plans, handoffs, and lifecycle matrices are not active faction policy and are not checker lifecycle inputs.

Current Entity Identity

Runtime identity is still global EntityKind. The current roster has 41 global kinds: 18 units, 19 buildings, 2 resource nodes, and 1 transient Shop delivery combat body. Server rules own the stable ids in server/crates/rules/src/kind.rs; protocol mirrors expose the same string ids in server/crates/protocol/src/lib.rs and client/src/protocol.js.

The current production catalog is in server/crates/rules/src/defs.rs:

Temporary compatibility shim policy: direct global kind checks are approved in the current rules catalog, protocol adapters, setup/loadout code, AI, dev scenarios, command execution, production, economy, combat, world-query helpers, and tests. New production files that introduce direct current-faction kind checks should either use the faction catalog API or be added to scripts/check-faction-assumptions.mjs with a short reason. High-risk approved files have a direct special-case count ratchet so newly added current-faction checks inside those large files are also visible during review. The ratchet is an inventory review tool, not approval to expand Kriegsia, Ekat, or fixture special cases casually.

Engineers and Serfs share EntityKind::Worker for building and selected vehicle repair. Worker-only repair admission, queued promotion, and execution keep that shared body check; Golems do not repair buildings or vehicles.

Current Economy Shape

Steel, Oil, and Supply are the only player resources in snapshots, compact snapshots, replay analysis, match history replay artifacts, and the HUD. Start-map resources are still only Steel and Oil nodes. Current Kriegsia starting values are STARTING_STEEL = 25, STARTING_OIL = 0, and STARTING_WORKERS = 1, and STARTING_RIFLEMEN = 4.

Compact snapshots encode resources as fixed scalar slots: tick, Steel, Oil, Supply used, and Supply cap. Spectator/replay player_resources use the same Steel/Oil/Supply fields. Later generic resource work must be a separate plan; this faction plan keeps the current resource payload shape. Approved direct-resource modules are listed in docs/design/balance.md under the faction economy contract. Future direct Steel/Oil/Supply references outside those owners should either route through catalog-aware cost/loadout helpers or update that approved inventory deliberately.

Current Starting Loadout

The standard Kriegsia match start is defined by the kriegsia.standard faction loadout in server/crates/rules/src/faction.rs and assembled by server/crates/sim/src/game/setup.rs: each player gets one completed Resource Depot, one Engineer and four Riflemen in separate rings, nearby Steel/Oil resource clusters, and starting Steel and Oil. Unknown non-empty faction ids receive no catalog loadout, starting entities, starting Steel/Oil, or Kriegsia supply credit; lifecycle owners must validate before building a Game.

The standard Ekat match start is defined by the ekat.standard faction loadout: one completed Zamok and one Ekat hero, with no starting Steel/Oil or Supply requirement. Zamok trains Golems for the current Ekat economy and recovery slice. The phase2_empty_fixture.scout_depot loadout starts one Depot and one Scout Car for explicit fixture tests only; catalog existence does not make that id product-playable. The cultivators.standard loadout reuses Kriegsia starting resources and economy entities, without Riflemen. It is structural catalog paperwork only and cannot reach simulation setup through a validated lifecycle path.

Replay starts reconstruct from recorded per-player PlayerStartingLoadout records. Replay validators reject missing loadouts, records for unknown players, faction mismatches, empty loadout ids, and loadout ids that do not exist in the player’s faction catalog. Global starting Steel/Oil constructors remain compatibility helpers for tests rather than replay/lifecycle reconstruction APIs.

Current Tech Tree

Workers can place Resource Depot and Supply Depot immediately, and can place Pump Jacks contextually on live oil patches with no tech requirement. Barracks requires a completed Resource Depot; Training Centre requires a completed Resource Depot and Barracks; Engineering Complex, Factory, and Gun Works require a completed Resource Depot and Training Centre; Tank Trap and Barbed Wire require a completed Training Centre. Resource Depot trains Workers. Barracks trains Riflemen immediately and Machine Gunners after the Training Centre requirement is met. Factory trains Scout Cars immediately, Command Cars once an Engineering Complex is complete, and Tanks after Tank Production research. Gun Works trains Mortar Teams immediately, Anti-Tank Guns while owning a completed Engineering Complex, and Artillery after Artillery research.

Research unlocks live in server/crates/sim/src/game/upgrade.rs and client descriptors in client/src/config.js. Training Centre researches Methamphetamines. Engineering Complex researches Artillery, Tank Production, and Smoke Plus. The retired AT Guns research leaves its former command-card slot empty so the remaining research hotkeys do not move. Each remaining dependency may already be complete or earlier in the same Engineering Complex queue when its dependent is ordered, while completion still gates the actual unlock. Tank Production unlocks Tanks; Command Cars require the Engineering Complex itself but no completed research. The current Ekat tech tree starts with Zamok training Golems; Golem-converted tech buildings are still planned work.

Current Ability Surface

Current ability ids are Charge (legacy no-op compatibility only), Smoke, Mortar Fire, Point Fire, Breakthrough, Ekat Teleport, Ekat Line Shot, Ekat Magic Anchor, and Ekat Consume Golem. The Rust faction catalog in server/crates/rules/src/faction.rs is authoritative for ability id, carrier, target mode, range, cooldown/charge, resource cost, queueability, autocast support, and command-card affordance metadata. client/src/config.js is the checked client projection, while server/crates/sim/src/game/services/ability_orders.rs, server/crates/sim/src/game/ability.rs, and server/crates/sim/src/rules/projection.rs own execution and projection hooks. Protocol ability vocabulary and compact codes remain mirrored through server/crates/protocol/src/lib.rs and client/src/protocol.js. Scout Car Smoke requires the owning player to retain a completed Engineering Complex; the command card keeps the ability visible but disabled with the missing-tech reason until that building is present.

Current Client Command Cards

The command-card renderer is local JS in client/src/hud_command_card.js; faction-sensitive build, train, research, and ability descriptors are driven by the checked catalog mirror in client/src/config.js. Kriegsia, Ekat and Cultivators command ids are namespaced by faction, unknown valid ids fail closed to an empty catalog, and fixture catalogs expose no command surface. Cultivators exposes Nexus, Portal, Three Dao Pavilion, Tournament Grounds, Proving Grounds and inert Shop construction; the Portal trains Disciples. The beta/local human-seat selector lists Kriegsia and Cultivators; Ekat is hidden. node tests/hud_command_card.mjs is the focused command-card guard, and node scripts/check-faction-catalog-parity.mjs compares client-exposed descriptor data against the Rust catalog dump.

Current AI Coupling

AI is Kriegsia-only through the public lobby seat flow: the only faction-locked profile, the internal jeffs_cult (Cultivators), cannot be seated in a human lobby. Legacy profiles and Rush AI select current Kriegsia roster kinds directly; Resource Depots auto-build Steel Mines and Pump Jacks, Engineers construct production and research buildings, and Steel/Oil/Supply budgets remain fixed fields. Public addAi requests do not accept a faction id. An AI seat plays its profile’s faction: Kriegsia, unless the profile is locked to another playable faction in server/crates/ai/src/live/factions.rs (rts_ai::live_profile_faction_id). A locked profile needs its own strategy written for that faction; jeffs_cult (server/crates/ai/src/jeffs_cult/) is locked to cultivators and plays only in observer sessions and offline tools for now.

Rush’s roster policy and staging modules (server/crates/ai/src/rush.rs and rush/staging.rs) intentionally select Riflemen, Machine Gunners, Panzerfausts and their production/research path. They receive fog-filtered SDK frames and use catalog-derived costs and building footprints. The faction assumption checker lists these two policy modules explicitly; they do not broaden the generic SDK or public faction admission boundary.

Pressure’s copied policy (server/crates/ai/src/ai_core/profiles/pressure.rs), independently owned staging (server/crates/ai/src/pressure.rs, with geometry in shared_tactics/staging.rs), and timed infantry production (pressure/production.rs) likewise select the current Kriegsia roster directly. The checker lists those three policy files explicitly. Pressure uses the same fog-filtered SDK and catalog-derived production costs; adding it as an AI 2.3 member or standalone opponent does not admit another AI faction.

Eco (server/crates/ai/src/eco.rs) is another explicit Kriegsia roster policy, using one-to-four bases, Machine Gunners, Panzerfausts and their research. It consumes the reusable SDK defensive planner; the planner’s geometry is independent of the build order, while its economic scoring (sdk/defense/scoring.rs) explicitly values the current Steel mines and production roster. These current-roster policy files are checker-listed. Neither the planner nor Eco changes public AI faction admission or replaces the catalog as the source of costs and prerequisites.

Current Prediction And WASM Coupling

Prediction/WASM assumes the current start payload, global entity ids, current command set, Steel/Oil/Supply scalar resources, and compact snapshot version. Local prediction is currently supported only for local Kriegsia players; local Ekat or fixture players disable prediction with the stable unsupported-local-faction reason until the WASM simulation and adapter support those contracts intentionally.

Lifecycle Paths

This section is the maintained source of truth for match creation, playback, replay branch, spectator, dev scenario, self-play, AI, prediction, match-history, and post-match replay paths. Later phases must update this section whenever they touch one of those lifecycle paths.

PathFaction sourceAllowed factionsAI behaviorPrediction behaviorReplay/branch behaviorTests or checks
Normal lobby startLobbyPlayer.factionId and PlayerInit.faction_id, defaulted by lobby::faction_validationProduct selector exposes kriegsia and cultivators; internal explicit ekat remains accepted; fixture and unknown ids rejectNo AI assignment by setFaction; AI seats are separateEnabled only for local Kriegsia when build/version metadata is compatibleSchema 2 records player faction id plus per-player loadout recordtests/faction_integration.mjs, tests/prediction_controller.mjs, server/src/lobby/faction_validation.rs tests
AI add/remove/startAI PlayerInit.faction_id, derived from the seat’s profile by rts_ai::live_profile_faction_id and lobby::faction_validationPublic AI seats default to kriegsia; no public Ekat selector; a profile may lock its seats to another playable factionEach profile plays its own faction; no faction selector in public lobby controlsNot applicableSchema 2 records AI faction and per-player loadout if match startstests/ai_integration.mjs, tests/server_integration.mjs
Fixture/dev faction startExplicit Rust test/dev harness onlyphase2_empty_fixture only in TestFixture validation or direct lower-level tests; playable catalogs reject in fixture-only contextRejected unless a later phase explicitly adds fixture AIDisabled when local fixture player is unsupportedFixture ids stay in explicit test artifacts onlyserver/crates/sim/src/game/setup/tests.rs, tests/prediction_controller.mjs, scripts/check-faction-assumptions.mjs
Replay playbackReplayArtifactV1.players[].faction_id and playerLoadouts[] in artifact schema 3Recorded playable ids kriegsia or ekat; missing, unknown, and fixture ids rejectFrom artifact onlyDisabled for replay viewersSchema 3 restores a checkpoint-backed start state; schema 2 and older artifacts reject; never lobby stateserver/crates/sim/src/game/replay.rs tests, server/src/lobby/room_task.rs replay tests
Replay branch staging/launchBranch seed seats copy recorded factionId from replay playersRecorded playable ids kriegsia or ekat; unsupported seat faction ids reject before live launchFrom recorded branch seed onlyDisabled unless supported by branch schema/WASMReconstruct from branch seed and cloned keyframeserver/src/lobby/room_task.rs tests, tests/protocol_parity.mjs
Dev scenariosScenario definition plus validation/defaultingCurrent bundled scenarios default to Kriegsia; explicit playable ids may be accepted by an owning scenarioNot applicable unless scenario declares AIEnabled only for local KriegsiaNot replayed unless scenario recording existsserver/crates/sim/src/game/setup/dev_scenarios/tests.rs, docs/context/testing.md
Self-playSelf-play PlayerInit.faction_id, validated by lobby::faction_validation; profile matchups use rts_ai::live_profile_faction_idCurrent bundled self-play defaults to Kriegsia; a faction-locked profile plays its locked faction; explicit Ekat needs a self-play script that owns itEach profile matchup side plays its profile’s factionNot applicableArtifact schema 3 records a checkpoint-backed start plus faction ids and per-player loadoutsserver/crates/ai/src/selfplay tests
Match history replayStored schema-3 match artifactRecorded playable ids kriegsia or ekat; missing, unknown, and fixture ids rejectFrom artifact onlyDisabled for replay viewersLoad from persisted schema 3; schema 2 and older artifacts are incompatibleserver/src/main.rs replay compatibility tests, docs/design/match-history.md
Spectator/no-fog viewLive match start payload or replay schemaMatch factions from start/replay metadataNot applicableDisabledPreserve recorded faction metadatatests/server_integration.mjs
Post-match replayCaptured schema-3 match artifactRecorded playable ids kriegsia or ekat; missing, unknown, and fixture ids rejectFrom artifact onlyDisabled for replay viewersLoad from captured checkpoint-backed start state with command logtests/server_integration.mjs

Current Guardrail Checks

Guardrail Map For Future Faction Work

When faction behavior changes, update the owning source and its guard in the same change: