Repository navigation
feat(#366): add pytest invocation detection and exit 4/5 baseline-fail classification - #372
Conversation
squne121
left a comment
There was a problem hiding this comment.
Verdict: REQUEST_CHANGES
self-authored PR のため --comment で verdict を記録(GitHub 制約)。
Mergeability
- mergeable=MERGEABLE, mergeStateStatus=CLEAN
- head_sha=86fcf7ff113de1d9daaa4c71b359adf0e3b3a710(PR と worktree HEAD 一致 / G4 PASS)
G1-G5 Deep Verification
| Gate | 結果 | 証跡 |
|---|---|---|
| G1: CI test path coverage | FAIL | .github/workflows/ci.yml:90-94 の python-test job は 5 固定パス(gemini-cli-headless-delegation/, edit-issue/, create-issue/tests/, create-issue/scripts/tests/, ssot-discovery/, hooks/)のみ実行し、本 PR の新規 AC1-AC8 テスト(.claude/skills/issue-contract-review/scripts/tests/test_baseline_vc_preflight.py)は CI で 1 度も実行されていない。`gh run view 26359166065 --log --job 77591402129 |
| G2: implementer self-claim verification | partial | PR 本文 "53 passed" は local 実行のみ。reviewer 環境 (uv run --locked pytest .claude/skills/issue-contract-review/scripts/tests/ -q → 53 passed, 1 skipped in 3.62s) で独立再現したが、CI 証跡ではない。 |
| G3: anchor oracle 実装の存在 | PASS | baseline_vc_preflight.py:178-179, 245, 279, 295, 304, 385 で shlex.split / _strip_uv_run_options / _is_pytest_invocation 全て確認。anchor B1 の exit 4 vs exit 5 分離は baseline_vc_preflight.py:388 (exit_code == 4 and re.search(r"error:\s+file or directory not found:", ...)) と baseline_vc_preflight.py:392 (exit_code == 5 and ("no tests ran" or "no tests collected" or "collected 0 items")) で正しく分岐。新カテゴリ追加なし(expected_baseline_fail 再利用)も確認。 |
| G4: head SHA consistency | PASS | gh pr view 372 --json headRefOid = git -C worktree rev-parse HEAD = 86fcf7ff113de1d9daaa4c71b359adf0e3b3a710。 |
| G5: fixture が validator 意図 path に到達 | PASS(local 再現) | fixture 5 件(pytest_exit4_missing_file.md / pytest_exit5_no_tests.md / pytest_usage_error.md / bash_exit4_file_not_found.md / pytest_baseline_only.md)はすべて run_preflight を経由し、test assert は classification == expected_fail, category == expected_baseline_fail, decision == go を実体検査。AC marker 欠落による loophole 通過ではない。anchor B4(git stash → fixture 化)解消も確認。 |
Evidence Check
| 項目 | 結果 | 根拠 |
|---|---|---|
| AC coverage | △ | AC1-AC8 を ## Test Plan の [x] pytest -k <name> で網羅。SKILL template 標準 ## 受け入れ条件の達成状況 セクション名は不採用だが機能的に同等。 |
| Allowed Paths | ○ | 7 変更ファイル全てが contract ## Allowed Paths (baseline_vc_preflight.py / tests/test_baseline_vc_preflight.py / tests/fixtures/) 配下。逸脱なし。 |
| CI Verification | × | 5 jobs 全 PASS だが python-test job は新規テストを 実行していない。本 PR の AC1-AC8 に対する CI 証跡が 0。 |
| 検証コマンド結果(PR 本文) | △ | ## Test Plan に [x] 記録あり。standalone section ## 検証コマンド結果 は未採用。 |
| scope 混入 | なし | diff 7 ファイル全て scope 内。 |
| Closes #366 keyword | 欠落 | PR 本文に Closes #N / Fixes #N / Resolves #N のいずれも存在しない(タイトル feat(#366): のみ)。SKILL Step 1 Stop Condition 抵触。 |
| Schema / Safety 適用性 | not_schema_change / not safety-sensitive | classifier 内部ロジック追加のみ。consumer 境界変更なし。docs/dev/runtime-verification-policy.md 変更なし、permission/sandbox/transport 影響なし。両 Gate skip。 |
| Runtime VC | not_applicable | contract runtime_verification_applicability.decision: not_applicable。証跡要件なし。 |
Local independent verification (reviewer)
$ uv run --locked pytest .claude/skills/issue-contract-review/scripts/tests/ -q
53 passed, 1 skipped in 3.62s
実装品質自体は AC1-AC8 を満たすことを reviewer 環境で確認済み。ただし CI で実行されないことが本 PR の blocker。
Blockers
- CI coverage gap (G1): 新規 AC1-AC8 テストが
.github/workflows/ci.ymlの python-test job に含まれていない。本 PR が修正対象とするbaseline_vc_preflight.pyの挙動を CI が永続検証できないため、将来の regression を CI で防げない。- fix_delta:
.github/workflows/ci.yml:94の直後に- run: uv run --locked pytest .claude/skills/issue-contract-review/scripts/tests/を追加し、本 PR に含める(Allowed Paths 拡張も必要; 追加 path:.github/workflows/ci.yml)。または follow-up Issue をmandatory_follow_upとして明示し本 PR にリンク。
- fix_delta:
Closes #366欠落: SKILL Step 1 / Stop Conditions に従い PR 本文にCloses #366を追加する必要がある。- fix_delta: PR 本文
## Summaryの直前または末尾にCloses #366を追記。
- fix_delta: PR 本文
Non-blockers(任意改善)
- PR 本文セクション名を template 標準(
## 受け入れ条件の達成状況/## 検証コマンド結果/## Allowed Paths 遵守)に揃えると LOOP_PROTOCOL parser との親和性が高まる。
LOOP_VERDICT
verdict: REQUEST_CHANGES
blockers:
- id: ci-coverage-gap
severity: blocker
summary: "新規 AC1-AC8 テストが .github/workflows/ci.yml の python-test job で実行されていない(G1 fail)"
code_ref: ".github/workflows/ci.yml:90-94"
ci_run_ref: "https://github.com/squne121/loop-protocol/actions/runs/26359166065/job/77591402129"
fix_delta: ".github/workflows/ci.yml に `uv run --locked pytest .claude/skills/issue-contract-review/scripts/tests/` を追加する。Allowed Paths も合わせて拡張するか、follow-up Issue として materialize する。"
- id: closes-keyword-missing
severity: blocker
summary: "PR 本文に Closes #366 / Fixes #366 / Resolves #366 のいずれも存在せず、SKILL Stop Condition 抵触"
code_ref: "PR #372 body"
fix_delta: "PR 本文に `Closes #366` を追記する。"
mergeable: MERGEABLE
mergeStateStatus: CLEAN
reviewed_head_sha: 86fcf7ff113de1d9daaa4c71b359adf0e3b3a710
follow_up_issue_requests:
- title: "ci.yml の python-test job に baseline_vc_preflight tests を追加する"
issue_kind: implementation
severity: mandatory_follow_up
source:
kind: pr_review
url: "https://github.com/squne121/loop-protocol/pull/372"
note_id: "1"
dedupe_key: "follow-up:squne121/loop-protocol:pr-372:ci-coverage-baseline-vc-preflight"
desired_destination: ".github/workflows/ci.yml の python-test job が .claude/skills/issue-contract-review/scripts/tests/test_baseline_vc_preflight.py を実行し、AC1-AC8 の regression を CI で防止する状態"
validated_scope_delta: ".github/workflows/ci.yml に `uv run --locked pytest .claude/skills/issue-contract-review/scripts/tests/` を追加。必要に応じて #366 contract の Allowed Paths を拡張するか、ci-config 単独 PR として扱う。"
origin_skill: pr-review-judge
labels:
- triage-required
- kind/implementation
- phase/implementation…l classification - Add _is_pytest_invocation() helper to detect pytest via argv parsing - Add _strip_uv_run_options() to unwrap uv run flags - Extend classify_result() with AC2/AC3: pytest exit 4 + file not found / exit 5 + no tests - Add 10 new test functions for AC1-AC7 (pytest detection, exit codes, regressions) - Add 5 fixture files for pytest test scenarios - All 53 baseline_vc_preflight tests pass + existing tests regression-free Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
…on-test job Add missing pytest invocation step to merge gate that runs new test functions for pytest invocation detection and exit 4/5 baseline-fail classification. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
9bd2a67 to
4a29393
Compare
squne121
left a comment
There was a problem hiding this comment.
Verdict: APPROVE
Mergeability
- mergeable=MERGEABLE, mergeStateStatus=CLEAN
- PR head 4a29393 == CI run 26359364169 head_sha (rebase onto main 確認済)
Evidence Check (iter 2 re-review)
B1 ci-coverage-gap (iter 1 blocker) — RESOLVED
.github/workflows/ci.yml行 95 にuv run --locked pytest .claude/skills/issue-contract-review/scripts/tests/ステップが存在- code_ref:
.github/workflows/ci.yml:95(worktree HEAD 4a29393 直接確認)
- code_ref:
- CI run 26359364169 / python-test job の step 名
Run uv run --locked pytest .claude/skills/issue-contract-review/scripts/tests/が conclusion: success- ci_run_ref: https://github.com/squne121/loop-protocol/actions/runs/26359364169/job/77591929559
- 該当 head_sha も 4a29393 と一致(implementer self-claim ではなく GH API 経由で確認)
B2 closes-keyword-missing (iter 1 blocker) — RESOLVED
- PR body 冒頭に
Closes #366確認済(gh pr view 372 --json bodyで直接抽出)
G3 anchor oracles 保持確認
shlex.split(line 179): 保持_strip_uv_run_options(line 245): 保持_is_pytest_invocation(line 279): 保持- exit 4 → expected_baseline_fail (line 388-390): 保持
- exit 5 → expected_baseline_fail (line 392-398): 保持
- 新カテゴリ追加なし(既存
expected_baseline_failを再利用、In Scope 通り)
G5 fixture coverage
- 5 fixtures 存在:
bash_exit4_file_not_found.md,pytest_baseline_only.md,pytest_exit4_missing_file.md,pytest_exit5_no_tests.md,pytest_usage_error.md - test_baseline_vc_preflight.py に AC1-AC7 関連の 10 test function 参照を確認(AC1 detection 4本 + AC2-AC7 各分岐)
AC coverage: AC1-AC8 すべて PR body Test Plan で [x] + 検証コマンド結果記述あり (issue contract の Verification Commands 8 件と 1:1 対応)
Allowed Paths: 遵守。diff 8 ファイルすべて amend 後 Allowed Paths (baseline_vc_preflight.py / tests/test_baseline_vc_preflight.py / tests/fixtures/ / .github/workflows/ci.yml) 内
- amend anchor: #366 (comment)
CI Verification: 5 jobs (build/lint/python-test/test/typecheck) 全 PASS @ run 26359364169
Safety / Security: shlex.split のみで shell 実行なし、secret 露出なし、scope 混入なし
Schema/Safety Gate: 該当なし(classifier ロジック追加のみ・consumer 境界変更なし・safety boundary 該当なし)。Runtime Verification decision: not_applicable (issue contract に明示) — 整合
Blockers
- なし
Non-blockers(任意改善)
- なし
LOOP_VERDICT
verdict: APPROVE
blockers: []
mergeable: MERGEABLE
mergeStateStatus: CLEAN
reviewed_head_sha: 4a293935ebf80bb82843b033762f82159325f964
follow_up_issue_requests: []
Closes #366
Summary
pytest,python -m pytest,uv run pytest, etc.Test Plan
Allowed Paths Compliance
Changes confined to allowed paths:
Generated with Claude Code