refactor(deploy): 出力先へのテンプレート配布を廃止 - #5
Conversation
settings.local.json.template はソース側から直接読んで生成するため、 出力先プロジェクトへのコピーは不要。配布物を exe + settings.local.json に整理。 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthrough
Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (3)
scripts/deploy-hooks.js (3)
103-116: 既存設定ファイル解析エラーのログ出力を推奨113行目の catch ブロックでエラー内容を破棄しています。デバッグ時に既存ファイルの何が問題だったか特定しやすくするため、エラーメッセージをログ出力すると有用です。
🔍 デバッグ情報追加案
- } catch { + } catch (e) { fs.writeFileSync(settingsDest, JSON.stringify(newSettings, null, 2) + "\n"); - console.log(" WARN: existing settings.local.json was invalid, regenerated"); + console.log(` WARN: existing settings.local.json was invalid (${e.message}), regenerated`); }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@scripts/deploy-hooks.js` around lines 103 - 116, The catch block that handles JSON.parse failures for settingsDest currently swallows the exception; update the catch to accept the error (e.g., catch (err)) and log the error details (using console.error or processLogger.error) along with context (settingsDest and that regeneration is happening) before calling fs.writeFileSync(newSettings...). Modify the catch around JSON.parse/fs.readFileSync in the block that references settingsDest, parsed, existing, and newSettings so the error message is preserved for debugging.
82-100: テンプレート解析失敗時のエラーハンドリング追加を推奨90行目の
JSON.parse(resolved)でテンプレートが不正な JSON の場合、例外がスローされますが、try-catch で囲まれていません。テンプレートファイルの編集ミス等でデプロイ全体が中断する可能性があります。🛡️ エラーハンドリング追加案
const templateSrc = path.join(CLAUDE_DIR, SETTINGS_TEMPLATE); if (fs.existsSync(templateSrc)) { const template = fs.readFileSync(templateSrc, "utf8"); const resolved = template.replace( /\{\{PROJECT_DIR\}\}/g, targetDir.replace(/\\/g, "\\\\") ); - const newSettings = JSON.parse(resolved); + let newSettings; + try { + newSettings = JSON.parse(resolved); + } catch (e) { + console.log(` WARN: Failed to parse ${SETTINGS_TEMPLATE}: ${e.message}`); + return true; + }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@scripts/deploy-hooks.js` around lines 82 - 100, JSON.parse(resolved) can throw on malformed JSON; wrap the parse (and subsequent validation of newSettings) in a try-catch around where templateSrc/template and resolved are used, catch the error, log a clear message including templateSrc and the parse error, and either throw a new Error with contextual information or gracefully skip updating hooks (depending on desired behavior) so the deploy doesn't crash; ensure you reference the same variables (templateSrc, resolved, newSettings) and preserve the existing validation of newSettings.hooks inside the try block.
7-7: ヘッダーコメントとコードの動作が不一致コメントでは「hooks-config.toml が存在しない場合のみ、テンプレートをコピー」と記載されていますが、実際のコード(71-80行目)ではコピー処理は行われず、メッセージを出力するのみです。PR の趣旨に合わせてコメントを修正することを推奨します。
📝 修正案
* 1. deploy-targets.json からターゲットプロジェクト一覧を読み込み * 2. 各ターゲットの .claude/ ディレクトリに exe をコピー -* 3. hooks-config.toml が存在しない場合のみ、テンプレートをコピー +* 3. settings.local.json.template を解決して settings.local.json を生成 +* 4. hooks-config.toml が存在しない場合は作成を促すメッセージを表示🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@scripts/deploy-hooks.js` at line 7, The header comment claiming "copy template only if hooks-config.toml is missing" is out of sync with the actual behavior (the code currently only logs a message when hooks-config.toml is missing); update the header comment to accurately state that the script only reports the missing file instead of copying, or if the original intent was to perform the copy, implement the copy logic where the script checks for "hooks-config.toml" and uses the fs copy methods to copy the template into place and log success/failure; locate the missing-file handling block (the code that prints the message about hooks-config.toml) and either change the comment above it to reflect the current behavior or add the copy implementation and corresponding logs so the comment remains accurate.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@scripts/deploy-hooks.js`:
- Around line 103-116: The catch block that handles JSON.parse failures for
settingsDest currently swallows the exception; update the catch to accept the
error (e.g., catch (err)) and log the error details (using console.error or
processLogger.error) along with context (settingsDest and that regeneration is
happening) before calling fs.writeFileSync(newSettings...). Modify the catch
around JSON.parse/fs.readFileSync in the block that references settingsDest,
parsed, existing, and newSettings so the error message is preserved for
debugging.
- Around line 82-100: JSON.parse(resolved) can throw on malformed JSON; wrap the
parse (and subsequent validation of newSettings) in a try-catch around where
templateSrc/template and resolved are used, catch the error, log a clear message
including templateSrc and the parse error, and either throw a new Error with
contextual information or gracefully skip updating hooks (depending on desired
behavior) so the deploy doesn't crash; ensure you reference the same variables
(templateSrc, resolved, newSettings) and preserve the existing validation of
newSettings.hooks inside the try block.
- Line 7: The header comment claiming "copy template only if hooks-config.toml
is missing" is out of sync with the actual behavior (the code currently only
logs a message when hooks-config.toml is missing); update the header comment to
accurately state that the script only reports the missing file instead of
copying, or if the original intent was to perform the copy, implement the copy
logic where the script checks for "hooks-config.toml" and uses the fs copy
methods to copy the template into place and log success/failure; locate the
missing-file handling block (the code that prints the message about
hooks-config.toml) and either change the comment above it to reflect the current
behavior or add the copy implementation and corresponding logs so the comment
remains accurate.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: cd18910d-b5c8-4e45-8a6f-aa74a47bc3bf
📒 Files selected for processing (1)
scripts/deploy-hooks.js
- テンプレートのJSONパースエラー時のtry-catchとログ出力を追加 - 既存settings.local.jsonパースエラー時にエラー内容をログに含めるよう修正 - ヘッダーコメントを実際の動作に合わせて修正 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
PreToolUse の jj-push-guard プリセットで直接の push をブロックし、 hooks-push-pipeline (スタンドアロン Rust exe) で push 前パイプラインを 実行する2段構成で、Claude Code hooks に存在しない push hook を補完する。 - PreToolUse: jj-push-guard プリセット追加 - hooks-push-pipeline: command 型/ai 型ステップの順次実行 + 最終 push - hooks-config.toml: [push_pipeline] セクション追加 - ビルド・配布統合: package.json, .gitignore, deploy-hooks.ts 更新 - ADR-008: 設計判断を記録 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> fix: CodeRabbit レビュー指摘4件を修正 - push_cmd/cmd の空文字バリデーション追加 (#1 Major) - jj-push-guard に環境変数プレフィックスバイパス対策 (#3 Nitpick) - ADR-008 コードブロックに言語指定追加 (#4 Nitpick) - hooks-push-pipeline 全関数に docstring 追加 (#5 Pre-merge)
* docs(todo): PR #88 post-merge-feedback の Tier 1/2 finding を採用 PR #88 post-merge-feedback (.claude/feedback-reports/88.md) で生成された 7 件の finding のうち、ユーザー判断により #1-5 を採用、#6-7 を見送り。 採用 finding (5 件): - T1 #1 (順位 5): Stop hook の `pnpm lint:md` 統合 — XS、順位 1 完了済の gap closure - T1 #2 (順位 6): AI 生成一時スクリプト pattern の pre-push 検出 — Small、順位 1 と関連 - T2 #3 (順位 13): `vitest` を devDependencies に固定 — Small - T2 #4 (順位 12): `cli-pr-monitor` ポーリング延長 + 重複起動ロック — Medium、★ rate-limit critical - T2 #5 (順位 14): `pnpm create-pr` 必須引数ヘルプ改善 — Small 見送り finding: - T3 #6: hook 統合時の commit 分割基準 → グローバルルール (~/.claude/) 編集は permission denied、要別経路 - T3 #7: jj rebase conflict 解消手順 → 同上 変更: - docs/todo3.md 新設 (todo2.md が 50KB に到達したため、PR #88 以降の新規エントリは todo3.md へ) - docs/todo.md 推奨実行順序サマリーに 5 件を Tier 別に挿入し、20 → 24 タスクへ全 renumber - 戦略テキストと cross-reference を全面更新 - todo2.md / todo3.md 内の 順位 N 参照を新採番へ追従 - 順位 1 (markdownlint hook 統合) は merged 済として削除参照を merged context に書き換え * fix(review): apply CodeRabbit fixes for #89 Resolved findings: - [Minor] docs/todo.md:49 順位参照の文言が現行テーブルと不整合です - [Major] docs/todo3.md:7 見出しリンクのアンカーが壊れる可能性があります
…必須 follow-up (順位 91 + 92 + 93) (#135) * feat(cli-finding-classifier, cli-push-runner): Bundle i — Phase d 着手前必須 follow-up (順位 91 + 92 + 93) PR #132 (Phase c MVP land) の post-merge-feedback で採用された 3 件を 1 PR にまとめて land。 ## 順位 91 (Tier 2 #4): [lint_screen] config parse test - src/cli-push-runner/src/config.rs に 5 tests を追加 - silent field rename / 追加で None fallback する failure mode を unit test で防止 - full fields / minimal only enabled / absent yields None / numeric defaults / string defaults の 5 軸独立検証 ## 順位 92 (Tier 2 #5): scale-aware eval fixtures (200+ 行) - eval13-large-refactor-real.diff (5 file / 280 行) — context 限界 + JSON 完全性 - eval14-mid-mixed.diff (3 file / 153 行) — mid-scale recall 安定性 - eval15-syntax-stress.diff (1 file / 208 行) — 単 file 長尺の schema 完全性 - lint-screen-evals.json に id 13/14/15 baseline (auto_fix lane × 13 findings 合計) 追加 - count test を rename + 上限緩和 (eval_set_loads_and_has_at_least_phase_b_prime_baseline_count) - Bundle i 実体スモーク test (eval_set_includes_bundle_i_scale_aware_fixtures) 追加 ### dogfood 結果 (mistral:7b / temperature=0) agreement = 11/15 = 73.3% (Phase b' 75% から marginal 劣化 = fixture が設計通り failure mode を再現) eval13 (280 行): JSON parse error 'missing field screen_decision' → fallback path 作動 = PR #132 smoke (868 行 diff) で観測した failure mode を decisive に再現 eval15 (208 行): JSON parse error 'missing field severity at line 38' = nested field omission の別 failure mode を新規捕捉 eval14 (153 行): JSON 完全だが recall 33% (3 baseline 中 1 件のみ TP) aggregate precision=76.2% recall=51.6% latency p50=4591ms p95=8370ms verdict CONDITIONAL-GO agreement < 75% 未達理由は eval13/15 の fallback (= fixture が設計通り作動した結果) で mechanical に説明可能。Phase d 投入前の必須 measurement を取得 (todo6.md L164 「未達理由が 文書化される」branch を満たす)。§8.D v4 prompt 改訂は別 bundle に切り出し。 ## 順位 93 (Tier 3 #8): coding-style.md partial fix anti-pattern codify - ~/.claude/rules/common/coding-style.md § Cross-File Reference Lifecycle に 「変更差分外への partial fix 再発」anti-pattern を追加 - PR #94 / #111 / #132 を inline cite (実証ベース) - family_tag を grep -rn で全 path 検索する対処手順、partial fix の意図的切り出しを明記 ## Phase d 着手の前提条件 update Bundle i land で以下が揃った: - (a) [lint_screen] config silent failure 防止 (順位 91) - (b) scale-aware fixtures による failure mode の reproducible measurement (順位 92) - (c) cross-file partial fix anti-pattern の global rule 化 (順位 93) 次は §8.D v4 prompt 改訂で大規模 diff の JSON 完全性を改善するループ (Phase d 着手前の最終 gate)。 * fix(cli-finding-classifier): CodeRabbit Major #r3213115045 — eval count 下限を Bundle i baseline 15 に固定 >=12 だと既存 fixture 削除を検出できないため >= 15 に変更し regression 防止。 将来の fixture 追加 (>15) は許容。
…nup (#193) * docs(adr-031): § Adoption Criteria threshold 追加 + ADR-039 cross-ref (PR #192 T3-#5) PR #192 post-merge-feedback Tier 3 #5 採用。Phase E land 時 § 採用判定の根拠 は 観測値の記録のみで「閾値」が暗黙だった。5 閾値 (採用率 ≥ 40% / wall-clock ≤ 10 分 / FP ≤ 5% / context 圧迫なし / systemic 検出力) を ADR-031 inline で永続記録、 将来 trial ADR の採用判定で参照可能化。 ADR-039 § 関連 にも back-link を追加し双方向 link 形成、§ Bounded lifetime の 3 値判定 (採用 / 却下 / 継続) の具体化例として参照可能。Tier 3 #6 (ADR-039 audit) の価値も部分吸収。 * docs(todo): Bundle CR-RL stale entry cleanup (順位 167/168/169 — PR #185 で land 済) PR #185 (commit 7f8b613) で Bundle CR-RL の実装 3 件は全て land 済: - 順位 167: RATE_LIMIT_MARKERS multi-variant 配列化 (main.rs:261) - 順位 168: 新 format fixture 3 variant (full / minutes-only / mixed) - 順位 169: ADR-018 lines 185-186 multi-variant 表記 + ADR-034 § 既知 format 一覧 + § 検出 logic 更新手順 todo9.md / todo-summary.md の stale entry を削除して in-progress を反映。 memory feedback_verify_task_not_already_done の本来用途 (= 既 land 済タスクを stale entry 削除に再目的化) を実適用。
…順位 222 採用 (#219) * docs(todo): 順位 222 採用 (PR #218 post-merge-feedback #5) PR #218 (docs PR、ファイルサイズチェックフロー改善計画 + 順位 220/221 採用) の post-merge-feedback で承認された #5 を採用: 順位 222 (💎 Tier 3、Effort XS): `~/.claude/CLAUDE.md` に「複数セッション跨ぎの計画文書作成時は AI が 先走らずユーザー確認後に方針報告し GO/NO-GO を得る」ルール追加 由来: PR #218 session 内で Plan file 作成完了報告後、AI がユーザー承認 なしに PR-W0 着手しようとして `[Request interrupted by user]` で停止 された実観測 (Severity Medium、Frequency Low 初観測、Effort XS、 Adoption Risk None)。memory `feedback_no_unauthorized_reorder` の補強 として「planning doc 作成のような大きな task 完了時は GO/NO-GO 確認待ち」 を明文化、派生プロジェクトへ `~/.claude/CLAUDE.md` 経由で自動波及。 採用しなかった項目: - #1 (weekly audit を feedback entry にも明示): 計画書 PR-W0 で既に管理 - #3 (lib-subprocess stress test): 順位 220 と完全重複 - #4 (Agent template PMF entry): 計画書 Appendix A で既に capture、却下 - #2/#6/#7: 様子見継続 * feat(weekly-review): file_length scan を pre-LLM step として追加 (PR-W0) ADR-031 weekly-review pipeline に deterministic Rust pre-step として 800 行超 file の scan を追加。LLM facet 不要、純機械測定。 順位 147 (file_length lint) は touch-trigger ratchet で「触られた file の 編集時のみ警告」設計のため、未触り state の violation を可視化できない。 本 step は毎週 1 回 master HEAD に対して 800 行超 file を全件列挙し、 aggregate-weekly facet の input に注入して watchlist として report 化する。 PR-3a (PR #217) で 7 件の 800 行超 file が判明した経緯から、Phase 1 (file split work、PR-W1 〜 W4) の進捗 dashboard としても機能する。 全 file ≤ 800 行に到達後も恒久的に監視継続。 由来: docs/file-length-enforcement-plan.md PR-W0 (PR #218 で land)、 severity = warning (block しない、健康診断目的)。
takt fix step が editable な todo14.md の 2 件 (#4 部分 / #5) を自動修正・re-push 済み。 本コミットは fix の権限外 (read-only zone) だった 3 件と #4 の残りを driver として適用する。 1. Major (ADR-069 / review-simplicity.md): diff 外計画文書による宣言の降格を廃止。 「diff の module doc が明示参照する計画文書」も不可に変更 — この PR でレビューされて いない文書は stale や自己都合の事前記述でありえ、未レビューのファイルにレビューを 緩和させる穴になる。宣言は同一 PR で更新される diff 内計画文書のみ有効 2. Minor (ADR-069 試験基準): decision trigger に (d)「宣言の欠落・非具体が blocking の まま」を追加し、fail-closed 3 条件すべてを検証対象に 3. Major (ADR-069 帰結): 「push は ADR-068 backstop と quality gate が守る」の過大記述を 訂正。backstop が守るのは fix の後退のみ、gate が守るのはビルド・テストのみで、 どちらも未消費抽象の設計妥当性は検証しない。降格誤適用の残リスク (blocking レビュー なしの land) と、残る防御が Warnings 監査痕跡だけであることを明記 4. Minor 残り (todo14): テスト項目を変更種別 3 種 (追加/書き換え/削除) に拡張し 完了基準と整合 (takt fix は (a) 追加系 + (b) ALWAYS_ALLOWED false-positive を カバー済みで、書き換え/削除の明示が残っていた) takt fix 分の検証: jj diff で +2/-1 (todo14 のみ) を確認、findings の Location 内で scope guard PASS、ALWAYS_ALLOWED の記述 (post-pr 側定義位置・共有要件・drift 防止) も 正確。auto-push 済みのため本コミットはその上に積む。 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…9) (#349) * chore(takt): simplicity review に PR chain 宣言の降格ルールを追加 (ADR-069) PR size gate (>1500 行で分割強制)・simplicity review の missing-consumer 検査 (dead-on-arrival / premature abstraction)・Multi-PR chaining 規約の 3 つは、内部 レイヤリングを持つ大型機能で同時充足できない — チェーンの先頭 PR は必ず「消費者の いない何か」を導入するため、宣言の仕組みが無い限り先頭 PR が構造的に REJECT される (2026-08-02 の WP-17 PR 2a incident の根本原因の片側)。 追加した降格ルール: - diff 内の計画文書 (または diff の module doc が明示参照する計画文書 — 既存の limited cross-file lookup の範囲) が「後続 PR と抽出↔呼び手のペアリング」を具体名で 宣言している場合、宣言済み項目への missing-consumer findings は non-blocking warning に降格する。Warnings への記録は残す (後続が land しない場合の監査痕跡) - fail-closed 3 条件: 宣言が無い / ペアリングが具体的でない / 宣言の名前が code と 不一致 → 従来どおり blocking。特に「diff 内計画書が code と矛盾する」ケース (incident で実際に起きた形) は矛盾を cite して blocking のまま - 未宣言の投機的抽象への検査は一切緩めない あわせて ADR-068 残課題の fix suggestion 記述規約を追加: 複数 remedy がある finding は 最も破壊的でない処置を先頭に書く (fix step は先頭候補に従う傾向があり、最破壊処置が 先頭だったことが gut-revert incident の一因)。 whole-tree variant (review-simplicity-whole.md) は push を block しないため対象外 (ADR-069 に記録)。 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * docs(adr): ADR-069 (PR chain 宣言規約) を起票 + dev-conventions 追記 3 ゲート (size gate / Multi-PR chaining 規約 / simplicity の missing-consumer 検査) の 合成デッドロックと、その解消規約を永続化する。前コミットの reviewer instruction 変更が 実装で、本 ADR がその決定記録。 記録する決定 4 点: 1. PR chain 宣言規約: チェーンの先頭/中間 PR は diff 内の計画文書で「後続 PR と 抽出↔呼び手のペアリング」を具体名で宣言する 2. chain-aware review 降格: 有効な宣言がある項目に限り missing-consumer findings を non-blocking warning へ降格 (fail-closed 3 条件つき)。whole-tree variant は push を block しないため対象外 3. 切断点ヒューリスティクス: 抽出と最初の呼び手の間で切らない / 良い関節が無ければ PR_SIZE_CHECK_OVERRIDE + 明記が正当 (incident の初回 2 分割はこの判断を誤った実例) 4. fix suggestion 記述規約: 最も破壊的でない処置を先頭に書く (ADR-068 残課題の引き取り) 試験運用判断: 宣言付き chain PR 3-5 本で (a) 有効宣言の先頭 PR が REJECT されない (b) 未宣言の投機的抽象は引き続き REJECT (c) 名前不一致は blocking のまま、を確認。 期限 2026-11-03。直近の検証機会は WP-17 再分割チェーン (2a/2b/2c) 自身。 dev-conventions.md に運用向けの要約 4 点 + 由来を追記し、CLAUDE.md の index 2 行 (ADR 一覧 + conventions 概要) を更新した。 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * docs(todo): 順位 364 (scope guard の pre-push 展開) を登録 (ADR-068 残課題) ADR-068 が「todo 順位 364」として予告した残課題を正式登録する。 エントリの要点: - ADR-068 の後退検知は削除系 (ファイル脱落 / 追加行削減) のみ検知する 80/20 の暫定。 追加系の injection (finding 対象外ファイルへの書き込み・config 書き換え) は検知不能 - PR #348 security review の non-blocking 注記 (fix step が push-runner-config.toml を 書き換えて backstop を自己弱体化できる経路が instruction 頼み) もこれで閉じる - 判定コアは lib-scope-guard (WP-17 再分割 PR で land 予定) を再利用し、post-pr 経路と 判定の同一性を保つ (ADR-054 の drift 防止)。依存欄にその順序を明記 - 完了基準に「ADR-068 の後退検知では通ってしまう追加系 injection ケースのテスト固定」を 含め、暫定と本命の検知範囲の差を機械的に検証する 登録先: todo14.md (詳細) + todo-summary2.md 末尾 (順位行、ADR-033)。 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * fix(review): apply CodeRabbit fixes for #349 Resolved findings: - [Major] docs/adr/adr-069-pr-chain-declaration.md:35 外部計画文書を使った宣言の降格を許可しないでください。 - [Minor] docs/adr/adr-069-pr-chain-declaration.md:65 欠落・非具体宣言の blocking を試験基準に追加してください。 - [Major] docs/adr/adr-069-pr-chain-declaration.md:83 pre-push backstop の保護範囲を正確に記述してください。 - [Minor] docs/todo14.md:816 回帰テスト計画を完了基準の全ケースに合わせてください。 - [Major] docs/todo14.md:816 `ALWAYS_ALLOWED` の中間ファイル例外を完了基準に明記してください。 * fix(review): PR #349 CodeRabbit 指摘の read-only zone 分 3 件 + #4 残り対応 takt fix step が editable な todo14.md の 2 件 (#4 部分 / #5) を自動修正・re-push 済み。 本コミットは fix の権限外 (read-only zone) だった 3 件と #4 の残りを driver として適用する。 1. Major (ADR-069 / review-simplicity.md): diff 外計画文書による宣言の降格を廃止。 「diff の module doc が明示参照する計画文書」も不可に変更 — この PR でレビューされて いない文書は stale や自己都合の事前記述でありえ、未レビューのファイルにレビューを 緩和させる穴になる。宣言は同一 PR で更新される diff 内計画文書のみ有効 2. Minor (ADR-069 試験基準): decision trigger に (d)「宣言の欠落・非具体が blocking の まま」を追加し、fail-closed 3 条件すべてを検証対象に 3. Major (ADR-069 帰結): 「push は ADR-068 backstop と quality gate が守る」の過大記述を 訂正。backstop が守るのは fix の後退のみ、gate が守るのはビルド・テストのみで、 どちらも未消費抽象の設計妥当性は検証しない。降格誤適用の残リスク (blocking レビュー なしの land) と、残る防御が Warnings 監査痕跡だけであることを明記 4. Minor 残り (todo14): テスト項目を変更種別 3 種 (追加/書き換え/削除) に拡張し 完了基準と整合 (takt fix は (a) 追加系 + (b) ALWAYS_ALLOWED false-positive を カバー済みで、書き換え/削除の明示が残っていた) takt fix 分の検証: jj diff で +2/-1 (todo14 のみ) を確認、findings の Location 内で scope guard PASS、ALWAYS_ALLOWED の記述 (post-pr 側定義位置・共有要件・drift 防止) も 正確。auto-push 済みのため本コミットはその上に積む。 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
* docs(todo): WP-18 で検出した問題を 4 エントリへ登録 (順位 374-377) WP-18 (夜間 todo 消化ループ、#361 / #362 / #363) の実装中に pre-push review・ CodeRabbit・ユーザー指摘で検出した問題 9 件のうち、todo 登録が要る 8 件を **実装時の PR 粒度**で 4 エントリへまとめる。切り分けは 2026-08-06 にユーザー確認済み。 ## 評価時の #1 を検証し、todo 登録が不要になった #1 は「Bash prefix 許可の悪用可能性検証と全経路への横展開」として登録予定だった。 ユーザー指示により登録前に検証したところ、**前提が誤りだった**。 #363 の security review は「`Bash(cargo test:*)` は前方一致でシェルを解釈しないため `cargo test` に任意コマンドを連結すると通過する」と主張していた。公式ドキュメントは これを明確に否定している: Claude Code is aware of shell operators, so a rule like `Bash(safe-cmd *)` won't give it permission to run the command `safe-cmd && other-cmd`. The recognized command separators are `&&`, `||`, `;`, `|`, `|&`, `&`, and newlines. A rule must match each subcommand independently. `--allowedTools` も同じルール体系に属する (managed settings の deny を --allowedTools で 上書きできない、と明記されている)。 結果: - `pr-monitor.yml` の Phase A 分析 agent に**当該の穴は無く、対処不要**。production の live な穴という当初の見立ては誤りだった - 残作業は `ADR-072` 決定 5 の根拠記述の訂正のみで、#363 が open のうちに同 PR へ直接 反映する。よって todo エントリを立てない 検証結果と経緯はセクション冒頭の対応表に残した。 ## この一件自体を教訓として取り込んだ 「レビュー指摘への対応時チェックリスト」エントリに 4 項目目を追加した — **指摘が技術的 前提 (ツールの挙動・仕様) に依拠しているなら、対処より先にその前提を検証する**。とくに 設計変更や他経路への横展開を伴う場合。 今回は未検証の前提のまま (a) agent から Bash を落とす設計変更を行い、(b) それを ADR の 決定として記録し、(c) さらに「同じ形が production にもある」と横展開の警告まで出していた。 一次情報に当たれば 1 回の WebFetch で否定できた。 ## 内訳 - 順位 374: WP-18 夜間ループの実走スモーク実施 (Tier 1、評価時の #2/#3) - 順位 375: レビュー指摘への対応時チェックリスト (Tier 2、評価時の #4/#5/#6 + 今回の #1) - 順位 376: push-runner の bookmark 自動前進がスタック境界を壊す (Tier 2、評価時の #7) - 順位 377: 夜間ループの防御を検知から防止へ格上げする判断 (Tier 3、評価時の #8/#9) ## まとめ方の方針 リポジトリの既存バッチ登録 (#350〜#357 の 24 件を 8 エントリへ) と同じく実装時の PR 粒度で まとめた。評価時の番号との対応はセクション冒頭に表で残してある。 順位 374 (スモーク) の観測項目は `ADR-072` の実走スモーク節に表があるため、todo 側は スケジューリングの掛かりだけを持ちチェックリストを複製しない。同じ表を 2 箇所で管理すると 必ず drift する (#362 の post-merge feedback が指摘した single source-of-truth 問題と同型)。 ADR-033 (絶対番号は table のみに保持) に従い、エントリ本文には順位番号を書いていない。 todo20.md は 50KB 閾値内。pnpm lint:docs / markdownlint ともに green。 Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> * docs(todo): #363 post-merge feedback の採用 6 件を登録 (順位 378-383) WP-18 最終 PR (#363、ADR-072) のマージ後 feedback が Tier 1 に 4 件・Tier 2 に 2 件を 採用候補として挙げた。ユーザー承認 (2026-08-07) を得て登録する。 ## 6 件は 1 本の根から出ている 台帳 (docs/claude-code-web-tasks.md) の 内容 / 対象ファイル / 注意 は自由記述のまま 無人 agent のプロンプトへ流入する。agent は $GITHUB_WORKSPACE 全体に書き込め、その 出力は draft PR 本文という公開面に出る。ADR-054 の信頼境界そのもの。 - 378 (XS) 台帳を ADR-035 の docs-only 除外パス表へ追加 — 他 3 件の前提。台帳だけを 変える PR が緩い評価経路に乗ると、対策そのものを迂回する台帳 PR が通りうる - 379 (S) tool scope を work/** へ限定 — ADR-072 決定 7 の改ざん検知が必要になって いる根本原因。実装後も検知層は残す (防御を 1 枚に減らす変更ではない) - 380 (M) 台帳フィールドを untrusted data として明示 framing - 381 (S) 台帳由来 SUMMARY の draft PR 本文出力に screening - 382 (M) injection payload の regression test (380 に依存) - 383 (S) is_separator_row のパイプ検証欠落 ## 期限を「定常運用開始前」に固定する 実効リスクは現時点では低い — 悪意ある台帳行を master へマージするのはユーザー自身で、 単独運用では外部からの注入経路が無い。ただし夜間ループが定常運用に入り draft PR の 流量が増えると前提が変わるため、無期限の Tier 積みにしない。 順位 374 (実走スモーク) は dry_run で PR を作らないため本件の実害が無く、待たせない。 ## 383 は実コードで確認済み is_table_row は行頭 | を要求するが、is_separator_row は split_cells の結果しか見ない。 split_cells("---") は ["---"] を返し全セルが '-' のみなので真になる。markdown の 水平線がセパレータ行として通る (todo ファイル自身が --- を使っている)。 ADR-072 決定 2 の fail-closed 設計の coverage hole。 ## 併せて 順位 374 のスモーク観測項目数を 4 → 8 へ修正した (ADR-072 側の実測と不一致だった)。 Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> * docs(harness-plan): WP-18 を 3 PR マージ済へ更新し残作業 2 系統を明示する #363 のマージ (2026-08-07) で WP-18 の実装 3 本がすべて land した。 ## 「実装完了 = WP 完了」ではないことを表で残す コードは全部 master にあるが、**夜間ループはまだ 1 度も走っていない**。この状態を 「実装済」の一語で片付けると、次のセッションが受け入れ基準を満たしたものと誤読する。 残作業を 2 系統に分けて表にした: 1. 実走スモーク (順位 374) — 受け入れ基準の中核 2. prompt injection 対策 4 件 (順位 378-381) — 定常運用開始前に必須 ## スモークの前提が充足したことを記録 受け入れ基準の表は「(a) workflow が master にある (b) 台帳に無人可マークがある」を 未充足として書いていたが、**両方ともマージで解消した**。残る操作は GitHub UI 側の AUTONOMY_ENABLED 設定のみなので、その 1 点へ書き換えた。 ## 依存関係を明示する 378-381 は 1 本の根 (台帳の自由記述が無検証で agent プロンプトへ流入) から出ている。 一方スモークは dry_run で PR を作らないため本件の実害が無い。したがって **スモークは 378-381 を待たずに着手してよい**と明記した。次セッションが順序で 迷わないようにするため。 ## 未 push の改善 3 点の所在を残す #363 の最終 push が security REJECT で止まったため、改ざん検知の red 化 / 決定 10 の 色分け表 / 決定 6 の列挙基準が master に載っていない。ローカル bookmark wp18/unpushed-improvements (fc22403c) に保持していることを記録した。いずれも 可観測性と文書の改善で、fail-closed 自体は master 版でも成立している。 Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> * docs(todo): 外部設定 (GitHub App / variables / secrets) の実体記録を登録 (順位 384) 新セッションでの指摘 (2026-08-07): workflow は vars.NIGHTLY_APP_ID / secrets.NIGHTLY_APP_PRIVATE_KEY を参照するが、App の作成・インストール・登録を 記録した文書がリポジトリ内に無い。 ## 欠けているのは設計根拠ではなく運用実体 ADR-072 決定 8 は「なぜ App token か」「なぜ PAT ではないか (オーナー PAT は Repository admin として ADR-067 の ruleset backstop を素通りする)」「どの権限を 付けるか (Workflows は付けない)」「なぜ publish 直前に発行するか (token 寿命 1 時間)」を厚く残している。 記録が無いのは以下: - App を実際に作成した事実・日付・名称・インストール範囲 - NIGHTLY_APP_ID = variable / NIGHTLY_APP_PRIVATE_KEY = secret という登録先の別 - 既存の Claude GitHub App との区別 (あちらは Workflows を含む広い権限を持つ別物) - 再構築手順 (鍵ローテーション・派生プロジェクト展開) NIGHTLY_APP の文字列はリポジトリ全体で workflow の 2 行と ADR 残課題の 1 行にしか 現れない。 ## これは ADR-051 違反 ADR-051 (クロスシステム設定 coupling) は内部設定と外部 SaaS 設定が論理結合する場合に (1) 両設定ファイルへの相互参照コメント (2) 期待値の組み合わせ表の ADR 必須記載 (3) 変更は両側を同一 PR、の 3 点を規律として定めている。workflow ↔ GitHub App + repository variables/secrets はこの型で、3 点とも未実施。 前例として ADR-067 段 0 は repository ruleset を ruleset 名つきで「設定済み」と 記録している。ADR-072 は同じ扱いをしていない。同型の欠落が AUTONOMY_ENABLED にも あり (ADR-066 は「Actions variable を使う」とは書くが現状値を記録していない)、 本エントリで一緒に扱う。 ## 順位 374 と同時実施にする理由 スモークでは AUTONOMY_ENABLED の設定と App token の実動確認のため GitHub UI を 触るので、その過程で実値がすべて揃う。先行して記録しようとすると値が確定せず 二度手間になる。 ## 教訓を残す App の作成手順・Expire user authorization tokens の扱い・既存 App との違いは 2026-08-07 のセッションでユーザーへ提示したが、リポジトリへ残さなかった。会話は 次のセッションに残らないが workflow は残る。参照だけが残って由来が消える状態を 作った。順位 375 と同じクラスの失敗としてエントリ本文に記録した。 Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> * fix(review): CodeRabbit Major 4 件を妥当性判定のうえ 3 件へ対応する (#364) 自動 fix 経路 (f698d19) が 1 件 (#4 台帳への非記録ルール追加) を対応済みで、 本コミットはその内容を含んだうえで残りを手で対応した結果である。同一ファイルの 近接行のため path 単位で分離できず 1 コミットに畳み込まれている。 ## 妥当性の判定 severity ラベルではなく、プロジェクトの設計方針に照らして 1 件ずつ判定した。 - #1 adr-072:335 (秘密値を ADR に記録しない) — **妥当**。「実走スモークで実値を 確認し ADR へ追記する」は秘密鍵本文まで書くと読める。ADR-051 が記録を課すのは 結合の存在と期待値の組み合わせであって秘密の実値ではない。設定メタデータに 限定し、鍵本文と token は ADR にも git 履歴にも残さないことを明記した - #2 harness-improvement-plan:223 (受け入れ基準が成功経路だけ) — **妥当**。本 プロジェクトは背圧 12 シナリオ・kill-switch 8 シナリオと停止側を drill で 固めてきたが、夜間ループの停止側は実走未観測。WP-17 の残課題 (明示的 false と config 側 deny が実走未観測) と同じ穴。AUTONOMY_ENABLED の 3 状態を受け入れ 基準へ追加した。指摘本文が名指しした 2 箇所 (計画書 L223 / todo20 L293-304) の 両方に反映している - #3 todo20:480 (prompt injection の回帰 fixture) — **妥当**。順位 382 の payload 例 "; echo PWNED; #" は shell injection であって prompt injection ではない。 台帳テキストが流れ込む先は shell ではなく LLM プロンプトなので、テストが目的と 噛み合っていなかった。自然言語 adversarial payload (本命) と shell/パース形式 payload (堅牢性) の 2 系統へ分離した ## 自動 fix の実測確認 f698d19 は 1 ファイル 2 行追加のみで範囲外の編集ゼロ。内容も妥当だったため そのまま採用した (ADR-068 の後退検知の趣旨に沿って diff を実測で確認済み)。 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Summary
pnpm deploy:hooksで出力先プロジェクトにsettings.local.json.templateをコピーする処理を削除Background
deploy-hooks.jsはソース側のテンプレートを読み込んで{{PROJECT_DIR}}を置換し、settings.local.jsonを直接生成しています。出力先にテンプレートをコピーする処理はこの生成に使われておらず、不要でした。配布物を
exe+settings.local.json+hooks-config.tomlの3種類に整理します。Test plan
pnpm deploy:hooks実行後、出力先にsettings.local.json.templateがコピーされないことsettings.local.jsonが正しく生成されること(hooks パス、permissions 保持)🤖 Generated with Claude Code
Summary by CodeRabbit
リリースノート
注: エンドユーザー向けの直接的な機能変更はありません。