Skip to content

導入: AIエージェント運用をminimal harnessへ縮退し、過剰なcontrol-planeを廃止する #1860

Open
7 of 7 issues completed

Description

@squne121

Machine-Readable Contract

contract_schema_version: v1
issue_kind: parent
goal_ref: "AIエージェント運用をminimal harnessへ縮退し、live Issue/PR、実diff、実test、current-head CI、独立reviewをauthorityにする"
change_kind: workflow
parent_mode: delivery-rollup
closure_mode: child-complete

Summary

本 parent は個人趣味開発に過剰な独自 control-plane を増やさず、実行可能な最小 harness を維持する。artifact の freshness/digest/自己申告は authority にしない。

Goal

live Issue/PR、実 diff、実テスト、current-head CI、独立reviewを authority とする minimal harness を維持する。

Desired Destination

Closure Matrix が live state に一致し、過剰な delegation graph control-plane を新設せず既存 Issue の改訂だけで処理する。

Owner Decision

Decisions Fixed

Closure Matrix

Issue disposition 根拠
#1833 keep native Multi-Agent V2 minimal rollout parent
#1835 / PR #1879 completed / merged V2設定成果を維持
#1836 not planned graph policy / self-attested validator は過剰
#1837 not planned digest-bound packet authority は採用しない
#1840 not planned graph policy/agent metadata checker の残存scopeなし
#790 not planned #1837 未実装のため completed 訂正
#1838 keep / revised native instruction と実在 consumer の最小移行
#1839 keep / revised worker/designer の最小定義
#1841 keep / revised bounded native runtime smoke
#1842 keep / revised read-only nested canary

Disposition readback: #1836、#1837、#1840、#790 はいずれも CLOSED / NOT_PLANNED。#1835 / PR #1879 の merged成果は維持する。

Remaining Parent Gaps

Current Validated Scope

Out of Scope

  • .codex/hooks.json の変更。
  • 独自 graph control-plane、self-attested binding/digest、専用publisher/reason-code enum。
  • agent-local permission/instruction を security enforcement として扱うこと。

Child Issues

Acceptance Criteria

Quality Decision Record

  • Status: N/A(delivery-rollup parent)。
  • Reason: live Issue/PR、実diff、実test、CI、独立reviewを authority とする。

Parent Closure Rule

既存 child の実作業が完了し、Closure Matrix の disposition を live state で確認できるまで本 parent は open を維持する。

Phase Handoff Contract

Sub-issues

Sub-issues

7 of 7 Issues completed
Loading 7 sub-issues

Activity

  1. added
    tracking
    state/in-progress
    on Jul 30, 2026
  2. squne121 commented on Jul 30, 2026

    @squne121
    OwnerAuthor

    you asked

    message time: 2026-07-30 21:35:32

    #1860
    .内容について関連Issue、PR、リポジトリ資産、コメントを参照した上で敵対的レビューして。
    取り扱う技術や配布物の実装をWEB検索し高品質化してほしい。


    chatgpt response

    Issue #1860の本文・コメント・関連Issue/PR・コード・テスト・CI・配布資産を一次資料と照合します。重大度順に再現条件、設計・検証上の欠陥、反証、修正案を整理します。


    chatgpt response

    現時点で#1860にコメントはなく、未調査のまま廃止方針を先決めしています。診断artifactと安全契約を分離し、相反Issueの脅威モデル・撤去順序・凍結規則を検証します。


    chatgpt response

    Closure Matrixは既に陳腐化し、現行mainの警告/hard gate分離とも不整合です。次にHook種別別の権限境界と、代替CIのTOCTOU・privileged workflow攻撃面を検証します。


    chatgpt response

    Issue #1860 敵対的レビュー

    判定

    REQUEST_CHANGES — 現状のまま子Issueの起票、実装開始、関連Issueの一括closeを進めるべきではありません。

    方向性、すなわち「artifactの欠落やstaleだけで通常開発を止めない」「意味判断を閉じたenumへ過剰変換しない」「Skill・Hook・Agentを薄くする」は妥当です。

    ただし現在の #1860 は、次の三つを混同しています。

    1. 停止権限を持つhard gate
    2. 検証や引継ぎに使う構造化データ
    3. 純粋な観測・telemetry

    この混同により、「blocking authorityを外す」という正しい目的から、「schema・digest・receipt・Hook・observabilityを広く廃止する」という未検証の結論へ飛躍しています。さらに、調査未完了を本文自身が認めながら、削除方針と関連Issueの処分方向を先に固定しています。

    ADVERSARIAL_REVIEW_RESULT:
      verdict: request_changes
      safe_to_spawn_removal_children: false
      safe_to_close_related_issues: false
      primary_blocker: >
        hard gate、provenance、非権威的schema、telemetryを分離せず、
        代替安全境界の実証前に撤去方針を固定している

    評価できる部分

    #1860 の根本問題意識は正しいです。リポジトリの現行方針も、live Issue、canonical worktree、実diff、実テスト、current-head CIをauthoritativeとし、scope snapshot、body SHA、ledger、session manifestなどの欠落・staleを通常作業の前提条件にしない方向へ既に移行しています。

    PR #1854 後の実装も、かなり適切な境界になっています。

    • contract snapshot が missing_go、stale、runtime_error でも実装へ進む
    • trusted authorによる最新の明示的な blocked は停止させる
    • overlap evidenceのschema/hash/drift不整合はwarningとしてPR作成を継続する
    • canonical repository解決失敗やcross-repository binding不一致はfail-closedのまま残す

    つまり、artifactを消すのではなく、artifactから停止権限だけを外す構造です。

    この形を #1860 の基準にすべきです。


    重大な指摘

    P0-1 — Closure Matrixが既にstaleで、親Issue自身のACを満たしていない

    #1860 は #1851 と PR #1854 を双方OPENとして扱い、未完了childに置いています。しかし現在は #1851 がClosed、PR #1854 がMergedです。PR #1854 は2026年7月30日にマージされています。

    起票時点ではOPENだったとしても、本文のAC3は「live state確認済みの状態で表に反映」と要求しています。したがってレビュー時点では、親Issueが自身の受入条件に違反しています。

    これは単なる表記ミスではありません。PR #1854 のレビュー過程では、初回実装に対して以下が後から発見されました。

    • 実際のrouting producerが変更されていなかった
    • canonical repository解決が誤ってfail-open化された
    • cross-repository拒否テストの意味が反転していた
    • warningがPR上に永続化されなかった

    その後の修正で安全境界が復旧しています。つまり「artifact hard gate撤去」は、雑に適用するとrepository identityなど別種の安全制御まで外してしまうことが既に実証されています。

    必要な修正


    P0-2 — 「調査parent」ではなく、結論を固定した撤去プログラムになっている

    本文は、関連Issueについて「title/state/urlレベルしか確認していない」「blocking authorityとして機能するコード箇所の精査が未実施」「childのOutcome・Allowed Paths・ACも未確定」と認めています。

    それにもかかわらず、先に以下を固定しています。

    これは調査結果から決定を導く構造ではなく、撤去という結論を正当化するために後から調査する構造です。

    さらに #1860 には現在コメントがなく、本文外でのownerによる項目別判断や反対証拠への応答もありません。

    必要な修正

    #1860 を二段階に分けるべきです。

    1. decision/research phase
      • producer、consumer、validator、publisher、Hook、docs、testsを列挙
      • 各項目の脅威モデルを記録
      • hard gate / advisory / non-authoritative interchange / delete に分類
      • 代替安全境界の有無を確認
    2. delivery-rollup phase
      • 決定済みの項目だけchild化
      • dependency順に実装
      • main上のruntime evidenceでclose

    少なくとも Decisions Fixed は、調査完了までは Working Hypotheses に下げる必要があります。


    P0-3 — 「権限」と「形式」を混同している

    schema、digest、receiptが存在すること自体はcontrol-planeではありません。

    同じJSONでも、用途は以下のように異なります。

    用途 扱い
    JSONがないため実装開始を拒否する blocking authority
    review結果を機械的に受け渡す interchange format
    current headやrepository identityを検証する provenance/safety evidence
    後日の障害分析に保存する telemetry
    enumでAIの意味判断を強制する semantic control-plane

    廃止すべきなのは主として一段目と、過剰な五段目です。二段目・三段目まで禁止すると、producer/consumer間のsplit-brain、重複キー、field名のずれ、stale head受理といった別の問題が戻ります。

    たとえば #1857 の LOOP_VERDICT_V2 は過剰な意味制約を含む可能性がありますが、canonical parser、duplicate-key拒否、producer/consumerのatomic cutoverは残す価値があります。ここを「新規strict schemaだから逆方向」と一括処分するのは不適切です。

    修正後の原則

    Ban authority, not representation.
    構造化形式を禁止するのではなく、その形式の欠落・stale・parse failureが通常作業を停止できる範囲を制限する。


    P0-4 — TEST_VERDICT撤去後のtrust modelが定義されていない

    現行の test-verdict-execution-record.yml は明らかに過剰です。しかし無意味ではありません。

    現在のworkflowは、概ね次を行っています。

    • default branch上のtrusted harnessだけを先にcheckout
    • GitHub REST APIから対象PRのrepository、commit、treeを解決
    • dispatcher指定HEADとcurrent headを照合
    • untrusted PR sourceを別workspaceへcheckout
    • secrets、OIDC、write tokenを渡さない
    • untrusted execution結果をdataとして扱い、trusted jobで再検証
    • artifact upload後に再download・digest・receiptを検証
    • 最終的に pass_eligible をfail-closedで確認

    これは運用負荷が高い一方、PRが自分自身のtest producerを書き換えてPASSを自己発行する問題に対する実装です。

    #1856 の方向で撤去する場合、「ordinary CIがあるから十分」では不足します。GitHubではrequired checkは最新commit SHAに対して成功している必要があり、特定のGitHub Appをexpected sourceとして要求できます。これらを実際のrulesetまたはbranch protectionで有効化した証拠が必要です。(GitHub Docs)

    さらに通常の pull_request workflowはPRのmerge commit側にあるworkflow定義を実行します。read-only token・secrets非公開という安全制約はありますが、PRがworkflow自体を変更できる以上、「テスト定義を改変してrequired checkを成功させる」問題は別途防ぐ必要があります。(GitHub Docs)

    一方、pull_request_target やprivileged workflow_run でPRコードをcheckout・実行する構造は、write tokenやsecretsを伴うrepository compromiseにつながり得るため、代替には使えません。(GitHub Docs)

    #1856を実装する前に必要な代替条件

    • required checkがlatest PR headまたはGitHubのtest merge commitへ束縛される
    • expected GitHub App/sourceをruleset側で固定する
    • test workflow・test harness変更にCODEOWNERSまたは同等の独立承認を要求する
    • PR由来コードをwrite token、secrets、OIDC付きjobで実行しない
    • workflow変更PRが自身の新workflowだけで自分を正当化できない
    • stale check、foreign Appの同名check、skipped jobでmergeできないnegative testを持つ
    • 実際のrepository ruleset/branch protection readbackをIssueまたはPRへ記録する

    今回確認できたリポジトリ資産からは、実際のGitHub ruleset・branch protection設定までは確認できませんでした。#1860 がGitHub protectionへ権限を移譲する以上、この設定のreadbackは実装前の必須証拠です。


    P0-5 — 「AIがファイルを選ぶ」と「Allowed Pathsをhard gateにする」が矛盾している

    #1860 はファイル選定をAIへ委ねるとしながら、Allowed Pathsをhard gateとして維持します。

    しかし実装中に必要ファイルが追加で判明した場合、AIは正しい変更を選んでもAllowed Paths gateで停止します。これは撤去対象としているcontract snapshot/body SHA問題と同じliveness failureを再生産します。

    次の区分が必要です。

    • 常時hard
      • secrets
      • credential
      • default branch直接変更
      • workflow/security policyなど明示的なprotected paths
      • repository外・別repositoryへの書込み
    • ownerが明示的にロックした場合のみhard
      • Issue固有のAllowed Paths
    • 通常はadvisory
      • AI生成または調査前に推定されたAllowed Paths

    scope拡張は、新しいdigestやreceiptではなく、Issue本文の明示更新またはownerコメント一件で十分です。


    P0-6 — ChildのClosed状態だけでは親Goalの達成を証明できない

    現在のParent Closure Ruleは、childがClosedになり、Closure Matrix対象が処理されたら親をcloseできる構造です。

    しかしIssueは以下の理由でもClosedになります。

    • 実装完了
    • duplicate
    • superseded
    • not planned
    • 実現不能
    • 方針撤回

    したがって「全child Closed」はdelivery完了の証拠ではありません。

    #1860 は Quality Decision Record: N/A としていますが、この変更は開発・レビュー・CI・GitHub protection全体のauthority migrationです。通常の機能Issueよりも、むしろ移行後の品質判断が必要です。

    親close条件に追加すべきもの

    • main上でartifact欠落・stale・invalid時にも通常実装が継続する
    • safety negative testsが維持される
    • required checksとexpected sourceがlive設定で確認される
    • dead producer/consumer/doc参照が残っていない
    • representative pilotでfalse blockと安全回帰がない
    • ownerが最終的に adopt / partial_adopt / rollback を記録する

    設計上の追加問題

    P1-1 — Issue #204を因果証拠として使えない

    #204 は、途中停止原因を以下のように分類する調査Issueです。

    • 通常Stop
    • SubAgent終了後のmain未再開
    • Stop hook
    • rate limitによるStopFailure
    • UI・remote-control・tmux切断
    • compactionやstate loss

    これは「artifactがstaleだったため停止した」という結論ではありません。#1860 の「#204で観測された停止と同種」という記述は、現時点では因果を過大解釈しています。

    Claude Codeの公式仕様でも、StopFailure はAPI error時に動作しますが、出力とexit codeは無視され、decision controlを持ちません。rate limit停止はschemaやartifact gateを削除しても解決しません。(Claude)

    したがって標語も次へ修正した方が正確です。

    Hard gateは、外部から機械的に検証可能な安全不変条件だけに限定する。
    すべてのgateはbounded retry、明示的なoverride、診断可能なfailureを持つ。
    意味判断と観測結果は原則advisoryとする。

    「Safetyは決定論的、Livenessは確率論的」だけでは、retry、timeout、idempotency、resumeといった決定論的liveness設計を説明できません。


    P1-2 — 公式仕様はHookやschemaの一括撤去を支持していない

    Codexの公式Hookは「deterministic scripts」として定義され、validation、secret検出、loggingなどの用途が明示されています。同時に、複数のmatching hookはすべて動き、同一eventのcommand hookは並列起動されるため、Hook間の順序依存は禁止すべきです。(OpenAI Developers)

    Claude Codeもmatching hookを並列実行します。またcommand hookは利用者の完全なOS権限で動くため、数を減らし、入力検証・絶対パス・sensitive file除外を厳格にする必要があります。(Claude)

    一方でSkillについては、本文を簡潔にし、詳細資料をsupporting filesへ移し、SKILL.mdを500行未満にすることが公式に推奨されています。Codexのcustom agentも「narrow and opinionated」が推奨です。(Claude)

    従って外部仕様から導ける結論は次です。

    • Skill・Agent本文の縮小: 採用
    • Hookの順序依存排除: 採用
    • passive telemetryのfail-open化: 採用
    • custom agentを狭い役割へ限定: 採用
    • Hookやschemaの存在自体をアンチパターン扱い: 根拠不足
    • semantic decisionをstrict schemaで全面固定: 撤去候補
    • repository identityやcurrent-head provenanceまで撤去: 不可

    関連Issue・PRの推奨処分

    対象 推奨
    #1830 / PR #1849 historical / complete。大量のenforcing harnessをquarantineしつつsandbox、approval、CI、review、branch/worktree identityを残した先行例として維持する。PRは46ファイル、+951/-5854で既にマージ済み。
    #1851 / PR #1854 complete。#1860の未完了childから外し、現在のadvisory/fail-closed境界をnormative baselineにする。
    #1856 / #1645 一つのmigration decisionへ統合。#1645のtrust chainをそのまま完成させるか、GitHub required checksへ移管して廃止するかの二択。並行実装は禁止。#1645のレビューで指摘されたself-attestation、PR-controlled producer、TOCTOU問題は代替設計でも解決が必要。
    #1857 縮小して維持。canonical parser、duplicate-key拒否、producer/consumer atomic cutoverは残し、semantic authority、replay、publisher連鎖を削る。
    #1674 分割。semantic overlap・優先順位はadvisory、実Git conflict・GitHub mergeabilityはhard observerとする。既存レビューも「one decision authority, multiple freshness/safety observers」を要求している。
    #1732 継続。Agent/Skill本文重複の削減とprogressive disclosureは #1860 の目的と一致する。close候補ではなくtarget architecture側。
    #1833 / PR #1850 新規custom graph protocolはfreeze。ただし既にマージされたprobe、artifact、docs、testsを先にinventoryする。単一agentをdefaultとし、read-only調査など狭いsubagentだけ任意利用する。PR #1850は既にmerged。
    #1153 #1860から分離。observabilityはauthorityではない。privacy、retention、運用費用、実利用率だけで独立に採否判断する。

    推奨するminimal harnessの権限モデル

    領域 分類 failure時
    canonical repository / worktree / branch / head hard gate fail-closed
    secrets / credentials / protected paths hard gate fail-closed
    force push / history rewrite / default branch直接push hard gate fail-closed
    sandbox / approval policy hard gate fail-closed
    required checks / expected source / latest SHA hard gate fail-closed
    trusted humanの明示 blocked / request_changes hard gate 明示解除まで停止
    Issue固有Allowed Paths advisory、またはowner明示lock scope拡張を要求
    contract snapshot / body SHA / scope rollup advisory warningして継続
    semantic overlap / dependency / priority advisory AI・人間レビューへ提示
    review result verdict + reviewed_head_sha + blockers staleなら再レビュー
    test summary JSON non-authoritative interchange parse失敗時は生ログを確認
    launch ledger / session manifest optional telemetry fail-open
    external observability opt-in telemetry fail-open・作業へ影響させない
    custom replay arbitration / dedicated publisher 原則delete GitHub機能で代替

    Acceptance Criteriaの置換案

    現行ACは「表がある」「リンクされている」といった管理上の条件が中心で、minimal harnessの挙動を証明しません。以下へ置き換えるべきです。

    AC1: Authority inventory

    全対象について、最低限次をMarkdown表で特定する。

    producer
    consumer
    validator
    publisher
    docs
    tests
    現在の停止効果
    撤去後の代替
    rollback
    

    新規schemaは不要です。

    AC2: Artifact-free liveness

    次のすべてで実装開始およびPR作成が継続する。

    • snapshotなし
    • stale body SHA
    • malformed telemetry
    • artifact download失敗
    • ledgerなし
    • session manifestなし
    • observability endpoint停止

    AC3: Safety regression

    次は引き続き拒否される。

    • canonical repository解決失敗
    • cross-repository binding不一致
    • detached HEAD
    • root checkoutからの禁止変更
    • Issue branch不一致
    • protected path・secret変更
    • force push・history rewrite
    • default branch直接push
    • trusted humanの最新 blocked

    AC4: GitHub enforcementの実証

    • required check名
    • expected GitHub App/source
    • latest SHA binding
    • rulesetまたはbranch protection
    • workflow変更保護
    • stale/foreign/skipped checkのnegative test

    をlive readbackで確認する。

    AC5: Workflow trust boundary

    • PRコードをwrite token、secrets、OIDC付きjobで実行しない
    • pull_request_target でPR headをcheckoutして実行しない
    • untrusted artifactを実行可能コードとして扱わない
    • workflow・harness変更は独立レビューを要求する

    AC6: Structured data boundary

    • schemaはinterchange用に利用可能
    • schema欠落・parse errorは通常作業の停止理由にしない
    • repository identityやhead bindingに必要な検証は例外
    • 同一schemaのshadow parserを禁止
    • duplicate keyを拒否するcanonical loaderを一つだけ持つ

    AC7: Hook boundary

    • 同一eventのHook間に実行順依存がない
    • passive Hookの失敗、timeout、出力不正が本処理のexit codeを変えない
    • command Hookは最小限で、絶対パス・入力sanitization・sensitive path除外を検証する

    AC8: Representative pilot

    最低でも以下のケースをmain相当環境で通す。

    1. docs-only変更
    2. product code+test変更
    3. snapshotなしの実装
    4. stale telemetry付きPR
    5. protected path拒否
    6. concurrent PRによる実Git conflict
    7. merge-cleanだが意味的に競合する二PR
    8. workflow変更PR

    AC9: Decommission integrity

    削除後、旧artifact名、reason code、publisher、validatorへの参照がproduction code、Skill、Agent、docs、testsに残っていないことを検証する。

    AC10: Parent closure

    childのstateではなく、main上のAC2~AC9が成功し、ownerが次を記録した場合のみcloseする。

    decision: adopt | partial_adopt | rollback
    verified_main_sha: "<sha>"
    remaining_authorities: [...]
    known_regressions: [...]

    これは新しいruntime frameworkではなく、親Issueの最終判断記録です。


    推奨する実施順序

    1. 導入: AIエージェント運用をminimal harnessへ縮退し、過剰なcontrol-planeを廃止する #1860 のlive stateを更新し、実装: implementation-worker.toml と open_pr.py の legacy artifact hard gate を除去する #1851 / PR #1854を完了扱いにする。
    2. Decisions Fixed を Working Hypotheses に変更する。
    3. authority inventoryとthreat modelだけを行う調査childを先行させる。
    4. producerを削除せず、まずconsumer側の停止権限だけをadvisoryへ切り替える。
    5. representative pilotを実行する。
    6. TEST_VERDICTについてGitHub required checksへの代替を実証する。
    7. 参照されなくなったproducer、materializer、publisher、schema、tests、docsを削除する。
    8. 最後に 実装: current-head TEST_VERDICT artifact の sanctioned producer を追加する #1645、実装: LOOP_VERDICT_V2 契約の producer/consumer/publisher atomic cutover を行う #1857、導入: OPEN Issue 重複・依存順・実装優先順位判定を issue-refinement-loop に一元化する #1674、導入: Codex CLI Multi-Agent V2 へ移行し、明示的な委譲グラフとbounded nested delegation harnessを導入する #1833、#1153を個別判断する。

    最終結論

    #1860 は、目標は妥当ですが、実行計画としては未完成です。

    特に修正が必要なのは次の四点です。

    • 調査前に削除・close方針を固定しない
    • schemaやtelemetryではなくblocking authorityを撤去対象にする
    • TEST_VERDICT撤去前にGitHub側のcurrent-head・expected-source・workflow trustを実証する
    • 子IssueのClosedではなく、main上のbehavioral evidenceで親をcloseする

    これらを反映すれば、#1830・#1851で始まった簡素化を安全に完遂する親Issueになります。現状のまま進めると、過剰なcontrol-planeを減らす過程で、repository identity、current-head provenance、workflow self-attestation対策まで失う可能性があります。


    you asked

    message time: 2026-07-30 22:11:13

    未起票subIssueの草案・調査と起票プロンプトを出して。
    Multi-Agent V2運用は採用したい。
    ClaudeCodeのマルチエージェント運用も最新化したい。


    chatgpt response

    #1860を前提に、未起票sub-issueを「撤去」「Multi-Agent V2採用」「Claude Code最新化」の3系統へ再構成します。関連Issueの現状と公式仕様を確認し、各Issue草案と起票用プロンプトまで落とします。

    公式仕様では、現行Codexはsubagent機能を既定有効とし、設定正本は[agents]です。既存#1833の[features.multi_agent_v2]・独自graph schema・digest-bound packet中心案は、採用方針を維持しつつnative-firstへ再構成する必要があります。

    調査結果と再編方針

    現行のCodex公式仕様では、subagent機能は既定で有効で、設定正本は[agents]です。主要項目はagents.enabled、agents.max_concurrent_threads_per_session、既定モデル・reasoning effortです。custom agentは.codex/agents/*.tomlにname、description、developer_instructionsを持たせ、狭く専門化することが推奨されています。並列化は探索・テスト・レビューなどread-heavy処理から始め、write-heavy処理は競合と調整コストに注意するのが公式方針です。(ChatGPT Learn)

    したがって、#1833のMulti-Agent V2採用方針は維持しつつ、[features.multi_agent_v2]、fork_turns、独自graph policy、digest-bound task packet、自己申告ledgerを中心に据える設計は廃止し、現行のnative [agents]、custom agent、sandbox、approval、agent threadへ移行するのが妥当です。現在の#1833は#1835〜#1842を未完了childとして持ち、custom graph・packet・marker・checkerを複数追加する構成です。

    Claude Codeの現行仕様は、subagentのネストをmain配下3層まで既定で許可し、環境変数で深さ・同時実行数・セッション総数を制限できます。Agent定義はskills、memory、background、effort、isolation: worktree、tool制限を持てますが、Skill preloadは説明だけでなく本文全体を注入するため、Skillを薄くしてからpreloadする必要があります。(Claude)

    Claude Codeのagent teamsは、teammate間通信や共有タスクリストが必要な調査・レビュー・独立モジュール開発には有効ですが、現在もexperimentalです。resume、task status、shutdown、nested teams、permission継承に制約があるため、通常経路はsubagents、agent teamsは明示的opt-inとするのが安全です。(Claude)

    #1732のAgent/Skill薄型化は維持対象です。ただし#1744はpreload追加を#1857のschema cutover完了にまで依存させ、runtime evidenceやpublisher契約を抱え込んでいます。Agent/Skillの重複削減と、review verdict schemaの再設計は分離した方がよい状態です。

    推奨するIssue構成

    区分 処理
    #1856 既存childとして継続。TEST_VERDICT撤去とGitHub側安全境界の確認を担当
    #1833 closeしない。Codex native multi-agent採用Issueへ改訂
    #1732 closeしない。Claude Agent/Skill薄型化の正本として改訂
    新規A Authority Inventoryと関連Issueの処分判定
    新規B semantic/contract/overlap artifactのadvisory化
    新規C review/refinement loopの簡素化
    新規D Claude Code native multi-agent最新化
    新規E SSOT・tests・dead control-planeの最終整理

    起票順は、A → B・C・D並行 → Eです。#1833と#1732の本文改訂はAの調査結果確定後に行います。

    #1833の既存child再編案

    Issue 推奨処理
    #1834 完了済みのruntime調査としてhistorical維持
    #1835 継続。[agents] native設定、legacy max_depth等の整理へ改訂
    #1836 独自graph policyを削除し、原則not_planned候補
    #1837 digest-bound packetを削除し、原則not_planned候補
    #1838 structured markerを廃止。必要な自然言語指示だけ#1835/#1839へ吸収
    #1839 継続。公式custom agent TOMLへ改訂
    #1840 独自graph checkerを廃止し、原則not_planned候補
    #1841 継続。native subagentのruntime smoke/negative testへ改訂
    #1842 継続。read-only nested canaryへ改訂

    紐づくPRや実装済みコードが存在するIssueは、機械的にcloseせず、再利用可能部分を確認してから処理します。

    以下が新規sub-issueの起票草案です。

    **Document Title: **

    新規A

    タイトル

    調査: #1860 のAuthority Inventoryを確定し、関連Issueをcurrent mainへ再束縛する

    Machine-Readable Contract

    contract_schema_version: v1
    issue_kind: research
    parent_issue: "#1860"
    goal_ref: "AIエージェント運用資産の実際の停止権限・consumer・代替安全境界をcurrent mainで特定し、#1860のAuthority MatrixとClosure Matrixを確定する"
    change_kind: research-only

    Parent Issue

    #1860

    Outcome

    #1860が撤去・advisory化候補としている全資産について、current main上の実装を直接調査し、以下をMarkdown表として確定する。

    項目 内容
    producer 生成元のfile/command/workflow
    consumer 読み手とproduction routing
    current effect 実装開始、test、review、PR publication、mergeのどこを停止するか
    authority class hard safety/human veto/advisory/interchange/telemetry/delete
    failure behavior missing/stale/invalid/timeout時の実挙動
    replacement 撤去後に維持する安全境界
    related Issue/PR ownerと現在のstate
    migration decision keep/reframe/remove/historical/not_planned

    分類語は本Issue内のMarkdown用語であり、新規schema、enum、reason codeとしてコードへ追加しない。

    In Scope

    Out of Scope

    • repository fileの変更
    • 関連Issueのclose、reopen、本文変更
    • 新規schema、digest、receipt、publisherの作成
    • 調査完了前の実装child起票

    Acceptance Criteria

    Verification Commands

    git fetch origin main
    git rev-parse origin/main
    
    rg -n \
      "ISSUE_EXECUTION_DECISION|CONTRACT_REVIEW_RESULT|body_sha|scope.rollup|overlap|SUBAGENT_LAUNCH_LEDGER|session.manifest|TEST_VERDICT|replay|parent.binding|semantic.graph|publisher|receipt" \
      .claude .codex scripts schemas docs .github
    
    gh issue view 1857 --repo squne121/loop-protocol --comments
    gh issue view 1645 --repo squne121/loop-protocol --comments
    gh issue view 1674 --repo squne121/loop-protocol --comments
    gh issue view 1732 --repo squne121/loop-protocol --comments
    gh issue view 1833 --repo squne121/loop-protocol --comments
    gh issue view 1153 --repo squne121/loop-protocol --comments
    
    for n in 1834 1835 1836 1837 1838 1839 1840 1841 1842 1744 1745; do
      gh issue view "$n" --repo squne121/loop-protocol \
        --json number,title,state,body,comments,closedAt,url
    done

    Allowed Paths

    • GitHub Issue #1860の本文・コメント
    • 本Issueの本文・コメント
    • repository、Issue、PR、Actionsのread-only調査

    repo-tracked fileは変更しない。

    Runtime Verification Applicability

    decision: not_applicable
    reason: "調査専用Issueであり、repo-tracked fileやruntime behaviorを変更しない"

    Stop Conditions

    • current mainまたは関連PRのfileを取得できない
    • production consumerを特定できない
    • linked PRや別session所有の変更を破棄する必要がある
    • 調査結果が不十分な状態でclose/supersede判断を要求される

    新規B

    タイトル

    実装: semantic planning・contract snapshot・overlap evidenceのblocking authorityをadvisoryへ降格する

    Machine-Readable Contract

    contract_schema_version: v1
    issue_kind: implementation
    parent_issue: "#1860"
    depends_on:
      - "#<AUTHORITY_INVENTORY_ISSUE>"
    goal_ref: "意味判断・contract snapshot・scope rollup・overlap evidenceの欠落やstaleだけでは通常実装とPR publicationを停止しない状態にする"
    change_kind: workflow

    Outcome

    live Issue、明示的なユーザー要求、canonical repository/worktree/branch、実diff、実テスト、current-head CIを通常作業の正本とする。

    以下はwarningまたは参考情報として扱い、単独では実装開始・test・review・PR publicationを停止しない。

    • contract snapshotの欠落、stale、parse failure
    • Issue body SHAの不一致
    • scope rollupの欠落、不完全、stale
    • semantic overlap/dependency/priorityの機械判定
    • overlap evidenceのhash、digest、collection completeness不一致
    • OPEN Issue全件収集失敗

    以下は引き続き停止させる。

    • live Issueを取得できない
    • trusted owner/authorによる最新の明示blockedまたはrequest_changes
    • canonical repository解決失敗
    • cross-repository evidence/mutation target不一致
    • root checkout、detached HEAD、Issue/branch不一致
    • protected paths、secret、owner lock済みAllowed Paths違反
    • 実Git conflict
    • current-head CI、required checks、reviewの失敗

    Migration Rule

    最初にconsumerからblocking behaviorを外す。producer、schema、test fixtureは、production consumerが存在しなくなるまで同一PRで先行削除しない。

    形式がinterchangeまたはdiagnosticとして有用な場合は残してよいが、存在・freshness・digest一致を通常作業の認可条件にしない。

    In Scope

    Authority Inventoryで特定した以下のexact consumer pathsのみ。

    • issue-refinement-loopのsemantic planning consumer
    • issue-contract-reviewのsnapshot/body SHA consumer
    • implement-issueのOPEN Issue全件再検査
    • impl-review-loopのartifact intake routing
    • open-prのsemantic/overlap evidence consumer
    • 対応するSkill、docs、behavioral tests

    Out of Scope

    Acceptance Criteria

    • AC1: snapshotなしでもreadyなlive implementation IssueがStep 1へ進む
    • AC2: stale/invalid snapshotでもwarningを記録してStep 1へ進む
    • AC3: overlap evidenceがmissing/stale/invalidでもPR作成が継続する
    • AC4: trusted authorの最新blockedは引き続き停止する
    • AC5: canonical repository解決失敗とcross-repository不一致は引き続き停止する
    • AC6: actual Git conflict、protected path、secret、CI failureのnegative testが維持される
    • AC7: warningはstderrまたはPRコメント等、人間が確認可能な場所へ残る
    • AC8: 新しいschema、digest、receipt、publisherを追加していない

    Verification Commands

    起票時にAuthority Inventoryからexact test nodeを埋める。

    uv run --locked pytest \
      <intake-advisory-tests> \
      <open-pr-advisory-tests> \
      <repository-binding-negative-tests> \
      <human-veto-negative-tests> -q
    
    rg -n \
      "ensure_contract_snapshot|missing_go|stale_action|overlap_gate|semantic_reclassification" \
      <EXACT_CONSUMER_PATHS>

    Allowed Paths

    #<AUTHORITY_INVENTORY_ISSUE>で確定したexact consumer、docs、test pathsのみを列挙する。directory全体のwildcardは使用しない。

    Runtime Verification Applicability

    decision: immediate
    reason: "artifact欠落・stale時のroutingとPR publication継続はproduction behaviorである"

    Stop Conditions

    • repository identityまたはhuman vetoを弱体化する必要が生じた
    • consumer-first移行ができずproducer先行削除が必要になった
    • Allowed Paths外のproduction consumerが見つかった
    • current-head CIやrequired checksを代替証拠として確認できない

    新規C

    タイトル

    実装: review/refinement loopをnative orchestrationと最小結果契約へ簡素化する

    Machine-Readable Contract

    contract_schema_version: v1
    issue_kind: implementation
    parent_issue: "#1860"
    depends_on:
      - "#<AUTHORITY_INVENTORY_ISSUE>"
    goal_ref: "review/refinementをbounded native-agent loopへ簡素化し、replay、binding digest、専用publisher、永続state storeを通常経路の必須条件から外す"
    change_kind: workflow

    Outcome

    review/refinement loopは、Claude CodeまたはCodexのnative agent orchestrationを使用し、main threadが次だけを所有する。

    • 対象Issue/PR
    • current head SHA
    • 最大iteration数
    • 各iterationの人間可読findings
    • final verdict
    • unresolved blockers
    • 次のaction

    reviewerの最小結果は概ね次とする。

    verdict: APPROVE | REQUEST_CHANGES | HUMAN_REVIEW_REQUIRED
    reviewed_head_sha: "<current PR head>"
    blockers:
      - "<具体的な指摘>"
    warnings:
      - "<任意>"

    これは新規公開schemaとしてcatalogへ登録せず、既存canonical parserが必要なら最小限へ縮小して再利用する。

    In Scope

    • impl-review-loopとissue-refinement-loopの通常経路
    • replay arbitration
    • parent binding digest
    • semantic graph digest
    • termination envelope
    • dedicated termination/review publisher
    • loop state storeの通常経路依存
    • pr-review-judge/issue-reviewerからmainへのresult handoff
    • 対応docs、tests、fixtures

    Required Behavior

    • default maximum iterationは3回程度のbounded loopとし、明示指示で変更可能
    • iteration間の継続はnative agent resultとlive GitHub stateから判断する
    • compaction/resume後はartifact replayではなくIssue/PR/current diffを再取得する
    • parser failureはPR作成を止めず、人間可読findingsへfallbackする
    • stale reviewed headはmerge-readyにせず再レビューする
    • GitHubへのroutine review投稿には通常のGitHub client/connectorを使用し、意味判断専用publisherを追加しない
    • repository、PR番号、current headをmutation直前にreadbackする

    Out of Scope

    Acceptance Criteria

    • AC1: replay envelope、parent binding digest、state storeがなくてもfresh reviewを開始できる
    • AC2: current PR headと実diffからreviewが再構築される
    • AC3: reviewer結果がverdict、reviewed head、blockers中心へ縮小される
    • AC4: stale reviewed headはAPPROVEとして利用されない
    • AC5: parser/publisher artifactの欠落でPR作成や人間レビューが停止しない
    • AC6:最大iteration到達時はhuman reviewへ移行し、無限replayしない
    • AC7: GitHub mutation前のrepository/PR/head readbackを維持する
    • AC8: dead replay/publisher/state-store consumerがproduction pathから除去される

    Verification Commands

    uv run --locked pytest \
      <review-loop-bounded-tests> \
      <refinement-loop-bounded-tests> \
      <stale-head-negative-tests> \
      <github-mutation-binding-tests> -q
    
    rg -n \
      "replay|parent_binding|semantic_graph_digest|termination_envelope|state_store|dedicated.*publisher" \
      .claude/skills/impl-review-loop \
      .claude/skills/issue-refinement-loop \
      .claude/skills/pr-review-judge

    Allowed Paths

    Authority Inventoryで確定したloop、review consumer、docs、testsのexact paths。

    Runtime Verification Applicability

    decision: immediate
    reason: "native agent dispatch、bounded iteration、stale-head rerunは実行時挙動である"

    Stop Conditions

    • current-head bindingを維持できない
    • dedicated publisher削除により別repository/別PRへの誤投稿可能性が生じる
    • native agent runtimeが利用不能で通常単一agent fallbackも動かない
    • loop simplificationとreview判断基準変更を同一PRで行う必要が生じる

    新規D

    タイトル

    実装: Claude Codeのnative subagents・nested delegation・agent teams運用を現行公式仕様へ更新する

    Machine-Readable Contract

    contract_schema_version: v1
    issue_kind: implementation
    parent_issue: "#1860"
    related_parent: "#1732"
    depends_on:
      - "#<AUTHORITY_INVENTORY_ISSUE>"
    goal_ref: "Claude Codeのnative subagents、nested delegation、agent teamsを用途別に採用し、独自control-planeを追加せず安全な並列運用を確立する"
    change_kind: workflow

    Goal

    Claude Codeの通常運用を次の二層へ更新する。

    1. Native subagents

      • 通常の探索、調査、test、review、log解析
      • main sessionへ要約だけを返す
        -必要な場合だけbounded nested delegationを使用
    2. Agent teams

      • teammate間通信が必要な敵対的レビュー、競合仮説調査、独立モジュール開発
      • experimental capabilityとして明示的に起動
        -通常実装の必須経路にはしない

    Decisions

    • main sessionを最終decision、GitHub mutation、merge判断のownerとする
    • project policyとしてsubagent spawn depthを2層へ制限する
      -同時subagent数は4程度を初期上限とし、実測で変更する
    • write-capable agentは同時に1つだけとする
    • read-only reviewer/researcher/verifierは並列実行可能
    • leaf agentはAgent toolを持たせない
    • nested delegationを許可するagentだけAgent toolを持つ
    • Skill preloadはthin化済みSkillだけに限定する
    • agent teams failure/resume failureは通常subagent経路を停止させない
      -独自delegation graph schema、digest、launch receiptは追加しない

    In Scope

    • .claude/settings.jsonの以下の初期policy
      • CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTH=2
      • CLAUDE_CODE_MAX_CONCURRENT_SUBAGENTS=4
      • agent teams capabilityの明示的opt-in設定
    • .claude/agents/*.mdのfrontmatter棚卸し
      • tools/disallowedTools
      • model
      • permissionMode
      • effort
      • background
      • isolation
      • skills
    • read-only nested canary
    • agent teamsによるread-only adversarial review smoke
    • docs/dev/agent-skill-boundaries.md
    • Claude Code向けruntime smokeとnegative tests
    • 実装: Agent/Skill の重複を削減し progressive disclosure へ移行する #1732/#1744との責務境界の更新

    Out of Scope

    Initial Agent Policy

    Agent class Parallel Write Nested spawn Typical use
    explorer/researcher yes no no codebase・Web・docs調査
    test-runner yes no no test、log、failure分類
    reviewer yes no verifierのみ correctness、security、test gaps
    implementation-designer yes no no 設計、変更範囲、tradeoff
    implementation-worker no yes designerのみ 実装
    cleanup/publisher no mutation only no 明示的なGitHub/Git操作

    Acceptance Criteria

    • AC1: fresh sessionで2件以上のread-only subagentが並列実行され、mainへ要約が返る
    • AC2:許可されたtop-level agentからread-only verifierへのnested delegationが動作する
    • AC3: leaf agentからの再委譲がtool restrictionまたはdepth policyで拒否される
    • AC4: write-capable agentが同時に複数起動しない
    • AC5: thin化されていない長大Skillがpreloadされていない
    • AC6: agent teamsが明示起動時だけ使用され、通常subagent workflowはteams無効時にも成功する
    • AC7: team resume、shutdown、task statusの既知制約がdocsへ記載されている
    • AC8: agent teams失敗時に通常単一agent/subagentへfallbackできる
    • AC9: secret、local settings、credential pathのdenyが維持される
    • AC10: runtime証跡にraw transcriptやsecretを保存しない

    Verification Commands

    claude --version
    
    uv run --locked pytest \
      <claude-agent-frontmatter-tests> \
      <tool-restriction-tests> \
      <nested-delegation-tests> \
      <agent-team-opt-in-tests> -q
    
    # fresh-session smoke
    python3 <CLAUDE_MULTI_AGENT_SMOKE_RUNNER> \
      --cases parallel-readonly,nested-readonly,leaf-no-spawn,teams-opt-in,teams-disabled-fallback

    Allowed Paths

    • .claude/settings.json
    • runtime policyに必要な.claude/agents/*.mdのexact files
    • docs/dev/agent-skill-boundaries.md
    • docs/dev/workflow.md
    • Claude multi-agent用のtests/smoke runner

    Skill本文の薄型化は#1732側で扱い、本Issueへ混入させない。

    Runtime Verification Applicability

    decision: immediate
    reason: "subagent並列実行、nested delegation、agent teams opt-inはfresh Claude Code sessionでのみ検証できる"

    Stop Conditions

    • agent teamsのexperimental failureが通常workflowを停止する
      -複数writerが同一worktreeを編集する
    • Agent/Skill薄型化を同一PRへ取り込む必要が生じる
    • permissionMode、secret deny、worktree identityを弱体化する必要が生じる
    • runtime unavailableをPASSとして扱う必要が生じる

    新規E

    タイトル

    整理: workflow SSOT・Skill・Agent・testsをnative-first minimal harnessへ収束する

    Machine-Readable Contract

    contract_schema_version: v1
    issue_kind: implementation
    parent_issue: "#1860"
    depends_on:
      - "#<SEMANTIC_AUTHORITY_ISSUE>"
      - "#<BOUNDED_LOOP_ISSUE>"
      - "#<CLAUDE_MULTI_AGENT_ISSUE>"
    goal_ref: "移行完了後にdead control-plane資産を削除し、Codex/Claude native multi-agentとminimal harnessをworkflow SSOTへ統合する"
    change_kind: mixed

    Outcome

    以下が一貫した状態になる。

    • live Issue、canonical worktree、actual diff、実test、current-head CI、independent reviewがauthoritative
    • contract、scope、overlap、ledger、manifestはadvisoryまたはtelemetry
    • Codexはnative [agents]とcustom agent TOMLを使用
    • Claude Codeはnative subagentsを通常経路、agent teamsをopt-in経路として使用
    • Agent/Skill本文はprogressive disclosureに従う
    • dead schema、validator、publisher、workflow、fixture、docs参照が削除される
    • GitHub protectionと人間の最終mergeを維持する

    In Scope

    Deletion Rule

    assetは次のすべてを満たす場合のみ削除する。

    1. production consumerが存在しない
    2. replacement behaviorがmainで検証済み
    3. docs/tests/schema catalogから参照が除去されている
    4. rollbackに必要なGit履歴またはhistorical Issueが存在する
    5. linked open PRが変更中ではない

    Acceptance Criteria

    Representative Pilot

    最低限次を実行する。

    1. docs-only変更
    2. product code+test変更
    3. contract snapshotなし
    4. stale telemetryあり
    5. protected path拒否
    6. actual Git conflict
    7. Codex parallel read-only review
    8. Claude parallel read-only review
    9. Claude nested verifier
    10. agent teams無効時fallback

    Verification Commands

    rg -n \
      "features.multi_agent_v2|fork_turns|CODEX_SUBAGENT_TASK_PACKET|SUBAGENT_LAUNCH_LEDGER|parent_binding_digest|semantic_graph_digest|TEST_VERDICT.*publisher" \
      .claude .codex scripts schemas docs .github
    
    uv run --locked pytest <MIGRATION_REGRESSION_TARGETS> -q
    pnpm typecheck
    pnpm lint
    pnpm test
    pnpm build

    Allowed Paths

    Authority Inventoryと各先行Issueの変更結果を基に、dead assetとSSOTのexact pathsを起票時に列挙する。

    Runtime Verification Applicability

    decision: immediate
    reason: "native multi-agent経路とartifact-free workflowの統合結果をmain相当環境で検証する必要がある"

    Stop Conditions

    • production consumerが残るassetの削除が必要
    • current-head CI/GitHub protectionの代替が未確認
    • linked open PRの変更を破棄する必要がある
    • representative pilotを実行できない
    • rollback不能な一括削除になる

    一括調査・改訂・起票プロンプト

    **Document Title: **

    リポジトリ squne121/loop-protocol で、Issue #1860 配下の未起票sub-issueを調査・改訂・起票してください。

    最終方針

    • Codex Multi-Agent V2/native subagents運用は採用する
    • Claude Codeのnative subagents、nested delegation、agent teamsも現行公式仕様へ更新する
    • 単一agentを既定へ戻す方針は採用しない
    • ただし独自graph policy、digest-bound task packet、launch receipt、semantic authorityは通常経路の必須条件にしない
    • Safety boundaryは決定論的に維持し、semantic planningとtelemetryはadvisoryにする
    • 新規JSON/YAML schema、digest、receipt、publisher、reason-code enumは追加しない
    • main sessionを最終decision、GitHub mutation、merge判断のownerとする
    • 並列writeは原則禁止し、read-heavy agentの並列利用を優先する

    最初に使用するsubagents

    main threadはcontrol-planeに専念し、最初に次のread-only subagentsを並列起動してください。

    1. repo-authority-investigator

    2. codex-native-agents-researcher

    3. claude-native-agents-researcher

    4. github-state-investigator

    全subagentの完了を待ち、根拠を統合してからmutationへ進んでください。

    公式資料の優先順位

    • Codex: OpenAI公式ドキュメントのみをnormative sourceとする
    • Claude Code: Anthropic公式ドキュメントのみをnormative sourceとする
    • repository判断: GitHub Issue、PR、current mainの実装・testsを一次資料とする
    • 非公式資料は補足にのみ使用し、仕様確定には使用しない

    #1833の改訂

    #1833はcloseせず、Codex native multi-agent採用parentとして本文を改訂してください。

    必須変更

    • [features.multi_agent_v2]を正本とする記述を削除する
    • current official [agents] configを正本にする
    • agents.enabled = trueを明示するか、既定有効をdocsへ明記する
    • agents.max_concurrent_threads_per_sessionの初期値を4程度に設定する
    • custom agentは.codex/agents/*.tomlのnative schemaを使用する
    • custom agentはnarrow and opinionatedにする
    • read-heavy parallelismを既定とし、write-heavyはsingle writerとする
    • fork_turns、独自graph policy、digest-bound task packet、structured dispatch marker、custom graph checkerを必須条件から除去する
    • sandbox/approvalはnative inheritanceを使用する
    • project-local enforcing hookを再導入しない
    • passive recorderはadvisoryのまま維持する

    Child処理候補

    live stateとlinked PRを確認した上で処理する。

    linked PR、実装済みコード、別Issueからのconsumerがある場合は機械的にcloseせず、再利用またはcleanup条件を本文へ記録してください。

    #1732の改訂

    #1732はAgent/Skill progressive disclosureのparentとして維持してください。

    • #1745の実stateとmerged PRを確認し、完了済みならchecklistを更新する
    • #1744のblocked_by: #1857が本当にpreload追加の技術的前提かcurrent mainで再検証する
    • schema cutoverが不要なら実装: LOOP_VERDICT_V2 契約の producer/consumer/publisher atomic cutover を行う #1857 dependencyを削除し、preload前後の既存behavior regressionだけを条件にする
    • Skill preloadは全文注入であるため、Skillをthin entrypointへ縮小してからpreloadする
    • #1744はreview schema再設計を所有せず、Agent/Skill重複削減だけを所有する
    • implementation-worker/implement-issue Child Cは、関連Issue番号のclose待ちではなく、current mainのactual diff/overlapping pathsを調査して起票可否を決める
    • Claude runtime policy、nested delegation、agent teamsは新規Claude multi-agent Issueが所有し、#1732へ混入させない

    新規起票するsub-issue

    以下の5件を、調査結果でexact Allowed Paths、test node、依存Issue番号を埋めた上で起票してください。

    1. 調査: #1860 のAuthority Inventoryを確定し、関連Issueをcurrent mainへ再束縛する
    2. 実装: semantic planning・contract snapshot・overlap evidenceのblocking authorityをadvisoryへ降格する
    3. 実装: review/refinement loopをnative orchestrationと最小結果契約へ簡素化する
    4. 実装: Claude Codeのnative subagents・nested delegation・agent teams運用を現行公式仕様へ更新する
    5. 整理: workflow SSOT・Skill・Agent・testsをnative-first minimal harnessへ収束する

    Issue本文は、ユーザーから渡された草案をbaselineとし、live調査結果で次を補完してください。

    • Current Validated Scope
    • exact Allowed Paths
    • linked Issue/PR
    • Acceptance Criteriaと対応するVerification Commands
    • Runtime Verification Applicability
    • Stop Conditions
    • dependency/ordering
      -既存Issueとのnon-duplication boundary

    起票・リンク手順

    1. Authority Inventory Issueを最初に起票する
    2. #1860へsub-issueまたはtask-list linkを追加する
    3. Authority InventoryのIssue番号を残り4件のdependencyへ反映する
    4. B、C、Dを起票する
    5. EはB、C、Dおよび既存実装: 通常レビューの evidence authority を TEST_VERDICT 非依存の CI/merge_state_status 正本へ切替える(Phase 1: authority cutover) #1856、改訂後導入: Codex CLI Multi-Agent V2 へ移行し、明示的な委譲グラフとbounded nested delegation harnessを導入する #1833/#1732の完了条件をdependencyとして起票する
    6. #1860のChild Issues、Current Validated Scope、Closure Matrixをlive stateへ更新する
    7. 実装: implementation-worker.toml と open_pr.py の legacy artifact hard gate を除去する #1851/PR #1854が完了済みなら完了状態へ更新する
    8. 関連Issueのclose/not_planned処理を行う場合は、事前に理由と移行先をコメントする
    9. open PRまたは未統合コードがあるIssueは自動closeしない

    Mutation Safety

    • mutation前に対象Issue/PRを毎回live readbackする
    • repositoryは必ずsqune121/loop-protocolへcanonicalizeする
    • Issue番号だけで別repositoryを参照しない
      -他session所有のbranch、worktree、PRを変更しない
    • default branchへ直接pushしない
    • force push、history rewriteを行わない
    • secret、credential、raw transcriptをIssueへ投稿しない
    • 新規control-plane frameworkを追加しない

    完了報告

    最後にMarkdown表で次を報告してください。

    対象 action final state Issue/PR URL dependency remaining blocker

    併せて以下を明示してください。

    • 新規作成したIssue番号
    • 更新した既存Issue
    • close/not_plannedにしたIssueと理由
    • linked PRが存在するため処理を保留したIssue
    • #1860の次の実装Issue
    • Codex native multi-agentの最終構成
    • Claude Code native subagents/agent teamsの最終構成
    • 未解決のhuman decision

    起票前に、#1835〜#1842と#1744に紐づくDraft PRおよび未マージcommitの有無をlive readbackする必要があります。


    Powered by AI Exporter

  3. squne121 commented on Jul 30, 2026

    @squne121
    OwnerAuthor

    Refinement Loop: Human Escalation Required

    The loop has terminated and requires human review. Cause: human judgment required

    Blockers

    "review 1回目: needs-fix (C4: '## Verification Commands'セクション欠落, C8: '## Outcome'セクション欠落)"
    
    "Step 2a parent-local replay arbitration 1回目: reviewer_claim_unbacked_by_deterministic_checker (iteration非消費でStep2へ差し戻し)"
    
    "review 2回目(同一 body_sha256: sha256:5db6cf015103518d757f2a9de730c6e6679cacbae19df4b27976e814fe5cdd12): 同一findingsを再確認(needs-fix)"
    
    "Step 2a parent-local replay arbitration 2回目: 同一body/laneで2回連続unbacked -> reviewer_false_positive_suspected -> human_escalation"
    
    "根本原因: reviewer_claim_replay taxonomyの vc_command_format entry は 'VC syntax malformed' カテゴリ(non_dollar_command/compound_shell/compound_command_disallowed/no_commands_extracted)のみを裏付けエビデンスとして扱い、'section自体が丸ごと欠落'(VC001_NO_VERIFICATION_COMMANDS_SECTION / category: extraction_error)を裏付けとして扱わないtaxonomy gapがある"
    
    "control-planeが独立に contract_readiness_check.py --mode execute を実行し、'## Verification Commands'セクションが本文に実在しないことを確認済み(gh issue view直接確認でも同じ)。findingそのものは事実として真だが、arbitrationの自動裏付けの仕組みが対応していないため人間判断が必要"
    
    "anchor comment (https://github.com/squne121/loop-protocol/issues/1860#issuecomment-5131369518, OWNER) の scope_delta_decision は fail_closed(ANCHOR_SCOPE_REFRAME_V1形式のpayloadなし)であり、この anchor comment は本文修正フィードバックとして扱われ、新規Allowed Path拡張の権限は付与されていない"
    
    "web_research(Step 1b)は完了済み: 8件のcritical external claims(Codex/Claude Code公式仕様)すべてverified、ハルシネーションなし"
    
    "delivery_rollup: applicable=true、未起票のchild issue候補4件あり(child materializationは未実施、human判断待ち)"
    
    "人間判断が必要な論点: (1) '## Verification Commands'/'## Outcome'セクション欠落は本parent tracker issueにとって本当に必須要件か(delivery-rollup parent故に不要という設計判断もありうる)、(2) 必須なら本文へどう追記するか、(3) reviewer_claim_replay taxonomyのvc_command_format entryにVC001_NO_VERIFICATION_COMMANDS_SECTION/extraction_errorカテゴリを追加すべきかのfollow-up要否"
    
  4. squne121 commented on Jul 30, 2026

    @squne121
    OwnerAuthor

    判定

    #1860の本文を、C4/C8を通すためだけに修正するべきではありません。
    今回の2件は、issue_kind: parentへの適用条件が欠けたチェッカー側の偽陽性と判断するのが妥当です。

    既存Issue向けのparent検証プロファイル existing_issue_readiness_v1 は、必須セクションにOutcomeとVerification Commandsを含めていません。実際の回帰テストでも、parentにVerification CommandsがなくてもLP001にしないことを明示しています。

    一方、check_issue_contract.pyのC4とC8はissue_kindを受け取らず、parentにも無条件でセクション存在を要求しています。C9にはissue-kind分岐があるため、C4/C8だけのapplicability driftです。

    推奨アクション

    1. 人間判断としてC4/C8をnot applicableにする

      • 対象はissue_kind: parentかつparent_mode: delivery-rollup。
      • #1860本文に、実装Issue用の疑似VCを追加しない。
      • この判断でchild issueの一括起票やAllowed Paths拡張まで許可しない。
    2. 同じbodyのまま直ちに再実行しない

      • checker修正前に同一laneを再実行すると、同じhuman escalationを再生産する可能性が高いです。
    3. 別Issue・別PRでC4/C8のapplicabilityを修正する

      • parentではC4/C8をn/aにする。
      • implementationの現行挙動は維持する。
      • researchについては既存契約を調査してから判断し、便乗変更しない。
    4. replay taxonomyも防御的に修正する

      • 現在のvc_command_formatはVC001_NO_VERIFICATION_COMMANDS_SECTIONを認識しません。
      • missing section producerは、正確にはrule_id: VC001_NO_VERIFICATION_COMMANDS_SECTION、category: extraction_errorを出します。readiness側ではsource_check: baseline_vc_preflightとして転記されます。
      • 汎用的なextraction_errorカテゴリを追加するより、正確なrule IDをreadiness_rule_idsへ追加する方が安全です。 現行マッチングはrule IDまたはsource-qualified categoryで成立するため、rule ID追加だけでこのケースを裏付けられ、無関係な抽出失敗をC4証拠として誤採用しません。
      • 同一bodyで決定論チェッカーがfailしているケースは、reviewer再実行ではなくtaxonomy_gap/fix_checker_artifactへ送るのが既存設計です。
    5. 4件のchild候補はまだ一括materializeしない

      • 今回の人間判断はchecker defectの処理に限定します。
      • 各childのOutcome、Allowed Paths、Acceptance Criteriaが確定してから個別に起票します。

    投稿する人間判断コメント

    Human Decision — Refinement escalation disposition

    Issue #1860 は issue_kind: parent、parent_mode: delivery-rollup、closure_mode: child-complete の既存parent trackerであり、本Issue自体ではコード変更を行わない。

    今回のreview findingについて、以下のとおり判断する。

    • C4 ## Verification Commands欠落: not applicable
    • C8 ## Outcome欠落: not applicable

    理由:

    • 既存parent Issue用の existing_issue_readiness_v1 profileでは、## Outcomeおよび## Verification Commandsは必須セクションではない。
    • check_issue_contract.pyのC4/C8がissue kindを考慮せずparentにも適用されており、parent validation profileとのapplicability driftが発生している。
    • #1860本文へ実装Issue用の疑似Verification Commandsを追加することは、本文の意味を改善せず、checkerを満足させるためだけのworkaroundになる。

    処置:

    1. C4/C8 findingを、#1860の本文修正blockerとしては棄却する。
    2. #1860本文は、この2件だけを理由として変更しない。
    3. C4/C8のparent applicabilityとreviewer-claim replay taxonomy gapは、別のfollow-up Issue/PRで修正する。
    4. checker修正前に同一body・同一laneでrefinement loopを再実行しない。
    5. この判断はAllowed Pathsの拡張、4件のchild候補の一括materialization、関連Issueのcloseを許可するものではない。child materializationは各childのOutcome・Allowed Paths・Acceptance Criteria確定後に個別判断する。

    実装修正プロンプト

    対象リポジトリ:

    https://github.com/squne121/loop-protocol

    関連Issue・コメント:

    目的:

    Issue #1860で発生したhuman escalationの根本原因を、parent Issue contractのapplicability driftとreviewer-claim replay taxonomy gapに分離して修正してください。

    固定する人間判断

    1. #1860は issue_kind: parent、parent_mode: delivery-rollup の既存parent trackerである。
    2. existing_issue_readiness_v1において、## Outcomeと## Verification Commandsはparentの必須セクションではない。
    3. #1860に対するC4/C8 findingは本文不備ではなく、check_issue_contract.pyのapplicability defectである。
    4. #1860本文へ疑似Outcome・疑似Verification Commandsを追加して回避してはならない。
    5. この作業では#1860の4件のchild候補をmaterializeしない。
    6. この作業では#1860のAllowed Pathsや実装スコープを拡張しない。
    7. workflow defectは#1860とは別のfollow-up IssueとPRで修正する。

    最初に行うreadback

    以下を一次資料として確認してください。

    • Issue #1860の現在のbody、body SHA、全コメント

    • docs/dev/github-ops.md の ISSUE_KIND_POLICY_V1

    • .claude/skills/create-issue/scripts/validate_issue_body.py

      • EXISTING_ISSUE_READINESS_V1
      • _EXISTING_ISSUE_READINESS_V1_PARENT_SECTIONS
    • .claude/skills/issue-contract-review/tests/test_contract_readiness_validation_profile.py

    • .claude/skills/review-issue/scripts/check_issue_contract.py

      • C1、C4、C8、C9
      • review artifactのfindings/structured_blockers生成箇所
    • .claude/skills/issue-refinement-loop/scripts/reviewer_claim_replay.py

      • REVIEWER_CHECKER_TAXONOMY_V1
      • _matching_readiness_errors
      • analyze
    • .claude/skills/issue-contract-review/scripts/baseline_vc_preflight.py

    • .claude/skills/issue-contract-review/scripts/contract_readiness_check.py

    推測で変更せず、current mainの実装とテストを確認してください。

    Follow-up Issue

    別Issueを起票してください。趣旨は次のとおりです。

    タイトル案:

    修正: parent IssueへC4/C8を誤適用するcontract reviewとVC section replay taxonomy gapを解消する

    Issueには最低限、次を含めてください。

    Outcome

    • canonical parent Issueでは、既存parent readiness profileと同じsection applicabilityがreview-issueでも適用される。
    • implementation IssueのC4/C8検証は維持される。
    • implementation Issueで## Verification Commandsが欠落した場合、VC001_NO_VERIFICATION_COMMANDS_SECTIONがreviewer replayの決定論的証拠として認識され、reviewer false-positive laneへ送られない。

    Allowed Paths

    原則として以下に限定してください。

    • .claude/skills/review-issue/scripts/check_issue_contract.py
    • .claude/skills/review-issue/tests/
    • .claude/skills/issue-refinement-loop/scripts/reviewer_claim_replay.py
    • .claude/skills/issue-refinement-loop/tests/

    必要性を一次資料で証明できないファイルは追加しないでください。

    実装要件

    1. C4 parent applicability

    check_c4_vc_commands_presentにcanonical issue kindを渡し、issue_kind == "parent"ではCheckResult.NAを返してください。

    • implementationの既存挙動を変更しない。
    • researchの扱いは便乗変更しない。既存の明示契約がなければ現状維持する。
      -文字列検索によるparent推定ではなく、既存のdetect_issue_kind結果を使用する。

    2. C8 parent applicability

    check_c8_outcome_concretenessにもcanonical issue kindを渡し、issue_kind == "parent"ではCheckResult.NAを返してください。

    • parent profileで必須でないセクションを、review-issueだけがblockしないようにする。
    • implementationのOutcomeチェックは維持する。
    • C8の抽象表現検査とsection存在検査を必要に応じて分離してよいが、スコープを不必要に拡大しない。

    3. VC missing-section replay taxonomy

    REVIEWER_CHECKER_TAXONOMY_V1のvc_command_format entryへ、次の正確なrule IDを追加してください。

    VC001_NO_VERIFICATION_COMMANDS_SECTION

    原則として、汎用カテゴリextraction_errorをそのままreadiness_categoriesへ追加しないでください。

    理由:

    • extraction_errorはmissing section以外の抽出失敗にも使われ得る。
    • producerはmissing sectionを一意なrule IDで出力している。
    • _matching_readiness_errorsはrule ID一致でも証拠採用できる。
    • readiness_rule_id_source_checkが未限定であるため、source_check: baseline_vc_preflightの実producer出力を正しく採用できる。

    カテゴリ追加が不可欠だと判断した場合は、無関係なextraction_errorを採用しないsource-qualified設計とnegative testを提示し、理由をPR本文に記録してください。

    4. 回帰テスト

    最低限、次を追加してください。

    1. canonical parent bodyがOutcomeとVerification Commandsを持たなくても:

      • C4がn/a
      • C8がn/a
      • これらを理由にneeds-fixにならない
    2. implementation bodyがVerification Commandsを持たない場合:

      • C4は従来どおりfailする
    3. implementation bodyがOutcomeを持たない場合:

      • C8は従来どおりfailする
    4. reviewer code C4と、以下のreadiness errorを同じbody SHAで入力した場合:

      • rule_id: VC001_NO_VERIFICATION_COMMANDS_SECTION
      • source_check: baseline_vc_preflight
      • category: extraction_error
      • verdictがdeterministic_fail_confirmed
      • routingがproceed_to_rewrite
      • should_consume_iteration: true
      • reviewer_claim_unbacked_by_deterministic_checkerにならない
      • 2回目でもreviewer_false_positive_suspected/human_escalationにならない
    5. taxonomy dump・schema・duplicate-key・parity invariantの既存テストがすべてpassする。

    6. parent validation profileの既存テストを変更せずpassさせる。

    禁止事項

    • #1860本文へ疑似VCを追加しない。
    • #1860のchild issueを自動起票しない。
    • 新しいJSON/YAML schema、receipt、digest、publisher、state machine、reason-code familyを追加しない。
    • extraction_error全体を無条件にC4証拠へ昇格しない。
    • reviewer rerun回数を増やして問題を回避しない。
    • human escalationを単に無効化しない。
    • implementation Issueの既存C4/C8 enforcementを弱めない。
    • テストfixtureを実装に合わせて緩めるだけの修正をしない。

    検証

    変更箇所に対応するpytestを個別実行した後、関連skillのテストスイートを実行してください。

    少なくとも以下を含めてください。

    • review-issueのC4/C8テスト
    • contract readiness parent profileテスト
    • reviewer claim replayテスト
    • reviewer claim replay taxonomy parityテスト

    実際のコマンドはrepositoryの現行runner、依存管理、CLAUDE.md、既存テスト実行規約を確認して確定してください。

    PR要件

    • Draft PRとして作成する。
    • PR本文に#1860のhuman escalationを再現した入力shapeを記載する。
    • 「parent applicability defect」と「implementation missing-VC taxonomy defect」を別項目で説明する。
    • #1860本文を変更していないことを明記する。
    • generic extraction_error mappingを採用しなかった理由を記載する。
    • before/afterのreplay verdict、routing、iteration consumptionを記載する。
    • current headに対するテスト結果を記載する。

    完了条件

    1. Follow-up Issueが起票されている。
    2. 修正PRが作成されている。
    3. parentでC4/C8がn/aになる回帰テストがpassしている。
    4. implementationでC4/C8のfailが維持されている。
    5. VC001_NO_VERIFICATION_COMMANDS_SECTIONがC4の決定論的証拠として採用される。
    6. 同一bodyでreviewer false-positive escalationへ遷移しない。
    7. #1860本文およびchild materializationに変更がない。
    8. 最終報告にIssue URL、PR URL、head SHA、変更ファイル、テスト結果、未解決事項を記載する。

    実装途中で、parent profile自体がOutcomeまたはVerification Commandsを必須とする別のcurrent SSOTを発見した場合は、勝手にどちらかへ統一せず停止し、該当箇所と矛盾する一次資料を報告してください。

    この順序なら、#1860の思想と矛盾する「checkerを満たすための本文増築」を避けつつ、実際の再発経路も閉じられます。

  5. squne121 commented on Jul 30, 2026

    @squne121
    OwnerAuthor

    Human Decision — Refinement escalation disposition

    Issue #1860 は issue_kind: parent、parent_mode: delivery-rollup、closure_mode: child-complete の既存parent trackerであり、本Issue自体ではコード変更を行わない。

    今回のreview findingについて、以下のとおり判断する。

    • C4 ## Verification Commands欠落: not applicable
    • C8 ## Outcome欠落: not applicable

    理由:

    • 既存parent Issue用の existing_issue_readiness_v1 profileでは、## Outcomeおよび## Verification Commandsは必須セクションではない。
    • check_issue_contract.pyのC4/C8がissue kindを考慮せずparentにも適用されており、parent validation profileとのapplicability driftが発生している。
    • #1860本文へ実装Issue用の疑似Verification Commandsを追加することは、本文の意味を改善せず、checkerを満足させるためだけのworkaroundになる。

    処置:

    1. C4/C8 findingを、#1860の本文修正blockerとしては棄却する。
    2. #1860本文は、この2件だけを理由として変更しない。
    3. C4/C8のparent applicabilityとreviewer-claim replay taxonomy gapは、別のfollow-up Issue/PRで修正する。
    4. checker修正前に同一body・同一laneでrefinement loopを再実行しない。
    5. この判断はAllowed Pathsの拡張、4件のchild候補の一括materialization、関連Issueのcloseを許可するものではない。child materializationは各childのOutcome・Allowed Paths・Acceptance Criteria確定後に個別判断する。
  6. squne121 commented on Jul 30, 2026

    @squne121
    OwnerAuthor

    Owner Decision: Codex V2 runtime capability probe assets

    decision: remove_probe_and_tests
    decided_at: 2026-07-30
    authority: human_owner
    applies_to:
      - scripts/agent-guards/probe_codex_v2_runtime_capability.py
      - tests/agent-guards/test_probe_codex_v2_runtime_capability.py
      - artifacts/codex-multi-agent-v2/runtime-capability.json
      - docs/dev/codex-multi-agent-v2-runtime-evidence.md
      - .github/ci/python-test-plan.json の tests/agent-guards/ target
    consequence:
      issue_1861: close_as_superseded
      implementation_scope: "#1860 配下の Multi-Agent V2 整理/クリーンアップ child"

    Decision rationale

    Issue #1834 / PR #1850 で追加された probe は、Codex CLI のバージョン、feature flag 認識、config loader の accept/reject を記録する Phase 0 診断資産であるが、実際の spawn_agent Multi-Agent V2 runtime capability は検証していない。

    現時点では、この probe artifact を実装判断または実行時 gate として使用する committed consumer が存在せず(2026-07-30 リポジトリ全体 rg で probe 本体・専用 test・artifact・専用 evidence 文書以外の参照なしを確認済み)、#1833 の後続 Multi-Agent V2 導入 children(#1835〜#1842)も未完了である。今後の方針は #1860 の minimal harness 化とし、利用されていない Phase 0 evidence chain へ追加のテスト・schema・freshness gate を投資しない。

    将来 Multi-Agent 機能を実際に利用する場合は、committed artifact を authoritative evidence として維持せず、利用直前に現在の Codex CLI を対象とした read-only live canary を実行する。canary の失敗は診断情報として扱い、通常の開発作業全体を停止する blocking authority にはしない。

    Required follow-up

  7. squne121 commented on Jul 30, 2026

    @squne121
    OwnerAuthor

    #1860 には対象childが未起票のまま残っています。既存 #1674 は semantic planning authority の集約を目標としており、今回の「authority自体を撤去する」方針とは衝突します。PR #1854 で確立した「artifactはadvisory、repository identity・実テスト等の安全境界は維持」という線を基準にした実行プロンプトです。

    あなたは squne121/loop-protocol の変更を完遂する実装オーケストレーターです。

    対象親Issue:

    実施対象:

    実装: semantic planning・overlap・contract artifactのblocking authorityを撤去する
    OPEN Issue全件収集・scope-rollup・contract snapshot・body SHA・overlap evidenceをblocking authorityから外し、実Git conflict・GitHub mergeabilityのみをこの領域のhard stopとして残す。

    親Issue #1860 の修正、implementation child Issueの起票、専用worktreeでの実装、Draft PR作成、独立レビューと修正反復までを、このセッション内で連続して実施してください。

    最重要のOwner Decision

    これは調査提案ではなく、実装を開始するための明示的なowner decisionです。

    以下は、実装開始・継続・PR publication・merge readinessを自動停止できません。

    • OPEN Issue全件収集の失敗、不完全、saturation
    • semantic duplicate・依存順・優先順位の推定
    • scope-rollup結果
    • ISSUE_SCOPE_ROLLUP_*
    • ISSUE_EXECUTION_DECISION_*
    • contract snapshot
    • CONTRACT_REVIEW_RESULT_*
    • Issue body SHA・updated_at・fingerprint不一致
    • overlap evidence
    • overlap evidence digest・freshness・readback不一致
    • declared Allowed Pathsの文字列重複
    • semantic classifierのambiguous・unknown・runtime failure
    • advisory artifactのmissing・stale・invalid・parse failure
    • scope-rollup runner、contract reviewer、overlap checkerの利用不能

    これらは削除するか、任意のadvisory diagnostic/telemetryに降格してください。

    表現形式を禁止するのではなく、停止権限を禁止します。

    JSON、YAML、digest、snapshotをログ・表示・機械的受け渡しに残すことは可能ですが、それらの欠落、不一致、stale、invalidを通常作業のhard stopにしてはなりません。新しい代替schema、receipt、digest、publisher、reason-code enum、planning graph、authority artifactは追加しないでください。

    この変更領域に残すhard stopは以下です。

    1. current headと対象peer commitの実際の3-way Git conflict

    2. target PRについてGitHubが現在のheadを明示的に競合状態と判定した場合

      • mergeable == CONFLICTING
      • merge_state_status == DIRTY

    UNKNOWN、null、BLOCKED、BEHIND、UNSTABLE、DRAFT、HAS_HOOKSをGit conflictとして扱わないでください。UNKNOWN/nullはbounded retry後にwarningとして実装・レビューを継続でき、最終merge-ready判定だけを保留できます。

    ただし、本Issueは以下の独立した安全境界を弱めるものではありません。

    • canonical repository・linked Issue・worktree identity
    • root checkout、detached HEAD、誤branchでの編集禁止
    • secret、credential、protected path
    • default branchへの直接push
    • force push、history rewrite、破壊的Git操作
    • live Issueで明示された対象スコープ
    • 実diff
    • typecheck、lint、test、build
    • current-head CI
    • 独立PRレビュー
    • GitHub branch protection
    • 現在の人間による直接的な「作業を停止せよ」という指示

    構造化された古いblocked artifactを発見しただけでは停止しないでください。現在のlive Issueまたはowner commentに直接的かつ明示的な停止命令がある場合だけ、人間のvetoとして扱います。


    Phase 1: 現行状態の取得

    最初に以下をlive取得してください。

    最低限、以下を横断検索してください。

    scope-rollup
    scope_rollup
    contract_snapshot
    CONTRACT_REVIEW_RESULT
    body_sha
    body_sha256
    fingerprint
    overlap_evidence
    check_implementation_overlap
    check_issue_overlap
    ISSUE_EXECUTION_DECISION
    latest_blocked
    missing_go
    stale_contract
    human_review_required
    pairwise_merge
    mergeable
    merge_state_status
    

    対象候補:

    .claude/skills/issue-refinement-loop/
    .claude/skills/issue-contract-review/
    .claude/skills/create-issue/
    .claude/skills/edit-issue/
    .claude/skills/implement-issue/
    .claude/skills/impl-review-loop/
    .claude/skills/open-pr/
    .claude/agents/
    .codex/agents/
    scripts/agent-guards/
    docs/dev/workflow.md
    docs/dev/agent-skill-boundaries.md
    docs/dev/scope-rollup-policy.md
    tests/
    

    ファイル名の存在はcurrent mainで確認し、存在しないパスをIssueのAllowed Pathsへ推測で追加しないでください。

    既存 #1674 系について、次の基準で分類してください。

    • semantic planningをblocking authorityとして維持・強化するだけのscope:

      • 新childによりsupersede
    • 削除対象コードの所在を示すscope:

      • reuse_for_removal
    • 実Git conflictまたはGitHub mergeabilityをartifact authorityなしで直接検証する独立scope:

      • 必要部分のみreuse可能
    • 新しいschema・digest・snapshot・freshness trust chainを追加するscope:

      • 原則supersedeまたはclose候補

    #1674の「semantic relationをissue-refinement-loopの唯一のauthorityにする」という方針は採用しません。planning authorityを別の場所へ移すのではなく、通常作業に対するblocking authority自体を撤去します。


    Phase 2: 親Issue #1860を先に修正

    Issue #1860をsection-preservingに更新してください。全文を雑に再生成せず、既存の有用な記述を保持してください。

    更新内容:

    2.1 Current state修正

    • #1851をCLOSED/完了済みに更新

    • PR #1854をMERGEDとして記録

    • #1854で確立した以下の境界をnormative baselineとして記録

      • artifact missing/stale/invalidはwarning
      • canonical repository bindingは維持
      • cross-repository mismatchは維持
      • protected paths、実テスト、CI、reviewは維持

    2.2 Owner Decision追加

    通常のMarkdown節として、2026-07-30の決定を追加してください。新しいmachine-readable schema名は作らないでください。

    明記する内容:

    • semantic planning artifactを新たなauthorityへ移行しない
    • OPEN Issue inventoryは必要時のadvisory調査
    • scope-rollupは明示手動呼出し可能なadvisory diagnostic
    • contract snapshotは任意のinterchange/telemetry
    • body SHAはログまたはoptimistic retryに利用可能
    • body SHA mismatchはrefetch・section-level reapplyで処理し、人間停止理由にしない
    • overlap evidenceは任意
    • evidence digest・freshness・completenessは停止権限を持たない
    • 新しい代替artifact authorityを追加しない
    • 実Git conflictとtarget PRの明示的なconflicting mergeabilityのみを当該領域のhard stopとする
    • unrelated safety/verification gateは維持する

    2.3 Child Issues更新

    次のplaceholderは、child起票後に実Issue番号へ置換します。

    (未起票)実装: semantic planning・overlap・contract artifactのblocking authorityを撤去する
    

    #1851のchecklistは完了へ更新してください。

    2.4 Closure Matrix更新

    #1674、#1676、#1679、#1652、#1792、#1793、#1853について、取得したlive stateと今回の決定に基づく暫定classificationを記録してください。

    閉じる時期は以下を守ってください。

    • child作成時点では、関連Issueへsupersede予定をコメントしてよい
    • そのIssueの全scopeが実際に吸収されるまでは早期closeしない
    • child PRがmainへ入った後に、残存scopeがないIssueだけcloseする
    • mergeabilityの直接検証として有用なscopeが残るIssueは、子Issueへ吸収するか、明確にkeepする

    2.5 親Issue更新方法

    body SHAや既存edit skillのgateで停止しないでください。

    推奨手順:

    1. live bodyを一時ファイルへ取得
    2. section単位で変更
    3. gh issue editで反映
    4. readback検証
    5. concurrent updateがあれば再取得し、同じsection patchを最大3回再適用

    body SHA mismatchそのものをhuman escalationにしないでください。


    Phase 3: implementation child Issueを起票

    完全一致タイトルのOPEN Issueが既に存在するかを軽量確認してください。

    検索失敗、pagination不完全、saturationはwarningです。完全一致が確認できなければ作成を続行してください。完全一致Issueが存在する場合は重複作成せず、それを採用して親へリンクしてください。

    タイトル:

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

    親:

    #1860
    

    既存の標準labelsをcurrent repositoryから取得し、implementation Issueとして適切なlabelsを付けてください。

    Issue本文には最低限、以下を含めてください。

    Machine-Readable Contract

    既存の通常形式だけを使います。

    contract_schema_version: v1
    issue_kind: implementation
    parent_issue: "#1860"
    goal_ref: "OPEN Issue inventory・semantic planning・scope-rollup・contract snapshot・body SHA・overlap evidenceを通常作業のblocking authorityから外し、実Git conflict・target PR mergeabilityだけを当該領域のhard stopとして残す"
    change_kind: workflow

    Outcome

    以下が同時に成立する状態を定義してください。

    • issue作成、refinement、contract review、implement、impl-review-loop、open-prの各production pathが、semantic planning/artifact異常だけで停止しない
    • OPEN Issue全件収集を通常実装開始の必須前提にしない
    • scope-rollupは任意のmanual advisory diagnostic
    • contract snapshot、body SHA、fingerprint、overlap evidenceはoptional
    • stale、missing、invalid、ambiguous、incomplete、saturated、runtime_errorで通常作業を継続できる
    • downstreamが別名の新artifact authorityを要求しない
    • current-headの実Git conflictは停止する
    • target PRのCONFLICTING/DIRTYは停止する
    • canonical repo、protected paths、test、CI、review等の独立安全境界は維持される

    In Scope

    current mainのinventory結果を反映して、少なくとも以下のproduction consumerを対象にしてください。

    • refinement preflight/planner routing
    • issue/contract review routing
    • create-issueのdedupe・overlap path
    • implement-issueのOPEN Issue全件overlap preflight
    • impl-review-loop preparation/intake routing
    • open-prのoverlap evidence consumer
    • 関連docs・tests・fixtures・validator

    Out of Scope

    • replay/envelope/custom publisher全体の整理
    • TEST_VERDICT lane全体
    • Multi-Agent V2・session ledger・manifest全体
    • unrelated product code
    • branch protectionそのものの弱体化
    • secret・protected path・destructive Git guardの弱体化
    • 新しいplanning schema/authority artifactの導入

    Acceptance Criteria

    少なくとも以下を含めてください。

    1. OPEN Issue inventoryがmissing/incomplete/saturated/runtime_errorでもimplementationへ進む
    2. semantic overlapがduplicate/ambiguous/unknownでも自動停止せずwarningになる
    3. scope-rollup missing/stale/invalid/runner failureがwarningになる
    4. contract snapshot missing/stale/invalid/blocked artifactが、それだけでは停止理由にならない
    5. Issue body SHA/fingerprint mismatchがrefetch/retryまたはwarningになり、通常作業を停止しない
    6. overlap evidenceが欠落・stale・digest mismatchでもPR publicationが可能
    7. check_implementation_overlap.py等のOPEN Issue全件収集がproduction必須経路から外れる
    8. 別名のreplacement authority artifactが追加されていない
    9. 実際の3-way Git conflictは停止する
    10. target PRのmergeable == CONFLICTINGまたはmerge_state_status == DIRTYは停止する
    11. UNKNOWN/null/BLOCKED/BEHIND/UNSTABLE/DRAFTをGit conflictと誤判定しない
    12. canonical repository mismatch、protected path、test failure、CI failure、review request-changesは従来どおり処理される
    13. docs、skill、production script、testsの記述が一致する

    Verification Commands

    current inventory後に実在するテストへ合わせて確定してください。

    最低限、以下の観点をテストしてください。

    • warning-only truth table
    • missing/stale/invalid artifact
    • incomplete/saturated OPEN Issue inventory
    • semantic overlap classifier failure
    • body SHA mismatch
    • overlap evidence missing/digest mismatch
    • actual merge conflict fixture
    • GitHub mergeability truth table
    • canonical repository mismatch negative test
    • full relevant skill test suites
    • lint/typecheck
    • git diff --check

    Allowed Paths

    current mainのproducer/consumer inventoryから確定してください。削除・更新対象に直接結合するdocs、tests、fixtures、validatorは含めてください。

    実装中に直接結合する追加pathが判明した場合:

    1. child Issue本文を先に更新
    2. readback
    3. その後に編集

    body SHA mismatchやoverlap判定を理由にscope updateを停止しないでください。

    Stop Conditions

    このchild固有のStop Conditionsは次に限定してください。

    • secret、credential、protected/manual assetへの意図しない変更が必要
    • destructive Git操作が必要
    • repositoryまたはGitHub権限が不足
    • current ownerの明示的な停止指示
    • 実Git conflictを安全に解消できない
    • target PRがcurrent headで明示的にCONFLICTING/DIRTY
    • 実テスト、CI、独立レビューのblockerを修正できない

    semantic planning、OPEN Issue inventory、scope-rollup、contract snapshot、body SHA、overlap evidenceをStop Conditionへ含めないでください。

    Issue作成後:

    • native sub-issueとして#1860へ登録
    • Part of #1860または同等の本文リンクを確認
    • #1860のplaceholderを新Issue番号へ置換
    • #1860のNext Actionを新child実装へ更新
    • parentとchildのreadbackを行う

    既存create-issue skillが、OPEN Issue全件性、semantic overlap、artifact freshnessを理由に停止する場合は、その停止自体が今回の撤去対象です。direct gh issue createを使用し、作成後に必要なlabels・parent relation・readbackを個別に適用してください。


    Phase 4: 実装

    新child専用のbranch/worktreeを作成してください。

    • root checkoutやdefault branch上で編集しない
    • dirty worktreeを流用しない
    • default branchへ直接pushしない
    • force pushしない
    • 1 Issue = 1 PR

    実装前にproducer/consumer matrixを一時メモとして作成してください。

    列:

    mechanism
    producer
    consumer
    current failure effect
    desired failure effect
    retain/delete
    tests
    

    このメモは新しいauthority artifactにしないでください。PR説明用の調査メモです。

    実装方針:

    4.1 OPEN Issue inventory

    • productionの通常実装開始経路から全件収集を外す
    • 必要時だけ明示的に実行できるadvisory調査へ縮小
    • pagination不完全、上限到達、schema不備、readback failureをwarningにする
    • 実装開始・PR作成を止めない
    • exact-title dedupeを残す場合も、検索失敗・saturationをhard stopにしない
    • 既存Issueを完全一致で発見した場合はidempotently再利用可能

    4.2 Semantic planning/scope-rollup

    • semantic relation、優先順位、duplicate、predecessorを閉じたroute enumで強制しない
    • issue-refinement-loopへのauthority集約で置換しない
    • impl-review-loopやimplement-issueからautomatic scope-rollup dispatchを外す
    • manual diagnostic capabilityを残す場合はadvisory-only
    • outputがなくても次工程へ進む

    4.3 Contract snapshot/body SHA

    • go snapshotをauthorization前提にしない
    • latest_blocked構造化artifactを自動human escalationへ直結させない
    • missing、stale、runtime_error、parse error、fingerprint mismatchをwarningにする
    • body SHAを残す場合はtelemetryまたはbounded optimistic retry専用
    • live Issue本文を正本にする
    • direct owner vetoはlive stateから判断する

    4.4 Overlap evidence

    • required input、required file、required digest、required commentにしない
    • open-prでオンライン再実行を要求しない
    • stored/fresh digest差分でPR publicationを止めない
    • evidenceを残す場合はPR本文のwarning/diagnosticに限定
    • Allowed Pathsの文字列重複やsemantic similarityを実Git conflictと扱わない

    4.5 実競合/mergeability

    過剰なschema-governed trust chainは作らないでください。

    実Git競合は、current target headと実在する比較対象commitについて、Gitの3-way merge observationで判定してください。ファイル名重複、Allowed Paths重複、自然言語類似度は代用にしません。

    GitHub mergeabilityは別フィールドとして処理してください。

    • mergeable == CONFLICTING: hard stop
    • merge_state_status == DIRTY: hard stop
    • BEHIND: branch更新または通常修正route
    • BLOCKED: required checks/review/protectionとして処理
    • UNKNOWN/null: bounded retry後warning、最終merge-readyのみ保留
    • UNSTABLE、DRAFT、HAS_HOOKS: Git conflictではない

    4.6 回帰防止

    PR #1854で発生した種類の回帰を防いでください。

    • docsだけ変わりcanonical routing producerが残る
    • canonical repository解決がfail-openになる
    • cross-repository binding rejectionの意味が反転する
    • warning-only化した情報が観測不能になる
    • testsが古いhard gateの文字列削除だけを確認し、実routeを確認しない
    • skill文書、production script、CLI help、testsが食い違う

    文字列grepだけでなく、production functionを実行するbehavior test/mutation testを追加してください。


    Phase 5: 検証とDraft PR

    child Issueの全ACを、freshなworktree状態で検証してください。

    最低限:

    対象pytest
    関連skill全テスト
    ruff/lint
    typecheck(該当時)
    build(該当時)
    git diff --check
    git status
    baseとの差分確認
    Allowed Paths readback
    current-head CI
    

    Draft PR本文には以下を含めてください。

    • Summary
    • Root cause
    • Authority removal matrix
    • Preserved safety boundaries
    • Acceptance Criteria達成状況
    • Verification commandsと実結果
    • Changed files
    • Scope Delta
    • Schema Change Applicability
    • Related/superseded Issues
    • Closes <new child issue>
    • parent #1860への参照

    新しいauthority artifactを作っていないことを明記してください。

    自動mergeは行わず、Draft PRをmerge-readyなレビュー状態まで進めてください。


    Phase 6: Implementation Review Loop

    Draft PR作成後、実装者とは独立したreviewerを使ってレビューしてください。

    既存impl-review-loopが利用できる場合は新child Issueを対象に実行します。ただし、そのloopが次の理由で停止する場合は、今回撤去する旧blocking authorityの自己参照です。

    • contract snapshot missing/stale/invalid
    • body SHA mismatch
    • scope-rollup missing/stale/invalid
    • OPEN Issue inventory incomplete
    • semantic overlap ambiguity
    • overlap evidence missing/digest mismatch
    • ISSUE_EXECUTION_DECISION_* missing/stale
    • artifact publisher/materializer不足

    これらでは人間へ停止せず、manual fallback review loopへ切り替えてください。

    manual fallback:

    1. implementation workerが修正
    2. fresh reviewerがIssue、parent、PR、current diff、関連Issue/PRを再取得
    3. reviewerがテストを独立再実行
    4. APPROVEまたはREQUEST_CHANGES
    5. blockerがあれば実装者が修正
    6. current head SHAを更新
    7. fresh reviewerが再レビュー
    8. 最大5 iteration

    レビューで重点確認する事項:

    • hidden blocking producerが残っていないか
    • docsだけadvisoryでproduction routerがfail-closedのままではないか
    • create-issueのsaturation guardが停止権限を保持していないか
    • implement-issueがOPEN Issue全件検査を別経路で呼んでいないか
    • impl-review-loopがscope-rollupをautomatic dispatchしていないか
    • latest_blockedやfingerprint mismatchが自動停止していないか
    • open-prがoverlap evidenceを再要求していないか
    • replacement artifact authorityを新設していないか
    • actual Git conflict detectorを単純path overlapで代用していないか
    • GitHubのmergeableとmerge_state_statusを混同していないか
    • canonical repository、cross-repository rejection、protected paths、tests、CIが弱体化していないか
    • warning-only経路のbehavior testがあるか
    • stale/missing/invalidを正常に継続できるnegative testがあるか

    review verdictはcurrent head SHAに束縛してください。

    REQUEST_CHANGESなら自動修正して再レビューしてください。semantic artifactを理由とする差し戻しは採用せず、実コード、実テスト、安全境界、Git conflict、GitHub mergeabilityに基づく指摘だけをblockerとして扱ってください。


    Phase 7: 関連Issue整理

    PRがreview APPROVEかつCI greenになった時点で、#1860と関連Issueへ結果を反映してください。


    最終報告

    最後に以下だけを明確に報告してください。

    RESULT:
      parent_issue_updated: true|false
      child_issue_url: ...
      child_issue_number: ...
      parent_child_link_verified: true|false
      branch: ...
      worktree: ...
      commit_sha: ...
      draft_pr_url: ...
      reviewed_head_sha: ...
      review_verdict: APPROVE|REQUEST_CHANGES|INCOMPLETE
      ci_status: ...
      mergeability:
        mergeable: ...
        merge_state_status: ...
      iterations: ...
      tests:
        passed: [...]
        failed: [...]
      preserved_safety_boundaries: [...]
      removed_blocking_authorities: [...]
      related_issue_actions: [...]
      remaining_blockers: [...]
      merge_performed: false

    不明点を質問して停止せず、live repositoryとowner decisionに基づいて最善の実装を進めてください。

    ただし、secret/credential、権限不足、破壊的Git操作、解消不能な実Git conflict、current ownerの明示停止指示がある場合は、安全に停止して具体的な証拠を提示してください。

    この版は、親Issueとchild Issueを実際に更新し、Draft PRを独立レビューのAPPROVEまたは修正不能blockerまで進めます。最終マージは行いません。

  8. squne121 commented on Jul 30, 2026

    @squne121
    OwnerAuthor

    設計上の補正

    対象childは現時点でも #1860 の Child Issues で「未起票」のままです。また、親Issueは新しいschema・digest・publisher・reason-code enumを追加しないこと、artifact不整合ではなくlive stateを正本にすることを明示しています。

    現行実装では、issue-refinement-loop がparent-local replay、V2 envelope、binding digest、永続state storeへ直結し、impl-review-loop は巨大なLOOP_STATEとLOOP_VERDICT_V2を正本にしています。PRレビュー投稿もcontrolled review publisher経由です。したがって、consumerだけを書き換えてproducerを残すのではなく、production call graphを切り替えた後にdead producer・schema・testを削除する必要があります。

    関連して、#1857はLOOP_VERDICT_V2をさらにstrict schema化する逆方向のIssueです。#1321/PR #1832も専用termination publisherの出力を強化する変更であり、このchildによるsupersede対象です。

    サブエージェントはfocused taskを独立contextで実行し、mainへ結果だけを戻す用途に適しています。一方、Agent Teamsはexperimentalで、同一ファイル群を一人のwriterが順次変更する作業には調整コストが大きいため、この作業ではnative subagentsを使い、Agent Teamsは使わない構成にしています。([Claude]1) ([Claude]2)

    Claude向け実行プロンプト

    あなたは `squne121/loop-protocol` のmain-thread owner/operatorとして作業する。
    
    # Mission
    
    親Issue #1860のOwner Decisionに基づき、次の未起票childを起票し、親Issueをlive stateへ修正し、実装・検証・独立レビューをbounded loopで完了してDraft PRを作成せよ。
    
    タイトル:
    
    実装: review/refinementのreplay・envelope・custom publisherをbounded loopへ置換する
    
    目的:
    
    - review/refinementの通常経路をClaude Code native subagentsによるbounded loopへ簡素化する
    - review結果を、概ね次の最小情報へ縮小する
      - verdict
      - reviewed_head_sha、またはIssue本文の場合はreviewed_body_sha256
      - blockers
      - optional warnings
    - replay arbitration、parent binding digest、review envelope、永続state store、専用termination/review publisherをproduction経路から撤去する
    - current-head検証、live IssueのAllowed Paths、実テスト、current-head CI、canonical repository/worktree/branch、protected paths、secret保護、GitHub branch protection、人間による最終マージは維持する
    
    最終成果物:
    
    1. 新規implementation Issue
    2. #1860本文のsection-level修正とreadback
    3. 新規Issue本文に対する最大3回の簡素なissue refinement loop
    4. 専用worktree/branch上の実装
    5. tests・lint・typecheck・build結果
    6. Draft PR
    7. 最大3回のimplementation review loop
    8. 関連Issue/PRのsupersession整理
    9. #1860へのPR進捗反映
    10. URL、SHA、検証結果、残存blockerを含む最終報告
    
    PRを自動mergeしてはならない。人間による最終マージを残すこと。
    
    ---
    
    # Absolute Rules
    
    ## Live state
    
    - Issue、PR、repository、branch、HEAD、diff、CIは毎回live readbackする。
    - prompt中や既存Issue本文に書かれたstate、head SHA、mergeabilityを固定値として信用しない。
    - GitHub mutation直前に、repository、Issue番号またはPR番号、current headを再取得する。
    - mutation後にbody、comment、PR headをreadbackする。
    - body SHAやupdated_atが変わっていた場合は、停止せずrefetchして対象sectionだけを再適用する。
    
    ## 禁止する新規control-plane
    
    以下を新設してはならない。
    
    - JSON/YAML schema
    - schema catalog entry
    - digest、fingerprint、receipt
    - replay artifact
    - binding artifact
    - snapshot authority
    - loop state file
    - custom publisher
    - semantic reason-code enum
    - custom termination envelope
    - compatibility用のV3等の新version
    - semantic judgmentをblockするSubagentStop/Stop hook
    - review結果を検証する専用hook、専用daemon、専用MCP
    - Agent Teams用task graphやteam state
    
    既存資産を別名で再実装することも禁止する。
    
    ## 維持する安全境界
    
    次は弱めない。
    
    - canonical repository identity
    - linked Issue、worktree、branch、HEADの一致
    - root checkout/detached HEAD/誤branchでの編集禁止
    - live Issue本文のAllowed Paths
    - protected paths、secret、credential、手管理asset
    - default branchへの直接push禁止
    - force push、history rewrite、destructive Git禁止
    - actual typecheck、lint、test、build
    - current-head CI/required checks
    - actual Git conflict
    - GitHub branch protection
    - independent review
    - 人間による最終merge
    
    artifact、digest、snapshot、parserの欠落や不正だけを理由に実装開始、PR作成、レビューを止めてはならない。
    
    ## 現行loopの扱い
    
    この作業では、変更対象そのものである現行`issue-refinement-loop`と`impl-review-loop`を、着手可否を決定するpreconditionとして使用してはならない。
    
    - 現行Replay Arbitrationを通過条件にしない
    - 現行LOOP_VERDICT_V2を起票・着手条件にしない
    - 現行termination publisherを作業開始条件にしない
    - 現行state storeをresume条件にしない
    - 現行artifact validation failureをhuman escalation理由にしない
    
    変更対象のtestsとして実行することは許可する。
    
    ## Agent policy
    
    - Native subagentsを使用する。
    - Agent Teamsは使用しない。
    - nested delegationは禁止する。全subagentからAgent toolを外す。
    - writerは常に1名だけ。
    - read-only agentは最大3名まで並列実行可能。
    - background writerは禁止する。
    - main threadのみがGitHub mutation、worktree作成、commit、push、PR作成、Issue close、PR closeを行う。
    - subagentはGitHub issue/PRをedit、comment、close、reviewしない。
    
    ---
    
    # Subagent Specifications
    
    既存の`issue-reviewer`と`pr-reviewer`は現時点ではreplay、LOOP_VERDICT_V2、controlled publisherへ結合されているため、変更前の定義を本作業の最終authorityとして使わない。
    
    初期調査と最初のレビューには、built-in Explore/general-purposeまたはsession-scoped custom subagentを使用する。今回の作業のためだけに新しい`.claude/agents/*.md`をcommitしてはならない。
    
    ## 1. control-plane-auditor
    
    責務:
    
    - production call graphの棚卸し
    - replay、envelope、binding、state、publisherのproducer/consumer一覧
    - exact pathごとのkeep/modify/delete分類
    - schema catalog、command registry、hook policy、docs、testsの参照確認
    - #1857、#1321、PR #1832、#1867とのscope関係確認
    
    権限:
    
    - Read、Grep、Glob、read-only Bash
    - Edit、Write、GitHub mutation、Agentは禁止
    
    出力:
    
    - exact path
    - current role
    - production consumer
    - proposed action: keep | modify | delete
    - safety reason
    - required tests
    - related Issue/PR disposition
    
    新しいschema形式で返さず、簡潔なMarkdown表または箇条書きで返す。
    
    ## 2. safety-boundary-auditor
    
    責務:
    
    - 削除対象と維持すべきsecurity boundaryを分離する
    - generic GitHub mutation guardを誤って削除しないことを確認する
    - repository/Issue/PR/head readback、Allowed Paths、protected path、secret、Git safetyを確認する
    - #1871の変更をrevertしないことを確認する
    
    権限:
    
    - read-only
    - Agent、Edit、Write、GitHub mutationは禁止
    
    出力:
    
    - must-preserve
    - safe-to-remove
    - unresolved safety blocker
    
    ## 3. issue-contract-reviewer-lite
    
    責務:
    
    - 新規Issueの本文をlive bodyからレビューする
    - semantic quality、scope、AC、VC、Allowed Pathsを確認する
    - replay taxonomyやdeterministic arbitrationを行わない
    - 本文を編集しない
    
    返却形式は内部の簡易conventionとし、schema登録しない。
    
    ```yaml
    verdict: APPROVE | REQUEST_CHANGES | HUMAN_REVIEW_REQUIRED
    reviewed_body_sha256: "<レビューしたlive bodyのsha256>"
    blockers:
      - "<具体的かつ修正可能な指摘>"
    warnings:
      - "<任意>"
    ```
    
    `reviewed_body_sha256`はfreshness確認のための一時値であり、artifactへ保存せず、authorityにしない。不一致時はbodyをrefetchしてbounded rereviewする。
    
    ## 4. implementation-worker
    
    唯一のwriter。
    
    責務:
    
    - 新規IssueのAllowed Paths内だけを編集する
    - consumer-first migration
    - dead producer、schema、tests、docsの削除
    - targeted testsの実行
    - blocker修正
    
    権限:
    
    - dedicated worktree内のRead、Grep、Glob、Edit、Write、Bash
    - GitHub mutation、force push、main直接push、Agentは禁止
    
    main threadがcommit/pushするため、workerは勝手にremote mutationしない。
    
    返却内容:
    
    - changed files
    - deletion list
    - tests executed
    - remaining blockers
    - scope delta候補
    
    ## 5. test-verifier
    
    責務:
    
    - sourceを編集せず、指定されたcurrent HEADで検証する
    - targeted tests、negative tests、full relevant suitesを実行する
    - test commandとexit statusを正確に返す
    - failureを実装blockerとenvironment failureに分離する
    
    権限:
    
    - Read、Grep、Glob、Bash
    - Edit、Write、GitHub mutation、Agentは禁止
    - testが通常生成するcache/build outputは許容するが、tracked sourceは変更しない
    
    ## 6. pr-reviewer-primary
    
    責務:
    
    - linked IssueのOutcome、AC、Allowed Pathsとcurrent PR diffを照合する
    - control-planeが別名で再導入されていないか確認する
    - deletion後にproduction dangling referenceがないか確認する
    - current-head tests/CIを確認する
    - GitHubへ投稿せずmainへ返す
    
    返却形式:
    
    ```yaml
    verdict: APPROVE | REQUEST_CHANGES | HUMAN_REVIEW_REQUIRED
    reviewed_head_sha: "<full current PR head SHA>"
    blockers:
      - "<file:line と具体的な問題>"
    warnings:
      - "<任意>"
    ```
    
    `merge_ready`、`required_auto_actions`、`allowed_paths_gate`、publisher request、digest、receipt等を返さない。
    
    ## 7. pr-reviewer-safety
    
    責務:
    
    - canonical repository/PR/head binding
    - stale-head handling
    - protected paths、secret、Git safety
    - actual conflict handling
    - generic mutation guardの回帰
    - parser/publisher除去後のTOCTOU処理
    - #1856/#1869のscope侵入有無
    
    返却形式は`pr-reviewer-primary`と同じ。
    
    ---
    
    # Phase 0 — Live Readback and Inventory
    
    main threadで以下を実施する。
    
    1. canonical repositoryを確認する。
    
    ```bash
    git rev-parse --show-toplevel
    git status --short --branch
    git remote -v
    gh repo view --repo squne121/loop-protocol --json nameWithOwner,defaultBranchRef
    git fetch origin main
    ```
    
    2. 次をlive取得する。
    
    - #1860のbody、全comments、labels、state
    - #1866とPR #1868
    - #1869とPR #1871
    - #1857
    - #1321とPR #1832
    - #1867
    - #1856
    - #1732
    - 関連するopen PR
    - current main SHA
    
    3. exact titleと意味的同一scopeの既存Issueを全stateで検索する。
    
    exact titleのOPEN Issueが既に存在し、parent、Outcome、scopeが今回と同一なら再利用する。単なる関連Issueや逆方向Issueは再利用しない。
    
    4. 次の語をproduction、docs、tests、registry、schema catalogで検索する。
    
    ```text
    reviewer_claim_replay
    parent_replay_binding
    REVIEWER_BLOCKER_CLAIM
    ISSUE_REVIEW_RESULT_COMPACT
    REVIEW_COMPACT
    REPLAY_PARENT_BINDING_DIGEST
    reviewer_claim_replay_state_store
    LOOP_STATE
    LOOP_VERDICT_V2
    route_loop_verdict_v2
    PR_REVIEW_PUBLISH_REQUEST
    pr_review.publish
    termination_report.publish
    publish_termination_report
    render_termination_report
    FOLLOW_UP_MATERIALIZATION_RESULT
    LOOP_HANDOFF_RESULT
    IMPL_REVIEW_LOOP_RESULT
    build_refinement_phase_state
    decide_next_loop_action
    emit_parent_review_envelope
    validate_review_compact_output
    ```
    
    最低限、以下をinventory rootとして読む。ただしIssueのAllowed Pathsにはdirectory wildcardではなく、調査で確定したexact filesを列挙する。
    
    ```text
    .claude/skills/issue-refinement-loop/
    .claude/skills/impl-review-loop/
    .claude/skills/pr-review-judge/
    .claude/agents/issue-reviewer.md
    .claude/agents/pr-reviewer.md
    .codex/agents/issue-reviewer.toml
    .codex/agents/pr-reviewer.toml
    scripts/agent-guards/controlled_skill_mutation_policy.py
    scripts/agent-guards/controlled_skill_mutation_exec.py
    .claude/settings.json
    docs/dev/workflow.md
    docs/dev/agent-skill-boundaries.md
    docs/dev/schema-governance.md
    docs/dev/workflows/issue-refinement-loop-design.md
    schemas/catalog.yaml
    ```
    
    5. `control-plane-auditor`と`safety-boundary-auditor`を並列実行する。
    
    6. main threadが結果を統合し、次のmatrixを作る。
    
    ```text
    path | role | production consumers | action | preserved invariant | tests
    ```
    
    このmatrixは作業メモであり、versioned artifactやGit管理ファイルにしない。
    
    7. PR #1871がOPENなら、そのbase、head、changed files、diffを取得する。
    
    - semantic overlapだけでは停止しない
    - actual conflictは`git merge-tree`またはdisposable worktreeで確認する
    - actual conflictがなければ並行して進める
    - #1871がmerge済みなら最新mainをbaseにする
    - #1871のwarning-continue方針やmergeability truth tableをrevertしない
    
    ---
    
    # Phase 1 — Create the Child Issue
    
    ## Issue creation
    
    exact duplicateがなければ、次のタイトルで新規Issueを作成する。
    
    ```text
    実装: review/refinementのreplay・envelope・custom publisherをbounded loopへ置換する
    ```
    
    既存labelを確認し、存在する場合だけ次を付与する。
    
    ```text
    enhancement
    phase/implementation
    agent/implementer
    ```
    
    新しいlabelを作成しない。
    
    Issue本文は以下を基礎とする。`Current Validated Scope`、`Verification Commands`、`Allowed Paths`はPhase 0のlive inventoryでexact path/test nodeへ置換してから起票する。`<...>`を残したまま起票してはならない。
    
    ---
    
    ## Machine-Readable Contract
    
    ```yaml
    contract_schema_version: v1
    issue_kind: implementation
    parent_issue: "#1860"
    goal_ref: "review/refinementの通常経路をnative subagentのbounded loopと最小結果conventionへ簡素化し、replay arbitration、parent binding digest、永続state store、review/termination専用publisherをproduction authorityから撤去する"
    change_kind: workflow
    ```
    
    ## Parent Issue
    
    #1860
    
    ## Parent Goal Ref
    
    - Goal: AIエージェント運用をminimal harnessへ縮退し、過剰なcontrol-planeを廃止する。
    - Desired Destination: live Issue/PR、canonical worktree、実diff、実テスト、current-head CI、独立レビューを正本とし、workflow artifactの存在・freshness・digest一致を通常作業の認可条件にしない。
    
    ## Current Validated Scope
    
    Phase 0で確認したproduction call graphを記載する。
    
    必ず次を含める。
    
    - issue-refinement-loopのReplay Arbitration、parent binding、review envelope、state store、termination publisherのcurrent consumers
    - impl-review-loopのLOOP_STATE、LOOP_VERDICT_V2、route parser、review publisherのcurrent consumers
    - pr-review-judge/issue-reviewer/pr-reviewerのcurrent handoff
    - controlled mutation policy内の対象command ID
    - schema catalog/docs/tests/fixturesのcurrent references
    - #1857、#1321/PR #1832、#1867とのscope関係
    - #1871のlive stateと、actual conflict以外はdependencyにしない判断
    
    ## Outcome
    
    `issue-refinement-loop`と`impl-review-loop`が、live GitHub stateとnative subagent resultだけで最大3回のbounded loopを実行できる状態にする。
    
    PR reviewの内部返却convention:
    
    ```yaml
    verdict: APPROVE | REQUEST_CHANGES | HUMAN_REVIEW_REQUIRED
    reviewed_head_sha: "<current PR head SHA>"
    blockers:
      - "<具体的なblocker>"
    warnings:
      - "<任意>"
    ```
    
    Issue reviewの内部返却convention:
    
    ```yaml
    verdict: APPROVE | REQUEST_CHANGES | HUMAN_REVIEW_REQUIRED
    reviewed_body_sha256: "<reviewed live bodyのsha256>"
    blockers:
      - "<具体的なblocker>"
    warnings:
      - "<任意>"
    ```
    
    これらは新規公開schema、catalog entry、artifact formatにせず、main threadとsubagent間の一時的な最小conventionとして扱う。
    
    main threadが所有する情報:
    
    - target Issue/PR
    - current bodyまたはPR head
    - iterationと最大iteration
    - unresolved blockers
    - current tests/CI
    - next action
    
    compaction、resume、session再開後はstate artifactをreplayせず、Issue/PR/current diff/CIを再取得する。
    
    ## Required Behavior
    
    - default maximum iterationは3
    - 明示入力でのみ上限変更可能
    - iteration間の継続はlive stateとfresh subagent resultから判断する
    - stale `reviewed_head_sha`はAPPROVEとして利用せず、current headで再レビューする
    - stale `reviewed_body_sha256`はhuman escalationにせず、bodyをrefetchして再レビューする
    - parser failureはIssue更新、implementation、Draft PR作成を止めない
    - 最小形式をparseできない場合は一度だけ再出力を求め、その後は人間可読blockerへfallbackする
    - max iteration到達時はPR/Issueを残したままHUMAN_REVIEW_REQUIREDへ移行する
    - 通常のGitHub client/connector/`gh issue comment --body-file`/`gh pr comment --body-file`を使用する
    - semantic result専用publisherを使用しない
    - GitHub mutation前後にrepository、target番号、current headをreadbackする
    - review criteria自体は変更せず、transport/orchestrationだけを簡素化する
    
    ## In Scope
    
    Phase 0で特定したexact filesに限定する。
    
    機能scope:
    
    - issue-refinement-loopの通常review/rewrite loop
    - impl-review-loopのimplementation/verification/PR review loop
    - issue-reviewer/pr-reviewerのminimal result handoff
    - replay arbitrationのproduction経路撤去
    - parent binding digestの撤去
    - review compact V2/termination envelopeの撤去
    - persistent loop state storeの撤去
    - LOOP_VERDICT_V2 production contractの最小conventionへの置換
    - dedicated review/termination publisherの撤去
    - dead command registry/policy branch/schema catalog entryの削除
    - docs、tests、fixturesの同期
    - normal GitHub mutation経路への移行
    - resume時のlive refetch
    - stale-head/stale-body negative tests
    
    ## Out of Scope
    
    - protected TEST_VERDICT producer/materializer/publisher laneの撤去(#1856)
    - semantic planning/scope rollup/overlap authorityの撤去(#1869)
    - canonical repository bindingの緩和
    - Allowed Paths、protected paths、secret保護の緩和
    - branch protection、required checks、人間mergeの削除
    - reviewのAPPROVE/REQUEST_CHANGES判断基準の再設計
    - Claude Code Agent Teamsの導入
    - Claude/Codex runtime capability probe
    - general-purpose GitHub security hookの一括削除
    - 複数writerによる並列編集
    - 新規schema、digest、receipt、publisher、state machine
    - old artifactからnew artifactへのcompatibility bridge新設
    
    ## Migration and Deletion Rule
    
    1. consumerから旧authority依存を外す。
    2. minimal bounded loopをproduction pathへ接続する。
    3. testsでreplacement behaviorを確認する。
    4. production consumerが0件になったproducer、validator、state store、schema、registry entry、fixtureを削除する。
    5. docsとcatalogを同期する。
    6. temporary compatibility codeを残さない。
    
    directory単位で一括削除せず、各fileのconsumerを確認する。
    
    generic controlled mutation frameworkを他command IDが使用している場合、framework全体は削除しない。`pr_review.publish`/`termination_report.publish`固有のbranch、policy、testsだけをconsumer消滅後に除去する。
    
    ## Safety Invariants
    
    - live Issue本文からAllowed Pathsを取得し、実changed filesと照合する
    - contract snapshotやfingerprintをAllowed Pathsの正本にしない
    - current PR head以外のCI/reviewを利用しない
    - review投稿前後にPR headをreadbackする
    - 投稿後にheadが変化していた場合、その投稿はstale noteとして扱いfresh reviewを実行する
    - wrong repository、wrong Issue/PR、protected path、secret、force push、main直接pushは拒否する
    - actual 3-way conflictまたはGitHubの`CONFLICTING`/`DIRTY`は自動解消せず停止する
    - `UNKNOWN`、`BLOCKED`、`BEHIND`、`UNSTABLE`、`DRAFT`、`HAS_HOOKS`をGit conflictとして扱わない
    - human final mergeを維持する
    
    ## Acceptance Criteria
    
    - [ ] AC1: replay envelope、parent binding artifact、state storeがなくてもfresh Issue reviewを開始できる
    - [ ] AC2: issue-refinement-loopがdefault最大3回でreview→rewrite→reviewを実行し、無限replayしない
    - [ ] AC3: impl-review-loopがdefault最大3回でimplementation→verification→PR reviewを実行し、永続LOOP_STATEを必須にしない
    - [ ] AC4: Issue review結果が`verdict`、`reviewed_body_sha256`、`blockers`、optional `warnings`程度に縮小される
    - [ ] AC5: PR review結果が`verdict`、`reviewed_head_sha`、`blockers`、optional `warnings`程度に縮小される
    - [ ] AC6: stale reviewed bodyはrefetch/rereviewされ、artifact mismatchによるhuman escalationにならない
    - [ ] AC7: stale reviewed headはAPPROVEとして消費されず、current headで再レビューされる
    - [ ] AC8:旧compact result、replay、binding、state、publisher artifactのmissing/malformed/staleでIssue更新やDraft PR作成が停止しない
    - [ ] AC9: max iteration到達時はHUMAN_REVIEW_REQUIREDへ移行し、Issue/PRとblocker summaryを残す
    - [ ] AC10: routine review/termination投稿が通常GitHub operationで行われ、専用semantic publisherを使用しない
    - [ ] AC11: mutation前後のrepository/IssueまたはPR/head readbackが維持される
    - [ ] AC12: dead replay/binding/state-store/publisher consumerとschema catalog entryがproduction pathから除去される
    - [ ] AC13:同等機能を持つ新schema、digest、receipt、publisher、state machineが追加されていない
    - [ ] AC14: canonical repository、live Allowed Paths、protected path、secret、Git safety、実テスト、current-head CI、branch protection、人間mergeが維持される
    - [ ] AC15: compaction/resume後にartifact replayではなくlive Issue/PR/diff/CIを再取得するテストまたはruntime smokeが存在する
    - [ ] AC16: #1857、#1321/PR #1832、#1867のscope dispositionがlive stateに基づいて記録される
    - [ ] AC17: PR #1871の変更をrevertせず、actual conflict以外を着手blockerにしていない
    - [ ] AC18: relevant test suites、lint、typecheck、build、`git diff --check`がcurrent headでpassする
    
    ## Verification Commands
    
    Phase 0のinventoryから実在するtest paths/node IDsへ具体化する。
    
    最低限次を含める。
    
    ```bash
    uv run --locked pytest .claude/skills/issue-refinement-loop/tests/ -q
    uv run --locked pytest .claude/skills/impl-review-loop/tests/ .claude/skills/impl-review-loop/scripts/tests/ -q
    uv run --locked pytest .claude/skills/pr-review-judge/tests/ .claude/skills/pr-review-judge/scripts/tests/ -q
    ```
    
    controlled mutation filesを変更した場合:
    
    ```bash
    uv run --locked pytest scripts/agent-guards/tests/ -q
    ```
    
    standard gates:
    
    ```bash
    uv run --locked ruff check .claude/skills scripts tests
    pnpm typecheck
    pnpm lint
    pnpm test
    pnpm build
    git diff --check
    ```
    
    production dangling reference check:
    
    ```bash
    rg -n \
      -e 'parent_replay_binding' \
      -e 'reviewer_claim_replay_state_store' \
      -e 'ISSUE_REVIEW_RESULT_COMPACT_V2' \
      -e 'REPLAY_PARENT_BINDING_DIGEST' \
      -e 'emit_parent_review_envelope' \
      -e 'LOOP_VERDICT_V2' \
      -e 'PR_REVIEW_PUBLISH_REQUEST_V1' \
      -e 'termination_report\.publish' \
      -e 'pr_review\.publish' \
      <EXACT_PRODUCTION_PATHS>
    ```
    
    削除する語が残ってよいhistorical docs/migration noteと、production consumerを区別する。単にrepository全体の文字列をゼロにすることを目的にしない。
    
    negative tests:
    
    - stale PR head
    - stale Issue body
    - wrong repository
    - wrong PR/Issue number
    - Allowed Paths violation
    - protected path/secret
    - failed tests
    - failed current-head CI
    - max iteration
    - parser failure fallback
    - normal GitHub comment pathのpre/post readback
    -旧artifactなしでのfresh start
    
    ## Allowed Paths
    
    Phase 0で確定したexact filesのみを列挙する。
    
    directory wildcardは禁止する。
    
    削除対象には`(削除)`、一部編集には変更範囲を併記する。
    
    実装中に直接consumerが追加で見つかった場合:
    
    1. live child Issueをrefetchする
    2. `Allowed Paths`と`Current Validated Scope`だけをsection-level更新する
    3. readbackする
    4. 作業を継続する
    
    body SHA mismatchだけで停止しない。
    
    ## Runtime Verification Applicability
    
    ```yaml
    decision: immediate
    reason: "native subagent result handoff、bounded iteration、stale-head/stale-body rereview、resume時live refetch、通常GitHub mutationのpre/post readbackは実行時挙動である"
    applicable_acs:
      - AC2
      - AC3
      - AC6
      - AC7
      - AC9
      - AC10
      - AC11
      - AC15
    ```
    
    ## Stop Conditions
    
    次だけをhard stopとする。
    
    - canonical repository/target Issue/PRを特定できない
    - repository、worktree、branch identityが一致しない
    - protected path、secret、credential、destructive Gitを弱める必要がある
    - actual 3-way Git conflictがある
    - target PRがlive current headで`CONFLICTING`または`DIRTY`
    - #1856または#1869の所有scopeを同一PRで変更しないと成立しない
    - review criteria自体を変更しないと成立しない
    - required testを実行できず、代替なしでPASS扱いする必要がある
    - generic GitHub safety boundaryを削除しないと通常投稿経路を作れない
    - native subagentとsingle-agent fallbackの双方が利用不能
    
    次はhard stopにしない。
    
    -旧artifact missing/stale/invalid
    - parser failure
    - body SHA mismatch
    - semantic overlap
    - #1871がOPENであること
    - mergeability UNKNOWN/BLOCKED/BEHIND/UNSTABLE/DRAFT/HAS_HOOKS
    - scope inventoryの警告
    - old publisherが利用不能
    
    ## Related and Supersession
    
    live readback後に確定する。
    
    - #1857: 新しいstrict LOOP_VERDICT_V2 schema/publisher cutoverを追加する逆方向scope。今回のIssueに完全に置換される場合はsuperseded。
    - #1321/PR #1832: 専用termination report/publisherを拡張する逆方向scope。独立した残存scopeがなければsuperseded。
    - #1867: C4/C8 parent applicability修正は独立して有効。reviewer replay taxonomy部分だけをsupersedeし、Issue全体を機械的にcloseしない。
    - #1532、#1541、#1554、#1555、#1754、#1755、#1791、#1810、#1829等のclosed Issueはhistorical recordとして維持し、再openしない。
    - PR #1871: warning-continue/actual conflict only方針を維持する。
    
    ## Delivery Rule
    
    - 1 Issue = 1 PR
    - dedicated worktree
    - Draft PR
    - `Closes #<NEW_ISSUE>`
    - `Part of #1860`
    - human final merge
    - force push禁止
    
    ---
    
    Issue本文は`--body-file`で作成する。起票後にIssue番号とbodyをreadbackする。
    
    ---
    
    # Phase 1.5 — Bounded Issue Refinement
    
    新規Issue起票後、現行legacy replay loopを使わず、次を最大3回実行する。
    
    ```text
    for iteration in 1..3:
      1. live Issue bodyを取得
      2. body bytesのsha256をmainが計算
      3. issue-contract-reviewer-liteを起動
      4. reviewerのreviewed_body_sha256とlive bodyを比較
      5. staleならcurrent bodyで再レビュー
      6. APPROVEなら終了
      7. REQUEST_CHANGESならmain threadが対象sectionだけ修正
      8. HUMAN_REVIEW_REQUIREDなら停止
    max到達:
      IssueをOPENのまま残し、blockersを通常Issue commentで投稿
    ```
    
    reviewer結果のためのartifact、state file、publisher、replay taxonomyを作成しない。
    
    Issue body修正はmain threadが`--body-file`で行い、毎回readbackする。
    
    ---
    
    # Phase 2 — Update Parent Issue #1860
    
    child Issueの本文がAPPROVEになった後、#1860をlive refetchし、section-levelで修正する。
    
    最低限、以下を行う。
    
    ## Child Issues
    
    対象placeholder:
    
    ```text
    - [ ] (未起票)実装: review/refinementのreplay・envelope・custom publisherをbounded loopへ置換する ...
    ```
    
    を次へ置換する。
    
    ```text
    - [ ] #<NEW_ISSUE> — 実装: review/refinementのreplay・envelope・custom publisherをbounded loopへ置換する — review結果を最小conventionへ縮小し、replay arbitration・parent binding digest・state store・専用review/termination publisherを撤去する。起票済み、実装準備中。
    ```
    
    ## Stale child status
    
    同じreadbackで少なくとも次をlive stateへ同期する。
    
    - #1866/PR #1868
    - #1869/PR #1871
    
    Issue/PRがclosed/mergedならcheckとstatusを反映し、OPENならcurrent head、CI、draft、mergeabilityを正確に記載する。古いhead SHAを残さない。
    
    ## Closure Matrix
    
    live inventoryに基づき次を追記または更新する。
    
    - #1857: `supersede_candidate_by #<NEW_ISSUE>`
    - #1321/PR #1832: `supersede_candidate_by #<NEW_ISSUE>`
    - #1867: `split_scope — retain parent applicability; supersede replay taxonomy`
    - #1871: current live status
    
    親Issueの他sectionを全面rewriteしない。
    
    `Child Issues`、`Closure Matrix`、必要な`Remaining Parent Gaps`またはcurrent objectiveだけを編集する。
    
    新規childを完了扱いにせず`[ ]`のままにする。
    
    更新後にbodyをreadbackし、次を確認する。
    
    - child番号が正しい
    - placeholderが残っていない
    - #1866/#1869 statusがlive stateと一致
    - unrelated textが変わっていない
    - parent Issueをcloseしていない
    
    ---
    
    # Phase 3 — Implementation
    
    ## Worktree
    
    最新mainから専用worktreeを作る。
    
    推奨:
    
    ```text
    .claude/worktrees/issue-<NEW_ISSUE>-bounded-review-loops
    worktree-issue-<NEW_ISSUE>-bounded-review-loops
    ```
    
    root checkoutやmain上で編集しない。
    
    PR #1871がまだOPENならactual conflictを確認する。actual conflictがなければ待たずに進める。#1871が途中でmergeされた場合、最終review前に最新mainへrebaseまたはmergeし、testsを再実行する。force pushは禁止する。
    
    ## Consumer-first implementation
    
    次の順序を維持する。
    
    ### A. issue-refinement-loop
    
    通常経路を次へ置換する。
    
    ```text
    live Issue fetch
      -> optional investigation
      -> issue reviewer
      -> APPROVE: terminate
      -> REQUEST_CHANGES: issue author/mainがbody更新
      -> HUMAN_REVIEW_REQUIRED: stop
      -> max 3
    ```
    
    実装要件:
    
    - Step 2a Replay Arbitrationを通常経路から削除
    - `parent_replay_binding.py`依存を削除
    - review compact V2 envelope依存を削除
    - previous replay state/state store依存を削除
    - phase state/digest gateがreview継続を認可する構造を削除
    - reviewerはblockersを直接返す
    - mainがiterationとblocker historyを一時的に保持する
    - resume時はIssue bodyをrefetchする
    - body変化はbounded rereviewの理由でありhuman escalationではない
    - final commentは通常のIssue comment operationで投稿する
    - custom termination renderer/publisherを使わない
    - follow-up候補の判断ロジックが独立して有用なら残せるが、mandatory termination envelopeへ埋め込まない
    
    ### B. impl-review-loop
    
    通常経路を次へ置換する。
    
    ```text
    live Issue/PR fetch
      -> implementation-worker
      -> actual verification
      -> current-head CI
      -> read-only PR reviewer
      -> APPROVE: mainがlive mergeability/CI/blockersを確認
      -> REQUEST_CHANGES: workerへ具体的blockerを渡す
      -> HUMAN_REVIEW_REQUIRED: stop
      -> max 3
    ```
    
    実装要件:
    
    - serialized LOOP_STATEを通常経路の正本にしない
    - LOOP_VERDICT_V2をminimal result conventionへ置換
    - `merge_ready`、`required_auto_actions`、`allowed_paths_gate`をreviewer outputから除去
    - mergeability、CI、Allowed Pathsはmainがlive stateから判定
    - Allowed Pathsはcontract snapshotではなくlive linked Issue bodyから読む
    - body-only PR hygieneはmainが通常操作で修正し、再レビューする
    - branch更新でheadが変わった場合はtestsとreviewを再実行する
    - stale reviewed headを消費しない
    - max 3
    - final summaryはplain Markdown
    - PRはDraftのまま人間へ渡す
    
    ### C. Reviewer result
    
    `issue-reviewer.md`と`pr-reviewer.md`を、必要なread-only責務だけへ薄型化する。
    
    禁止:
    
    - replay claim生成
    - parent-only fields生成
    - envelope assembly
    - publisher request JSON生成
    - body digest chain生成
    - state write
    - merge readinessの自己申告
    - follow-up materialization envelope生成
    - GitHub mutation
    - nested Agent
    
    許可:
    
    - live対象の読取
    - diff/Issue bodyのレビュー
    - actual commandのread-only実行
    -最小resultの返却
    
    ### D. Publisher removal
    
    production consumersを切り替えた後に処理する。
    
    - `termination_report.publish`固有経路
    - `pr_review.publish`固有経路
    - semantic result renderer
    - dedicated publisher input schema
    - idempotency artifact
    - result artifact
    - command registry entry
    - policy branch
    - publisher-specific tests
    - publisher-specific docs
    
    通常投稿:
    
    ```text
    Issue: GitHub connector、または gh issue comment --repo ... --body-file ...
    PR: GitHub connector、または gh pr comment --repo ... --body-file ...
    ```
    
    PR review objectである必要がなければ通常PR commentを使用する。self-authored PRへAPPROVE review stateを作らない。
    
    投稿手順:
    
    ```text
    1. repo/target/current headをread
    2. body-fileから投稿
    3. comment URL/bodyをreadback
    4. PRの場合はheadを再read
    5. headが変化していれば投稿をstale noteとして扱いfresh review
    ```
    
    このreadbackはmain orchestrationの通常処理であり、digest、receipt、publisher artifactへ変換しない。
    
    generic GitHub mutation policy内に他command IDが残る場合、そのgeneric security codeは維持する。
    
    ### E. Dead asset removal
    
    `rg`とimport graphでproduction consumerが0件になったことを確認してから削除する。
    
    候補例:
    
    - replay analyzer/taxonomy
    - parent binding producer
    - review envelope emitter/validator
    - replay state store
    - loop state schema/builder
    - LOOP_VERDICT_V2 router/validator/schema
    - dedicated termination renderer/publisher
    - dedicated review publisher request handling
    - registry entries
    - schema catalog entries
    - fixtures
    - tests
    - references
    
    候補を無条件に全削除せず、他production consumerがある場合はそのconsumerを先に移行する。
    
    ### F. Docs
    
    最低限、次を整合させる。
    
    - `docs/dev/workflow.md`
    - `docs/dev/agent-skill-boundaries.md`
    - `docs/dev/schema-governance.md`
    - issue-refinement design docs
    - impl-review-loop SKILL/steps
    - pr-review-judge SKILL/references
    - agent definitions
    
    normative wording:
    
    - safety boundaryは決定論的
    - semantic/review orchestrationはnative bounded loop
    - live state authoritative
    - no persistent semantic state
    - no dedicated semantic publisher
    - resume by refetch
    
    ---
    
    # Phase 4 — Targeted and Full Verification
    
    implementation-workerの変更後、test-verifierを起動する。
    
    最低限、次を検証する。
    
    1. fresh Issue review without replay files
    2. fresh PR review without LOOP_VERDICT_V2 schema
    3. max iteration 3
    4. stale Issue body rereview
    5. stale PR head rereview
    6. malformed reviewer result fallback
    7. missing old artifact does not block
    8. normal Issue/PR comment publication
    9. pre/post mutation readback
    10. wrong repo/target denial
    11. live Allowed Paths violation
    12. protected path/secret denial
    13. failed tests/current-head CI denial
    14. no replacement authority
    15. no dangling production import
    16. generic mutation commands not related to removed publishers still pass
    17. #1871 changes are preserved
    18. standard gates
    
    test-verifierがsourceを変更した場合、その結果を無効にしてclean worktreeから再実行する。
    
    全command、exit code、pass/fail/skip数を記録する。SKIPをPASSに変換しない。
    
    ---
    
    # Phase 5 — Commit, Push, Draft PR
    
    最初のcoherent implementationとtargeted testsが完了したらmain threadがcommitする。
    
    - conventionalで具体的なcommit message
    - no force push
    - remote branchをreadback
    - push後にremote headを確認
    - Draft PRを作成
    
    PR本文には次を含める。
    
    - Summary
    - Root cause
    - Before/After loop
    - Deleted Authority Matrix
    - Preserved Safety Boundaries
    - Exact changed/deleted files
    - Acceptance Criteria status
    - Verification Commandsと実結果
    - Runtime Verification Evidence
    - Related/Superseded Issues
    - PR #1871との関係
    - Scope Delta
    - Schema Change Applicability
    - Schema Consumer Inventory
    - Safety Claim Matrix
    
    schemaを削除する場合、`not_schema_change`と偽装しない。
    
    ```text
    Schema Change Applicability: schema_change
    Change type: removal/de-registration
    New schema added: no
    All production consumers removed: yes/no
    ```
    
    PR本文:
    
    ```text
    Closes #<NEW_ISSUE>
    Part of #1860
    Supersedes #1857
    Supersedes #1321 / PR #1832
    ```
    
    ただし、inventoryで独立残存scopeが見つかったIssueはSupersedesに含めない。
    
    ---
    
    # Phase 6 — Bounded Implementation Review Loop
    
    Draft PR作成後、最大3iterationのreview loopを実行する。
    
    ```text
    for iteration in 1..3:
      1. mainがPR current head、base、diff、linked Issue、CIをlive取得
      2. test-verifierをcurrent headで実行
      3. pr-reviewer-primaryとpr-reviewer-safetyを並列実行
      4. 各reviewed_head_shaがcurrent headと一致することを確認
      5. stale resultは捨ててcurrent headで再レビュー
      6. HUMAN_REVIEW_REQUIREDが1件でもあれば停止
      7. blockerが1件でもあればimplementation-workerへ統合blocker listを渡す
      8. writerが1回だけ修正
      9. mainがcommit/push
      10. tests、CI、reviewをcurrent headで再実行
      11. 全reviewer APPROVE、tests green、current-head CI green、actual conflictなしなら終了
    max到達:
      Draft PRを残しHUMAN_REVIEW_REQUIRED
    ```
    
    同じ問題の表現違いはmainがdedupeしてworkerへ渡す。指摘を勝手に無視しない。
    
    reviewer間で判断が割れた場合:
    
    - blockerの具体的根拠をmainがlive diffで確認する
    -解消可能なら修正
    - policy判断が必要ならHUMAN_REVIEW_REQUIRED
    - replay artifactや第三のdeterministic arbiterを作らない
    
    review結果はGitHubへ通常PR commentとして投稿してよい。投稿はmain threadが行い、専用publisherを使わない。
    
    PRをmergeしない。
    
    ---
    
    # Phase 7 — Related Issue / PR Disposition
    
    Draft PRのscopeと独立レビューが確定した後、main threadが関連Issueをlive readbackする。
    
    ## #1857
    
    今回のPRがLOOP_VERDICT_V2 strict schema cutoverを完全に不要化する場合:
    
    1. 新規Issue/PRへのlink付きcommentを投稿
    2. 「#1860 Owner Decisionにより、新strict schemaではなくminimal native loopへ置換するためsuperseded」と明記
    3. independent residual scopeがないことを確認
    4. `not planned`でclose
    
    残存scopeがあればcloseせず、残すscopeを本文またはcommentで明確化する。
    
    ## #1321 / PR #1832
    
    今回のPRが専用termination renderer/publisher経路を削除する場合:
    
    1. #1321とPR #1832にsupersession comment
    2. PR #1832をmergeしない
    3. independent materialization logicが残らない場合、PR #1832をclose
    4. #1321を`not planned`でclose
    5. independent follow-up materialization behaviorが残る場合、その残存scopeだけを明示し、機械的にcloseしない
    
    ## #1867
    
    Issueを一括closeしない。
    
    - C4/C8のparent applicability fixは維持候補
    - `reviewer_claim_replay.py` taxonomy追加は今回の削除scopeによりsuperseded候補
    
    live PR/commitの有無を調べ、必要ならIssue本文をsection-levelで縮小する。validなparent applicability bugfixを失わない。
    
    ## Historical closed Issues
    
    #1532、#1541、#1554、#1555、#1754、#1755、#1791、#1810、#1829等は変更しない。
    
    ---
    
    # Phase 8 — Final Parent Update
    
    #1860を再取得し、対象child行をcurrent stateへ更新する。
    
    Draft PRがreview-readyなら例:
    
    ```text
    - [ ] #<NEW_ISSUE> — 実装: review/refinementのreplay・envelope・custom publisherをbounded loopへ置換する — PR #<PR>(Draft、head <SHA>、current-head tests/CI、独立レビュー結果)を作成。人間マージ待ち。
    ```
    
    merge前なのでcheckboxは`[ ]`のままにする。
    
    Closure Matrixへ次の確定結果を反映する。
    
    - #1857
    - #1321
    - PR #1832
    - #1867
    - new Issue/PR
    - #1866/#1869のlive status
    
    bodyをreadbackし、unrelated sectionを変更していないことを確認する。
    
    ---
    
    # Final Response
    
    最終応答はplain Markdownで、少なくとも次を含める。
    
    ```text
    Child Issue:
    Parent Update:
    Branch / Worktree:
    Draft PR:
    Final Head SHA:
    Implementation Iterations:
    Review Iterations:
    Reviewers:
    Changed Files:
    Deleted Files:
    Tests:
    CI:
    Related Issue Disposition:
    Preserved Safety Boundaries:
    Remaining Blockers:
    Human Next Action:
    ```
    
    versioned result schema、marker、digest、receiptを出力しない。
    
    成功条件:
    
    - child Issueが起票されている
    - #1860がlive stateへ修正されている
    - bounded issue refinementが完了している
    - implementationがdedicated worktreeに存在する
    - Draft PRが作成されている
    - current-head tests/CI/review結果が確認されている
    - replay/envelope/binding/state/publisherのproduction authorityが撤去されている
    - replacement control-planeが追加されていない
    - human final mergeが残されている
    
  9. added a commit that references this issue on Jul 30, 2026
  10. squne121 commented on Jul 31, 2026

    @squne121
    OwnerAuthor

    現行状態を反映した補正

    親は #1860 です。本文には、今回の作業が「未起票」child として残っており、Authority Matrix/Closure Matrix を精査してから起票する前提が記録されています。

    対象 Issue の live state は一律ではありません。

    また、現在の consumer-ready contract は implementation Issue のタイトルを 実装: または implement: に限定しています。したがって、親本文上の仮称が「整理:」でも、実際に起票して impl-review-loop へ渡す child は 実装: で始める必要があります。

    docs/dev/workflow.md は自身を workflow SSOT と定義し、Skill への長文重複を避ける方針を示しています。一方で、同じ文書内には ISSUE_EXECUTION_DECISION_V1、closed relation enum、fail-closed semantic validator、dual-write migration が残り、後段では artifact missing/stale を warning-only とする方針も併存しています。今回の child は、この内部矛盾と残存 Skill/tests を整理する 後処理 child とするのが適切です。

    実行用プロンプト

    あなたは `squne121/loop-protocol` の root orchestrator です。
    
    今回の作業は、親 Issue #1860 の未起票 child を正式起票し、Issue refinement、実装、検証、独立 PR review まで進める作業です。
    
    対象となる未起票項目:
    
    「workflow SSOT・Skill・testsをminimal harnessへ収束し、Closure Matrix対象の残存Issueを閉じる — docs/dev/workflow.mdを正本として整合させ、Skill入口を縮小し、#1857・#1645・#1674・#1732の未着手厳密化childrenの扱いを確定する」
    
    ただし、古い Issue 本文や親の表に記録された state を事実として固定せず、必ず live GitHub state、current main、関連 PR、コメント、実際の consumer/producer/tests を再取得して判断してください。
    
    # 0. 実行権限と禁止事項
    
    このプロンプトにより、以下を事前承認します。
    
    - Issue #1860 の本文更新
    - implementation child Issue 1件の起票
    - child を #1860 の native sub-issue として登録
    -必要な native dependency/relationship の登録
    - 対象 Issue への disposition/supersede 計画コメント投稿
    - stale な補助ラベルの hygiene
    - issue-refinement-loop による child 本文の修正
    - isolated worktree での実装
    - commit、branch publish、Draft PR 作成・更新
    - test、lint、build、current-head CI確認
    - 独立 PR review
    - 実装 PR マージ後であることを確認できた対象 Issue の evidence-backed close/supersede
    
    以下は承認しません。
    
    - PR の自動マージ
    - default branch への直接 push
    - force push、history rewrite、破壊的 Git 操作
    - permission bypass、hook bypass、dangerous/yolo/skip-permissions
    - protected/manual asset、secret、credential、LICENSES、管理対象 asset の変更
    - active consumer が残る schema/script/test の先行削除
    - title や親本文だけを根拠にした一括 close
    - 新しい workflow framework、state machine、JSON/YAML schema、digest、receipt、専用 publisher、reason-code enum の追加
    - この作業のためだけの新しい semantic planning authority の導入
    
    GitHub mutation、branch publish、Issue close は root orchestrator が所有してください。read-heavy 調査は subagent へ委譲できますが、複数 agent の並行 writeは禁止します。
    
    リポジトリ既存の `create-issue`、`edit-issue`、controlled mutation、`rtk` 等の sanctioned 経路を優先してください。利用不能な場合に無断で別の mutation lane へ迂回してはいけません。
    
    # 1. モデル/サブエージェント方針
    
    メインセッションの model/reasoning 設定を変更しないでください。
    
    Codex CLI の場合:
    
    - `.codex/agents/*.toml` の設定を SSOT とする
    - spawn 時に model/reasoning を上書きしない
    - `/model`、`/reasoning`、CLI option、環境変数での override を行わない
    - read-only inventory の少なくとも1タスクを、既存設定上 `gpt-5.3-codex-spark` を使用する custom subagent に委譲する
    - Spark agent は調査・分類・差分候補列挙のみを担当し、GitHub mutation、Issue close、repo write を行わない
    
    Claude Code の場合:
    
    - native subagent を使い、同じ責務分離を適用する
    - agent team/subagent 内からの nested delegation は行わない
    
    最低限、次の read-only 調査を分担してください。
    
    1. Closure Matrix 調査
       - #1857、#1645とそのchildren、#1674と全descendants、#1732と全descendants
       - 関連 PR、コメント、close reason、merged commit、current state
    
    2. current-main residual inventory
       - docs
       - Skill entrypoint
       - Agent mirror
       - production scripts
       - schema/catalog
       - tests/fixtures
       - active producer/consumer/publisher
    
    3. predecessor/scope collision 調査
       - #1856
       - #1869 と関連 PR
       - #1873/#1874 の重複・canonical owner
       - 同一パスを変更する他の OPEN Issue/PR
       - 実際の Git conflict、GitHub mergeability
    
    root orchestrator は各結果を live readback で検証してから最終 classification を決めてください。subagent の classification をそのまま authority として採用してはいけません。
    
    # 2. 最初に読むもの
    
    最初に、次を current main と live GitHub から取得してください。
    
    - repository root の CLAUDE.md/AGENTS.md 等の適用指示
    - docs/dev/workflow.md
    - docs/dev/agent-skill-boundaries.md
    - docs/dev/ssot-registry.md
    - docs/dev/runtime-verification-policy.md
    - Issue #1860 本文・全コメント
    - Issue #1856 本文・全コメント・関連 PR
    - Issue #1869 本文・全コメント・関連 PR
    - Issue #1873 と #1874 の本文・全コメント・関連 PR
    - Issue #1857 本文・全コメント
    - Issue #1645 と #1646〜#1648、#1848 の live state
    - Issue #1674 と native sub-issue/dependency graph全件
    - Issue #1732 と native sub-issue/dependency graph全件
    - 上記 Issue が参照する merged/open/closed PR
    - current main 上の実ファイルと test suite
    
    body 内の state、日付、PR head SHA、close reason は live readback と一致する場合だけ根拠にしてください。
    
    # 3. 固定する live-state baseline
    
    開始時点では以下を既知の候補として扱いますが、必ず再検証してください。
    
    - #1645 は Closed / not planned。再オープン禁止
    - #1857 は Open
    - #1674 は Open
    - #1732 は Open
    - #1869 は semantic planning/scope-rollup/overlap/contract artifact の blocking authority 撤去を所有する候補
    - #1873/#1874 は bounded loop/minimal review convention/custom publisher撤去を所有する候補
    - #1856 は通常レビューの TEST_VERDICT authority cutover を所有し、物理 cleanup は別 phase の可能性がある
    
    #1873 と #1874 が重複している場合は、live implementation、PR、コメント、親 checklist、最新 owner decision を照合し、canonical owner を1件に確定してください。重複 Issue を両方 predecessor として扱わないでください。
    
    # 4. Closure Matrix の作成
    
    永続 schema は追加せず、Issue本文または作業メモ上の通常の Markdown table として、次の列を持つ Closure Matrix を作ってください。
    
    | Target | Live state | Active residual | Current owner | Classification | Close gate | Evidence |
    |---|---|---|---|---|---|---|
    
    Classification は次から選びます。
    
    - `already_closed`
    - `keep`
    - `absorbed_by_merged_work`
    - `superseded_close_after_merge`
    - `absorb_small_residual_into_new_child`
    - `residual_child_required`
    
    これは一回限りの人間可読 triage であり、新しい machine-readable authority にしてはいけません。
    
    各 Issue について、最低限次を確認してください。
    
    ## #1857
    
    - activeな `LOOP_VERDICT_V2` producer/consumer/publisher が predecessor完了後も残るか
    - #1873/#1874 が `LOOP_VERDICT_V2`、`pr_review.publish`、route script、strict schema追加方針を置換するか
    - duplicate-key rejection や parser一本化のうち、minimal conventionでも必要な独立 residual があるか
    - residual がなければ、predecessor PR merge後に superseded close
    - 小さな residual だけなら新 child に吸収
    - substantialな独立実装が必要なら `residual_child_required` とし、この実装 Issueを無断拡張しない
    
    ## #1645 系列
    
    - #1645 自体は `already_closed`。再オープンしない
    - #1646〜#1648、#1848 の live state と active residual を確認する
    - #1856 または別 merged work に吸収済みなら evidence付きでclose/supersede
    - TEST_VERDICT物理削除をこの child に無条件で取り込まない
    - #1856 が物理cleanupを別Phaseとして所有している場合、そのownershipを尊重する
    - stale docs、Skill記述、dead fixtureだけが残る場合に限り、新 child のcleanup対象候補とする
    
    ## #1674 系列
    
    native descendants、本文上の children、関連 Issue を全件列挙してください。少なくとも次を候補として照合します。
    
    - #1675
    - #1676
    - #1677
    - #1679
    - #1680
    - #1792
    - #1793
    - #1853
    - その他 live native sub-issue
    
    #1869 またはその後継 merged work が、semantic planning authority、OPEN Issue全件収集、scope-rollup hard gate、pairwise observation schema、overlap gateを吸収・撤去しているか確認してください。
    
    - active residualなし: predecessor merge後に superseded close
    - safety上独立して有効な residualあり: keep または residual_child_required
    - `ISSUE_EXECUTION_DECISION_V1` や pairwise artifactを別名で再導入するだけのchildは残さない
    - 実Git conflict、GitHub CONFLICTING/DIRTY、canonical repository、protected path等の安全境界は削除対象にしない
    
    #1674 parent は、全descendantの disposition が確定し、close対象が実際に処理されるまでcloseしないでください。
    
    ## #1732 系列
    
    少なくとも次を確認してください。
    
    - #1745
    - #1744
    - #1857
    - #1858
    - 未起票 Child C
    - その他 native sub-issue
    
    progressive disclosure、Agent/Skill重複削減、thin entrypoint化という目的自体は保持候補です。
    
    一方、次のような厳密化は current minimal harness に実残存価値があるか個別評価してください。
    
    - preloadを成立させるためだけの大規模 permission contract
    - static byte/token budgetをblocking gateにする仕組み
    - runtime smoke receipt/digest/schema
    - AgentとSkill間の二重schema所有
    - LOOP_VERDICT_V2 strict cutoverへの依存
    - 未着手の implementation-worker context diet child
    
    current main と predecessor完了後に、単純な thin entrypoint/reference map/parity testだけで目的を達成できる場合は、その最小 residualを新 childへ吸収し、過剰な未着手childrenはsupersede対象としてください。
    
    # 5. 新規 child Issue の起票
    
    実際のタイトルは、implementation consumer-ready contractに合わせて次とします。
    
    実装: workflow SSOT・Skill・testsをminimal harnessへ収束し、Closure Matrix残存Issueを閉じる
    
    「整理:」では開始しないでください。
    
    Issue本文は `.github/ISSUE_TEMPLATE/implementation.yml` の全必須sectionを満たしてください。
    
    次の内容をbaselineとし、調査結果で具体化してください。
    
    ## Machine-Readable Contract
    
    ```yaml
    contract_schema_version: v1
    issue_kind: implementation
    parent_issue: "#1860"
    goal_ref: "docs/dev/workflow.mdをworkflow policyの正本としてSkill・Agent・testsの残存control-plane重複を除去し、Closure Matrix対象Issueをlive evidenceに基づいて処理する"
    change_kind: workflow
    ```
    
    ## Parent Issue
    
    #1860
    
    ## Parent Goal Ref
    
    - Goal: AIエージェント運用をminimal harnessへ縮退し、artifact authorityではなくlive Issue/PR、canonical worktree、actual diff、実test、current-head CI、独立reviewを正本にする。
    - Desired Destination: workflow SSOT、Skill入口、Agent mirror、production scripts、testsが同じminimal harness境界を表し、supersededな残存Issueが処理済みになっている。
    
    ## Current Validated Scope
    
    ここには調査で確認した current-main の write-capable residualだけを書いてください。
    
    単に関連するという理由で広いdirectoryを記載してはいけません。
    
    候補パス:
    
    - docs/dev/workflow.md
    - docs/dev/agent-skill-boundaries.md
    - docs/dev/ssot-registry.md
    - docs/dev/workflows/README.md
    - docs/dev/workflows/impl-review-loop-design.md
    - docs/dev/workflows/issue-refinement-loop-design.md
    - .claude/skills/issue-refinement-loop/SKILL.md
    - .claude/skills/impl-review-loop/SKILL.md
    - predecessor merge後も残る関連 references/steps
    - predecessor merge後も残る関連 tests/fixtures
    - parity上必要な exact `.codex/agents/...` mirror
    - active consumerが存在しないことを確認済みの dead catalog/schema entry
    
    候補をそのまま全採用せず、実diffに必要な exact pathへ狭めてください。
    
    ## Remaining Parent Gaps
    
    - Multi-Agent V2/ledger/manifest/external observabilityの別child scope
    - #1856 が所有する未完了TEST_VERDICT phase
    - predecessor PRのhuman merge
    - 本IssueのPR merge後にのみ可能なIssue close
    - Closure Matrix上 `keep` または `residual_child_required` となったscope
    
    ## Outcome
    
    `docs/dev/workflow.md` がworkflow policyの唯一の人間可読正本となり、各Skill入口がtrigger・inputs・bounded loop・安全境界・reference map程度へ縮小され、obsoleteなcontrol-plane docs/tests/fixturesが除去され、Closure Matrix対象Issueがevidence-backedな状態へ処理されている。
    
    ## In Scope
    
    - workflow SSOT内の相互矛盾解消
    - Skill entrypointから詳細state machine、schema body、digest、publisher手順、重複routing tableを除去
    - 詳細手順が必要な場合のprogressive disclosure referenceへの移動または既存reference再利用
    - predecessor完了後にdeadとなったdocs/scripts/tests/fixturesの削除
    - testsを「artifactが存在すること」ではなく、維持すべき安全挙動とbounded loop挙動へ再束縛
    - #1857、#1645系列、#1674系列、#1732系列のdisposition確定
    - merged evidenceが揃った対象Issueへのsupersedeコメントとclose
    - #1860のClosure Matrix/Child Issues/Remaining Parent Gapsの更新
    
    ## Out of Scope
    
    - #1856、#1869、canonical bounded-loop Issueの実装を重複してやり直すこと
    - predecessor PRをこのIssueのPRへcherry-pickして混載すること
    - 新しいschema、digest、receipt、publisher、state store、reason-code enumの追加
    - product code変更
    - branch protectionやrequired CIの弱体化
    - canonical repository/worktree/protected path/secret/destructive Git guardの撤去
    - auto merge
    - substantialな別Outcomeを持つresidualの無断吸収
    
    ## Dependencies / Work Ordering
    
    live stateから次のルールで記載してください。
    
    - #1869 またはそのcanonical successorがopenで、同一パスを変更する場合はhard predecessor
    - #1873/#1874のうちcanonical bounded-loop ownerがopenで、同一パスを変更する場合はhard predecessor
    - #1856は、TEST_VERDICT物理cleanupパスを変更する場合だけhard predecessor。それ以外はcoordination relation
    - closed/merged済みならdependencyではなくcompleted prerequisiteとして記録
    - #1645をdependencyとして再登録しない
    - native dependencyと本文記述を一致させる
    
    ## Acceptance Criteria
    
    - [ ] AC1: `docs/dev/workflow.md` 内で、workflow artifact missing/stale/invalidが通常作業を停止しない方針と、別sectionのsemantic planning authority記述が矛盾していない
    - [ ] AC2: workflow方針の人間可読正本が `docs/dev/workflow.md` に一元化され、Skill/Agent/派生docsは同じpolicy本文を長文複製していない
    - [ ] AC3: `issue-refinement-loop` と `impl-review-loop` のSkill入口がtrigger、inputs、最大iteration、主要step、安全境界、reference mapを中心とするthin entrypointになっている
    - [ ] AC4: Skill entrypointから削除した詳細がactive runtimeに必要な場合、既存reference/production scriptに一意に存在し、別の第二SSOTを形成していない
    - [ ] AC5: obsolete artifact、strict semantic planning、replay、publisherを必須とするtests/fixturesは削除またはnon-authoritative behavior testへ置換されている
    - [ ] AC6: canonical repository、worktree identity、wrong branch、protected path、secret、destructive Git、actual test failure、current-head CI failure、stale review head、human stopのnegative testsは維持される
    - [ ] AC7: 新しいJSON/YAML schema、digest、receipt、publisher、state store、reason-code enumが追加されていない
    - [ ] AC8: 削除対象のscript/schema/fixtureにはactive producer/consumer/publisherが残っていないことをcode searchとtestで確認している
    - [ ] AC9: #1645は再オープンされず、Closed/not plannedとして親とClosure Matrixに正しく反映される
    - [ ] AC10: #1857のdispositionがcanonical bounded-loop実装とcurrent-main residualに基づいて記録される
    - [ ] AC11: #1674と全descendantsのdispositionが#1869系統のmerged resultに基づいて記録される
    - [ ] AC12: #1732と全descendantsについて、progressive disclosureとして残す最小scopeとsupersedeする厳密化scopeが明示される
    - [ ] AC13: close対象Issueには、absorbing Issue/PR、merged commit、残存consumerなし、close理由を示すコメントがある
    - [ ] AC14: #1860の未起票checklistが本child番号へ置換され、native sub-issue readbackが成功する
    - [ ] AC15: relevant pytest、lint、typecheck、build、agent parity、`git diff --check`がcurrent PR headでPASSする
    - [ ] AC16: line数/byte数の削減量はadvisory metricとしてPRに記録されるが、任意の数値閾値を新しいblocking gateにしていない
    - [ ] AC17: PR未マージの場合、merge依存のIssue closeを先行実行せず、正確なpost-merge closure planを残している
    
    ## Verification Commands
    
    実装前に current main 上の実在パスへ再計算してください。存在しないtest fileや古いcommandをIssueへ記録してはいけません。
    
    少なくとも次のsuiteのうち、実際に変更scopeへ結合するものを実行してください。
    
    ```bash
    uv run --locked pytest .claude/skills/issue-refinement-loop/tests/ -q
    uv run --locked pytest .claude/skills/impl-review-loop/tests/ .claude/skills/impl-review-loop/scripts/tests/ -q
    uv run --locked pytest .claude/skills/pr-review-judge/scripts/tests/ -q
    uv run --locked pytest scripts/agent-guards/tests/ -q
    uv run --locked pytest tests/test_agent_parity.py tests/test_issue_refinement_ops_review.py -q
    uv run --locked ruff check .claude/skills scripts
    git diff --check
    ```
    
    repository instructionで `rtk` wrapperが要求される場合はsanctioned equivalentを使ってください。
    
    削除したファイルだけを対象にしたtest commandを残してはいけません。
    
    追加で以下を実行してください。
    
    - `ISSUE_EXECUTION_DECISION_V1`
    - `LOOP_VERDICT_V2`
    - `TEST_VERDICT_MACHINE`
    - `PARENT_REPLAY`
    - `termination_report.publish`
    - `pr_review.publish`
    - `scope_rollup`
    - `contract_snapshot`
    - `overlap evidence`
    
    についてcurrent mainとcandidate diffをcode searchし、各matchを次へ分類してください。
    
    - active safety boundary
    - active non-authoritative interchange
    - advisory diagnostic
    - historical documentation
    - test-only compatibility
    - dead residual
    
    単純にmatch数ゼロをACにせず、active safety boundaryを誤削除しないでください。
    
    ## Allowed Paths
    
    read-only inventory完了後、exact pathsを列挙してください。
    
    directory単位の広い許可は避け、変更または削除するファイルを個別に記載してください。
    
    Issue本文をimpl_readyにする前にAllowed Pathsを確定してください。
    
    ## Stop Conditions
    
    - canonical repository、worktree、branch、Issue bindingを確定できない
    - protected/manual asset、secret、credential、LICENSES変更が必要
    - destructive Git操作が必要
    - actual 3-way Git conflictを安全に解決できない
    - target PRがcurrent headでCONFLICTINGまたはDIRTY
    - predecessorと同じactive code pathを未マージ状態で並行編集する必要がある
    - active consumerが残るschema/script/publisherを削除する必要がある
    - substantialな独立Outcomeが判明し、追加Issueが必要
    - required test/current-head CI/独立reviewのblockerを修正できない
    - current ownerの明示停止指示
    - repository/GitHub権限不足
    
    次は停止理由にしないでください。
    
    - scope-rollup missing/stale/invalid
    - contract snapshot missing/stale/invalid
    - Issue body SHA drift
    - overlap evidence missing/stale/digest mismatch
    - OPEN Issue全件収集のincomplete/saturation
    - advisory artifact parse failure
    - telemetry/ledger/manifestの欠落
    
    body driftはlive bodyをrefetchし、対象sectionへ再適用してください。
    
    # 6. child起票と親Issue更新のmutation順序
    
    次の順序で処理してください。
    
    1. #1860をlive refetchする
    2. Closure Matrixとchild本文draftを完成させる
    3. child Issueを起票する
    4. child番号、本文、labelsをreadbackする
    5. childを#1860のnative sub-issueへ登録する
    6. hard predecessorがopenならnative dependencyを登録する
    7. relationshipとdependencyをreadbackする
    8. #1860の本文を再取得する
    9. 未起票checklist行を次へ置換する
    
       `- [ ] #<NEW_CHILD> — 実装: workflow SSOT・Skill・testsをminimal harnessへ収束し、Closure Matrix残存Issueを閉じる`
    
    10. #1645をOPEN扱いしている箇所があればClosed/not plannedへ更新する
    11. #1857、#1674、#1732、#1856、#1869、canonical bounded-loop Issueのlive stateをCurrent Validated Scope/Closure Matrixへ反映する
    12. Remaining Parent GapsとWork Orderingを更新する
    13. #1860をcloseしない
    14. 親本文、child checklist、native sub-issue、dependencyを再度readbackする
    
    Issue本文全体を古いsnapshotで上書きせず、live bodyへのsection-level reapplyを行ってください。
    
    # 7. issue-refinement-loop
    
    起票後、child Issueに対してissue-refinement-loopを実施してください。
    
    - max_iterations: 3
    - approval確認なしでiterationを継続可能
    - live Issue本文とcurrent mainを毎iteration再取得
    - reviewerは独立subagent
    - review結果は `APPROVE / REQUEST_CHANGES / HUMAN_REVIEW_REQUIRED` と具体的blockerで扱う
    - replay artifact、parent binding digest、state store、custom publisherの存在を継続条件にしない
    - body driftはrefetchして再review
    - Allowed Paths、AC、Verification Commands、Dependenciesが実行可能になるまで修正
    - 最終状態を `impl_ready` または具体的なhuman blockerとして記録
    
    3回以内にimpl_readyにならない場合は、根本的なscope問題として停止してください。曖昧な「要確認」だけで止めず、最小の人間判断を明示してください。
    
    # 8. 実装開始ゲート
    
    issue-refinement-loopがimpl_readyになった後、hard predecessorを再取得してください。
    
    次の条件を満たす場合だけimpl-review-loopへ進みます。
    
    - 同一パスを所有するhard predecessorがmerged/closed
    - current mainにpredecessor commitが存在する
    - child本文がcurrent stateへ再束縛済み
    - canonical worktreeを作成可能
    - actual Git conflictなし
    - contract reviewが必要な現行運用ならlive `go`
    - hard safety stopなし
    
    predecessorがまだopen、Draft、human merge待ちの場合:
    
    - cleanup実装を開始しない
    - child Issueはimpl_readyのまま維持する
    - exact predecessor、PR、重複path、必要な人間actionをコメントする
    - `IMPL_REVIEW_LOOP_RESULT: blocked_by_predecessor` を返す
    - artifact missingやsemantic overlap推定をblockerにしない
    
    # 9. impl-review-loop
    
    開始可能なら、isolated worktreeで実装レビューループを実行してください。
    
    最大3 iterationです。
    
    各iteration:
    
    1. Implementation
       - implementation-workerへ委譲
       - exact Allowed Pathsのみ変更
       - predecessorの実装をrevertしない
       - dead residual削除前にactive consumer search
       - docs、Skill、testsを同一diffで同期
       - GitHub Issue closeはまだ行わない
    
    2. Verification
       - test-runnerへ委譲
       - Issueに記録した全Verification Commands
       - changed-scopeに必要な追加regression
       - current head SHAとliteral commandを記録
       - TEST_VERDICT専用artifactの有無を判定authorityにしない
    
    3. Draft PR
       - sanctioned publish pathを使う
       - 1 Issue = 1 PR
       - PR本文に以下を含める
         - Summary
         - Acceptance Criteria達成状況
         - Verification command結果
         - Allowed Paths遵守
         - predecessor/scope ordering
         - Closure Matrix disposition
         - deleted active-consumer audit
         - SSOT/Skill size delta(advisory)
         - Post-merge Closure Plan
    
    4. Independent PR Review
       - pr-reviewerへ委譲
       - current PR headでreview
       - stale reviewed headは再review
       - actual diff、tests、current-head CI、safety boundaryを評価
       - artifact missing/staleだけでREQUEST_CHANGESにしない
       - REQUEST_CHANGESならfix_deltaをimplementation-workerへ返す
    
    終了条件:
    
    - current-head tests PASS
    - required CI PASS
    - independent review APPROVE
    - unresolved blockerなし
    - Draft PRが人間マージ可能な状態
    - auto mergeはしない
    
    3 iterationで収束しない場合はHUMAN_REVIEW_REQUIREDで停止してください。
    
    # 10. Closure処理
    
    PRがまだDraft/Open/未マージの場合:
    
    - #1857、#1674、#1732やdescendantsを、未マージdiffに依存して先行closeしない
    - 各close候補へ、次を含むpending disposition commentを投稿してよい
      - absorbing child Issue
      - Draft PR
      - planned classification
      - close gate
      - remaining residual
    - `post_merge_required` として正確なclosure listを返す
    
    PRが人間によってすでにmergeされたことをlive readbackできる場合のみ:
    
    1. merged commitがdefault branchへ到達したことを確認
    2. relevant tests/CIのmerged-head状態を確認
    3. active consumerが残っていないことを再確認
    4. close対象Issueへ次を含むコメントを投稿
       - superseded/absorbed理由
       - absorbing Issue/PR
       - merged commit
       -残存scopeの有無
    5. Issueをclose
    6. parent/native relationshipをreadback
    7. #1860のClosure Matrixとchecklistを更新
    8. #1860自身は全child完了条件を満たさない限りcloseしない
    9. post-merge-cleanupを実行
    
    `keep` または `residual_child_required` のIssueはcloseしないでください。
    
    # 11. 最終出力
    
    散文だけで終えず、次の見出しで結果を返してください。
    
    ## PARENT_EDIT_RESULT
    
    - parent_issue
    - updated_sections
    - child_checklist_readback
    - native_subissue_readback
    - dependency_readback
    - parent_closed: false
    - warnings
    
    ## CHILD_ISSUE_RESULT
    
    - issue_number
    - title
    - state
    - parent
    - hard_predecessors
    - coordination_relations
    - exact_allowed_paths
    - issue_url
    
    ## REFINEMENT_RESULT
    
    - iterations
    - final_status: impl_ready | human_review_required
    - remaining_blockers
    - body_readback
    
    ## CLOSURE_MATRIX_RESULT
    
    対象 Issue と全descendantsについて:
    
    - classification
    - active_residual
    - owner
    - close_gate
    - action_performed
    - deferred_action
    
    ## IMPL_REVIEW_LOOP_RESULT
    
    - status: draft_pr_ready | blocked_by_predecessor | human_review_required
    - iterations
    - branch
    - worktree
    - pr
    - reviewed_head_sha
    - tests
    - ci
    - review
    - merge_performed: false
    
    ## POST_MERGE_CLOSURE_PLAN
    
    - close_after_merge
    - keep
    - residual_child_required
    - parent_update_after_merge
    - cleanup_actions
    
    事実を確認できなかった項目は、推測で埋めず `not_verified` としてください。
    

    このプロンプトでは、親・childの起票とrefinementは直ちに進め、#1869/canonical bounded-loop Issueとの実パス依存が未解消なら実装開始だけを正しく止める構成にしています。Issue本文の stale artifact や semantic overlap 推定では止めず、実際の predecessor、Git conflict、current-head test/CI/reviewだけを実装ゲートにします。

  11. 19 remaining items

  12. squne121 commented on Aug 21, 2026

    @squne121
    OwnerAuthor

    関連 Owner Decision: Issue #2223

    Issue #2223 で、GitHub mutation を minimal harness に縮退する Owner Decision が確定・issue-refinement-loop approve済みです(anchor comment)。

    要旨: generic GitHub mutation production broker は実装しない/新規 GitHub mutation enforcing hook は追加しない/security authority は GitHub server-side protection(branch protection・required CI・repository permission)に限定する。

    これは本 Issue の Owner Decision("agent-local instruction/permission profile は behavioral contract であり security boundary ではない"、Remaining Parent Gaps の「新しい...enforcing hook は追加しない」)と方向性が完全に一致するため、本 Issue 本文の書き換えは行いません(重複所有を避けるため)。付随して以下の対応も完了しています。

    参考として cross-reference のみ記録します。

  13. squne121 commented on Aug 21, 2026

    @squne121
    OwnerAuthor

    Cross-reference: GitHub mutation authority model の更新(#2223)

    本 Issue の Multi-Agent V2 セクションに記載されている以下の記述:

    • root/main thread が routing、最終判断、Issue/PR mutation を所有する。
    • nested delegation は bounded read-only task に限定し、write-capable-to-write-capable nested delegation は禁止する。

    は、Issue #2223(2026-08-21 OWNER Decision 更新)により、GitHub mutation authority に関する部分が capability-based model へ更新されています。

    • GitHub mutation authority は agent hierarchy(root/nested/leaf)ではなく、各 Agent/SubAgent に明示的に割り当てられた capability/role contract(frontmatter の tools/disallowedTools/permissionMode)によって決定する。
    • mutation-capable custom SubAgent(例: issue-editor, issue-creator)は、その責務・許可範囲内で mutation を実行してよい。nested/leaf であること自体は mutation prohibition の理由にしない。
    • read-only Agent は hierarchy 上の位置に関係なく mutation してはならない(capability/role contract 由来の制約)。
    • root/main thread は mutation-capable だが、通常 mutation の唯一の execution owner ではない(fallback / recovery / explicit OWNER instruction 等が主用途)。
    • 本更新は 導入: AIエージェント運用をminimal harnessへ縮退し、過剰なcontrol-planeを廃止する #1860 の minimal-harness 方針(新規 enforcing hook を追加しない、agent-local permission を security boundary としない)とは両立し、supersede しません。

    本 Issue の Multi-Agent V2 delivery-rollup スコープには本更新を追加で組み込みません(#2223 のスコープ外)。詳細・全文は #2223 を参照してください。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    state/in-progresstracking

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions