Repository navigation
feat: Claude Code 2.1.89 未満向けの legacy hook 経路を退役(v0.79.0) - #178
Merged
Merged
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The migration can leave a current kit hook active after its feature is disabled when both hook generations are present.
Review effort: Balanced
Findings: 1
What changed in this PR
Claude Code 2.1.89 未満向け legacy hook 経路を退役し、既存環境を現行 hook へ移行します。積み重ね元の CLI uninstall 修正と依存関係更新も含まれます。
Changes:
- hook のバージョン分岐を廃止し、旧エントリの移行処理を追加。
- MDM、ドキュメント、テストを現行 hook 形状へ更新。
- stacked PR の CLI uninstall 修正と依存関係更新を反映。
| File | Description |
|---|---|
uninstall.sh |
CLI 削除処理と旧 cache cleanup を更新 |
tests/unit/test-web-content-extraction.sh |
undici fixture を更新 |
tests/unit/test-update-refactor.sh |
legacy hook 更新移行テストを追加 |
tests/unit/test-uninstall.sh |
CLI 削除テストを追加 |
tests/unit/test-runtime-hooks.sh |
legacy 経路の退役を検証 |
tests/unit/test-retired-hooks.sh |
hook 移行関数を検証 |
tests/unit/test-pr-creation-log.sh |
単一 hook 形状へ更新 |
tests/unit/test-mdm-expected.sh |
MDM の現行 hook 形状を検証 |
tests/unit/test-mdm-detect.sh |
runtime lock hash を更新 |
tests/unit/test-hook-fixtures.sh |
legacy 環境変数を削除 |
tests/unit/test-deploy-refactor.sh |
version gate テストを削除 |
tests/unit/test-codex-setup.sh |
CLI subcommand 検査を追加 |
tests/unit/test-auto-update.sh |
cache 退役と version 非依存を検証 |
tests/run-scenarios.sh |
hook 移行シナリオを追加 |
tests/helpers.sh |
legacy hook fixture 変換を追加 |
skills/web-content-extraction/package-lock.json |
脆弱性修正版へ更新 |
setup.sh |
旧 cache cleanup の説明を更新 |
README.md |
最小 CLI 要件と uninstall を文書化 |
README.en.md |
英語ドキュメントを同期 |
mdm/render-expected.py |
現行 hook のみ描画 |
mdm/install-mdm.sh |
legacy MDM フラグを削除 |
mdm/detect-mdm.sh |
runtime bundle hash を更新 |
lib/update.sh |
legacy hook 移行を追加 |
lib/dryrun.sh |
旧 cache の扱いを説明 |
lib/deploy.sh |
CLI version gate を削除 |
features/pr-creation-log/scripts/log-pr.sh |
legacy filtering を削除 |
features/pr-creation-log/hooks.legacy.json |
legacy fragment を削除 |
features/auto-update/scripts/auto-update.sh |
24h cache 経路を削除 |
features/auto-update/hooks.legacy.json |
legacy fragment を削除 |
docs/mdm/README.md |
MDM 要件と hash を更新 |
CLAUDE.md |
開発規約を新しい要件へ更新 |
CHANGELOG.md |
0.79.0 と stacked releases を記録 |
Files not reviewed (1)
- skills/web-content-extraction/package-lock.json: Generated file
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+1503
to
+1506
| elif any(($registered + .done)[]; . == $now) then . | ||
| else ([$K[]? | inner[] | select(cmd == $now)] | first) as $kit_hook | ||
| | if $kit_hook == null then . | ||
| else .hooks += [$kit_hook] | .done += [$now] end |
okash1n
force-pushed
the
feat/retire-legacy-hook-path
branch
from
October 6, 2026 23:08
efd5641 to
2b81fd6
Compare
v0.39.0 / v0.41.0 で入れた 2.1.89 未満向けの旧 hook 形状(auto-update は SessionStart のみ + 24h cache、pr-creation-log は if なしでスクリプト側が コマンドを再判定)を、v0.70.0(#120)で宣言した退役条件の成立に合わせて 廃止し、サポート最小 Claude Code を 2.1.89 と宣言する。hook は導入時の CLI バージョンに関係なく常に 1 つの形状で生成し、settings.json の生成時に claude --version を起動しない。旧 CLI 検出時の警告は足していない。 - features/*/hooks.legacy.json(2 本)を削除 - lib/deploy.sh: _version_ge / _claude_cli_semver / _claude_supports_async_hooks / _versioned_hooks_fragment と呼び出しを削除し、 build_settings_file は hooks.json を直接参照する - auto-update.sh: AUTO_UPDATE_LEGACY / LEGACY_CACHE_* と 24h cache を削除 - log-pr.sh: PR_CREATION_LOG_LEGACY 分岐を削除(絞り込みは hook の if のみ) - lib/update.sh: 稼働確認は CLI によらず SessionStart と SessionEnd の両方を 要求する。旧形状のエントリを現行のエントリへ書き換える _migrate_legacy_hook_entries を追加し、_update_phase_settings の retired 掃除と superseded 掃除の間で毎回実行する - MDM: render-expected.py は hooks.json を読み、manifest から async_hooks を 削除。install-mdm.sh は KIT_MDM_ASYNC_HOOKS の注入と async_hooks の検証を 削除。MDM が配備する pr-creation-log は if + async の形になる - README.md / README.en.md / docs/mdm/README.md / CLAUDE.md / CHANGELOG を更新 - .starter-kit-update-cache の掃除(setup.sh / uninstall.sh / lib/dryrun.sh / cleanup_paths)は旧環境の残骸対応として残し、理由をコメントに書いた 移行の理由: 旧形状と現行形状はコマンド文字列が違う(env 接頭辞)ため、 v0.77.0 のコマンド集合による同一性では対にならない。利用者が同じ配列に 自分の hook を足している環境の非対話 3-way merge では旧形状と現行形状が 両方残り、bootstrap merge では旧形状が置き換わらずに残っていた。移行は キットが生成した 2 つのコマンドに完全一致する hook だけを対象にし、同じ 配列に現行コマンドがあれば旧形状を取り除き、なければその場でキット現行の hook に置き換える。ほかの hook・エントリ・並び順は変えず、旧形状がない settings.json は書き換えない。 確認したこと(b4eea52 との比較、全体スイートは未実行): - build_settings_file の出力は、Standard / Full × ja / en で、CLI が 2.1.89 / 2.1.88 / 2.1.291 / 解析不能 / 不在のいずれでも b4eea52 の 2.1.89 向け出力とバイト一致(20 通り)。ビルド中の claude 起動は 16 回から 0 回 - MDM の policy.json は 5 通りの profile / language でバイト一致。期待状態の 差分は settings.json(pr-creation-log)、log-pr.sh、manifest.json のみ - 変更したテストファイルを 1 つずつ修正前のコードに当てると、移行関数の 10 件、設定フェーズの 4 件、退役の不変条件 6 件、シナリオ 2 件が失敗する - tests/unit/test-mdm-expected.sh 単体は 30 件すべて成功 旧形状を前提にしていた単体テスト 7 件とシナリオ 1 件は削除した。 Fixes #136
「the SessionEnd requirement does not depend on the installed CLI」の settings.json 生成で、'%s' と JSON 文字列の間の空白が抜けており、JSON が printf の書式文字列として解釈されていた。現在の fixture では出力は変わらず テストも通っていたが、fixture に % やバックスラッシュが入ると内容が壊れる。 同じファイルの _auh_run と同じく、'%s' の引数として渡す。
- 移行されないケース: 残った pr-creation-log のエントリは if / async を 持たず、log-pr.sh の再判定もなくなったため、Bash 実行のたびに起動し、 出力に PR の URL があれば PR 作成以外でも [Hook] PR created を表示する。 manifest なしの新規インストールで旧形状が残る場合も同じ - 旧形状で導入し、auto-update / pr-creation-log の hook エントリを settings.json から手で削除していた環境では、更新時に現行のエントリとして 再登録される(コマンド文字列が違うため、3-way merge がキットの追加として 扱う)。止める場合は機能を無効にすること、無効な機能は再登録されないこと、 削除し直せば以後の更新で保たれることを書いた コードの変更はない。
「再登録されたエントリを削除し直した場合と、現行形状で導入していた環境での 削除は、以後の更新でも保たれる」は、キットがその hooks 配列を変更しない 更新でしか成り立たない。非対話更新の 3-way merge は、キットが内容を変えた 配列を新しいキットの配列を土台にして組み立て、利用者が削除したキットの エントリを除く規則を持たない。 - 削除が保たれるのは、キットがその配列(SessionStart / SessionEnd / PostToolUse の配列ごと)を変更しない更新に限られると書き直した - 後続のリリースでキットが同じ配列を変更すると、現行形状で導入した環境でも 削除していたエントリが非対話更新で再び登録されること、3-way merge の この挙動は v0.78.2 と同じで今回は変更していないことを書いた - 再登録の理由説明を、旧形状から現行形状への切り替えでキット側の 3 配列が 変わるため、という実際の仕組みに合わせた コードの変更はない。
okash1n
force-pushed
the
feat/retire-legacy-hook-path
branch
from
October 6, 2026 23:59
2b81fd6 to
77f0e43
Compare
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.

概要
Claude Code 2.1.89 未満向けの旧 hook 形状(legacy hook 経路)を退役し、サポート最小 Claude Code を 2.1.89 と宣言します(v0.79.0、minor)。#136 の退役条件「2.1.89 のリリースから 6 か月後(2026-10)以降の最初の minor」が成立したためです。
Fixes #136
Issue 本文に書かれていなかった 2 点を同じ PR に含めています
mdm/render-expected.pyがhooks.legacy.jsonを期待状態として描き、mdm/install-mdm.shがKIT_MDM_ASYNC_HOOKS=falseを固定していた。フラグメント削除だけでは MDM の expected-state 生成が失敗するため、renderer・installer の検証・lib/deploy.shの MDM 分岐・tests/unit/test-mdm-expected.shを現行形状へ切り替えたAUTO_UPDATE_LEGACY=1/PR_CREATION_LOG_LEGACY=1の接頭辞)ため、v0.77.0 の「コマンド集合による同一性」では対にならず、非対話 3-way merge では二重登録、bootstrap merge では旧形状の残留が起きていた。lib/update.shに_migrate_legacy_hook_entriesを追加し、更新時に旧形状のエントリを現行のエントリへ置き換えるユーザーに見える変更
settings.jsonは v0.78.2 と同一(Standard / Full × 日本語 / 英語の 4 通りでバイト一致を確認)。更新で変わるのは hook スクリプト 2 本だけsetup.sh/setup.sh --updateがsettings.json生成時にclaude --versionを起動しなくなったif+asyncの形になる。install-mdm.shとrender-expected.pyの再配布が必要(bundle 側と checkout 側の renderer SHA-256 が一致しないと remediation は失敗する)。policy SHA-256 は不変[0.79.0](Changed / Removed / Fixed)を参照変更内容(26 ファイル)
features/auto-update/hooks.legacy.json、features/pr-creation-log/hooks.legacy.jsonlib/deploy.sh:_claude_cli_semver/_claude_supports_async_hooks/_versioned_hooks_fragment/_version_geを削除lib/update.sh:require_session_end分岐を常に true 化、_migrate_legacy_hook_entriesを追加し_update_phase_settingsから呼ぶfeatures/auto-update/scripts/auto-update.sh:AUTO_UPDATE_LEGACY/ 24h cache を削除。features/pr-creation-log/scripts/log-pr.sh:PR_CREATION_LOG_LEGACY分岐を削除mdm/render-expected.py、mdm/install-mdm.sh: 現行形状へ。manifest.jsonからasync_hooksを削除~/.claude/.starter-kit-update-cacheの掃除コード 4 箇所は残置(理由をコメントと CHANGELOG に記載。1〜2 リリース後に削除)リスク
async/if付きエントリをどう扱うかは未確認$HOMEが変わった環境、manifest を持たない新規インストール経路は対象外(CHANGELOG に対処を記載)install-mdm.shを通しで動かす MDM テスト群(test-mdm-install.shなど)はローカル未実行。CI で確認する実行した検査
build_settings_fileの出力比較: Standard / Full × ja / en × CLI 5 種(2.1.89 / 2.1.88 / 2.1.291 / 解析不能 / 不在)の 20 通りで v0.78.2 の 2.1.89 向け出力とバイト一致。ビルド中のclaude起動は 16 回 → 0 回policy.jsonが 5 通りで変更前後バイト一致。tests/unit/test-mdm-expected.sh単体 PASStests/unit/test-auto-update.sh、test-pr-creation-log.sh、test-runtime-hooks.sh、test-hook-fixtures.sh、test-deploy-refactor.sh、test-retired-hooks.sh、test-update-refactor.shを最小ランナーで実行: 全件 PASSshellcheck -S warning: 全 .sh(CI と同じ)