> 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/phase11-session02-test-fixture-hardening/tasks.md).

# Task Checklist

**Session ID**: `phase11-session02-test-fixture-hardening` **Total Tasks**: 25 **Estimated Duration**: 3-4 hours **Created**: 2026-05-31

***

## Legend

* `[x]` = Completed
* `[ ]` = Pending
* `[P]` = Parallelizable (can run with other \[P] tasks)
* `[S1102]` = Session reference (11=phase number, 02=session number)
* `TNNN` = Task ID

***

## Progress Summary

| Category       | Total  | Done   | Remaining |
| -------------- | ------ | ------ | --------- |
| Setup          | 3      | 3      | 0         |
| Foundation     | 6      | 6      | 0         |
| Implementation | 13     | 13     | 0         |
| Testing        | 3      | 3      | 0         |
| **Total**      | **25** | **25** | **0**     |

***

## Setup (3 tasks)

Initial state confirmation and source review.

### Cross-package

* [x] T001 \[S1102] Verify Phase 11 Session 02 prerequisites, completed Session 01 state, and cross-package fixture-hardening scope (`.spec_system/PRD/phase_11/session_02_test_fixture_hardening.md`)
* [x] T002 \[S1102] Review existing Codex fixture and test coverage across protocol, hooks, CLI, server, and web packages (`.spec_system/PRD/phase_11/PRD_phase_11.md`)
* [x] T003 \[S1102] \[P] Identify focused package test commands and sensitive-field sentinel strategy for fixture validation (`vitest.config.ts`)

***

## Foundation (6 tasks)

Shared fixtures, protocol guarantees, and package-specific fixture entry points.

### packages/protocol

* [x] T004 \[S1102] Extend shared hero CLI vocabulary tests for `codex-cli` display metadata and Claude compatibility expectations (`packages/protocol/tests/heroes.test.ts`)
* [x] T005 \[S1102] Extend ingest vocabulary tests for Codex lifecycle events, compact snake\_case aliases, compaction event names, and deprecated Claude aliases (`packages/protocol/tests/ingest.test.ts`)

### apps/hooks

* [x] T006 \[S1102] \[P] Create reusable redacted Codex hook payload fixture builders for lifecycle, Bash, `apply_patch`, permission, subagent, MCP, unknown, and compaction cases (`apps/hooks/tests/codexPayloadFixtures.js`)

### apps/server

* [x] T007 \[S1102] \[P] Extend the server Codex lifecycle fixture with MCP, unknown named event, compaction-safe, and redacted metadata cases (`apps/server/tests/fixtures/event-ingest/codexLifecycle.ts`)

### apps/web

* [x] T008 \[S1102] \[P] Extend web Codex fixture builders for display, mission filters, tool usage, replay, export, and private-field sentinel coverage (`apps/web/tests/codexAwarenessFixtures.ts`)

### Cross-package

* [x] T009 \[S1102] Record fixture source, sanitization boundaries, and limitations for event-ingest fixtures without raw payload examples (`apps/server/tests/fixtures/event-ingest/README.md`)

***

## Implementation (13 tasks)

Focused fixture-backed coverage and blocker-only fixes.

### apps/hooks

* [x] T010 \[S1102] Harden Codex hook-map assertions for every event, matcher, managed command, `FACTIONOS_CLI=codex-cli`, Windows command, timeout, and existing handler path (`apps/hooks/tests/codexHookMap.test.js`)
* [x] T011 \[S1102] Refactor hook runtime lifecycle coverage to consume shared Codex fixtures with isolated temp homes and no real user config access (`apps/hooks/tests/hookRuntime.test.js`)
* [x] T012 \[S1102] Add hook runtime coverage for `apply_patch` and MCP fixtures with bounded edit metadata, redacted paths, and no raw argument or patch bodies (`apps/hooks/tests/hookRuntime.test.js`)
* [x] T013 \[S1102] Extend hook normalization and spool tests for prompt, `tool_input`, `tool_response`, transcript, agent transcript, MCP args, unknown, and compaction-sensitive payloads (`apps/hooks/tests/hookNormalization.test.js`)

### apps/cli

* [x] T014 \[S1102] Harden provider-aware runtime tests for `init --cli claude`, `init --cli codex`, `init --cli all`, install alias, invalid provider no-write behavior, and idempotent reruns (`apps/cli/tests/cliRuntime.test.js`)
* [x] T015 \[S1102] Extend Codex installer edge-case tests for `CODEX_HOME`, malformed hooks, first backup preservation, managed hook replacement, backup restore, and surgical uninstall (`apps/cli/tests/codexInstaller.test.js`)
* [x] T016 \[S1102] Harden status and doctor output tests for Codex posture, disabled hooks, malformed hook files, and redaction of raw commands, prompts, tokens, paths, and payloads (`apps/cli/tests/cliRuntime.test.js`)

### apps/server

* [x] T017 \[S1102] Add server replay tests for full Codex lifecycle fixture persistence, Bash, `apply_patch`, permission, subagent lineage, mission completion, and no raw field leakage (`apps/server/tests/eventIngest.test.ts`)
* [x] T018 \[S1102] Add server tests for unknown Codex events, MCP-style tool names, compaction-safe events, bounded opaque metadata, and deterministic no-crash fallback behavior (`apps/server/tests/eventIngest.test.ts`)

### apps/web

* [x] T019 \[S1102] Add Codex hero card display tests with protocol-backed provider labels, accessible text, and no raw CLI fallback copy (`apps/web/tests/HeroCard.test.tsx`)
* [x] T020 \[S1102] Add Codex hero detail display tests for external OpenAI model metadata, provider labels, and drawer re-entry safety (`apps/web/tests/HeroDetailDrawer.test.tsx`)
* [x] T021 \[S1102] Add Codex mission filter and tool categorization tests for hero names, CLI/provider/model terms, Bash, `apply_patch`, and `mcp__*` names (`apps/web/tests/MissionLogFilter.test.tsx`)
* [x] T022 \[S1102] Add Codex replay and export redaction tests for prompts, command previews, broad paths, transcripts, terminal output, patch text, tokens, URLs, and MCP arguments (`apps/web/tests/replayLink.test.ts`, `apps/web/tests/exportSession.test.ts`)

***

## Testing (3 tasks)

Focused verification and repository hygiene.

### Cross-package

* [x] T023 \[S1102] Run focused Vitest suites for planned protocol, hooks, CLI, server, and web fixture coverage (`vitest.config.ts`)
* [x] T024 \[S1102] Run workspace typecheck, Biome format check, and Biome lint for touched code and test files (`package.json`)
* [x] T025 \[S1102] Run `git diff --check`, ASCII/LF validation, targeted sensitive-string review, and document commands plus fixture limitations (`.spec_system/specs/phase11-session02-test-fixture-hardening/implementation-notes.md`)

***

## 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 the validate workflow step

***

## Next Steps

Run the validate workflow step to verify session completeness.


---

# 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/phase11-session02-test-fixture-hardening/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.
