Repository navigation
Description
Machine-Readable Contract
contract_schema_version: v1
issue_kind: implementation
subkind: docs-only
goal_ref: "loop-state.md 散文中の review phase hard_stop_eligible 誤記を修正し docs 整合性を回復する"
allowed_paths:
- ".claude/skills/issue-refinement-loop/references/loop-state.md"
acceptance_criteria:
- id: AC1
description: "references/loop-state.md の散文中で hard_stop_eligible == true の例示から review が削除され、正しい prose が存在している"
- id: AC2
description: "同ファイルの phase table(review | continue_investigation | false)は変更されていない"
- id: AC3
description: "修正後の散文が post_rewrite_check および decide_next_action のみを hard_stop_eligible == true の phase として列挙している"
- id: AC4
description: "loop-state.md の phase table description が review phase で decide_next_loop_action.py を呼ばないことを明示している"
- id: AC5
description: "pnpm typecheck と pnpm test が pass する(pnpm lint/build は本 Issue 対象外の pre-existing failure があるため対象外)"
labels:
- documentation
- area/ai-ops
dedupe_key: "fix:loop-state.md:review-phase-hard-stop-eligible-prose"
related_issue: "#1013"
related_pr: "#1030"Parent Issue
なし(standalone 実装 Issue)
Parent Goal Ref
issue-refinement-loop の phase gate 整合性維持 — PR #1030 マージ後に残存した loop-state.md 散文誤記を修正し、normative docs と実装の一貫性を保つ。
Current Validated Scope
.claude/skills/issue-refinement-loop/references/loop-state.mdの散文中のhard_stop_eligible == true例示からreviewを削除する 1 箇所のみ
Remaining Parent Gaps
なし
Goal
.claude/skills/issue-refinement-loop/references/loop-state.md の散文中で review phase の hard_stop_eligible が true と誤記されている箇所を false に修正する。
Background
PR #1030(Issue #1013: issue-refinement-loop phase gate 追加)のマージ後、PR reviewer が以下の非ブロッカー誤記を指摘した:
- ファイル:
.claude/skills/issue-refinement-loop/references/loop-state.md - 問題: phase table 直後の散文で
reviewphase がhard_stop_eligible: trueであるかのように記述されている - 正しい値:
reviewphase は pre-rewrite phase のためhard_stop_eligible: false - 影響: 直上の phase table(
review | continue_investigation | false)は正確であり、実装・テストも正しい。runtime 動作への影響はなく、docs の一貫性問題のみ
具体的には、以下の誤記が存在する:
hard_stop_eligible == true (i.e., phase is 'review', 'post_rewrite_check', or 'decide_next_action')
この文の review は hard_stop_eligible: false であるため削除し、正しくは post_rewrite_check または decide_next_action とすべきである。
重要性: loop-state.md は orchestrator/agent 向け契約文書であるため、誤記を放置すると将来の routing 実装・手順修正で誤った hard stop を再導入するリスクがある。現行コードの phase gate と allowlist が守られる限り runtime 影響はないが、normative docs の矛盾として修正が必要。
品質ゲートについて: pnpm lint および pnpm build はこの Issue と無関係の pre-existing failure が存在する(pnpm lint: 3980 errors、pnpm build: rolldown error)。これらは本 Issue のスコープ外であり、別途追跡される。AC5 は pnpm typecheck と pnpm test のみを対象とする。
Outcome
.claude/skills/issue-refinement-loop/references/loop-state.md の散文中で review が hard_stop_eligible == true の例示から除外され、phase table との整合性が保たれる。review phase が explicitly not hard-stop eligible であることが散文中でも明確になる。
In Scope
.claude/skills/issue-refinement-loop/references/loop-state.mdの散文誤記修正(reviewをhard_stop_eligible == true例示から除外)
Out of Scope
- runtime ロジック(
build_refinement_phase_state.py等)の変更 - テストファイルの変更
- phase table の変更(既に正確)
pnpm lint/pnpm buildの pre-existing failure 修正
Acceptance Criteria
- AC1:
references/loop-state.mdの散文中でhard_stop_eligible == trueの例示からreviewが削除され、正しい prose が存在している - AC2: 同ファイルの phase table(
review | continue_investigation | false)は変更されていない(既に正確) - AC3: 修正後の散文が
post_rewrite_checkおよびdecide_next_actionのみをhard_stop_eligible == trueの phase として列挙している - AC4:
loop-state.mdの phase table description がreviewphase でdecide_next_loop_action.pyを呼ばないことを明示している - AC5:
pnpm typecheckとpnpm testが pass する
Verification Commands
# AC1
$ rg "is .post_rewrite_check. or" .claude/skills/issue-refinement-loop/references/loop-state.md# AC2
# baseline-expect: pass
$ rg "review.*continue_investigation.*false" .claude/skills/issue-refinement-loop/references/loop-state.md# AC3
$ rg "post_rewrite_check. or.*decide_next_action" .claude/skills/issue-refinement-loop/references/loop-state.md# AC4
# baseline-expect: pass
$ rg "NOT call.*decide_next_loop_action" .claude/skills/issue-refinement-loop/references/loop-state.md# AC5
$ pnpm typecheck
$ pnpm testAllowed Paths
.claude/skills/issue-refinement-loop/references/loop-state.md
Runtime Verification Applicability
runtime_verification_applicability:
decision: not_applicable
status: not_applicable
reason: "docs-only 変更。loop-state.md は参照ドキュメントであり実行されない。"Stop Conditions
- Allowed Paths 外のファイルへの変更が必要と判明した場合
loop-state.mdの phase table や実装ロジックを変更しないと散文修正できない場合- PR レビューで先行 Issue の実装が必要と判明した場合
scope-signal-guard.mdの内容と矛盾する修正が必要と判明した場合- 散文修正が
references/内の他ファイルへの連鎖修正を引き起こす場合 build_refinement_phase_state.pyの実装と不整合が生じる修正が必要と判明した場合
Required Skills
- Markdown ドキュメント編集
loop-state.mdの phase gate 仕様の理解(hard_stop_eligiblesemantics)
Source
- dedupe_key: "fix:loop-state.md:review-phase-hard-stop-eligible-prose"
- origin: post-merge-cleanup(PR feat(#1013): issue-refinement-loop に phase gate を追加し preflight 直後の誤った human_escalation を防ぐ #1030)
- related_issue: 実装: issue-refinement-loop に phase gate を追加し preflight 直後の誤った human_escalation を防ぐ #1013
- related_pr: feat(#1013): issue-refinement-loop に phase gate を追加し preflight 直後の誤った human_escalation を防ぐ #1030
Activity
squne121 commentedon Jun 20, 2026
結論
Issue #1040 は 対応すべきです。ただし、単なる「散文の誤字」ではなく、
issue-refinement-loopの phase gate 契約に関わる normative docs の矛盾修正として扱うべきです。現状の
loop-state.mdは、phase table ではreview | continue_investigation | falseと正しく定義している一方、その直後の散文でreviewをhard_stop_eligible == trueの例に含めています。これは #1040 の指摘どおり矛盾しています。敵対的レビュー
1. #1040 の問題設定は正しい
#1040 は、PR #1030 後の follow-up として、
loop-state.mdの散文中にあるreviewphase のhard_stop_eligible誤記を直す Issue です。Issue 本文では、正しい値はreview: false、hard_stop_eligible == trueはpost_rewrite_checkとdecide_next_actionのみと明記されています。また、#1040 自体にはコメントがなく、追加仕様や反対意見はありません。
2. 「runtime 影響なし」はやや危険な断定
#1040 本文では「runtime 動作への影響はなく、docs の一貫性問題のみ」とされていますが、これは phase gate を正しく守る orchestrator 前提なら成立します。敵対的に見ると、この断定は弱いです。
build_refinement_phase_state.pyの実装では、reviewphase はhard_stop_eligible: Falseで、decide_next_loop_action.pyも forbidden router に入っています。 一方、post_rewrite_checkとdecide_next_actionはhard_stop_eligible: Trueです。ただし、
decide_next_loop_action.pyの中核 routing は、呼ばれてしまえばscope_signal_guard.triggeredかつexcluded_by_anchor_reframe == falseをhuman_escalationにします。 つまり、docs の誤記を読んだ人間または agent がreviewphase で router を呼ぶ実装に寄せると、#1013 が防ごうとした premature human escalation を再導入できます。したがって、#1040 の説明はこう補強すべきです。
3. 修正範囲は妥当。ただし同じ行周辺に小さな追加矛盾がある
#1040 の Allowed Path を
.claude/skills/issue-refinement-loop/references/loop-state.mdだけに限定するのは妥当です。scope-signal-guard.md側は、reviewをhard_stop_eligible: falseとして正しく記述しています。ただし、
loop-state.mdのpreflight行は “proceed to investigation/review” と書いており、scope-signal-guard.md側の “investigation/web_research/review” と完全一致していません。#1040 の主目的ではありませんが、同一ファイル・同一表の整合性修正として、ついでに
investigation/web_research/reviewにそろえる価値があります。推奨パッチ
最小修正はこれです。
品質を上げるなら、曖昧さを潰してこうする方が安全です。
任意の同時修正として、同じ表の preflight 行も合わせるなら以下です。
Acceptance Criteria の改善案
現行 AC は概ね妥当ですが、grep が粗いです。特に AC3 の
post_rewrite_check.*decide_next_actionは、同じ行に両方があれば通るだけで、「review が除外された」ことの強い証明にはなりません。修正版は以下がよいです。
検証コマンドも、より exact にするなら以下です。
WEB調査からの品質化ポイント
JSON Schema では、
additionalProperties: falseにより未定義プロパティを拒否でき、requiredで必須キーを定義します。したがって #1013 の設計どおり、phaseをLOOP_STATE_V1に混ぜず、別契約ISSUE_REFINEMENT_PHASE_STATE_V1として扱う方針は妥当です。(JSON Schema)python-jsonschemaはvalidate()で最初のValidationErrorを投げますが、複数エラーを構造化したい場合はiter_errors()が使えます。今回 #1040 ではコード変更不要ですが、将来ISSUE_REFINEMENT_ROUTER_ERROR_V1のmissing_fields/unexpected_fieldsを高品質化するなら、単一メッセージ抽出よりiter_errors()ベースに寄せるべきです。([jsonschema]2)また Python の
sys.exit()は 0 が正常、非 0 が異常終了として扱われ、Unix 系では 2 がコマンドライン構文エラーによく使われます。decide_next_loop_action.pyは exit 3 をrouter_error/inconsistent_stateに使う内部契約なので、docs 側ではhuman_escalationとrouter_error: rebuild_phase_stateを混同しない記述にするのが重要です。([Python documentation]3)最終判定
実装可。ただし PR レビューでは “docs-only trivial” として流さず、契約文書の矛盾修正として見るべきです。
推奨する実装方針は次の通りです。
loop-state.mdの hard-stop prose からreviewを削除する。investigation/web_research/reviewに合わせる。squne121 commentedon Jun 20, 2026
Refinement Loop: Approved
The issue has been approved and is ready for implementation.
approvedsqune121 commentedon Jun 20, 2026
CONTRACT_REVIEW_RESULT_V1
squne121 commentedon Jun 20, 2026
実装完了レポート
PR #1045 を Draft で作成しました。
実施内容
.claude/skills/issue-refinement-loop/references/loop-state.mdの散文中、hard_stop_eligible == trueの例示からreviewphase を削除しました。変更箇所 (91-96行目):
修正前:
修正後:
AC 検証結果
rg "is .post_rewrite_check. or"rg "review.*continue_investigation.*false"rg "post_rewrite_check. or.*decide_next_action"rg "NOT call.*decide_next_loop_action"pnpm typecheckpnpm testAllowed Paths 準拠
変更ファイル:
.claude/skills/issue-refinement-loop/references/loop-state.mdのみ(contract の Allowed Paths 内)fix(#1013-followup): loop-state.md 散文誤記修正 — review phase を hard_stop_…