Skip to content

fix: markdownlint-cli2 に gitignore: true を導入し lint:md の script-body drift を縮小する - #2781

Merged
squne121 merged 2 commits into
mainfrom
worktree-issue-2777-markdownlint-gitignore
Sep 26, 2026
Merged

squne121 merged 2 commits into
mainfrom
worktree-issue-2777-markdownlint-gitignore

Conversation

@squne121

@squne121 squne121 commented Sep 26, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • .markdownlint-cli2.yaml に gitignore: true を追加し、.gitignore に既に含まれる redundant な ignores エントリ(node_modules/** / dist/** / coverage/** / playwright-report/** / test-results/**)を削減した。.claude/** / docs/** / .github/** の policy-specific ignore は維持する。
  • .agents/skills/** の除外を package.json の CLI negation から .markdownlint-cli2.yaml の ignores(config 側)へ移管した。
  • package.json の scripts["lint:md"] を "markdownlint-cli2"(引数なし)に固定した。
  • .claude/skills/issue-contract-review/scripts/pnpm_gate_registry.py の _SCRIPTS["lint:md"] を新しい package.json script body と byte-for-byte 同期した。

Checks

  • pnpm typecheck
  • pnpm lint
  • pnpm test
  • pnpm build
  • 上記コマンドをすべてローカルで実行し、成功したことを確認してからチェックしています

Schema Change Applicability

  • decision: not_schema_change
  • reason: producer-consumer 境界をまたぐ machine-readable contract の変更ではなく、markdownlint-cli2 の設定ファイルと pnpm script body の同期のみ。

Schema Consumer Inventory

N/A — not_schema_change のため対象外。

Safety Claim Matrix

.claude/skills/issue-contract-review/scripts/pnpm_gate_registry.py を変更対象に含むため本セクションを記載します(実体は権限・サンドボックス・transport・auth 等の安全境界ロジックではなく、package.json script body の文字列レジストリです)。

Claim Implemented? Not controlled Evidence Follow-up
pnpm_gate_registry.py の _SCRIPTS["lint:md"] 文字列変更は、gate 実行ロジック・権限判定・sandbox 境界を一切変更せず、package.json["scripts"]["lint:md"] との byte-for-byte 一致を保つ registry 文字列の同期のみである yes N/A uv run pytest .claude/skills/issue-contract-review/tests/test_pnpm_gate_security_boundary.py -v 17/17 PASS N/A

AC ごとの直接証拠

  • AC1: rg -n "gitignore: true" .markdownlint-cli2.yaml → 9:gitignore: true
  • AC2: .markdownlint-cli2.yaml から node_modules/** / dist/** / coverage/** / playwright-report/** / test-results/** を削除。.claude/** / docs/** / .github/** は維持(rg で個別確認済み、baseline-expect: pass)。.agents/skills/** を新規追加。
  • AC3: rg -n '"lint:md": "markdownlint-cli2"' package.json → 一致。pnpm run lint:md 実行で Linting: 116 file(s) / Summary: 0 error(s)(動作確認済み)
  • AC4: uv run pytest .claude/skills/issue-contract-review/tests/test_pnpm_gate_security_boundary.py -v → 17/17 PASS(_SCRIPTS["lint:md"] と package.json の exact-equality regression test)
  • AC5: git ls-files -z '*.md' | git check-ignore --no-index -v -z --stdin を実行し、.gitignore の artifacts/ パターンに一致する tracked Markdown は以下4件のみであることを確認した(他候補なし。intentional policy delta として本 Issue で明示的に許容):
    • artifacts/claude-code-spawn-observability-research/code-analysis.md
    • artifacts/claude-code-spawn-observability-research/conclusion.md
    • artifacts/claude-code-spawn-observability-research/reproduction-log.md
    • artifacts/claude-code-spawn-observability-research/retry-policy-assessment.md
  • AC6: 一時的に showFound: true を有効化し、baseline(gitignore: true 導入前の config)/ candidate(導入後の config)で found-file set を実測した。
    • baseline found: 392 件
    • candidate found: 116 件
    • comm -13(candidate のみ): 0 件 → candidate ⊆ baseline 成立
    • comm -23(baseline のみ): 276 件 = .agents/skills/ prefix 272 件 + AC5 の4件のみ(他候補なし)
    • 検証後 showFound: true は完全に削除済み(最終 diff・.markdownlint-cli2.yaml には残っていない。grep -n showFound .markdownlint-cli2.yaml は exit 1 で不在確認済み)
  • AC7: candidate found-file set に対し grep -c "^\.agents/skills/" を実行し 0 件を実測確認

Runtime binary version(実行 binary バージョン)

markdownlint-cli2 v0.17.2 (markdownlint v0.37.4) — pnpm exec markdownlint-cli2 --version で確認。package.json の manifest constraint(^0.17.2)・pnpm-lock.yaml の lockfile resolution(0.17.2)と一致(version constraint 自体は変更していない)。

Notes

IMPLEMENTATION_SCOPE_COVERAGE_V1:
  schema_version: "IMPLEMENTATION_SCOPE_COVERAGE_V1"
  issue_number: 2777
  issue_body_sha256: "sha256:37c33b78a60ed992717ccec99c39d52079603608de0dbf3122041dd6e1211e2f"
  normalized_scope_manifest_sha256: "sha256:6c8c44e65b216a070ac5a9eed689000a173f43c2d27e9d29fa16f22d4bae4aa7"
  pr_head_sha: "37f7dcd37a52ed5a0f562e8162de3510bca299f6"
  scope_manifest: {"acceptance_criteria": [".agents/skills/** の除外が package.json の CLI negation から .markdownlint-cli2.yaml の ignores(config側)へ移管されており、candidate の showFound file set に .agents/skills/ prefix のファイルが0件であることを実測で確認している", ".claude/skills/issue-contract-review/scripts/pnpm_gate_registry.py の _SCRIPTS[\"lint:md\"] が新しい package.json[\"scripts\"][\"lint:md\"] と byte-for-byte 一致し、既存の test_pnpm_gate_security_boundary.py の exact-equality regression test が pass する", ".markdownlint-cli2.yaml に gitignore: true が追加されている", ".markdownlint-cli2.yaml の ignores から .gitignore に既に含まれる redundant なエントリ(node_modules/** 等)が削減されている一方、.agents/skills/**(新規に config へ移管)/ .claude/** / docs/** / .github/** は維持されている", "baseline(変更前)と candidate(変更後)の showFound: true による found-file set 差分が candidate ⊆ baseline であり、baseline - candidate が AC5 で許容した intentional_gitignored_delta(既知4件、または同等に明白な generated/research evidence)のみであることを確認している", "package.json の lint:md が \"markdownlint-cli2\"(引数なし)に固定されており、実行して動作することを確認している", "実装前 inventory で、tracked Markdown のうち .gitignore パターンに一致するのは artifacts/claude-code-spawn-observability-research/ 配下の4件のみであることを確認し、これらが gitignore: true 導入後に lint 対象から外れることを intentional policy delta として本文に明示している(fresh inventory で他の tracked Markdown が新たに一致すると判明した場合は、意図的差分として拡張せず semantic finding として扱う)"], "allowed_paths": [".claude/skills/issue-contract-review/scripts/pnpm_gate_registry.py", ".markdownlint-cli2.yaml", "package.json"], "change_kind": "code", "goal_ref": "markdownlint-cli2 の gitignore: true 採用により scratch/generated markdown の false-fail を無くし、lint:md の script-body drift を縮小する", "in_scope": [".claude/skills/issue-contract-review/scripts/pnpm_gate_registry.py: _SCRIPTS[\"lint:md\"] を新しい package.json script body と同期", ".markdownlint-cli2.yaml: gitignore: true 追加、redundant ignores 削減、.agents/skills/** を config へ明示移管、policy-specific ignore(.claude/** / docs/** / .github/**)は維持", "package.json: lint:md を \"markdownlint-cli2\"(引数なし)に固定", "実装前後の一回限りの inventory / file-set diff(tracked Markdown と .gitignore の衝突棚卸し、baseline/candidate の showFound file-set diff、実行 binary version の記録)"], "schema_version": "IMPLEMENTATION_SCOPE_MANIFEST_V1"}

…rift を縮小する (#2777)

`.markdownlint-cli2.yaml` に `gitignore: true` を追加し、`.gitignore` と重複する
redundant な `ignores` エントリ(node_modules/**, dist/**, coverage/**,
playwright-report/**, test-results/** 等)を削減した。`.agents/skills/**` の除外は
`package.json` の CLI negation から `.markdownlint-cli2.yaml` の `ignores`
(config側)へ移管した。

`package.json` の `lint:md` を引数なしの `"markdownlint-cli2"` に固定し、
`.claude/skills/issue-contract-review/scripts/pnpm_gate_registry.py` の
`_SCRIPTS["lint:md"]` を同期させ、exact-equality gate の drift 原因(PR #2729)を
解消した。

実装前 investigation で、tracked Markdown と `.gitignore` の衝突が
`artifacts/claude-code-spawn-observability-research/` 配下の4件のみであること、
baseline/candidate の `showFound` file-set diff が `candidate ⊆ baseline` で
`baseline - candidate` がその4件 + `.agents/skills/**` 配下272件のみであること、
candidate の found-file set に `.agents/skills/` prefix が0件であることを実測で
確認した(markdownlint-cli2 v0.17.2 実行 binary)。

Co-Authored-By: Claude Sonnet 5 <[email protected]>
@github-actions

github-actions Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Preview URL

Preview removed (PR #2781 closed).

@squne121

Copy link
Copy Markdown
Owner Author

PR Review Verdict

Mergeability

  • mergeable=MERGEABLE, merge_state_status=CLEAN(review時点でBLOCKED→python-test-core完了後CLEANへ遷移を確認)

Evidence Check

  • diff は Allowed Paths 内3ファイルのみ(.markdownlint-cli2.yaml / package.json / .claude/skills/issue-contract-review/scripts/pnpm_gate_registry.py)
  • AC1〜AC4, AC7: 直接diff確認済み
  • AC5/AC6: PR本文のinvestigation証跡(tracked Markdown衝突4件、baseline392/candidate116、.agents/skills/0件、runtime version v0.17.2)を具体的記載として妥当と判断
  • Stop Conditions / Out of Scope 抵触なし

Blockers

なし

Non-blockers(warning)

  • PR本文のIMPLEMENTATION_SCOPE_COVERAGE_V1.pr_head_shaが実際のPR head(96d993f...)ではなく親コミット(08b0690...)を指している(advisory、merge-blockingではない)
verdict: APPROVE
reviewed_head_sha: "96d993f0876a03e6626b40e823f3abb13531c5ef"
blockers: []
warnings:
  - "PR本文のIMPLEMENTATION_SCOPE_COVERAGE_V1.pr_head_shaが親コミットを指している(advisory)"

@squne121

Copy link
Copy Markdown
Owner Author

PR #2781 を、関連する #2730 / #2777 / PR #2729 / PR #978、実装差分、CI、[email protected] のソース・テストまで突き合わせました。

結論

実装差分そのものにマージを止める機能的 blocker は見つかりませんでした。 gitignore: true への移行、lint:md の引数削除、registry 同期という3点は整合しており、実 CI でも current head 96d993f... に対して markdownlint-cli2 v0.17.2 が 116 files / 0 errors で動作しています。

ただし、既存レビューが advisory 扱いしている IMPLEMENTATION_SCOPE_COVERAGE_V1.pr_head_sha の不一致は、単なる PR 本文の見栄えの問題ではありません。コード変更とは分離して扱うべきですが、再発性のある control-plane defect が露出しています。

P2 — IMPLEMENTATION_SCOPE_COVERAGE_V1.pr_head_sha が偽の publication snapshot になっている

PR本文には、

pr_head_sha: "08b0690e7b2dd6fac62d82f89b4c541523ada0c3"

とありますが、PR #2781 の実際の head は、

96d993f0876a03e6626b40e823f3abb13531c5ef

です。前者は親コミットです。既存レビューもこの不一致自体は発見しています。[PR #2781](https://github.com/squne121/loop-protocol/pull/2781?utm_source=chatgpt.com)

問題は、その生成・consumer 実装です。open_pr.py は marker を 「immutable publication-time marker」 として生成し、その際 git rev-parse HEAD を pr_head_sha に入れます。一方、入力 body に IMPLEMENTATION_SCOPE_COVERAGE_V1 が既にあれば、現在 HEAD で生成した marker を捨てて 古い marker をそのまま返します。[open_pr.py の該当実装](

def resolve_head_sha() -> str | None:
try:
result = subprocess.run(["git", "rev-parse", "HEAD"], capture_output=True, text=True, check=True, timeout=10)
except subprocess.SubprocessError:
return None
sha = result.stdout.strip()
return sha if re.fullmatch(r"[0-9a-f]{40}", sha, re.IGNORECASE) else None
def append_implementation_scope_coverage(body: str, *, repo: str, linked_issue: int) -> str | None:
"""Embed the immutable publication-time marker before validation/create."""
issue_body = get_linked_issue_body(repo, linked_issue)
head_sha = resolve_head_sha()
module = _load_implementation_scope_evidence_module()
if issue_body is None or head_sha is None or module is None:
return None
try:
marker = module.build_scope_coverage_marker(
issue_number=linked_issue, issue_body=issue_body, pr_head_sha=head_sha
)
block = module.render_scope_coverage_marker(marker)
except (AttributeError, TypeError, ValueError):
return None
# The wrapper is idempotent: a retry must never create two historical
# snapshots for the same publication transaction.
if "IMPLEMENTATION_SCOPE_COVERAGE_V1:" in body:
return body
return body.rstrip() + "\n\n" + block + "\n"
)

さらに consumer の implementation_landed_evidence.py は pr_head_sha について 40桁SHA形式かどうかしか検査せず、実 PR head との一致を検証していません。したがって今回のような意味的に stale な SHA が valid marker として通ります。[implementation_landed_evidence.py の marker parser](

def _parse_marker(pr_body: str, *, issue_number: int) -> tuple[dict[str, Any] | None, list[str]]:
matches: list[Any] = []
for fence in _FENCE_RE.findall(pr_body or ""):
try:
import yaml
parsed = yaml.safe_load(fence)
except Exception:
continue
if isinstance(parsed, Mapping) and COVERAGE_SCHEMA in parsed:
matches.append(parsed[COVERAGE_SCHEMA])
if not matches:
return None, ["scope_coverage_marker_missing"]
if len(matches) != 1 or not isinstance(matches[0], Mapping):
return None, ["scope_coverage_marker_ambiguous_or_invalid"]
marker = dict(matches[0])
errors: list[str] = []
if marker.get("schema_version") != COVERAGE_SCHEMA:
errors.append("scope_coverage_schema_version_invalid")
if marker.get("issue_number") != issue_number:
errors.append("scope_coverage_issue_identity_mismatch")
if not _valid_digest(marker.get("issue_body_sha256")):
errors.append("scope_coverage_issue_body_digest_invalid")
if not _valid_sha(marker.get("pr_head_sha")):
errors.append("scope_coverage_pr_head_invalid")
manifest = marker.get("scope_manifest")
if not isinstance(manifest, Mapping) or _digest(dict(manifest)) != marker.get("normalized_scope_manifest_sha256"):
errors.append("scope_coverage_manifest_digest_mismatch")
return marker if not errors else None, errors
def coverage_from_pr_body(*, pr_body: str, issue_number: int, live_issue_body: str) -> dict[str, Any]:
marker, errors = _parse_marker(pr_body, issue_number=issue_number)
if marker is None:
return {
"status": "missing_marker" if errors == ["scope_coverage_marker_missing"] else "invalid",
"errors": errors,
}
immutable = marker["scope_manifest"]
coverage = normalize_scope_coverage(immutable, live_issue_body)
coverage.update({"marker": marker, "errors": []})
return coverage
)

これは #2781 の markdownlint 実装を壊す欠陥ではないので、この修正のために #2781 のコードスコープを膨らませる必要はありません。ただしマージ前に PR 本文の marker を 96d993f... へ直すのが妥当です。そして再発防止は別 Issue として、

open-pr publication 時、既存 IMPLEMENTATION_SCOPE_COVERAGE_V1 を無条件再利用せず、publication HEAD と marker pr_head_sha の一致を検証する。consumer 側も candidate の live/head SHA と marker SHA の binding を検証する。

程度の狭い修正で十分です。新しい大掛かりな integrity framework は不要です。

gitignore: true の実装評価

ここはかなり堅いです。

markdownlint-cli2 の公式仕様では、config の globs は CLI 引数に追加でき、ignores は file enumeration 前の negated glob として使われます。また gitignore: true はツリー内の .gitignore を利用します。.gitignore という文字列指定なら root の ignore file のみに制限でき、こちらは大規模 tree で高速になり得ます。:chatgpt-content-reference{index="3"}

さらに repo が使っている exact v0.17.2 のソースも確認しました。処理順は、

  1. CLI args を globPatterns 化
  2. config の globs を追加
  3. config の ignores を追加
  4. その後 globPatterns.length === 0 を判定

です。したがって .markdownlint-cli2.yaml に既に **/*.md があるこの repo では、

"lint:md": "markdownlint-cli2"

で問題ありません。v0.17.2 の upstream tests にも args: [] + config globs / globs-and-ignores のケースがあります。v0.17.2 source v0.17.2 tests

これは PR の自己申告だけでもありません。GitHub Actions の lint job で実際に、

$ markdownlint-cli2
markdownlint-cli2 v0.17.2 (markdownlint v0.37.4)
Linting: 116 file(s)
Summary: 0 error(s)

まで成功しています。

なお gitignore 自体は v0.13.0 から存在し、glob 指定対応は v0.14.0 からです。0.17.2 に突然追加された未成熟機能ではありません。:chatgpt-content-reference{index="6"}

gitignore: true による lint 範囲縮小

#2777 の adversarial review で発見された最大の論点だった部分ですが、これは適切に処理されています。

root .gitignore の artifacts/ により、次の tracked Markdown 4件が新たに markdownlint から外れます。

  • artifacts/claude-code-spawn-observability-research/code-analysis.md
  • conclusion.md
  • reproduction-log.md
  • retry-policy-assessment.md

実装時には baseline 392 → candidate 116 を showFound で比較し、減った276件が .agents/skills/** の272件 + この4件だけと確認されています。.agents/skills は .claude/skills の alias なので二重 lint を外すのも既存方針に合っています。#2777 実装証跡

個人開発で workflow availability を優先する今回の前提なら、4件の research/generated evidence を markdownlint 対象外にする選択は合理的です。ここを守るための専用 validator を新設する方が保守コストが高くなります。

ただし意味としては今後、

Markdown lint 対象集合は Git tree ではなく .gitignore policy にも追従する

ことになります。新しい nested .gitignore が追加されれば lint 対象も静かに変わります。globby 自身も gitignore 有効時は適用対象 .gitignore の規則を優先するとしています。:chatgpt-content-reference{index="8"}

これは #2730 で gitignore: ".gitignore" ではなく true を選択した理由まで明記されているため、今回は defect ではなく 意図的な設計 trade-off と判断します。現状 nested .gitignore は tests/.gitignore 等の少数で、tracked Markdown に新たな予期せぬ脱落も確認されていません。

関連履歴との整合

今回の変更は過去の実害をかなり素直に閉じています。

PR #978 では untracked tmp/*.md が pnpm lint:md / lint:docs を false-fail させています。一方 PR #2729 では package.json と pnpm_gate_registry.py に長い lint:md command body を二重保持した結果、.agents/skills/** の追加漏れによる exact-equality drift が実際に発生しました。

#2781 はこの2種類をそれぞれ、

scratch/generated false-fail
→ gitignore: true
package.json ↔ registry の長い exclusion-list drift
→ script body を "markdownlint-cli2" まで縮小

で解消しています。構造的に妥当です。

マージ前にやること

私ならコード差分はそのままにします。追加の security gate、digest、lint-scope validator、恒久的な showFound テストは入れません。

マージ前に直す対象は PR本文の IMPLEMENTATION_SCOPE_COVERAGE_V1.pr_head_sha を実 head 96d993f0876a03e6626b40e823f3abb13531c5ef に合わせることだけです。そのうえで open-pr の「既存 marker を無条件保持する」挙動については別 Issue 化が適切です。

したがって adversarial review の整理は、code findings: blocker 0 / metadata-control-plane finding: P2 1件 / accepted trade-off: gitignore:true による lint-policy coupling です。現行の実装品質と CI 証跡から見て、scope marker を修正した後に markdownlint 側へさらに機構を足す費用対効果は低いです。

@squne121

Copy link
Copy Markdown
Owner Author

確認した限り、今回の impl-review-loop 再実行は コード修正ではなく PR metadata の是正を主目的にするのが適切です。

現状は、PR #2781 が open / draft、current head は 96d993f0876a03e6626b40e823f3abb13531c5ef で、current-head の ci を含む取得できた workflow runs は成功しています。一方、PR 本文の IMPLEMENTATION_SCOPE_COVERAGE_V1.pr_head_sha はまだ親コミット 08b0690... のままです。さらに、前回の impl-review-loop 完了報告より後に対象コメント #issuecomment-5846075094 が追加されているため、以前の draft_pr_ready をそのまま最終状態として扱わず、新しい review feedback を消費して再レビューすべきです。

再発防止については、新規 Issue は起票しません。既に open の [Issue #2766](https://github.com/squne121/loop-protocol/issues/2766)「IMPLEMENTATION_SCOPE_COVERAGE_V1 の pr_head_sha を current-head drift で stale 化させない」が今回の producer/consumer 問題をほぼそのまま対象にしています。PR #2781 は #2764 に続く再現例になるため、新規 Issue を作るより #2766 へ dedupe するのが適切です。

推奨アクションは、既存 PR #2781 を existing_pr_resume として再開し、対象コメントを fresh feedback として取り込み、repo ファイルは原則変更せず、PR body の marker を live head に整合させたうえで fresh pr-reviewer と mergeability/CI 判定を通し、再び draft_pr_ready で停止する、という流れです。

以下をそのまま ClaudeCode に渡してください。

現在 auto mode で起動済みの対話的 Claude Code セッションをそのまま使用してください。

新しい Claude Code セッションを起動し直さず、permission mode も変更しないでください。

対象リポジトリ:

squne121/loop-protocol

対象 PR:

https://github.com/squne121/loop-protocol/pull/2781

今回の fresh review feedback / trusted context anchor:

https://github.com/squne121/loop-protocol/pull/2781#issuecomment-5846075094

linked Issue:

https://github.com/squne121/loop-protocol/issues/2777

使用する skill:

.claude/skills/impl-review-loop/SKILL.md

目的

PR #2781 に対して impl-review-loop を再開し、上記対象コメントで新たに指摘された問題を取り込み、必要な修正、fresh verification、fresh PR review、CI / mergeability の確認までを、人間の逐次承認なしで自律的に実行してください。

最終到達点はマージ直前です。

IMPL_REVIEW_LOOP_RESULT_V1.status: draft_pr_ready

かつ current PR head に対して skill が要求する approved 条件を満たす状態まで進めてください。

PR はマージしないでください。
post-merge-cleanup も実行しないでください。
Issue #2777 もマージ前に手動 close しないでください。

重要: 過去の draft_pr_ready を final authority にしない

PR #2781 では既に以前の impl-review-loop が一度完了し、

https://github.com/squne121/loop-protocol/issues/2777#issuecomment-5846001221

で draft_pr_ready が報告されています。

しかし今回指定した review feedback:

https://github.com/squne121/loop-protocol/pull/2781#issuecomment-5846075094

はその後に追加された新しい入力です。

したがって、過去の draft_pr_ready / APPROVE を理由に early-exit してはいけません。

今回のコメントを fresh review delta として必ず消費し、current state に対して再評価してください。

Fresh state を最初に取得する

開始時に以下を live GitHub / local repository から再取得してください。

以下は 2026-09-26 時点の参考値であり、authority として固定してはいけません。

必ず fresh readback を優先してください。

Existing PR resume

新しい branch / worktree / PR を無条件に作成してはいけません。

pre-Step-1 の Evidence-Based Landing Disposition を fresh に評価してください。

Issue #2777 に対する既存 PR #2781 が現在も有効なら、canonical existing_pr_resume 経路として扱ってください。

duplicate PR を作成しないでください。

今回の actionable finding

対象コメントの主要 finding は以下です。

PR body の:

IMPLEMENTATION_SCOPE_COVERAGE_V1.pr_head_sha

が actual PR publication/current head と一致していません。

確認時点では:

stale marker:

08b0690e7b2dd6fac62d82f89b4c541523ada0c3

live PR head:

96d993f0876a03e6626b40e823f3abb13531c5ef

です。

対象コメントでは、この問題の root cause として以下が指摘されています。

  1. .claude/skills/open-pr/scripts/open_pr.py

    • current HEAD から新 marker を生成する。
    • しかし input body に既存 IMPLEMENTATION_SCOPE_COVERAGE_V1 があると、その新 marker を捨てて既存 block をそのまま返す。
    • そのため publication 時点ですでに stale な marker が保持され得る。
  2. .claude/skills/impl-review-loop/scripts/implementation_landed_evidence.py

    • pr_head_sha が40桁SHAであることは検証する。
    • しかし candidate の live/head SHA と marker pr_head_sha の semantic binding は検証していない。
    • そのため stale SHA が syntactically valid marker として通り得る。

この finding 自体は Issue #2777 の markdownlint 実装コードを壊す blocker ではありません。

したがって、fresh investigation で別の blocker が確認されない限り、Issue #2777 の Allowed Paths を膨らませて producer / consumer 実装をこの PR に追加しないでください。

PR #2781 で行う最小修正

fresh readback 後も marker が stale なら、PR body の IMPLEMENTATION_SCOPE_COVERAGE_V1 を publication/current PR head と整合させてください。

repo file の変更ではなく PR metadata の修正として扱ってください。

現在の Issue #2777 body / scope manifest / hashes が marker 作成時から変化していないことを確認してください。

変化していなければ、最低限 pr_head_sha を live PR head に訂正してください。

Issue body または manifest が変化している場合は、一部フィールドだけを手作業で混在させず、current canonical producer semantics に基づいて coverage block 全体を再計算してください。

PR body のその他の Summary / Checks / evidence / Notes を破壊しないでください。

PR body mutation は repo の body-file guard / docs/dev/github-ops.md に従い、一時ファイルを用いた安全な body update を使用してください。

root/main thread が直接 data-plane mutation を実行する設計になっていない場合は、skill が指定する write-capable SubAgent に委譲してください。

head が変わった場合

原則として今回は repo code を変更する必要はない想定です。

ただし fresh review で本当にコード blocker が確認され、Issue #2777 の live Allowed Paths 内で修正が必要になった場合のみ canonical fix_delta を適用してください。

その結果 commit が増えて PR head が変化した場合は、最終 commit / push 後の live head を取得し、その head に対して coverage marker を最終的に再整合させてください。

古い head を marker に残したまま final review を完了してはいけません。

SubAgent の使用と completion join

SubAgent を積極的に使用してください。

最低でも skill の canonical role separation に従って、必要に応じて以下を委譲してください。

  • repository / PR state investigation
  • implementation / PR metadata mutation
  • verification / test execution
  • independent PR review

特に fresh pr-reviewer を使用してください。

重要:

SubAgent を spawn しただけで完了扱いしてはいけません。

起動した全 SubAgent の完了を必ず待ってください。

各 SubAgent の structured result を回収してから次の routing decision を行ってください。

並列化可能な read-only investigation は並列実行して構いませんが、PR body mutation や同一ファイルへの write は競合させないでください。

SubAgent が human_review_required 等を自己申告しただけで独自に loop を停止せず、現行 impl-review-loop の canonical routing / human-veto policy に従ってください。

Verification

PR body のみの metadata 修正で repo head が変化しない場合、無意味なコード変更やテスト用コミットを追加しないでください。

ただし final verdict 前に必ず current PR head を fresh に再取得し、その head に対して以下を確認してください。

skill が test-runner の実行を要求する場合は従い、完了まで待ってください。

過去 head の PASS を current head の PASS として流用しないでください。

Fresh PR review

修正後は fresh pr-reviewer を起動し、current PR head と current PR body を対象に独立 review を行ってください。

今回の target comment の finding が解消されたことを明示的に確認させてください。

fresh review が blocker を返した場合は、canonical fix_delta として次 iteration に戻してください。

APPROVE 単独で終了せず、impl-review-loop の current canonical routing に従って live mergeability / blockers / required checks を合わせて評価してください。

再発防止 Issue の扱い

今回の stale IMPLEMENTATION_SCOPE_COVERAGE_V1.pr_head_sha 問題について、重複 Issue を新規作成してはいけません。

既に open の Issue #2766:

https://github.com/squne121/loop-protocol/issues/2766

タイトル:

実装: IMPLEMENTATION_SCOPE_COVERAGE_V1 の pr_head_sha を current-head drift で stale 化させない

が存在します。

#2766 は以下を既に対象にしています。

  • static coverage metadata と live-head evidence の責務分離
  • fix iteration 後の stale pr_head_sha 防止
  • current-head claim の authority / lifecycle 明確化
  • regression coverage
  • 手動 PR-body 更新を通常運用から排除
  • 重い provenance subsystem を追加しないこと

今回の PR #2781 は #2764 に続く追加 reproducer とみなしてください。

follow-up materialization では、新規 Issue を作る代わりに #2766 へ dedupe してください。

最終結果に例えば以下と同等の情報を残してください。

FOLLOW_UP_MATERIALIZATION_RESULT_V1:
  status: deduped_existing
  existing_issue: 2766
  reason: "PR #2781 reproduced the same IMPLEMENTATION_SCOPE_COVERAGE_V1.pr_head_sha current-head drift already tracked by #2766"

fresh readback の結果、#2766 が既に close 済み、または今回の producer/consumer defect を実際には包含していないことが判明した場合のみ、通常の dedupe 手順をやり直し、独立した再発性のある gap が残る場合に限って狭い follow-up Issue を起票してください。

大規模な integrity framework、daemon、新しい approval gate、追加の恒久 harness は導入しないでください。

人間承認

通常の:

implementation → verification → review → fix_delta → rereview

の iteration ごとに人間へ承認を求めないでください。

既に Claude Code は auto mode で起動済みです。

permission mode を変更しないでください。

--dangerously-skip-permissions 等を追加しないでください。

loop continuation policy と Claude Code permission mode は別物として扱ってください。

現行 skill が定義する actual Git conflict、明示的な human veto、max_iterations 等の canonical hard stop はそのまま尊重してください。

独自の追加 approval gate を作らないでください。

終了条件

以下を満たした時だけ終了してください。

終了後も PR は merge しないでください。

最終報告

最後に最低限、以下を構造化して報告してください。

散文だけで終了せず、skill が定義する IMPL_REVIEW_LOOP_RESULT_V1 を emit してください。

この形なら、前回の完了状態を誤って再利用せず、#2781 の修正範囲も膨らませずに再レビューまで完走できます。必要なら、これをさらに短い「ClaudeCode貼り付け専用版」に圧縮できます。

@squne121
squne121 marked this pull request as ready for review September 26, 2026 12:30
@squne121
squne121 merged commit b699ee6 into main Sep 26, 2026
70 of 73 checks passed
@squne121
squne121 deleted the worktree-issue-2777-markdownlint-gitignore branch September 26, 2026 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

実装: markdownlint-cli2 に gitignore: true を導入し lint:md の script-body drift を縮小する

1 participant