Skip to content

Port jq-removal fix from #1519 to Codex adapter hook#1527

Merged
liplus-lin-lay merged 1 commit into
mainfrom
1526-port-jq-removal-fix-from-1519-to-codex-adapters-on-session-startsh-posix-fallback
Jul 6, 2026
Merged

Port jq-removal fix from #1519 to Codex adapter hook#1527
liplus-lin-lay merged 1 commit into
mainfrom
1526-port-jq-removal-fix-from-1519-to-codex-adapters-on-session-startsh-posix-fallback

Conversation

@liplus-lin-lay

Copy link
Copy Markdown
Member

目的

#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 パターンに置換。
  • 既存の fail-safe fallback(sed regex による matcher 抽出、jq/node 両方不在時の full-emit)は維持。
  • state 書き込みは Claude 側と同じく「配列に蓄積 → 最後に node 一括書き込み」方式にリファクタ(元は section ごとに jq を都度呼ぶ方式だった)。
  • 実機スモークテスト実施: このワークスペース(C:\Users\smile\Code)を対象に2回連続実行し、1回目が正常な full-emit JSON、2回目が正しく diff-only の "no new orientation material" 経路を通ることを確認済み。テスト生成物 (.codex/state/) は削除済み。
  • Codex 実機(harness統合)検証は [[project-codex-realdevice-verification-deferred]] の対象範囲(2026-07-01 Master確認済、新Codexモデル待ち)。本PRはシェルスクリプト単体のスモークテストのみで、Codex CLI 自体との統合検証は次回実機使用時に回す。
  • ついでに docs/2.-Evolution.md・docs/6.-Adapter.md の古い jq 記述(同監査で発見)も node に修正。

brake

brake 1 (skills/evolution-parallel-agent-eval) を実行予定。adapter/codex/** は L6-adapter layer (L1-model ではない) のため brake 2 は不要。

Closes #1526

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 liplus-lin-lay left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 する。

@liplus-lin-lay liplus-lin-lay merged commit 4be81d7 into main Jul 6, 2026
2 checks passed
@liplus-lin-lay liplus-lin-lay deleted the 1526-port-jq-removal-fix-from-1519-to-codex-adapters-on-session-startsh-posix-fallback branch July 6, 2026 00:02
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.

Port jq-removal fix from #1519 to Codex adapter's on-session-start.sh POSIX fallback

1 participant