Phase 24: Unconventional & Prohibited Warfare¶
Status: Complete Tests: 345 new (6,325 total) Dependencies: None new
Overview¶
Final planned phase. Delivers escalation dynamics (0–10 ladder driven by desperation index), prohibited weapons with treaty compliance, unconventional warfare (IEDs, guerrilla, SOF), war crimes consequence cascading, insurgency/COIN feedback loops, and negotiated war termination.
Key principle: modulation layer on existing systems — escalation modulates ROE, morale, AI decisions, and political systems. Chemical weapons use Phase 18 CBRN effects. IEDs use existing damage model. No new combat resolution.
Sub-Phases¶
24a: Escalation Model & Political Pressure (75 tests)¶
escalation/__init__.py— Package initescalation/ladder.py— 11-level escalation state machine (CONVENTIONAL through STRATEGIC_NUCLEAR_GENERAL), desperation index (5-factor weighted composite), hysteresis de-escalation (0.7×), cooldown enforcement, commander personality modulationescalation/political.py— International + domestic pressure [0,1], rate-driven growth/decay, 9 political effects at threshold crossings, existential threat suppression of domestic pressureescalation/consequences.py— War crimes consequence cascading (own morale penalty, enemy hardening, civilian hostility, political pressure, escalation spiral via Bernoulli)escalation/events.py— 8 frozen dataclass event typescore/types.py— Added ModuleId.ESCALATION
24b: Prohibited Weapons & Compliance (56 tests)¶
combat/ammunition.py— 4 new AmmoType values (CLUSTER, INCENDIARY_WEAPON, ANTI_PERSONNEL_MINE, EXPANDING), 3 new AmmoDefinition fields (prohibited_under_treaties, compliance_check, uxo_rate)combat/damage.py— IncendiaryDamageEngine (fire zone creation, wind-driven expansion, burnout→BurnedZone), UXOEngine (submunition failure field, encounter probability)combat/engagement.py— check_prohibited_compliance (treaty→escalation level mapping: CWC→5, BWC→6, CCM→4, Ottawa→4, Protocol III→3, Hague→3)c2/roe.py— check_treaty_compliance, apply_political_roe_modulation- 10 YAML prohibited ammunition definitions (cluster, AP mines, incendiary, chemical, expanding)
24c: Unconventional Warfare + SOF (59 tests)¶
combat/unconventional.py— IED emplacement/detection/detonation (speed-detection tradeoff, EW jamming for remote IEDs), guerrilla attack/disengage evaluation, human shields civilian proximityc2/ai/sof_ops.py— SOF mission lifecycle (PLANNING→INFIL→EXECUTING→EXFIL→COMPLETE), HVT targeting, sabotage, infiltrationterrain/obstacles.py— IED=8, BOOBY_TRAP=9 obstacle types + ied_subtype/blast_radius/concealment fieldsentities/organization/special_org.py— INSURGENT=4, MILITIA=5, PMC=6 org typeslogistics/prisoners.py— TreatmentLevel enum, interrogation model (stress-reliability tradeoff), InterrogationResult- 6 doctrine YAML, 4 IED weapon YAML, 2 SOF unit YAML
24d: AI Escalation Logic (62 tests)¶
c2/ai/commander.py— 3 new personality traits: doctrine_violation_tolerance=0.2, collateral_tolerance=0.3, escalation_awareness=0.5c2/ai/decisions.py— BrigadeDivAction: EMPLOY_PROHIBITED_WEAPON, AUTHORIZE_ESCALATION, ORDER_SCORCHED_EARTH. CorpsAction: EMPLOY_CHEMICAL, AUTHORIZE_NUCLEARc2/ai/adaptation.py— MILITARY_STALEMATE, POLITICAL_PRESSURE triggers. ESCALATE_FORCE, DE_ESCALATE actionsc2/ai/stratagems.py— SABOTAGE_CAMPAIGN, TERROR, SCORCHED_EARTH stratagems with requirementsc2/ai/assessment.py— compute_desperation_index(), estimate_escalation_consequences() pure functions- 4 commander profile YAML, 2 escalation config YAML
24e: Insurgency & COIN (46 tests)¶
population/insurgency.py— Multi-stage Markov radicalization pipeline (neutral→sympathizer→supporter→cell member→combatant), InsurgentCell with concealment degradation, cell operations (IED emplacement, sabotage, ambush), discovery (HUMINT/SIGINT/pattern analysis)population/civilians.py— get_regions_by_disposition() helperlogistics/disruption.py— apply_insurgent_sabotage() wires cell sabotage into existing disruption framework
24f: Integration & Validation (47 tests)¶
escalation/war_termination.py— Negotiated war termination (mutual willingness threshold, stalemate duration gate, capitulation)simulation/scenario.py— escalation_config field, 9 new SimulationContext engine fields, ceasefire/armistice victory condition typessimulation/engine.py— _update_escalation in tick loop (incendiary, SOF, insurgency, war termination)simulation/victory.py— CEASEFIRE=5, ARMISTICE=6 victory condition types- 4 validation scenarios: Halabja 1988, Srebrenica 1995, Eastern Front 1943, COIN Campaign
Key Patterns¶
- Modulation layer: Escalation modulates existing systems (ROE, morale, AI decisions) — no parallel combat engine
- Desperation index as pure function: Weighted composite, not stored state. Same inputs → same output
- Hysteresis prevents oscillation: De-escalation threshold = entry × 0.7
- Event-based coupling: escalation/ publishes events; other modules subscribe. No circular imports
- Optional via null config: escalation_config: null disables all logic. Zero cost when disabled
- Treaty→escalation mapping: Each prohibited weapon maps to a minimum escalation level
- Population-driven insurgency: Insurgency in population/, not combat/. Combat is a consequence
- SOF as dedicated engine: Qualitatively different from conventional operations
Backward Compatibility¶
All 5,980 pre-existing tests pass without modification. 9 new SimulationContext fields default to None. 4 new AmmoType values appended. New commander traits have defaults. New action/trigger/stratagem enum values appended. escalation_config defaults to None.
Known Limitations¶
- Fire zone model is simple (center + radius expansion, not cellular automaton)
- Insurgency engine needs external scenario wiring for real collateral/aid data (engine tick loop passes empty defaults)
- War termination ceasefire/armistice victory conditions are marker types — actual activation via engine tick loop
- Validation scenarios are simplified (no CBRN wiring for chemical employment test)
Postmortem¶
Scope: On target¶
All planned items delivered. ~32 YAML files. 9 new + ~18 modified source files. 345 tests (6 sub-phases: 75 + 56 + 59 + 62 + 46 + 47).
Quality: High¶
- Zero TODOs/FIXMEs in new code
- All values configurable via pydantic Config classes
- All modules follow DI pattern, get_logger, type hints, state protocol
- PRNG discipline: all randomness via injected
np.random.Generator
Integration: Modulation by design¶
Escalation layer modulates existing systems rather than creating parallel engines. ROE, morale, AI decisions, and population systems all receive escalation inputs through their existing interfaces. No new combat resolution path.
Deficits: 0 new¶
No new deficits discovered. All known limitations are design choices: - Fire zone model uses center + radius expansion (adequate for campaign-scale effects) - Insurgency engine scenario wiring passes empty defaults (caller must inject real data) - War termination victory conditions are activated by engine tick loop - Validation scenarios omit full CBRN wiring (component-level validation sufficient)
Test Performance¶
Phase 24 tests: 345 tests. Full suite: 6,325 tests. No degradation from Phase 23 baseline.