> 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/specs/phase24-session03-live-enemy-presentation/tasks.md).

# Task Checklist

**Session ID**: `phase24-session03-live-enemy-presentation` **Total Tasks**: 20 **Estimated Duration**: 3-4 hours **Created**: 2026-07-08

***

## Legend

* `[x]` = Completed
* `[ ]` = Pending
* `[P]` = Parallelizable (can run with other \[P] tasks)
* `[S2403]` = Session reference (phase 24, session 03)
* `TNNN` = Task ID

***

## Progress Summary

| Category       | Total  | Done   | Remaining |
| -------------- | ------ | ------ | --------- |
| Setup          | 2      | 2      | 0         |
| Foundation     | 5      | 5      | 0         |
| Implementation | 8      | 8      | 0         |
| Testing        | 5      | 5      | 0         |
| **Total**      | **20** | **20** | **0**     |

***

## Setup (2 tasks)

* [x] T001 \[S2403] Verify prerequisites: baseline web typecheck; confirm live-enemy reducer event shapes for `test_failure` spawn/clear, `build_error`/`build_fix`, `ts_errors`/`lint_error`, wraith stack source (`tool_result` error), and siege escalation in `apps/web/src/lib/gameProjection.ts` so integration tests use real shapes.
* [x] T002 \[S2403] Confirm the hero-coordinate computation and `battlefield2d-reduce-motion` CSS gating in `apps/web/src/components/battlefield/Battlefield.tsx` and existing battlefield CSS location for motion variants.

***

## Foundation (5 tasks)

* [x] T003 \[S2403] Create `apps/web/src/lib/liveLegion.ts` with named constants: `LIVE_LEGION_SKIRMISHER_VISIBLE_LIMIT`, `LIVE_LEGION_WRAITH_VISIBLE_LIMIT` (3), keep-gate anchor percentages, and presentation types (visible skirmisher entry with safe label, wraith entry, gremlin summary, ram/siege views).
* [x] T004 \[S2403] Implement safe label derivation for skirmisher paths and ram detail reusing `normalizeLegionIssuePathSegments` / `sanitizeLegionSectorLabel` (bounded, relative, redacting) - untrusted display input posture.
* [x] T005 \[S2403] Implement `liveLegionPresentation(legion)`: bounded visible skirmishers (stable order by `sinceAt` then path) + overflow count, wraiths capped at 3 by stack desc then heroId, gremlin total pressure (tsErrors + lint, with files context), ram and siege pass-through views, and total threat counts for the sr summary.
* [x] T006 \[S2403] Write pure tests in `apps/web/tests/liveLegion.test.ts`: zero states, caps/overflow, ordering, label privacy (absolute paths, hostile strings, non-ASCII), gremlin totals.
* [x] T007 \[S2403] Add motion-variant CSS (camp-fire-style flicker not needed; skirmisher pulse, ram slow-rock, gremlin jitter, wraith drift) gated under `.battlefield2d-frame:not(.battlefield2d-reduce-motion)` in the battlefield styles, with static defaults.

***

## Implementation (8 tasks)

* [x] T008 \[S2403] Create `LiveLegionLayer.tsx` skeleton beside `CampLayer.tsx`: layer div (pointer-events-none, absolute inset-0, z-\[16]), sr-only threat summary, exported test-id helpers, props (presentation model, heroCoordinates, reduceMotion, onSelectHero).
* [x] T009 \[S2403] Render skirmisher edge markers: red slash marker + count badge along the board edge, title + sr text with safe test path, overflow chip ("+N more"), `data-*` attributes mirroring CampLayer conventions.
* [x] T010 \[S2403] Render the ram at the keep-gate anchor: motion slow-rock variant, static cracked-gate chip twin, safe detail label, absent when `ram` is null.
* [x] T011 \[S2403] Render the gremlin count chip near the keep anchor: total pressure, hidden at zero, jitter motion variant with jitter-free static twin.
* [x] T012 \[S2403] Render wraith wisps beside hero coordinates: translucent wisp with stack badge, darkening by stack tier, native button whose accessible name names the hero and stack, click selects the hero (stopPropagation like hero tokens); off-board heroes counted in summary only.
* [x] T013 \[S2403] Render the siege banner with level chip when siege is active, offset from the keep anchor so ram and siege never overlap.
* [x] T014 \[S2403] Mount the layer in `Battlefield.tsx` after `ScannerStateLayer`, passing the presentation model (derived via `useGameStore` legion selector + `liveLegionPresentation`), the hero-coordinate record already computed for tokens, `reduceMotion`, and a hero-select handler that reuses the existing selection setter.
* [x] T015 \[S2403] Review pass: layer holds no state/timers, z-order below hero tokens verified, all caps/anchors exported constants, Biome clean.

***

## Testing (5 tasks)

* [x] T016 \[S2403] \[P] Component tests in `apps/web/tests/LiveLegionLayer.test.tsx`: each enemy kind renders with accessible names and static twins under `reduceMotion`, caps and overflow chips enforce, wraith click selects hero, zero states render nothing but the summary.
* [x] T017 \[S2403] \[P] Privacy component test: hostile paths/details in the legion model never render raw (absolute paths, secrets pattern, non-ASCII normalized).
* [x] T018 \[S2403] Integration test in `apps/web/tests/Battlefield.test.tsx`: dispatch a real `test_failure` through `applyEvent` (replayingSinceMs null) and assert the skirmisher marker appears; dispatch the clearing pass event and assert removal; assert ram appears on `build_error` and clears on `build_fix`.
* [x] T019 \[S2403] Run gates: full web project from repo root, web typecheck, Biome on changed files, ASCII/LF validation.
* [x] T020 \[S2403] Update implementation-notes.md with decisions (anchor values, caps) and any grounding corrections.

***

## Completion Checklist

Before marking session complete:

* [x] All tasks marked `[x]`
* [x] All tests passing
* [x] All files ASCII-encoded
* [x] implementation-notes.md updated
* [x] Ready for `/creview`

***

## Next Steps

Run `/creview` to review and repair all implementation changes before validation.


---

# 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/specs/phase24-session03-live-enemy-presentation/tasks.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.
