codex hooks.json: top-level description を除去(Codex 0.142.5 parse error 回帰)(#185) - #186
Merged
Merged
Conversation
… 回帰)(#185) #181(PR #184)で入れた ~/.codex/hooks.json の top-level "description" が Codex 0.142.5 の TUI hook review 経路で parse error になり hook が読み込めない(未知の top-level キーを厳格化。0.142.2 の plugin 実例は description を持っていたが 0.142.5 で弾かれる回帰)。実機で description 行を外すと parse OK + /hooks trust 成立を確認済み。 template がまだ description を出していたため次の apply で手修正が上書きされ再発 する(MM drift)。修正: - dot_codex/hooks.json.tmpl: rendered JSON を最小形 {"hooks":{...}} にし top-level description を除去。人間向け注記は Go-template コメント(JSON に出ない)へ。 - test-codex-settings.sh: top-level キーが厳密に {hooks} のみ(未知キー無し= 0.142.5 parse-safety)を回帰固定。 - template comment: 0.142.5 の top-level 厳格化を honest-label。 template == live(ユーザーの手修正と一致)で drift 解消・apply 不要。codex doctor は hooks.json を厳格 validate しない(description 有無で差なし)ため gate に使えず、 テストでスキーマを pin する。全テスト green・shellcheck clean。 Closes #185 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016qw8BkUDu5WdwhYfiFFX5n
Owner
Author
🔍 レビュー依頼(→ Codex)
|
Owner
Author
📋 レビュー結果(by Codex)判定: ✅ merge 可(must 0)
確認結果(Codex):
must 0 のため CI green 確認後 merge します。 |
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
#181(PR #184)の回帰修正。managed
~/.codex/hooks.jsonの top-leveldescriptionが Codex 0.142.5 の TUI hook review 経路で parse error になり、hook が読み込めなかった(未知 top-level キーを厳格化。0.142.2 の plugin 実例は description を持つが 0.142.5 で弾かれる)。実機の経緯(ユーザー確認・0.142.5)
~/.codex/hooks.jsonからdescription行を外すと parse OK →/hooksの "Trust all and continue" で trust 成立、config.tomlに[hooks.state."/Users/kosako/.codex/hooks.json:pre_tool_use:0:0"]が記録された。chezmoi applyで手修正が上書きされ再発する状態(MM .codex/hooks.json)だった。変更
dot_codex/hooks.json.tmpl: rendered JSON を最小形{"hooks":{...}}にし top-leveldescriptionを除去。人間向け注記は Go-template コメント(JSON に出ない)へ移動。scripts/test-codex-settings.sh: top-level キーが厳密に{hooks}のみ(未知キー無し=0.142.5 parse-safety)を回帰固定。検証
test-codex-settingsに parse-safety guard 追加・test-render/test-doctor/validate-policyは影響なし)、shellcheck -S warningclean。chezmoi statusの codex drift は解消・apply 不要。codex doctorは hooks.json を厳格 validate しない(description 有無で差なし)ため gate に使えず、テストでスキーマを pin。レビュー観点(→ Codex)
hooksのみ・matcher/command/timeout 構造)。{hooks})が過不足ないか。Closes #185
🤖 Generated with Claude Code