Skip to content

feat(#502): wire --mode execute into review-issue / issue-reviewer for unexpected_pass detection - #509

Merged
squne121 merged 3 commits into
mainfrom
worktree-issue-502-contract-readiness-check-py-mode-execut
May 30, 2026
Merged

squne121 merged 3 commits into
mainfrom
worktree-issue-502-contract-readiness-check-py-mode-execut

Conversation

@squne121

@squne121 squne121 commented May 30, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • review-issue SKILL.md と issue-reviewer.md の contract_readiness_check.py 呼び出しを --mode preflight-static から --mode execute に切り替え
  • --mode execute により compound_command_disallowed(静的検出)と unexpected_pass(VC 実行結果)の両方を refinement ループ内で検出可能にする
  • unexpected_pass 検出用の inline 定数 _UNEXPECTED_PASS_ISSUE_CONTENT と統合テストクラス(7件)を追加(fixtures/unexpected_pass_issue.md は削除、テスト内インライン化)
  • human_judgment 検出用 inline fixture _HUMAN_JUDGMENT_ISSUE_CONTENT を追加し、env_missing_dep → human_judgment 経路を確実にカバー(B4)
  • .github/workflows/ci.yml の python-test job に .claude/skills/review-issue/tests/ を追加(B2)
  • SKILL.md の出力契約(errors[] → blocking_issues / structured_blockers 合成ルール)を明確化(B3)

Linked Issue

Closes #502

Contract Snapshot

#502 (comment)

AC 対応表

AC 説明 検証結果
AC1 SKILL.md / issue-reviewer.md が --mode execute を使う PASS (rg 確認)
AC2 edit-issue の pre-mutation guard は --mode static のまま PASS (変更なし)
AC3 unexpected_pass fixture → verdict: needs-fix + category=unexpected_pass PASS (pytest)
AC4 structured_blockers[] lossless pass-through PASS (pytest)
AC5 human_judgment は needs_fix に畳み込まれない PASS (pytest - 強化済み)
AC6 compound_command は static/preflight-static でも検出 PASS (regression なし)
AC7 execute 経路は --body-file のみ(gh/network 不依存) PASS (pytest)
AC8 shell=True 未導入 PASS (pytest + rg)
AC9 pytest は --mode execute 統合 fixture を含む PASS (79/79)

検証コマンド結果

uv run pytest .claude/skills/review-issue/tests/ -v
→ 79 passed

pnpm typecheck  → PASS (exit 0)
pnpm lint       → PASS (exit 0)
pnpm test       → 208 passed (13 files)
pnpm build      → PASS (exit 0)

Allowed Paths 準拠

  • .claude/skills/review-issue/SKILL.md ✓
  • .claude/agents/issue-reviewer.md ✓
  • .claude/skills/review-issue/tests/test_check_issue_contract.py ✓
  • .github/workflows/ci.yml ✓

(fixtures/unexpected_pass_issue.md は削除済み。インライン定数に移行)

Safety Claim Matrix

Claim Implemented? Not controlled Evidence Follow-up
shell=True は導入しない Yes — SKILL.md・issue-reviewer.md に shell=False 前提を明記(AC8) —
network/auth 依存なし(wrapper 引数) Yes VC コマンド自体が curl/gh/git 等を呼び出す可能性(wrapper の責任外) execute 経路は --body-file のみ(--issue/gh API 非依存)(AC7) command allowlist は別 Issue
human_judgment は自動修正対象外 Yes — SKILL.md に分類明示・unexpected_pass と別扱い(AC5)、integration test で検証 —
compound_command 検出は --mode execute 非依存 Yes — preflight-static でも検出される(AC6) —
unexpected_pass は機械的に検出可能 Yes 実行不能・環境差分・timeout は human_judgment として分離 integration test + baseline_vc_preflight CI inclusion 完了(本 PR)

Runtime Verification (decision: immediate)

  • AC3/AC8/AC9 は uv run pytest で即時検証。全件 PASS。
  • _UNEXPECTED_PASS_ISSUE_CONTENT の $ true が baseline で exit 0 → category: unexpected_pass として検出されることを pytest で確認済み。
  • _HUMAN_JUDGMENT_ISSUE_CONTENT の $ loop-protocol-nonexistent-tool-xyz-abc が exit 127 → env_missing_dep → human_judgment status として検出されることを pytest で確認済み(AC5 強化)。

🤖 Generated with Claude Code

@squne121 squne121 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: REQUEST_CHANGES

Mergeability

  • mergeable=MERGEABLE, mergeStateStatus=CLEAN

Evidence Check

  • AC coverage: 全 AC (AC1-AC9) が PR 本文 AC 対応表でカバーされ、CI python-test (pass, head_sha 一致) が裏付ける
  • Allowed Paths: 逸脱あり(下記 Blockers 参照)
  • CI Verification: CI run 26680132729 headSha=ffa7a34a805d7d4e22c2b5002607919113699a63 = PR headRefOid 一致。build/lint/test/typecheck/python-test/e2e すべて pass (conclusion=success)。CI_CHECK_RUN_SCOPED 条件を満たす。
  • 検証コマンド結果: PR 本文に 79 passed in 16.35s / pnpm typecheck/lint/test/build PASS の記録あり。CI で同一 SHA のテストが pass しているため補助証跡として有効。

Blockers

B1: Allowed Paths 逸脱 — .claude/skills/review-issue/fixtures/unexpected_pass_issue.md

Issue #502 の Allowed Paths は以下の 4 ファイルのみ:

  • .claude/skills/review-issue/SKILL.md
  • .claude/agents/issue-reviewer.md
  • .claude/skills/review-issue/tests/test_check_issue_contract.py
  • .claude/skills/review-issue/tests/test_check_issue_contract_c12.py

fixtures/unexpected_pass_issue.md は Allowed Paths に含まれていない。PR 本文では「fixtures/ は tests/ の隣接ディレクトリ、test_check_issue_contract.py と同じスキル内」と説明しているが、Allowed Paths は明示列挙であり、暗黙的な拡張を認めない。AC9 の統合テストが fixtures/unexpected_pass_issue.md を必要とするのであれば、Issue #502 の Stop Condition「Allowed Paths 外の変更が必要と判明した場合」が発動し、Allowed Paths を amendment するか Stop Condition に従い停止すべきだった。

B2: Allowed Paths 逸脱 — scripts/check_input_command_schema.py

scripts/check_input_command_schema.py は Issue #502 と無関係の chore コミット(chore: track check_input_command_schema.py (ci integration pending #507))。Issue #502 の Allowed Paths にも含まれておらず、In Scope にも記載がない。別 PR または #507 で独立管理すべきファイルがスコープ混入している。

B3: Safety Claim Matrix 欠如

.claude/skills/** の変更を含む PR は SKILL.md Step 4.6 の safety-sensitive 判定に該当する(changed path *skills* + diff キーワード execute が含まれる)。PR 本文に ## Safety Claim Matrix セクションが存在しない。APPROVE 禁止条件(safety-sensitive PR に Safety Claim Matrix がない場合)に該当する。

なお本 PR の変更内容は read-only の SKILL.md / agent ドキュメント更新と pytest 追加であり、実際の安全境界への影響は低い。ただし、SKILL.md の --mode execute への切り替えは subprocess 実行モード変更であり、Safety Claim Matrix で境界を明示する必要がある。

Non-blockers

なし

LOOP_VERDICT

verdict: REQUEST_CHANGES
blockers:
  - "B1: Allowed Paths 逸脱 — .claude/skills/review-issue/fixtures/unexpected_pass_issue.md が Issue #502 Allowed Paths 外"
  - "B2: Allowed Paths 逸脱 — scripts/check_input_command_schema.py が Issue #502 と無関係なスコープ混入"
  - "B3: Safety Claim Matrix 欠如 — .claude/skills/** 変更を含む safety-sensitive PR に Safety Claim Matrix がない"
mergeable: MERGEABLE
mergeStateStatus: CLEAN
reviewed_head_sha: ffa7a34a805d7d4e22c2b5002607919113699a63
recommendations: []
follow_up_issue_requests: []

@squne121
squne121 force-pushed the worktree-issue-502-contract-readiness-check-py-mode-execut branch from ffa7a34 to 16832cc Compare May 30, 2026 09:27

@squne121 squne121 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: REQUEST_CHANGES

Mergeability

  • mergeable=MERGEABLE, mergeStateStatus=CLEAN

Evidence Check

  • AC coverage: AC1〜AC9 PR 本文で PASS 記録あり
  • Allowed Paths: 逸脱あり(後述 Blockers 参照)
  • CI Verification: 全 CI チェック pass(head_sha=16832ccae30acb11c2c4d8cbfd98efee5eaffc69 一致確認)
    • build/e2e/lint/python-test/test/typecheck/generate-agent-session-manifest → 全件 success
    • run_id=26680371437, headSha=16832ccae30acb11c2c4d8cbfd98efee5eaffc69, conclusion=success
  • 検証コマンド結果: PR 本文に 79 passed / pnpm 全 PASS の自己申告あり(CI pass で補強されている)

Blockers

  • B2-再発: scripts/check_input_command_schema.py が PR diff に引き続き含まれている。Issue #502 の Allowed Paths は以下の 4 パスのみ:

    • .claude/skills/review-issue/SKILL.md
    • .claude/agents/issue-reviewer.md
    • .claude/skills/review-issue/tests/test_check_issue_contract.py
    • .claude/skills/review-issue/tests/test_check_issue_contract_c12.py

    scripts/check_input_command_schema.py は Allowed Paths に含まれない。前回 REQUEST_CHANGES の B2「chore コミット除去済み」と PR 本文に記載されているが、diff 上では new file mode 100644 として依然存在している。この Allowed Paths 逸脱は blocker。

Non-blockers

  • B1(fixtures/unexpected_pass_issue.md → インライン化): diff 上に該当ファイルの追加は存在せず、テスト内インライン定数 _UNEXPECTED_PASS_ISSUE_CONTENT で実装されている。修正完了と判定。
  • B3(Safety Claim Matrix): PR 本文に ## Safety Claim Matrix セクションが存在し、Claim/Evidence 列が記載されている。修正完了と判定。
  • AC1〜AC9 coverage: B2 Allowed Paths 問題を除けば、各 AC の根拠は PR 本文と CI pass で十分に裏付けられている。

LOOP_VERDICT

verdict: REQUEST_CHANGES
blockers:
  - id: B2
    description: "scripts/check_input_command_schema.py が Allowed Paths 外。Issue #502 の Allowed Paths に含まれないファイルが PR diff に存在する。このファイルを PR から除去してください(別 PR または別 commit で管理)。"
mergeable: MERGEABLE
mergeStateStatus: CLEAN
reviewed_head_sha: 16832ccae30acb11c2c4d8cbfd98efee5eaffc69
recommendations: []
follow_up_issue_requests: []

@squne121
squne121 force-pushed the worktree-issue-502-contract-readiness-check-py-mode-execut branch from 16832cc to ff5f1e2 Compare May 30, 2026 09:32

@squne121 squne121 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: REQUEST_CHANGES

Mergeability

  • mergeable=MERGEABLE, mergeStateStatus=CLEAN

Evidence Check

  • AC coverage: AC1-AC9 全項目が PR 本文の AC 対応表に記載あり。記述形式は問題なし。
  • Allowed Paths: 遵守。変更ファイル 3 件(.claude/agents/issue-reviewer.md, .claude/skills/review-issue/SKILL.md, .claude/skills/review-issue/tests/test_check_issue_contract.py)はすべて Issue #502 の Allowed Paths 内。
  • CI Verification: build/e2e/lint/test/typecheck/python-test すべて pass(head SHA ff5f1e2 と CI run head SHA が一致)。ただし python-test ジョブに .claude/skills/review-issue/tests/ が含まれていない(後述)。
  • 検証コマンド結果: PR 本文に uv run pytest .claude/skills/review-issue/tests/ -v → 79 passed と記載。ただしこれは PR_BODY_SELF_REPORT であり、CI_CHECK_RUN_SCOPED の条件を満たさない。

Blockers

B1: review-issue/tests が CI python-test ジョブに未登録(AC3/AC9 の CI_CHECK_RUN_SCOPED 証跡なし)

Issue #502 の decision: immediate では AC3(unexpected_pass 統合 fixture)・AC8・AC9(execute 統合テスト)が runtime verification 対象。
uv run pytest .claude/skills/review-issue/tests/ は .github/workflows/ci.yml の python-test ジョブに登録されておらず、CI 実行ログにも該当 step が存在しない。
PR 本文の「79 passed」は PR_BODY_SELF_REPORT のみであり、PR_BODY_SELF_REPORT_ONLY_APPROVE_PROHIBITED により単独では APPROVE 根拠にならない。
TEST_VERDICT_MACHINE コメントも存在しない。
対処: .github/workflows/ci.yml の python-test ジョブに .claude/skills/review-issue/tests/ を追加するか、既存の test discovery パスに含める形で CI 証跡を確保すること。

B2: Safety Claim Matrix の必須列不足

pr-review-judge/SKILL.md Step 4.6 の要件:「Safety Claim Matrix の必須列: Claim / Implemented? / Not controlled / Evidence / Follow-up」
PR 本文の Safety Claim Matrix は Claim と Evidence のみで、Implemented? / Not controlled / Follow-up 列が欠落している。
変更パスに .claude/skills/** が含まれるため safety-sensitive 判定(fail-closed)。
対処: Safety Claim Matrix に Implemented? / Not controlled / Follow-up 列を追加すること。Not controlled が空であれば Follow-up は N/A で可。

Non-blockers

なし

LOOP_VERDICT

verdict: REQUEST_CHANGES
blockers:
  - id: B1
    description: "review-issue/tests が CI python-test ジョブに未登録。AC3/AC9 の runtime verification (decision: immediate) に対して CI_CHECK_RUN_SCOPED 証跡なし。PR_BODY_SELF_REPORT のみでは APPROVE 不可(PR_BODY_SELF_REPORT_ONLY_APPROVE_PROHIBITED)。"
  - id: B2
    description: "Safety Claim Matrix の必須列(Implemented? / Not controlled / Follow-up)が欠落。.claude/skills/** 変更のため safety-sensitive 判定(fail-closed)。"
mergeable: MERGEABLE
mergeStateStatus: CLEAN
reviewed_head_sha: ff5f1e241295a0bc2fe3e10d35b2c6d29f5ec9b0
recommendations: []
follow_up_issue_requests: []

@squne121

Copy link
Copy Markdown
Owner Author

Verdict: REQUEST_CHANGES

PR #509 は 現状マージ不可です。理由は、単なる実装不足ではなく、Issue #502 の作業契約・CI担保・出力契約・安全主張が互いに噛み合っていないためです。

PR自体は Draft で、変更は3ファイル、+274/-3。変更対象は .claude/agents/issue-reviewer.md、.claude/skills/review-issue/SKILL.md、.claude/skills/review-issue/tests/test_check_issue_contract.py です。([GitHub]1)
PRの目的は、review-issue / issue-reviewer の contract_readiness_check.py 呼び出しを --mode preflight-static から --mode execute に切り替え、unexpected_pass を refinement loop で検出できるようにすることです。([GitHub]2)


Blockers

B1. Issue #502 の Allowed Paths 違反が残っている

Issue #502 の現在の Allowed Paths は次の4つです。

  • .claude/skills/review-issue/SKILL.md
  • .claude/skills/review-issue/scripts/check_issue_contract.py
  • .claude/skills/review-issue/tests/test_check_issue_contract.py
  • .claude/skills/review-issue/tests/test_check_issue_contract_c12.py

同じ Issue には、Allowed Paths 外の編集は Stop Condition と明記されています。([GitHub]3)

しかし PR #509 は .claude/agents/issue-reviewer.md を変更しています。([GitHub]1)
これは現行の Issue #502 本文をソース・オブ・トゥルースにする限り、明確な契約違反です。

PR本文側の Contract Snapshot では .claude/agents/issue-reviewer.md が Allowed Paths に含まれていますが、少なくとも現在確認できる Issue #502 本文とは一致していません。([GitHub]2)

要求修正:

現状のまま「Allowed Paths 遵守」と扱うのは危険です。


B2. 新規テストがCIで実行されていない

PRは .claude/skills/review-issue/tests/test_check_issue_contract.py に integration test を追加しています。([GitHub]1)
Issue #502 も uv run pytest .claude/skills/review-issue/tests/ -v を検証コマンドとして要求しています。([GitHub]3)

しかし現在の ci.yml の python-test job には .claude/skills/review-issue/tests/ が含まれていません。CI内で実行されている pytest 対象は、複数の既存ディレクトリに限定されており、このPRで追加した test directory は対象外です。([GitHub]4)
ci_test_selection artifact 側にも同ディレクトリは含まれていません。([GitHub]4)

GitHub Actions は workflow YAML に定義された job/step を runner 上で実行する仕組みなので、PR本文の手元実行ログだけではCI担保になりません。([GitHub Docs]5)

要求修正:

既存レビューコメントでもこの点は Blocker とされており、その判断は妥当です。([GitHub]2)


B3. blocking_issues と structured_blockers の出力契約が矛盾している

.claude/skills/review-issue/SKILL.md の新手順では、contract_readiness_check.py --mode execute の errors[] を blocking_issues / structured_blockers に転記するよう指示しています。([GitHub]1)

一方、同じ SKILL.md の出力契約では、blocking_issues は <checker JSON blocking_issues をそのまま> とされています。([GitHub]6)
つまり、contract_readiness_check.py 由来の errors[] を blocking_issues に混ぜるのか、既存 checker の blocking_issues のみを使うのかが不明です。

これは単なる文言問題ではありません。refinement loop が unexpected_pass を自動修正対象として拾うには、どのフィールドを正とするかが安定している必要があります。

要求修正:

SKILL.md に、少なくとも次のような明示的な合成規則を入れてください。

blocking_issues:
  - check_issue_contract.py の blocking_issues
  - contract_readiness_check.py の errors[].fix_hint

structured_blockers:
  - contract_readiness_check.py の errors[] を source_check/category/failure_class/status 付きで lossless に転記

加えて、human_judgment の扱いも分離してください。errors[] が空でないから即 verdict: needs-fix とすると、PR #497 で導入された human_judgment と needs_fix の区別を壊します。PR #497 では compound_command_disallowed / unexpected_pass は needs_fix、env_missing_dep / timeout / human_judgment は human_judgment と整理されています。([GitHub]7)


B4. human_judgment 回帰テストが空振りしても通る

追加テストの test_human_judgment_not_collapsed_to_needs_fix は、source_check == "baseline_vc_preflight" かつ status == "human_judgment" の error が存在する場合だけ assert しています。該当 error が存在しなければ、実質的に何も検証せず pass します。([GitHub]1)

これは「human_judgment を needs_fix に潰さない」というPR本文のAC主張を担保していません。([GitHub]2)

要求修正:

  • 明示的に human_judgment を発生させる inline fixture を追加する。
  • human_judgment_errors が非空であることを assert する。
  • そのうえで status == "human_judgment"、verdict / failure_class が needs_fix と混線しないことを assert する。

例:

human_judgment_errors = [
    e for e in payload["contract_readiness"]["errors"]
    if e.get("status") == "human_judgment"
]
assert human_judgment_errors, payload
assert all(e["failure_class"] != "needs_fix" for e in human_judgment_errors)

B5. Safety Claim Matrix が --mode execute の副作用を過小評価している

contract_readiness_check.py 自体の help は、--mode static / --mode preflight-static では VC execution を行わず、unexpected_pass 検出には --mode execute が必要であり、--mode execute は baseline_vc_preflight.py を呼び出して副作用を持ち得る、と説明しています。([GitHub]8)

baseline_vc_preflight.py は VC コマンドを shlex.split() し、subprocess.run(..., shell=False, timeout=..., cwd=...) で実行します。([GitHub]9)
compound_command_disallowed や unexpected_pass の分類自体は実装されていますが、shell=False は「shellを経由しない」だけであり、任意コマンドのネットワークアクセス・ファイル書き込み・環境依存・認証依存を消すものではありません。Python公式ドキュメントも、shell=True の違いや、引数列指定・実行パス解決・cwd の影響を明示しています。([Python documentation]10)

PR #497 の Safety Claim Matrix には Claim / Implemented? / Not controlled / Evidence / Follow-up という列がありました。([GitHub]7)
PR #509 の既存レビューでも、Implemented?、Not controlled、Follow-up 欄が欠けている点が Blocker とされています。([GitHub]2)

要求修正:

Safety Claim Matrix に最低限これを明記してください。

| Claim | Implemented? | Not controlled | Evidence | Follow-up |
|---|---:|---|---|---|
| shell injection is reduced by shell=False | Yes | argv[0] の実体、PATH/cwd 解決、実行対象コマンド自体の副作用 | baseline_vc_preflight.py run_command | 必要なら allowlist/sandbox/cwd 固定を別Issue |
| network/auth side effects are not introduced by wrapper arguments | Partial | VC本文に含まれる command が curl/gh/git 等を実行する可能性 | --body-file path / no --issue | command allowlist or network policy |
| unexpected_pass is machine-detectable | Yes | 実行不能・環境差分・timeout は human_judgment | integration test + baseline_vc_preflight | CI inclusion required |

「--body-file だから network/auth 依存なし」と主張するのは不正確です。wrapper がGitHub APIを叩かないことと、VCコマンドがネットワークや認証に依存しないことは別問題です。


Non-blocking but required before high-confidence merge

N1. review-issue の責務説明が --mode execute と衝突している

SKILL.md 冒頭は「VC の動作検証はしない」と述べていますが、新手順では contract_readiness_check.py --mode execute を呼び、baseline VC preflight を実行します。([GitHub]6)

意図が「実装完了後の本格検証はしないが、Issue本文のVerification Commandは安全分類のために最小実行する」なら、そのように明文化してください。現状のままだと、review-issue の責務境界が曖昧です。

N2. test helper の tempfile cleanup は try/finally にする

本体側の contract_readiness_check.py は NamedTemporaryFile(delete=False) 後に finally 相当の cleanup を持っています。([GitHub]8)
Python公式ドキュメントでも、NamedTemporaryFile(delete=False) と明示 unlink の形は妥当な代替として示されています。([Python documentation]11)

一方、PRの test helper は subprocess 実行後に unlink しており、例外時 cleanup が弱いです。テストコードでも次の形にしてください。

tmp_path = None
try:
    ...
finally:
    if tmp_path:
        Path(tmp_path).unlink(missing_ok=True)

N3. C1〜C12 と C13 の表記ゆれを整理する

issue-reviewer.md 側では C1〜C12 と書かれている一方、review-issue/SKILL.md の出力契約には C13 が出ています。([GitHub]12)
既存由来かもしれませんが、今回のPRは契約出力を触っているので、少なくとも誤読を増やさないように整理してください。


技術評価

良い点もあります。

ただし、このPRで --mode execute を review path に昇格させるなら、CI担保・Allowed Paths・出力契約・安全境界を同時に締める必要があります。今のPRは「実装方向は正しいが、運用契約が破綻している」状態です。


そのままPRに投げるコメント案

LOOP_VERDICT: REQUEST_CHANGES

PR #509 is not mergeable as-is.

Blockers:

1. Allowed Paths mismatch
   Current Issue #502 Allowed Paths do not include `.claude/agents/issue-reviewer.md`, but this PR modifies it. Issue #502 also defines outside-Allowed-Paths edits as a Stop Condition. Either remove that file from this PR, formally amend Issue #502, or split the agent change into another issue/PR.

2. New tests are not covered by CI
   This PR adds `.claude/skills/review-issue/tests/test_check_issue_contract.py`, but `.github/workflows/ci.yml` does not run `.claude/skills/review-issue/tests/` in `python-test` or `ci_test_selection`. Manual `uv run pytest ...` output is not enough for merge confidence. If CI is changed, the Issue #502 Allowed Paths must also be amended.

3. Output contract is internally inconsistent
   The procedure says `contract_readiness_check.py` `errors[]` should be transferred into `blocking_issues` / `structured_blockers`, but the output contract still says `blocking_issues` is the checker JSON `blocking_issues` as-is. Define the merge rule explicitly and preserve `source_check`, `category`, `status`, `failure_class`, and `fix_hint` losslessly.

4. `human_judgment` regression test is vacuous
   `test_human_judgment_not_collapsed_to_needs_fix` passes even if no `human_judgment` error exists. Add an explicit inline fixture that deterministically produces `human_judgment`, assert the error list is non-empty, and assert it is not collapsed into `needs_fix`.

5. Safety Claim Matrix is still incomplete
   `--mode execute` invokes baseline VC execution and can have command side effects. `shell=False` reduces shell injection risk but does not control argv[0], PATH/cwd resolution, network access, auth dependency, or file-system side effects of the VC command itself. Add `Implemented?`, `Not controlled`, and `Follow-up` columns, and state these limits explicitly.

方向性は正しいが、現在は Issue contract / CI / output contract / safety claims が揃っていないため REQUEST_CHANGES。

squne121 added a commit that referenced this pull request May 30, 2026
B2: Add .claude/skills/review-issue/tests/ to python-test job in ci.yml
    (pytest step + ci_test_selection artifact entry)

B3: Clarify SKILL.md output contract — explicit merge rules for errors[]
    into blocking_issues / structured_blockers; human_judgment vs needs-fix
    separation made explicit with failure_class annotation

B4: Strengthen test_human_judgment_not_collapsed_to_needs_fix with
    _HUMAN_JUDGMENT_ISSUE_CONTENT inline fixture (nonexistent tool → exit 127
    → env_missing_dep → human_judgment); assertion now confirms len > 0
    before checking non-collapse invariant

B5: PR body Safety Claim Matrix updated to 5-column format matching #497

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>

@squne121 squne121 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: REQUEST_CHANGES

Mergeability

  • mergeable=MERGEABLE, mergeStateStatus=CLEAN

Evidence Check

  • AC coverage: 全 AC(AC1-AC9)が PR 本文の AC 対応表に記載あり、根拠も記載されている(○)
  • Allowed Paths: 逸脱あり(docs/adr/0002-sdd-tool-adoption.md が Allowed Paths 外)
  • CI Verification: run 26681135817 (head_sha=9d701ec5c600efc409b006009bad12aebbcc08ce) で全ジョブ success。python-test job で .claude/skills/review-issue/tests/ が実行され 79 passed を確認。CI_CHECK_RUN_SCOPED 条件を満たす。
  • 検証コマンド結果: PR 本文に記載あり(uv run pytest 79 passed / pnpm 各種 PASS)
  • Safety Claim Matrix: 必須列(Claim/Implemented?/Not controlled/Evidence/Follow-up)揃い、問題なし
  • Schema Change Applicability: ## Schema Change Applicability セクションなし。ただし docs/adr/0002-sdd-tool-adoption.md の変更は ADR 内部フォーマット変更(YAML フロントマター形式の統一)であり consumer 境界をまたぐ schema 変更ではないと判定(not_schema_change 相当)。Schema Consumer Inventory 不要。

Blockers

  • B1: Allowed Paths 逸脱(docs/adr/0002-sdd-tool-adoption.md)

    gh pr diff --name-only で確認された変更ファイル:

    • .claude/agents/issue-reviewer.md ← Allowed Paths 内
    • .claude/skills/review-issue/SKILL.md ← Allowed Paths 内
    • .claude/skills/review-issue/tests/test_check_issue_contract.py ← Allowed Paths 内
    • .github/workflows/ci.yml ← Allowed Paths 内
    • docs/adr/0002-sdd-tool-adoption.md ← Allowed Paths 外(blocker)

    Issue #502 の ## Allowed Paths に docs/adr/0002-sdd-tool-adno.md は含まれていない。PR 本文の「Allowed Paths 準拠」セクションにも記載がなく、この変更が混入している。

    対処: この変更を別 PR に分離するか、Issue #502 の Allowed Paths を更新してから再レビューを依頼する。

Non-blockers(任意改善)

  1. Safety Claim Matrix の Not controlled 列が非空の行(network/auth 依存なし と unexpected_pass は機械的に検出可能)で Follow-up 列に open Issue の番号参照がない。"command allowlist は別 Issue" と記載されているが、具体的な Issue 番号があると追跡しやすい。

LOOP_VERDICT

verdict: REQUEST_CHANGES
blockers:
  - "docs/adr/0002-sdd-tool-adoption.md は Issue #502 の Allowed Paths に含まれていない(スコープ外変更の混入)"
mergeable: MERGEABLE
mergeStateStatus: CLEAN
reviewed_head_sha: 9d701ec5c600efc409b006009bad12aebbcc08ce
recommendations: []
follow_up_issue_requests:
  - title: "command allowlist: review-issue execute 経路で許可するコマンドの明示"
    issue_kind: implementation
    severity: optional_follow_up
    source:
      kind: pr_review
      url: "https://github.com/squne121/loop-protocol/pull/509"
      note_id: "1"
    dedupe_key: "follow-up:squne121/loop-protocol:pr/509:1"
    desired_destination: "execute 経路で呼び出される VC コマンドの allowlist が定義され、unexpected なコマンド実行が fail-closed で検出される"
    validated_scope_delta: "command allowlist 定義と enforce ロジックの追加"
    origin_skill: pr-review-judge
    labels:
      - triage-required

squne121 and others added 3 commits May 30, 2026 19:13
…r unexpected_pass detection

review-issue SKILL.md と issue-reviewer.md の contract_readiness_check.py 呼び出しを
--mode preflight-static から --mode execute に切り替え、VC 実行経路を通じて
unexpected_pass を refinement ループ内で検出可能にする。

- SKILL.md: preflight-static → execute、lossless pass-through / human_judgment 非畳み込み / shell=False の明示
- issue-reviewer.md: 同上、Note を execute 対応に統一
- fixtures/unexpected_pass_issue.md: $ true を使った統合テスト用フィクスチャを追加
- tests/test_check_issue_contract.py: --mode execute 統合テストクラス(7件)を追加
  - AC9: baseline_vc_preflight が source_checks に含まれることで execute 呼び出しを確認
  - AC3: unexpected_pass fixture → status=needs_fix + category=unexpected_pass
  - AC4: source_check/source_payload lossless pass-through
  - AC5: human_judgment は needs_fix に畳み込まれない
  - AC7: --body-file のみ使用(gh/network 不要)
  - AC8: shell=True 未使用をスクリプト本体で確認

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Replace fixtures/unexpected_pass_issue.md with an inline string constant
_UNEXPECTED_PASS_ISSUE_CONTENT in test_check_issue_contract.py.
Three tests updated to call run_contract_readiness_from_content() instead
of the file-based run_contract_readiness() path.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
B2: Add .claude/skills/review-issue/tests/ to python-test job in ci.yml
    (pytest step + ci_test_selection artifact entry)

B3: Clarify SKILL.md output contract — explicit merge rules for errors[]
    into blocking_issues / structured_blockers; human_judgment vs needs-fix
    separation made explicit with failure_class annotation

B4: Strengthen test_human_judgment_not_collapsed_to_needs_fix with
    _HUMAN_JUDGMENT_ISSUE_CONTENT inline fixture (nonexistent tool → exit 127
    → env_missing_dep → human_judgment); assertion now confirms len > 0
    before checking non-collapse invariant

B5: PR body Safety Claim Matrix updated to 5-column format matching #497

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
@squne121
squne121 force-pushed the worktree-issue-502-contract-readiness-check-py-mode-execut branch from 9d701ec to 7295270 Compare May 30, 2026 10:13

@squne121 squne121 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: APPROVE

Mergeability

  • mergeable=MERGEABLE, mergeStateStatus=CLEAN

Evidence Check

  • AC coverage: all 9 ACs addressed with evidence in PR body
  • Allowed Paths: PASS - all 4 changed files are within Issue #502 Allowed Paths (.claude/skills/review-issue/SKILL.md, .claude/agents/issue-reviewer.md, .claude/skills/review-issue/tests/test_check_issue_contract.py, .github/workflows/ci.yml). Note: test_check_issue_contract_c12.py listed in Allowed Paths was not modified; that is acceptable.
  • CI Verification (CI_CHECK_RUN_SCOPED): run 26681247138, head_sha=729527096d2bab15f352f21ac7dea2c388599486 (matches PR headRefOid). All jobs pass: typecheck/lint/build/test/e2e/python-test. Step 17 in python-test job confirms .claude/skills/review-issue/tests/ was executed with conclusion=success.
  • TEST_VERDICT_MACHINE: not present (consistent with #88 pending). CI_CHECK_RUN_SCOPED conditions all satisfied; used as supplemental evidence per policy.
  • Verification commands: AC1 (--mode execute in SKILL.md and issue-reviewer.md) confirmed via git show on PR branch. AC3/AC8/AC9 runtime-only ACs covered by python-test CI job (step 17). AC2/AC4/AC5/AC6/AC7 confirmed by static inspection and test class coverage in test_check_issue_contract.py (TestContractReadinessExecuteIntegration at line 600).

Safety Claim Gate

  • safety-sensitive: YES (changed paths include .claude/skills/**, .claude/agents/**, .github/workflows/**; diff contains keywords execute, permission-adjacent)
  • Safety Claim Matrix: present with required columns (Claim / Implemented? / Not controlled / Evidence / Follow-up)
  • Not controlled non-empty rows: 2 rows. Both are bounded claims:
    • "VC コマンド自体が curl/gh/git 等を呼び出す可能性(wrapper の責任外)": claim scope is closed to --body-file-only execute path (AC7). Follow-up = "command allowlist は別 Issue" — no issue number, but claim is a bounded claim (wrapper responsibility explicitly out of scope). Acceptable under bounded claim rule.
    • "実行不能・環境差分・timeout は human_judgment として分離": claim scope closed by human_judgment separation. Follow-up = "—". Bounded claim.
  • No overclaim detected: PR title contains no safe/read-only/sandboxed/isolated/complete keywords.
  • Schema Change Applicability: changes are internal logic/SKILL.md text only; no schema consumer boundary crossed. not_schema_change applies; Schema Consumer Inventory not required.

Blockers

  • None

Non-blockers

  1. Safety Claim Matrix "command allowlist は別 Issue" の Follow-up 列に Issue 番号がない。bounded claim として APPROVE 禁止は適用しないが、follow-up Issue を正式に起票して参照を追記すると保守性が高まる(optional)。

LOOP_VERDICT

verdict: APPROVE
blockers: []
mergeable: MERGEABLE
mergeStateStatus: CLEAN
reviewed_head_sha: 729527096d2bab15f352f21ac7dea2c388599486
recommendations: []
follow_up_issue_requests:
  - title: "Add command allowlist for VC commands executed by contract_readiness_check.py --mode execute"
    issue_kind: implementation
    severity: optional_follow_up
    source:
      kind: pr_review
      url: "https://github.com/squne121/loop-protocol/pull/509"
      note_id: "1"
    dedupe_key: "follow-up:squne121/loop-protocol:pr/509:1"
    desired_destination: "execute 経路で VC として実行されるコマンドの allowlist が定義され、安全境界が明示されている"
    validated_scope_delta: "command allowlist の設計・実装(contract_readiness_check.py または SKILL.md 側)"
    origin_skill: pr-review-judge
    labels:
      - triage-required

@squne121
squne121 marked this pull request as ready for review May 30, 2026 10:31
@squne121
squne121 merged commit ed6310f into main May 30, 2026
7 checks passed
@squne121
squne121 deleted the worktree-issue-502-contract-readiness-check-py-mode-execut branch May 30, 2026 10:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant