Skip to content

docs: 削除確認 VC の guidance を exit 0 成功の rg --files-without-match 形へ是正する (#2943) - #2947

Merged
squne121 merged 3 commits into
mainfrom
worktree-issue-2943-deletion-vc-guidance
Oct 5, 2026
Merged

squne121 merged 3 commits into
mainfrom
worktree-issue-2943-deletion-vc-guidance

Conversation

@squne121

@squne121 squne121 commented Oct 5, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • linked Issue は 実装: 削除確認 VC の authoring guidance が rg -c を成功条件 0 件の形で規定しており、no-match の exit 1 で成否が逆転するため guidance を exit 0 成功の negative assertion へ是正する #2943 です。create-issue の削除確認 VC の authoring guidance が rg -c を「0 件を成功」とする形で示しており、no-match の exit 1 で成否が逆転する問題を是正しました。
  • SKILL.md の「削除確認パターン」箇条(inline code)と references/body-authoring.md の「### 削除確認パターン」節(fenced block)を、plain rg の absence 形 rg --files-without-match --fixed-strings -- "<literal>" <file>(1 command = 1 concrete file、成功は exit 0、-q 非併用)へ置換しました。-- は option parsing の終端で、--settings のように - で始まる literal を option ではなく pattern として扱うために必須です(--fixed-strings だけでは dash 始まりの literal が option と解釈され rg が exit 2 になります)。
  • body-authoring.md には、-- separator が必要な理由、成功は exit 0 であること、1 command = 1 file、-q を使わない理由(ripgrep 14.1.0 の upstream bug #3108)、-c / --count が no-match で exit 1 を返し削除確認に使えないこと、否定演算子 ! 前置の検索を canonical にしない理由を日本語で説明しています。
  • 回帰テスト test_deletion_vc_guidance_exit_semantics.py を追加しました。2 件で、文書の静的検査と、実 baseline_vc_preflight.py を real subprocess として呼び出す分類観測を行います。fixture の literal は dash 始まりの --DELETION_TARGET_LITERAL_2943 で、-- separator により option parse error にならないことも固定しています(mock / fake / 手書き classifier は使っていません)。
  • 実行環境の契約(P2): uv / pytest / rg / git が利用できない場合、テストは SKIP / PASS ではなく assertion failure(hard FAIL)になります。exit 77 のための wrapper / adapter は追加していません。
  • 削除確認以外の正の件数確認 rg -c "# AC[0-9]" issue_body.md(body-authoring.md の別箇所)は変更していません。baseline_vc_preflight.py と review checker の論理も変更していません。

受け入れ条件の達成状況

  • AC1: test_replacement_command_classified_by_real_baseline_vc_preflight が PASS。baseline fixture(literal あり)で exit_code: 1 / expected_fail / expected_baseline_fail(dash 始まり literal でも option parse error なし)、current-head fixture(literal なし)で exit_code: 0 / expected_pass / expected_pass_resolved_on_current_head を実 subprocess の出力から観測(下記ログ参照)。SKIP・mock・fallback は使用していません
  • AC2: test_guidance_deletion_section_has_canonical_single_file_absence_form が PASS。両文書の削除確認 section に -c / --count、-q / --quiet、! 否定検索の例が無く、path operand が 1 つの canonical 置換形が存在
  • AC3: SKILL.md に rg -c "削除対象 形の削除確認例が残っていない(rg --files-without-match が exit 0)
  • AC4: references/body-authoring.md に同形の例が残っていない(exit 0)
  • AC5: references/body-authoring.md に canonical 置換形が記載されている(exit 0)
  • AC6: SKILL.md に canonical 置換形が記載されている(exit 0)
  • AC7: test_verify_vc_single_command_guardrail_docs.py が 16 件 PASS

検証コマンド結果

Runtime Verification(decision: immediate、AC1)の実行ログ抜粋です。uv run pytest ...test_deletion_vc_guidance_exit_semantics.py -v -s の出力で、baseline の expected_fail と current-head の expected_pass_resolved_on_current_head を実 baseline_vc_preflight.py から観測しています。

$ uv run pytest .claude/skills/create-issue/tests/test_deletion_vc_guidance_exit_semantics.py -v -s
[#2943 runtime observation] baseline new_form exit_code=1 classification=expected_fail category=expected_baseline_fail
[#2943 runtime observation] no-separator form (dash-leading literal) rg exit_code=2 stderr='rg: unrecognized flag --DELETION_TARGET_LITERAL_2943'
[#2943 runtime observation] baseline old_form(rg -c) literal_present exit_code=0 classification=unexpected_pass
[#2943 runtime observation] current-head new_form exit_code=0 classification=expected_pass category=expected_pass_resolved_on_current_head process_rc=0
[#2943 runtime observation] baseline old_form(rg -c) literal_absent exit_code=1 classification=expected_fail
2 passed

$ rg --files-without-match --fixed-strings -- 'rg -c "削除対象' .claude/skills/create-issue/SKILL.md                       -> exit 0
$ rg --files-without-match --fixed-strings -- 'rg -c "削除対象' .claude/skills/create-issue/references/body-authoring.md  -> exit 0
$ rg -q -F -e 'rg --files-without-match --fixed-strings -- "<literal>" <file>' references/body-authoring.md               -> exit 0
$ rg -q -F -e 'rg --files-without-match --fixed-strings -- "<literal>" <file>' SKILL.md                                    -> exit 0
$ uv run pytest .claude/skills/create-issue/tests/test_verify_vc_single_command_guardrail_docs.py                       -> 16 passed
$ uv run pytest .claude/skills/create-issue/tests/                                                                      -> 288 passed

対照として、-- なしの形は dash 始まり literal で rg exit 2(unrecognized flag)になること、旧形 rg -c は literal が存在する間は exit 0(unexpected pass)、除去後は exit 1 となり成否が逆転することも実 runner で確認しています。

Allowed Paths 遵守

  • 変更ファイル: .claude/skills/create-issue/SKILL.md、.claude/skills/create-issue/references/body-authoring.md、.claude/skills/create-issue/tests/test_deletion_vc_guidance_exit_semantics.py
  • Allowed Paths 逸脱: なし
  • .github/ci/python-test-plan.json は .claude/skills/create-issue/tests/ を収集済みのため、登録の変更は不要です。

Checks

  • 前回 head(947d25c6)で pnpm typecheck / pnpm lint / pnpm test(108 files / 1943 tests PASS)/ pnpm build は成功済みです。今回の fix_delta は文書 2 件と Python テスト 1 件のみで TS は未変更のため、pnpm は再実行していません。
  • 今回 head で uv run ruff check / uv run ruff format --check(変更テスト)が成功しました。
  • 上記に加え、uv run pytest .claude/skills/gemini-cli-headless-delegation/tests/test_model_routing.py(24 passed)、validate_japanese_content.py --threshold 0.1(変更した 2 文書)、verify_vc_single_command_guardrail_docs.py --strict も成功しました。

Schema Change Applicability

  • decision: not_schema_change
  • reason: 文書の例示コマンドの是正と回帰テストの追加のみで、machine-readable contract の key 集合・型・schema は変更していません。

Schema Consumer Inventory

N/A
reason: 変更対象 schema はありません。

Safety Claim Matrix

Claim Implemented? Not controlled Evidence Follow-up
削除確認 VC の guidance が exit 0 成功の absence 形になり、実 baseline_vc_preflight で baseline は expected_fail、current-head は expected_pass_resolved_on_current_head に分類される yes none test_replacement_command_classified_by_real_baseline_vc_preflight PASS(上記ログ) N/A
安全境界・権限・sandbox・transport・workflow gate には触れない(VC authoring guidance の例示のみの変更) yes none 変更ファイルは文書 2 件とテスト 1 件のみ N/A

Notes

…#2943)

rg -c は no-match で exit 1 を返すため、0 件を成功とする削除確認 guidance は
成否が逆転していた。1 command = 1 file の absence 形へ置換し、実
baseline_vc_preflight で分類を観測する regression test を追加する。

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

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Preview URL

✅ verified live assets: https://squne121.github.io/loop-protocol/pr-2947/

The preview will be removed when this PR is closed.

@squne121

squne121 commented Oct 5, 2026

Copy link
Copy Markdown
Owner Author

PR レビュー結果: APPROVE(iteration 0)

PR #2947 の現在の head に対する pr-reviewer の判定と、control-plane による独立確認の結果です。

判定

  • 判定: APPROVE
  • レビュー対象 head: 947d25c
  • blockers: なし
  • warnings: Allowed Paths を専用 gate で再計算せず変更 3 ファイルを手動照合した点と、AC1 の旧形対照で literal 不在側の classification を assert していない点(いずれも非 blocker)

根拠

  • AC1 は実 baseline_vc_preflight.py を subprocess で呼び、baseline は expected_fail / expected_baseline_fail、current-head は expected_pass / expected_pass_resolved_on_current_head を観測した。mock や SKIP による成功はない。
  • AC2 は docs を変異させた複製で fail することを reviewer が確認し、空洞化していないことを確認済み。
  • AC1 から AC7 は control-plane が worktree で独立に再実行し、すべて exit 0 だった。
  • 必須 CI は現在の head ですべて success。以前の python-test failure は、PR 本文更新で cancel された旧 run に起因する stale なものだった。
  • step4-adjudicate は nonblocking、step5-terminal-gate は route approved で exit 0。
  • live mergeability は MERGEABLE / CLEAN(Draft のまま)。

状態

merge は実行していない。auto-merge も有効化していない。人間の merge 判断待ち。

verdict: APPROVE
reviewed_head_sha: 947d25c66eca445ca18e872d04d2962dc6244d8b
blockers: []
warnings:
  - allowed_paths_gate_not_recomputed_manual_match
  - ac1_old_form_contrast_absent_side_classification_not_asserted

@squne121

squne121 commented Oct 5, 2026

Copy link
Copy Markdown
Owner Author

Findings

  1. [P1 / Blocker] canonical な削除確認コマンドが、- で始まる literal を扱えません。

    PR docs: 削除確認 VC の guidance を exit 0 成功の rg --files-without-match 形へ是正する (#2943) #2947 は SKILL.md と body-authoring.md の正本を次に変更しています。

    rg --files-without-match --fixed-strings "<literal>" <file>

    しかし ripgrep では、positional pattern が - で始まると option として解釈されます。--fixed-strings を付けてもこれは変わりません。upstream maintainer も、dash-leading pattern には -e/--regexp または -- separator が必要と明記しています。これは特に --settings、--foo のような CLI option 名そのものを削除対象にするケースで現実的に踏みます。[GitHub](https://github.com/BurntSushi/ripgrep/discussions/1560?utm_source=chatgpt.com)

    今回追加された regression test は LITERAL = "DELETION_TARGET_LITERAL_2943" だけなので、この failure class を通りません。そのため current CI が全 green でも、canonical guidance の一般性については false-negative です。

    repository 側には追加 harness は不要です。baseline_vc_preflight.py::_rg_extract_path_operands() は既に -e/--regexp と -- separator の両方を処理でき、実装: VC preflight の rg path operand 抽出が長形式の真偽 flag を PATH と誤認し VCP_BROAD_SEARCH_PATH_UN を誤発する欠陥を是正する #2900 / PR fix: VC preflight の rg path 抽出が長形式 boolean flag を PATH と誤認する欠陥を是正する #2904 で --files-without-match / --fixed-strings も対応済みです。

    最小修正としては、1 token 足すだけの次の形を推奨します。

    rg --files-without-match --fixed-strings -- "<literal>" <file>

    -- 以降の最初の positional が pattern、次が path になるので、literal だけでなく dash-leading path にも自然に対応します。-e "<literal>" <file> でも解消できます。

    さらに real baseline_vc_preflight.py test の literal を、たとえば --DELETION_TARGET_LITERAL_2943 にして、

    • baseline: literal あり → exit 1 / expected_fail
    • current-head: literal なし → exit 0 / expected_pass_resolved_on_current_head

    を固定すべきです。

    これは実装だけの問題ではありません。[Issue #2943](https://github.com/squne121/loop-protocol/issues/2943?utm_source=chatgpt.com) の AC5/AC6 と In Scope 自体が現在の exact canonical form を指定しているため、Issue contract → docs 2 箇所 → regression test を同時に狭く修正するのが整合的です。

  2. [P2 / contract drift] tool 不在時の挙動が Issue の Runtime Verification 契約と一致していません。

    実装: 削除確認 VC の authoring guidance が rg -c を成功条件 0 件の形で規定しており、no-match の exit 1 で成否が逆転するため guidance を exit 0 成功の negative assertion へ是正する #2943 は uv / pytest / rg / git が利用不能なら exit 77 の SKIP として Stop Condition に上げ、PASS 扱いしないとしています。一方、新規 test の _require_tools() は rg / git 不在時に assert failure にしており、pytest は通常の failure になります。PR の test docstring も「SKIP にせず FAIL」と明示していて、これは偶然ではなく実装方針の差です。

    false-green にはならないため P1 より低いですが、PR が「AC1 達成」とするなら契約差は解消した方がよいです。実 runtime policy 上 FAIL の方を採りたいなら、複雑な exit-77 wrapper を追加するより 実装: 削除確認 VC の authoring guidance が rg -c を成功条件 0 件の形で規定しており、no-match の exit 1 で成否が逆転するため guidance を exit 0 成功の negative assertion へ是正する #2943 の skip contract を実装に合わせて修正する方がこの個人開発には適しています。

判定

REQUEST_CHANGES が妥当です。

確認時点の対象は [PR #2947](https://github.com/squne121/loop-protocol/pull/2947?utm_source=chatgpt.com)、exact HEAD は 947d25c66eca445ca18e872d04d2962dc6244d8b。main は PR base と同じ 9a0f24aeac58a864bb538787bea9f67fdd00f83f で、main drift はありません。latest CI、python-test、typecheck、lint、test、build は success、PR は Draft / mergeable です。

既存の iteration 0 コメントは APPROVE としていますが、dash-leading literal のケースを test fixture が持っていないため、この finding はそこで検出されていません。[既存 APPROVE コメント](#2947)

一方、基本方針は正しいです。rg -c を捨てること、negated ! rg を canonical にしないこと、1 command = 1 concrete file に限定すること、-q を付けないことには賛成です。特に ripgrep 14.1.0 の -q --files-without-match は exit status が反転する既知 bug で、15.0.0 で upstream 修正されています。[GitHub](https://github.com/BurntSushi/ripgrep/issues/3108?utm_source=chatgpt.com)

修正範囲

P1 は別 Issue や新 checker に分離せず、この PR で直すのが最小です。必要なのは #2943 の canonical form、2 文書、focused regression test の更新だけです。[#2900 / parser ownership](https://github.com/squne121/loop-protocol/issues/2900?utm_source=chatgpt.com) と [PR #2904](https://github.com/squne121/loop-protocol/pull/2904?utm_source=chatgpt.com) の既存実装をそのまま再利用できます。

#46 の literal inventory、#397 の review warning robustness は別 failure class なので、この修正に巻き込む必要はありません。セキュリティ gate、wrapper、approval layer の追加も不要です。

@squne121

squne121 commented Oct 5, 2026

Copy link
Copy Markdown
Owner Author

推奨アクションは、#2947 を新規作成し直さず再利用し、まず #2943 の narrow contract drift を canonical workflow で修正してから、同じ PR/worktree/branch を current impl-review-loop へ戻すことです。対象コメントは top-level PR conversation comment で、current build_intake_capsule.py は closing PR 上の #issuecomment-... を human_context_comment_url として扱える実装です。upstream ripgrep でも dash-leading pattern には -e/--regexp または -- が必要と明記されており、P1 は実 defect です。[GitHub](https://github.com/BurntSushi/ripgrep/discussions/1560?utm_source=chatgpt.com) -q --files-without-match の既知問題も upstream で確認できます。[GitHub](https://github.com/BurntSushi/ripgrep/issues/3108?utm_source=chatgpt.com)

添付 transcript では、対象コメントが付く前の #2947 は head 947d25c... で terminal gate approved、merge 直前まで到達していました。したがって、以前の APPROVE を再利用して終了するのではなく、新しい REQUEST_CHANGES context によりその証拠を stale 扱いし、fresh verification/review を取り直すのが妥当です。貼り付けたテキスト(1)

以下を、そのまま既に auto mode で起動している fresh interactive Claude Code に貼り付けてください。

repo=squne121/loop-protocol

対象:

この 既に auto mode で起動している fresh interactive Claude Code セッションをそのまま継続してください。新しい Claude Code session を起動し直さないでください。

目的は、対象コメント #issuecomment-5995255600 の REQUEST_CHANGES を current repository contract に従って解消し、既存 PR #2947 を 人間が merge 判断できる直前まで再度 impl-review-loop で仕上げることです。

今回は既存 PR / branch / worktree があるため、重複 PR・重複 branch・重複 worktree を作らないでください。current repository-native landing disposition / recovery contract を使って既存 #2947 を resume してください。

この invocation では、通常の investigation / Issue contract repair / implementation / verification / review / repair について iteration ごとの人間承認は不要です。以下を明示的に承認します。

ただし、これは permission bypass の承認ではありません。

bypassPermissions、--dangerously-skip-permissions、permission mode の変更は要求しないでください。force push、history rewrite、secret / credential の取得・変更・公開、他 task の branch/worktree の変更・削除、不可逆 cleanup は行わないでください。

PR は merge しないでください。auto-merge も有効化しないでください。Issue #2943 も手動 close しないでください。

0. まず current authority を fresh に取得する

過去 transcript、前回の APPROVE コメント、下記の観測 SHA を current fact として固定しないでください。

canonical main root から少なくとも次を fresh に取得してください。

  1. origin/main / default branch の current HEAD
  2. PR docs: 削除確認 VC の guidance を exit 0 成功の rg --files-without-match 形へ是正する (#2943) #2947 の:
    • state / draft
    • exact head SHA / branch / base
    • mergeable / mergeStateStatus
    • changed files
    • closing Issue
    • PR body
    • conversation comments
    • review threads / submitted reviews
    • current-head CI / checks
  3. Issue 実装: 削除確認 VC の authoring guidance が rg -c を成功条件 0 件の形で規定しており、no-match の exit 1 で成否が逆転するため guidance を exit 0 成功の negative assertion へ是正する #2943 の current body / comments / body SHA256
  4. 対象コメント 5995255600 の live body と author / association / timestamp
  5. 前回 APPROVE コメント 5994756238
  6. current:
    • .claude/skills/impl-review-loop/SKILL.md
    • steps/preparation.md
    • steps/step-1-implementation.md
    • steps/step-2-verification.md
    • steps/step-4-pr-review.md
    • steps/step-5-feedback-and-termination.md
    • steps/step-5-mergeability-handling.md
    • relevant context/guardrail docs
  7. current relevant agent definitions:
    • implementation-worker
    • test-runner
    • pr-reviewer
    • contract repair に必要なら issue-refinement-loop 側 agent / Skill
  8. target defect に関係する repository implementation:
  9. 実装: Issue VC 設計改善: 「削除確認 VC は削除対象 literal を列挙する」原則を body-authoring.md に追記し review-issue の non-blocking warning check に反映する #46 / 改善: review-issue checker の vc_negative_grep_without_literal_inventory を inventory marker 強化と negative grep pattern 拡張で堅牢化する #397 は関連 ownership 確認だけ行い、今回の scope に混ぜない

確認開始時点では、外部観測として PR head は
947d25c66eca445ca18e872d04d2962dc6244d8b
、main は
9a0f24aeac58a864bb538787bea9f67fdd00f83f
だったが、必ず fresh readback してください。

1. 対象コメントを human context として canonical intake に束縛する

今回の URL:

https://github.com/squne121/loop-protocol/pull/2947#issuecomment-5995255600

は human_context_comment_url として扱ってください。agent report lane に入れないでください。

current build_intake_capsule.py の実装を確認し、top-level PR conversation #issuecomment-... が、PR #2947 が #2943 を closing Issue として持つ場合に target Issue context として exact-bind できる current contract を使ってください。

raw human comment を implementation-worker の command として直接連結しないでください。root/main thread が repository fact・実 diff・実 test・upstream spec と照合して technical_recommendation に正規化し、comment ID / capsule artifact を evidence reference として child に渡してください。

2. 最初に #2943 の contract drift を解消する

今回の P1 は repository file だけを直すと current Issue contract と矛盾します。

live #2943 がまだ exact canonical form:

rg --files-without-match --fixed-strings "<literal>" <file>

を AC5 / AC6 / In Scope / Outcome / Verification Commands 等で固定している場合、PR branch を先に変更しないでください。

current repository-native issue-refinement-loop / controlled Issue edit path を使って、対象コメントを trusted human context とした narrow contract repair を先に完了してください。

raw gh issue edit を思いつきで直接叩くのではなく、current canonical Issue mutation workflow を使ってください。

この contract repair について、次の方向を明示的に承認します。

P1 contract delta

canonical deletion VC を:

rg --files-without-match --fixed-strings -- "<literal>" <file>

へ変更する。

-- は option parsing の終端として使い、- で始まる literal(例 --settings / --foo)を pattern として正しく扱えることを contract に含める。

少なくとも次の contract surface を current Issue 内で一貫させること:

  • Goal / Desired Destination で exact form に依存している記述
  • Current Validated Scope
  • Outcome
  • In Scope
  • Runtime Verification の relevant text
  • AC1 / AC2 / AC5 / AC6 のうち canonical exact form に依存する箇所
  • Verification Commands の AC5 / AC6
  • その他同じ exact form を normative に固定している箇所

Allowed Paths は現状の 3 件のままで足りるはずなので、根拠なく拡張しないでください。

P1 regression requirement

real baseline_vc_preflight.py test では dash-leading literal を実際に使ってください。例:

--DELETION_TARGET_LITERAL_2943

少なくとも次を real subprocess で固定すること:

  • baseline / literal present:
    • command が option parse error にならない
    • exit 1
    • expected_fail
    • expected_baseline_fail
  • current-head / literal absent:
    • exit 0
    • expected_pass
    • expected_pass_resolved_on_current_head

mock / fake / hand-written classifier では代替しないでください。

P2 contract drift

live #2943 の Runtime Verification が「uv / pytest / rg / git 不在なら exit 77 SKIP」と規定している一方、current test implementation が missing tool を hard FAIL にしている差を解消してください。

個人趣味開発として余計な wrapper / harness を足さないことを優先します。

current repository の runtime policy が hard FAIL / Stop を許すなら、Issue contract を current implementation の hard FAIL semantics に狭く合わせることを優先してください。exit 77 を作るためだけの新 wrapper や adapter は追加しないでください。

ただし current canonical policy が exit 77 を必須としていることを live repository から確認した場合は、それを勝手に上書きせず current policy に従って最小修正を選んでください。

いずれにせよ:

  • tool absence を PASS にしない
  • fallback-only success を PASS にしない
  • evidence が得られないのに AC1 達成扱いにしない

ことは維持してください。

contract repair 後は fresh Issue body を readback し、body SHA を取り直し、current canonical review / readiness が通ることを確認してください。

もし current deterministic workflow が、この narrow repair に対して genuine human_judgment_required を返す場合だけ停止してください。通常の deterministic repair / review iteration は人間承認待ちにしないでください。

3. contract repair 後に Root-Owned Synchronous Entry Transition を fresh に通す

#2943 の body が更新された後は、前回の root-entry result や contract snapshot を再利用しないでください。

current impl-review-loop 自身の Root-Owned Synchronous Entry Transition を、この invocation で fresh に実行してください。

body update により body SHA が変わるため:

  • old contract snapshot
  • old VC adjudication
  • old test-runner report
  • old reviewer approval
  • old terminal approval

を current authorization / current-head evidence として使わないでください。

4. existing PR resume を優先する

PR #2947、branch worktree-issue-2943-deletion-vc-guidance、既存 linked worktree が current live state で有効なら必ず再利用してください。

build_intake_capsule.py / landing disposition producer を current contract どおり使い、期待値としては existing_pr_resume を検討してください。

ただし enum / route を prose から決め打ちせず canonical producer の結果を使ってください。

reconciliation_required 等が出た場合は current runbook に従って freshness / identity を解消し、duplicate PR を作ることで回避しないでください。

5. REQUEST_CHANGES を fix_delta として Step 1 に戻す

対象コメントを repository fact / upstream spec と照合した root-normalized technical recommendation として worker に渡してください。

今回の最小 implementation delta は基本的に次です。

docs

.claude/skills/create-issue/SKILL.md

と

.claude/skills/create-issue/references/body-authoring.md

の canonical form を:

rg --files-without-match --fixed-strings -- "<literal>" <file>

へ更新する。

既存の以下の方針は維持すること:

  • rg -c / --count を zero-count success の削除確認に使わない
  • ! rg / ! grep を canonical deletion VC にしない
  • 1 command = 1 concrete file
  • -q / --quiet を併用しない
  • 削除確認以外の正の件数確認 rg -c は変更しない

focused test

.claude/skills/create-issue/tests/test_deletion_vc_guidance_exit_semantics.py

を更新し:

  • canonical docs command が -- separator を含むこと
  • dash-leading literal を real runner で使うこと
  • old command without separator が dash-leading literal で失敗する failure class を必要なら negative control として観測すること
  • baseline/current-head classification を real baseline_vc_preflight.py subprocess で確認すること
  • no mock / fake classifier
  • section-scoped -c / --count, -q, negated search guard は維持
  • path operand が 1 concrete file である guard は維持

してください。

checker / baseline_vc_preflight.py 自体は、current parser がすでに -- / -e / --files-without-match / --fixed-strings を正しく扱えることを確認できる限り変更しないでください。

追加 checker、wrapper、approval layer は作らないでください。

PR body

修正後、PR body が旧 canonical form・旧 AC・旧 runtime evidence を成功状態として記述したままにならないよう current implementation と fresh evidence に更新してください。

PR body mutation は current canonical wrapper / open-pr contract を使ってください。

6. SubAgent の完了確認を厳密に行う

SubAgent は dispatch した時点では完了ではありません。

implementation-worker / test-runner / pr-reviewer について、current Common Completion Protocol を守り:

  1. canonical task name を保持
  2. mailbox activity / timeout を success とみなさない
  3. final structured result を実際に取得
  4. list_agents 等 current harness が定める手段で terminal completed を確認
  5. final result と terminal completed の両方が揃った後だけ downstream へ進む

ようにしてください。

errored / interrupted / shutdown / not_found は成功扱いしないでください。

7. Step 2 verification を updated Issue contract から fresh に組み立てる

Issue body が contract repair で変更されるため、Verification Commands metadata は live body から fresh に抽出してください。

current extract-vc-metadata 等 canonical parse-only path を使い、全 command の:

  • ac
  • literal raw_command
  • command_hash

triplet を updated Issue contract から取得してください。

test-runner にはこれらを逐語で渡してください。旧 body の command hash を再利用しないでください。

current PR head で、Issue に記載された全 Verification Commands を実行してください。

最低限 P1 regression について:

  • dash-leading literal が baseline で expected_fail
  • current-head で expected_pass_resolved_on_current_head
  • process / rg option parse error にならない

ことを fresh evidence で確認してください。

P2 についても updated contract と test behavior が一致していることを確認してください。

test-runner の self-report だけで終わらず、current Skill が要求する adjudication / head-body-command binding を通してください。

8. CI は current HEAD に束縛する

修正 commit を push した後、required CI を current PR head に対して待ってください。

過去 head や PR body 更新で cancel された stale run の failure を current failure と混同しないでください。

failed / cancelled の場合は current wait_ci_checks.sh / failed-log path 等の repository-native procedure に従って原因を確認してください。

通常の修正可能 CI failure は停止理由にせず、Allowed Paths 内で直せるなら修正 → push → verification → CI を反復してください。

9. Step 4 は fresh pr-reviewer を必ず起動する

今回の target comment は前回 APPROVE の後に追加された新しい blocker です。

したがって前回の:
https://github.com/squne121/loop-protocol/pull/2947#issuecomment-5994756238

を final review として再利用してはいけません。

updated body + updated PR head + updated command hashes + fresh test-runner result について current step4-adjudicate gate を通し、許可された場合だけ fresh pr-reviewer を起動してください。

pr-reviewer には少なくとも:

を明示的に渡してください。

reviewer は P1 の dash-leading literal case が実際に固定されたか、P2 contract drift が消えたかを敵対的に確認してください。

pr-reviewer の final result + terminal completed を待ってください。

REQUEST_CHANGES が返ったら、通常 blocker なら人間へ戻さず:
fix_delta → implementation-worker repair → test → CI → fresh gate → fresh reviewer
を current max iteration 内で継続してください。

10. reviewer verdict の publish と stale-head handling

pr-reviewer は GitHub mutation authority を持たない current contract に従ってください。

reviewer の verdict は control-plane が current canonical comment path で投稿してください。

投稿前後で PR head を fresh に readback し、head が変わっていれば stale verdict として current Skill の stale-head re-review route を使ってください。

旧 APPROVE コメントは削除・改変する必要はありません。今回の fresh verdict により history 上 supersede してください。

11. Step 5 terminal gate まで完遂する

fresh reviewer が APPROVE でも、それだけで merge-ready と判定しないでください。

current step5-terminal-gate を使い、同一 live read の:

  • current head SHA
  • mergeable
  • mergeStateStatus

を current VC binding / dispatch seq / reviewer verdict と照合してください。

BEHIND なら current canonical update_branch route を使い、head 更新後に verification + review をやり直してください。

actual conflict なら current conflicting runbook に従ってください。

通常の BLOCKED / pending check / stale evidence は直ちに human escalation へ落とさず、current routing contract に従ってください。

terminal approval は current step5-terminal-gate exit 0 / route approved のみを根拠にしてください。

終了時は current contract の:

IMPL_REVIEW_LOOP_RESULT_V1.status: draft_pr_ready

相当の terminal state まで到達してください。

merge は行わず停止してください。auto-merge も禁止です。

12. 再発防止 follow-up Issue

今回の P1 自体は #2943 / PR #2947 内で修正してください。P1 を別 Issue に逃がさないでください。

#46 の literal inventory と #397 の warning robustness は別 ownership なので、この PR に混ぜないでください。

修正・再レビュー中に、今回の scope 外で 具体的な recurrence defect を新たに観測した場合のみ follow-up Issue を検討してください。

その場合は:

  1. open / closed Issue を dedupe 検索
  2. exact ownership が既存 Issue にあるなら新規作成せず reuse
  3. 既存 ownership がなく、実 failure class と再現/evidence があるなら current repository-native issue creation path で GitHub Issue を実際に起票
  4. speculative hardening、一般 security 論、追加 approval layer だけを理由に起票しない
  5. current fix をその follow-up にブロックさせない

ようにしてください。

起票した場合は final report に URL と dedupe 根拠を含めてください。

13. 停止境界

次だけを genuine escalation / stop 候補にしてください。

  • destructive operation が必要
  • secret / credential operation が必要
  • force push / history rewrite が必要
  • current repository contract の genuine human_judgment_required
  • authority の irreconcilable conflict
  • Allowed Paths 外の implementation file 変更が不可避で current contract repair でも解消不能
  • evidence integrity を維持できない
  • actual Git conflict を current runbook で解消不能
  • canonical max iteration 到達
  • permission boundary の迂回が必要
  • current user / OWNER の新しい explicit stop

次だけを理由に停止しないでください。

  • ordinary test failure
  • 今回の REQUEST_CHANGES
  • stale HEAD
  • stale body / stale command hashes
  • BEHIND
  • 修正可能な CI failure
  • advisory artifact missing/stale
  • SubAgent の boolean human_review_required: true 自己申告だけ
  • 前回 APPROVE と今回 REQUEST_CHANGES が履歴上両方存在すること

exact routing は current repository-native Skill / deterministic scripts を authority にしてください。

14. 最終報告

main/root thread から最低限次を報告してください。

調査や提案だけで止まらず、

fresh inspect → target comment intake → narrow Issue contract reconciliation → fresh root entry → existing PR resume → repair → independent verification → current-head CI → adversarial fresh PR review → fix/re-test/re-review as needed → terminal gate → recurrence follow-up materialization → merge直前で停止

まで完遂してください。

この prompt では、対象コメントが要求する Issue contract 自体の修正を PR repair より先に置く点が重要です。現在の #2943 の AC5/AC6 のまま -- を追加すると、実装を正しく直した結果として VC が失敗するためです。

Test and others added 2 commits October 5, 2026 22:27
…にする (#2943)

ripgrep は --fixed-strings を付けても dash 始まりの pattern を option と解釈するため、
canonical 形を `rg --files-without-match --fixed-strings -- "<literal>" <file>` に更新した。

- SKILL.md / body-authoring.md の削除確認パターンを -- 付きの形へ更新し、説明を追加
- regression test で -- separator の存在を検査し、dash 始まり literal
  (--DELETION_TARGET_LITERAL_2943) を実 baseline_vc_preflight で分類する
- -- なしの形が rg exit 2 (option parse error) になる対照を追加
- tool 不在は hard FAIL とする契約を test docstring に明記(exit 77 wrapper は追加しない)

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@squne121

squne121 commented Oct 5, 2026

Copy link
Copy Markdown
Owner Author

PR レビュー結果(iteration 1 / fresh review)

判定: APPROVE(head 56233a0259661c13ca239c285f159053e68b1204)

この判定は OWNER の REQUEST_CHANGES(https://github.com/squne121/loop-protocol/pull/2947#issuecomment-5995255600)より新しい fresh review であり、これより古い APPROVE(https://github.com/squne121/loop-protocol/pull/2947#issuecomment-5994756238、head 947d25c6)は superseded として再利用していません。

Mergeability

  • head 56233a02(update_branch 後)、mergeStateStatus: CLEAN、required CI は current head で全 success。

Evidence Check

Blockers

  • なし

Non-blockers

  • PR は Draft のまま(merge 判断は人間)。
  • -- なし形の negative control は rg を直接実行している(real preflight 側の assertion は mutation で fail することを確認済み)。
  • pnpm 系ゲートは前 head の結果で、current head の required CI は全 success。
verdict: APPROVE
reviewed_head_sha: 56233a0259661c13ca239c285f159053e68b1204
blockers: []
warnings:
  - "PR は Draft のまま。merge 判断は人間に残す"
  - "no-separator 形の negative control は rg を直接実行している"

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

Labels

None yet

Projects

None yet

1 participant