{
  "schema": "prism/prompt/1",
  "goal": "Roll one strike die in Karst: Zero Horizon, with cover and momentum. Then every roll in a fight can be replayed.",
  "pattern": "decisionTable",
  "repository": "afflom/karst-zero",
  "app": {
    "name": "karst-strike",
    "limits": [
      "It resolves one attacking die against no defending hits; the opposed pool sums the dice.",
      "Plating, resilience and subsystem rupture are outside it."
    ],
    "title": "Strike die",
    "purpose": "Decide what one d6 of a strike pool does against an undefended target behind no cover, low cover or a solid bulkhead, after the striker moved some sectors.",
    "fields": [
      {
        "name": "die",
        "kind": "number",
        "min": 0,
        "means": "the face the d6 shows",
        "max": 6
      },
      {
        "name": "cover",
        "kind": "choice",
        "values": [
          "none",
          "low",
          "solid"
        ],
        "means": "the cover between the striker and the target"
      },
      {
        "name": "momentum",
        "kind": "number",
        "min": 0,
        "means": "sectors the striker moved before the strike, 4 meaning 4 or more",
        "max": 4
      }
    ],
    "outcomes": [
      "critical",
      "hit",
      "miss",
      "blocked"
    ],
    "meanings": {
      "critical": "one net hit from a natural 6",
      "hit": "one net hit",
      "miss": "no net hit",
      "blocked": "line of sight is blocked, no hit"
    },
    "rules": [
      {
        "when": [
          {
            "field": "cover",
            "op": "is",
            "value": "solid"
          }
        ],
        "then": "blocked",
        "why": "src/CombatEngine.lex.tex resolveOpposedNetHits: cover level 2, a solid bulkhead, gives 0 net hits (bulkheadFullCoverBlocksLineOfSight)"
      },
      {
        "when": [
          {
            "field": "cover",
            "op": "is",
            "value": "none"
          },
          {
            "field": "die",
            "op": "=",
            "value": 6
          }
        ],
        "then": "critical",
        "why": "src/game/nemesisEngine.ts: the strike pool scores critical 6s"
      },
      {
        "when": [
          {
            "field": "cover",
            "op": "is",
            "value": "none"
          },
          {
            "field": "die",
            "op": ">=",
            "value": 4
          }
        ],
        "then": "hit",
        "why": "README Subsystem 2: the opposed strike pool hits on 4+"
      },
      {
        "when": [
          {
            "field": "cover",
            "op": "is",
            "value": "none"
          },
          {
            "field": "momentum",
            "op": ">=",
            "value": 4
          }
        ],
        "then": "hit",
        "why": "src/CombatEngine.lex.tex momentumBonusHit: 4 moved sectors add one hit to the pool"
      },
      {
        "when": [
          {
            "field": "cover",
            "op": "is",
            "value": "low"
          },
          {
            "field": "momentum",
            "op": ">=",
            "value": 4
          },
          {
            "field": "die",
            "op": "=",
            "value": 6
          }
        ],
        "then": "critical",
        "why": "src/CombatEngine.lex.tex: the momentum hit pays for the low cover auto-evade, so the natural 6 still lands"
      },
      {
        "when": [
          {
            "field": "cover",
            "op": "is",
            "value": "low"
          },
          {
            "field": "momentum",
            "op": ">=",
            "value": 4
          },
          {
            "field": "die",
            "op": ">=",
            "value": 4
          }
        ],
        "then": "hit",
        "why": "src/CombatEngine.lex.tex resolveOpposedNetHits: atk + momentumBonusHit minus coverAutoEvade leaves one net hit"
      }
    ],
    "otherwise": "miss",
    "otherwiseWhy": "src/CombatEngine.lex.tex coverAutoEvade: low cover cancels the single hit without a momentum charge, and a face below 4 without momentum scores none",
    "properties": [
      {
        "kind": "never",
        "when": [
          {
            "field": "cover",
            "op": "is",
            "value": "solid"
          }
        ],
        "then": "hit",
        "why": "nothing hits through a solid bulkhead"
      },
      {
        "kind": "never",
        "when": [
          {
            "field": "die",
            "op": "<",
            "value": 6
          }
        ],
        "then": "critical",
        "why": "only a natural 6 is a critical"
      },
      {
        "kind": "never",
        "when": [
          {
            "field": "cover",
            "op": "is",
            "value": "low"
          },
          {
            "field": "momentum",
            "op": "<",
            "value": 4
          }
        ],
        "then": "hit",
        "why": "partialCoverGrantsOneAutoEvade: without a momentum charge low cover cancels the one hit"
      },
      {
        "kind": "always",
        "when": [
          {
            "field": "cover",
            "op": "is",
            "value": "solid"
          }
        ],
        "then": "blocked",
        "why": "a solid bulkhead always blocks line of sight"
      }
    ],
    "examples": [
      {
        "request": "6 none 0",
        "response": "critical"
      },
      {
        "request": "4 none 0",
        "response": "hit"
      },
      {
        "request": "3 none 0",
        "response": "miss"
      },
      {
        "request": "3 none 4",
        "response": "hit"
      },
      {
        "request": "4 low 0",
        "response": "miss"
      },
      {
        "request": "6 low 0",
        "response": "miss"
      },
      {
        "request": "4 low 4",
        "response": "hit"
      },
      {
        "request": "6 low 4",
        "response": "critical"
      },
      {
        "request": "6 solid 4",
        "response": "blocked"
      }
    ]
  },
  "stakeholders": [
    {
      "name": "Player",
      "text": "Rolls the strike pool and needs every die resolved by the rules, the same on every screen.",
      "concerns": [
        "Correct answers"
      ]
    },
    {
      "name": "Game designer",
      "text": "Tunes cover and momentum and needs the never-hit guarantees to survive every change.",
      "concerns": [
        "Proved guarantees",
        "Correct answers"
      ]
    }
  ],
  "components": [
    {
      "name": "Karst client",
      "kind": "staticSite",
      "text": "The Karst: Zero Horizon client, src/game/nemesisEngine.ts, which rolls the pool and shows the combat breakdown."
    },
    {
      "name": "karst-kernel",
      "kind": "service",
      "text": "The no_std, forbid(unsafe_code) Rust kernel in crates/karst-kernel that realizes the Nemesis Core engine."
    }
  ],
  "threats": [
    {
      "name": "Loaded die",
      "text": "A client sends a face it did not roll, to turn a miss into a hit.",
      "stride": "tampering",
      "asset": "request",
      "likelihood": "medium",
      "impact": "major",
      "accepted": "The app resolves the face it is given; the roll itself belongs to the client, and the skirmish replay shows every face sent."
    },
    {
      "name": "Shot through a bulkhead",
      "text": "A strike through solid cover is counted as a hit, so a unit behind a bulkhead takes damage.",
      "stride": "elevationOfPrivilege",
      "asset": "answer",
      "likelihood": "low",
      "impact": "major",
      "control": {
        "name": "Line of sight proved",
        "text": "The app never answers hit behind solid cover, and the engine proves 0 net hits at cover level 2.",
        "evidence": [
          {
            "kind": "proof",
            "reference": "KarstStrikeProofs::inv001Holds"
          },
          {
            "kind": "review",
            "reference": "src/CombatEngine.lex.tex bulkheadFullCoverBlocksLineOfSight"
          }
        ]
      }
    },
    {
      "name": "Momentum without the move",
      "text": "A strike behind low cover is credited a momentum charge the striker did not earn.",
      "stride": "tampering",
      "asset": "answer",
      "likelihood": "medium",
      "impact": "minor",
      "control": {
        "name": "Four sectors required",
        "text": "Without 4 moved sectors low cover cancels the hit, proved for every request.",
        "evidence": [
          {
            "kind": "proof",
            "reference": "KarstStrikeProofs::inv003Holds"
          },
          {
            "kind": "review",
            "reference": "src/CombatEngine.lex.tex momentumChargeRequiresFourSectors"
          }
        ]
      }
    }
  ],
  "quality": [
    {
      "characteristic": "Interaction capability",
      "subcharacteristic": "Self-descriptiveness",
      "requirement": "Every face named",
      "text": "Each answer names what the die did: critical, hit, miss or blocked.",
      "measure": "Unnamed answers",
      "measureText": "Answers that are not one of the four outcome words.",
      "threshold": 0
    }
  ],
  "journeys": [
    {
      "stakeholder": "Player",
      "steps": [
        "REQ-001",
        "REQ-002",
        "REQ-003",
        "REQ-004",
        "otherwise"
      ]
    },
    {
      "stakeholder": "Game designer",
      "steps": [
        "REQ-005",
        "REQ-006",
        "INV-001",
        "INV-003",
        "INV-004"
      ]
    }
  ],
  "axioms": {
    "inv004Holds": [
      "Classical.choice",
      "Quot.sound",
      "propext"
    ]
  }
}
