> 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/phase10-session02-codex-hook-install-uninstall-and-diagnostics/implementation-notes.md).

# Implementation Notes

**Session ID**: `phase10-session02-codex-hook-install-uninstall-and-diagnostics` **Package**: apps/cli, apps/hooks **Started**: 2026-05-31 12:51 **Last Updated**: 2026-05-31 13:09

***

## Session Progress

| Metric              | Value     |
| ------------------- | --------- |
| Tasks Completed     | 23 / 23   |
| Estimated Remaining | 0 minutes |
| Blockers            | 0         |

***

### 2026-05-31 - Final Checkpoint

**Notes**:

* Treated valid JSON with an invalid top-level Codex hooks shape as the same install fallback category as malformed hooks so CLI output reports the fresh-map fallback.
* Re-ran focused Vitest coverage after the cleanup; result: 4 test files passed, 32 tests passed.
* Re-ran focused Biome check and final ASCII/LF plus `git diff --check`; all passed.

**Files Changed**:

* `apps/cli/src/installers/codex.js` - tightened invalid-shape install fallback reporting.
* `.spec_system/specs/phase10-session02-codex-hook-install-uninstall-and-diagnostics/implementation-notes.md` - recorded final checkpoint.

***

### Task T023 - Validate ASCII/LF hygiene and whitespace diff check

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

**Notes**:

* Checked touched implementation, test, README, tasks, and implementation-notes files for non-ASCII characters.
* Checked the same files for CRLF characters.
* Ran `git diff --check`; no whitespace errors were reported.
* Re-ran focused Vitest coverage after formatting; result: 4 test files passed, 32 tests passed.

**Files Changed**:

* `.spec_system/specs/phase10-session02-codex-hook-install-uninstall-and-diagnostics/implementation-notes.md` - logged T023 and updated session progress.
* `.spec_system/specs/phase10-session02-codex-hook-install-uninstall-and-diagnostics/tasks.md` - marked T023 and completion checklist complete.

**BQC Fixes**:

* N/A - verification task.

***

### Task T022 - Run focused Biome check on touched CLI, hook, and README files

**Started**: 2026-05-31 13:06 **Completed**: 2026-05-31 13:07 **Duration**: 1 minute

**Notes**:

* Ran focused Biome check on touched CLI and hook implementation/test files plus README paths.
* Initial check found formatting-only changes in `apps/cli/src/installers/codex.js`, `apps/cli/src/commands/init.js`, and `apps/cli/tests/codexInstaller.test.js`.
* Applied `npx biome format --write` to touched JS files and reran the focused check successfully.

**Files Changed**:

* `apps/cli/src/installers/codex.js` - formatted.
* `apps/cli/src/commands/init.js` - formatted.
* `apps/cli/tests/codexInstaller.test.js` - formatted.
* `.spec_system/specs/phase10-session02-codex-hook-install-uninstall-and-diagnostics/implementation-notes.md` - logged T022.
* `.spec_system/specs/phase10-session02-codex-hook-install-uninstall-and-diagnostics/tasks.md` - marked T022 complete.

**BQC Fixes**:

* N/A - formatting and lint verification task.

***

### Task T021 - Run focused hook map tests for Codex template integrity

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

**Notes**:

* Ran focused Vitest coverage for `apps/hooks/tests/codexHookMap.test.js`.
* Result: 1 test file passed, 8 tests passed.

**Files Changed**:

* `.spec_system/specs/phase10-session02-codex-hook-install-uninstall-and-diagnostics/implementation-notes.md` - logged T021.
* `.spec_system/specs/phase10-session02-codex-hook-install-uninstall-and-diagnostics/tasks.md` - marked T021 complete.

**BQC Fixes**:

* N/A - verification task.

***

### Task T020 - Run focused CLI tests for Codex installer, provider routing, and runtime behavior

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

**Notes**:

* Ran focused Vitest coverage for Codex installer, provider selection, and CLI runtime behavior.
* Result: 3 test files passed, 24 tests passed.

**Files Changed**:

* `.spec_system/specs/phase10-session02-codex-hook-install-uninstall-and-diagnostics/implementation-notes.md` - logged T020.
* `.spec_system/specs/phase10-session02-codex-hook-install-uninstall-and-diagnostics/tasks.md` - marked T020 complete.

**BQC Fixes**:

* N/A - verification task.

***

### Task T019 - Update hooks README for user-level Codex installation support

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

**Notes**:

* Updated hooks README wording so `hooks.codex.json` is the source template consumed by the CLI installer.
* Documented user-level install behavior, backup, merge, `CODEX_HOME`, atomic writes, and user hook preservation.
* Preserved `/hooks` trust-review, project-local `.codex`, trusted state, custom slash commands, plugin packaging, and runtime validation boundaries.

**Files Changed**:

* `apps/hooks/README_hooks.md` - updated Codex installation support wording and boundaries.
* `.spec_system/specs/phase10-session02-codex-hook-install-uninstall-and-diagnostics/implementation-notes.md` - logged T019.
* `.spec_system/specs/phase10-session02-codex-hook-install-uninstall-and-diagnostics/tasks.md` - marked T019 complete.

**BQC Fixes**:

* Contract alignment: hooks package docs now match CLI ownership of user-level installation.
* Trust boundary enforcement: docs retain Codex `/hooks` review and no plugin/trust bypass claims.

***

### Task T018 - Update CLI README for Codex install, uninstall, diagnostics, trust review, and excluded settings

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

**Notes**:

* Updated CLI provider-selection docs from deferred Codex routing to supported user-level Codex hook installation.
* Documented `CODEX_HOME`, backup, atomic merge, user hook preservation, malformed install fallback, uninstall restore/removal/no-overwrite behavior, diagnostics, and `/hooks` trust review.
* Kept excluded Codex settings and packaging boundaries explicit.

**Files Changed**:

* `apps/cli/README_cli.md` - documented Codex installer, uninstall, diagnostics, trust review, and excluded settings.
* `.spec_system/specs/phase10-session02-codex-hook-install-uninstall-and-diagnostics/implementation-notes.md` - logged T018.
* `.spec_system/specs/phase10-session02-codex-hook-install-uninstall-and-diagnostics/tasks.md` - marked T018 complete.

**BQC Fixes**:

* Contract alignment: docs now match the implemented Codex user-level install boundary.
* Error information boundaries: documentation preserves no-raw-output diagnostic expectations.

***

### Task T017 - Add Codex hook map installability assertions

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

**Notes**:

* Added a hook-map test that runs the CLI Codex template reader against `hooks.codex.json`.
* Asserted valid top-level `hooks`, source placeholders, interpolated POSIX and Windows command placeholders, and FactionOS command hooks.

**Files Changed**:

* `apps/hooks/tests/codexHookMap.test.js` - added Codex installer-template assertions.
* `.spec_system/specs/phase10-session02-codex-hook-install-uninstall-and-diagnostics/implementation-notes.md` - logged T017.
* `.spec_system/specs/phase10-session02-codex-hook-install-uninstall-and-diagnostics/tasks.md` - marked T017 complete.

**BQC Fixes**:

* Contract alignment: hook-map tests now exercise the same template reader used by the CLI installer.

***

### Task T016 - Fill Codex installer tests for install, merge, malformed, reinstall, restore, surgical uninstall, env, and CODEX\_HOME

**Started**: 2026-05-31 12:52 **Completed**: 2026-05-31 13:04 **Duration**: 12 minutes

**Notes**:

* Completed focused Codex installer tests for missing directory install, valid existing hook merge, malformed backup fallback, reinstall idempotency, backup restore, surgical uninstall, no-backup malformed uninstall, env injection, compact posture, disabled hook feature detection, and `CODEX_HOME`.
* Tests use only temporary homes and a source-controlled hook root fixture.

**Files Changed**:

* `apps/cli/tests/codexInstaller.test.js` - filled Codex installer behavior tests.
* `.spec_system/specs/phase10-session02-codex-hook-install-uninstall-and-diagnostics/implementation-notes.md` - logged T016.
* `.spec_system/specs/phase10-session02-codex-hook-install-uninstall-and-diagnostics/tasks.md` - marked T016 complete.

**BQC Fixes**:

* Trust boundary enforcement: tests assert posture excludes command bodies and auth token values.
* State freshness on re-entry: tests assert `CODEX_HOME` overrides default Codex state.

***

### Task T015 - Expand CLI runtime tests for Codex install, all, alias, uninstall, doctor, and status

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

**Notes**:

* Updated Codex runtime tests from deferred provider output to real hook installation.
* Covered `init --cli codex`, `init --cli all`, install alias, uninstall restore, duplicate-trigger prevention on rerun, doctor, and status output.
* Added `CODEX_HOME` cleanup to the runtime test fixture.

**Files Changed**:

* `apps/cli/tests/cliRuntime.test.js` - expanded Codex runtime coverage.
* `.spec_system/specs/phase10-session02-codex-hook-install-uninstall-and-diagnostics/implementation-notes.md` - logged T015.
* `.spec_system/specs/phase10-session02-codex-hook-install-uninstall-and-diagnostics/tasks.md` - marked T015 complete.

**BQC Fixes**:

* Duplicate action prevention: runtime test now reruns `init --cli all` and asserts managed Codex hook counts do not grow.
* Error information boundaries: runtime diagnostics still assert sensitive fixture content is not printed.

***

### Task T014 - Update provider selection tests from deferred Codex behavior to real install and uninstall expectations

**Started**: 2026-05-31 13:03 **Completed**: 2026-05-31 13:04 **Duration**: 1 minute

**Notes**:

* Replaced the deferred no-mutation Codex provider test with real install/uninstall expectations.
* Asserted managed hook installation, backup restore, user hook preservation, local settings creation, and no Claude settings mutation.
* Added `CODEX_HOME` env restoration to the provider test fixture.

**Files Changed**:

* `apps/cli/tests/cliProvider.test.js` - updated Codex provider behavior coverage.
* `.spec_system/specs/phase10-session02-codex-hook-install-uninstall-and-diagnostics/implementation-notes.md` - logged T014.
* `.spec_system/specs/phase10-session02-codex-hook-install-uninstall-and-diagnostics/tasks.md` - marked T014 complete.

**BQC Fixes**:

* State freshness on re-entry: test fixture now restores `CODEX_HOME`.
* Trust boundary enforcement: provider test asserts Codex install does not create Claude provider settings.

***

### Task T013 - Add compact Codex status output with validity, counts, backup, and disabled-hook labels

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

**Notes**:

* Status now uses the real Codex provider posture formatter added in T009.
* Added warning level for malformed or disabled Codex hook states.
* Kept absent, loaded, and not-loaded states compact and informational.

**Files Changed**:

* `apps/cli/src/commands/status.js` - added Codex warning severity for malformed and disabled states.
* `.spec_system/specs/phase10-session02-codex-hook-install-uninstall-and-diagnostics/implementation-notes.md` - logged T013.
* `.spec_system/specs/phase10-session02-codex-hook-install-uninstall-and-diagnostics/tasks.md` - marked T013 complete.

**BQC Fixes**:

* Failure path completeness: malformed and disabled Codex posture is visibly warned in status output.
* Error information boundaries: status prints compact provider posture only.

***

### Task T012 - Add Codex doctor checks for hooks posture, managed count, disabled hooks, and trust review

**Started**: 2026-05-31 13:02 **Completed**: 2026-05-31 13:03 **Duration**: 1 minute

**Notes**:

* Added Codex doctor checks for hook JSON validity when a hooks file exists.
* Added managed-command presence checks for valid Codex hooks files.
* Added disabled-hook feature detection and `/hooks` trust-review guidance.
* Kept absent Codex hooks informational so Claude-only diagnostics remain usable.

**Files Changed**:

* `apps/cli/src/commands/doctor.js` - added real Codex doctor checks.
* `.spec_system/specs/phase10-session02-codex-hook-install-uninstall-and-diagnostics/implementation-notes.md` - logged T012.
* `.spec_system/specs/phase10-session02-codex-hook-install-uninstall-and-diagnostics/tasks.md` - marked T012 complete.

**BQC Fixes**:

* Failure path completeness: malformed present Codex hooks and disabled hook features are surfaced with explicit hints.
* Error information boundaries: doctor output uses labels and counts only, with no raw command, env, config, or path disclosure from Codex hooks.

***

### Task T011 - Replace deferred Codex uninstall output with concrete outcomes

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

**Notes**:

* Added Codex uninstall output for backup restore, surgical managed-hook removal, absent hooks, malformed no-backup refusal, and not-found states.
* Kept wording scoped to provider hook entries only and avoided broader erasure claims.

**Files Changed**:

* `apps/cli/src/commands/uninstall.js` - added concrete Codex uninstall result formatting.
* `.spec_system/specs/phase10-session02-codex-hook-install-uninstall-and-diagnostics/implementation-notes.md` - logged T011.
* `.spec_system/specs/phase10-session02-codex-hook-install-uninstall-and-diagnostics/tasks.md` - marked T011 complete.

**BQC Fixes**:

* Failure path completeness: malformed Codex hooks without a backup produce a visible no-overwrite result.
* Error information boundaries: uninstall output does not print paths, hook commands, env values, or backup contents.

***

### Task T010 - Replace deferred Codex init summary with installed, unchanged, and guidance states

**Started**: 2026-05-31 13:01 **Completed**: 2026-05-31 13:02 **Duration**: 1 minute

**Notes**:

* Replaced deferred Codex init messaging with installed and already-up-to-date summaries.
* Added compact managed/unmanaged hook counts and backup state.
* Added next-step guidance to start FactionOS, launch Codex, and review loaded hooks with `/hooks`.
* Kept excluded Codex settings explicit in output.

**Files Changed**:

* `apps/cli/src/commands/init.js` - updated Codex init/install summary output.
* `.spec_system/specs/phase10-session02-codex-hook-install-uninstall-and-diagnostics/implementation-notes.md` - logged T010.
* `.spec_system/specs/phase10-session02-codex-hook-install-uninstall-and-diagnostics/tasks.md` - marked T010 complete.

**BQC Fixes**:

* Failure path completeness: init output now distinguishes real Codex install state from unchanged reruns and malformed-file fallback.
* Error information boundaries: summary prints counts and labels only, not hooks file paths, command bodies, or env values.

***

### Task T009 - Extend provider posture formatting for Codex validity, backup, counts, disabled hooks, and trust guidance

**Started**: 2026-05-31 13:06 **Completed**: 2026-05-31 13:07 **Duration**: 1 minute

**Notes**:

* Replaced deferred Codex provider formatting with compact posture facts.
* Formatted hook file presence, JSON validity, managed/unmanaged counts, backup presence, feature-disabled posture, and `/hooks` guidance.
* Kept posture output label-only with no command bodies, env values, or raw config content.

**Files Changed**:

* `apps/cli/src/lib/providerPosture.js` - added real Codex posture formatting.
* `.spec_system/specs/phase10-session02-codex-hook-install-uninstall-and-diagnostics/implementation-notes.md` - logged T009.
* `.spec_system/specs/phase10-session02-codex-hook-install-uninstall-and-diagnostics/tasks.md` - marked T009 complete.

**BQC Fixes**:

* Error information boundaries: provider posture output is compact and excludes raw hook commands, config text, env values, and local paths.

***

### Task T008 - Implement Codex uninstall backup restore and surgical managed-hook removal

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

**Notes**:

* Implemented Codex uninstall backup restore when the FactionOS-created backup exists.
* Added surgical removal of only managed FactionOS Codex command hooks when no backup is available.
* Preserved user-owned hooks and unknown top-level fields.
* Added malformed no-backup handling that reports the condition and leaves the file untouched.

**Files Changed**:

* `apps/cli/src/installers/codex.js` - implemented Codex uninstall restore, removal, absent, malformed, and not-found outcomes.
* `.spec_system/specs/phase10-session02-codex-hook-install-uninstall-and-diagnostics/implementation-notes.md` - logged T008.
* `.spec_system/specs/phase10-session02-codex-hook-install-uninstall-and-diagnostics/tasks.md` - marked T008 complete.

**BQC Fixes**:

* Failure path completeness: malformed uninstall without backup now returns a no-overwrite result instead of mutating user content.
* Trust boundary enforcement: uninstall does not remove FactionOS sessions, spool, logs, archives, browser state, Codex trust state, or provider settings.

***

### Task T007 - Implement backup-first Codex install merge with idempotency and malformed-file fallback

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

**Notes**:

* Implemented `factionos init --cli codex` hook writes to user-level Codex `hooks.json`.
* Created first-run raw backup as `hooks.backup.factionos.json` without replacing existing FactionOS backups.
* Preserved user-owned hook entries and top-level fields while replacing only managed FactionOS command hooks.
* Handled malformed existing hooks by preserving raw content in backup and writing a fresh managed hooks object.
* Prepared local FactionOS state and wrote `cli: "codex-cli"` only when Codex is selected as the default provider path.

**Files Changed**:

* `apps/cli/src/installers/codex.js` - implemented Codex install merge, backup, idempotency, settings merge, and env injection.
* `.spec_system/specs/phase10-session02-codex-hook-install-uninstall-and-diagnostics/implementation-notes.md` - logged T007.
* `.spec_system/specs/phase10-session02-codex-hook-install-uninstall-and-diagnostics/tasks.md` - marked T007 complete.

**BQC Fixes**:

* Duplicate action prevention: reinstall removes prior managed hooks before appending the current template so reruns do not duplicate commands.
* Failure path completeness: malformed existing hooks have an explicit backup-and-fresh-write path.
* Trust boundary enforcement: install writes only FactionOS local state and Codex hooks, not Codex auth, provider, telemetry, model, profile, account, trust, or project-local config.

***

### Task T006 - Implement managed Codex hook detection and compact hook counting

**Started**: 2026-05-31 13:03 **Completed**: 2026-05-31 13:04 **Duration**: 1 minute

**Notes**:

* Added strict Codex managed-command detection using the Codex CLI marker, known FactionOS hook script names, and hook root or source-script evidence.
* Added compact managed/unmanaged command hook counting that returns counts only.
* Avoided exposing raw command bodies from posture data.

**Files Changed**:

* `apps/cli/src/installers/codex.js` - added managed Codex hook detection and counting helpers.
* `.spec_system/specs/phase10-session02-codex-hook-install-uninstall-and-diagnostics/implementation-notes.md` - logged T006.
* `.spec_system/specs/phase10-session02-codex-hook-install-uninstall-and-diagnostics/tasks.md` - marked T006 complete.

**BQC Fixes**:

* Error information boundaries: posture helpers return labels and counts rather than command bodies, env values, or hook config content.

***

### Task T005 - Implement Codex hook template loading and PLUGIN\_ROOT interpolation

**Started**: 2026-05-31 12:55 **Completed**: 2026-05-31 13:03 **Duration**: 8 minutes

**Notes**:

* Replaced the deferred Codex installer stub with source-backed template loading for `apps/hooks/hooks.codex.json`.
* Added explicit missing-template and invalid-template errors.
* Interpolated `${PLUGIN_ROOT}` and `%PLUGIN_ROOT%` placeholders only at install time so the source template remains reviewable.
* Added command environment decoration after template interpolation.

**Files Changed**:

* `apps/cli/src/installers/codex.js` - added Codex template loading and interpolation implementation.
* `.spec_system/specs/phase10-session02-codex-hook-install-uninstall-and-diagnostics/implementation-notes.md` - logged T005.
* `.spec_system/specs/phase10-session02-codex-hook-install-uninstall-and-diagnostics/tasks.md` - marked T005 complete.

**BQC Fixes**:

* Failure path completeness: missing and malformed Codex hook templates now produce explicit installer errors instead of deferred success text.

***

### Task T004 - Add Codex directory resolution helper with CODEX\_HOME support and no real-home test leakage

**Started**: 2026-05-31 12:54 **Completed**: 2026-05-31 12:55 **Duration**: 1 minute

**Notes**:

* Added `getCodexDir()` beside the existing Claude directory helper.
* Resolver uses `CODEX_HOME` when present and otherwise falls back to `~/.codex` through Node's home directory resolution.
* The focused Codex installer tests exercise this under temporary homes.

**Files Changed**:

* `apps/cli/src/lib/localFiles.js` - added Codex directory helper.
* `.spec_system/specs/phase10-session02-codex-hook-install-uninstall-and-diagnostics/implementation-notes.md` - logged T004.
* `.spec_system/specs/phase10-session02-codex-hook-install-uninstall-and-diagnostics/tasks.md` - marked T004 complete.

**BQC Fixes**:

* State freshness on re-entry: Codex path resolution reads current environment state per call so test and runtime re-entry can swap homes safely.

***

### Task T003 - Create focused Codex installer fixture structure with isolated homes and CODEX\_HOME setup

**Started**: 2026-05-31 12:52 **Completed**: 2026-05-31 12:54 **Duration**: 2 minutes

**Notes**:

* Added a dedicated Vitest file for Codex installer coverage.
* Built isolated temporary `HOME`, `FACTIONOS_HOME`, `FACTIONOS_HOOKS_ROOT`, and `CODEX_HOME` fixtures.
* Added helper readers and managed-command counters for later install, uninstall, posture, malformed-file, backup, and env interpolation assertions.

**Files Changed**:

* `apps/cli/tests/codexInstaller.test.js` - created isolated Codex installer fixture and planned behavior tests.
* `.spec_system/specs/phase10-session02-codex-hook-install-uninstall-and-diagnostics/implementation-notes.md` - logged T003.
* `.spec_system/specs/phase10-session02-codex-hook-install-uninstall-and-diagnostics/tasks.md` - marked T003 complete.

**BQC Fixes**:

* Trust boundary enforcement: tests isolate home directories so installer coverage cannot read or mutate real user Codex state.

***

### Task T002 - Inspect current deferred Codex provider routing and Claude installer safety patterns

**Started**: 2026-05-31 12:51 **Completed**: 2026-05-31 12:52 **Duration**: 1 minute

**Notes**:

* Confirmed `apps/cli/src/installers/codex.js` currently returns deferred install, uninstall, and posture results without file mutation.
* Reviewed Claude install/uninstall patterns for hook-root resolution, atomic writes, first-run backup, malformed-settings fallback, managed-command filtering, and surgical removal.
* Identified reusable boundaries: keep Codex hook ownership detection strict, preserve user-owned entries, avoid raw command output in diagnostics, and preserve `.factionos` state during uninstall.

**Files Changed**:

* `.spec_system/specs/phase10-session02-codex-hook-install-uninstall-and-diagnostics/implementation-notes.md` - logged T002.
* `.spec_system/specs/phase10-session02-codex-hook-install-uninstall-and-diagnostics/tasks.md` - marked T002 complete.

**BQC Fixes**:

* Contract alignment: matched Codex installer behavior to the existing provider routing contract while keeping provider-specific file boundaries separate.

***

## Task Log

### 2026-05-31 - Session Start

**Environment verified**:

* [x] Prerequisites confirmed
* [x] Tools available
* [x] Directory structure ready
* [x] apps/cli package prerequisites confirmed
* [x] apps/hooks package prerequisites confirmed

***

### Task T001 - Verify Phase 10 Session 02 prerequisites, source scope, and no-overclaim boundaries

**Started**: 2026-05-31 12:50 **Completed**: 2026-05-31 12:51 **Duration**: 1 minute

**Notes**:

* Confirmed active session from `.spec_system/scripts/analyze-project.sh --json`.
* Verified repo, apps/cli, and apps/hooks prerequisites with the local spec scripts.
* Reviewed the session PRD and spec scope: user-level Codex hook install, uninstall, status, doctor, focused tests, and docs only.
* Confirmed no-overclaim exclusions for Codex auth, provider, telemetry, model, profile, API keys, account settings, trusted-project state, project-local `.codex/`, plugin packaging, and `/hooks` trust bypass.

**Files Changed**:

* `.spec_system/specs/phase10-session02-codex-hook-install-uninstall-and-diagnostics/implementation-notes.md` - initialized session notes and logged T001.
* `.spec_system/specs/phase10-session02-codex-hook-install-uninstall-and-diagnostics/tasks.md` - marked T001 complete.

**BQC Fixes**:

* Trust boundary enforcement: confirmed implementation scope must not cross into Codex auth, trust, account, provider, telemetry, model, profile, or project-local config mutation.

***


---

# 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/phase10-session02-codex-hook-install-uninstall-and-diagnostics/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.
