> 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-session03-end-to-end-validation-and-integration-fixes/implementation-notes.md).

# Implementation Notes

**Session ID**: `phase11-session03-end-to-end-validation-and-integration-fixes` **Package**: Cross-cutting **Started**: 2026-05-31 16:09 **Last Updated**: 2026-05-31 16:50

***

## Session Progress

| Metric              | Value   |
| ------------------- | ------- |
| Tasks Completed     | 25 / 25 |
| Estimated Remaining | 0 hours |
| Blockers            | 0       |

***

## Task Log

### 2026-05-31 - Session Start

**Environment verified**:

* [x] Prerequisites confirmed
* [x] Tools available
* [x] Directory structure ready
* [x] Database not applicable

**Preflight commands**:

* `bash .spec_system/scripts/analyze-project.sh --json`
* `bash .spec_system/scripts/check-prereqs.sh --json --env`
* `bash .spec_system/scripts/check-prereqs.sh --json --tools "node,npm,codex,npx"`

***

### Task T001 - Verify prerequisites and cross-package scope

**Started**: 2026-05-31 16:09 **Completed**: 2026-05-31 16:09 **Duration**: 1 minute

**Notes**:

* Confirmed current session is `phase11-session03-end-to-end-validation-and-integration-fixes`.
* Confirmed Phase 11 Session 03 is cross-cutting and may touch CLI, hooks, server, web, protocol, docs, and e2e artifacts.
* Confirmed prerequisite sessions listed in the spec are marked complete in `.spec_system/state.json` and Session 02 validation passed.

**Files Changed**:

* `.spec_system/specs/phase11-session03-end-to-end-validation-and-integration-fixes/implementation-notes.md` - Created session implementation notes and recorded preflight.
* `.spec_system/specs/phase11-session03-end-to-end-validation-and-integration-fixes/tasks.md` - Marked T001 complete.

**BQC Fixes**:

* N/A - setup and validation-scope task only.

***

### Task T002 - Review fixture evidence, Codex docs, and fix boundaries

**Started**: 2026-05-31 16:09 **Completed**: 2026-05-31 16:10 **Duration**: 1 minute

**Notes**:

* Reviewed Session 02 validation and implementation notes. Session 02 passed with 25/25 tasks complete, focused Codex fixture tests, workspace gates, and sensitive-string review.
* Reviewed `apps/cli/README_cli.md`, `apps/hooks/README_hooks.md`, `docs/api/README_api.md`, and `docs/api/event-api-hook-contracts.md`.
* Confirmed the blocker-only boundary: source edits outside e2e and evidence files require a validation failure.
* Confirmed official Codex docs still require hook review with `/hooks`, load hooks from active config layers, run multiple matching hooks, and treat project-local `.codex/` layers as trusted-project scoped.

**Source References**:

* `https://developers.openai.com/codex/hooks`
* `https://developers.openai.com/codex/config-reference`
* `https://developers.openai.com/codex/cli/slash-commands`

**Files Changed**:

* `.spec_system/specs/phase11-session03-end-to-end-validation-and-integration-fixes/implementation-notes.md` - Recorded reviewed evidence, source boundaries, and official-doc confirmation.
* `.spec_system/specs/phase11-session03-end-to-end-validation-and-integration-fixes/tasks.md` - Marked T002 complete.

**BQC Fixes**:

* N/A - documentation and evidence review task only.

***

### Task T003 - Prepare isolated validation homes and seed plan

**Started**: 2026-05-31 16:10 **Completed**: 2026-05-31 16:11 **Duration**: 1 minute

**Notes**:

* Created temporary `FACTIONOS_HOME`, `CODEX_HOME`, and Claude home directories outside the repository.
* Seeded the isolated Codex home with a user-owned `SessionStart` hook and unknown top-level field for preservation checks.
* Seeded the isolated Claude home with user-owned settings for no-mutation checks during Codex-only install.
* Planned default local ports `2468` and `5193`; auth token values will not be recorded in tracked artifacts.

**Files Changed**:

* `.spec_system/specs/phase11-session03-end-to-end-validation-and-integration-fixes/codex-e2e-validation-record.md` - Created environment isolation and validation route record.
* `.spec_system/specs/phase11-session03-end-to-end-validation-and-integration-fixes/implementation-notes.md` - Recorded isolation setup.
* `.spec_system/specs/phase11-session03-end-to-end-validation-and-integration-fixes/tasks.md` - Marked T003 complete.

**BQC Fixes**:

* Trust boundary enforcement: Validation homes are isolated so install/uninstall checks cannot mutate real user config.

***

### Task T004 - Link CLI and record environment preflight

**Started**: 2026-05-31 16:11 **Completed**: 2026-05-31 16:12 **Duration**: 1 minute

**Notes**:

* `npm --workspace apps/cli link` completed successfully.
* `factionos help` ran successfully, but the help text still says Codex hook writes are deferred. This is a documentation/help observation unless source behavior also fails.
* `codex --version` returned `codex-cli 0.135.0`.
* Live `/hooks` trust review requires interactive human review. This implementation will not use Codex trust-bypass flags, so the trust-review step will be documented as unavailable for live automation and the source-backed fixture replay path will be used.
* Default ports `2468` and `5193` were occupied during preflight; compatibility will be checked before runtime/browser validation.

**Files Changed**:

* `.spec_system/specs/phase11-session03-end-to-end-validation-and-integration-fixes/codex-e2e-validation-record.md` - Recorded CLI link, Codex availability, trust-review route, auth, and port preflight.
* `.spec_system/specs/phase11-session03-end-to-end-validation-and-integration-fixes/implementation-notes.md` - Recorded preflight decisions.
* `.spec_system/specs/phase11-session03-end-to-end-validation-and-integration-fixes/tasks.md` - Marked T004 complete.

**BQC Fixes**:

* Error information boundaries: Recorded only status labels and version labels, not token values or local temp paths.

***

### Task T005 - Create validation record skeleton

**Started**: 2026-05-31 16:12 **Completed**: 2026-05-31 16:13 **Duration**: 1 minute

**Notes**:

* Expanded the closeout record with sections for install, status, doctor, uninstall, runtime health, browser evidence, privacy review, exceptions, blocker fixes, and final status.
* Added pending rows so later validation can record pass/fail evidence without changing the artifact shape.

**Files Changed**:

* `.spec_system/specs/phase11-session03-end-to-end-validation-and-integration-fixes/codex-e2e-validation-record.md` - Expanded the evidence skeleton.
* `.spec_system/specs/phase11-session03-end-to-end-validation-and-integration-fixes/implementation-notes.md` - Recorded skeleton setup.
* `.spec_system/specs/phase11-session03-end-to-end-validation-and-integration-fixes/tasks.md` - Marked T005 complete.

**BQC Fixes**:

* N/A - evidence artifact scaffolding only.

***

### Task T006 - Create redacted Codex e2e fixture helper

**Started**: 2026-05-31 16:13 **Completed**: 2026-05-31 16:16 **Duration**: 3 minutes

**Notes**:

* Added a Playwright support helper that builds a redacted Codex lifecycle with `SessionStart`, `UserPromptSubmit`, Bash, `apply_patch`, MCP, permission request, subagent start/stop, degraded subagent metadata, unknown redaction probe, and `Stop` steps.
* Added schema-style validation before posting each fixture payload.
* Added explicit failure reasons for invalid payloads, HTTP errors, malformed responses, and server-side ingest rejection.
* Ran `npx biome format --write tests/e2e/support/codexFixtures.ts` and `npx biome lint tests/e2e/support/codexFixtures.ts`.

**Files Changed**:

* `tests/e2e/support/codexFixtures.ts` - Created reusable Codex fixture builder and replay helper.
* `.spec_system/specs/phase11-session03-end-to-end-validation-and-integration-fixes/implementation-notes.md` - Recorded helper implementation.
* `.spec_system/specs/phase11-session03-end-to-end-validation-and-integration-fixes/tasks.md` - Marked T006 complete.

**BQC Fixes**:

* Trust boundary enforcement: Fixture payloads are validated before crossing the `/event` boundary.
* Failure path completeness: Fixture replay maps invalid payload, HTTP, malformed JSON, and rejected ingest failures to explicit labels.
* Error information boundaries: Helper uses redacted summaries, compact IDs, and relative or placeholder paths only.

***

### Task T007 - Add Codex fixture-replayed cockpit e2e coverage

**Started**: 2026-05-31 16:16 **Completed**: 2026-05-31 16:19 **Duration**: 3 minutes

**Notes**:

* Added an app e2e path that replays the Codex lifecycle helper through `/event` and verifies connected cockpit behavior.
* Added deterministic WebSocket stubs for loading, offline, and stream-error surface states.
* Covered empty state through a Codex-specific mission search with no matches.
* Asserted Codex label, provider accessibility, mission detail, tool pills, permission modal, orchestration lineage/degraded state, replay panel, and privacy-safe visible text.
* Ran `npx biome format --write tests/e2e/app.e2e.ts`, `npx biome lint tests/e2e/app.e2e.ts`, and `npx playwright test tests/e2e/app.e2e.ts --project app-desktop --list`.

**Files Changed**:

* `tests/e2e/app.e2e.ts` - Added Codex fixture replay and local stream state coverage.
* `.spec_system/specs/phase11-session03-end-to-end-validation-and-integration-fixes/implementation-notes.md` - Recorded e2e coverage.
* `.spec_system/specs/phase11-session03-end-to-end-validation-and-integration-fixes/tasks.md` - Marked T007 complete.

**BQC Fixes**:

* State freshness on re-entry: Local stream states are isolated to per-page WebSocket fixtures.
* Failure path completeness: Loading, offline, and error states now have deterministic browser assertions.
* Accessibility and platform compliance: Codex mission details and provider labels are checked with accessible-name guards.

***

### Task T008 - Record live-vs-fixture decision rules

**Started**: 2026-05-31 16:19 **Completed**: 2026-05-31 16:20 **Duration**: 1 minute

**Notes**:

* Live Codex CLI availability is confirmed by `codex --version`.
* Live `/hooks` trust review is not automated in this session because it requires interactive human review of hook definitions.
* This session will not pass `--dangerously-bypass-hook-trust` or recommend trust bypasses.
* Fixture replay may validate FactionOS hook-shaped ingest, WebSocket delivery, browser display, replay behavior, and privacy boundaries. It must not be described as live Codex trust validation.
* Closeout wording must distinguish "Codex CLI installed and available" from "live `/hooks` trust review completed".

**Files Changed**:

* `.spec_system/specs/phase11-session03-end-to-end-validation-and-integration-fixes/implementation-notes.md` - Recorded live-vs-fixture decision rules and no-overclaim wording.
* `.spec_system/specs/phase11-session03-end-to-end-validation-and-integration-fixes/tasks.md` - Marked T008 complete.

**BQC Fixes**:

* Error information boundaries: Evidence wording avoids overclaiming fixture replay as live provider trust.

***

### Task T009 - Map validation commands to owner packages and focused tests

**Started**: 2026-05-31 16:20 **Completed**: 2026-05-31 16:21 **Duration**: 1 minute

**Notes**:

* CLI install/status/doctor/uninstall owner: `apps/cli`; focused tests: `apps/cli/tests/cliRuntime.test.js`, `apps/cli/tests/codexInstaller.test.js`, `apps/cli/tests/cliProvider.test.js`.
* Hook payload/spool owner: `apps/hooks`; focused tests: `apps/hooks/tests/hookRuntime.test.js`, `apps/hooks/tests/hookNormalization.test.js`, `apps/hooks/tests/hookPayloads.test.js`, `apps/hooks/tests/codexHookMap.test.js`.
* Server ingest/runtime owner: `apps/server`; focused tests: `apps/server/tests/eventIngest.test.ts`, plus route/health tests if runtime startup changes.
* Web display/replay/export owner: `apps/web`; focused tests: `apps/web/tests/HeroCard.test.tsx`, `apps/web/tests/HeroDetailDrawer.test.tsx`, `apps/web/tests/MissionLogFilter.test.tsx`, `apps/web/tests/toolUsage.test.ts`, `apps/web/tests/replayLink.test.ts`, `apps/web/tests/exportSession.test.ts`.
* Shared vocabulary owner: `packages/protocol`; focused tests: `packages/protocol/tests/heroes.test.ts`, `packages/protocol/tests/ingest.test.ts`.
* Browser validation owner: `tests/e2e`; focused Playwright commands: `npx playwright test tests/e2e/app.e2e.ts --project app-desktop --grep "Codex"` and `npx playwright test tests/e2e/app.e2e.ts --project app-mobile --grep "Codex"`.

**Files Changed**:

* `.spec_system/specs/phase11-session03-end-to-end-validation-and-integration-fixes/implementation-notes.md` - Recorded owner-package and focused-test mapping.
* `.spec_system/specs/phase11-session03-end-to-end-validation-and-integration-fixes/tasks.md` - Marked T009 complete.

**BQC Fixes**:

* N/A - validation planning task only.

***

### Task T010 - Record isolated Codex init evidence

**Started**: 2026-05-31 16:21 **Completed**: 2026-05-31 16:23 **Duration**: 2 minutes

**Notes**:

* Seeded the correct isolated Claude settings path before the Codex-only run so no-mutation evidence covered the path used by the CLI.
* Ran `factionos init --cli codex --faction orc` with isolated `FACTIONOS_HOME`, `CODEX_HOME`, `HOME`, and local hooks root.
* Confirmed the first run exited `0`, installed `15` managed Codex hook commands, preserved the one unmanaged user hook, preserved an unknown top-level Codex field, and created a backup because user-owned state existed.
* Confirmed FactionOS settings recorded `cli=codex-cli`, `faction=orc`, and a configured server URL label.
* Reran the same command and confirmed unchanged posture, stable backup, stable managed hook count, no duplicate managed hook slots, and unchanged isolated Claude settings checksum.

**Files Changed**:

* `.spec_system/specs/phase11-session03-end-to-end-validation-and-integration-fixes/codex-e2e-validation-record.md` - Recorded install validation evidence.
* `.spec_system/specs/phase11-session03-end-to-end-validation-and-integration-fixes/implementation-notes.md` - Recorded T010 completion.
* `.spec_system/specs/phase11-session03-end-to-end-validation-and-integration-fixes/tasks.md` - Marked T010 complete.

**BQC Fixes**:

* Trust boundary enforcement: The install ran only with isolated homes and a local hooks root.
* Duplicate action prevention: Rerun evidence proves managed hooks are replaced in place instead of duplicated.
* Error information boundaries: Evidence records labels and counts, not temp paths, hook command bodies, or raw payloads.

***

### Task T011 - Record Codex trust-review exception

**Started**: 2026-05-31 16:23 **Completed**: 2026-05-31 16:24 **Duration**: 1 minute

**Notes**:

* Rechecked local `codex --help` and `codex exec --help`; both expose `--dangerously-bypass-hook-trust`.
* Kept the validation route on source-backed fixture replay because live `/hooks` trust review requires interactive human review and the session must not use trust bypass flags.
* Finalized exception wording that separates live trusted-hook execution from fixture-backed ingest, WebSocket delivery, browser display, replay, and privacy validation.

**Files Changed**:

* `.spec_system/specs/phase11-session03-end-to-end-validation-and-integration-fixes/codex-e2e-validation-record.md` - Finalized trust-review exception.
* `.spec_system/specs/phase11-session03-end-to-end-validation-and-integration-fixes/implementation-notes.md` - Recorded T011 completion.
* `.spec_system/specs/phase11-session03-end-to-end-validation-and-integration-fixes/tasks.md` - Marked T011 complete.

**BQC Fixes**:

* Trust boundary enforcement: The live trusted-hook claim remains unavailable rather than bypassed.
* Error information boundaries: Evidence records command help labels and source-backed scope, not hook command bodies or local paths.

***

### Task T012 - Record Codex status and doctor evidence

**Started**: 2026-05-31 16:24 **Completed**: 2026-05-31 16:27 **Duration**: 3 minutes

**Notes**:

* Read the status, doctor, provider posture, and uninstall command paths before running diagnostics.
* Ran `factionos status --cli codex` and `factionos doctor --cli codex` with isolated homes and a `5s` timeout.
* Both commands exited `0`; status reported Codex `loaded`, hooks present, JSON valid, `15` managed hooks, `1` unmanaged hook, backup present, feature not configured, and `review with /hooks`.
* Doctor reported the same Codex posture. Neither command emitted raw prompt, patch, command-output, transcript, token, or payload labels.
* Raw command output included absolute local path lines for state/runtime diagnostics, so T014 will treat this as a CLI privacy blocker candidate.

**Files Changed**:

* `.spec_system/specs/phase11-session03-end-to-end-validation-and-integration-fixes/codex-e2e-validation-record.md` - Recorded status and doctor evidence plus the path-output observation.
* `.spec_system/specs/phase11-session03-end-to-end-validation-and-integration-fixes/implementation-notes.md` - Recorded T012 completion.
* `.spec_system/specs/phase11-session03-end-to-end-validation-and-integration-fixes/tasks.md` - Marked T012 complete.

**BQC Fixes**:

* Failure path completeness: Diagnostics were bounded with timeouts and recorded explicit command result labels.
* Error information boundaries: Evidence stores provider labels and counts only; broad CLI path output is tracked for T014 remediation.

***

### Task T013 - Record Codex uninstall evidence

**Started**: 2026-05-31 16:27 **Completed**: 2026-05-31 16:28 **Duration**: 2 minutes

**Notes**:

* Ran `factionos uninstall --cli codex` twice with isolated `FACTIONOS_HOME`, `CODEX_HOME`, `HOME`, and local hooks root.
* Confirmed the first run exited `0`, restored the original Codex hooks backup, removed the backup file, changed managed hook count from `15` to `0`, and preserved the one unmanaged user hook plus the unknown top-level Codex field.
* Confirmed the second run exited `0`, reported no managed hooks found, and kept counts stable at `0` managed and `1` unmanaged.
* Confirmed isolated Claude settings were unchanged and uninstall output made no trusted-erasure, broad deletion, account, auth, or trust cleanup claim.

**Files Changed**:

* `.spec_system/specs/phase11-session03-end-to-end-validation-and-integration-fixes/codex-e2e-validation-record.md` - Recorded uninstall validation evidence.
* `.spec_system/specs/phase11-session03-end-to-end-validation-and-integration-fixes/implementation-notes.md` - Recorded T013 completion.
* `.spec_system/specs/phase11-session03-end-to-end-validation-and-integration-fixes/tasks.md` - Marked T013 complete.

**BQC Fixes**:

* Duplicate action prevention: Rerun evidence proves uninstall is idempotent.
* Trust boundary enforcement: Uninstall removed only managed Codex hooks and preserved user-owned state.
* Error information boundaries: Evidence records labels and counts only, with no path or payload content.

***

### Task T014 - Fix CLI diagnostics blocker behavior

**Started**: 2026-05-31 16:27 **Completed**: 2026-05-31 16:28 **Duration**: 1 minute

**Notes**:

* Validated the T012 blocker candidate and confirmed status/doctor raw output exposed absolute local path lines.
* Removed stale CLI help text that still described Codex hook writes as deferred.
* Changed status and doctor path diagnostics to compact `configured`/`(unset)` labels instead of absolute local paths.
* Added focused runtime tests proving help describes active Codex hook install and status/doctor output excludes the temp home and repo root.
* Ran `npx biome format --write apps/cli/src/index.js apps/cli/src/commands/status.js apps/cli/src/commands/doctor.js apps/cli/tests/cliRuntime.test.js`.
* Ran `npx biome lint apps/cli/src/index.js apps/cli/src/commands/status.js apps/cli/src/commands/doctor.js apps/cli/tests/cliRuntime.test.js`.
* Ran `npx vitest run apps/cli/tests/cliRuntime.test.js apps/cli/tests/codexInstaller.test.js apps/cli/tests/cliProvider.test.js`; `27` tests passed.
* Reinstalled Codex hooks in the isolated validation home and rechecked `factionos help`, `factionos status --cli codex`, and `factionos doctor --cli codex`; no stale deferred text, raw payload labels, or absolute local path lines were detected.

**Files Changed**:

* `apps/cli/src/index.js` - Updated Codex help examples to active hook install wording.
* `apps/cli/src/commands/status.js` - Replaced absolute state/workspace path output with compact labels.
* `apps/cli/src/commands/doctor.js` - Replaced absolute runtime/workspace path output with compact labels and generic runtime-root failure guidance.
* `apps/cli/tests/cliRuntime.test.js` - Added help wording and broad-path redaction assertions.
* `.spec_system/specs/phase11-session03-end-to-end-validation-and-integration-fixes/codex-e2e-validation-record.md` - Recorded the T014 fix and recheck.
* `.spec_system/specs/phase11-session03-end-to-end-validation-and-integration-fixes/implementation-notes.md` - Recorded T014 completion.
* `.spec_system/specs/phase11-session03-end-to-end-validation-and-integration-fixes/tasks.md` - Marked T014 complete.

**BQC Fixes**:

* Error information boundaries: Status and doctor no longer print broad local paths for state/runtime/workspace diagnostics.
* Contract alignment: Help now matches current Codex installer behavior.
* Failure path completeness: Doctor runtime-root failure guidance remains actionable without exposing the attempted root path.

***

### Task T015 - Validate local runtime health with mock disabled

**Started**: 2026-05-31 16:29 **Completed**: 2026-05-31 16:31 **Duration**: 2 minutes

**Notes**:

* Read the CLI start/lifecycle path and server health/mock configuration before starting a runtime.
* Started a separate server-only runtime on a temporary loopback port with `FACTIONOS_MOCK=false` to avoid the already occupied default server/web ports.
* Polled authenticated `/health` with a `10s` bounded wait and `1s` per-request timeout; readiness succeeded in under one second.
* Confirmed `/health` returned HTTP `200`, `ok=true`, a present version label, numeric uptime, and `mock=false`.
* Confirmed unauthenticated `/health` returned HTTP `401`, proving the local auth boundary without recording the token.
* Interrupted the temporary runtime and confirmed the temporary port was closed.

**Files Changed**:

* `.spec_system/specs/phase11-session03-end-to-end-validation-and-integration-fixes/codex-e2e-validation-record.md` - Recorded runtime health evidence.
* `.spec_system/specs/phase11-session03-end-to-end-validation-and-integration-fixes/implementation-notes.md` - Recorded T015 completion.
* `.spec_system/specs/phase11-session03-end-to-end-validation-and-integration-fixes/tasks.md` - Marked T015 complete.

**BQC Fixes**:

* Resource cleanup: Temporary runtime was stopped and the port was verified closed.
* External dependency resilience: Health polling used bounded request and overall wait timeouts.
* Error information boundaries: Evidence records health labels and booleans only, not token values or runtime paths.

***

### Task T016 - Validate Codex lifecycle ingest

**Started**: 2026-05-31 16:31 **Completed**: 2026-05-31 16:34 **Duration**: 3 minutes

**Notes**:

* Read the Codex fixture helper, server event ingest normalizer, and protocol ingest contract.
* Used the fixture helper to build and schema-validate `SessionStart`, `UserPromptSubmit`, and `Stop` payloads for a unique Codex lifecycle seed.
* Posted the three lifecycle payloads to the authenticated local `/event` route; all `3` were accepted.
* Confirmed `SessionStart` returned a hero id label, and `UserPromptSubmit`/`Stop` returned hero and mission id labels.
* Ran a local negative validation for a lifecycle payload missing a session id; the helper rejected it before network submission with `invalid_payload`.

**Files Changed**:

* `.spec_system/specs/phase11-session03-end-to-end-validation-and-integration-fixes/codex-e2e-validation-record.md` - Recorded lifecycle ingest evidence.
* `.spec_system/specs/phase11-session03-end-to-end-validation-and-integration-fixes/implementation-notes.md` - Recorded T016 completion.
* `.spec_system/specs/phase11-session03-end-to-end-validation-and-integration-fixes/tasks.md` - Marked T016 complete.

**BQC Fixes**:

* Trust boundary enforcement: Fixture payloads were schema-validated before posting to `/event`.
* Failure path completeness: Invalid lifecycle input maps to `invalid_payload` before any network write.
* Error information boundaries: Evidence stores accepted/error labels only, not payload bodies or auth values.

***

### Task T017 - Validate full server ingest behavior

**Started**: 2026-05-31 16:34 **Completed**: 2026-05-31 16:35 **Duration**: 1 minute

**Notes**:

* Started an isolated server-only runtime with a temporary `FACTIONOS_HOME`, loopback binding, and `FACTIONOS_MOCK=false`.
* Replayed the full Codex fixture lifecycle through the authenticated local `/event` route.
* Confirmed all `14` fixture steps were accepted: lifecycle, Bash, `apply_patch`, MCP, permission, subagent start/stop, degraded subagent, unknown redaction probe, and Stop.
* Confirmed final replay produced `1` hero, `2` missions, `1` archive file, and archive event types for hero, mission, tool, permission, lineage, graph, and opaque mission events.
* Scanned the isolated archive and found `0` private sentinel hits and `0` raw boundary hits.
* Stopped the temporary runtime and confirmed the port closed. No server source fix was needed.

**Files Changed**:

* `.spec_system/specs/phase11-session03-end-to-end-validation-and-integration-fixes/codex-e2e-validation-record.md` - Recorded full server ingest and archive evidence.
* `.spec_system/specs/phase11-session03-end-to-end-validation-and-integration-fixes/implementation-notes.md` - Recorded T017 completion.
* `.spec_system/specs/phase11-session03-end-to-end-validation-and-integration-fixes/tasks.md` - Marked T017 complete.

**BQC Fixes**:

* Trust boundary enforcement: Replay used the authenticated local event route and schema-validated fixture payloads.
* Failure path completeness: Full helper replay retains explicit `invalid_payload`, `http_error`, `malformed_response`, and `ingest_rejected` failure mapping.
* Resource cleanup: Temporary runtime was stopped and the port was verified closed.
* Error information boundaries: Archive scan verified no private sentinels or raw boundary strings were persisted.

***

### Task T018 - Validate Bash and apply\_patch observability

**Started**: 2026-05-31 16:35 **Completed**: 2026-05-31 16:36 **Duration**: 1 minute

**Notes**:

* Reused the isolated full replay archive from T017 after confirming the temporary runtime was stopped.
* Confirmed expected observability event counts: `1` `bash_command`, `2` `file_access`, `4` `tool_use`, and `3` `tool_result` events.
* Confirmed raw command strings, command output labels, raw patch bodies, and broad paths were absent from the isolated archive.
* Confirmed command and path redaction placeholders were present in the archive.

**Files Changed**:

* `.spec_system/specs/phase11-session03-end-to-end-validation-and-integration-fixes/codex-e2e-validation-record.md` - Recorded Bash and `apply_patch` observability evidence.
* `.spec_system/specs/phase11-session03-end-to-end-validation-and-integration-fixes/implementation-notes.md` - Recorded T018 completion.
* `.spec_system/specs/phase11-session03-end-to-end-validation-and-integration-fixes/tasks.md` - Marked T018 complete.

**BQC Fixes**:

* Error information boundaries: Archive evidence shows command, path, command-output, and patch-body boundaries stayed redacted or summarized.
* Resource cleanup: T018 evidence uses the stopped isolated runtime and temporary archive only.

***

### Task T019 - Validate MCP and permission observability

**Started**: 2026-05-31 16:36 **Completed**: 2026-05-31 16:38 **Duration**: 2 minutes

**Notes**:

* Inspected the isolated replay archive for MCP, permission, and degraded fallback evidence.
* Confirmed archive tool labels were limited to `Bash`, `apply_patch`, and `mcp__filesystem__read_file`.
* Confirmed `1` permission request event was archived for `Bash`.
* Confirmed the MCP tool-use label was present and raw MCP sentinel values, JSON argument shapes, bearer/token strings, and auto-approval wording were absent.
* Confirmed degraded fallback metadata was present in the replay archive.

**Files Changed**:

* `.spec_system/specs/phase11-session03-end-to-end-validation-and-integration-fixes/codex-e2e-validation-record.md` - Recorded MCP and permission observability evidence.
* `.spec_system/specs/phase11-session03-end-to-end-validation-and-integration-fixes/implementation-notes.md` - Recorded T019 completion.
* `.spec_system/specs/phase11-session03-end-to-end-validation-and-integration-fixes/tasks.md` - Marked T019 complete.

**BQC Fixes**:

* Error information boundaries: Archive evidence excludes raw MCP arguments, token-shaped values, and auto-approval claims.
* Contract alignment: Observed tool labels match the fixture allowlist used by browser and server validation.

***

### Task T020 - Validate subagent lineage and degraded fallback observability

**Started**: 2026-05-31 16:38 **Completed**: 2026-05-31 16:42 **Duration**: 4 minutes

**Notes**:

* Initial lineage inspection found the degraded subagent fixture still inherited `agent_id` from the base payload, so it did not exercise the missing-id degraded path.
* Fixed `tests/e2e/support/codexFixtures.ts` so the degraded subagent payload keeps session and hero identifiers but omits subagent identifiers.
* Reran the full isolated server replay with the corrected fixture; all `14` events were accepted.
* Confirmed final lineage evidence: `3` subagent lineage updates, `3` mission graph updates, `1` child mission start, states `active`, `completed`, and `degraded`, reviewer type metadata, and compact degraded reason `missing_subagent_id`.
* Confirmed raw child-agent id strings were absent and lineage placeholders were present in the archive.
* Ran `npx biome format --write tests/e2e/support/codexFixtures.ts` and `npx biome lint tests/e2e/support/codexFixtures.ts`.
* Stopped the temporary runtime and confirmed the port closed.

**Files Changed**:

* `tests/e2e/support/codexFixtures.ts` - Fixed the degraded subagent fixture to omit inherited subagent identifiers.
* `.spec_system/specs/phase11-session03-end-to-end-validation-and-integration-fixes/codex-e2e-validation-record.md` - Recorded final subagent lineage evidence and updated final isolated replay counts.
* `.spec_system/specs/phase11-session03-end-to-end-validation-and-integration-fixes/implementation-notes.md` - Recorded T020 completion.
* `.spec_system/specs/phase11-session03-end-to-end-validation-and-integration-fixes/tasks.md` - Marked T020 complete.

**BQC Fixes**:

* Contract alignment: The degraded fixture now matches the intended missing-safe-id scenario.
* Error information boundaries: Lineage archive evidence contains redacted identifiers and compact degraded reasons.
* Resource cleanup: Temporary runtime was stopped and the port was verified closed after rerun.

***

### Task T021 - Validate Codex cockpit browser behavior

**Started**: 2026-05-31 16:42 **Completed**: 2026-05-31 16:44 **Duration**: 2 minutes

**Notes**:

* Ran the Codex app desktop e2e path on alternate local ports to avoid reusing the occupied default ports.
* Fixed e2e scaffolding blockers discovered by the run: auth/faction seeding for newly-created pages, duplicate Bash tool-pill strictness, rendered `Reviewer` label casing, and closing a transient hero drawer before opening Settings.
* Reran `FACTIONOS_E2E_SERVER_PORT=2492 FACTIONOS_E2E_WEB_PORT=5196 FACTIONOS_E2E_DEMO_PORT=8104 VITE_FACTIONOS_SERVER_PORT=2492 npx playwright test tests/e2e/app.e2e.ts --project app-desktop --grep "Codex"`; `2` tests passed.
* Desktop validation covered loading, offline, stream-error, connected lifecycle, mission search empty state, Codex label, mission detail, tool usage, lineage/degraded state, replay panel copy, visible-text privacy, private sentinel checks, and interactive accessibility guards.

**Files Changed**:

* `tests/e2e/app.e2e.ts` - Fixed Codex e2e auth seeding, duplicate pill assertions, reviewer label assertion, and transient drawer cleanup before replay.
* `.spec_system/specs/phase11-session03-end-to-end-validation-and-integration-fixes/codex-e2e-validation-record.md` - Recorded desktop browser validation evidence.
* `.spec_system/specs/phase11-session03-end-to-end-validation-and-integration-fixes/implementation-notes.md` - Recorded T021 completion.
* `.spec_system/specs/phase11-session03-end-to-end-validation-and-integration-fixes/tasks.md` - Marked T021 complete.

**BQC Fixes**:

* State freshness on re-entry: Every new browser page in the Codex state test now gets deterministic local auth/faction seed state before navigation.
* Accessibility and platform compliance: Browser validation asserts interactive names and text-fit/privacy guards on the Codex mission/replay surfaces.
* Error information boundaries: Browser-visible text and private sentinels are checked during Codex replay and state validation.

***

### Task T022 - Validate web Codex display and redaction source boundary

**Started**: 2026-05-31 16:44 **Completed**: 2026-05-31 16:45 **Duration**: 1 minute

**Notes**:

* Read `apps/web/src/lib/heroCli.ts`, `apps/web/src/lib/replayLink.ts`, and `packages/protocol/src/heroes.ts`.
* Confirmed Codex display labels are sourced from protocol metadata: `Codex CLI`, provider family `openai`, and provider label `OpenAI`.
* Confirmed replay redaction includes field-specific handling for prompts, commands, patch bodies, MCP arguments, secrets, transcript fields, terminals, URLs, paths, and tool names.
* Ran `npx vitest run apps/web/tests/heroCli.test.ts apps/web/tests/replayLink.test.ts apps/web/tests/exportSession.test.ts packages/protocol/tests/heroes.test.ts`; `79` tests passed.
* No web app source fix was needed.

**Files Changed**:

* `.spec_system/specs/phase11-session03-end-to-end-validation-and-integration-fixes/codex-e2e-validation-record.md` - Recorded web source-boundary validation.
* `.spec_system/specs/phase11-session03-end-to-end-validation-and-integration-fixes/implementation-notes.md` - Recorded T022 completion.
* `.spec_system/specs/phase11-session03-end-to-end-validation-and-integration-fixes/tasks.md` - Marked T022 complete.

**BQC Fixes**:

* Contract alignment: Codex web labels remain protocol-backed.
* Error information boundaries: Replay/export tests cover field-specific redaction and private-field handling.

***

### Task T023 - Run focused desktop/mobile Codex Playwright validation

**Started**: 2026-05-31 16:45 **Completed**: 2026-05-31 16:48 **Duration**: 3 minutes

**Notes**:

* Ran `FACTIONOS_E2E_SERVER_PORT=2496 FACTIONOS_E2E_WEB_PORT=5200 FACTIONOS_E2E_DEMO_PORT=8108 VITE_FACTIONOS_SERVER_PORT=2496 npx playwright test tests/e2e/app.e2e.ts --project app-desktop --project app-mobile --grep "Codex"`.
* Result: `4` tests passed across `app-desktop` and `app-mobile`.
* Browser guards passed for Codex replay and state-surface tests.
* Fixed e2e resilience found during the focused run: transient toast dismissal, plan workpad dismissal before clicks, and keyboard activation for the dense mobile mission row.

**Files Changed**:

* `tests/e2e/app.e2e.ts` - Hardened transient overlay dismissal and mission-row activation for desktop/mobile Codex validation.
* `.spec_system/specs/phase11-session03-end-to-end-validation-and-integration-fixes/codex-e2e-validation-record.md` - Promoted browser evidence to desktop/mobile.
* `.spec_system/specs/phase11-session03-end-to-end-validation-and-integration-fixes/implementation-notes.md` - Recorded T023 completion.
* `.spec_system/specs/phase11-session03-end-to-end-validation-and-integration-fixes/tasks.md` - Marked T023 complete.

**BQC Fixes**:

* State freshness on re-entry: Codex browser validation now passes under parallel desktop/mobile page creation.
* Accessibility and platform compliance: Mobile mission row activation uses keyboard Enter instead of relying on ambiguous pointer hit testing in a dense layout.
* Failure path completeness: Browser guards run clean after deterministic transient-overlay cleanup.

***

### Task T024 - Run focused Vitest suites and workspace typecheck

**Started**: 2026-05-31 16:48 **Completed**: 2026-05-31 16:49 **Duration**: 1 minute

**Notes**:

* Ran focused Vitest suites for CLI, hooks, server ingest, web Codex display/redaction, and protocol contracts.
* Result: `17` test files passed, `309` tests passed.
* Ran `npm run typecheck`; workspace typecheck passed for adapters, server, warroom, web, and protocol.

**Files Changed**:

* `.spec_system/specs/phase11-session03-end-to-end-validation-and-integration-fixes/codex-e2e-validation-record.md` - Recorded focused test and typecheck status.
* `.spec_system/specs/phase11-session03-end-to-end-validation-and-integration-fixes/implementation-notes.md` - Recorded T024 completion.
* `.spec_system/specs/phase11-session03-end-to-end-validation-and-integration-fixes/tasks.md` - Marked T024 complete.

**BQC Fixes**:

* Contract alignment: Focused tests covered protocol labels/ingest, CLI provider behavior, hook normalization/payloads, server ingest, and web redaction/display contracts.

***

### Task T025 - Run final quality gates and finalize notes

**Started**: 2026-05-31 16:49 **Completed**: 2026-05-31 16:50 **Duration**: 1 minute

**Notes**:

* Ran `npm run format:check`; passed.
* Ran `npm run lint`; passed.
* Ran `git diff --check`; passed.
* Ran ASCII/LF validation for touched session/code files; `9` files checked, `0` failures.
* Ran sensitive-string review. Tracked evidence artifacts contain no temp paths, token values, raw Codex sentinels, transcript paths, or patch bodies. The only private sentinel hits are intentional constants in `tests/e2e/support/codexFixtures.ts`.
* Finalized the validation record and task checklist.

**Files Changed**:

* `.spec_system/specs/phase11-session03-end-to-end-validation-and-integration-fixes/codex-e2e-validation-record.md` - Finalized status and closeout checks.
* `.spec_system/specs/phase11-session03-end-to-end-validation-and-integration-fixes/implementation-notes.md` - Recorded T025 and final progress.
* `.spec_system/specs/phase11-session03-end-to-end-validation-and-integration-fixes/tasks.md` - Marked T025 and completion checklist complete.

**BQC Fixes**:

* Error information boundaries: Sensitive-string review verified tracked evidence does not contain local temp paths, token values, raw sentinels, transcript paths, or patch bodies.

***

## Final Summary

* Completed all `25 / 25` tasks for `phase11-session03-end-to-end-validation-and-integration-fixes`.
* Validated isolated Codex install/status/doctor/uninstall behavior, including user-owned hook preservation, idempotency, no Claude mutation, and no trusted-erasure overclaim.
* Recorded the live `/hooks` trust-review exception without using or recommending trust bypasses.
* Validated local runtime health with `FACTIONOS_MOCK=false`, authenticated health checks, and cleanup.
* Added and validated Codex fixture replay coverage for lifecycle, Bash, `apply_patch`, MCP, permission, subagent lineage, degraded fallback, unknown redaction probe, browser states, and replay privacy.
* Fixed CLI help/path privacy blockers and e2e fixture/test blockers discovered during validation.
* Passed focused Playwright desktop/mobile validation, focused Vitest suites, workspace typecheck, format, lint, diff whitespace, ASCII/LF, and sensitive-string gates.


---

# 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-session03-end-to-end-validation-and-integration-fixes/implementation-notes.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.
