GREEN:

# Front Door Hooks Step 3 Report 2026-05-18

## Purpose

内川様の「止めないでいいから最後まで進めてください」を、Step 3の明示許可として扱い、Codex project-local check-only hooks pilotを実装した。

## Changed Files

- `.codex/hooks.json`
- `.codex/hooks.example.json`
- `scripts/ai_workflow/hooks/codex_hook_adapter.py`
- `scripts/ai_workflow/frontdoor_check.py`
- `docs/ai_workflow/codex_hooks_setup_guide.md`
- `docs/ai_workflow/claude_worker_preflight_gate.md`
- `docs/ai_workflow/codex_runtime_settings_guide.md`

## What Changed

- `.codex/hooks.json` を空の `{"hooks": {}}` から、project-local check-only hook wiringへ変更した。
- hook eventは `UserPromptSubmit`、`PreToolUse`、`PermissionRequest`、`PostToolUse`、`Stop`。
- すべてのhookは `scripts/ai_workflow/hooks/codex_hook_adapter.py` だけを呼ぶ。
- adapterは既存の `pre_prompt_guard.py`、`pre_tool_guard.py`、`secret_scanner.py`、`post_evidence_collector.py` を読み取り専用で呼び出す。
- 現在のpilotはadvisory / check-only。`systemMessage` または `additionalContext` を返すだけで、外部API、MCP、Browser、Computer Use、Claude Code body execution、本番操作、保存、送信、購入、友だち追加完了は行わない。
- `frontdoor_check.py` は空hooks専用の検査から、許可されたcheck-only hook event、adapter command、timeout <= 10を検査する形へ更新した。

## Verification

- Official hooks docs rechecked: `https://developers.openai.com/codex/hooks`
- `python scripts\ai_workflow\hooks\pre_prompt_guard.py --sample`: GREEN
- `python scripts\ai_workflow\hooks\pre_tool_guard.py --sample`: GREEN
- `python scripts\ai_workflow\hooks\secret_scanner.py --sample`: GREEN
- `python scripts\ai_workflow\hooks\post_evidence_collector.py --sample`: GREEN
- `python scripts\ai_workflow\hooks\stop_report_formatter.py --sample`: GREEN
- `python -m py_compile scripts\ai_workflow\hooks\codex_hook_adapter.py scripts\ai_workflow\hooks\pre_prompt_guard.py scripts\ai_workflow\hooks\pre_tool_guard.py scripts\ai_workflow\hooks\secret_scanner.py scripts\ai_workflow\hooks\post_evidence_collector.py scripts\ai_workflow\hooks\stop_report_formatter.py scripts\ai_workflow\frontdoor_check.py`: PASS
- `python scripts\ai_workflow\hooks\codex_hook_adapter.py --sample`: GREEN
- `python -m json.tool .codex\hooks.json`: PASS
- `python -m json.tool .codex\hooks.example.json`: PASS
- PowerShell command path smoke: `{"hook_event_name":"PreToolUse","tool_name":"Bash","tool_input":{"command":"git push"}} | python "$(git rev-parse --show-toplevel)/scripts/ai_workflow/hooks/codex_hook_adapter.py"` returned advisory JSON.
- `python scripts\ai_workflow\frontdoor_check.py`: GREEN
- `python scripts\ai_workflow\evidence_check.py --sample`: GREEN
- `python scripts\secretary\frontdoor_design_reform_lint.py --write-json tmp\frontdoor_hooks_step3_reform_lint_20260518.json`: PASS, findings_count 0
- `python -m unittest tests.test_universal_work_control_plane`: PASS, 25 tests
- Targeted `git diff --check`: PASS with LF/CRLF warnings only.
- `python scripts\secretary\evidence_package_lint.py tmp\frontdoor_hooks_step3_evidence_20260518.json`: PASS
- `python scripts\secretary\uwcp_adoption_gate.py --intent tmp\frontdoor_hooks_step3_intent_20260518.json --evidence tmp\frontdoor_hooks_step3_evidence_20260518.json --write-receipt tmp\frontdoor_hooks_step3_adoption_receipt_20260518.json`: ADOPTED

## Unchecked

- Whether the currently running Codex app session reloads `.codex/hooks.json` immediately was not directly observed.
- If the installed Codex runtime requires project trust or a restart to pick up project-local hooks, that must be done through the Codex UI/runtime flow. User-level config was not edited.

## Unexecuted High-Risk Operations

- User-level Codex settings edit: not executed
- `.mcp.json` or MCP server setup: not executed
- env/credential/secret edit: not executed
- production read/write: not executed
- external API write: not executed
- Browser/Computer Use operation: not executed
- Claude Code body execution from hooks: not executed
- save/send/purchase/friend-add completion: not executed
- commit/push/PR/merge: not executed

## PR / Commit State

- commit: not executed
- push: not executed
- PR: not created
- merge: not executed

## Decision Point

No ChatGPT decision is required for this Step 3 implementation. The remaining operational check is observing whether Codex runtime loads project-local hooks in a fresh/trusted session.
