[lint] テンプレート同期チェックを4ペア対応に拡張(Plan 0021) - #9
Merged
Conversation
同期忘れが3度再発した4つのファイルペアのドリフトを lint-template-sync.py で 機械的に検出する。検出はツール、解釈と修復はエージェントの役割分担。 - ペア1: ProgressTemplate.addf.md ⇔ Progress.md(テキスト包含・ERROR) - ペア2: ProgressTemplate.addf.md ⇔ ProgressTemplate.md(正規化比較・WARNING) - ペア3: CLAUDE.md ⇔ AGENTS.md(ブートシーケンス手順番号・WARNING) - ペア4: CLAUDE.md ⇔ development-process.md(同上・WARNING) WARNING には git log の最終更新日ヒントを併記。ダウンストリームでは ADDF 本体固有ファイルの欠如を SKIP 扱いとし誤 ERROR を防ぐ。 テスト6種16アサーションを run-all.sh に追加。 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
fruitriin
added a commit
that referenced
this pull request
Jun 10, 2026
オーナーのセッション内直接指示(/addf-dev plan21)により解消。 Plan 0021 は PR #9 でマージ済み。 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
fruitriin
added a commit
that referenced
this pull request
Jul 6, 2026
4体並列レビュー(skeptic / attacker / newcomer / 配布安全性)の指摘対応。 Critical: - symlink 越しのリポジトリ外書き込みを遮断(#1): read_text() で os.path.islink() を除外。git は symlink を blob 追跡するため、open() で 辿るとリンク先(リポジトリ外でも)を読み書きしてしまう。check の参照数 集計・rewrite・lint の3走査すべてに適用 - apply 未実施の rewrite を ERROR で拒否(#2): new_root(.claude/addf)不在 なら書き換えを開始しない — 参照だけが実在しないパスへ一括で書き換わる事故を防ぐ - 完了メッセージが新位置のツールパスを案内(#4・コンセンサス昇格): apply で ツール自身が移動するため、旧パスのコピペ実行が No such file で即死していた。 paths.toml の addfTools エントリの new から具体的なコマンドラインを算出して表示 Warning: - backup ref の無条件上書きを拒否(#5): 既存なら ERROR + git update-ref -d の明示削除を要求(「本当の移行前」を静かに失わない) - check/rewrite と lint の走査対象を統一(#6): 拡張子ホワイトリストを廃止し 「全 git 追跡テキストファイル」に統一。バイナリは NUL バイト検査+ UTF-8 デコード失敗で除外(Makefile / Dockerfile / 拡張子なしも対象に入る) - 空ディレクトリ衝突の自己ロック解消(#7): 途中クラッシュで残った空の 移動先は衝突扱いせず rmdir して継続。非空衝突には回復手順を案内 - 実行位置検証(#8): 両スクリプトで git rev-parse --show-toplevel と cwd の 一致を検証し、不一致は ERROR(lint は git リポジトリ外のみ従来どおり SKIP) - lint ERROR に部分適用の可能性の注記を追加(#9) - check にマッチ例(ファイル:行:行内容、旧パスごとに先頭3件)を表示(#10) Suggestion(#11): - paths.toml: [exclusions] → [rewrite_exclusions] にリネーム(コード追従)、 dynamic エントリに optional = true を明記、区分は人間向け分類で移動方式は git 追跡状態による自動判定である旨と逐次置換の不変条件をコメント化、 immovable と移動エントリ old の重複をロード時に機械検査(validate_map) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
概要
同期忘れが3度再発した4つのファイルペアのドリフトを
lint-template-sync.pyで機械的に検出する(Plan 0021)。「検出はツール、解釈と修復はエージェント」の役割分担で、チェック自体をエージェントの注意力に依存させない。変更内容
.claude/addfTools/lint-template-sync.py— 1ペア→4ペア対応に全面拡張.addf.md→.md正規化)git logの最終更新日ヒントを併記(どちらを正として同期すべきかの判断材料).claude/tests/tools/test-template-sync.sh— 新規。6テスト16アサーション。mktemp サンドボックスにドリフト(行削除・番号書き換え・ファイル削除)を注入して検証。run-all.shに自動組み込み.claude/commands/addf-lint.md— セクション6を4ペア表に更新、結果報告を ✓/⚠/✗ の3値化docs/knowhow/ADDF/sync-lint-design.md— 設計知見の記録(既存2記事と双方向リンク)レビュアー向けの補足
.addf.md版・AGENTS.md 等)が存在しないペアは SKIP、ペア1は無印テンプレートへフォールバック。配布先で/addf-lintが誤 ERROR にならないbash .claude/tests/run-all.sh全通過🤖 Generated with Claude Code