> 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-session06-world-cues-and-bark-reuse/validation.md).

# Validation Report

**Session ID**: `phase24-session06-world-cues-and-bark-reuse` **Package**: apps/web **Validated**: 2026-07-08 **Result**: PASS

## Validation Summary

| Check                     | Status | Notes                                                                                                                                |
| ------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------ |
| Code Review               | PASS   | `code-review.md` exists with `Result: RESOLVED` and lists all changes since base commit `971f022685f53643def9d1ba5cfb59e9e8367fa2`.  |
| Tasks Complete            | PASS   | 20/20 tasks complete.                                                                                                                |
| Files Exist               | PASS   | 14/14 listed deliverables exist and are non-empty.                                                                                   |
| ASCII Encoding            | PASS   | Deliverables are ASCII text with LF endings; `git diff --check` found no whitespace errors.                                          |
| Tests Passing             | PASS   | Focused suite: 74/74 passed. Full suite: 3375/3376 passed, 1 skipped, 0 failed.                                                      |
| Database/Schema Alignment | N/A    | No DB-layer, migration, schema, server, protocol, or package manifest changes.                                                       |
| Success Criteria          | PASS   | Functional, testing, non-functional, and quality criteria are covered by implementation artifacts and current verification commands. |
| Conventions               | PASS   | TypeScript, Vitest, Biome format/lint, package boundary, and no-new-media conventions passed.                                        |
| Security & GDPR           | PASS   | Security PASS; GDPR N/A. See `security-compliance.md`.                                                                               |
| Behavioral Quality        | PASS   | Trust boundary, cleanup, duplicate prevention, failure path, and contract spot-check passed.                                         |
| UI Product Surface        | PASS   | Battlefield hook wiring adds no rendered debug, diagnostic, or world-cue UI.                                                         |

**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.19-codex/skills/apex-spec/scripts/analyze-project.sh --json; fi`       | PASS              | Current session `phase24-session06-world-cues-and-bark-reuse`; monorepo true; package candidate `apps/web`; session files present. |
| Package context     | `spec.md` inspection                                                                                                                                                                                                                      | PASS              | `Package: apps/web`; all listed deliverables are inside `apps/web`.                                                                |
| Review base         | `git rev-parse --verify --quiet "971f022685f53643def9d1ba5cfb59e9e8367fa2^{commit}"`                                                                                                                                                      | PASS              | Base commit resolved.                                                                                                              |
| Code review         | `code-review.md` inspection plus `git diff --name-status 971f022685f53643def9d1ba5cfb59e9e8367fa2` and `git ls-files --others --exclude-standard`                                                                                         | PASS              | `Result: RESOLVED`; review surface matches current tracked and untracked session files.                                            |
| Task completion     | `grep -Ec '^- \\[[ x]\\] T[0-9]+' tasks.md`; `grep -Ec '^- \\[x\\] T[0-9]+' tasks.md`; \`grep -En '^- \\\[ \\] T\[0-9]+' tasks.md                                                                                                         |                   | true\`                                                                                                                             |
| Deliverables        | Shell `-s` check over the 14 files listed in `spec.md` deliverables                                                                                                                                                                       | PASS              | 14/14 files exist and are non-empty.                                                                                               |
| ASCII/LF            | `file [deliverables]`; `LC_ALL=C grep -n '[^[:print:][:space:]]' [deliverables]`; `grep -l $'\\r' [deliverables]`; `git diff --check 971f022685f53643def9d1ba5cfb59e9e8367fa2`                                                            | PASS              | Deliverables reported ASCII text; no non-ASCII or CRLF output; diff check produced no errors.                                      |
| Focused tests       | `npm test -- --run apps/web/tests/audioRuntime.test.ts apps/web/tests/fileVoiceSynth.test.ts apps/web/tests/worldCues.test.ts apps/web/tests/useWorldCues.test.tsx apps/web/tests/Battlefield.test.tsx`                                   | PASS              | 5 test files, 74 tests passed. Battlefield emitted known non-fatal React `act(...)` warnings.                                      |
| Web typecheck       | `npm --workspace apps/web run typecheck`                                                                                                                                                                                                  | PASS              | `tsc -b --noEmit` completed successfully.                                                                                          |
| Full tests          | `npm test`                                                                                                                                                                                                                                | PASS              | 287 test files passed, 1 skipped; 3375 tests passed, 1 skipped; 0 failed.                                                          |
| Workspace typecheck | `npm run typecheck --workspaces --if-present`                                                                                                                                                                                             | PASS              | adapters, server, warroom, web, protocol, and public-website typechecks passed; Astro reported 0 errors, 0 warnings, 0 hints.      |
| Format              | `npm run format:check`                                                                                                                                                                                                                    | PASS              | Biome checked 791 files with no fixes applied.                                                                                     |
| Lint                | `npm run lint`                                                                                                                                                                                                                            | PASS              | Biome checked 793 files with no fixes applied.                                                                                     |
| Database/schema     | \`git diff --name-only 971f022685f53643def9d1ba5cfb59e9e8367fa2 -- . ':!package.json' ':!package-lock.json'                                                                                                                               | rg -n '(^         | /)(migrations?                                                                                                                     |
| Dependencies        | `git diff --name-only 971f022685f53643def9d1ba5cfb59e9e8367fa2 -- package.json package-lock.json apps/*/package.json packages/*/package.json public-website/package.json public-demo/package.json`                                        | PASS              | No dependency manifest or lockfile changed.                                                                                        |
| Media boundary      | `git diff --name-only 971f022685f53643def9d1ba5cfb59e9e8367fa2 -- apps/web/public assets public-demo public-website`                                                                                                                      | PASS              | No new audio/media/public asset files were added by this session.                                                                  |
| Success criteria    | \`rg -n "SFX\_FILES\\.world                                                                                                                                                                                                               | WORLD\_CUE\_KINDS | playWorldCue                                                                                                                       |
| Security/GDPR       | `npm run security:secrets`; targeted `rg`; static inspection of reviewed files                                                                                                                                                            | PASS              | Secret scan passed; no source network/storage/eval/secret sinks added; labels and failure details are redacted; GDPR N/A.          |
| Behavioral quality  | Targeted inspection of `apps/web/src/lib/worldCues.ts`, `apps/web/src/store/useWorldCues.ts`, `apps/web/src/lib/audioRuntime.ts`, `apps/web/src/store/useAudioRuntimeStore.ts`, and `apps/web/src/components/battlefield/Battlefield.tsx` | PASS              | Input validation, replay/future filtering, rate limiting, duplicate guards, cleanup, and contract alignment are present.           |
| UI product surface  | \`rg -n "debug                                                                                                                                                                                                                            | diagnostic        | telemetry                                                                                                                          |

## 1. Code Review Gate

### Status: PASS

**Report**: `code-review.md` **Result**: RESOLVED **Issues**: None unresolved. Review fixed one high-severity test mock export gap and one medium disabled-audio rate-budget issue before validation.

## 2. Task Completion

### Status: PASS

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

## 3. Deliverables Verification

### Status: PASS

| File                                                  | Found | Status |
| ----------------------------------------------------- | ----- | ------ |
| `apps/web/src/lib/worldCues.ts`                       | Yes   | PASS   |
| `apps/web/src/store/useWorldCues.ts`                  | Yes   | PASS   |
| `apps/web/tests/worldCues.test.ts`                    | Yes   | PASS   |
| `apps/web/tests/useWorldCues.test.tsx`                | Yes   | PASS   |
| `apps/web/src/lib/sfxAssets.ts`                       | Yes   | PASS   |
| `apps/web/src/lib/voiceSynth.ts`                      | Yes   | PASS   |
| `apps/web/src/lib/fileVoiceSynth.ts`                  | Yes   | PASS   |
| `apps/web/src/lib/audioRuntime.ts`                    | Yes   | PASS   |
| `apps/web/src/store/useAudioRuntimeStore.ts`          | Yes   | PASS   |
| `apps/web/src/store/useVoiceBarks.ts`                 | Yes   | PASS   |
| `apps/web/src/components/battlefield/Battlefield.tsx` | Yes   | PASS   |
| `apps/web/tests/audioRuntime.test.ts`                 | Yes   | PASS   |
| `apps/web/tests/fileVoiceSynth.test.ts`               | Yes   | PASS   |
| `apps/web/tests/Battlefield.test.tsx`                 | Yes   | PASS   |

**Missing deliverables**: None

## 4. ASCII Encoding Check

### Status: PASS

| File                                                  | Encoding | Line Endings | Status |
| ----------------------------------------------------- | -------- | ------------ | ------ |
| `apps/web/src/lib/worldCues.ts`                       | ASCII    | LF           | PASS   |
| `apps/web/src/store/useWorldCues.ts`                  | ASCII    | LF           | PASS   |
| `apps/web/tests/worldCues.test.ts`                    | ASCII    | LF           | PASS   |
| `apps/web/tests/useWorldCues.test.tsx`                | ASCII    | LF           | PASS   |
| `apps/web/src/lib/sfxAssets.ts`                       | ASCII    | LF           | PASS   |
| `apps/web/src/lib/voiceSynth.ts`                      | ASCII    | LF           | PASS   |
| `apps/web/src/lib/fileVoiceSynth.ts`                  | ASCII    | LF           | PASS   |
| `apps/web/src/lib/audioRuntime.ts`                    | ASCII    | LF           | PASS   |
| `apps/web/src/store/useAudioRuntimeStore.ts`          | ASCII    | LF           | PASS   |
| `apps/web/src/store/useVoiceBarks.ts`                 | ASCII    | LF           | PASS   |
| `apps/web/src/components/battlefield/Battlefield.tsx` | ASCII    | LF           | PASS   |
| `apps/web/tests/audioRuntime.test.ts`                 | ASCII    | LF           | PASS   |
| `apps/web/tests/fileVoiceSynth.test.ts`               | ASCII    | LF           | PASS   |
| `apps/web/tests/Battlefield.test.tsx`                 | ASCII    | LF           | PASS   |

**Encoding issues**: None

## 5. Test Results

### Status: PASS

| Metric                | Value                           |
| --------------------- | ------------------------------- |
| Focused Session Tests | 74 passed / 74                  |
| Full Test Files       | 287 passed / 288, 1 skipped     |
| Total Tests           | 3376                            |
| Passed                | 3375                            |
| Failed                | 0                               |
| Skipped               | 1                               |
| Coverage              | Not collected by these commands |

**Failed tests**: None

## 6. Database/Schema Alignment

### Status: N/A

**Evidence**: `git diff --name-only` with DB/schema filename scan returned no migration, schema, DB, SQL, ORM, or server/protocol changes. The session adds transient client-side audio cue derivation only.

**Issues found**: None

## 7. Success Criteria

From spec.md:

**Functional requirements**:

* PASS - Six world cue kinds are typed in `sfxAssets.ts`, synthesized in `voiceSynth.ts`, routed through `fileVoiceSynth.ts` and `audioRuntime.ts`, and covered by focused tests.
* PASS - Camp-hit, camp-collapse, ram-crash, ram-break-triumph, skirmisher red-slash, and flare attention derive from existing combat/live/focus/event anchors in `worldCues.ts`.
* PASS - Hero actor barks reuse `buildHeroBarkRequest` and the runtime store for wraith spawn, verified camp kill, and linked mission completion.
* PASS - `shouldPlayCue` histories are threaded in `worldCues.ts`; tests prove rate limits suppress audio while candidates remain derivable.
* PASS - Disabled, muted, unsupported, replayed, unlinked, future, and duplicate cases are covered by runtime, pure, hook, and Battlefield tests.

**Testing requirements**:

* PASS - Pure cue derivation and rate limiting tests pass in `apps/web/tests/worldCues.test.ts`.
* PASS - Hook tests pass in `apps/web/tests/useWorldCues.test.tsx`.
* PASS - Runtime and adapter tests pass in `apps/web/tests/audioRuntime.test.ts` and `apps/web/tests/fileVoiceSynth.test.ts`.
* PASS - Battlefield integration test covers event-to-cue routing and asserts no debug UI.

**Quality gates**:

* PASS - ASCII/LF checks passed.
* PASS - `npm --workspace apps/web run typecheck` passed.
* PASS - `npm test`, `npm run typecheck --workspaces --if-present`, `npm run format:check`, and `npm run lint` passed.

## 8. Conventions Compliance

### Status: PASS

**Categories spot-checked**: naming, file structure, error handling, comments, testing, package boundary, media/dependency boundary, and database relevance.

**Convention violations**: None

## 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

**Checklist applied**: Yes **Files spot-checked**: `apps/web/src/lib/worldCues.ts`, `apps/web/src/store/useWorldCues.ts`, `apps/web/src/lib/audioRuntime.ts`, `apps/web/src/store/useAudioRuntimeStore.ts`, `apps/web/src/components/battlefield/Battlefield.tsx`

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

**Violations found**: None

**Fixes applied during validation**: None

## 11. UI Product-Surface Spot-Check

### Status: PASS

**Surfaces inspected**: Battlefield hook wiring and `apps/web/tests/Battlefield.test.tsx` event-to-cue integration coverage. **Diagnostics found in primary UI**: None **Allowed debug/admin surfaces**: None **Fixes applied during validation**: None

## Validation Result

### PASS

Session 06 satisfies the review gate, task checklist, deliverables, encoding, tests, schema boundary, success criteria, conventions, security/GDPR, behavioral quality, and UI product-surface checks.

### 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/specs/phase24-session06-world-cues-and-bark-reuse/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.
