Port jq-removal fix from #1519 to Codex adapter hook#1527
Conversation
adapter/codex/hooks/on-session-start.sh (the Codex POSIX fallback; the Windows-native primary on-session-start.ps1 never depended on jq) still called an external jq binary for JSON output wrapping, HOOK_INPUT field extraction, and cold-start diff-only state read/write. Ports the same node -e replacement #1519 applied to the Claude-side hook, using node as the safe-assumption runtime dependency instead of an external jq binary that may not be installed. Smoke-tested end to end (two consecutive runs against this workspace): first run produces valid JSON with full material, second run correctly takes the diff-only "no new orientation material" path, confirming the node-based state read/write/compare cycle works. Also fixes two docs/ references (2.-Evolution.md, 6.-Adapter.md) that still described the pre-#1519 jq-based fail-safe/matcher-extraction behavior — found stale during the same full-refactor audit that surfaced this gap. #1519でClaude側hookから除去した外部jq依存が、Codex側のPOSIX fallback hookに 移植されていなかったため、同じnode -e置換パターンを移植し、docsの古いjq記述も 合わせて修正した。 Closes #1526 Co-authored-by: Claude Lin & Lay <noreply@anthropic.com>
liplus-lin-lay
left a comment
There was a problem hiding this comment.
Self-review (brake 1 完了)
skills/evolution-parallel-agent-eval に基づき N=3 opus 並列評価者を実行(全員 direct 調査、サブエージェント連鎖なし)。
Axis A (挙動一貫性/移植の正しさ): 3/3 consistent — jq 呼び出し4箇所(flush_json ラップ・.cwd 抽出・matcher 抽出・state 読み書き)すべて node -e で意味的に等価に移植、既存 fallback (sed regex / sha256 fail-safe) は無傷、gh --jq 組み込みは対象外と正しく除外、bash -n 構文チェック通過。1人はさらに実際に write→read round-trip を実行して確認。
Axis B (impression-literal detection, 固定軸): 3/3 consistent — 追加コメント・docs 修正はすべて load-bearing rationale、rhetorical padding なし。
Axis C (可読性/保守性): 3/3 consistent — Claude 側 reference と構造が揃っており今後の sync が容易、state 部分はむしろ旧 jq 版より読みやすいとの指摘あり。
判定: 3/3 全軸 unanimous PASS。DEVIATION なし。
brake 2 は非該当(adapter/codex/** は L6-adapter layer、L1-model ではない)。
実機スモークテストも実施済み(このセッションの実ワークスペースで2回連続実行、full-emit → diff-only 遷移を確認、テスト生成物は削除済み)。Codex CLI 自体との実機統合検証は [[project-codex-realdevice-verification-deferred]] により意図的 defer 中(2026-07-01 Master 確認済)。
release classification: patch (dormant Codex アダプター側のバグ修正、Master が現在使用している Claude host の挙動には無観測)。semi_auto mode の patch 経路に従い AI 直接 merge する。
目的
#1526 の修正実装。
adapter/codex/hooks/on-session-start.sh(Codex POSIX fallback hook)に未移植だった外部jqバイナリ依存を除去する。背景
2026-07-06 scheduled evolution-full-run の full-refactor 監査(adapter parity check)で発見。#1519 は Claude 側 hook の jq 依存を
node -eに置換したが、Codex 側の POSIX fallback(.sh。Windows ネイティブ primary の.ps1は元々 jq 非依存)には移植されていなかった。変更内容
flush_json()の JSON 出力ラップ、HOOK_INPUTからのcwd/matcher抽出、cold-start diff-only state の読み書きを、すべて Fix on-session-start.sh gh-install OS assumption and remove jq dependency #1519 と同じnode -eパターンに置換。C:\Users\smile\Code)を対象に2回連続実行し、1回目が正常な full-emit JSON、2回目が正しく diff-only の "no new orientation material" 経路を通ることを確認済み。テスト生成物 (.codex/state/) は削除済み。brake
brake 1 (
skills/evolution-parallel-agent-eval) を実行予定。adapter/codex/**は L6-adapter layer (L1-model ではない) のため brake 2 は不要。Closes #1526