Skip to content

実装: 再発防止: issue-contract-review の Verification Commands section 抽出を GFM-aware canonical parser に統一する #2782

Closed

Description

@squne121

Parent Issue

なし(単独改善)

Machine-Readable Contract

contract_schema_version: v1
issue_kind: implementation
parent_issue: "none"
goal_ref: "VC section 抽出の authority を prose_boundary_policy.py の新設 level-2 canonical section extraction helper に一本化し、baseline_vc_preflight.py / contract_readiness_check.py の両方をそこへ委譲させることで section boundary algorithm の複製・循環依存を防ぎ、あわせて extract_verification_commands_section() の return contract(None/空文字/非空文字の区別)を明文化して presence 判定 consumer を is not None ベースに揃える"
change_kind: fix

Parent Goal Ref

なし(単独 follow-up Issue)

Current Validated Scope

  • .claude/skills/create-issue/scripts/prose_boundary_policy.py に、既存 primitive(parse_atx_heading_line() / lookup_heading_policy())を再利用した新規 level-2 canonical section extraction helper を追加する
  • .claude/skills/issue-contract-review/scripts/baseline_vc_preflight.py::extract_verification_commands_section() を、正規表現ベースの抽出からこの新設 shared helper への委譲に置き換える(section boundary algorithm 自体を baseline_vc_preflight.py 内にコピーしない)
  • .claude/skills/issue-contract-review/scripts/contract_readiness_check.py::_extract_section_by_canonical_name() も同じ shared helper に委譲させ、section boundary の重複実装を残さない
  • extract_verification_commands_section(body) -> Optional[str] の return contract を明文化する: heading 不在 → None、heading 存在するが本文が空 → ""、heading 存在し本文あり → non-empty str
  • presence のみを判定する consumer(run_contract_review_once.py::_resolve_delivery_rollup_applicability()、contract_readiness_check.py execute mode の canonical-parent VC-presence 判定)を truthiness / bool() から ... is not None へ変更する
  • baseline preflight 自身が「section は存在するが実行可能 content がない」ことをエラーにする箇所では、presence 判定(is not None)と content validation(空文字チェック)を分離する
  • 上記変更後、baseline_vc_preflight.py / run_contract_review_once.py / contract_readiness_check.py の既存 consumer 挙動(delivery-rollup applicability 判定、canonical-parent skip 判定)が壊れないことを、シンボル存在確認ではなく consumer 単位の pytest 回帰で固定する

Remaining Parent Gaps

なし(本 Issue はスコープ内で完結する fix)。ただし contract_readiness_check.py と run_contract_review_once.py の canonical parent / delivery-rollup skip 判定ロジック全体を単一 helper に統合する作業は Issue #1945 の別スコープであり、本 Issue では扱わない(詳細は Out of Scope 参照)。本 Issue が達成するのは、両ファイルが消費する section extraction の authority を 1 箇所(prose_boundary_policy.py)に揃え、その return contract を正しく消費させることまでである。

Outcome

.claude/skills/issue-contract-review/scripts/baseline_vc_preflight.py::extract_verification_commands_section() の正規表現ベースの Verification Commands section 抽出が、GFM closing-hash 見出し(末尾に ## が付く見出し)・section 内部の nested 見出し(### Runtime checks 等)・fenced code block 内の ## で始まる行、のいずれに対しても誤抽出しない状態になる。

この保証は「完全な GFM/CommonMark container-tree parser への準拠」ではなく、既存 .claude/skills/create-issue/scripts/prose_boundary_policy.py の canonical heading / fence semantics に統一することに限定する(同モジュールの iter_markdown_blocks() は raw line ベースの fence 検出であり、list item / blockquote を container として解析する完全な GFM parser ではない)。

具体的な完了状態:

  1. section extraction の authority が prose_boundary_policy.py に新設する 1 個の level-2 canonical helper に一本化され、baseline_vc_preflight.py にも contract_readiness_check.py にも section boundary algorithm の独立コピーが存在しない。
  2. baseline_vc_preflight.py → contract_readiness_check.py への逆 import は発生しない(既存の contract_readiness_check.py → baseline_vc_preflight.py import 方向は維持される)。
  3. extract_verification_commands_section(body) -> Optional[str] の return contract(None = heading 不在 / "" = heading 存在するが本文空 / non-empty str = heading 存在し本文あり)が docstring に明文化され、presence 判定 consumer が is not None を使用する。
  4. run_contract_review_once.py の delivery-rollup applicability 判定と contract_readiness_check.py execute mode の canonical-parent VC-presence 判定が、上記 return contract を正しく消費し、既存の意図した挙動(delivery-rollup parent に VC section があれば適用除外、canonical parent に VC section がなければ baseline preflight をスキップ)を維持していることが、それぞれ専用の新設 consumer regression pytest ファイル(absent / present-empty / present-nonempty / closing-hash-present の4ケース)で固定される。
  5. 上記変更後、本 Issue で新設する4件の regression test ファイルが全て PASS し、かつ既存 .claude/skills/create-issue/scripts/tests/test_prose_boundary_policy.py の全テストが引き続き PASS する(既存 .claude/skills/issue-contract-review/tests/ / .claude/skills/issue-contract-review/scripts/tests/ 配下の広範な既存 suite 全体の再実行は、単一 VC コマンドの実行時間予算(1コマンドあたり既定 150 秒、実測で該当 suite は 250 秒超)を超えるため本 Issue の VC には含めず、リポジトリ標準 CI の python-test-plan による継続的なカバレッジに委ねる)。

Runtime Verification Applicability

  • decision: not_applicable
  • reason: 本 Issue は Markdown section 抽出ロジック(Python 正規表現→既存 shared policy モジュールへの委譲)の修正であり、pytest による静的・決定論的検証で完結する。ランタイム smoke や実行環境依存の動作検証は不要

Background

PR #2780(Issue #2771)の OWNER review comment(https://github.com/squne121/loop-protocol/pull/2780#issuecomment-5845765792)の F2 指摘が本 Issue の起点。

PR #2780 では、contract_readiness_check.py に新設した check_runtime_assertion_binding_coverage() 内の VC section 抽出だけを、既存の _extract_rva_section() を汎化した _extract_section_by_canonical_name(body, "Verification Commands") に切り替えることで局所的に回避した。しかし extract_verification_commands_section() という helper 自体(.claude/skills/issue-contract-review/scripts/baseline_vc_preflight.py 内の定義、正規表現ベースの見出しマッチによる抽出)は今回修正されておらず、baseline_vc_preflight.py 自身の内部呼び出し、run_contract_review_once.py、contract_readiness_check.py execute mode の canonical-parent skip 判定は同じ抽出誤りを引き続き抱えている。

本 Issue は起票後、OWNER による review directive(https://github.com/squne121/loop-protocol/issues/2782#issuecomment-5846193834)で needs-fix 判定を受けた。指摘の要点は次の 2 点(詳細は Notes for Reviewer 参照):

  1. P1 — 依存関係上「既存 extractor への単純な委譲」ができない: contract_readiness_check.py は冒頭で既に baseline_vc_preflight から extract_verification_commands_section を import しているため、baseline_vc_preflight.py 側が contract_readiness_check.py::_extract_section_by_canonical_name() へ単純に委譲すると循環依存になる。かつ元の Allowed Paths には prose_boundary_policy.py も新しい共有 module の path も含まれていなかったため、実装者に許された最も簡単な解が「section boundary algorithm のコピー」になり得た。
  2. P1 — presence と content の bool() 混同: 旧 regex は空 section でも "\n" を返し truthy になる一方、GFM-aware canonical extractor では空 section は "" を返す。この差異により run_contract_review_once.py:198(if extract_verification_commands_section(body):)と contract_readiness_check.py(bool(extract_verification_commands_section(body)))の presence 判定が silently 反転しうる。

これらを受け、本 Issue の Allowed Paths・In Scope・Acceptance Criteria・Verification Commands を、section extraction authority の配置(prose_boundary_policy.py)・return contract の明文化・consumer 挙動固定まで含む形に更新した。

なお contract_readiness_check.py と run_contract_review_once.py の canonical parent / delivery-rollup skip 判定ロジック全体を単一 helper に統合する試みは Issue #1945 で別途進行中。本 Issue はその統合を前提にせず、section extraction の抽出精度と authority の一本化のみを修正する(詳細は Out of Scope 参照)。

In Scope

  • .claude/skills/create-issue/scripts/prose_boundary_policy.py に、既存 primitive(parse_atx_heading_line() / lookup_heading_policy())を再利用した新規 level-2 canonical section extraction helper(body: str, canonical_en: str -> Optional[str] 相当のシグネチャ)を追加する。新しい Markdown parser ライブラリや独自の container-tree 解析は追加しない
  • .claude/skills/issue-contract-review/scripts/baseline_vc_preflight.py::extract_verification_commands_section() の実装を、正規表現ベースの抽出から上記 shared helper への委譲に置き換える。関数のシグネチャ(body: str -> Optional[str])は変更しない
  • .claude/skills/issue-contract-review/scripts/contract_readiness_check.py::_extract_section_by_canonical_name() も同じ shared helper に委譲させ、section boundary algorithm の独立実装をこのファイルにも残さない
  • extract_verification_commands_section(body) -> Optional[str] の return contract を docstring に明文化する: None = heading 不在 / "" = heading 存在するが本文空 / non-empty str = heading 存在し本文あり
  • 以下の presence-only consumer を truthiness / bool() から ... is not None に変更する:
    • run_contract_review_once.py::_resolve_delivery_rollup_applicability()
    • contract_readiness_check.py execute mode の canonical-parent VC-presence 判定(parent_has_vc_section 相当)
  • baseline preflight 自身が「section は存在するが実行可能 content がない」ことをエラーとして扱う箇所では、presence 判定(is not None)と空文字/content validation を分離する
  • 以下の regression ケースを最低限含む pytest を、新設の専用 regression test ファイルへ追加する(既存ファイルへの新規テスト関数追加は VC の canonical node-id 制約と衝突するため行わない):
    1. .claude/skills/create-issue/scripts/tests/test_prose_boundary_policy_section_extraction.py(新設): shared extractor の GFM closing-hash 見出し / section 内 nested 見出し / fenced code block 内の擬似 ## 行 / heading 不在 / heading 存在かつ本文空 / heading 存在かつ本文あり、の6ケース
    2. .claude/skills/issue-contract-review/tests/test_run_contract_review_once_vc_presence_contract.py(新設): run_contract_review_once.py の delivery-rollup applicability 判定の absent / present-empty / present-nonempty / closing-hash-present の4ケース
    3. .claude/skills/issue-contract-review/tests/test_contract_readiness_check_vc_presence_contract.py(新設): contract_readiness_check.py execute mode の canonical-parent VC-presence 判定の absent / present-empty / present-nonempty / closing-hash-present の4ケース
    4. .claude/skills/issue-contract-review/scripts/tests/test_extraction_authority_delegation.py(新設): baseline_vc_preflight.py / contract_readiness_check.py それぞれが shared helper に委譲し、section boundary algorithm の独立実装を持たないことの回帰
  • 既存 .claude/skills/create-issue/scripts/tests/test_prose_boundary_policy.py は変更せず、新設 helper 追加後も引き続き全件 PASS することを確認する(既存 API の後方互換性、AC9)

Out of Scope

  • contract_readiness_check.py と run_contract_review_once.py の canonical parent / delivery-rollup skip 判定ロジック全体の統合(Issue contract_readiness_check.py の canonical parent skip 判定を run_contract_review_once.py と共有する #1945 のスコープ)。本 Issue が触れるのはそれらが消費する section extraction の authority と return contract のみ
  • review-issue skill 側の extract_section()(.claude/skills/review-issue/scripts/check_issue_contract.py)の実装変更(既に GFM-aware であり、対象外)
  • markdown-it-py 等の新規 Markdown parser 依存、LLM judge、新規 runtime smoke、新規 security gate、専用 harness の追加
  • list item / blockquote を container として解析する完全な GFM/CommonMark block model の実装(prose_boundary_policy.iter_markdown_blocks() の raw-line ベースの fence 検出方式は維持する)
  • Verification Commands section の内容(コマンド抽出後の parse・実行ロジック)の変更。本 Issue は section 境界抽出のみを扱う
  • リポジトリ内の他の Markdown section extractor 実装の全数調査・重複排除(follow-up 調査: canonical Markdown section extractor の重複実装を棚卸しし parser drift 再発箇所を特定する #2784 の独立 research スコープ)

Acceptance Criteria

  • AC1: prose_boundary_policy.py に新設する shared section extraction helper が、GFM closing-hash 見出し(見出し末尾に ## が付く形式)を含む body から正しく VC section 本文を抽出する
  • AC2: 同 helper が section 内部に nested 見出し(例: ### Runtime checks)を含む body でも、次の ## レベル見出しまでの全文を正しく抽出する(nested 見出しで途切れない)
  • AC3: 同 helper が fenced code block 内に ## で始まる行(コード例としての疑似見出し文字列)を含む body でも、その行を section 終端とみなさず正しく抽出する
  • AC4: 同 helper の return contract が次の3値で区別される: heading 不在 → None、heading 存在するが本文空 → ""、heading 存在し本文あり → non-empty str
  • AC5: run_contract_review_once.py::_resolve_delivery_rollup_applicability() が absent / present-empty / present-nonempty / closing-hash-present の4ケースで既存の delivery-rollup applicability 判定意図(VC section が実質的に存在する場合は適用除外)を維持し、presence 判定に truthiness ではなく extract_verification_commands_section(body) is not None を使用する
  • AC6: contract_readiness_check.py execute mode の canonical-parent VC-presence 判定が同4ケース(absent / present-empty / present-nonempty / closing-hash-present)で既存の skip 判定意図(VC section が実質的に存在しない canonical parent のみ baseline preflight をスキップ)を維持し、bool() ではなく is not None で判定する
  • AC7: baseline_vc_preflight.py::extract_verification_commands_section() が新設 shared helper(prose_boundary_policy.py)に委譲し、section boundary algorithm の独立コピーを自身に持たない。かつ baseline_vc_preflight.py から contract_readiness_check.py への import は発生しない(循環依存が生じない)
  • AC8: contract_readiness_check.py::_extract_section_by_canonical_name() も同じ shared helper(prose_boundary_policy.py)に委譲し、section boundary algorithm の重複実装を持たない
  • AC9: 既存 .claude/skills/create-issue/scripts/tests/test_prose_boundary_policy.py の全テストが、新設 helper 追加後も引き続き PASS する(既存 API の後方互換性)
  • AC10: 本 Issue で新設する4件の regression test ファイル(AC1–AC8 が対象とするファイル)が、単一の pytest 実行で全て PASS する

Verification Commands

# AC1
$ uv run --locked pytest .claude/skills/create-issue/scripts/tests/test_prose_boundary_policy_section_extraction.py -k "closing_hash" -q
# AC2
$ uv run --locked pytest .claude/skills/create-issue/scripts/tests/test_prose_boundary_policy_section_extraction.py -k "nested_heading" -q
# AC3
$ uv run --locked pytest .claude/skills/create-issue/scripts/tests/test_prose_boundary_policy_section_extraction.py -k "fenced_hash" -q
# AC4
$ uv run --locked pytest .claude/skills/create-issue/scripts/tests/test_prose_boundary_policy_section_extraction.py -k "absent or present_empty or present_nonempty" -q
# AC5
$ uv run --locked pytest .claude/skills/issue-contract-review/tests/test_run_contract_review_once_vc_presence_contract.py -q
# AC6
$ uv run --locked pytest .claude/skills/issue-contract-review/tests/test_contract_readiness_check_vc_presence_contract.py -q
# AC7
$ uv run --locked pytest .claude/skills/issue-contract-review/scripts/tests/test_extraction_authority_delegation.py -k "baseline_vc_preflight" -q
# AC8
$ uv run --locked pytest .claude/skills/issue-contract-review/scripts/tests/test_extraction_authority_delegation.py -k "contract_readiness_check" -q
# AC9
# vc-role: regression_gate
# baseline-expect: pass
$ uv run --locked pytest .claude/skills/create-issue/scripts/tests/test_prose_boundary_policy.py -q
# AC10
$ uv run --locked pytest .claude/skills/create-issue/scripts/tests/test_prose_boundary_policy_section_extraction.py .claude/skills/issue-contract-review/tests/test_run_contract_review_once_vc_presence_contract.py .claude/skills/issue-contract-review/tests/test_contract_readiness_check_vc_presence_contract.py .claude/skills/issue-contract-review/scripts/tests/test_extraction_authority_delegation.py -q

Allowed Paths

  • .claude/skills/create-issue/scripts/prose_boundary_policy.py
  • .claude/skills/create-issue/scripts/tests/ (新設 test_prose_boundary_policy_section_extraction.py を含む)
  • .claude/skills/issue-contract-review/scripts/baseline_vc_preflight.py
  • .claude/skills/issue-contract-review/scripts/run_contract_review_once.py
  • .claude/skills/issue-contract-review/scripts/contract_readiness_check.py
  • .claude/skills/issue-contract-review/tests/ (新設 test_run_contract_review_once_vc_presence_contract.py / test_contract_readiness_check_vc_presence_contract.py を含む)
  • .claude/skills/issue-contract-review/scripts/tests/ (新設 test_extraction_authority_delegation.py を含む)

Stop Conditions

  • Allowed Paths 外の変更が必要と判明した場合
  • In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
  • 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
  • 後続 Phase / 別スコープへの波及が判明した場合
  • nested SubAgent delegation が必要になった場合
  • 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
  • 本 Issue のスコープが Issue contract_readiness_check.py の canonical parent skip 判定を run_contract_review_once.py と共有する #1945(canonical parent / delivery-rollup skip 判定ロジック全体の統合)まで広がりそうになった場合は、統合作業を分離し本 Issue のスコープを section extraction authority の一本化と return contract 明文化のみに留める
  • prose_boundary_policy.py への新設 helper 追加が、list item / blockquote container を解析する完全な GFM block model の実装まで拡大しそうになった場合は着手を止め、既存 raw-line ベースの fence 検出方式の範囲内に留める

Required Skills

なし

Required Design References

  • .claude/skills/issue-contract-review/SKILL.md(baseline_vc_preflight / contract_readiness_check の役割分担と VC preflight 全体像)
  • .claude/skills/issue-contract-review/references/vc-preflight.md(VC preflight の section 抽出・判定ロジックに関する既存ドキュメント)

Delivery Rule

1 Issue = 1 PR を原則とする。worktree を切って作業し、Draft PR で起票する。

Notes for Reviewer

Activity

  1. added
    enhancement
    phase/implementation
    agent/implementer
    follow-up
    on Sep 26, 2026
  2. squne121 commented on Sep 26, 2026

    @squne121
    OwnerAuthor

    判定

    needs-fix。方向性は妥当ですが、現状の Issue #2782 の契約のまま実装すると、「3ケースを直す」ことはできても「canonical parser へ統一して再発防止する」という Outcome を満たさない実装が通り得ます。

    2026-09-26 現在、#2782 は open・コメントなしで本文も起票時から未更新、起点の PR #2780 は 967ce4bac148cc225221a530ef2b7fd19cc7ebef で merge 済みです。PR #2780 の F2 局所修正は main に入っていますが、baseline_vc_preflight.py::extract_verification_commands_section() は依然として旧 regex のままです。

    優先度 | Finding | 影響 -- | -- | -- P1 | 「既存 canonical extractor へ委譲」と Allowed Paths が両立していない | 修正者が section extraction をもう一度コピーし、SSOT 化したつもりで第三実装を作れる P1 | empty VC section の「存在」と「内容」を bool() で混同したまま | canonical parent / delivery-rollup の skip 判定が静かに反転し得る P2 | AC1–3 は helper 単体しか固定せず、影響を受ける2 consumer の挙動を固定しない | helper tests PASS / full suite PASS でも、既存 consumer semantics の意図が保証されない P2 | 「GFM-aware」という保証範囲が実装より広い | list / blockquote 内 fence では共有 policy 自体が完全な GFM parser ではない P2 | AC1–3 の pytest 対象ディレクトリが不自然 | 最も自然な scripts/tests/ に regression を置くと focused VC が実行しない

    P1 — 現在の依存関係では「既存 extractor への委譲」ができない

    ここが一番大きいです。

    main の contract_readiness_check.py:1407-1439 にある _extract_section_by_canonical_name() は確かに今回欲しい処理です。しかし同じ contract_readiness_check.py は冒頭で既に baseline_vc_preflight から extract_verification_commands_section を import しています。

    したがって、

    baseline_vc_preflight.py → contract_readiness_check._extract_section_by_canonical_name

    と単純に委譲すると循環依存になります。

    一方、下位の prose_boundary_policy.py が提供しているのは parse_atx_heading_line()、lookup_heading_policy()、iter_markdown_blocks() などの primitive です。section 全体を取得する共有 API は存在しません。 現在の Allowed Paths には prose_boundary_policy.py も、新しい共通 module の path もありません。

    このため、実装者に許されている最も簡単な解は、_extract_section_by_canonical_name() のループを baseline_vc_preflight.py にコピーすることです。closing hash / nested heading / fence の3テストは通りますが、「canonical parser に統一」「既存 SSOT ロジックへの委譲」という Issue の主目的は達成していません。

    推奨は、新しい parser を増やすのではなく prose_boundary_policy.py に小さな section extraction helper を置けるよう Allowed Paths を広げることです。 たとえば extract_level2_section_by_canonical_name(...) -> Optional[str] 程度で十分です。baseline_vc_preflight と contract_readiness_check がそれを消費すれば依存方向も素直です。review-issue までこの Issue で改修する必要はありません。

    これは harness 強化ではなく、むしろ重複実装を減らす変更です。

    P1 — Optional[str] の意味を先に決める必要がある

    現在の legacy regex は、驚くべきことに空 section でも truthy です。

    ## Verification Commands
    ## Next

    現在の regex

    r"^##\s+Verification Commands\s*$(.+?)(?=^##|\Z)"

    では、この入力から "\n" が返るため bool(...) == True です。

    しかし _extract_section_by_canonical_name() 相当の自然な実装では、section は「存在するが本文は空」なので "" が返ります。すると次の2箇所が変わります。

    run_contract_review_once.py:198 は if extract_verification_commands_section(body):、contract_readiness_check.py:2359-2362 は bool(extract_verification_commands_section(body)) で section presence を判断しています。

    既存テストはどちらも「VC section + 実コマンド」のケースしか固定していません。empty-but-present はありません。

    ここは "\n" を互換 sentinel として無理に維持するより、

    None = section absent、str(空文字を含む) = section present

    と契約を明確にして、presence-only consumer を

    extract_verification_commands_section(body) is not None

    へ変える方が堅牢です。baseline preflight 自身が「空内容をエラーにする」箇所では、その後に if not vc_section: と内容チェックすればよいです。

    #1945 の skip ロジック統合まで行う必要はありません。これは #2782 の parser return contract を正しく消費するだけなので、#1945 と責務衝突しません。

    P2 — AC5 の rg は consumer regression の代わりになっていない

    Issue 本文は「全 consumer で既存挙動を維持」と明言していますが、AC5 が確認するのはシンボル名の存在だけです。

    特に今回重要なのは helper が import できることではなく、

    run_contract_review_once の delivery-rollup applicability と、contract_readiness_check execute mode の canonical-parent preflight skip

    が正しいことです。

    既にそれぞれ専用 regression test が存在します。そこへ absent / present-empty / present-nonempty / closing-hash を足すのが最小コストです。新しい integration harness は不要です。

    P2 — 「GFM-aware」は少し言い過ぎ

    closing hash 対応自体は GFM/CommonMark の仕様どおりです。ATX heading は末尾の closing # sequence を許容し、fenced code 内の内容は heading として扱われません。 GitHub Docs

    ただし CommonMark/GFM の block model は list item や blockquote を container として扱い、その中にも fenced code block を置けます。公式仕様にも `> ```` 型の blockquote 内 fence が例示されています。 GitHub Docs

    対して現在の prose_boundary_policy.iter_markdown_blocks() は raw line に対して「0–3 spaces + fence」で fence を検出しており、Markdown container tree を解析していません。例えば list 内 fence を完全に理解する parser ではありません。

    この Issue のために markdown-it-py 等を追加するのは過剰です。canonical Issue の VC は top-level fenced bash というリポジトリ規約もあります。したがって、Outcome を「full GFM compliant」ではなく「既存 prose_boundary_policy の canonical heading/fence semantics に統一」と限定するのが、個人開発には適しています。

    P2 — focused Verification Commands の test root がずれている

    baseline preflight の既存テスト群は主に

    .claude/skills/issue-contract-review/scripts/tests/

    にあります。それなのに AC1–AC3 はすべて

    pytest .claude/skills/issue-contract-review/tests/ -k ...

    だけです。

    AC4 では両方の test root を実行しているので、単純な記載漏れに見えます。新規 regression を自然な scripts/tests/test_baseline_vc_preflight_...py に追加すると AC1–3 の focused VC が拾いません。

    Issue #2782 に入れるべき修正

    大規模化させる必要はありません。本文を refine するなら、少なくとも次の契約を追加すれば implementation-ready にかなり近づきます。

    1. Shared extraction
       - section boundary algorithm を baseline_vc_preflight.py に複製しない。
       - prose_boundary_policy 側の shared helper、または循環依存しない
         lower-level shared module に extraction authority を置く。
       - そのために必要な shared helper file / tests を Allowed Paths に追加する。
    
    1. Return contract

      • None = Verification Commands heading absent
      • "" = heading present but section body empty
      • non-empty str = heading present with body
      • presence-only consumer は bool(result) ではなく result is not None を使用する。
    2. Consumer regression

      • run_contract_review_once:
        absent / empty-present / closing-hash-present
      • contract_readiness_check:
        absent / empty-present / closing-hash-present
      • baseline_vc_preflight:
        closing hash / nested ### / fenced ## でも command inventory が同一
    3. Verification

      • AC1–AC3 の pytest 対象に tests/ と scripts/tests/ の両方を含める。

    最終的には、新しい Markdown dependency、LLM judge、runtime smoke、セキュリティ gate は不要です。今回価値が高いのは「既存 primitive を本当に1箇所の section extractor に集約する」「section presence と content truthiness を分離する」「既存2 consumer の regression を直接固定する」の3点です。

    この3点を入れずに実装へ進むと、#2780 の F2 を直すために起票した follow-up が、今度は parser drift そのものを温存する可能性があります。

  3. squne121 commented on Sep 26, 2026

    @squne121
    OwnerAuthor

    推奨は、#2782 を実装へ進めず、対象 OWNER コメントを human-context anchor として issue-refinement-loop で本文契約を修正し切ることです。コメントの P1 は実装詳細ではなく、現行 Issue の Allowed Paths / return contract / consumer regression が不足しているという契約上の問題なので、先に refinement するのが適切です。

    特に固定すべき点は次です。

    1. contract_readiness_check.py::_extract_section_by_canonical_name() を baseline_vc_preflight.py にコピーしない。循環依存しない下位 SSOT、第一候補として .claude/skills/create-issue/scripts/prose_boundary_policy.py に共有 section helper を置けるよう Allowed Paths とテスト範囲を拡張する。
    2. Optional[str] を None = section absent、"" = present but empty、non-empty string = present with content と明文化し、presence 判定を is not None に変える。
    3. run_contract_review_once.py と contract_readiness_check.py の既存専用 regression test に、absent / empty-present / nonempty-present / closing-hash を直接追加する。単なる rg を AC にしない。
    4. AC1–AC3 の focused pytest は tests/ と scripts/tests/ の双方を対象にする。共有 helper を prose_boundary_policy.py に置くなら、その既存テストも VC に含める。
    5. 「full GFM parser」の保証には広げず、「既存 prose_boundary_policy の canonical heading / fence semantics に統一」と表現を限定する。新規 Markdown dependency や harness は不要。
    6. contract_readiness_check.py の canonical parent skip 判定を run_contract_review_once.py と共有する #1945 の skip 判定ロジック統合には踏み込まない。ただし 実装: 再発防止: issue-contract-review の Verification Commands section 抽出を GFM-aware canonical parser に統一する #2782 で必要な presence consumer の is not None 化は 実装: 再発防止: issue-contract-review の Verification Commands section 抽出を GFM-aware canonical parser に統一する #2782 の return contract 対応として実施対象にする。

    また、同型の section parser drift が他の独自 extractor にも再発し得ることを確認したため、実装を無闇に共通化せず evidence-first で棚卸しする再発防止 Issue を起票しました。#2784 は #2782 の blocker ではありません。

    [Issue #2784 — canonical Markdown section extractor の重複実装を棚卸し](#2784)

    以下を、そのまま既に auto mode で起動中の Claude Code に渡すのがよいです。

    squne121/loop-protocol の Issue #2782 を対象に、repository の canonical skill .claude/skills/issue-refinement-loop/SKILL.md に従って issue refinement loop を実行してください。

    対象:

    この Claude Code セッションは既に auto mode で起動済みです。通常の iteration 継続や Issue 本文修正について人間への承認確認・確認質問を挟まず、自律的に進めてください。Claude Code 自体の permission mode を変更する必要はありません。repository skill が定める genuine human judgment / environment failure / destructive operation 等の hard stop は迂回しないでください。

    max_iterations は 5 とし、approved、修復不能な terminal condition、または max_iterations 到達まで継続してください。

    対象コメントは OWNER による明示的な review directive なので、anchor URL を単なる unlabeled anchor として扱わず、issue-refinement-loop が定める with_human_context lane を使用してください。current SKILL.md / command_registry.py を正本として canonical executor を使用し、手書きの代替 workflow を作らないでください。

    最初に current main の実態調査を codebase-investigator SubAgent へ read-only で委譲してください。少なくとも以下を current main から検証してください。

    1. baseline_vc_preflight.py::extract_verification_commands_section() の現行 regex と全 consumer。
    2. contract_readiness_check.py::_extract_section_by_canonical_name() と prose_boundary_policy の依存方向。
    3. .claude/skills/create-issue/scripts/prose_boundary_policy.py に section 全体を返す共有 API が現時点で存在するか。
    4. run_contract_review_once.py::_resolve_delivery_rollup_applicability() の VC presence 判定。
    5. contract_readiness_check.py execute mode の parent_has_vc_section 判定。
    6. 次の既存 regression test の拡張可能性:
      • .claude/skills/issue-contract-review/tests/test_run_contract_review_once_regression_matrix.py
      • .claude/skills/issue-contract-review/tests/test_contract_readiness_check_execute_mode_parent_skip.py
      • baseline VC preflight 関連の scripts/tests/
      • .claude/skills/create-issue/scripts/tests/test_prose_boundary_policy.py
    7. Issue contract_readiness_check.py の canonical parent skip 判定を run_contract_review_once.py と共有する #1945 との scope boundary。
    8. follow-up 調査: canonical Markdown section extractor の重複実装を棚卸しし parser drift 再発箇所を特定する #2784 が 実装: 再発防止: issue-contract-review の Verification Commands section 抽出を GFM-aware canonical parser に統一する #2782 の blocker ではなく独立 research であること。

    codebase-investigator を起動しただけで調査完了扱いにしないでください。SubAgent の完了を必ず待ち、最終結果を取得・検証してから mutation / review へ進んでください。

    planner が web research を required と判定した場合だけ web-researcher SubAgent を使用してください。その場合も investigator と web-researcher の双方の完了を必ず join してから Step 2 へ進んでください。planner が不要と判定した外部調査を独自判断で追加しないでください。

    OWNER comment の findings は refinement の主要 input として扱い、Issue #2782 を少なくとも以下の契約へ収束させてください。

    • section boundary algorithm を baseline_vc_preflight.py にコピーしない。
    • contract_readiness_check.py から逆向き import して循環依存を作らない。
    • section extraction authority は循環依存しない lower-level shared module に置く。
    • current architecture で妥当なら第一候補を .claude/skills/create-issue/scripts/prose_boundary_policy.py とし、そこに小さな level-2 canonical section extraction helper を追加できるよう Issue の Allowed Paths を更新する。
    • helper 用 regression test path も Allowed Paths / Verification Commands に含める。
    • investigation の結果、既存の別 lower-level SSOT がより適切と実証できた場合だけそちらを採用し、Issue 本文に理由を反映する。第三の独自 parser を新設しない。

    return contract は曖昧にしないでください。

    extract_verification_commands_section(body) -> Optional[str] は:

    • None: Verification Commands heading が存在しない
    • "": heading は存在するが section body は空
    • non-empty str: heading が存在し content がある

    と明文化してください。

    section presence だけを判定する consumer は truthiness を使用せず、result is not None 相当で判定する契約にしてください。

    対象は少なくとも:

    • run_contract_review_once.py::_resolve_delivery_rollup_applicability()
    • contract_readiness_check.py execute mode の canonical-parent VC-presence 判定

    です。

    一方、baseline preflight 自身で「section は存在するが実行可能 content がない」ことをエラーにすべき箇所では、presence と content validation を分離してください。

    これは Issue #1945 の canonical parent / delivery-rollup skip decision 全体を共有 helper に統合する作業ではありません。#1945 の refactor は Out of Scope のまま維持してください。#2782 で必要なのは parser return contract を各既存 consumer が正しく消費することまでです。

    Acceptance Criteria / regression coverage は helper 単体だけで終わらせず、consumer behavior を固定してください。最低限:

    • shared extractor / extract_verification_commands_section
      • closing-hash heading
      • nested ### heading
      • fenced code 内の疑似 ##
      • absent
      • present-empty
      • present-nonempty
    • run_contract_review_once
      • absent
      • present-empty
      • present-nonempty
      • closing-hash-present
        が delivery-rollup applicability の intended semantics を維持すること
    • contract_readiness_check
      • absent
      • present-empty
      • present-nonempty
      • closing-hash-present
        が canonical parent execute-mode preflight skip の intended semantics を維持すること

    を直接 pytest で固定してください。

    現行 AC5 の symbol を rg するだけの確認を consumer regression の代替にしないでください。rg は補助 verification に残してもよいですが、behavioral AC は pytest を authority にしてください。

    AC1–AC3 の focused pytest が .claude/skills/issue-contract-review/tests/ だけを走らせる現行記述も修正してください。regression の自然な配置先が scripts/tests/ の場合に取りこぼさないよう、必要な両 test root を対象にしてください。prose_boundary_policy.py を変更対象にするなら、その canonical policy test も Verification Commands に明示してください。

    Issue 本文の「GFM-aware」「canonical parser」という表現は実装能力以上に広げないでください。current prose_boundary_policy.iter_markdown_blocks() は Markdown container tree 全体を実装した完全な GFM parser ではないため、Outcome / In Scope / AC は原則として

    「既存 prose_boundary_policy の canonical heading / fence semantics に統一する」

    程度の保証に限定してください。

    この Issue のために markdown-it-py 等の新規 Markdown dependency、LLM judge、新規 runtime smoke、新規 security gate、専用 harness を導入しないでください。

    Issue #2782 の Allowed Paths を広げる必要があること自体は今回の trusted OWNER directive で明示されています。skill の with_human_context / scope-delta handling に従って処理してください。Allowed Paths の exact repository-relative path 導出が必要なら codebase-investigator の read-only evidence を使用し、人間に ANCHOR_SCOPE_REFRAME_V1 等を手書きさせるために停止しないでください。NEXT_ACTION: issue_editor_required が返った場合は skill の canonical full-rewrite lane に従ってください。

    Step 4 で issue-editor SubAgent を使用した場合も、起動した時点で成功扱いにしないでください。SubAgent の完了を必ず待ち、Issue body/title の readback を取得してから fresh preflight / fresh review に進んでください。

    Step 2 の canonical review は current issue-refinement-loop の仕様どおり root-owned run_root_review_pipeline.py produce を使用してください。background execution が指定されている場合、background launch は完了ではありません。task notification を必ず join し、完了 JSON を取得してから canonical_step2_route を consume してください。旧 issue-reviewer SubAgent を canonical Step 2 の代替 authority として起動しないでください。

    write-capable SubAgent からさらに write-capable SubAgent を nested delegation しないでください。GitHub mutation、最終 routing、termination 判断は root/main thread が所有してください。

    各 needs-fix iteration では、人間承認を求めず Step 4 → readback → fresh Step 2 review を継続してください。no-progress や max-iteration 判定は skill の canonical router に従い、独自の prose 判断で迂回しないでください。

    再発防止については、既に以下の独立 research Issue が起票されています。

    #2784

    #2784 は #2782 の blocker にしないでください。今回の refinement 中にさらに別の concrete recurrence が見つかった場合は、まず OPEN Issue を検索して dedupe してください。#2782、#1945、#2784 のいずれにも包含されず、再現可能な別 failure mode が確認できた場合だけ follow-up Issue を materialize してください。推測だけで新規 Issue を量産しないでください。

    refinement が approved になったら、Issue 本文の最終 readback、termination report / LOOP_HANDOFF_RESULT_V1 が適用される場合の publish まで current skill に従って完了してください。

    重要: 今回の依頼は Issue refinement です。approved 後に impl-review-loop、implementation worker、実装用 worktree、production code の変更、commit、push、PR 作成を自動開始しないでください。refinement の正常終了地点で停止してください。

    最後に、main/root thread から簡潔に以下を報告してください。

    このプロンプトでは、単に「サブエージェントを使う」だけでなく、investigator / optional web research / issue-editor / background Step 2 の完了を待たずに先へ進むことを明示的に禁止しています。また、approved 後に実装ループへ流れ込まないよう境界も固定しています。

  4. squne121 commented on Sep 26, 2026

    @squne121
    OwnerAuthor

    Refinement Loop: Approved

    issue-refinement-loop(with_human_context lane、anchor: https://github.com/squne121/loop-protocol/issues/2782#issuecomment-5846193834)による refinement を完了し、approved で終了する。

    反映した OWNER review directive

    OWNER review directive(https://github.com/squne121/loop-protocol/issues/2782#issuecomment-5846193834)の P1/P2 指摘を全て本文へ反映した:

    • P1(依存関係上「既存 extractor への委譲」が不可能だった点)→ prose_boundary_policy.py に新設 level-2 shared helper を置き、baseline_vc_preflight.py / contract_readiness_check.py の双方がそこへ委譲する設計に変更。Allowed Paths に prose_boundary_policy.py と新設テストファイル群を追加(AC7/AC8)
    • P1(presence/content の bool() 混同)→ return contract(None/""/non-empty str)を明文化し、presence-only consumer を is not None 判定へ変更する AC4/AC5/AC6 を新設
    • P2(AC1–3 が helper 単体しか固定しない)→ AC5/AC6 で run_contract_review_once.py / contract_readiness_check.py の consumer regression(absent / present-empty / present-nonempty / closing-hash-present)を専用の新設 regression test ファイルで直接固定
    • P2(「GFM-aware」表現が実装能力を超過)→ Outcome / Out of Scope を「既存 prose_boundary_policy の canonical heading/fence semantics に統一する」範囲に限定し、list/blockquote container を含む完全な GFM block model 実装を明示的に Out of Scope 化
    • P2(AC1–3 の focused pytest 対象ディレクトリの偏り)→ prose_boundary_policy.py 変更対象化に伴い .claude/skills/create-issue/scripts/tests/ も Verification Commands に含め、AC9 で既存 canonical policy test(test_prose_boundary_policy.py)の後方互換性を明示的に検証

    VC preflight 反復で解消した実行時問題

    1回目 rewrite 後の fresh Step 2 review で canonical_step2_route: step_5_operator_intervention_required(failure_class: contract_readiness_human_judgment)を検出した。原因は次の2点:

    • 新規 regression test を 既存ファイルへの -k フィルタ参照として書いていたため、実装前は該当テストが未作成で pytest が exit 5(「no tests collected」)を返し、baseline_vc_preflight.py の command-shape policy 上ブロック対象になっていた
    • 3 test root を1コマンドに結合した AC が実測 250 秒超で per-command timeout(既定 150 秒)を超過していた

    これを受け、全ての新規 regression ケースを 新設専用テストファイル(未作成ファイルパスへの直接参照、pytest exit 4 = expected_baseline_fail として正しく分類される)へ切り替え、かつ広範な directory 一括実行を避けるスコープへ AC9/AC10 を再設計した。2回目 rewrite 後の fresh preflight(baseline_vc_preflight.py dry-run)で AC1–AC10 全て decision: go を確認済み。

    起動した SubAgent と completion join

    Final review / readiness

    • fresh preflight(preflight.run): STATUS: pass / NEXT_ACTION: proceed
    • fresh canonical Step 2 review(run_root_review_pipeline.py produce): status: ok / verdict: approve / next_action: proceed / structured_blockers: [] / findings: []
    • baseline_vc_preflight.py dry-run: top-level status: pass、errors: []、AC1–AC10 全て decision: go

    implementation は開始していない(impl-review-loop / implementation worker / 実装用 worktree / production code 変更 / commit / push / PR 作成のいずれも未実施)。

    LOOP_HANDOFF_RESULT_V1:
      status: blocked
      routing_action: blocked
      contract_review:
        status: blocked
        gate_result: missing_go
        latest_comment_url: ''
        generated_at: ''
        body_sha256: ''
      metadata:
        title_prefix_ready: false
      label_sync_observation:
        kind: presentation_sync
        result: noop
        detail: 'issue-refinement-loop did not mutate labels in this cycle'
      auto_fixes:
        result: blocked
        required: []
        skipped: []
      blockers:
      - kind: contract_review_not_run
        description: 'issue-contract-review (issue-contract-review skill, distinct from the contract_readiness_check.py --mode preflight-static pre-edit check run during Step 4 rewrite) has not yet been executed against this body revision; run it before any impl-review-loop dispatch is considered'
      permissions:
        unavailable: []
      generated_at: '2026-09-26T13:03:53Z'
      checked_body_sha256: sha256:1676371daede6305b62eed5fb8e1234c348fc0852ef2c6c0a183a0ff952f4833
      checker_exit_code: 0
      missing_sections: []
      missing_contract_keys: []
  5. squne121 commented on Sep 26, 2026

    @squne121
    OwnerAuthor

    確認した限り、今は再 refinement ではなく impl-review-loop を root-owned entry から起動する段階です。

    #2782 は open のままですが、本文は OWNER 指摘を反映済みで、refinement 自体は approved まで完了しています。一方、その refinement コメント末尾の LOOP_HANDOFF_RESULT_V1 は contract_review_not_run で blocked です。ただし現在の impl-review-loop は、Step 1 の前に 同一 invocation 内で fresh issue-contract-review を実行し、live Issue を再取得してから routing する設計です。したがって、この古い blocked handoff を理由に別途人間承認を挟む必要はありません。

    また current main では、baseline_vc_preflight.py の VC 抽出はまだ regex、run_contract_review_once.py はまだ truthiness、contract_readiness_check.py はまだ bool(...) 判定で、#2782 の修正対象が残っています。#2782 に対応するPRも現時点では見つかりませんでした。既存の #1945 と #2784 は関連スコープを既にカバーしているため、同内容の再発防止Issueは重複起票させないのが適切です。

    auto mode の Claude Code には、以下をそのまま渡すのを推奨します。

    Issue #2782 を対象に、リポジトリに定義されている .claude/skills/impl-review-loop を使用して、実装・検証・PRレビューのループを開始してください。

    対象:
    #2782

    使用する skill:
    .claude/skills/impl-review-loop/SKILL.md

    目的は、Issue #2782 の live contract を満たす実装を行い、Verification と PR review を反復し、impl-review-loop が定義する正常終了地点、すなわち人間が最終的な merge 判断を行える直前まで自律的に進めることです。

    人間への途中承認要求は原則不要です。レビューで修正要求が出た場合も、Issue contract と Allowed Paths の範囲内で自律修正し、再検証・再レビューしてください。

    max_iterations は 6 としてください。単なる reviewer finding、advisory artifact の欠落、古い handoff marker、scope-rollup warning、product-spec advisory、SubAgent の human_review_required: true 自己申告だけを理由に停止しないでください。現行 impl-review-loop の routing policy と live-state safety boundary を authority としてください。

    Entry の重要条件

    Step 1 を直接起動せず、impl-review-loop の Root-Owned Synchronous Entry Transition を必ず使用してください。

    同一の continuous root invocation 内で、

    capability preflight
    → live Issue #2782 fetch
    → current-run issue-contract-review
    → live Issue 再取得
    → root entry routing
    → invoke_impl_review_loop の場合のみ Step 1

    という現行 skill の正規フローを実行してください。

    Issue #2782 の refinement 完了コメント:

    #2782 (comment)

    には、refinement 時点の LOOP_HANDOFF_RESULT_V1 として

    contract_review_not_run

    が残っています。

    これは過去 invocation の telemetry であり、今回の Step 1 authorization として再利用してはいけません。また、それ自体を今回の終端 blocker にもしないでください。

    今回の root invocation 自身で fresh issue-contract-review を実行し、その current-run result と直後の live Issue state に基づいて routing してください。

    fresh review が go / implementation entry 可なら、そのまま同一 invocation で Step 1 へ進んでください。

    fresh review が本当に contract refinement / human decision を要求する結果になった場合だけ、現行 root-entry policy に従って扱ってください。

    Current main で既知の未実装点

    実装前に live main を必ず確認してください。2026-09-26 時点で確認された main では、少なくとも次が未修正です。

    baseline_vc_preflight.py::extract_verification_commands_section() は regex:

    ^##\s+Verification Commands\s*$(.+?)(?=^##|\Z)

    による独立抽出のままです。

    contract_readiness_check.py::_extract_section_by_canonical_name() は parse_atx_heading_line() / lookup_heading_policy() / fence 判定を組み合わせた section boundary algorithm を同ファイル内に保持しています。

    run_contract_review_once.py::_resolve_delivery_rollup_applicability() は:

    if extract_verification_commands_section(body):

    という truthiness 判定です。

    contract_readiness_check.py execute mode は:

    bool(extract_verification_commands_section(body))

    を VC section presence として使用しています。

    ただし、これらは開始時の参考 evidence です。実装直前に live branch を再確認し、すでに別変更で解消されていれば duplicate implementation を行わないでください。

    Issue contract の実装方針

    Issue #2782 本文を authority としてください。

    特に次を崩さないでください。

    section extraction authority は .claude/skills/create-issue/scripts/prose_boundary_policy.py の新規 level-2 canonical section helper に一本化すること。

    その helper は既存の parse_atx_heading_line()、lookup_heading_policy()、既存 fence semantics を再利用すること。

    新規 Markdown parser dependency や完全な CommonMark/GFM container tree parserを導入しないこと。

    baseline_vc_preflight.py::extract_verification_commands_section() と contract_readiness_check.py::_extract_section_by_canonical_name() の双方を同じ shared helper へ委譲させること。

    baseline_vc_preflight.py → contract_readiness_check.py の逆 import を作らず、循環依存を発生させないこと。

    extract_verification_commands_section(body) -> Optional[str] の contract は厳密に:

    None = heading absent
    "" = heading present but body empty
    non-empty str = heading present with content

    とすること。

    presence-only consumer は truthiness ではなく is not None で判定すること。

    baseline preflight 自身の「実行可能 VC content が空である」という validation と、「section が存在する」という presence 判定を混同しないこと。

    Issue #1945 の canonical-parent / delivery-rollup skip 判定全体の共通化には踏み込まないこと。

    完全な list/blockquote container-aware GFM parser には拡張しないこと。

    SubAgent 実行規律

    impl-review-loop が定義する Step ごとに SubAgent を使用してください。

    Step 1:
    implementation-worker / implement-issue 系 SubAgent に実装を委譲する。

    Step 2:
    独立した test-runner SubAgent に Verification Commands と必要な regression を検証させる。

    Step 4:
    独立した pr-reviewer / pr-review-judge SubAgent に current PR head をレビューさせる。

    REQUEST_CHANGES が返った場合:
    root orchestrator が blocker/fix_delta を保持し、次 iteration の implementation worker に渡す。

    重要:
    SubAgent を launch した後、その SubAgent の completion を必ず join / wait してください。

    SubAgent が完了していない状態で、その結果を推測して次 Step へ進んではいけません。

    implementation-worker 完了前に Verification を開始しない。
    test-runner 完了前に PR review を開始しない。
    pr-reviewer 完了前に verdict routing を行わない。
    fix worker / update-branch worker を起動した場合も、その completion を待ってから再検証する。

    root orchestrator → SubAgent という委譲は必須ですが、SubAgent 自身にさらに nested SubAgent delegation を要求しないでください。Issue #2782 の Stop Conditions にある nested SubAgent delegation と、impl-review-loop 自身による root-level delegation を混同しないこと。

    Verification

    Issue #2782 の AC1–AC10 と Verification Commands をそのまま authority としてください。

    特に、新設される4件の regression test と既存 test_prose_boundary_policy.py を必ず実行してください。

    focused test が PASS しただけで終了せず、Step 2 の test-runner が current head と Issue body に binding された VC adjudication を完了したことを確認してください。

    テスト失敗が implementation defect なら自律修正してください。

    既存 Issue contract 自体の意味変更が必要になる場合のみ、実装で吸収せず現行 workflow の contract handling に従ってください。

    単に harness / telemetry / advisory artifact が欠けているだけなら、それを理由に有用な実装作業を止めないでください。リポジトリの現行 skill が advisory と規定しているものは advisory として扱ってください。

    PR とレビュー

    1 Issue = 1 PR を維持してください。

    既存の #2782 対応 open/draft PR が live discovery で見つかった場合は duplicate PR を作らず resume してください。

    見つからなければ canonical worktree / branch を用いて実装し、Issue の Delivery Rule に従って Draft PR を作成してください。

    PR review の REQUEST_CHANGES は、Allowed Paths 内かつ Issue contract を変更しない限り人間へ戻さず自律修正してください。

    reviewed head と current head がずれた場合は stale review を承認根拠にせず current head を再レビューしてください。

    branch が behind の場合は現行 route_to_update_branch に従って branch update → Verification → PR review をやり直してください。

    実 Git conflict / DIRTY は skill の conflict runbook に従ってください。

    最終的に APPROVE、空 blockers、current-head verification、live mergeability 等、現行 impl-review-loop の approved route 条件をすべて満たすまで反復してください。

    PR の merge 自体は行わないでください。
    impl-review-loop の正常終了である draft_pr_ready / approved 相当まで進め、人間が merge 判断できる状態で止めてください。

    再発防止 follow-up

    作業中に再発性のある別問題を発見した場合は、まず GitHub の open/closed Issue を検索して重複確認してください。

    特に以下は既存 follow-up なので重複起票しないでください。

    Issue #1945:
    contract_readiness_check.py と run_contract_review_once.py の canonical parent / delivery-rollup skip 判定ロジック全体の共有化。

    Issue #2784:
    canonical Markdown section extractor の repo-wide 棚卸しと parser drift 再発箇所の調査。

    これらに包含されない、具体的な再現 evidence があり、複数箇所・将来変更で再発する可能性が高い新しい根因だけを follow-up Issue 候補にしてください。

    新規 follow-up が必要な場合は、抽象的な「リファクタした方がよい」ではなく、

    再現条件
    影響範囲
    根因
    既存 Issue でカバーされない理由
    bounded scope
    Acceptance Criteria
    Verification 方針

    を明示して GitHub Issue を起票してください。

    ただし #2782 の Stop Conditions に抵触する scope split が必要な問題だった場合は、follow-up を起票したうえで #2782 の Allowed Paths を勝手に拡張せず、current loop はその stop condition に従ってください。

    #2782 の正常実装とは独立した non-blocking follow-up であれば、#2782 の実装・検証・PR review を妨げないでください。

    最終報告

    root/main thread から最後に簡潔に報告してください。

    Issue #2782 の final loop status。
    作成または再利用した PR 番号と URL。
    最終 PR head SHA。
    実装した AC の対応概要。
    実行した Verification Commands と結果。
    implementation-worker / test-runner / pr-reviewer、および追加 worker があればそれぞれの completion を待ったこと。
    最終 reviewer verdict と live mergeability。
    残存 blocker の有無。
    新規 follow-up Issue を起票した場合は番号と理由。なければ none。
    merge は実行していないこと。

    途中でユーザーへ確認を求めるのではなく、現行 impl-review-loop が定義する自律 routing を最大限使用して完了まで進めてください。

    特に今回のポイントは、5846499892 の contract_review_not_run を見てそこで止まらせないことです。現在の impl-review-loop はこの用途のために current-run contract review を root entry に組み込んでいるので、その経路から起動するのが一番整合しています。

  6. squne121 commented on Sep 26, 2026

    @squne121
    OwnerAuthor

    root-owned entry router audit

    route: invoke_impl_review_loop
    reason: fresh_review_go_live_equality

  7. squne121 commented on Sep 26, 2026

    @squne121
    OwnerAuthor

    implement-issue: 実装完了 (2026-09-26T14:06:22Z)

    • PR: fix: VC section 抽出の authority を prose_boundary_policy.py へ一本化する #2786
    • Worktree: .claude/worktrees/issue-2782-vc-section-extraction-authority
    • Branch: worktree-issue-2782-vc-section-extraction-authority
    • PR head SHA: 38609af11636e4e92f7320e2664efc6771720703
    • Verification: AC1-AC10 全て PASS(新設4テストファイル計28件)。既存 test_prose_boundary_policy.py(92件)、test_baseline_vc_preflight.py(143件+1 skip)、test_contract_readiness.py(49件)、execute-mode/regression-matrix 系(35件)も回帰なしを確認。pnpm typecheck / lint / test(1943件)/ build も全て成功
    • 後続: PR レビュー(pr-review-judge)→ マージ → post-merge-cleanup
  8. squne121 commented on Sep 26, 2026

    @squne121
    OwnerAuthor

    impl-review-loop: 完了 (2026-09-26T15:43:17Z)

    IMPL_REVIEW_LOOP_RESULT_V1:
      schema_version: 1
      status: draft_pr_ready
      pr_url: "https://github.com/squne121/loop-protocol/pull/2786"
      head_sha: "14743c8fcb1203b8e4f1cedac9a3aa3a12933722"
      issue_number: 2782
      termination_reason: approved
      merge_ready: true
      iteration: 0
    
    FOLLOW_UP_MATERIALIZATION_RESULT_V1:
      schema_version: 1
      materialized_by: impl-review-loop
      follow_up_issues: []
      note_only_observations: []
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

    agent/implementerenhancementfollow-upphase/implementation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions