Repository navigation
fix: web-content-extraction の依存 lock 残留時に update が無言で終了コード 75 になる問題を修正(v0.79.1) - #179
Merged
Merged
Conversation
…正(v0.79.1) install.sh / /update-kit / 自動アップデートが呼ぶ setup.sh --update は、 Step 2/5(CLAUDE.md)の後で web-content-extraction の依存 lock (~/.claude/skills/web-content-extraction/logs/.update.lock)を取得する。 依存 updater(update-deps.mjs)が lock を持ったまま強制終了されると lock が 残り、以後の update は何も表示せず終了コード 75 で止まっていた。しかも backup と settings.json / CLAUDE.md の書き換えは lock 取得より前に走るため、 失敗のたびに snapshot / manifest だけが古い中途半端な状態と 1 回分の バックアップが残っていた。dry-run は一時ディレクトリで模擬するため検出 できず、自動アップデートの失敗を利用者に知らせる経路もなかった。 - setup.sh: update ではバックアップの前、fresh では deploy の前に lock を preflight する。実行中の owner は最大 60 秒待ち、止まるときは kit の ファイルを変更しない - lib/update.sh: lock を取得・解放できないときにパス / owner / 作成時刻 / owner PID とその生存状態 / 状態別の復旧手順を表示する。owner が kit の 書く形式で、その PID が存在せず、owner ファイルが 60 分以上前の lock に 限り、reclaim mutex の下で再照合 → rename で隔離 → 再照合 → 削除する 手順で自動回収する(MSYS / MDM では回収しない)。取得側は owner を noclobber で書き、mutex を見つけたら最大 3 秒待って token 照合付きで 取り下げる。解放も同じ mutex で直列化し、lock token の PID は保持 サブシェルの BASHPID を記録する - lib/update.sh: 失敗で中途半端になった環境の回復時、CLAUDE.md の kit セクションが新 kit と同一なら利用者編集扱いにせず snapshot を更新する - update-deps.mjs: 最新版チェックの間は lock を持たず、更新を適用する間 だけ取得して installed version を読み直す。中断マーカーがあれば 24 時間 の throttle を迂回して復旧する。取得後に canonical owner を再照合する - lib/dryrun.sh / setup.sh: dry-run は実 ~/.claude の lock を読み取りだけで 検査し、自動回収されるか止まるかを警告する - i18n: STR_WCE_LOCK_* を en / ja に追加 - 文書: commands/update-kit.md / update-kit-dry-run.md に終了コード 75 / 74 の意味と復旧手順、skill README に lock の設計、CLAUDE.md に preflight と 回収の規約を追記 - テスト: tests/unit/test-wce-update-lock.sh に 44 件、test-update-refactor.sh に 2 件、skill の node テストに 15 件、シナリオ 3 件を追加 v0.73.0 で廃止した「経過時間だけを根拠にした stale lock の自動奪取」は 復活させていない。回収は owner プロセスの不在を確認できる場合に限る。 自動アップデート失敗の SessionStart 通知は含まない。 レビュー 8 ラウンド(正しさ / セキュリティ・競合 / テスト・文書 / Codex) で計 25 件の指摘を修正し、最終ラウンドは指摘なし。
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
Lock-release diagnostics can announce exit 74 while the wrapper returns the callback’s different failure status.
Review effort: Balanced
Findings: 1
Open (2)
What changed in this PR
Fixes silent update failures caused by stale web-content-extraction dependency locks.
Changes:
- Adds preflight lock diagnosis, waiting, and bounded stale-lock recovery.
- Narrows updater locking to mutation phases and improves interrupted-update recovery.
- Adds localization, recovery documentation, snapshot convergence, and regression tests.
| File | Description |
|---|---|
lib/update.sh |
Implements lock recovery, diagnostics, and snapshot convergence. |
setup.sh |
Runs preflight before deployment writes. |
lib/deploy.sh |
Propagates lock-specific exit codes. |
skills/web-content-extraction/scripts/update-deps.mjs |
Narrows lock scope and handles interrupted updates. |
skills/web-content-extraction/test/update-deps-run.test.mjs |
Tests updater execution and lock scope. |
skills/web-content-extraction/test/update-deps-lock.test.mjs |
Tests lock/reclaimer races. |
skills/web-content-extraction/README.md |
Documents lock behavior and recovery. |
tests/unit/test-wce-update-lock.sh |
Adds extensive lock regression coverage. |
tests/unit/test-update-refactor.sh |
Tests CLAUDE.md baseline refresh. |
tests/run-scenarios.sh |
Adds end-to-end lock scenarios. |
i18n/en/strings.sh |
Adds English diagnostics. |
i18n/ja/strings.sh |
Adds Japanese diagnostics. |
commands/update-kit.md |
Documents exit codes and recovery. |
commands/update-kit-dry-run.md |
Documents dry-run lock warnings. |
CLAUDE.md |
Records lock architecture constraints. |
CHANGELOG.md |
Adds the v0.79.1 release notes. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| [[ "$release_rc" -eq 0 ]] || release_rc=74 | ||
| if [[ "$release_rc" -ne 0 ]]; then | ||
| release_rc=74 | ||
| _wce_runtime_update_lock_report "$current_dir" 74 || true |
| # baseline (for example on the dependency lock after Step 2). That is not | ||
| # a user edit. Leave the file as it is and let the caller refresh the | ||
| # snapshot so the next update compares against the right baseline. | ||
| return 3 |
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.


概要
/update-kit(setup.sh --update)が、web-content-extractionskill の依存 lock(~/.claude/skills/web-content-extraction/logs/.update.lock)が残っていると、Step 2/5 の直後に何も表示せず終了コード 75 で止まる問題を修正します(v0.79.1、patch)。発見の経緯
この端末で
/update-kitを実行したところ、Step 2/5(CLAUDE.md)の後に無言で終了しました。原因は 2026-09-06 から残っている lock で、owner のプロセス(依存 updater)は存在せず、以後 1 か月間、kit の更新と依存更新がすべて失敗していました(manifest は v0.77.1 のまま)。原因
update-deps.mjs)は lock を持ったまま同期のnpm viewを実行し、その間はシグナルハンドラが動かない。SessionStart の async hook として起動されるため、セッション終了時の強制終了で lock が残るexit 75し、呼び出し元は errexit 下の単純コマンドなので無言で終了するユーザーに見える変更
~/.claudeの lock を読み取りだけで確認し、自動回収されるか止まるかを表示する(rc は 0 のまま)[0.79.1]を参照変更内容(16 ファイル)
lib/update.shBASHPID。CLAUDE.md の snapshot 収束setup.sh/lib/deploy.sh/lib/dryrun.shskills/web-content-extraction/scripts/update-deps.mjsi18n/en/i18n/jaSTR_WCE_LOCK_*commands/update-kit.md/update-kit-dry-run.md/ skill README /CLAUDE.mdtests/unit/test-wce-update-lock.sh+44、test-update-refactor.sh+2、skill の node テスト +15、シナリオ +3リスク
npm ci(timeout なし)が 60 分を超えて動き続ける場合。どちらも 60 分条件で緩和し、CHANGELOG と skill README に記載.update.lock.reclaim)が残り、以後の自動回収は止まる(診断で mutex の削除手順を表示)/proc分岐、GNUstat/find -mmin、MSYS 判定)は macOS でのみ確認。CI の ubuntu で確認する実行した検査
setup.sh --update --non-interactiveが rc=0 で lock を回収し、snapshot / manifest が更新されることを確認shellcheck -S warning(変更 .sh)、git diff --check、node --checktests/unit/test-wce-update-lock.sh(65 件)、test-update-refactor.sh、skill のnpm test(63 件): 全件 PASS(最終レビュー時点)。積み直し後の再実行は PR 作成と並行して実施中/update-kitで確認する