Skip to content

fix: VC preflight タイムアウトを named constant の関係式で定義し drift を防ぐ - #1335

Merged
squne121 merged 3 commits into
mainfrom
worktree-issue-1333-issue-contract-review-vc-preflight
Jul 4, 2026
Merged

squne121 merged 3 commits into
mainfrom
worktree-issue-1333-issue-contract-review-vc-preflight

Conversation

@squne121

@squne121 squne121 commented Jul 4, 2026 •

Copy link
Copy Markdown
Owner

Summary

背景

Issue #1328 の contract snapshot 自動生成時に ensure_contract_snapshot.py --mode auto --post が2回とも runtime_error(run_contract_review_once_error: timeout)で失敗した。

実測すると uv run --locked pytest .claude/skills/issue-contract-review/scripts/tests/test_baseline_vc_preflight.py は単体実行で 112 passed, 1 skipped in 57.76s(real 約59秒)かかる。一方 baseline_vc_preflight.py の --timeout-seconds デフォルトは30秒であり、この重いテストコマンドを参照する VC は常に timeout 分類になる。

Issue #1333 は当初「定数の単純な引き上げ」として起票されたが、issue-refinement-loop によって以下の点を含むよう本文が更新された:

  • タイムアウト値を独立したリテラルで引き上げるのではなく named constant の関係式で表現し、将来の drift を防ぐ
  • run_contract_review_once.py が baseline_vc_preflight.py を起動する際に per-command timeout を明示的な argv として渡す
  • テストファイルの配置を、実際に既存する .claude/skills/issue-contract-review/tests/ の既存テストスイートの構造・パターンに整合させる

変更内容

  1. .claude/skills/issue-contract-review/scripts/baseline_vc_preflight.py

    • DEFAULT_TIMEOUT_SECONDS = 90 の named constant を追加(実測58秒 + 安全マージン)
    • --timeout-seconds の argparse default をこの定数を参照する形に変更(リテラル default=30 の直書きを廃止)
  2. .claude/skills/issue-contract-review/scripts/run_contract_review_once.py

    • baseline_vc_preflight.DEFAULT_TIMEOUT_SECONDS を _VC_PREFLIGHT_PER_COMMAND_TIMEOUT として import し、単一の正本として参照
    • _VC_PREFLIGHT_TIMEOUT を _VC_PREFLIGHT_PER_COMMAND_TIMEOUT × _VC_PREFLIGHT_MAX_COMMAND_BUDGET(6) + _VC_PREFLIGHT_OVERHEAD_SECONDS(60) = 600 の関係式として導出(独立したリテラル引き上げを廃止)
    • baseline_vc_preflight.py を subprocess 起動する箇所で --timeout-seconds を明示的な argv として追加し、2つのタイムアウト値の drift を防止
  3. テスト追加(Issue 実装: issue-contract-review の VC preflight タイムアウト定数を実測実行時間に合わせて引き上げる #1333 の更新後 Allowed Paths に整合)

    • .claude/skills/issue-contract-review/scripts/tests/test_baseline_vc_preflight_default_seconds.py(新規)— AC1: DEFAULT_TIMEOUT_SECONDS >= 90 かつ argparse default がこの定数を参照していることを固定するテスト
    • .claude/skills/issue-contract-review/tests/test_run_contract_review_once_wrapper_wiring.py(新規)— AC2: _VC_PREFLIGHT_TIMEOUT が関係式で導出されていること、AC3: baseline_vc_preflight.py 起動 argv に --timeout-seconds が含まれることを、既存 test_run_contract_review_once.py と同じ importlib ロード + patch.object パターンで固定するテスト

classify_result() 等の分類ロジック自体、VC の dedup/replay・bounded parallel execution(Issue #1338 に分離)は変更していない。

なお、以前のコミットで誤った配置に追加していた .claude/skills/issue-contract-review/scripts/tests/test_run_contract_review_once.py(新規ファイル)と test_baseline_vc_preflight.py への追記テストは、更新後の Allowed Paths に含まれないため本 PR で削除・撤回した。

Checks

以下のチェックをすべて実行し、成功したことを確認した(検証チェック結果)。

  • pnpm typecheck(型エラーなし)
  • pnpm lint(ESLint エラーなし)
  • pnpm test(全 1399 件 PASS)
  • pnpm build(ビルド成功)

Schema Change Applicability

  • decision: not_schema_change
  • reason: producer-consumer 境界をまたぐ machine-readable schema(CONTRACT_REVIEW_ONCE_RESULT_V1 等の出力フィールド構造)は変更していない。変更対象はタイムアウト値を決定する内部定数・関係式・subprocess argv の組み立てのみである

Schema Consumer Inventory

該当なし(not_schema_change のため、schema consumer の洗い出しは不要と判断した)

Safety Claim Matrix

変更対象が .claude/skills/issue-contract-review/**(contract review の安全ゲート実装)に該当するため、以下の安全性主張表を記載する。

Claim Implemented? Not controlled Evidence Follow-up
タイムアウト定数の引き上げ・関係式化は classify_result() 等の既存分類ロジックを変更しない yes N/A git diff に classify_result() 本体の変更なし。既存回帰スイートは 136 passed, 1 skipped で全件 PASS している N/A
本 PR は Issue #1328 の rg exit_code==2 分類問題を解決しない partial(部分的) Issue #1328 が未解決の間は、該当 VC が本 PR 適用後も human_judgment または blocked になり得る Issue #1333 本文の Notes for Reviewer 欄に明記されている #1328
VC コマンドの dedup/replay・bounded parallel execution による総実行時間削減は本 PR では行っていない no(未実装) Issue #1328 のような、同一の重い VC コマンドが複数 AC から重複参照される構造では、本 PR のマージ後も総実行時間が長くなり得る Issue #1333 本文の Out of Scope 欄に明記されている #1338

記載ルールの遵守確認:

Runtime Verification Applicability

  • decision: not_applicable
  • reason: 本変更は named constant の値・関係式・argv 構築のみを検証する軽量テストで検証が完結する。実際に長時間 VC を実行する timing test は意図的に含めていない(baseline_vc_preflight.py の subprocess 呼び出し自体は patch.object でモックしている)

検証結果(詳細)

すべて成功した:

  • uv run --locked pytest .claude/skills/issue-contract-review/scripts/tests/test_baseline_vc_preflight_default_seconds.py の実行結果 → 3 passed
  • uv run --locked pytest .claude/skills/issue-contract-review/tests/test_run_contract_review_once_wrapper_wiring.py の実行結果 → 5 passed
  • uv run --locked pytest .claude/skills/issue-contract-review/scripts/tests/test_baseline_vc_preflight.py .claude/skills/issue-contract-review/tests/test_run_contract_review_once.py(既存スイートの回帰確認)の実行結果 → 136 passed, 1 skipped in 48.14s
  • pnpm typecheck の実行結果 → pass(型エラーなし)
  • pnpm lint の実行結果 → ESLint: No issues found
  • pnpm test の実行結果 → 92 passed (92 files) / 1399 passed (tests)
  • pnpm build の実行結果 → pass(dist/ 生成成功)

Notes

以下、レビュー・運用の参考情報を記載する(備考)。

baseline_vc_preflight.py の --timeout-seconds デフォルト値(30秒)が
test_baseline_vc_preflight.py の実測実行時間(約58秒)を下回り、常に
timeout 分類となって contract snapshot 自動生成が構造的に blocked/
runtime_error になっていたため、90秒に引き上げる。連動して
run_contract_review_once.py の _VC_PREFLIGHT_TIMEOUT も180秒から
600秒に引き上げ、対応する回帰テストを追加する。

Closes #1333

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

github-actions Bot commented Jul 4, 2026 •

Copy link
Copy Markdown
Contributor

Preview URL

Preview removed (PR #1335 closed).

Issue #1333 の refined contract に合わせて再実装。timeout 値を独立した
リテラルで引き上げるのではなく、baseline_vc_preflight.py に
DEFAULT_TIMEOUT_SECONDS(=90) の named constant を追加し、
run_contract_review_once.py 側の _VC_PREFLIGHT_TIMEOUT はこの定数を
import した上で per-command timeout × 想定コマンド数 + overhead の
関係式(90×6+60=600)として導出する。さらに run_contract_review_once.py
から baseline_vc_preflight.py を subprocess 起動する際に --timeout-seconds
を明示的な argv として渡し、2つのタイムアウト値の drift を防ぐ。

テストは Issue #1333 の更新後 Allowed Paths に合わせて配置し直した:
- scripts/tests/test_baseline_vc_preflight_default_seconds.py (新規, AC1)
- issue-contract-review/tests/test_run_contract_review_once_wrapper_wiring.py
  (新規, AC2/AC3。既存 test_run_contract_review_once.py の
  importlib ロード + patch.object パターンを踏襲)

以前のコミットで追加した scripts/tests/test_run_contract_review_once.py
(誤った配置の新規ファイル)と test_baseline_vc_preflight.py への追記
テストは、更新後の Allowed Paths に含まれないため削除・撤回した。

Closes #1333

Co-Authored-By: Claude Sonnet 5 <[email protected]>
@squne121 squne121 changed the title fix: issue-contract-review の VC preflight タイムアウト定数を実測実行時間に合わせて引き上げる fix: VC preflight タイムアウトを named constant の関係式で定義し drift を防ぐ Jul 4, 2026
@squne121

squne121 commented Jul 4, 2026

Copy link
Copy Markdown
Owner Author

LOOP_VERDICT_V2

verdict: REQUEST_CHANGES
reviewed_head_sha: "1c80a1fce165667e51fa2a2b0a1d48a0105086d4"
merge_ready: false
mergeability:
mergeable: "MERGEABLE"
merge_state_status: "UNSTABLE"

@squne121

squne121 commented Jul 4, 2026

Copy link
Copy Markdown
Owner Author

blockers:

  • "CI required check "PR Body Japanese Check" is FAILURE at reviewed head (ci_verdict_summary.py exit 10, status=failed)."

@squne121

squne121 commented Jul 4, 2026

Copy link
Copy Markdown
Owner Author

LOOP_VERDICT_V2 part 1 of 3

LOOP_VERDICT_V2

verdict: REQUEST_CHANGES
reviewed_head_sha: 1c80a1f
merge_ready: false
mergeability:
mergeable: MERGEABLE
merge_state_status: UNSTABLE
blockers:

  • CI required check PR Body Japanese Check is FAILURE at reviewed head. ci_verdict_summary.py exit 10, status failed. validate_japanese_content.py reports aggregate_ratio 0.585 over threshold 0.1, but per block gate fails: block index 1 has ratio 0.000, jp 0, total 11 tokens, an English only prose block exists in the PR body. Aggregate ratio does not satisfy the per block Japanese Check.
  • Safety Claim Matrix section is missing from the PR body. All changed paths are under dot claude slash skills slash issue-contract-review, which matches the safety sensitive path pattern dot claude slash skills slash double star per pr-review-judge safety-claim-gate reference. A Safety Claim Matrix section, Claim, Implemented, Not controlled, Evidence, Follow-up, is required and currently absent.
  • ALLOWED_PATHS_GATE_RESULT_V1 cannot be computed to ok. No contract review snapshot comment with expected_contract_fingerprint, contract_source_kind, contract_source_id binding was found on linked Issue 1333. Per pr-review-judge SKILL this must be treated as indeterminate, fail closed, merge blocking, even though a manual diff of gh pr view json files shows the 4 changed files match Issue 1333 Allowed Paths exactly.

@squne121

squne121 commented Jul 4, 2026

Copy link
Copy Markdown
Owner Author

LOOP_VERDICT_V2 part 2 of 3

required_auto_actions:

  • kind: update_pr_body_hygiene
    executor: implementation-worker
    skill: open-pr.update_pr
    blocking_merge_ready: true
    mechanical: false
    auto_fix_applied: []
    follow_up_issue_requests: []
    allowed_paths_gate:
    status: indeterminate
    producer_role: review_subagent
    worker_report_used_as_canonical: false
    changed_files_source: gh_pr_view_json_files
    reason: expected_contract_fingerprint binding missing on Issue 1333, no contract review snapshot comment found. Manual diff shows changed_files are within contract Allowed Paths.

@squne121

squne121 commented Jul 4, 2026

Copy link
Copy Markdown
Owner Author

LOOP_VERDICT_V2 part 3 of 3(補足・人間向け)

CI は python-test / e2e / typecheck / lint / test / build / actionlint など全て SUCCESS。PR Body Japanese Check のみ FAILURE(英語のみの段落が本文に1ブロック残っている)。修正はその段落へ日本語文を追加する軽微な hygiene 修正で完了見込み。

deploy-pr は CANCELLED(concurrency 起因と推定)であり本レビューでは blocker として扱っていない。

AC1〜AC4 に対応するユニットテストと既存回帰テストの結果は PR 本文の検証結果セクションに記載されている。変更ファイルは Issue 1333 の Allowed Paths(4ファイル)と厳密一致している。gh pr view json files で確認済み。

.claude/skills 配下の変更であるため Safety Claim Matrix が必須。本 PR は timeout 定数・argv 明示渡しのみで権限昇格やサンドボックス変更を含まないと見受けられるが、その旨を Matrix に明記し Not controlled 列の扱いを明示すること。

本 PR は self-authored(author squne121 が実行アカウントと一致)のため gh pr review ではなく gh pr comment で本 verdict を記録している。gh pr review は root checkout からの gh mutation allowlist に存在せず gh_mutation_denied として拒否されるため。

@squne121

squne121 commented Jul 4, 2026

Copy link
Copy Markdown
Owner Author

Verdict: APPROVE

前回指摘した3件のブロッカーをすべて再検証し、解消を確認した。

Mergeability

  • mergeable=MERGEABLE, merge_state_status=UNSTABLE(isDraft=true、Draft自体はblockerではない)

Evidence Check

  1. PR Body Japanese Check: reviewed_head_sha (1c80a1f) にひもづく最新run(run_id 28712392830, completed 16:25:57Z)が SUCCESS であることを ci_verdict_summary.py で確認した。head_sha一致・stale無し。
  2. Safety Claim Matrix: PR本文に正式カラム(Claim / Implemented? / Not controlled / Evidence / Follow-up)で3行記載を確認。Not controlled が非空の2行はいずれも Issue 実装: new-file VC preflight を missing Allowed Paths file として決定論的に分類する #1328 / 実装: issue-contract-review の VC preflight に同一command dedup/replay と bounded parallel execution を追加する #1338 への follow-up が明記され、無限定な safe/complete 断定表現も無い。
  3. ALLOWED_PATHS_GATE_RESULT_V1: Issue 実装: issue-contract-review の VC preflight タイムアウト定数を実測実行時間に合わせて引き上げる #1333 のcontract snapshotコメント(実装: issue-contract-review の VC preflight タイムアウト定数を実測実行時間に合わせて引き上げる #1333 (comment) , CONTRACT_REVIEW_RESULT_V1 status go, body_sha256=sha256:72e2c01e38b98605975ab6ad77a1c4805d5ef2306ad51324989a30cd6050bd03)とcurrent Issue本文のAllowed Paths(4ファイル)からexpected_contract_fingerprintをreview_subagentが独立構築し、allowed_paths_review_gate.pyをPR実diffに対して再実行した結果 status=ok(violations無し、changed_files_source=git_diff_name_status_find_renames_z)。Issue updatedAt(16:14:04Z)がgo comment作成時刻と一致しており本文driftも無いことを確認した。base_sha_at_snapshotはorigin/main tip(988c5293dc70bf274cbe503b94e9c42711e2f829)で snapshot後にmainが進んでいないことも確認済み。

Allowed Paths 遵守

CI Verification

  • ci_verdict_summary.py(--expected-head-sha 一致)は exit 10 (failed) を返すが、内訳は failed_checks=["deploy-pr"] のみ。deploy-pr(run 28711792823)はheadSha一致だが conclusion=cancelled で、同時刻に別run(28711797049)が同一push由来で success しており、deploy-pages previewのconcurrency-group競合によるcancelとみられる(GitHub Actionsのpull_request向けpreview-deployでよくある挙動)。required CI job群(typecheck/lint/test/build/e2e/python-test/node-backed-hook-tests/actionlint/ci-verdict-summary)は全てSUCCESS。mergeStateStatus=UNSTABLE(BLOCKEDではない)であることもnon-required checkの失敗である傍証。前回レビューでも同様の判断でblocker外としており継続する。

検証コマンド結果

  • PR本文記載の各pytest実行結果(test_baseline_vc_preflight_default_seconds.py 3 passed / test_run_contract_review_once_wrapper_wiring.py 5 passed / 既存回帰 136 passed,1 skipped)はpython-test CI jobのSUCCESSと整合。

AC coverage

  • AC1〜AC4はPR本文『変更内容』『検証結果(詳細)』に個別対応するテストファイル・実行結果が記載されており、placeholderは無い。

Blockers

  • なし

Non-blockers

  • deploy-pr cancelled(上記の通りconcurrency起因と判断、non-required)

LOOP_VERDICT_V2

verdict: APPROVE
reviewed_head_sha: "1c80a1fce165667e51fa2a2b0a1d48a0105086d4"
merge_ready: true
mergeability:
mergeable: "MERGEABLE"
merge_state_status: "UNSTABLE"
blockers: []
required_auto_actions: []
auto_fix_applied: []
follow_up_issue_requests: []
allowed_paths_gate:
status: ok
producer_role: review_subagent
worker_report_used_as_canonical: false
changed_files_source: git_diff_name_status_find_renames_z
changed_files:
- .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/tests/test_baseline_vc_preflight_default_seconds.py
- .claude/skills/issue-contract-review/tests/test_run_contract_review_once_wrapper_wiring.py
violations: []
contract_fingerprint:
issue_number: 1333
contract_source_kind: issue_comment
contract_source_id: "#1333 (comment)"
contract_body_sha256: "sha256:72e2c01e38b98605975ab6ad77a1c4805d5ef2306ad51324989a30cd6050bd03"
base_ref: main
base_sha_at_snapshot: "988c5293dc70bf274cbe503b94e9c42711e2f829"
reason: All changed files are within allowed paths
allowed_paths_gate_source: review_subagent

本PRはself-authored(author squne121 が実行アカウントと一致)のため gh pr review ではなく gh pr comment で本verdictを記録している。

@squne121

squne121 commented Jul 4, 2026

Copy link
Copy Markdown
Owner Author

結論

P0ブロッカーは見当たりません。条件付きで APPROVE 寄りです。
ただし、PRはまだ Draft で、変更対象は .claude/skills/issue-contract-review/** の安全ゲート系です。Draft解除前に下の P1-1 / P1-2 は直す方が堅いです。PRは open / draft / mergeable=true、差分は4ファイル・+282/-3です。

確認したこと

PR #1335 は、Issue #1333 の「VC preflight timeout を named constant と関係式にする」スコープに沿って、baseline_vc_preflight.py に DEFAULT_TIMEOUT_SECONDS = 90 を追加し、--timeout-seconds の default をその定数参照へ変更しています。

run_contract_review_once.py 側も baseline_vc_preflight.DEFAULT_TIMEOUT_SECONDS を _VC_PREFLIGHT_PER_COMMAND_TIMEOUT として import し、_VC_PREFLIGHT_TIMEOUT = 90 * 6 + 60 = 600 の関係式に変更しています。 さらに、baseline VC 呼び出し時に --timeout-seconds を明示的に渡すようになっています。

関連Issueの整理も概ね正しいです。#1333 は timeout 定数整合性だけを対象にし、#1328 の rg exit_code==2 分類問題と、#1338 の dedup / bounded parallel execution は別Issueに分離しています。

CI状況も、少なくとも取得できた範囲では ci 本体が success、Japanese check も最新runで success、deploy-pages の cancelled が残る状態です。GitHub Actions の concurrency は同一groupの進行中runを cancel できる仕様なので、preview deploy の cancelled を non-required 扱いにする判断は妥当です。 ([GitHub Docs]1)

敵対的レビュー

P1-1: _VC_PREFLIGHT_MAX_COMMAND_BUDGET = 6 は #1328 文脈に対して説明不足

#1328 の実例は「同一の重い pytest command が10個のACから参照される」問題です。#1333では dedup/parallel は out of scope としているので、6というbudget自体は即ブロッカーではありません。ただし、コードコメントで「Issue #1328 のように複数ACが同一の重いVCを重複参照するケース」と説明しながら budget が6なのは、読み手に「#1328型もtimeoutだけで十分吸収できる」と誤読させます。

Python の subprocess.run(timeout=...) は timeout 到達時に child process を kill し、プロセス終了後に TimeoutExpired を再送出します。つまり wrapper 側 600秒に当たると、baseline_vc_preflight.py がJSONを返せず runtime_error になります。([Python documentation]2)

修正案:
どちらかに寄せるべきです。

  1. budget を 10 に上げ、90 * 10 + 120 = 1020 程度にする。
  2. budget 6 のままにするなら、コメントを「#1333の暫定緩和。#1328の10重複ケースは#1338で解く」に弱める。

私は 2 を推奨します。#1338 が既に dedup / bounded parallel execution を切っているため、#1335で17分級timeoutにするより、過剰主張を削る方が安全です。

P1-2: テストが「本物の argparse parser」を直接検証していない

新規テストは ArgumentParser() をテスト内で再構築して DEFAULT_TIMEOUT_SECONDS を参照させています。これは「テスト内のparser」は検証していますが、production の main() が本当にそのparser defaultを使うことは、後続のソース文字列検査に依存しています。

argparse の default は、オプションがCLI上に存在しないときに使われる値です。今回の狙い自体は正しいですが、検証方法はやや脆いです。([Python documentation]3)

修正案:
最小なら現状でも許容。ただし高品質化するなら、baseline_vc_preflight.py に build_arg_parser() を切り出して、テストで実parserを直接 inspect してください。

P2: CLIスクリプト import による結合が増えている

run_contract_review_once.py が timeout constant 取得のために baseline_vc_preflight.py 全体を import する形になっています。現状の baseline_vc_preflight.py は import 時にプロセス実行しないため壊れてはいませんが、2500行超のCLIスクリプトを定数のために import するのは将来の副作用リスクがあります。

Allowed Paths の都合で今回のPR内では難しいですが、将来的には vc_preflight_config.py のような小さい共有定数モジュールへ分離する方が安全です。

P2: preview URL はこのPRの検証根拠として弱い

PRコメントに preview URL は出ていますが、今回の変更は .claude/skills/issue-contract-review/** のPython orchestrationであり、ゲーム画面previewのlive assets確認は実質的な検証になりません。これはブロッカーではなく、PR本文の Checks / pytest / CI を主根拠にすべきです。

外部実装・仕様照合からの補強点

subprocess.run(..., timeout=...) は child kill + wait + TimeoutExpired なので、wrapper timeout は「各command timeoutの合計より少し上」ではなく、JSON生成・GitHub API・parser処理・プロセス起動遅延を含む上限として余裕を持たせる必要があります。([Python documentation]2)

rg の exit status 2 は「error」で、regex syntax error のような catastrophic error と、読めないファイルのような soft error の両方を含みます。したがって #1328 を #1335 で混ぜて解こうとしない分離方針は正しいです。([Debian Manpages]4)

マージ判断

マージ方針:

Codex / Claude Code への修正依頼プロンプト

PR #1335 を、スコープを広げずに最小修正してください。

目的:
- Issue #1333 の timeout constant / wrapper timeout drift 防止は維持する
- #1328 の rg exit_code==2 分類問題、#1338 の dedup/parallel は実装しない
- ただし #1328 の10重複ケースをこのPR単独で解決するように読める過剰主張を削る

修正内容:
1. .claude/skills/issue-contract-review/scripts/run_contract_review_once.py
   - _VC_PREFLIGHT_MAX_COMMAND_BUDGET = 6 は維持してよい
   - ただしコメントを「#1333 の暫定的な wrapper timeout budget。#1328 の10重複ケースの根本対策は #1338」と明記する
   - 「Issue #1328 のようなケースを踏まえた想定上限」と読める表現を弱める

2. 可能ならテスト改善
   - test_vc_preflight_timeout_safely_exceeds_measured_test_runtime の名称またはassertを見直す
   - wrapper timeout >= 180 だけでなく、_VC_PREFLIGHT_TIMEOUT == per_command * budget + overhead を主契約として明確化する
   - baseline parser default の検証は、可能なら build_arg_parser() 切り出しで production parser を直接検査する
   - ただし Allowed Paths 外の新規ファイル追加は禁止

3. 実行:
   - uv run --locked pytest .claude/skills/issue-contract-review/scripts/tests/test_baseline_vc_preflight_default_seconds.py
   - uv run --locked pytest .claude/skills/issue-contract-review/tests/test_run_contract_review_once_wrapper_wiring.py
   - uv run --locked pytest .claude/skills/issue-contract-review/scripts/tests/test_baseline_vc_preflight.py .claude/skills/issue-contract-review/tests/test_run_contract_review_once.py
   - pnpm typecheck
   - pnpm lint
   - pnpm test
   - pnpm build

禁止:
- #1328 の classify_result() 変更を入れない
- #1338 の dedup/replay / bounded parallel execution を入れない
- schema output fields を変更しない
- Allowed Paths 外を変更しない

ローカルでの実テスト実行はしていません。GitHub上のPR本文、差分、Issue、コメント、CIメタデータ、外部仕様ドキュメントに基づくレビューです。

敵対的レビュー(P1-1)の指摘を反映。budget=6 の説明が「Issue #1328 のように
複数ACが同一の重いVCを重複参照するケースを踏まえた想定上限」となっており、
budget=6 だけで #1328 型(10重複)のケースも十分吸収できると誤読される
余地があった。値(6)自体はIssue #1333のスコープ外のため変更せず、
コメントのみを「#1333 の暫定的な wrapper timeout budget。#1328 の
根本対策は #1338 で扱う」という趣旨に弱め、timeout側だけで完全に
吸収する意図ではないことを明記した。

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

squne121 commented Jul 4, 2026

Copy link
Copy Markdown
Owner Author

Verdict: APPROVE(軽微追加コミットの再検証)

前回 APPROVE(head 1c80a1f)以降、head が 1063b5a に進んだが、変更は run_contract_review_once.py のコメントのみ(git diff --stat 1c80a1f..1063b5a → 1 file changed, 6 insertions(+), 2 deletions(-))。git show でコミット両バージョンのファイル全文を直接比較し、_VC_PREFLIGHT_MAX_COMMAND_BUDGET = 6 / _VC_PREFLIGHT_OVERHEAD_SECONDS = 60 / 関係式そのものに変更が無いことを確認した。classify_result() はこのファイルに存在せず、他3ファイル(baseline_vc_preflight.py、2テストファイル)は今回の commit で無変更。schema フィールドの変更も無い。

@squne121

squne121 commented Jul 4, 2026

Copy link
Copy Markdown
Owner Author

CI(ci_verdict_summary.py, expected-head-sha=1063b5a)

初回照会時は e2e/test/deploy-pr/python-test が IN_PROGRESS(exit 20, next_action=wait_for_ci)だったため、完了を待って再照会した。最終結果は status: all_pass、failed_checks 空、pending_checks 空、stale_checks 空。head_sha 一致。

@squne121

squne121 commented Jul 4, 2026

Copy link
Copy Markdown
Owner Author

Allowed Paths gate 再計算

gh pr view --json files で確認した changed files(4件、全 commit 累積)は前回 APPROVE 時と同一で、baseline_vc_preflight.py、run_contract_review_once.py、test_baseline_vc_preflight_default_seconds.py、test_run_contract_review_once_wrapper_wiring.py の4つ。Issue #1333 は updatedAt 2026-07-04T16:14:04Z のまま変化なし(本文・Allowed Paths 未更新)。前回 APPROVE で fingerprint 一致確認済みの contract snapshot コメント(issue 1333 コメント、contract_body_sha256 sha256始まり72e2c01e、base_sha_at_snapshot 988c529)は issue 側が無変更のため fingerprint 継続有効。local main HEAD も同一sha のままで snapshot 後に main が進んでいないことを確認済み(stale_snapshot 非該当)。結論は status ok、violations なし。

@squne121

squne121 commented Jul 4, 2026

Copy link
Copy Markdown
Owner Author

本PRはself-authored(author squne121 が実行アカウントと一致)のため gh pr review ではなく gh pr comment で本verdictを記録している。

@squne121

squne121 commented Jul 4, 2026

Copy link
Copy Markdown
Owner Author

reason: Issue 1333 unchanged since prior fingerprint binding, changed files across all commits remain within Allowed Paths, commit diff to reviewed head is comment-only.
allowed_paths_gate_source: review_subagent

@squne121

squne121 commented Jul 4, 2026

Copy link
Copy Markdown
Owner Author

PR本文

follow-up 記載(#1328 は根本対策せず #1338 に分離)は今回のコメント修正意図と一致しており矛盾なし。大きな更新は不要と判断。

Blockers

なし

@squne121

squne121 commented Jul 4, 2026

Copy link
Copy Markdown
Owner Author

LOOP_VERDICT_V2

verdict: APPROVE
reviewed_head_sha: 1063b5a
merge_ready: true
mergeability:
mergeable: MERGEABLE
merge_state_status: CLEAN
blockers: []
required_auto_actions: []
auto_fix_applied: []
follow_up_issue_requests: []
allowed_paths_gate:
status: ok
producer_role: review_subagent
worker_report_used_as_canonical: false
changed_files_source: gh_pr_view_json_files
changed_files:
- .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/tests/test_baseline_vc_preflight_default_seconds.py
- .claude/skills/issue-contract-review/tests/test_run_contract_review_once_wrapper_wiring.py
violations: []
contract_fingerprint:
issue_number: 1333
contract_source_kind: issue_comment
contract_source_id: #1333 (comment)
contract_body_sha256: sha256:72e2c01e38b98605975ab6ad77a1c4805d5ef2306ad51324989a30cd6050bd03
base_ref: main
base_sha_at_snapshot: 988c529
reason: Issue 1333 unchanged since prior fingerprint binding, changed files across all commits remain within Allowed Paths, commit diff to reviewed head is comment-only.
allowed_paths_gate_source: review_subagent

本PRはself-authored(author squne121 が実行アカウントと一致)のため gh pr review ではなく gh pr comment で本verdictを記録している。

注記: 直前の複数の短いテスト系コメントは本レビュー作業中の投稿検証用の誤投稿です。無視してください。実質的な verdict は本コメントと直前の一連のコメントに記載の内容です。

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

実装: issue-contract-review の VC preflight タイムアウト定数を実測実行時間に合わせて引き上げる

1 participant