Repository navigation
Description
Machine-Readable Contract
contract_schema_version: v1
issue_kind: research
parent_issue: none
goal_ref: ".gitattributes 追加後に既存 CRLF ファイルを安全に LF 正規化するための適用範囲・実施タイミング・手順を確定し、実装 Issue を起票可能にする"
change_kind: research-onlyParent Issue
なし(単独改善。ただし Issue #97 の follow-up として起票)
Outcome
git add --renormalize を安全に実施するための適用範囲・タイミング・手順が docs/ 配下に文書化され、実装 Issue が起票された状態になる
Background
Issue #97 で .gitattributes を追加することで 将来の CRLF 混入を防ぐことができる。しかし、既に working tree / index に残っている CRLF ファイルを正規化するには git add --renormalize . が必要になる。
Issue #97 は Out of Scope として git add --renormalize を除外しており(Allowed Paths が .gitattributes のみ)、別 Issue として対応することが明示されている。
git add --renormalize は全 tracked ファイルに影響するため、慎重な実施計画が必要である。Git 公式および GitHub Docs が推奨する正規化手順として確認済み(anchor comment: https://github.com/squne121/loop-protocol/issues/97#issuecomment-4514751223)。
anchor comment の内容:
このIssueでやるべきことは「.gitattributes を追加して将来の CRLF 混入を構造的に抑える」までです。既存 working tree の復旧、git add --renormalize、実行 bit 監査、CI guard は別Issueに分けるべきです。
推奨する追加 follow-up は次の2つです。
2. 運用: line-ending 正規化後の git add --renormalize 適用範囲を設計する
In Scope
git add --renormalizeを実施した場合の差分範囲の事前調査(git ls-files --eol等で CRLF 混入ファイル数を把握)- 既存 CI / lint / build への影響有無の評価
- 実施タイミングの設計(Issue 実装: .gitattributes を追加し .claude/skills 配下スクリプトの CRLF 破損を防ぐ #97 マージ直後 vs 別 PR vs 全スクリプト復旧後)
- 実施手順を記載した実装 Issue の起票
Out of Scope
git add --renormalizeの実際の実行(本 Issue は調査のみ).gitattributesの変更(Issue 実装: .gitattributes を追加し .claude/skills 配下スクリプトの CRLF 破損を防ぐ #97 の対象)- executable bit 管理(別 follow-up Issue の対象)
Acceptance Criteria
- AC1:
git ls-files --eolの出力で CRLF 混入ファイルの件数・パスが本 Issue 本文またはコメントに記録されている - AC2:
git add --renormalize .実施時の差分範囲(対象ファイル数・パス一覧)が dry-run または調査コマンド出力として記録されている - AC3: 既存 CI / lint / build への影響有無が評価結果として記録されている
- AC4: 実施タイミング(Issue 実装: .gitattributes を追加し .claude/skills 配下スクリプトの CRLF 破損を防ぐ #97 マージ直後 / 別 PR / 全スクリプト復旧後)の採用方針が決定されている
- AC5: 調査結果をもとに
git add --renormalize実施手順を記載した実装 Issue が起票されており、本 Issue からリンクされている - AC6: 本 Issue が close 可能、または追加調査要件が明示されている
Verification Commands
# AC1: CRLF 混入ファイル調査コマンド(調査時に実行し結果を記録する)
git ls-files --eol | grep -E "^i/crlf|^w/crlf|^i/mixed"
# AC2: renormalize 影響範囲の事前確認(dry-run)
git add --renormalize --dry-run . 2>/dev/null | head -50
# AC5: 実装 Issue が起票されているか確認
gh issue list --repo squne121/loop-protocol --search "renormalize is:open" --json number,title,urlAllowed Paths
docs/配下(調査結果の文書化先)- 読み取り専用コマンド(
git ls-files --eol、git add --renormalize --dry-run .等)
Stop Conditions
- Outcome / Scope / AC が検索可能な形で記載されていない場合は即停止
- Allowed Paths 外への書き込みを試みた場合は即停止
- 権限不足(permission denied)により操作が完了できない場合は即停止
- 成果物の書き込みに失敗した場合(I/O エラー等)は即停止
Handoff Contract
Current Objective:git add --renormalize適用範囲・タイミング・手順の確定Bounded Current Context: Issue 実装: .gitattributes を追加し .claude/skills 配下スクリプトの CRLF 破損を防ぐ #97 (.gitattributes 追加) の follow-up。実行ではなく調査・設計のみOpen Questions: 実施タイミング(実装: .gitattributes を追加し .claude/skills 配下スクリプトの CRLF 破損を防ぐ #97 マージ直後 vs 別 PR)の採用方針Next Action: 調査結果をもとにgit add --renormalize実施手順を記載した実装 Issue を起票するArtifact Refs: anchor comment 実装: .gitattributes を追加し .claude/skills 配下スクリプトの CRLF 破損を防ぐ #97 (comment)
Runtime Verification Applicability
decision: not_applicable
reason: "調査・文書化のみ。リポジトリへの実装変更なし(`git add --renormalize` の実行は Out of Scope)"Source
dedupe_key: "git-add-renormalize-design-post-gitattributes"
source_issue: "#97"
anchor_comment: "https://github.com/squne121/loop-protocol/issues/97#issuecomment-4514751223"
Activity