> 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/sessions/phase23-session06-battlefield-camp-layer/validation.md).

# Validation Report

**Session ID**: `phase23-session06-battlefield-camp-layer` **Package**: apps/web **Validated**: 2026-07-05 **Result**: PASS

## Validation Summary

| Check                     | Status | Notes                                                                                                                        |
| ------------------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------- |
| Code Review               | PASS   | `code-review.md` has `Result: RESOLVED` and scopes all changes since base commit `9bd52bab83a07b4ca415b0d864f8df491d9b1194`. |
| Tasks Complete            | PASS   | 22/22 tasks marked `[x]`.                                                                                                    |
| Files Exist               | PASS   | 4/4 deliverables found and non-empty.                                                                                        |
| ASCII Encoding            | PASS   | Deliverables are ASCII text with LF line endings.                                                                            |
| Tests Passing             | PASS   | Focused Battlefield: 20/20 passed; full suite: 3247 passed, 1 skipped, 0 failed.                                             |
| Database/Schema Alignment | N/A    | No DB-layer or schema changes in touched app files; project conventions list Database as not configured.                     |
| Success Criteria          | PASS   | Functional, testing, non-functional, and quality gate criteria verified by inspection and commands.                          |
| Conventions               | PASS   | `.spec_system/CONVENTIONS.md` exists; Biome format/lint, TypeScript, Vitest, and structure checks passed.                    |
| Security & GDPR           | PASS   | Security PASS; GDPR N/A. See `security-compliance.md`.                                                                       |
| Behavioral Quality        | PASS   | Application-code spot-check found no high-severity or low-severity violations.                                               |
| UI Product Surface        | PASS   | Camp UI exposes product-facing camp copy only; no banned diagnostics on the primary Battlefield surface.                     |

**Overall**: PASS

## Evidence Ledger

| Check               | Command or Inspection                                                                                                                                                                                                               | Result          | Evidence / Blocker                                                                                                                                                                         |
| ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Project state       | `if [ -d ".spec_system/scripts" ]; then bash .spec_system/scripts/analyze-project.sh --json; else bash /home/aiwithapex/.codex/plugins/cache/apexdev/apex-spec/2.2.18-codex/skills/apex-spec/scripts/analyze-project.sh --json; fi` | PASS            | Current session is `phase23-session06-battlefield-camp-layer`; session dir exists; monorepo true; package context `apps/web`; phase 23 in progress.                                        |
| Package/base        | `spec.md` inspection and `git rev-parse --verify 9bd52bab83a07b4ca415b0d864f8df491d9b1194^{commit}`                                                                                                                                 | PASS            | Spec declares Package `apps/web`; base commit exists.                                                                                                                                      |
| Code review         | \`rg -n "^\*\*Result\*\*:                                                                                                                                                                                                           | ^\*\*Scope\*\*: | ^\*\*Base Commit\*\*:" .spec\_system/specs/phase23-session06-battlefield-camp-layer/code-review\.md\`                                                                                      |
| Task completion     | `rg -n "^- \[[ x]\] T[0-9]{3}" .spec_system/specs/phase23-session06-battlefield-camp-layer/tasks.md`                                                                                                                                | PASS            | 22 task rows found and all are `[x]`.                                                                                                                                                      |
| Deliverables        | `wc -l apps/web/src/components/battlefield/CampLayer.tsx apps/web/src/components/battlefield/Battlefield.tsx apps/web/src/index.css apps/web/tests/Battlefield.test.tsx`                                                            | PASS            | 374, 688, 723, and 733 lines respectively; all files exist and are non-empty.                                                                                                              |
| ASCII/LF            | `file ...`; `perl -ne 'if (/[^\\x00-\\x7F]/) ...' ...`; `perl -ne 'if (/\\r/) ...' ...`                                                                                                                                             | PASS            | `file` reports ASCII text for all deliverables; no non-ASCII or CRLF output from Perl checks.                                                                                              |
| Focused tests       | `source "$HOME/.nvm/nvm.sh" && nvm use 26.2.0 >/dev/null && npm test -- apps/web/tests/Battlefield.test.tsx`                                                                                                                        | PASS            | 1 file passed; 20 tests passed; 0 failed.                                                                                                                                                  |
| Package typecheck   | `source "$HOME/.nvm/nvm.sh" && nvm use 26.2.0 >/dev/null && npm --workspace @factionos/web run typecheck`                                                                                                                           | PASS            | `tsc -b --noEmit` completed successfully.                                                                                                                                                  |
| Format              | `source "$HOME/.nvm/nvm.sh" && nvm use 26.2.0 >/dev/null && npm run format:check`                                                                                                                                                   | PASS            | Biome checked 778 files; no fixes applied.                                                                                                                                                 |
| Lint                | `source "$HOME/.nvm/nvm.sh" && nvm use 26.2.0 >/dev/null && npm run lint`                                                                                                                                                           | PASS            | Biome checked 780 files; no fixes applied.                                                                                                                                                 |
| Workspace typecheck | `source "$HOME/.nvm/nvm.sh" && nvm use 26.2.0 >/dev/null && npm run typecheck --workspaces --if-present`                                                                                                                            | PASS            | Typecheck passed for adapters, server, warroom, web, protocol, and public-website.                                                                                                         |
| Full tests          | `source "$HOME/.nvm/nvm.sh" && nvm use 26.2.0 >/dev/null && npm test`                                                                                                                                                               | PASS            | 278 test files passed, 1 skipped; 3247 tests passed, 1 skipped; 0 failed.                                                                                                                  |
| Whitespace          | `git diff --check`                                                                                                                                                                                                                  | PASS            | No whitespace errors.                                                                                                                                                                      |
| Database/schema     | \`rg -n "CREATE TABLE                                                                                                                                                                                                               | ALTER TABLE     | migration                                                                                                                                                                                  |
| Success criteria    | Spec criteria inspection plus focused tests, typecheck, format, lint, full tests, and diff check                                                                                                                                    | PASS            | Criteria are covered by app code inspection, `Battlefield.test.tsx` coverage, and quality gates listed above.                                                                              |
| Conventions         | `.spec_system/CONVENTIONS.md` inspection plus `npm run format:check`, `npm run lint`, `npm run typecheck --workspaces --if-present`, `npm test`                                                                                     | PASS            | Repo uses npm workspaces, Biome, TypeScript, and Vitest; all relevant convention gates passed.                                                                                             |
| Security/GDPR       | `security-compliance.md` plus secret/dependency/DB searches                                                                                                                                                                         | PASS            | No security findings; GDPR N/A because no personal data handling was introduced.                                                                                                           |
| Behavioral quality  | Targeted inspection of `CampLayer.tsx`, `Battlefield.tsx`, `Battlefield.test.tsx`, and `index.css`; focused tests                                                                                                                   | PASS            | Native controls, existing mutation guard delegation, no resource acquisition, no new trust boundary, contract-aligned props/selectors, and explicit tests.                                 |
| UI product surface  | React Testing Library render coverage in `Battlefield.test.tsx`; targeted code/CSS inspection; banned-diagnostics search                                                                                                            | PASS            | Primary Battlefield camp surface shows tier, sector, HP, issue count, and Banish only; no debug panels, raw issue details, route ownership, package/version, or readiness copy introduced. |

## 1. Code Review Gate

### Status: PASS

**Report**: `code-review.md` **Result**: RESOLVED **Issues**: None remaining. The review fixed one low-severity test cleanup issue by unstubbing globals in `Battlefield.test.tsx`.

## 2. Task Completion

### Status: PASS

**Tasks**: 22/22 complete **Incomplete tasks**: None

## 3. Deliverables Verification

### Status: PASS

| File                                                  | Found | Status           |
| ----------------------------------------------------- | ----- | ---------------- |
| `apps/web/src/components/battlefield/CampLayer.tsx`   | Yes   | PASS - 374 lines |
| `apps/web/src/components/battlefield/Battlefield.tsx` | Yes   | PASS - 688 lines |
| `apps/web/src/index.css`                              | Yes   | PASS - 723 lines |
| `apps/web/tests/Battlefield.test.tsx`                 | Yes   | PASS - 733 lines |

**Missing deliverables**: None

All deliverables are under the declared package boundary `apps/web`.

## 4. ASCII Encoding Check

### Status: PASS

| File                                                  | Encoding | Line Endings | Status |
| ----------------------------------------------------- | -------- | ------------ | ------ |
| `apps/web/src/components/battlefield/CampLayer.tsx`   | ASCII    | LF           | PASS   |
| `apps/web/src/components/battlefield/Battlefield.tsx` | ASCII    | LF           | PASS   |
| `apps/web/src/index.css`                              | ASCII    | LF           | PASS   |
| `apps/web/tests/Battlefield.test.tsx`                 | ASCII    | LF           | PASS   |

**Encoding issues**: None

## 5. Test Results

### Status: PASS

| Metric                 | Value                                   |
| ---------------------- | --------------------------------------- |
| Focused Tests          | 20 passed, 0 failed                     |
| Full Suite Total Tests | 3248                                    |
| Full Suite Passed      | 3247                                    |
| Full Suite Failed      | 0                                       |
| Full Suite Skipped     | 1                                       |
| Coverage               | Not reported by the validation commands |

**Failed tests**: None

## 6. Database/Schema Alignment

### Status: N/A

*N/A because the session introduced no DB-layer changes.*

**Evidence**: `rg -n "CREATE TABLE|ALTER TABLE|migration|schema|drizzle|prisma|knex|sqlite|postgres|database|db\.|execute\(|query\(" apps/web/src/components/battlefield/CampLayer.tsx apps/web/src/components/battlefield/Battlefield.tsx apps/web/src/index.css apps/web/tests/Battlefield.test.tsx` returned no matches. `.spec_system/CONVENTIONS.md` lists Database as not configured.

**Issues found**: None

## 7. Success Criteria

From spec.md:

**Functional requirements**:

* [x] Ranked camps render on the battlefield only from current projection camp data. Evidence: `Battlefield.tsx` uses `rankVisibleLegionCamps` with `gameProjection.legion.camps`; focused tests verify render order and count.
* [x] Each camp is a native, keyboard-accessible control with tier, HP, issue count, and safe sector label in its accessible name. Evidence: `CampLayer.tsx` renders `button` controls with generated `aria-label`; focused tests assert accessible names.
* [x] Activating a camp opens the existing Quest Board camp focus for real current issue ids. Evidence: `Battlefield.tsx` calls `focusQuestBoardCamp`; focused tests assert focus state with issue ids.
* [x] Dry Banish entry uses the existing Quest Board Banish action and does not create progress, rewards, camp damage, or projection side effects. Evidence: `Battlefield.tsx` delegates to `banishQuestBoardCamp`; no protocol/storage/server changes; focused tests assert dismiss route call.
* [x] Camps sit below hero tokens and do not disable empty-terrain clearing. Evidence: `CampLayer` z-index 15, empty clear z-index 10, hero layer z-index 20; focused tests assert z-order and terrain clearing.
* [x] Champion Mode limits visible camps for one-hero and two-hero boards. Evidence: selector-led render and focused tests assert solo visible limit of 3.
* [x] Entrenched camps are quieter while remaining keyboard accessible and inspectable. Evidence: muted/edge attributes and styles in `CampLayer.tsx` and `index.css`; focused tests assert entrenched edge presentation.
* [x] Reduced-motion mode preserves complete static HP, issue, tier, and sector information. Evidence: reduced-motion CSS removes camp animation/transition while preserving chips/labels; focused tests assert reduced-motion marker data.

**Testing requirements**:

* [x] `apps/web/tests/Battlefield.test.tsx` covers camp rendering, accessibility, callbacks, ordering, Champion Mode limits, z-order, empty-terrain clearing, reduced-motion static equivalents, and entrenched presentation. Evidence: focused test cases at `Battlefield.test.tsx` cover these assertions.
* [x] `npm test -- apps/web/tests/Battlefield.test.tsx` passes. Evidence: 20/20 tests passed.
* [x] `npm --workspace @factionos/web run typecheck` passes. Evidence: web `tsc -b --noEmit` completed successfully.
* [x] `npm run format:check` passes. Evidence: Biome checked 778 files with no fixes applied.

**Non-functional requirements**:

* [x] No new protocol event, server route, storage key, hosted dependency, art asset, required audio asset, or trusted-erasure claim introduced. Evidence: changed file inventory is limited to web component/CSS/test plus spec state/docs; dependency manifests unchanged.
* [x] Camp marker UI does not render raw issue messages, prompts, transcripts, terminal output, file contents, provider payloads, environment values, secrets, broad absolute paths, or diagnostics. Evidence: `CampLayer` visible copy is tier, sector, HP, issue count, and Banish; banned-diagnostics search found no new surface issue.
* [x] Battlefield remains readable at common desktop and mobile board sizes. Evidence: CSS uses bounded marker width, responsive mobile sizing, fixed board aspect ratio, edge placement, and reduced-motion static labels; focused tests verify placement attributes and z-order.

**Quality gates**:

* [x] All files ASCII-encoded. Evidence: `file` and Perl ASCII checks passed.
* [x] Unix LF line endings. Evidence: Perl CRLF check returned no output.
* [x] Code follows project conventions. Evidence: Biome format/lint, TypeScript, workspace typecheck, and Vitest passed.
* [x] Primary user-facing surfaces contain product-facing copy only. Evidence: UI product-surface check passed.

## 8. Conventions Compliance

### Status: PASS

*`.spec_system/CONVENTIONS.md` exists.*

**Categories spot-checked**: naming, file structure, error handling, comments, testing, and database conventions when relevant.

**Convention violations**: None. `CampLayer.tsx` is under the battlefield component tree, app wiring stays in `Battlefield.tsx`, styles are in `index.css`, tests stay in `apps/web/tests`, Biome and TypeScript pass, and no DB conventions apply.

## 9. Security & GDPR Compliance

### Status: PASS

**Full report**: See `security-compliance.md` in this session directory.

#### Summary

| Area     | Status | Findings |
| -------- | ------ | -------- |
| Security | PASS   | 0 issues |
| GDPR     | N/A    | 0 issues |

**Critical violations**: None

## 10. Behavioral Quality Spot-Check

### Status: PASS

*Session produced application code.*

**Checklist applied**: Yes **Files spot-checked**: `apps/web/src/components/battlefield/CampLayer.tsx`, `apps/web/src/components/battlefield/Battlefield.tsx`, `apps/web/src/index.css`, `apps/web/tests/Battlefield.test.tsx`

**Categories spot-checked**: trust boundaries, resource cleanup, mutation safety, failure paths, and contract alignment.

**Violations found**: None. Camp rendering accepts typed selector output, native controls provide platform input/focus support, dry Banish delegates duplicate-trigger/rollback semantics to the existing store action, no scoped resources are acquired, and focused tests cover the relevant contracts.

**Fixes applied during validation**: None

## 11. UI Product-Surface Spot-Check

### Status: PASS

*Session changed user-facing UI.*

**Surfaces inspected**: `Battlefield` component rendered by `apps/web/tests/Battlefield.test.tsx`; code/CSS inspection of `CampLayer.tsx`, `Battlefield.tsx`, and `index.css`.

**Diagnostics found in primary UI**: None. The new visible camp surface renders product-facing tier, safe sector, HP, issue-count, and Banish copy. Hidden test/data attributes are not user-facing diagnostics.

**Allowed debug/admin surfaces**: None

**Fixes applied during validation**: None

## Validation Result

### PASS

All validation gates passed for `phase23-session06-battlefield-camp-layer`.

### Unresolved Failures And Blockers

None

## Next Steps

Next command: `updateprd`


---

# 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/sessions/phase23-session06-battlefield-camp-layer/validation.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.
