> For the complete documentation index, see [llms.txt](https://faction-os.gitbook.io/faction-os-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://faction-os.gitbook.io/faction-os-docs/.spec_system/archive/phases/phase_24/session_01_pure_strike_and_combo_model.md).

# Session 01: Pure Strike And Combo Model

**Session ID**: `phase24-session01-pure-strike-and-combo-model` **Package**: apps/web **Status**: Not Started **Estimated Tasks**: \~18 **Estimated Duration**: 2-4 hours

***

## Objective

Build the pure, side-effect-free combat playback model - strike classification, combo merging, stage-prop milestones, and per-category SFX rate-limit counters - as a new `apps/web/src/lib/combatPlayback.ts` module with focused tests and no DOM or store dependencies.

***

## Scope

### In Scope (MVP)

* Strike classification: map tool-event shapes to strike kinds (Edit/Write = hammer, Bash = fire, Read/Grep = scout ring, Task = peon flank, unknown = generic strike), with `tool_result` error mapping to a counterattack.
* Combo merging: strikes of one category within a short window merge into combo stages that escalate visually instead of re-firing; window duration and stage thresholds land as named tuning constants.
* Stage-prop milestones: duration thresholds at which a long linked mission accumulates siege props (ladders, trenches), expressed as pure derivation from mission elapsed time.
* Per-category SFX rate-limit counters: a pure allow/deny decision given a category, timestamp history, and N-per-minute constant.
* Safe-label guarantees: any label derivation (for example a skirmisher test path) uses bounded safe strings and is covered by privacy-focused tests.
* Focused pure tests following the existing `apps/web/tests` lib-test conventions.

### Out of Scope

* DOM rendering, React components, effects layers, audio playback.
* Store wiring, projection reducer changes, link recording.
* Actual SFX cue definitions (Session 06).

***

## Prerequisites

* [ ] Phase 23 complete; projection substrate for live enemies verified.

***

## Deliverables

1. `apps/web/src/lib/combatPlayback.ts` pure module with named tuning constants.
2. Focused test file covering classification, combo stages, stage props, rate-limit decisions, and safe-label boundaries.

***

## Success Criteria

* [ ] All strike kinds and the counterattack path classify deterministically from event shapes with no RNG.
* [ ] Combo merging provably caps visual event frequency for a simulated 45-minute event stream.
* [ ] Rate-limit decisions silence a category after its N-per-minute budget while allowing other categories.
* [ ] No raw prompts, output, absolute paths, or provider payloads appear in any derived label; tests enforce it.
* [ ] Web typecheck and focused tests pass.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://faction-os.gitbook.io/faction-os-docs/.spec_system/archive/phases/phase_24/session_01_pure_strike_and_combo_model.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
