feat: tactical-wargame simulation primitives (Monte Carlo + clash) #45
Merged
wasabi opened 1 week ago

Summary

Adopts the constructive tactical-wargame concept as advisory probabilistic stress-testing.

  • services/simulation/resolution.py: monte_carlo (wraps any deterministic simulator as a black box, perturbs sampled inputs, returns p5/p50/p95 with per-draw failure isolation under a bounded pool) and resolve_clash (CRT-style two-sided attacker/defender outcome probabilities incl. mutual loss) plus clash_sweep.
  • Read-only convenience wrappers: digital_twin.monte_carlo_yield, stock_flow.monte_carlo_stock.
  • Advisory clash examples: clash_examples.stress_reserve (threat pressure vs. reserve adequacy), clash_examples.pest_vs_intervention.
  • Register read-only simulation_wargame report type.

Safety / boundary

  • All outputs are advisory/read-only; no governed-state writes.
  • The "opposing force" is shocks/threats/pests/market/competitor data ONLY — never stakeholder/community fragmentation (anti-capture governance). Any future proposal still routes through DRAFT-only tactical_opportunity.
  • Documented in AGENTS.md.

Tests

  • tests/test_simulation_resolution.py: distribution aggregation, seed reproducibility, per-draw failure isolation, per-draw connection factory, symmetric/dominant-attacker clash, stochastic reproducibility, concurrent isolated sweep. All pass; ruff clean on new files.
Commits were merged into target branch
  • feat: add tactical-wargame simulation primitives (Monte Carlo + clash)
    Adopt the constructive tactical-wargame concept as advisory probabilistic
    stress-testing. Add services/simulation/resolution.py with a Monte Carlo
    runner (wraps any deterministic simulator, returns p5/p50/p95 with
    per-draw failure isolation under a bounded pool) and a CRT-style
    resolve_clash (two-sided attacker/defender outcome probabilities, incl.
    mutual loss). Add clash_sweep for concurrent scenarios. Wire read-only
    convenience wrappers: digital_twin.monte_carlo_yield and
    StockFlowSimulator.monte_carlo_stock. Add advisory clash examples
    (stress_reserve: threat pressure vs. reserve adequacy; pest_vs_intervention).
    Register a read-only simulation_wargame report type.
    
    Boundary: the "opposing force" is shocks/threats/pests/market/
    competitor data only -- never stakeholder/community fragmentation
    (anti-capture governance). All outputs are advisory; no governed
    state writes.
    
    Co-Authored-By: opencode <noreply@opencode.ai>
    1 week ago
  • wasabi merged 1 week ago
1/1
Submitter wasabi
Target main
Source feat/tactical-wargame-sim
Jobs
Merge Strategy
Create Merge Commit
Watchers (1)
Reference
pull request KI-45
Please wait...
Connection lost or session expired, reload to recover
Page is in error, reload to recover