Repository navigation
Description
Parent Issue
なし(単独改善)
Machine-Readable Contract
contract_schema_version: v1
issue_kind: implementation
parent_issue: "none"
goal_ref: "TERMINATION_REPORT_INPUT_V1 の loop_handoff 入力形状(wrapper object / inner object の両対応、正規化ロジックの挙動)を正式ドキュメントに明文化すること"
change_kind: docsParent Goal Ref
- Goal: なし(単独改善のため親 Issue 不在)
- Desired Destination: N/A
Current Validated Scope
.claude/skills/issue-refinement-loop/references/termination-policy.mdのTERMINATION_REPORT_INPUT_V1スキーマ定義にloop_handoffフィールドの説明を追記する
Remaining Parent Gaps
なし
Outcome
.claude/skills/issue-refinement-loop/references/termination-policy.md の TERMINATION_REPORT_INPUT_V1 スキーマ定義に loop_handoff(任意フィールド)の入力形状が明文化され、wrapper object({"LOOP_HANDOFF_RESULT_V1": {...}})と inner object の両方を受け付けること、および _normalize_loop_handoff() が両形式をどう正規化するかが記述されている状態。
Background
PR #1317(Issue #1311)のレビューで、render_termination_report.py の loop_handoff 入力が wrapper 形式({"LOOP_HANDOFF_RESULT_V1": {...}})と inner object の両方を受け付けることが判明したが、TERMINATION_REPORT_INPUT_V1 の正式スキーマ定義(.claude/skills/issue-refinement-loop/references/termination-policy.md の該当セクション)にはこの入力形状が一切記載されていない。
実装コード(_normalize_loop_handoff())は、渡された loop_handoff がちょうど1つのキー LOOP_HANDOFF_RESULT_V1 を持ち、その値が dict である場合のみ unwrap し、それ以外はそのまま inner object として扱う。この挙動がドキュメント化されていないため、将来の orchestrator 実装者が inner/wrapper のどちらを渡すべきか混乱する可能性がある(PR #1317 レビューで non-blocking follow-up として明示的に切り出されている)。
In Scope
.claude/skills/issue-refinement-loop/references/termination-policy.mdのTERMINATION_REPORT_INPUT_V1セクションにloop_handoffフィールド(任意, wrapper object / inner object の両対応)の説明を追記する_normalize_loop_handoff()の正規化ロジック(wrapper 判定条件・inner object 扱いのフォールバック)を文章で説明する
Out of Scope
_normalize_loop_handoff()自体のロジック変更(実装は変更しない。ドキュメント追記のみ)LOOP_HANDOFF_RESULT_V1terminal contract 本体(schemas/loop_handoff_result_v1.json)の変更
Acceptance Criteria
- AC1:
.claude/skills/issue-refinement-loop/references/termination-policy.mdのTERMINATION_REPORT_INPUT_V1セクションにloop_handoff:という YAML フィールドが記載されている - AC2: 同セクション付近に
wrapper objectという語句を用いて inner object との両対応が明記されている - AC3: 同セクション付近に
_normalize_loop_handoffの正規化条件(キー集合がLOOP_HANDOFF_RESULT_V1のみで値が dict の場合にのみ unwrap する)が説明されている
Verification Commands
# AC1
$ rg -n "loop_handoff:" .claude/skills/issue-refinement-loop/references/termination-policy.md
# AC2
$ rg -n "wrapper object" .claude/skills/issue-refinement-loop/references/termination-policy.md
# AC3
$ rg -n "_normalize_loop_handoff" .claude/skills/issue-refinement-loop/references/termination-policy.mdAllowed Paths
.claude/skills/issue-refinement-loop/references/termination-policy.md
Stop Conditions
- Allowed Paths 外の変更が必要と判明した場合
- In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
- 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
- 後続 Phase / 別スコープへの波及が判明した場合
- nested SubAgent delegation が必要になった場合
- 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
Required Skills
なし
Scope Delta(任意)
N/A
Delivery Rule
1 Issue = 1 PR。worktree で作業し、Draft PR を既定とする。
Notes for Reviewer
- 本 Issue は post-merge-cleanup 用の
issue_kind: documentationという起票候補ラベルを受けたが、リポジトリのissue_kind契約(docs/dev/agent-skill-boundaries.md)はimplementation/research/parentのみを許容し、docs等の分類はlabelsに入れる規約のため、issue_kind: implementation(change_kind: docs)+documentationlabel へ写像した。タイトル prefix も同様の理由で実装:に統一している。
Source(自動起票 Issue 必須セクション)
- origin_skill: pr-review-judge
- source_url: feat: issue-refinement-loop termination report に LOOP_HANDOFF_RESULT_V1 marker生成を実装する #1317 (comment)
- source_note_id: termination_report_input_schema_clarification
- dedupe_key: follow-up:squne121/loop-protocol:1317:termination_report_input_schema_clarification
Activity