Repository navigation
Description
Machine-Readable Contract
contract_schema_version: v1
issue_kind: parent
goal_ref: "impl-review-loop 系の決定論的 gate 自動化と compact verdict 化により token/context 浪費を削減する"
change_kind: workflow
parent_mode: delivery-rollup
closure_mode: child-completeSummary
2026-06-12 提供の運用監査レポート(Issue #786 / #788 の Claude Code ログ、Issue #778 の Codex ログ分析)で、impl-review-loop を中心とした以下の token / context 浪費ホットスポットが特定された。
missing_contract_goで停止 → 人間がYを返答 →issue-contract-reviewを手動起動する往復が 実装: 戦闘中の debug pause/resume surface を追加する #786 / 実装: Player 向け HP / HULL 表示ポリシーを通常 UI に適用する #788 / 実装: implementation-worker の update_branch を expected_head_sha TOCTOU guard と REST contract test で堅牢化する #778 で同型反復しているcontract_readiness_check.pyの CLI option drift(--issueと--issue-number)で Codex が失敗・再実行している- PR Body Japanese Check の失敗確認に
gh run view --logの grep 結果が main context へ流入している - PR body 日本語修正が repair plan なしで反復され、全 AC pass でも max_iterations に到達した事例がある(実装: Player 向け HP / HULL 表示ポリシーを通常 UI に適用する #788)
- scope rollup の
invocation_idが shell PID 展開依存で full verification できず deferred になっている - session manifest hook に
issue-402の hard-code があり(generate_session_manifest_from_hook.mjs:185)、artifact identity が実行中 Issue とズレる issue-contract-review(458 行)/pr-review-judge(710 行)の SKILL.md 入口が長く、progressive disclosure が不十分- Codex 側
AGENTS.mdの rtk 境界に対し、Claude 側に対応する観測手段がない
本 parent は、これらに対する決定論的対策(contract snapshot 自動 materialize / CI verdict compactor / PR body Japanese repair planner / scope rollup self-validating 化 / hook identity 修正 / SKILL.md progressive disclosure / rtk shadow guard)を child issue として bundle する delivery-rollup tracker である。
Goal
impl-review-loop 実行 1 回あたりの「人間 Y 介入」「失敗コマンド再実行」「raw ログの main context 流入」を決定論的 script で排除し、loop が missing_contract_go から人間介入なしで継続できる状態にする。
Desired Destination
ensure_contract_snapshot.py による contract review 自動 materialize、ci_verdict_summary.py による CI ログ compact 化、pr_body_japanese_repair_plan.py による PR body 修復の決定論化、scope rollup result の self-validating 化、session manifest の issue identity 動的解決、SKILL.md の progressive disclosure 分離、rtk boundary shadow guard が repo に反映され、impl-review-loop が「missing_contract_go での人間介入 0 回・CI / Japanese check の raw ログ流入 0 回」で完走できる状態。
Current Validated Scope
.claude/skills/impl-review-loop/**(SKILL.md / steps / scripts / tests).claude/skills/issue-contract-review/**(SKILL.md / scripts / tests).claude/skills/pr-review-judge/**(SKILL.md / scripts / references / tests).claude/skills/open-pr/scripts/**.claude/skills/issue-refinement-loop/scripts/plan_issue_scope_rollup.pyと関連 tests.claude/agents/scope-rollup-runner.md.claude/hooks/**/.claude/settings.jsonscripts/generate-session-manifest.mjs/tests/agent-session-manifest*.test.ts
Decisions Fixed
- 2026-06-12: 監査レポートの提案 §8.1〜§8.10 のうち、新規性のある 7 件を本 parent の child として起票する。§8.1+§8.2 は密結合のため 1 child に統合する
- 2026-06-12: §8.5(SubAgent handoff envelope)は既存 実装: agent preflight bundle と task packet generator を追加する #790(agent preflight bundle / task packet generator)へ routing し、本 parent では起票しない
- 2026-06-12: §8.6(Allowed Paths trailing slash 正規化)は既存 実装: allowed_paths_review_gate.py の trailing-slash パターンをディレクトリプレフィックスとして扱う #812 で起票済みのため、本 parent では起票しない
- 2026-06-12: §9.6(agent_log_compactor)は既存 実装: transcript hotspot summarizer(summarize_agent_transcript.py)を追加し agent ops レビューを回帰計測可能にする #798(transcript hotspot summarizer、導入: agent ops の token/context 浪費を決定論的 preflight / compact contract / hook 規律で削減する #791 child)と重複するため、本 parent では起票しない
- 2026-06-12: 導入: agent ops の token/context 浪費を決定論的 preflight / compact contract / hook 規律で削減する #791 は issue-refinement-loop 起点の token 削減 parent であり、本 parent(impl-review-loop 起点)とはスコープを分離して運用する
Quality Decision Record
Status: N/ADecision Date: 未記録Does this prove the parent goal complete?: N/AReason: delivery-rollup parent のため N/AEvidence: N/ANext Action: child issue を依存順(contract 自動化 → 各 compactor → progressive disclosure)に実装する
Parent Closure Rule
delivery-rollup: 本 parent の child issue 7 件がすべて CLOSED になった時点でクローズする。実装: agent preflight bundle と task packet generator を追加する #790 / 実装: allowed_paths_review_gate.py の trailing-slash パターンをディレクトリプレフィックスとして扱う #812 / 実装: transcript hotspot summarizer(summarize_agent_transcript.py)を追加し agent ops レビューを回帰計測可能にする #798 へ routing した項目は本 parent の close 条件に含めないquality-gate: N/Arouting-map: N/Adecision-log: N/A- 非
quality-gateparent のQuality Decision RecordはN/A扱いでよく、close 判定の必須材料にしない
Child Issues
着手順(前提となる Issue が上):
- 実装: impl-review-loop の missing_contract_go で issue-contract-review を自動 materialize する #817 — 1: impl-review-loop の missing_contract_go で issue-contract-review を自動 materialize する(ensure_contract_snapshot.py / run_contract_review_once.py)
- 実装: pr-review-judge に ci_verdict_summary.py を追加し CI ログを compact verdict 化する #818 — 2: pr-review-judge に ci_verdict_summary.py を追加し CI ログを compact verdict 化する
- 実装: open-pr に pr_body_japanese_repair_plan.py を追加し PR body 日本語修復を決定論化する #819 — 3: open-pr に pr_body_japanese_repair_plan.py を追加し PR body 日本語修復を決定論化する
- 実装: scope rollup result を self-validating 化し verify を 1 コマンドに集約する #820 — 4: scope rollup result を self-validating 化する(invocation_id / sha256 を script 側で一括生成)
- 実装: session manifest hook の issue-402 hard-code を除去し issue identity を動的解決する #821 — 5: session manifest hook の issue-402 hard-code を除去し issue identity を動的解決する
- 実装: issue-contract-review / pr-review-judge SKILL.md の progressive disclosure refactor #822 — 6: issue-contract-review / pr-review-judge SKILL.md の progressive disclosure refactor
- 実装: Claude 側 rtk boundary shadow guard hook を shadow mode で追加する #823 — 7: Claude 側 rtk boundary shadow guard hook を shadow mode で追加する
Remaining Parent Gaps
- SubAgent handoff envelope(LOOP_HANDOFF_CONTEXT_V1)は 実装: agent preflight bundle と task packet generator を追加する #790 で追跡する
- Allowed Paths trailing slash 正規化は 実装: allowed_paths_review_gate.py の trailing-slash パターンをディレクトリプレフィックスとして扱う #812 で追跡する
- transcript / 作業ログの定量計測は 実装: transcript hotspot summarizer(summarize_agent_transcript.py)を追加し agent ops レビューを回帰計測可能にする #798(導入: agent ops の token/context 浪費を決定論的 preflight / compact contract / hook 規律で削減する #791 child)で追跡する
- token 削減量の定量効果測定は child 完了後に perf(#296): OUTPUT_BUDGET_V1 効果測定 — SubAgent 代表実行での output_chars/lines 測定 #312 との統合可否を判断する
Phase Handoff Contract
Desired DestinationCurrent Validated ScopeRemaining Parent GapsCurrent ObjectiveBounded Current ContextNormative ReferencesAllowed PathsRequired SkillsValidation CommandsStop ConditionsOpen QuestionsNext ActionArtifact RefsHandoff Prompt DraftLinked PR(implementation のみ)
Acceptance Criteria
- AC1:
ensure_contract_snapshot.pyが.claude/skills/impl-review-loop/scripts/に存在する(child 1 完了の証跡) - AC2:
ci_verdict_summary.pyが.claude/skills/pr-review-judge/scripts/に存在する(child 2 完了の証跡) - AC3:
pr_body_japanese_repair_plan.pyが.claude/skills/open-pr/scripts/に存在する(child 3 完了の証跡)
child issue 全件の CLOSED 確認は Parent Closure Rule に従う(rollup 判定であり個別 AC にしない)。
Verification Commands
# AC1
test -f .claude/skills/impl-review-loop/scripts/ensure_contract_snapshot.py
# AC2
test -f .claude/skills/pr-review-judge/scripts/ci_verdict_summary.py
# AC3
test -f .claude/skills/open-pr/scripts/pr_body_japanese_repair_plan.pyAllowed Paths
本 parent は tracker のため直接の実装変更を持たない。child issue の Allowed Paths は各 child 本文を正本とする。対象領域は以下。
.claude/skills/impl-review-loop/**.claude/skills/issue-contract-review/**.claude/skills/pr-review-judge/**.claude/skills/open-pr/scripts/**.claude/skills/issue-refinement-loop/scripts/**.claude/agents/scope-rollup-runner.md.claude/hooks/**/.claude/settings.jsonscripts/generate-session-manifest.mjs/tests/agent-session-manifest*.test.ts
Notes
- 分析レポート正本: 本 Issue 起票時のユーザー提供監査レポート(2026-06-12、Issue 実装: 戦闘中の debug pause/resume surface を追加する #786 / 実装: Player 向け HP / HULL 表示ポリシーを通常 UI に適用する #788 / 実装: implementation-worker の update_branch を expected_head_sha TOCTOU guard と REST contract test で堅牢化する #778 の作業ログ分析)
- 関連 OPEN Issue: 実装: agent preflight bundle と task packet generator を追加する #790(preflight bundle / task packet、§8.5 の routing 先)、実装: allowed_paths_review_gate.py の trailing-slash パターンをディレクトリプレフィックスとして扱う #812(trailing slash、§8.6 の routing 先)、導入: agent ops の token/context 浪費を決定論的 preflight / compact contract / hook 規律で削減する #791 / 実装: transcript hotspot summarizer(summarize_agent_transcript.py)を追加し agent ops レビューを回帰計測可能にする #798(refinement-loop 系 token 削減 parent とその child)、実装: contract_snapshot_url の status: go を自動確認するスクリプトを implement-issue に追加する #66(implement-issue 側の status: go 自動確認、本 parent child 1 と統合可否を contract review 時に確認)、perf(#296): OUTPUT_BUDGET_V1 効果測定 — SubAgent 代表実行での output_chars/lines 測定 #312(OUTPUT_BUDGET_V1 効果測定)
ensure_contract_snapshot.pyの自動投稿は GitHub comment という副作用を持つため、child 1 では--dry-run/ idempotency / latest blocked precedence を必須要件とする
Activity
squne121 commentedon Jun 13, 2026
全 child issue (#817〜#823) がクローズされたため、delivery-rollup parent #816 をクローズする。