Closed
Labels
agent/implementerAI implementer agentenhancementNew feature or requestphase/implementationImplementation phase
Description
Machine-Readable Contract
contract_schema_version: v1
issue_kind: implementation
parent_issue: "244"
goal_ref: "issue-contract-review が検出する VC preflight / Runtime Verification Applicability / Issue body validator 不備を、issue-refinement-loop 本体ではなく review-issue・issue-author・edit-issue 側で修正可能な structured feedback として扱えるようにする"
change_kind: workflow
depends_on:
- "327"
- "329"
- "456"
related:
- "456"Parent Issue
Parent Goal Ref
- Goal: GitHub Issue body が validator / preflight script により機械検証され、AI agent は failing rule + minimal_context + fix_hint だけで修正できる状態にする。
- Desired Destination:
issue-refinement-loopは薄い orchestration のまま、review-issue/issue-author/edit-issueがissue-contract-review相当の deterministic result を consume し、impl-review-loop着手時のCONTRACT_REVIEW_RESULT_V1 status: blockedを前段で潰せる。
Current Validated Scope
.claude/skills/issue-contract-review/scripts/にcontract_readiness_check.pyを追加し、mutation-free でISSUE_CONTRACT_READINESS_RESULT_V1を返す helper を実装する。review-issue/issue-reviewer.mdが contract readiness result をneeds-fixblocker として consume する。issue-author.mdが AC3/AC4 の blocker payload から本文修正を生成できる authoring rule を持つ。edit-issueが mutation 前に contract readiness check を fail-closed で実行する。#327/#329成果物(validate_issue_body.py/baseline_vc_preflight.py)を helper から参照する。
Remaining Parent Gaps
#456: VC_SINGLE_COMMAND_GUARDRAIL の body-authoring.md SSOT 移設(本 Issue では重複定義しない)。- PR body validator(実装: PR body contract validator を追加する #469)は本 Issue の対象外。
issue-contract-reviewのgo | blocked | human_judgment意味論変更は本 Issue の外。
Outcome
issue-refinement-loop 実行中に issue-contract-review 相当の deterministic blocker が review-issue → issue-author → edit-issue の通常経路で修正される。結果として、implementation Issue が approved になった直後に /impl-review-loop <issue> を実行しても、VC preflight / Runtime Verification Applicability / Issue body validator 不備だけを理由に preparation BLOCKED にならない状態で、contract_readiness_check.py が存在し fixture tests が PASS している。
In Scope
.claude/skills/issue-contract-review/scripts/contract_readiness_check.pyを新規追加する。- 入力:
--issue <N>または--body-file <path> - 出力:
ISSUE_CONTRACT_READINESS_RESULT_V1JSON(status、body_sha256、source_checks[]、errors[]、minimal_context[]、fix_hint) - GitHub comment / label / branch / worktree を作らない(mutation-free)。
validate_issue_body.pyのエラー結果を統合する。baseline_vc_preflight.pyのblocked/human_judgment結果を統合する。Runtime Verification Applicability decision: immediateの必須 field 不足を検出する。- 仕様:
--mode static(既定): VC 構文・section・schema のみを静的検証する。edit-issuepre-mutation guard の既定。GitHub 認証・VC 実行・ネットワーク不要。--mode execute:baseline_vc_preflight.pyを呼び出して VC を実行する。issue-contract-review互換用。
- Status mapping contract を実装する:
validate_issue_body.pyのLPxxxerrors →needs_fixbaseline_vc_preflight.pyのcompound_command_disallowed→needs_fixbaseline_vc_preflight.pyのno commands/extraction error(本文構造起因)→needs_fixbaseline_vc_preflight.pyのenv/tool missing/regression gate fails→human_judgmentbaseline_vc_preflight.pyのhuman_judgment→human_judgment(絶対に潰さない)
- 出力仕様:
ISSUE_CONTRACT_READINESS_RESULT_V1JSON(schema,status,body_sha256,source_checks[],errors[],minimal_context[],fix_hint) source_checks[]は各 checker の実行結果(name,schema,status,exit_code)を含むerrors[]の各要素はrule_id,severity,source_check,category,section,line_start,line_end,minimal_context,fix_hint,autofixableを持つ
- 入力:
.claude/skills/issue-contract-review/scripts/tests/fixtures/にissue412_contract_blocked.md/issue412_contract_go.mdを追加する。review-issue/.claude/agents/issue-reviewer.mdを更新し、contract readiness result をREVIEW_ISSUE_RESULT_V1のneeds-fix理由に転写する(判定ロジックは再実装しない)。.claude/agents/issue-author.mdの<!-- VC_SINGLE_COMMAND_GUARDRAIL -->参照セクションがcontract_readiness_check.pyの診断結果をbody-authoring.mdの SSOT へ誘導できるよう確認・更新する(詳細 VC authoring rule はbody-authoring.md正本に委譲するため、issue-author.mdに新規ルールを追加しない)。.claude/skills/edit-issue/を更新し、Issue body mutation 前にcontract_readiness_check.py --mode staticを fail-closed で実行する。status: go以外の場合はgh issue editを実行しない。human_judgmentもgoと同等に扱わない(fail-closed)。.claude/skills/create-issue/references/body-authoring.mdの contract readiness 参照を追記する(#456の VC_SINGLE_COMMAND_GUARDRAIL SSOT と重複定義しない)。
Out of Scope
issue-refinement-loopに contract preflight 判定ロジックを追加すること。impl-review-loopの preparation 条件を緩和すること。issue-contract-reviewの BLOCKED / human_judgment / go の意味論変更。- GitHub comment 投稿、label mutation、branch / worktree 作成。
- PR body validator の変更(実装: PR body contract validator を追加する #469 の scope)。
#412の secure-secret-boundary 実装本体。VC_SINGLE_COMMAND_GUARDRAILの SSOT 移設(実装: VC_SINGLE_COMMAND_GUARDRAIL を issue-author 直書きから body-authoring 正本へ移設する #456 の scope)。issue-refinement-loop/SKILL.md/impl-review-loop/SKILL.mdへの判定ロジック追加。issue-author.mdにcontract_readiness_check.pyの診断ルールを直書きすること(body-authoring.md 正本に委譲)。
Acceptance Criteria
- AC1:
contract_readiness_check.pyまたは同等 helper が存在し、--body-file入力で GitHub 非依存にISSUE_CONTRACT_READINESS_RESULT_V1JSON を返す。 - AC2: result は
schema: "ISSUE_CONTRACT_READINESS_RESULT_V1"、status、body_sha256、source_checks[]、errors[](各要素にrule_id,severity,source_check,category,section,line_start,line_end,minimal_context,fix_hint,autofixable)、fix_hint、minimal_context[]を含む。 - AC3:
baseline_vc_preflight.pyが返すcompound_command_disallowed/unexpected_pass/ invalidpreflight-scope/human_judgmentが contract readiness result に lossless に写像される。 - AC4:
Runtime Verification Applicability decision: immediateでapplicable_acs/execution_environment/skip_conditions/fallback_policy/artifact_requirementsの不足がneeds_fixとして検出される。 - AC5:
review-issueは contract readiness result を consume し、needs-fixverdict に含める。ただし判定ロジックを prose で再実装しない。 - AC6:
issue-authorの<!-- VC_SINGLE_COMMAND_GUARDRAIL -->参照セクションが contract readiness feedback をbody-authoring.mdSSOT に誘導する形になっている(新規 VC authoring rule をissue-author.mdに直書きしていない)。 - AC7:
edit-issueは mutation 前に contract readiness check を実行し、error が残る body を GitHub に書き込まない。 - AC8: 実装: Claude Code / GitHub Actions の Secret 到達面を上流で制限する secure-secret-boundary を導入する #412 相当 blocked fixture で、compound VC、unexpected pass、regression gate 誤分類、Runtime Verification Applicability 不足が検出される。
- AC9: 実装: Claude Code / GitHub Actions の Secret 到達面を上流で制限する secure-secret-boundary を導入する #412 相当 fixed fixture で
status: goになる。 - AC10:
issue-refinement-loop/SKILL.mdとimpl-review-loop/SKILL.mdに新しい判定ロジックを追加していないことを test または grep で確認する。 - AC11:
contract_readiness_check.pyの pytest がpnpm testまたは CI の必須ジョブで実行される。 - AC12:
--body-file+--mode staticモードは GitHub token /gh auth/ network に依存せず実行できる。 - AC13: result JSON は checkin 済み JSON Schema または golden fixture で strict に検証される(unknown top-level key は tests で reject される)。
Verification Commands
# AC1
$ test -f .claude/skills/issue-contract-review/scripts/contract_readiness_check.py
# AC2
# preflight-scope: runtime_only
$ uv run pytest .claude/skills/issue-contract-review/scripts/tests/ -q -k "contract_readiness_result_v1_schema"
# AC3
# preflight-scope: runtime_only
$ uv run pytest .claude/skills/issue-contract-review/scripts/tests/ -q -k "compound_command_disallowed or unexpected_pass or preflight_scope or contract_readiness"
# AC4
# preflight-scope: runtime_only
$ uv run pytest .claude/skills/issue-contract-review/scripts/tests/ -q -k "runtime_verification_applicability or applicable_acs or contract_readiness"
# AC5
$ rg -n "ISSUE_CONTRACT_READINESS_RESULT_V1" .claude/skills/review-issue/ .claude/agents/issue-reviewer.md
# AC6
# preflight-scope: pr_review_only
$ rg -n "VC_SINGLE_COMMAND_GUARDRAIL" .claude/agents/issue-author.md
# AC7
$ rg -n "contract_readiness_check" .claude/skills/edit-issue/
# AC8
# preflight-scope: runtime_only
$ uv run pytest .claude/skills/issue-contract-review/scripts/tests/ -q -k "issue412"
# AC9
# preflight-scope: runtime_only
$ uv run pytest .claude/skills/issue-contract-review/scripts/tests/ -q -k "contract_go_fixture"
# AC10
# preflight-scope: runtime_only
$ uv run pytest .claude/skills/issue-contract-review/scripts/tests/ -q -k "no_logic_in_orchestration_skills"
# AC11
# preflight-scope: runtime_only
$ uv run pytest .claude/skills/issue-contract-review/scripts/tests/ -q -k "contract_readiness"
# AC12
# preflight-scope: runtime_only
$ uv run pytest .claude/skills/issue-contract-review/scripts/tests/ -q -k "no_network_required or static_mode"
# AC13
# preflight-scope: runtime_only
$ uv run pytest .claude/skills/issue-contract-review/scripts/tests/ -q -k "golden_fixture or schema_strict"
$ pnpm typecheck
$ pnpm lint
$ pnpm test
$ pnpm buildAllowed Paths
.claude/skills/issue-contract-review/scripts/
.claude/skills/issue-contract-review/scripts/tests/
.claude/skills/issue-contract-review/scripts/tests/fixtures/
.claude/skills/issue-contract-review/SKILL.md
.claude/skills/review-issue/
.claude/agents/issue-reviewer.md
.claude/agents/issue-author.md
.claude/skills/edit-issue/
.claude/skills/create-issue/references/body-authoring.md
issue-refinement-loop / impl-review-loop は原則 Allowed Paths に入れない。どうしても reference map だけ更新が必要な場合は、別 Issue か、AC10 を満たす範囲の comment-only/reference-only 変更に限定する。
Stop Conditions
- Allowed Paths 外の変更が必要と判明した場合
- In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
- 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
- 後続 Phase / 別スコープへの波及が判明した場合
- nested SubAgent delegation が必要になった場合
- 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
issue-refinement-loopまたはimpl-review-loopに判定ロジックを追加しないと達成できないと判明した場合issue-contract-reviewの既存go | blocked | human_judgment意味論を変更する必要が出た場合- GitHub comment / label / branch / worktree mutation が helper 実行に必要になる場合
- 実装: VC_SINGLE_COMMAND_GUARDRAIL を issue-author 直書きから body-authoring 正本へ移設する #456 の SSOT 移設と衝突し、VC authoring rule の正本を二重定義する必要が出た場合
review-issueが deterministic checker の結果を再解釈しないと routing できない場合- 実装: Claude Code / GitHub Actions の Secret 到達面を上流で制限する secure-secret-boundary を導入する #412 固有実装に踏み込む必要が出た場合
Runtime Verification Applicability
decision: immediate
applicable_acs:
- AC1
- AC2
- AC3
- AC4
- AC5
- AC6
- AC7
- AC8
- AC9
- AC10
- AC11
- AC12
- AC13
execution_environment:
cli_tools:
- python3
- uv
- rg
- pnpm
auth_required: false
network_required: false
skip_conditions:
- "local repository checkout が存在しない場合は SKIP ではなく environment blocked として扱う"
- "fixture 入力テストは GitHub 認証なしで実行できること"
fallback_policy:
fallback_success_is_pass: false
notes: "grep だけで orchestration 層非変更を確認する場合も、contract readiness helper の fixture tests が PASS しない限り成功扱いにしない"
artifact_requirements:
- ".claude/skills/issue-contract-review/scripts/tests/fixtures/issue412_contract_blocked.md"
- ".claude/skills/issue-contract-review/scripts/tests/fixtures/issue412_contract_go.md"
- "contract_readiness_check.py JSON output"
- "pytest output for contract_readiness tests"Required Skills
- Python(
argparse/json/subprocess) - pytest(fixture / parametrize)
Scope Delta(任意)
N/A
Metadata
Metadata
Assignees
Labels
agent/implementerAI implementer agentenhancementNew feature or requestphase/implementationImplementation phase
Activity
squne121 commentedon May 29, 2026
create-issue transaction partial-failure
Issue: #492
Failure stage: label-readback
Message: label read-back mismatch
Requested:
Completed steps: create, label
Failure context:
matching_issue_numbers=[492]
issue_number=492
Recovery hint: label-readback failed for #492.
Manual re-apply command (idempotent: yes):
gh issue edit 492 --repo squne121/loop-protocol --add-label
Verify:
gh issue view 492 --repo squne121/loop-protocol --json labels
Please recover deterministically before re-running the create issue transaction.
squne121 commentedon May 29, 2026
判定: REQUEST_CHANGES / 現状のまま実装開始は危険
#492 の狙い自体は妥当です。
issue-contract-reviewのBLOCKEDをimpl-review-loopまで持ち越さず、review-issue / issue-author / edit-issueの refinement 中に修正可能にする、という接続点は親Issue #244の「validator/preflight の機械結果と minimal_context だけで AI が修正できる状態にする」方針と整合しています。(GitHub)ただし、現行案は #456 未解決、VC parser 仕様、Runtime Verification Applicability の即時検証、baseline preflight の status semantics を甘く見ています。このままだと「BLOCKED を解消する仕組み」ではなく、「BLOCKED を別名の
needs_fixに詰め替えるだけの層」になります。致命的問題
1. #456 と SSOT が衝突している
#492 は
issue-authorに AC3/AC4 修正ルールを追加するとしつつ、#456 の SSOT には踏み込まない、としています。これは危険です。#456 はまさに VC authoring rule を.claude/skills/create-issue/references/body-authoring.mdに集約し、issue-author.mdから詳細ルールを排除するためのIssueです。(GitHub)さらに現状の
body-authoring.mdにはまだ&& echo PASS || echo FAILや pipe を含む例が残っており、baseline preflight の「単一コマンド」前提と矛盾しています。(GitHub)修正要求: #492 は
depends_on: 456に格上げするか、少なくともissue-authorには詳細な VC authoring rule を置かず、contract_readiness_check.pyの診断結果を body-authoring SSOT に誘導するだけにしてください。issue-author.mdに新しい規則を直接増やすと、#452/#456 で既に指摘された「SubAgent 定義が運用設計書化する」問題を再発させます。(GitHub)2. #492 自身の Verification Commands が契約違反になり得る
#327 の validator は fenced bash の VC を要求し、#329 の baseline preflight も
## Verification Commands配下の fenced bash block からコマンドを抽出する設計です。(GitHub)一方、#492 の Verification Commands は indented code block 風で、全コマンドが fenced bash ではありません。また
|、複数行、! rg ...、python - <<'PY'系の構造が混在しており、baseline preflight の compound-command 検出ではblockedになり得ます。(GitHub)修正要求: #492 の本文自体を先に修正してください。各 VC は fenced bash、1 AC につき単一コマンド、
# AC<N>marker を明示、pipe/heredoc/compound shell を避ける必要があります。自分自身が通らない契約を実装Issueにしないでください。3. AC4 の immediate runtime-field 検証は既存 validator では足りない
#492 は
Runtime Verification Applicability decision: immediateの場合にapplicable_acs / execution_environment / skip_conditions / fallback_policy / artifact_requirements欠落をneeds_fixにする、としています。(GitHub)しかし既存
validate_issue_body.pyの LP020 は、主に section/decision と deferred 用フィールドを見ており、immediate 用の具体フィールド完全性までは検査していません。(GitHub)修正要求:
contract_readiness_check.py側で AC4 専用の parser/check を明示実装してください。validate_issue_body.pyの LP020 に依存すると false negative が出ます。診断は最低限、rule_id,section,field,line_start,minimal_context,fix_hint,autofixable=trueを持つべきです。4.
blockedを機械的にneeds_fixへ写像すると壊れる#329/#354 の経緯では、
blockedとhuman_judgmentの優先順位・保持が重要な論点でした。特に「blocked と human_judgment が混在した場合に human_judgment が勝つ」バグがレビューで指摘され、blocked優先に直されています。(GitHub)#492 の
go | needs_fix | human_judgmentへの集約は、baseline preflight のblockedcategory を潰しやすいです。例えばcompound_command_disallowedは本文修正で直せるためneeds_fixでよい一方、環境依存・command not found・timeout・retrieval/extraction error は本文修正では直らない場合があります。pytestの exit code 5 “No tests collected” のように、preflight 側で意味づけされる終了コードもあります。(GitHub)修正要求: mapping table をIssue本文に追加してください。最低限、次を分けるべきです。
source | category | readiness status | 理由 -- | -- | -- | -- validate_issue_body error | LPxxx | needs_fix | 本文修正可能 baseline preflight | compound_command_disallowed | needs_fix | VC記述修正で解消可能 baseline preflight | no commands / extraction error | needs_fix または human_judgment | 本文構造起因なら needs_fix、parser仕様外なら human_judgment baseline preflight | env/tool missing | human_judgment | 本文修正だけでは解消不能 baseline preflight | regression gate fails | human_judgment | 実装・環境・依存不備の可能性 baseline preflight | human_judgment | human_judgment | 絶対に潰さない5. 「mutation-free helper」が VC 実行の副作用を無視している
#492 は helper を mutation-free としていますが、baseline preflight は
subprocess.run(..., shell=False)で実際にコマンドを実行します。shell=Falseは shell injection 面では有利ですが、実行対象コマンド自体の filesystem/network 副作用を消すものではありません。Python 公式ドキュメントでもsubprocess.run()は外部プロセス実行 API であり、shell の既定は false です。(GitHub)修正要求:
contract_readiness_check.pyに mode を分けてください。edit-issueの pre-mutation guard で arbitrary VC を実行する設計は危険です。最低でも allowlist、timeout、cwd固定、環境変数制限、network禁止方針、実行ログの minimal_context 制限が必要です。高品質化のための具体設計
1. 出力 schema を固定する
#244 は「AI が failing rule + minimal_context から修正できる」ことを親方針にしています。(GitHub) そのため #492 の
ISSUE_CONTRACT_READINESS_RESULT_V1は prose contract ではなく、JSON Schema か golden fixture で固定すべきです。JSON Schema は JSON document の validation vocabularies を定義する標準仕様として使えます。(json-schema.org)推奨形:
errors[]は string 配列では不十分です。最低限、rule_id,severity,source_check,category,section,line_start,line_end,minimal_context,fix_hint,autofixableを持たせてください。2.
edit-issueへの接続位置を明確化するGitHub CLI の
gh issue editは--body-fileで本文ファイルを読み込めます。(GitHub CLI) 現行edit-issueは body backup → body生成 → guard →gh issue edit --body-fileの流れです。(GitHub)#492 の guard はこの既存 guard の直前または同一段に入れるべきです。
human_judgmentを edit-issue で許可するかは明文化が必要です。fail-closed ならgo以外は拒否です。human_judgmentを通すなら、それは fail-closed ではありません。3. CI 追加を AC に入れる
#367 では、validator tests が CI に入っていないことが blocker として指摘されました。(GitHub) #492 でも同じ失敗を避ける必要があります。
追加すべき AC:
fixture 設計への要求
#492 は #412 を blocked/go fixture に使う方針ですが、#412 は secret boundary 実装Issueであり、secret 値・hash・base64・comment dumping などを明示的に out-of-scope にしています。(GitHub)
fixture は #412 の全文コピーではなく、契約構造だけを抽出した synthetic fixture にしてください。必要なのは secret 実装ではなく、次の contract anti-pattern です。
immediate RVA fields 欠落
fenced bash ではない VC
compound VC
AC/VC marker 不一致
baseline preflight の
blockedvalidate_issue_body の LPxxx error
human_judgmentを潰さない mixed result推奨する #492 本文修正
#492 に次を追記すると実装品質が上がります。
最終判断
実装方針は正しいですが、現Issueは 仕様境界がまだ粗い です。特に #456 との SSOT 衝突、#492 自身の VC 契約違反、immediate RVA 検証の不足、baseline preflight status の lossy mapping は blocker です。
このIssueは、実装開始前に少なくとも次を直すべきです。
## 判定: REQUEST_CHANGES / 現状のまま実装開始は危険実装: VC_SINGLE_COMMAND_GUARDRAIL を issue-author 直書きから body-authoring 正本へ移設する #456 を依存関係に格上げ、または
issue-authorへの詳細ルール追加を撤回。実装: issue-contract-review の BLOCKED 結果を review-issue / issue-author / edit-issue に接続し、refinement 中に contract 不備を修正可能にする #492 の Verification Commands を fenced bash + single command + AC marker に修正。
blocked/human_judgment/needs_fixmapping table を明文化。--mode staticと--mode executeを分離。result schema / golden fixture / CI gate を AC に追加。
immediate Runtime Verification Applicability の必須フィールド検査を新 helper の明示責務にする。
#492 の狙い自体は妥当です。
issue-contract-reviewのBLOCKEDをimpl-review-loopまで持ち越さず、review-issue / issue-author / edit-issueの refinement 中に修正可能にする、という接続点は親Issue #244の「validator/preflight の機械結果と minimal_context だけで AI が修正できる状態にする」方針と整合しています。([GitHub]1)ただし、現行案は #456 未解決、VC parser 仕様、Runtime Verification Applicability の即時検証、baseline preflight の status semantics を甘く見ています。このままだと「BLOCKED を解消する仕組み」ではなく、「BLOCKED を別名の
needs_fixに詰め替えるだけの層」になります。致命的問題
1. #456 と SSOT が衝突している
#492 は
issue-authorに AC3/AC4 修正ルールを追加するとしつつ、#456 の SSOT には踏み込まない、としています。これは危険です。#456 はまさに VC authoring rule を.claude/skills/create-issue/references/body-authoring.mdに集約し、issue-author.mdから詳細ルールを排除するためのIssueです。([GitHub]1)さらに現状の
body-authoring.mdにはまだ&& echo PASS || echo FAILや pipe を含む例が残っており、baseline preflight の「単一コマンド」前提と矛盾しています。([GitHub]2)修正要求: #492 は
depends_on: 456に格上げするか、少なくともissue-authorには詳細な VC authoring rule を置かず、contract_readiness_check.pyの診断結果を body-authoring SSOT に誘導するだけにしてください。issue-author.mdに新しい規則を直接増やすと、#452/#456 で既に指摘された「SubAgent 定義が運用設計書化する」問題を再発させます。([GitHub]3)2. #492 自身の Verification Commands が契約違反になり得る
#327 の validator は fenced bash の VC を要求し、#329 の baseline preflight も
## Verification Commands配下の fenced bash block からコマンドを抽出する設計です。([GitHub]4)一方、#492 の Verification Commands は indented code block 風で、全コマンドが fenced bash ではありません。また
|、複数行、! rg ...、python - <<'PY'系の構造が混在しており、baseline preflight の compound-command 検出ではblockedになり得ます。([GitHub]1)修正要求: #492 の本文自体を先に修正してください。各 VC は fenced bash、1 AC につき単一コマンド、
# AC<N>marker を明示、pipe/heredoc/compound shell を避ける必要があります。自分自身が通らない契約を実装Issueにしないでください。3. AC4 の immediate runtime-field 検証は既存 validator では足りない
#492 は
Runtime Verification Applicability decision: immediateの場合にapplicable_acs / execution_environment / skip_conditions / fallback_policy / artifact_requirements欠落をneeds_fixにする、としています。([GitHub]1)しかし既存
validate_issue_body.pyの LP020 は、主に section/decision と deferred 用フィールドを見ており、immediate 用の具体フィールド完全性までは検査していません。([GitHub]5)修正要求:
contract_readiness_check.py側で AC4 専用の parser/check を明示実装してください。validate_issue_body.pyの LP020 に依存すると false negative が出ます。診断は最低限、rule_id,section,field,line_start,minimal_context,fix_hint,autofixable=trueを持つべきです。4.
blockedを機械的にneeds_fixへ写像すると壊れる#329/#354 の経緯では、
blockedとhuman_judgmentの優先順位・保持が重要な論点でした。特に「blocked と human_judgment が混在した場合に human_judgment が勝つ」バグがレビューで指摘され、blocked優先に直されています。([GitHub]6)#492 の
go | needs_fix | human_judgmentへの集約は、baseline preflight のblockedcategory を潰しやすいです。例えばcompound_command_disallowedは本文修正で直せるためneeds_fixでよい一方、環境依存・command not found・timeout・retrieval/extraction error は本文修正では直らない場合があります。pytestの exit code 5 “No tests collected” のように、preflight 側で意味づけされる終了コードもあります。([GitHub]7)修正要求: mapping table をIssue本文に追加してください。最低限、次を分けるべきです。
needs_fixcompound_command_disallowedneeds_fixneeds_fixまたはhuman_judgmenthuman_judgmenthuman_judgmenthuman_judgmenthuman_judgment5. 「mutation-free helper」が VC 実行の副作用を無視している
#492 は helper を mutation-free としていますが、baseline preflight は
subprocess.run(..., shell=False)で実際にコマンドを実行します。shell=Falseは shell injection 面では有利ですが、実行対象コマンド自体の filesystem/network 副作用を消すものではありません。Python 公式ドキュメントでもsubprocess.run()は外部プロセス実行 API であり、shell の既定は false です。([GitHub]7)修正要求:
contract_readiness_check.pyに mode を分けてください。edit-issueの pre-mutation guard で arbitrary VC を実行する設計は危険です。最低でも allowlist、timeout、cwd固定、環境変数制限、network禁止方針、実行ログの minimal_context 制限が必要です。高品質化のための具体設計
1. 出力 schema を固定する
#244 は「AI が failing rule + minimal_context から修正できる」ことを親方針にしています。([GitHub]8) そのため #492 の
ISSUE_CONTRACT_READINESS_RESULT_V1は prose contract ではなく、JSON Schema か golden fixture で固定すべきです。JSON Schema は JSON document の validation vocabularies を定義する標準仕様として使えます。([json-schema.org]9)推奨形:
{ "schema": "ISSUE_CONTRACT_READINESS_RESULT_V1", "status": "go", "body_sha256": "sha256:...", "source_checks": [ { "name": "validate_issue_body", "schema": "loop_body_lint/v1", "status": "pass", "exit_code": 0 } ], "errors": [], "minimal_context": [], "fix_hint": null }errors[]は string 配列では不十分です。最低限、rule_id,severity,source_check,category,section,line_start,line_end,minimal_context,fix_hint,autofixableを持たせてください。2.
edit-issueへの接続位置を明確化するGitHub CLI の
gh issue editは--body-fileで本文ファイルを読み込めます。(GitHub CLI) 現行edit-issueは body backup → body生成 → guard →gh issue edit --body-fileの流れです。([GitHub]11)#492 の guard はこの既存 guard の直前または同一段に入れるべきです。
human_judgmentを edit-issue で許可するかは明文化が必要です。fail-closed ならgo以外は拒否です。human_judgmentを通すなら、それは fail-closed ではありません。3. CI 追加を AC に入れる
#367 では、validator tests が CI に入っていないことが blocker として指摘されました。([GitHub]12) #492 でも同じ失敗を避ける必要があります。
追加すべき AC:
fixture 設計への要求
#492 は #412 を blocked/go fixture に使う方針ですが、#412 は secret boundary 実装Issueであり、secret 値・hash・base64・comment dumping などを明示的に out-of-scope にしています。([GitHub]13)
fixture は #412 の全文コピーではなく、契約構造だけを抽出した synthetic fixture にしてください。必要なのは secret 実装ではなく、次の contract anti-pattern です。
blockedhuman_judgmentを潰さない mixed result推奨する #492 本文修正
#492 に次を追記すると実装品質が上がります。
最終判断
実装方針は正しいですが、現Issueは 仕様境界がまだ粗い です。特に #456 との SSOT 衝突、#492 自身の VC 契約違反、immediate RVA 検証の不足、baseline preflight status の lossy mapping は blocker です。
このIssueは、実装開始前に少なくとも次を直すべきです。
issue-authorへの詳細ルール追加を撤回。blocked/human_judgment/needs_fixmapping table を明文化。--mode staticと--mode executeを分離。squne121 commentedon May 30, 2026
Contract Review: BLOCKED (2026-05-30T00:07:00Z)
不足項目
uv run python3 contract_readiness_check.py ...file_not_found_unrunnable$ test -f .claude/skills/issue-contract-review/scripts/contract_readiness_check.pyに変更、または# preflight-scope: runtime_onlyを追加uv run pytest ... -k "<new_keyword>"regression_gate/blocked# preflight-scope: runtime_onlyを追加rg -n "VC_SINGLE_COMMAND_GUARDRAIL" .claude/agents/issue-author.mdunexpected_pass$ test ! -f .claude/agents/issue-author.md← 存在はするので別の "absence" チェックに変更すべきAC6 VC 再設計の推奨
AC6 の意図は「
issue-author.mdに新規 VC authoring rule が直書きされていないこと」を確認すること。しかし現行 VC はVC_SINGLE_COMMAND_GUARDRAILタグの存在を確認するだけで、それが既に存在するため baseline で pass してしまいます。推奨 VC:
(PR レビュー時に「直書きルールがないこと」を確認する形に変更)
推奨アクション
issue-refinement-loopを起動し、以下の VC 修正を行ってください:test -f .claude/skills/issue-contract-review/scripts/contract_readiness_check.pyに変更# preflight-scope: runtime_onlyを追加# preflight-scope: pr_review_onlyマーカーを追加するか、"absence of new rules" を確認する形に再設計squne121 commentedon May 30, 2026
Contract Snapshot (2026-05-30T00:14:30Z)
issue-refinement-loop実行中にissue-contract-review相当の deterministic blocker がreview-issue→issue-author→edit-issueの通常経路で修正される。contract_readiness_check.pyが存在し fixture tests が PASS している。.claude/skills/issue-contract-review/scripts/,.claude/skills/review-issue/,.claude/agents/issue-reviewer.md,.claude/agents/issue-author.md,.claude/skills/edit-issue/,.claude/skills/create-issue/references/body-authoring.md.claude/worktrees/issue-492-issue-contract-review-blocked-review-issworktree-issue-492-issue-contract-review-blocked-review-isssqune121 commentedon May 30, 2026
implement-issue: 実装完了 (2026-05-30T00:26:54Z)
.claude/worktrees/issue-492-issue-contract-review-blocked-review-issworktree-issue-492-issue-contract-review-blocked-review-issfix(#492): address 6 PR review blockers for contract_readiness_check
squne121 commentedon May 30, 2026
implement-issue: PR #497 レビューフィードバック修正完了 (2026-05-30T00:49:49Z)
6ブロッカーすべて修正しました。
修正内容
B1 & B4 (--mode preflight-static + operator sync):
--mode preflight-staticをstaticのエイリアスとして追加baseline_vc_preflight.pyと同期(<,>,<<<追加)review-issue/SKILL.md/issue-reviewer.mdを--mode preflight-static使用に更新B2 (structured_blockers):
REVIEW_ISSUE_RESULT_V1にstructured_blockersフィールド追加(machine-readable errors[])blocking_issuesは人間向け fix_hint 文字列、structured_blockersは構造体のままB3 (issue-author repair contract):
body-authoring.mdに「Issue-Author Repair Contract by Blocker Category」セクション追加B5 (non-assertive AC3 tests):
test_contract_readiness.pyに synthetic preflight JSON を渡す unit test 5件追加B6 (Safety Claim Matrix):
fix(#492): address 6 PR blockers — validator human_judgment, lossless…
feat(#492): add contract_readiness_check.py and wire into review-issu…