Skip to content

調査: read-only Issue の Allowed Paths prose が rg VC の broad-path 誤検知を起こす #2779

Closed
1 of 1 issue completed

Description

@squne121

Machine-Readable Contract

contract_schema_version: v1
issue_kind: research
parent_issue: "none"
goal_ref: "## Allowed Paths の grammar を mutation allowlist として明確化し、read-only 慣用句・lexical heuristic に依存しない canonical no-path marker + legacy 後方互換を全 producer/parser/consumer で確定する"
change_kind: research-only

Parent Issue

なし(issue-refinement-loop / issue-contract-review の共有 checker に対する再発防止 Issue)

Source

Background

.claude/skills/issue-contract-review/scripts/baseline_vc_preflight.py::extract_allowed_paths() は ## Allowed Paths セクション内の非空行を無条件に path literal として扱う。このリポジトリの read-only / research issue 向け標準慣用句「- 読み取り専用。リポジトリ変更なし(既定)」はプロースだが path として誤抽出され、_rg_has_broad_search_path() が実際の rg VC を broad-path として誤検知する(Issue #2730 で実証済み)。

この慣用句は単なる repo 内の慣用表現ではなく、.github/ISSUE_TEMPLATE/research.yml(Allowed Paths フィールドの attributes.value default)が生成する 公式 canonical input である。GitHub Issue Forms の仕様上、textarea.attributes.value はフォームの事前入力テキストであり、そのまま submit すれば Issue 本文に反映される(GitHub 公式ドキュメント: https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema の value 属性定義)。したがって producer 側(テンプレート)を含めて対応しない限り、GitHub UI から research Issue を作成するたびに同じ入力が再生産される。

Findings / Design Decision

OWNER 敵対的レビューと、codebase-investigator SubAgent による current-main の網羅的なコード読解、および web-researcher SubAgent による一次資料調査により、以下を設計判断として確定する。

1. Allowed Paths の意味

## Allowed Paths は repository mutation の allowlist と定義する。read-only / research Issue の調査対象ファイルを列挙する欄として兼用しない。調査対象は In Scope / Required Design References / Findings / Verification Commands 等へ記述する。

2. lexical heuristic の棄却

以下のような推測ベースの prose 除外は 採用しない。

  • 日本語の文章だから prose
  • 。 等の句読点があるから prose
  • ASCII portable filename character set 外の文字を含むから prose
  • 空白を含むから prose
  • 読み取り専用 という語を含むから prose

根拠(一次資料で確認済み):

したがって、採るべきは path らしさを推測する heuristic ではなく explicit grammar である。

3. explicit no-path grammar(canonical no-path marker)

canonical no-path marker を明示的な予約 token として定義する。第一候補:

## Allowed Paths

- (none)

(none) は「path に見えないから除外」するのではなく、契約上予約された no-path marker として 0 paths に解釈する。

4. backward compatibility(legacy exact marker)

既存 Issue を一括 rewrite しない。少なくとも legacy exact marker:

読み取り専用。リポジトリ変更なし(既定)

を 0 paths として解釈する後方互換を要求する。基本 semantics:

canonical `(none)`       -> zero paths
legacy exact marker      -> zero paths(exact match のみ、fuzzy/substring matching は導入しない)
ordinary path entries    -> 既存の path semantics を変更しない

現在 OPEN の research Issue には legacy exact marker を使うものが多数(少なくとも24件、うち #2605, #1934, #499, #2778, #1759, #2730 を含む8件以上が Verification Commands に rg を含む)確認されており、既存 Issue の一括書き換えや migration daemon は不要とする。

5. producer inventory

canonical marker 採用時は parser だけでなく producer も同期させる。current main の網羅的な検索(codebase-investigator による調査)により、## Allowed Paths の no-path デフォルト値を生成している producer は以下のみと確認した。

  • .github/ISSUE_TEMPLATE/research.yml(Allowed Paths フィールドの attributes.value。唯一の producer。implementation.yml / parent.yml / bug-report.yml / feature-request.yml には同種の no-path default value は存在しない)

create-issue / edit-issue skill 配下には、Issue 本文の ## Allowed Paths セクション自体を生成する固定テンプレート文字列は存在せず(check_issue_overlap.py 等はあくまで既存 Issue 本文の parse 側であり producer ではない)、producer scope は .github/ISSUE_TEMPLATE/research.yml に限定される。

6. parser/consumer inventory(全体棚卸し)

codebase-investigator による current main の網羅的な調査により、## Allowed Paths セクションを独自に parse している実装は以下の 8 系統であることを確認した(extract_allowed_paths() の直接 consumer に限定しない)。

# ファイル 関数 用途 no-path prose の現在の扱い
1 .claude/skills/issue-contract-review/scripts/baseline_vc_preflight.py extract_allowed_paths() VC の broad-path 判定(_rg_has_broad_search_path()) 誤抽出する(本 Issue の defect)
2 .claude/skills/create-issue/scripts/check_issue_overlap.py extract_allowed_paths() / extract_allowed_path_entries() Issue 間の overlap / duplicate 判定(same_path_set() 等) 誤抽出する(無関係な2つの read-only research Issue が duplicate 候補に入り得る)
3 .claude/skills/create-issue/scripts/path_classification.py extract_allowed_paths() path kind classification(docs_only 等) 誤抽出する
4 .claude/skills/issue-refinement-loop/scripts/check_vc_scope.py _extract_allowed_paths() VC の path scope 検査(独自の _broad_search_check() を含む) 誤抽出する
5 .claude/skills/issue-refinement-loop/scripts/plan_issue_scope_rollup.py _extract_allowed_paths() scope rollup の exact_allowed_paths_equal overlap signal 誤抽出する
6 .claude/skills/issue-refinement-loop/scripts/repair_issue_contract.py _extract_allowed_paths_ric() contract repair 誤抽出する
7 .claude/skills/edit-issue/scripts/issue_contract_hygiene_autofix.py (## Allowed Paths セクション抽出、C9 autofix 判定) hygiene autofix の runtime/non-runtime path 判定 誤抽出する可能性がある
8 scripts/agent-ops/pr_head_replay_publish_exec.py _allowed_paths() PR head replay/publish executor の mutation-path allowlist 判定(変更ファイルが Allowed Paths に含まれるかの検査、PROTECTED_PREFIXES と並ぶ mutation gate) 誤抽出する(baseline_vc_preflight.extract_allowed_paths() への delegation なし。no-path prose 行が非空文字列であれば無条件に path として追加される独自 line-split parser)

一方、以下の3実装は既に baseline_vc_preflight.extract_allowed_paths() を importlib 経由で呼び出す canonical delegation になっており、baseline 側の修正がそのまま反映される(新規修正不要、ただし fix 適用後の regression 確認対象には含める)。

  • scripts/agent-guards/materialize_issue_scope_snapshot.py(_allowed_paths())
  • .claude/skills/impl-review-loop/scripts/ensure_contract_snapshot.py(extract_allowed_paths_from_body())
  • .claude/skills/impl-review-loop/scripts/build_intake_capsule.py(_live_allowed_paths_hash())

設計判断: 新しい heavyweight validator / daemon は追加しない。上記 7 系統それぞれに canonical no-path 判定((none) および legacy exact marker → 0 paths)を適用する最小の共有ヘルパー(例: baseline_vc_preflight.py の既存 _normalize_allowed_path_entry() を拡張した no-path 判定関数、または独立した小さな shared helper 関数)を追加し、7系統の parser がそれぞれこの判定を通す形に統一する。3つの delegation 実装は変更不要。

Outcome

## Allowed Paths の grammar を mutation allowlist として明確化し、canonical no-path marker((none))と legacy exact-marker(読み取り専用。リポジトリ変更なし(既定))の両方を 0 paths と解釈する契約を、producer(.github/ISSUE_TEMPLATE/research.yml)と全 7 parser/consumer 系統に対して確定した。lexical heuristic による prose 除外は棄却した。この設計判断に基づく implementation Issue を起票し、本 Issue がそれを link する。

In Scope

  • ## Allowed Paths = mutation allowlist という意味論の確定(完了、上記 Findings 参照)
  • lexical heuristic(日本語・句読点・文字セット等による prose 判定)の棄却(完了)
  • canonical no-path marker (none) の採用と、legacy exact marker の後方互換 semantics の確定(完了)
  • producer inventory の確定(.github/ISSUE_TEMPLATE/research.yml が唯一の producer であることの確認、完了)
  • parser/consumer inventory の網羅的な棚卸し(7系統の独自 parser + 3系統の canonical delegation、完了)
  • 採用方針に基づく implementation Issue のスコープ・regression 要件の確定

Out of Scope

Acceptance Criteria

  • extract_allowed_paths() の現在の実装がプロース行をパスとして誤抽出することが、再現手順とともに記載されている(Background 参照)
  • lexical heuristic を棄却し、canonical no-path marker (none) + legacy exact-marker 後方互換を採用方針として確定している(Findings 2-4 参照)
  • .github/ISSUE_TEMPLATE/research.yml が producer inventory に含まれ、他に該当 producer が存在しないことを確認している(Findings 5 参照)
  • baseline_vc_preflight.extract_allowed_paths() の直接 consumer に限定せず、## Allowed Paths を独自 parse する全 8 系統の parser/consumer を棚卸ししている(Findings 6 参照。issue-design-reviewer によるセマンティックレビューで欠落が指摘され、scripts/agent-ops/pr_head_replay_publish_exec.py::_allowed_paths() を追加して修正済み)
  • 採用方針に基づく implementation Issue が起票され、本 Issue がそれを link している(実装: Allowed Paths の canonical no-path marker (none) を legacy 慣用句と互換のまま current-main の全 independent parser/consumer へ導入する #2783、GitHub native sub-issue として登録済み)

Verification Commands

  • AC: 現在の extract_allowed_paths() がプロース行を path として誤抽出することの再現手順は Background セクションに記載済み(PYTHONPATH=.claude/skills/issue-contract-review/scripts uv run python3 -c "..." という形式は本 Issue の VC preflight 許可コマンド形(rg/test/grep/uv run pytest 等)に該当しないため、ここでは実行可能コマンドとして提示しない。Background の記述と、本 Issue の research 実施過程で実際に検証済みの結果を証跡とする)。

  • AC: .github/ISSUE_TEMPLATE/research.yml が現在も legacy marker を default value として生成していることを確認する(producer が現在も legacy marker を生成し続けていることの確認であり、baseline で pass することが意図通り)

# baseline-expect: pass
$ grep -n "読み取り専用。リポジトリ変更なし" .github/ISSUE_TEMPLATE/research.yml
  • AC: 採用方針に基づく implementation Issue が起票され、本 Issue がリンクしていることを確認する(起票後、実際の Issue 番号で以下を実行して確認する。番号は起票前は未確定のため、ここでは実行可能コマンドとして提示しない): gh issue view <IMPLEMENTATION_ISSUE_NUMBER> --repo squne121/loop-protocol --json number,title,body

Allowed Paths

  • (none)

Stop Conditions

  • Outcome / Scope / AC が検索可能な形で記載されていない場合は即停止
  • Allowed Paths 外への書き込みを試みた場合は即停止
  • 権限不足(permission denied)により操作が完了できない場合は即停止
  • 成果物の書き込みに失敗した場合(I/O エラー等)は即停止

Handoff Contract

Notes for Reviewer

  • 本 Issue は Issue 調査: markdownlint-cli2 の gitignore option 導入是非を検討する #2730 の issue-refinement-loop 実行中(Step 2 canonical review 時)に実証された、独立した再発可能な checker defect の記録である。
  • 本 Issue自身の ## Allowed Paths は canonical no-path marker (none) を使用する(本 Issue には具体パスを指す rg VC を含めていないため、この Issue 自体は本 defect を踏まない)。
  • 実装スコープは baseline_vc_preflight.py 単体ではなく、Findings 6 に列挙した 8 系統の parser/consumer 全体に及ぶ。実装 Issue の Acceptance Criteria / Verification Commands には、少なくとも以下の regression を含めることを要求する(詳細は実装 Issue 本文で具体化する):
    1. legacy exact marker 読み取り専用。リポジトリ変更なし(既定) → allowed_paths == []
    2. canonical marker (none) → allowed_paths == []
    3. read-only body + rg pattern specific/file.py → broad_search_path_unbounded にならない
    4. rg pattern / rg pattern . → 従来どおり broad と判定される(ripgrep 公式 GUIDE.md: rg foo は rg foo ./ と等価、https://github.com/BurntSushi/ripgrep/blob/master/GUIDE.md)
    5. docs/日本語。md 等の Unicode / punctuation を含む real path → path として保持される
    6. some/path.py(読み取り専用) → 既存の annotation normalization semantics(PR fix(#683): extract_allowed_paths が backtick/注釈付き Allowed Paths を正規化できない問題を修正 #684)を壊さず real path を保持する
    7. #2762 型の mixed prose(read-only 宣言 + 調査対象説明)を mutation allowlist と investigation prose を混同しない仕様として明示し regression 化する
    8. #2730 と同型の contract/body を canonical Step 2 pipeline に通し、本 defect を理由として operator_intervention_required に落ちない integration regression
    9. check_issue_overlap で、無関係な2つの read-only research Issue が no-path marker の一致だけを理由に same_path_set / duplicate evidence を得ない regression

Sub-issues

Sub-issues

1 of 1 Issues completed
Loading 1 sub-issues

Activity

  1. squne121 commented on Sep 26, 2026

    @squne121
    OwnerAuthor

    結論

    Issue #2779 の不具合認識と再現は正しいです。#2730 で起きた broad_search_path_unbounded は、現在の baseline_vc_preflight.py::extract_allowed_paths() の実装から説明できます。

    ただし、現状の contract のまま implementation Issue を materialize するのは勧めません。特に In Scope にある「日本語の文章・句点・既知のパス文字セットなどで prose を判定する」という方向は避けるべきです。

    敵対的に見ると、現在の #2779 は「rg の false positive」を発見できていますが、実際には Allowed Paths の no-path/read-only 表現そのものが machine-readable contract になっていないことが根因です。そのため、局所的に baseline_vc_preflight.py だけ直すと別 consumer に同じ意味論的汚染が残ります。

    P0 — 実際の producer が In Scope から抜けています

    最も大きな欠落です。

    現在の .github/ISSUE_TEMPLATE/research.yml は Allowed Paths の既定値として、まさに

    - 読み取り専用。リポジトリ変更なし(既定)
    

    を生成しています。つまりこれは単なる「repo 内で広く使われる慣用句」ではなく、公式 Research Issue Form が生成している canonical input です。

    GitHub Issue Forms は .github/ISSUE_TEMPLATE/*.yml をフォーム定義として使い、textarea.attributes.value はフォームに事前入力され、その回答が Issue 本文の Markdown に変換されます。:chatgpt-content-reference{index="0"}

    ところが #2779 の代替案では「create-issue / edit-issue skill のテンプレートを寄せる」としか書かれていません。これだけ直しても、GitHub UI から research Issue を作れば旧表現が再生産されます。

    必須修正: In Scope に少なくとも .github/ISSUE_TEMPLATE/research.yml を明記し、

    canonical no-path 表現を採用した場合、GitHub Issue Form を含む全 producer を同期する

    を research outcome に入れるべきです。


    P0 — 「path らしさを推測する」設計は採用しない方がいいです

    #2779 の現在の候補:

    日本語の文章、句点を含む、既知のパス文字セットに一致しない等を除外

    は危険です。

    たとえば以下は十分あり得る repository path です。

    docs/調査結果.md
    docs/仕様。旧版.md
    docs/My Notes/result.md
    

    GNU Coreutils の pathchk -p が ASCII 英数字と ._-/ を「POSIX portable filename character set」として特別に検査しているのも、それが全ての有効なファイル名ではなく、移植可能な部分集合だからです。Python の pathlib の公式例にも非ASCII名が普通に登場します。:chatgpt-content-reference{index="1"}

    しかも current repo には、

    - .claude/.../ensure_contract_snapshot.py(読み取り専用。リポジトリ変更なし)
    

    のような本当に path である entry に read-only 注釈が付いている例もあります。したがって 読み取り専用 という語の存在で落とすのも不正解です。

    採るべきなのは lexical heuristic ではなく explicit grammar です。

    推奨は、

    • canonical no-path marker を明示的に1つ定義
    • legacy の現在の定型句だけを exact match で no-path と解釈
    • それ以外の既存 path grammar は変更しない

    です。

    たとえば canonical marker を (none) にするのは妥当です。重要なのは (none) が「path らしくないから除外」ではなく、契約上予約された no-path token だから除外することです。


    P0 — 問題は baseline_vc_preflight.extract_allowed_paths() の consumer だけではありません

    #2779 の In Scope は、

    _rg_has_broad_search_path() 以外に extract_allowed_paths() を消費する箇所

    を調べる、としています。

    これは不十分です。リポジトリには Allowed Paths を独自に parse している実装が複数あります。

    確認できたものだけでも、

    • issue-contract-review/scripts/baseline_vc_preflight.py
    • create-issue/scripts/path_classification.py
    • create-issue/scripts/check_issue_overlap.py
    • issue-refinement-loop/scripts/check_vc_scope.py
    • issue-refinement-loop/scripts/plan_issue_scope_rollup.py
    • issue-refinement-loop/scripts/repair_issue_contract.py
    • impl-review-loop/scripts/ensure_contract_snapshot.py
    • impl-review-loop/scripts/build_intake_capsule.py

    などがあります。

    特に check_issue_overlap.py は実害候補が大きいです。現在は、

    1. Allowed Paths を抽出
    2. path set の overlap を計算
    3. same_path_set() なら duplicate 候補にする

    という構造です。

    したがって、候補比較まで到達した無関係な2つの research Issue がどちらも

    読み取り専用。リポジトリ変更なし
    

    を「path」として持つと、title/goal が違っても同一 Allowed Paths set として duplicate 判定経路に入れます。

    「全 research Issue が常に duplicate になる」という意味ではありません。candidate discovery の条件があります。しかし、candidate に入った後にこの prose が path-overlap evidence として意味を持つこと自体が欠陥です。

    よって調査対象は、

    extract_allowed_paths() の consumers

    ではなく、

    ## Allowed Paths grammar の全 producer / parser / consumer

    へ拡張すべきです。

    これは新しい heavyweight validator を増やす必要はありません。既存 helper の共通化か、小さな parity regression test で十分です。


    P1 — 既存 Issue の backward compatibility が AC にありません

    現在、canonical phrase

    読み取り専用。リポジトリ変更なし(既定)
    

    を持つ OPEN Issue は24件確認できました。

    そのうち少なくとも 8件が Verification Commands に rg を含んでいます。#2605、#1934、#499、#2778、#1759、#2730 などです。

    全8件がこの不具合だけで必ず terminal になる、という意味ではありません。他の VC defect を持つものもあります。ただし、現在の checker に対して同じ false-positive 条件へ露出しています。

    そのため、

    今後 (none) を使う

    だけでは不十分です。

    既存 Issue を手動 rewrite させない方が、この個人開発リポジトリでは有用性が高いです。実装は、

    canonical new marker → no paths
    legacy exact phrase → no paths
    ordinary entries → 従来通り
    

    という後方互換にするのが適切です。

    既存24 Issueの一括書き換えや migration daemon は不要です。


    P1 — Allowed Paths の意味を先に固定する必要があります

    #2762 にはさらに厄介な実例があります。

    概略、

    - 読み取り専用。リポジトリ変更なし(既定)
    - 調査対象として `.claude/hooks/` および `scripts/...py` を参照可能(変更は行わない)
    

    となっています。

    2行目は「write-allowed path」ではなく、read/investigation target を説明する proseです。現在の parser はこれも path literal として扱い得ます。

    したがって research の結論で、

    Allowed Paths は何を表す欄なのか

    を確定すべきです。

    この repo の現在の用途なら、最も単純なのは、

    Allowed Paths = repository mutation の allowlist。
    research/read-only Issue は (none)。
    調査対象は In Scope / Required Design References / Verification Commands 等に書く。

    です。

    これなら read-only research と implementation authorization が混ざりません。

    また rg の path 無指定は ripgrep 自身が current directory 全体の再帰検索として扱います。公式ガイドでも rg foo は rg foo ./ 相当です。したがって no-path / . を broad としてブロックする現在の checker 方針自体は維持してよいです。:chatgpt-content-reference{index="2"}


    P1 — regression test が helper 単体だけでは不足します

    #683 / PR #684 では backtick・注釈正規化の helper-level regression が入りました。それでも今回の別サブケースが残りました。

    #2779 の implementation follow-up には最低限、次を要求した方がよいです。

    1. legacy の 読み取り専用。リポジトリ変更なし(既定) → allowed_paths == []
    2. canonical new marker (none) → allowed_paths == []
    3. read-only body + rg pattern specific/file.py → broad_search_path_unbounded にならない
    4. rg pattern / rg pattern . → 従来通り broad
    5. docs/日本語。md のような Unicode / punctuation path → path として保持
    6. some/path.py(読み取り専用) → real path を保持
    7. 調査: SubAgent の Bash/Write/Edit tool 経由操作が pre-existing untracked file を意図せず削除・上書きする guard gap を調査する #2762 型の mixed prose をどう扱うかを明示してテスト
    8. 調査: markdownlint-cli2 の gitignore option 導入是非を検討する #2730 と同型の body を canonical Step 2 pipeline に通し、本 defect を理由に operator_intervention_required へ落ちない integration regression
    9. check_issue_overlap で、2つの read-only research Issue が no-path marker だけを理由に same_path_set / duplicate にならない

    特に 8 と 9 が重要です。単に extract_allowed_paths() の戻り値だけ直して終えると、今回と同じ「別 consumer で残る」パターンを繰り返します。


    推奨する研究結論

    #2779 の Open Question はかなり絞れます。

    「prose 除外 heuristic」案は棄却し、「canonical no-path marker + legacy exact-marker compatibility」の組み合わせを採用するのが最も小さく、ワークフロー阻害も少ないです。

    実装方針は次の程度で十分です。

    Allowed Paths は mutation allowlist と定義する。
    
    research/read-only:
      ## Allowed Paths
      - (none)
    
    parser:
      - canonical `(none)` は 0 paths とする
      - legacy exact marker
        `読み取り専用。リポジトリ変更なし(既定)`
        も 0 paths とする
      - それ以外の既存 path parsing semantics は変更しない
    
    producer:
      - .github/ISSUE_TEMPLATE/research.yml
      - create-issue / edit-issue の関連 producer
      を canonical marker へ更新
    
    compatibility:
      - 既存 OPEN Issue の bulk rewrite は要求しない
    
    consumers:
      - baseline parser だけでなく Allowed Paths grammar の全 parser を棚卸し
      - overlap / intake hash / scope snapshot / VC scope で no-path semantics が一致することを確認
    

    新しい schema、常駐 validator、migration daemon、厳格な「prose 禁止 gate」は不要です。今回の目的に対しては過剰です。

    #2779 に対する最終評価

    問題の発見品質は高いですが、現 contract は implementation handoff にはまだ狭すぎます。

    優先して修正するなら、

    1. .github/ISSUE_TEMPLATE/research.yml を producer inventory に追加
    2. path-like heuristic を候補から実質除外
    3. Allowed Paths = mutation allowlist と no-path semantics を固定
    4. baseline extractor の consumers ではなく 全 Allowed Paths parser へ impact scope を拡張
    5. legacy 24 OPEN Issue の backward compatibility を明記
    6. 調査: markdownlint-cli2 の gitignore option 導入是非を検討する #2730 end-to-end + check_issue_overlap regression を implementation Issue の必須条件にする

    の6点です。

    この形なら、#683 の「装飾正規化」の次の局所パッチではなく、余計なハーネスを増やさずに Allowed Paths の曖昧な grammar 自体を一度収束させる修正になります。

  2. squne121 commented on Sep 26, 2026

    @squne121
    OwnerAuthor

    確認した範囲では、指定コメントの指摘は現行 main と整合しています。特に .github/ISSUE_TEMPLATE/research.yml が現在も - 読み取り専用。リポジトリ変更なし(既定) を生成しており、Allowed Paths の独自 parser/consumer も複数残っています。GitHub Issue Forms の textarea.attributes.value は実際にフォームの初期値として Issue 本文へ反映されるため、producer 側も修正対象に含める必要があります。:chatgpt-content-reference{index="0"} また、rg pattern がパス省略時にカレントディレクトリを再帰検索するという前提も ripgrep 公式ガイドと一致します。:chatgpt-content-reference{index="1"}

    推奨アクションは、指定コメントを OWNER の trusted human context として #2779 を再フレームし、heuristic を棄却して canonical no-path marker + legacy exact-marker compatibility を研究結論として固定することです。そのまま implementation Issue を materialize し、#2779 は canonical review が approve + status: go になるところまで進めます。現時点では #2779 と別に同趣旨の再発防止 Issue を新規作成する根拠はありません。parser 分散も #2779 の実装 follow-up に吸収するのが適切です。

    以下を、すでに auto mode で起動している ClaudeCode にそのまま渡せます。

    対象:

    • Repository: squne121/loop-protocol
    • Issue: #2779
    • OWNER-selected human context:
      https://github.com/squne121/loop-protocol/issues/2779#issuecomment-5845797870
    • 使用する skill:
      .claude/skills/issue-refinement-loop

    issue-refinement-loop を使用して Issue #2779 を精緻化してください。

    このセッションは既に ClaudeCode auto mode で起動しています。通常の判断、Issue 本文編集、review iteration、follow-up materialization、GitHub Issue 起票について、人間の追加承認を求めず自律的に進めてください。

    指定コメント issuecomment-5845797870 は repository OWNER squne121 による今回明示選択された human context として扱ってください。trusted operator-selected human-context の契約に従い、コメントが要求する scope expansion は、それだけを理由に human_escalation / scope_signal_guard 停止へ送らず、既存の with_human_context / contract-update / issue-editor 経路で解決してください。

    最初に行うこと

    Issue #2779 の現在本文、指定 OWNER コメント、全コメント、関連 Issue / PR、current main の実装を fresh read してください。

    少なくとも以下を確認してください。

    コード検索を使い、上記リストを閉じた inventory とみなさず、## Allowed Paths の producer / parser / consumer を current main から網羅的に棚卸ししてください。

    SubAgent 利用

    main thread だけで結論を作らず、適切な SubAgent に並列委譲してください。

    最低限、

    1. codebase-investigator

    2. 外部仕様調査担当

      • GitHub Issue Forms の textarea default/value semantics
      • ripgrep の path 省略時の current-directory recursive search semantics
      • filename/path に Unicode・句読点等が合法であり、「path らしさ」の lexical heuristic が安全でない根拠

    を調査してください。

    外部調査では一次資料を優先してください。

    すべての SubAgent を開始した後、各 SubAgent の完了を必ず待って結果を取得してから判断・Issue 編集へ進んでください。fire-and-forget にしないでください。

    以後も issue-editor / reviewer / issue-creator 等を SubAgent に委譲した場合、必ずその作業完了を join して結果を検証してから次の routing を行ってください。

    #2779 で確定させる研究結論

    指定 OWNER コメントを起点として事実確認し、current main と矛盾しなければ、以下を contract の明確な設計判断として確定してください。

    1. Allowed Paths の意味

    ## Allowed Paths は repository mutation の allowlist と定義する。

    read-only / research Issue の調査対象ファイルを列挙する欄として兼用しない。

    調査対象は In Scope / Required Design References / Findings / Verification Commands 等へ記述する。

    2. lexical heuristic を棄却

    以下のような推測ベースの prose 除外は採用しない。

    • 日本語だから prose
    • 。 等の句読点があるから prose
    • ASCII portable filename character set 外だから prose
    • 空白があるから prose
    • 読み取り専用 という文字を含むから prose

    Unicode、句読点、空白等を含む正当な repository path を壊し得るため。

    3. explicit no-path grammar

    canonical no-path marker を明示的な予約 token として定義する。

    第一候補は:

    ## Allowed Paths
    
    - (none)
    

    (none) は「path に見えないから除外」するのではなく、契約上予約された no-path marker として 0 paths に解釈する。

    4. backward compatibility

    既存 Issue を一括 rewrite しない。

    少なくとも legacy exact marker:

    読み取り専用。リポジトリ変更なし(既定)
    

    を 0 paths として解釈する後方互換を要求する。

    基本 semantics:

    canonical `(none)`       -> zero paths
    legacy exact marker      -> zero paths
    ordinary path entries    -> existing path semantics
    

    legacy marker の fuzzy / substring matching は導入しない。

    5. producer inventory

    canonical marker 採用時は parser だけでなく producer も同期させる。

    最低でも current main の:

    .github/ISSUE_TEMPLATE/research.yml
    

    を明示的な対象に含める。

    create-issue / edit-issue その他の producer については current main を検索し、実際に該当 producer が存在するものだけ scope に含めること。

    6. parser/consumer inventory

    調査対象を

    baseline_vc_preflight.extract_allowed_paths() の直接 consumer
    

    だけに限定しない。

    ## Allowed Paths を独自 parse している producer/parser/consumer 全体を対象にし、

    • VC scope
    • overlap / duplicate 判定
    • path classification
    • issue scope rollup
    • contract repair
    • contract snapshot
    • intake capsule / hash
    • scope snapshot
    • その他 current-main consumer

    間で no-path semantics が一致する設計にする。

    新しい heavyweight validator、daemon、常設 migration harness は追加しない。

    既存 canonical helper の再利用、または小さな shared parser/helper と parity regression で解決できるならそちらを優先する。

    implementation follow-up に必須とする regression

    implementation Issue の Acceptance Criteria / Verification Commands は、最低限次を実証できる形にしてください。

    1. legacy exact marker
      読み取り専用。リポジトリ変更なし(既定)
      → zero paths

    2. canonical marker (none)
      → zero paths

    3. read-only body + rg pattern specific/file.py
      → no-path prose の誤解釈だけを理由に broad_search_path_unbounded にならない

    4. rg pattern および rg pattern .
      → 従来どおり broad と判定される

    5. docs/日本語。md 等の Unicode / punctuation を含む real path
      → path として保持される

    6. some/path.py(読み取り専用)
      →既存の annotation normalization semantics を壊さず real path を保持する

    7. 調査: SubAgent の Bash/Write/Edit tool 経由操作が pre-existing untracked file を意図せず削除・上書きする guard gap を調査する #2762 型の mixed prose
      → mutation allowlist と investigation prose を混同しない仕様を明示し regression 化する

    8. 調査: markdownlint-cli2 の gitignore option 導入是非を検討する #2730 と同型の contract/body を canonical Step 2 pipeline に通し、
      この defect を理由として
      operator_intervention_required
      に落ちない integration regression

    9. check_issue_overlap で、無関係な2つの read-only research Issue が
      no-path marker の一致だけを理由に same_path_set / duplicate evidence
      を得ない regression

    helper 単体テストだけで終了しないでください。#683 / PR #684 後にも別 consumer/subcase で今回の defect が残った事実を踏まえ、consumer-level/integration coverage を含めてください。

    #2779 本文の編集

    current body を部分パッチで継ぎ足して矛盾させず、必要であれば issue-editor に full rewrite を委譲してください。

    少なくとも以下を更新してください。

    • Background
    • Findings / Design Decision
    • Outcome
    • In Scope
    • Out of Scope
    • Acceptance Criteria
    • Verification Commands
    • Allowed Paths の意味
    • Handoff Contract
    • Artifact Refs
    • Notes for Reviewer

    OWNER コメント内の :chatgpt-content-reference{...} のような ChatGPT 内部参照文字列は Issue 本文へコピーしないでください。必要な根拠は一次資料 URL または repository asset で置き換えてください。

    #2779 自体は research-only です。production code をこの Issue で変更しないでください。

    また、未修正の current checker 自体が今回の defect を持っている点を考慮してください。research Issue の Verification Commands を増やすことで自分自身を broad_search_path_unbounded に陥らせるような contract を作らないでください。詳細な executable regression は implementation follow-up 側へ置き、#2779 では研究判断・implementation contract の検証可能性を優先してください。

    implementation Issue の materialization

    研究結論が確定したら、#2779 の AC に従って implementation Issue を実際に起票してください。

    起票前に既存 OPEN Issue を semantic scope と dedupe key で検索し、既存の同一 implementation Issue があれば再利用してください。

    title similarity だけで duplicate と判断しないでください。

    implementation Issue は:

    を満たしてください。

    起票後、#2779 本文または canonical な link field / Source / Handoff Contract に implementation Issue をリンクし、AC を満たしてください。

    この invocation では implementation Issue の実装を開始しないでください。
    impl-review-loop、implementation worker、worktree 作成、production code 編集、commit、push、PR 作成へ進まないでください。

    review loop

    Issue 編集後は issue-refinement-loop の canonical 手順を最後まで実行してください。

    特に canonical Step 2 は skill の現行契約どおり、

    • background launch
    • mandatory completion join
    • 完了 JSON の取得
    • canonical_step2_route を唯一の routing authority として使用

    を守ってください。

    reviewer が修正を要求した場合は、人間承認を求めず issue-editor に戻し、bounded loop 内で自律的に修正してください。

    approve だけで完了扱いにせず、fresh な canonical contract review の:

    CONTRACT_REVIEW_RESULT_V1.status == go
    

    まで確認してください。

    stale snapshot は使用しないでください。

    再発防止 follow-up

    今回の調査・review 中に、#2779 の implementation follow-up へ自然に吸収できない別個の再発性 defect を発見した場合:

    1. current main で再現可能か確認
    2. 既存 OPEN Issue を検索
    3. 重複がなければ GitHub Issue を起票
    4. 元 evidence / reproduction / impact / recommended prevention / dedupe key を記載
    5. 調査: read-only Issue の Allowed Paths prose が rg VC の broad-path 誤検知を起こす #2779 の本来スコープへ無理に混ぜない
    6. 起票完了を待って URL / issue number を取得
    7. termination summary に materialization 結果を記載

    してください。

    単なる改善アイデアや hypothetical risk は起票しないでください。

    現在確認されている「Allowed Paths parser が複数存在する」という問題は #2779 の中心的 impact scope なので、それだけを理由に別 Issue を増やさず、まず #2779 の implementation follow-up に統合してください。

    自動実行方針

    以下について追加の人間承認を求めないでください。

    単に「人間判断が望ましい」という理由で停止しないでください。current repository policy、OWNER-selected comment、一次資料、current-main evidence から deterministic に決められるものは決めて進めてください。

    ただし次の場合は無理に突破しないでください。

    • destructive operation が必要
    • secret / credential の取得・露出が必要
    • GitHub 権限が実際に不足して mutation が不可能
    • canonical skill contract 上、自動解決不能な矛盾した trusted authority がある
    • current main と OWNER directive の間に、事実確認で解消不能な重大矛盾がある

    この場合も、追加承認要求だけを書いて終了するのではなく、実施済み作業、正確な blocker、再開可能な next action を残してください。

    完了条件

    以下をすべて満たすまで終了しないでください。

    最後に、変更した Issue、作成・再利用した implementation/follow-up Issue、最終 review status、canonical contract review status、残 blocker の有無を簡潔に報告してください。

    補足すると、pathchk -p の portable filename character set は「有効な全ファイル名」ではなく可搬性を検査する部分集合なので、文字種を使った path/prose 判別へ流用する設計は避けるのが妥当です。:chatgpt-content-reference{index="2"}

  3. squne121 commented on Sep 26, 2026

    @squne121
    OwnerAuthor

    issue-refinement-loop 終了レポート

    human-context comment: https://github.com/squne121/loop-protocol/issues/2779#issuecomment-5845797870(OWNER による trusted human context、with_human_context lane で処理)

    処理経緯

    1. Fresh read: Issue 調査: read-only Issue の Allowed Paths prose が rg VC の broad-path 誤検知を起こす #2779 本文・両 OWNER コメント(issuecomment-5845797870 / issuecomment-5845852140)・Issue 調査: markdownlint-cli2 の gitignore option 導入是非を検討する #2730・Issue 実装: fix(#648): broad-path 検査が backtick/注釈付き Allowed Paths を正規化できず正当な rg VC を誤検知する #683・PR fix(#683): extract_allowed_paths が backtick/注釈付き Allowed Paths を正規化できない問題を修正 #684・.github/ISSUE_TEMPLATE/research.yml を取得。
    2. codebase-investigator SubAgent と web-researcher SubAgent を並列起動し、両方の完了を join。
      • codebase-investigator: current main の ## Allowed Paths producer/parser/consumer inventory(当初7系統 + 3 delegation系統)
      • web-researcher: GitHub Issue Forms の textarea.attributes.value 事前入力仕様、ripgrep no-path recursive search 仕様、POSIX/pathchk/pathlib による path 合法性の一次資料確認
    3. contract_update.run.with_human_context → STATUS: blocked / NEXT_ACTION: human_judgment_required(BLOCKERS: PLANNER_FAIL_CLOSED)。scope_signal_delta.classify_scope_delta_authority() を直接実行し根本原因を特定: directive の directive.confidence は "explicit" だが detect_boundary_flags() が expands_allowed_paths: true を検出し route.action: human_escalation になっていた(## Allowed Paths という語 + 複数の repository path literal の列挙が false positive trigger)。investigation_derived_path_literals による 実装: operator-selected human context の scope reframe を自動継続し scope expansion stop を撤去する #2086 AC3 の救済経路も試したが、contract_patch_plan.operations が非空化し decide_human_review_directive_editor_route()(実装: trusted human contract feedback を controlled editor handoff に接続する #2620)の operations_empty eligibility を満たせないことを確認した。この独立した control-plane defect は再発防止 Issue 調査: trusted human-context directive の Allowed Paths boundary/operation が section-local source binding を失う #2785 として記録した(下記参照)。
    4. OWNER の第2コメント(issuecomment-5845852140)が本状況でも issue-editor 経由の自律解決を明示的に許可していたため、contract_update を no-progress retry せず(write は 0 のまま)、issue-editor SubAgent による controlled full-rewrite(reviewer_feedback_url に anchor comment URL を使用)で Issue 本文を全面改稿した。
    5. Fresh preflight.run.with_human_context → STATUS: pass / NEXT_ACTION: proceed。
    6. Fresh canonical Step 2 review(run_root_review_pipeline.py produce、background 起動・完了 join)→ 当初 canonical_step2_route: step_5_operator_intervention_required(VC preflight allowlist 外のコマンド形 + 本 Issue 自身の Allowed Paths (none) に対する broad-path 誤検知 + 未確定 issue 番号 placeholder の分類不能、計3件の blocking issue)。issue-editor による2回の部分パッチ(Verification Commands の command-form修正、baseline-expect注釈追加)で解消し、canonical_step2_route: step_2_5 / verdict: approve に到達。
    7. Step 2.5(semantic design review、issue-design-reviewer SubAgent、3サイクル、都度 pin-bundle → 起動・completion join → record-result → join_review_results):
      • 1回目: high severity finding(Findings 6 の parser/consumer 棚卸しが scripts/agent-ops/pr_head_replay_publish_exec.py::_allowed_paths() という8番目の独立 parser を欠落)。独立検証の上で issue-editor へ転送し、Findings 6 の表を7系統→8系統へ修正。
      • 2回目: medium severity finding 2件(issue_contract_hygiene_autofix.py の defect confidence の hedge表現、per-system regression coverage の一部欠落)。finding_policy: route_high_open_to_rewrite により non-blocking(effective_verdict: approve)。
      • 3回目: low severity finding 1件(本文内の孤立した「7系統」表記)。non-blocking(effective_verdict: approve)。
    8. Step 4.5(follow-up materialization): 既存 OPEN Issue の dedupe 検索で重複なしを確認し、implementation Issue 実装: Allowed Paths の canonical no-path marker (none) を legacy 慣用句と互換のまま current-main の全 independent parser/consumer へ導入する #2783 を起票(GitHub native sub-issue として 調査: read-only Issue の Allowed Paths prose が rg VC の broad-path 誤検知を起こす #2779 に登録、parent_verified: true)。調査: read-only Issue の Allowed Paths prose が rg VC の broad-path 誤検知を起こす #2779 本文の AC / Handoff Contract を更新し link を反映。
    9. 再発防止 follow-up: 上記3で発見した control-plane defect(expands_allowed_paths boundary flag の false positive + investigation_derived_path_literals 適用時の operations 非空化)について dedupe検索(既存 OPEN Issue に重複なし)の上、research Issue 調査: trusted human-context directive の Allowed Paths boundary/operation が section-local source binding を失う #2785 を起票。
    10. 最終 fresh preflight → STATUS: pass / NEXT_ACTION: proceed。最終 fresh canonical Step 2 review → canonical_step2_route: step_2_5 / verdict: approve / blocking_issues: []。.claude/skills/issue-contract-review/scripts/run_contract_review_once.py(CONTRACT_REVIEW_RESULT_V1 相当、CONTRACT_REVIEW_ONCE_RESULT_V1)を 調査: read-only Issue の Allowed Paths prose が rg VC の broad-path 誤検知を起こす #2779 に対して実行し status: go を確認(VC preflight も pass)。

    Contract に反映した主要 delta

    • ## Allowed Paths = repository mutation の allowlist と定義し、read-only Issue の調査対象列挙欄との兼用を廃止
    • lexical heuristic(日本語・句読点・文字セット等による prose 判定)を棄却
    • canonical no-path marker (none) + legacy exact marker 読み取り専用。リポジトリ変更なし(既定) の後方互換 semantics を確定(exact match のみ、fuzzy/substring matching は不採用)
    • producer inventory: .github/ISSUE_TEMPLATE/research.yml のみが該当(GitHub Issue Forms の textarea.attributes.value 事前入力仕様を一次資料で確認)
    • parser/consumer inventory: 独自 parser 8系統(baseline_vc_preflight.py / check_issue_overlap.py / path_classification.py / check_vc_scope.py / plan_issue_scope_rollup.py / repair_issue_contract.py / issue_contract_hygiene_autofix.py / pr_head_replay_publish_exec.py)+ canonical delegation 3系統を確定
    • implementation follow-up の regression 要件(legacy/canonical marker → zero paths、broad-path 回帰防止、Unicode/句読点 path 保持、annotation 正規化保持、mixed prose 明示化、#2730型 integration regression、check_issue_overlap duplicate 回避、8系統個別 regression)を確定

    主要 evidence

    • codebase-investigator: current main の producer/parser/consumer inventory(当初7系統検出、semantic design review で8系統目を追加確認)
    • web-researcher: GitHub 公式ドキュメント(Issue Forms syntax)、ripgrep 公式 GUIDE.md、POSIX.1-2017、GNU Coreutils pathchk マニュアル、Python pathlib 公式ドキュメントによる一次資料確認
    • scope_signal_delta.classify_scope_delta_authority() の直接実行による PLANNER_FAIL_CLOSED 根本原因診断
    • scripts/agent-ops/pr_head_replay_publish_exec.py::_allowed_paths()(L74-100)の直接読解による8番目 parser の独立確認

    Follow-up Issue

    Terminal Verdict

    canonical_step2_disposition: route: step_2_5 → semantic design review 3サイクル完了 → effective_verdict: approve
    CONTRACT_REVIEW_ONCE_RESULT_V1.status: go(.claude/skills/issue-contract-review の readiness checker、VC preflight pass)

    実装作業(impl-review-loop、implementation worker、worktree 作成、production code 編集、commit、push、PR 作成)はこの invocation では一切開始していない。

    起動した全 SubAgent(codebase-investigator ×1、web-researcher ×1、issue-editor ×5、issue-design-reviewer ×3、issue-creator ×2)はすべて完了を join済み。

  4. squne121 commented on Sep 27, 2026

    @squne121
    OwnerAuthor

    全 child issue(#2783)がマージ済み PR #2791 の完了をもってクローズされたため、本 research issue をクローズします。post-merge-cleanup(PR #2791 完了後)による自動判定。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions