Skip to content

feat: retire orphaned codex-hook-adapter.mjs と adapter-only tests - #2428

Merged
squne121 merged 2 commits into
mainfrom
worktree-issue-2412-codex-hook-adapter-cleanup
Aug 30, 2026
Merged

squne121 merged 2 commits into
mainfrom
worktree-issue-2412-codex-hook-adapter-cleanup

Conversation

@squne121

@squne121 squne121 commented Aug 30, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • PR feat: retire native Codex CLI assets and documentation #2409(8675869e18cff37efb62914f81490d323e4ee0ce、fresh default-branch HEAD d9a251a872280cd1e208dfa697b7daeb64d194c0)が native Codex CLI runtime を retire し .codex/hooks.json / .codex/hooks/session-recording-composite.mjs を削除した結果、orphan となった scripts/session-recording/codex-hook-adapter.mjs を DELETE_CHAIN で削除する。
  • fresh HEAD 上で git grep -n -- 'codex-hook-adapter\.mjs' による complete tracked-file inventory を実施し、production inbound producer count == 0 を確認した(Issue 実装: scripts/session-recording/codex-hook-adapter.mjs の残存 .codex 参照を削除する #2412 Decision Gate に従う)。
  • adapter 本体と adapter-only tests(tests/hooks/codex-harness-advisory-boundary.test.ts、tests/hooks/codex-harness-advisory-recorder.test.ts、tests/hooks/codex-harness-workflow-gates.test.ts、tests/hooks/codex-harness-advisory-fail-open.test.ts、tests/session_recording/codex/test_hook_adapter.py、tests/session_recording/codex/test_initial_branch_create_lane.py、tests/session_recording/codex/test_external_manifest_publish.py)を削除した。
  • 実装中に判明した追加項目: tests/hooks/codex-harness-advisory-fail-open.test.ts は当初 Issue 実装: scripts/session-recording/codex-hook-adapter.mjs の残存 .codex 参照を削除する #2412 の Allowed Paths に含まれていなかったが、tests/hooks/codex-harness-advisory-recorder.test.ts が export する invoke ヘルパー(アダプタを直接 spawn する)の唯一の consumer であることが pnpm test 失敗を通じて判明した。独立した fresh-HEAD 調査(read-only、git grep + 全文読解)で「同ファイルはアダプタの fail-open 挙動のみを検証しており、他に独立した production contract を持たない」ことを確認し、direct operator instruction による bounded contract repair(Issue 実装: scripts/session-recording/codex-hook-adapter.mjs の残存 .codex 参照を削除する #2412 本文への Allowed Paths / In Scope / AC3 / 新規 VC 追加)を経て DELETE_CHAIN に追加した。新たな production inbound producer は発見されていない(既存の production_inbound_producer_count == 0 の結論は変更なし)。
  • 削除に伴う mechanical cleanup: scripts/agent-guards/tests/test_git_mutation_command_policy.py の adapter direct-reference guard assertion を削除し、.github/workflows/ci.yml から削除済み3テストパスへの参照(通常実行・xdist実行・collect-only target・ci_test_selection artifact の pytest_args・session-recording prefix 判定・存在 assertion・コメント)を除去し、.github/ci/python-test-plan.json の secondary_coverage.dedicated_lanes から該当3エントリを除去した。
  • OWNER REQUEST_CHANGES 反映(issuecomment-5466835712): scripts/agent-guards/git_mutation_command_policy.py の _AUTHORIZED_EXECUTION_BOUNDARY_LAYERS に、削除済みアダプタが渡していた codex_hook_adapter_pretooluse という 実行可能な authorization value が残存し、remote-write transaction の直前で実際に authorization 判定に使われていることが判明した(Issue 実装: scripts/session-recording/codex-hook-adapter.mjs の残存 .codex 参照を削除する #2412 は当該箇所を誤って「historical/design-rationale prose」として Out of Scope 扱いしていた)。_AUTHORIZED_EXECUTION_BOUNDARY_LAYERS を frozenset({"worktree_scope_guard_denied"}) へ縮小し、--boundary-layer codex_hook_adapter_pretooluse が他の未知値と同様に execution_not_authorized_for_boundary_layer で拒否されることを検証する focused regression test を追加した。あわせて docs/dev/hook-boundaries.md の「Codex advisory hook allowlist」節を、docs/dev/session-recording-policy.md の既存 historical framing に合わせて historicize した。

AC2 の詳細インベントリ(fresh HEAD ef2c7175、OWNER 指摘 P2 反映)

git grep -n -- 'codex-hook-adapter\.mjs' の全 hit を分類し、以下の表にまとめた(production inbound producer / test-only / docs-historical / fixture の4分類)。

path classification
scripts/session-recording/codex-hook-adapter.mjs adapter 本体(DELETE 対象)
tests/hooks/codex-harness-advisory-boundary.test.ts test-only(DELETE 対象)
tests/hooks/codex-harness-advisory-recorder.test.ts test-only(DELETE 対象)
tests/hooks/codex-harness-workflow-gates.test.ts test-only(DELETE 対象)
tests/hooks/codex-harness-advisory-fail-open.test.ts test-only(DELETE 対象、recorder test の invoke 唯一の consumer)
tests/session_recording/codex/test_hook_adapter.py test-only(DELETE 対象)
tests/session_recording/codex/test_initial_branch_create_lane.py test-only(DELETE 対象)
tests/session_recording/codex/test_external_manifest_publish.py test-only(DELETE 対象)
scripts/agent-guards/tests/test_git_mutation_command_policy.py comment-only(DELETE_CHAIN に伴い adapter direct-reference guard assertion を削除)
scripts/agent-guards/git_mutation_command_policy.py comment-only/filename 文字列は含むが、codex_hook_adapter_pretooluse という 別の識別子が executable authorization value として残っていたため本 PR で除去(filename grep だけでは検出不能な semantic residue)
.github/workflows/ci.yml comment-only(削除済みパス参照を mechanical cleanup)
.claude/scripts/check_session_recording_runtime_safety.py comment-only(本 Issue Allowed Paths 外、prose のみ、未変更)
.claude/skills/impl-review-loop/steps/step-5-feedback-and-termination.md docs-historical 相当の prose(本 Issue Allowed Paths 外、未変更)
scripts/agent-guards/tests/test_skill_runtime_exec_session_manifest.py comment-only(「これはアダプタではない」旨を明示する既存コメント、本 Issue Allowed Paths 外、未変更)
scripts/session-recording/bootstrap-source-bound-readiness.mjs comment-only(本 Issue Allowed Paths 外、未変更)

production inbound producer count は 0 である(.codex/hooks.json および composite hook は既に不在であることを確認済み)。

追加の semantic sweep(filename 文字列に依存しない識別子を横断検索、OWNER 提案):

$ git grep -n -E -e 'codex_hook_adapter_pretooluse' -e 'CODEX_PASSIVE_RECORDING_DIR' -e 'codex_passive_session_record' -e 'passive-events\.jsonl' -e 'codex-hook-adapter\.mjs' -- ':(exclude)docs/**'

この sweep で実際に codex_hook_adapter_pretooluse という production 側の semantic residue(上記の git_mutation_command_policy.py の authorization value)を発見し、本 PR で除去した。

Checks

  • pnpm typecheck
  • pnpm lint
  • pnpm test(1874 passed, 105 files)
  • uv run --locked pytest -q scripts/agent-guards/tests/test_git_mutation_command_policy.py(37 passed)
  • pnpm build
  • 上記コマンドをすべてローカルで実行し、成功したことを確認してからチェックしています

Schema Change Applicability

  • decision: not_schema_change
  • reason: producer-consumer 境界をまたぐ machine-readable contract の変更ではなく、production inbound producer が存在しない(production_inbound_producer_count == 0)ことを確認した上での adapter・adapter-only tests・その参照の完全削除である。adapter が書いていた passive-events.jsonl フォーマットの consumer も同時に廃止されるため、residual schema consumer は存在しない。

Schema Consumer Inventory

N/A — not_schema_change のため対象外。

Compatibility Decision(互換性判定)

  • change_type: N/A
  • compatibility: N/A
  • migration_required: N/A
  • migration_or_followup: N/A
  • reason: schema 変更ではないため該当なし。

Visual Impact Declaration(視覚影響申告)

本 PR は DOM/CSS の変更を含まないが、.github/workflows/ci.yml の編集が meta_policy_change として visual-impact-policy に検出され、既定 surface(combat-hud-critical / combat-hud-running)が影響候補として自動列挙されたため、以下の宣言で verified_unchanged を明示する。実際の変更内容は native Codex CLI adapter とその専用テストの削除、および CI 上の該当パス参照の mechanical cleanup のみであり、UI/DOM/CSS は一切変更していない。

schema: VISUAL_IMPACT_DECLARATION_V1
surfaces:
  - surface_id: combat-hud-critical
    disposition: verified_unchanged
  - surface_id: combat-hud-running
    disposition: verified_unchanged

Safety Claim Matrix

Claim Implemented? Not controlled Evidence Follow-up
削除される codex-hook-adapter.mjs は削除前の時点で live production inbound producer を持たない(fresh HEAD 上で .codex/hooks.json / composite hook が既に不在) yes N/A 上記 AC2 path-by-path inventory(本 PR 説明)。全 hit が test-only / docs-historical / comment-only、production inbound producer count == 0 N/A
git_mutation_command_policy.py の remote-write gate(execute_existing_branch_update_transaction / execute_initial_branch_create_transaction)から、削除済みアダプタ用の codex_hook_adapter_pretooluse authorization value を除去し、残る唯一の authorized caller は worktree_scope_guard_denied(Claude Code 側の trusted in-process caller)のみになる。gate の deny-by-default 挙動自体は変更せず、認可対象の縮小のみ yes N/A _AUTHORIZED_EXECUTION_BOUNDARY_LAYERS の変更差分(本 PR)。新規 focused regression test test_retired_codex_hook_adapter_boundary_layer_is_no_longer_authorized が --boundary-layer codex_hook_adapter_pretooluse の deny を検証。uv run --locked pytest -q scripts/agent-guards/tests/test_git_mutation_command_policy.py → 37 passed N/A

Notes

@github-actions

Copy link
Copy Markdown
Contributor

Preview URL

✅ verified live assets: https://squne121.github.io/loop-protocol/pr-2428/

The preview will be removed when this PR is closed.

@squne121
squne121 marked this pull request as ready for review August 30, 2026 04:33
@squne121

Copy link
Copy Markdown
Owner Author

判定: REQUEST_CHANGES

PR #2428 の方向性、つまり native Codex CLI を repository から retire した以上、孤立した codex-hook-adapter.mjs と専用テストを残さないという判断には賛成です。PR は 11 files、+10/-419 のほぼ純粋な DELETE_CHAIN で、#2412 が定めた「#2409 merged + production producer 0 の場合のみ削除」という基本 gate に沿っています。

ただし、現状は retirement が production policy と repository SSOT まで完結していません。新しい harness を増やす必要はありません。むしろ残存した Codex-specific control path と stale contract を削る方向が適切です。

優先度 | Finding | 判定 -- | -- | -- P1 / BLOCKER | git_mutation_command_policy.py に retired Codex adapter 用の実行可能な authorization valueが残っている | 修正必須 P1 / HIGH | stable SSOT hook-boundaries.md が、存在しない Codex hook をまだ「active」と規定している | 同 PR 修正推奨 P1 / HIGH | OPEN Issue #1852 / #2050 が削除対象 adapter / .codex/** の実装を要求したまま | merge と同時に disposition 必須 P2 / MEDIUM | #2412 AC2 が要求する complete inventory が PR body に列挙されておらず、filename grep では semantic residue を見逃した | evidence 修正推奨

1. BLOCKER — retired adapter の authorization lane が production code に残っている

これが最大の問題です。

現在の scripts/agent-guards/git_mutation_command_policy.py は、

_AUTHORIZED_EXECUTION_BOUNDARY_LAYERS = {"worktree_scope_guard_denied", "codex_hook_adapter_pretooluse"}

を保持しています。しかもコメントだけではなく、実際の remote-write transaction の直前でこの集合を authorization 判定に使っています。

つまり #2428 は adapter と「adapter を参照するテスト」は消していますが、

codex_hook_adapter_pretooluse という、もう存在しない caller を production policy が trusted boundary として受理する能力

を残しています。

これは「重大なセキュリティ脆弱性」とまでは断定しません。他の precondition も存在するためです。しかし retirement としては明確に不完全です。また source comment 自身が、この boundary string は secret ではなく caller authentication でもないと説明しています。したがって dead caller identity を残す有用性がありません。

しかも #2412 は、git_mutation_command_policy.py 内の adapter reference を「historical/design-rationale prose」と分類して Out of Scope にしています。
実態はそうではなく、comment + executable allowlist です。

ここは harness を追加するのではなく単純に、

_AUTHORIZED_EXECUTION_BOUNDARY_LAYERS = frozenset(
    {"worktree_scope_guard_denied"}
)

へ縮め、Codex adapter 前提のコメントを削除し、既存テストに

codex_hook_adapter_pretooluse -> execution_not_authorized_for_boundary_layer

を1ケース足す程度で十分です。

これは security 強化というより dead control-plane branch の削除です。ワークフローを重くしません。


2. HIGH — docs/dev/hook-boundaries.md が retirement 後の世界と矛盾する

docs/dev/hook-boundaries.md は status: stable で、hook boundary の正本を名乗っています。しかし現在も、

project-local Codex hook の active allowlist は SessionEnd と SubagentStop の passive recorder

と書き、.codex/hooks.json を active configuration として説明しています。

一方、

です。

ここを残すと、今後 Claude Code / Claude-GPT が stable SSOT を読んだ際に、

「Codex passive recorder は active なはずなのに実装がない」

という逆方向の修復を始める可能性があります。

session-recording-policy.md は少なくとも Codex section を historical と明記しています。
hook-boundaries.md も同様に historical framing にするか、active Codex section を削除するのが適切です。

これは新しい checker や docs drift harness を作る話ではありません。stale prose を消すだけでよいです。


3. HIGH — OPEN backlog が削除後の architecture を逆行させる

少なくとも以下の2件が現在 OPEN のままです。

Issue #1852 は、まさに削除される codex-hook-adapter.mjs に対して write budget / file-type validation を実装する Issue です。

Issue #2050 はさらに、

  • codex-hook-adapter.mjs の SubagentStop

  • .codex/config.toml

  • .codex/hooks.json

  • .codex/hooks/session-recording-composite.mjs

を実装対象にしています。

#2428 merge 後にこれらを通常の implementation queue へ流すと、retire した architecture を agent が再導入しようとする可能性があります。

個人趣味開発なら dependency graph や stale-Issue detector を新設する必要はありません。#2428 merge に合わせて、

で十分です。

特に #1852 の defect は、adapter 自体を削除するなら直さないのが最善です。余計な安全実装を増やさないという今回の方針にも合います。


4. MEDIUM — AC2 の inventory evidence が弱く、実際に semantic residue を見逃した

#2412 AC2 は、fresh HEAD 上の git grep 全 hit を分類し、PR body に記録することを要求しています。

ところが #2428 body は、

all hit が test-only / docs-historical / comment-only
production inbound producer count == 0

という集約結果だけで、path-by-path inventory を掲載していません。

通常なら軽微ですが、今回は実際に codex_hook_adapter_pretooluse という production semantic residue が見つかったため、単なる証跡不足ではありません。

filename だけの

git grep 'codex-hook-adapter\.mjs'

に加えて、今回の DELETE_CHAIN では少なくとも一度だけ、

git grep -n -E -- \
  'codex_hook_adapter_pretooluse|CODEX_PASSIVE_RECORDING_DIR|codex_passive_session_record|passive-events\.jsonl|codex-hook-adapter\.mjs'

程度の semantic sweep を行えば十分です。

これも新規 harness にする必要はなく、one-shot verification command で足ります。


upstream Codex との照合

一点重要なのは、Codex hooks 自体が obsolete だから削除するわけではないことです。

現在の upstream openai/codex には Hook event schema と hook runtime/engine が依然として実装され、SubagentStop、SessionEnd、PreToolUse 等の lifecycle が存在します。(GitHub)

したがって #2412/#2428 の rationale は現在のまま、

upstream 機能が死んだからではなく、loop-protocol が native Codex CLI runtime を意図的に retire したため

とするのが正しいです。

PR #2409 が一度 boundary/fail-open/recorder tests を「provider-neutral advisory recorder」として RETAIN した履歴もあります。
その後 #2412 で「実体は Codex-specific env/schema/lifecycle にしか接続されず producer 0」と再評価して DELETE へ転換したこと自体は合理的です。

推奨する最小 fix_delta

大規模な再 refinement や新規 harness は不要です。

git_mutation_command_policy.py から codex_hook_adapter_pretooluse の executable authorization を削除することを merge blocker にし、対応する focused regression test を更新する。その上で hook-boundaries.md の active Codex recorder 記述を historical 化し、PR body に semantic inventory 結果を追記するのが最小構成です。

#1852/#2050 はコードに混載せず、merge 前後の GitHub housekeeping として superseded / reframe すればよいです。

最終 CI は現 head で green まで到達しており、今回の問題は「テストが足りない」というより 削除境界の classification が1段浅いことです。したがって CI/harness をさらに増やすより、dead production authority・stale SSOT・stale backlog を削る方が、このリポジトリには有用です。

結論として、DELETE_CHAIN 自体は KEEP。PR #2428 は現状のまま merge せず、上記 P1 の production authorization residue を除去してから merge を推奨します。

## 判定: **REQUEST_CHANGES**

PR #2428 の方向性、つまり native Codex CLI を repository から retire した以上、孤立した codex-hook-adapter.mjs と専用テストを残さないという判断には賛成です。PR は 11 files、+10/-419 のほぼ純粋な DELETE_CHAIN で、#2412 が定めた「#2409 merged + production producer 0 の場合のみ削除」という基本 gate に沿っています。

ただし、現状は retirement が production policy と repository SSOT まで完結していません。新しい harness を増やす必要はありません。むしろ残存した Codex-specific control path と stale contract を削る方向が適切です。

優先度 Finding 判定
P1 / BLOCKER git_mutation_command_policy.py に retired Codex adapter 用の実行可能な authorization valueが残っている 修正必須
P1 / HIGH stable SSOT hook-boundaries.md が、存在しない Codex hook をまだ「active」と規定している 同 PR 修正推奨
P1 / HIGH OPEN Issue #1852 / #2050 が削除対象 adapter / .codex/** の実装を要求したまま merge と同時に disposition 必須
P2 / MEDIUM #2412 AC2 が要求する complete inventory が PR body に列挙されておらず、filename grep では semantic residue を見逃した evidence 修正推奨

1. BLOCKER — retired adapter の authorization lane が production code に残っている

これが最大の問題です。

現在の scripts/agent-guards/git_mutation_command_policy.py は、

_AUTHORIZED_EXECUTION_BOUNDARY_LAYERS = {"worktree_scope_guard_denied", "codex_hook_adapter_pretooluse"}

を保持しています。しかもコメントだけではなく、実際の remote-write transaction の直前でこの集合を authorization 判定に使っています。

つまり #2428 は adapter と「adapter を参照するテスト」は消していますが、

codex_hook_adapter_pretooluse という、もう存在しない caller を production policy が trusted boundary として受理する能力

を残しています。

これは「重大なセキュリティ脆弱性」とまでは断定しません。他の precondition も存在するためです。しかし retirement としては明確に不完全です。また source comment 自身が、この boundary string は secret ではなく caller authentication でもないと説明しています。したがって dead caller identity を残す有用性がありません。

しかも #2412 は、git_mutation_command_policy.py 内の adapter reference を「historical/design-rationale prose」と分類して Out of Scope にしています。
実態はそうではなく、comment + executable allowlist です。

ここは harness を追加するのではなく単純に、

_AUTHORIZED_EXECUTION_BOUNDARY_LAYERS = frozenset(
    {"worktree_scope_guard_denied"}
)

へ縮め、Codex adapter 前提のコメントを削除し、既存テストに

codex_hook_adapter_pretooluse -> execution_not_authorized_for_boundary_layer

を1ケース足す程度で十分です。

これは security 強化というより dead control-plane branch の削除です。ワークフローを重くしません。


2. HIGH — docs/dev/hook-boundaries.md が retirement 後の世界と矛盾する

docs/dev/hook-boundaries.md は status: stable で、hook boundary の正本を名乗っています。しかし現在も、

project-local Codex hook の active allowlist は SessionEnd と SubagentStop の passive recorder

と書き、.codex/hooks.json を active configuration として説明しています。

一方、

です。

ここを残すと、今後 Claude Code / Claude-GPT が stable SSOT を読んだ際に、

「Codex passive recorder は active なはずなのに実装がない」

という逆方向の修復を始める可能性があります。

session-recording-policy.md は少なくとも Codex section を historical と明記しています。
hook-boundaries.md も同様に historical framing にするか、active Codex section を削除するのが適切です。

これは新しい checker や docs drift harness を作る話ではありません。stale prose を消すだけでよいです。


3. HIGH — OPEN backlog が削除後の architecture を逆行させる

少なくとも以下の2件が現在 OPEN のままです。

Issue #1852 は、まさに削除される codex-hook-adapter.mjs に対して write budget / file-type validation を実装する Issue です。

Issue #2050 はさらに、

  • codex-hook-adapter.mjs の SubagentStop
  • .codex/config.toml
  • .codex/hooks.json
  • .codex/hooks/session-recording-composite.mjs

を実装対象にしています。

#2428 merge 後にこれらを通常の implementation queue へ流すと、retire した architecture を agent が再導入しようとする可能性があります。

個人趣味開発なら dependency graph や stale-Issue detector を新設する必要はありません。#2428 merge に合わせて、

で十分です。

特に #1852 の defect は、adapter 自体を削除するなら直さないのが最善です。余計な安全実装を増やさないという今回の方針にも合います。


4. MEDIUM — AC2 の inventory evidence が弱く、実際に semantic residue を見逃した

#2412 AC2 は、fresh HEAD 上の git grep 全 hit を分類し、PR body に記録することを要求しています。

ところが #2428 body は、

all hit が test-only / docs-historical / comment-only
production inbound producer count == 0

という集約結果だけで、path-by-path inventory を掲載していません。

通常なら軽微ですが、今回は実際に codex_hook_adapter_pretooluse という production semantic residue が見つかったため、単なる証跡不足ではありません。

filename だけの

git grep 'codex-hook-adapter\.mjs'

に加えて、今回の DELETE_CHAIN では少なくとも一度だけ、

git grep -n -E -- \
  'codex_hook_adapter_pretooluse|CODEX_PASSIVE_RECORDING_DIR|codex_passive_session_record|passive-events\.jsonl|codex-hook-adapter\.mjs'

程度の semantic sweep を行えば十分です。

これも新規 harness にする必要はなく、one-shot verification command で足ります。


upstream Codex との照合

一点重要なのは、Codex hooks 自体が obsolete だから削除するわけではないことです。

現在の upstream openai/codex には Hook event schema と hook runtime/engine が依然として実装され、SubagentStop、SessionEnd、PreToolUse 等の lifecycle が存在します。([GitHub]1)

したがって #2412/#2428 の rationale は現在のまま、

upstream 機能が死んだからではなく、loop-protocol が native Codex CLI runtime を意図的に retire したため

とするのが正しいです。

PR #2409 が一度 boundary/fail-open/recorder tests を「provider-neutral advisory recorder」として RETAIN した履歴もあります。
その後 #2412 で「実体は Codex-specific env/schema/lifecycle にしか接続されず producer 0」と再評価して DELETE へ転換したこと自体は合理的です。

推奨する最小 fix_delta

大規模な再 refinement や新規 harness は不要です。

git_mutation_command_policy.py から codex_hook_adapter_pretooluse の executable authorization を削除することを merge blocker にし、対応する focused regression test を更新する。その上で hook-boundaries.md の active Codex recorder 記述を historical 化し、PR body に semantic inventory 結果を追記するのが最小構成です。

#1852/#2050 はコードに混載せず、merge 前後の GitHub housekeeping として superseded / reframe すればよいです。

最終 CI は現 head で green まで到達しており、今回の問題は「テストが足りない」というより 削除境界の classification が1段浅いことです。したがって CI/harness をさらに増やすより、dead production authority・stale SSOT・stale backlog を削る方が、このリポジトリには有用です。

結論として、DELETE_CHAIN 自体は KEEP。PR #2428 は現状のまま merge せず、上記 P1 の production authorization residue を除去してから merge を推奨します。

Test added 2 commits August 30, 2026 14:15
…2412)

PR #2409 merged (8675869) and removed
.codex/hooks.json / .codex/hooks/session-recording-composite.mjs, leaving
scripts/session-recording/codex-hook-adapter.mjs as an orphaned native
Codex CLI runtime asset with production_inbound_producer_count == 0
(verified via fresh-HEAD git grep inventory).

DELETE_CHAIN:
- scripts/session-recording/codex-hook-adapter.mjs (adapter)
- tests/hooks/codex-harness-advisory-boundary.test.ts
- tests/hooks/codex-harness-advisory-recorder.test.ts
- tests/hooks/codex-harness-workflow-gates.test.ts
- tests/hooks/codex-harness-advisory-fail-open.test.ts (discovered
  mid-implementation: sole consumer of codex-harness-advisory-recorder's
  exported `invoke` helper, which spawns the adapter directly -- deleting
  the recorder test alone breaks this file's import and fails pnpm test)
- tests/session_recording/codex/test_hook_adapter.py
- tests/session_recording/codex/test_initial_branch_create_lane.py
- tests/session_recording/codex/test_external_manifest_publish.py

Mechanical cleanup of stale references:
- scripts/agent-guards/tests/test_git_mutation_command_policy.py: removed
  the adapter direct-reference guard assertion that read the now-deleted
  source file.
- .github/workflows/ci.yml: removed the 3 dead pytest steps, dropped the
  3 deleted test paths from collect-only/pytest_args/session-recording
  prefix classification, and reworded a comment to stop referencing the
  deleted filename.
- .github/ci/python-test-plan.json: removed the secondary_coverage entry
  for the 3 deleted test paths.

Runtime verification: not_applicable (static cleanup + tracked-file
inventory only; no native Codex runtime session to exercise).

Closes #2412
…ue (#2412)

OWNER REQUEST_CHANGES review on PR #2428
(#2428 (comment))
found that scripts/agent-guards/git_mutation_command_policy.py still
authorized `boundary_layer=codex_hook_adapter_pretooluse` -- a live caller
identity for the now-deleted native Codex CLI hook adapter -- in the
remote-write authorization gate used by
execute_existing_branch_update_transaction and
execute_initial_branch_create_transaction.

- _AUTHORIZED_EXECUTION_BOUNDARY_LAYERS narrows to
  frozenset({"worktree_scope_guard_denied"}); no caller in the repo passes
  codex_hook_adapter_pretooluse anymore (verified via git grep).
- Add a focused regression test asserting
  --boundary-layer codex_hook_adapter_pretooluse is now rejected with
  execution_not_authorized_for_boundary_layer, same as any other unknown
  caller.
- docs/dev/hook-boundaries.md's "Codex advisory hook allowlist" section
  historicized to match docs/dev/session-recording-policy.md's existing
  historical framing for the same retired architecture -- it previously
  described the passive recorder as currently active, which could prompt
  a future agent to reintroduce the retired architecture.

Closes #2412
@squne121
squne121 force-pushed the worktree-issue-2412-codex-hook-adapter-cleanup branch from e0ec0c0 to a5566b1 Compare August 30, 2026 05:16
@squne121
squne121 merged commit dab370e into main Aug 30, 2026
38 of 44 checks passed
@squne121
squne121 deleted the worktree-issue-2412-codex-hook-adapter-cleanup branch August 30, 2026 05:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

実装: scripts/session-recording/codex-hook-adapter.mjs の残存 .codex 参照を削除する

1 participant