Repository navigation
Closed
Labels
agent/implementerAI implementer agentenhancementNew feature or requestphase/implementationImplementation phase
Description
Machine-Readable Contract
contract_schema_version: v1
issue_kind: implementation
parent_issue: none
goal_ref: >-
PR #2400 delivered the structural repair consumer and registry entry. Close
the remaining root gaps: exact skill-runtime executor dispatch and the
canonical issue-refinement-loop route for NEXT_ACTION
apply_deterministic_structural_repair.
change_kind: workflow-runtimeParent Issue
none (standalone improvement)
Parent Goal Ref
- Goal: make a fresh preflight structural repair action reachable only through the canonical root/main route.
- Desired Destination: none; this Issue owns the narrow root dispatch and route documentation, not the structural consumer.
Current Validated Scope
- Add the dedicated structural outer flag and exact policy/parser/renderer/dispatcher wiring.
- Add the canonical
apply_deterministic_structural_repairroute to.claude/skills/issue-refinement-loop/SKILL.md. - Verify the real root executor → real policy → real registry → fixture child chain, including argv, stdout, stderr, return code, and pre-spawn rejection.
- Preserve PR feat: structural repair actionをcontrolled consumerへ接続する #2400's registry argv and structural consumer without schema or consumer changes.
Remaining Parent Gaps
- The 実装: issue-contract-review に scope_collision_check を JSON / script-first で追加する #387-dependent scope-collision evidence consumer is tracked separately by 実装: issue-refinement-loop で scope_collision_check/v1 を消費する #2406 and is not implemented here.
- 実装: Migrate contract_update control-plane mutation profiles to the dedicated runtime worktree #2393 remains blocked by 実装: control-plane preflight を dedicated linked worktree の identity probe と command class 分離で 4 production profile へ移行する #2199; it must retain this structural profile after it later rebases on main.
Background
- PR feat: structural repair actionをcontrolled consumerへ接続する #2400 closed 実装: template-derived structural_repair_action を controlled consumer へ接続し、blocked precedence deadlock を解消する #2396 by adding
structural_repair_action.apply, the structural consumer, and deadlock arbitration. The remaining gap is root executor/policy dispatch plus the canonical skill route. - The exact structural incident is 実装: e2e performance benchmark の percentile estimator を before/after/provider/gate-ready 全経路で統一する #2180 (comment); the underlying Issue's original topic is unrelated to this root transport correction.
- Current-main fact checks confirm that the registry and consumer exist, while
skill_runtime_exec.py,skill_runtime_command_policy.py, andSKILL.mdstill expose only the generic repair lane.
Scope Collision Record
- related_issue: 実装: Migrate contract_update control-plane mutation profiles to the dedicated runtime worktree #2393
- overlapping_paths:
.claude/skills/issue-refinement-loop/SKILL.md,scripts/agent-guards/skill_runtime_exec.py,scripts/agent-guards/skill_runtime_command_policy.py - edit_intent: 実装: Migrate contract_update control-plane mutation profiles to the dedicated runtime worktree #2393 migrates a distinct
contract_updateruntime profile after 実装: control-plane preflight を dedicated linked worktree の identity probe と command class 分離で 4 production profile へ移行する #2199; this Issue adds the existing structural repair profile. - non_conflict_reason: distinct command IDs, profiles, entrypoints, ACs, and test targets; 実装: Migrate contract_update control-plane mutation profiles to the dedicated runtime worktree #2393 has no active PR and 実装: control-plane preflight を dedicated linked worktree の identity probe と command class 分離で 4 production profile へ移行する #2199 is not a predecessor for this Issue.
- overlapping_paths:
- related_pr: feat: route_canonical_step2_result() に verified failure_class ベースの operator intervention route を追加する #2398
- overlapping_paths:
.claude/skills/issue-refinement-loop/SKILL.md - edit_intent: feat: route_canonical_step2_result() に verified failure_class ベースの operator intervention route を追加する #2398 changes the Step 2 compact-review
contract_readiness_human_judgmentroute to operator intervention. - non_conflict_reason: this Issue adds the preflight structural-repair next-action route in a different section and does not alter Step 2 compact-review routing, its failure class, or its wire contract.
- overlapping_paths:
- related_issue: 実装: preflight.run の GH_CONFIG_DIR を command-scoped に伝播する #2403
- overlapping_paths:
scripts/agent-guards/skill_runtime_exec.py - edit_intent: 実装: preflight.run の GH_CONFIG_DIR を command-scoped に伝播する #2403 retains
GH_CONFIG_DIRfor bare preflight execution. - non_conflict_reason: this Issue does not change
_sanitize_env()or environment propagation; it adds structural apply parsing and dispatch only.
- overlapping_paths:
- classification: semantic_non_conflict / proceed_with_coordination. File overlap alone is advisory; no native dependency is created for this Issue.
Outcome
The documented canonical structural repair route and root runtime safely invoke structural_repair_action.apply only with its dedicated outer transport validation, while production-shaped fixture tests prove the exact child argv and stdout/stderr/nonzero-return relay without live GitHub mutation.
Runtime Verification Applicability
decision: immediate
reason: >-
The production root executor launches a fixture child through the real exact
policy and registry. AC4 and AC5 directly observe the changed subprocess
boundary; a generic Claude worktree inspection does not invoke or observe
this structural route.
applicable_acs: [AC4, AC5]
execution_environment: >-
Hermetic root chain with python3, uv, and git; no authentication, network,
credential, or live GitHub Issue mutation.
skip_conditions: >-
A missing required AC4/AC5 subprocess result, unavailable fixture runtime,
or fallback-only result is non-PASS and blocks review; do not convert it to
PASS.
fallback_policy: >-
Fallback success is not PASS. The real root executor → policy → registry →
fixture-child test remains required evidence for AC4 and AC5.
artifact_requirements: >-
Focused pytest output proving byte-for-byte stdout, stderr, return code, and
no-spawn negatives, bound to the reviewed PR head.In Scope
- Dedicated
--apply-structural-repair-actionparsing inskill_runtime_exec.py, mutually exclusive with generic apply. - A sibling structural exact policy that accepts only
structural_repair_action.apply, its dedicated flag, trusted repo, target Issue's safe repo-relative artifact path, canonical root/default branch, and active Issue worktree. - Rendering the existing registry command with
preflight_result_pathand reusing existing child supervision, write checks, and stdout/stderr/returncode relay. SKILL.mddocumentation that maps the structural next action only to the structural command and flag, normalizes the artifact path, prohibits cross-route flag pairing, and resumes fresh preflight/Step 2 only after exit 0, complete phase, null failure code, and applied/no_change outcome.- Production-shaped fixture tests with only the leaf child substituted; policy and registry remain real.
Out of Scope
- Changing command-registry argv,
run_refinement_preflight.py, the structural consumer, its payload/schema/digest validation, or any schema. - Root re-parsing of nested structural payload semantics, disposition, item digests, provenance, or body drift.
- Generic repair behavior changes, new ledger/state store/broker/authorization infrastructure, or permission broadening.
- Live GitHub mutation, network/auth dependency, or model-specific canary as runtime verification.
Acceptance Criteria
- AC1:
.claude/skills/issue-refinement-loop/SKILL.mdlistsapply_deterministic_structural_repairas a canonical next action and maps it only tostructural_repair_action.applywith--apply-structural-repair-actionand a target-Issue repo-relative preflight artifact. - AC2: The root parser accepts the structural flag and generic/structural apply flags are mutually exclusive.
- AC3: The structural exact policy accepts only the fixed structural command shape and validates canonical root/default branch, active Issue worktree, repository identity, and the target Issue artifact path.
- AC4: A real hermetic chain using the production root executor, production exact policy, and production command registry proves observed child argv, byte-for-byte stdout relay, stderr sentinel relay, and nonzero child return-code propagation.
- AC5: Missing, mixed, or extra flags; wrong command/flag pairing; absolute/traversal/symlink/cross-Issue paths; and wrong repo/Issue/cwd/branch/active-Issue context fail before the fixture child starts.
- AC6: An executable documentation-contract test loads
SKILL.mdand proves that the canonical structural route permits fresh preflight/Step 2 only for exit 0,phase: complete, nullfailure_code, andmutation_outcomeapplied/no_change; it asserts that unknown, not_attempted, incomplete, and nonzero results are not blindly retried. - AC7: Existing generic root wiring plus the merged structural consumer, structural deadlock-arbitration, and generic repair consumer suites pass unchanged.
- AC8: Verification adds no live canary, network/auth dependency, credential requirement, schema, ledger, persistent state store, generic broker, permission broadening, or unrelated runtime harness. This bounded negative-scope assertion is not an agent-runtime smoke gate; AC4 and AC5 remain the immediate runtime verification evidence. The fresh PR review must enforce the live Allowed Paths gate and assess this assertion through
Schema Change Applicability,Schema Consumer Inventory, andSafety Claim Matrix.
Verification Commands
# AC1
# baseline-expect: fail
$ rg -n "apply_deterministic_structural_repair" .claude/skills/issue-refinement-loop/SKILL.md# AC2
# baseline-expect: fail
# preflight-scope: pr_review_only
$ uv run --locked pytest scripts/agent-guards/tests/test_skill_runtime_policy_commands.py -k "structural_repair_action_apply" -v# AC3
# baseline-expect: fail
# preflight-scope: pr_review_only
$ uv run --locked pytest scripts/agent-guards/tests/test_skill_runtime_policy_commands.py -k "structural_repair_action_apply" -v# AC4
# baseline-expect: fail
# preflight-scope: pr_review_only
$ uv run --locked pytest scripts/agent-guards/tests/test_skill_runtime_exec_stdout.py -k "structural_repair_action_apply" -v# AC5
# baseline-expect: fail
# preflight-scope: pr_review_only
$ uv run --locked pytest scripts/agent-guards/tests/test_skill_runtime_exec_stdout.py -k "structural_repair_action_apply" -v# AC6
# baseline-expect: fail
# preflight-scope: pr_review_only
$ uv run --locked pytest scripts/agent-guards/tests/test_skill_runtime_policy_commands.py -k "structural_repair_route_documents_resume_gate" -v# AC7
# baseline-expect: fail
# preflight-scope: pr_review_only
$ uv run --locked pytest scripts/agent-guards/tests/test_skill_runtime_policy_commands.py scripts/agent-guards/tests/test_skill_runtime_exec_stdout.py -q# AC8
# baseline-expect: pass
# preflight-scope: pr_review_only
$ git diff --checkAllowed Paths
.claude/skills/issue-refinement-loop/SKILL.mdscripts/agent-guards/skill_runtime_exec.pyscripts/agent-guards/skill_runtime_command_policy.pyscripts/agent-guards/tests/test_skill_runtime_policy_commands.pyscripts/agent-guards/tests/test_skill_runtime_exec_stdout.py
Stop Conditions
- Allowed Paths 外の変更が必要と判明した場合
- In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
- 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
- 後続 Phase / 別スコープへの波及が判明した場合
- nested SubAgent delegation が必要になった場合
- 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
- The command-registry argv, structural consumer, or schema must change.
- A genuine semantic contradiction, actual Git conflict, secret/credential exposure, or permission escalation/bypass cannot be resolved by the declared route.
- A live GitHub mutation would be required as runtime verification.
Required Skills
- Python
- pytest subprocess fixtures
Required Design References
docs/dev/workflow.mddocs/dev/runtime-verification-policy.md.claude/skills/issue-refinement-loop/SKILL.md- Issue 実装: template-derived structural_repair_action を controlled consumer へ接続し、blocked precedence deadlock を解消する #2396, merged PR feat: structural repair actionをcontrolled consumerへ接続する #2400, and the 実装: e2e performance benchmark の percentile estimator を before/after/provider/gate-ready 全経路で統一する #2180 incident comment
- Issue 実装: Migrate contract_update control-plane mutation profiles to the dedicated runtime worktree #2393, Issue 実装: control-plane preflight を dedicated linked worktree の identity probe と command class 分離で 4 production profile へ移行する #2199, Issue 実装: control-plane preflight の remote default-ref OID observe/fetch/pin/verify プロトコルを実装する #2197, PR feat: route_canonical_step2_result() に verified failure_class ベースの operator intervention route を追加する #2398, and Issue 実装: preflight.run の GH_CONFIG_DIR を command-scoped に伝播する #2403
Scope Delta(任意)
- Correct AC8's verification target: the prior generic Claude worktree smoke neither invoked nor observed
structural_repair_action.apply, so it is removed as a merge gate without weakening AC4/AC5's production-shaped subprocess evidence. - Preserve
decision: immediatefor AC4/AC5 and retain AC8 as the bounded no-live-mutation/no-broadening assertion.
Delivery Rule
1 Issue = 1 PR. Use an isolated worktree and create a Draft PR by default. Do not merge. Shared paths are advisory only: retain the Scope Collision Record, rebase if necessary, and stop only for actual Git conflict or genuine semantic contradiction. No live GitHub mutation is runtime verification.
Metadata
Metadata
Assignees
Labels
agent/implementerAI implementer agentenhancementNew feature or requestphase/implementationImplementation phase
Activity
squne121 commentedon Aug 29, 2026
判定
REQUEST_CHANGES/reframe_in_placeを推奨します。実装の必要性は明確です。PR #2400 は
structural_repair_action.applyの command registry entry と consumer を追加し、現在のmainにマージ済みです。しかし #2402 の現行契約どおり4ファイルだけを変更すると、完成するのは人間がコマンド名を知っていれば実行できる root executorまでであり、issue-refinement-loopがNEXT_ACTION: apply_deterministic_structural_repairを受信して専用 consumer を選ぶ正規ルートは未定義のまま残ります。現在のmainは PR #2400 の merge commit12806d85639567998ee5121f7196a3c8afe0d54eです。重大所見
重要度 | 所見 | 影響 | 必須対応 -- | -- | -- | -- P0 | canonical NEXT_ACTION route が Allowed Paths 外 | executor は存在しても通常の refinement loop から選ばれない | SKILL.md を追加し structural route を規定 P1 | Runtime Verification が not_applicable | リポジトリ自身の検証ポリシーと矛盾 | hermetic subprocess を immediate として扱う P1 | AC4 が stdout しか要求しない | stderr 消失・exit code 0 化・mock false-green を検出できない | real root chain で argv/stdout/stderr/returncode を検証 P1 | 「payload の cross-route 防止」が root の責務になっている | artifact semantic parsingの重複実装を誘発 | root は command/flag/path isolation、payload は既存 consumer に委ねる P1 | AC6・AC7 と Verification Commands が一致しない | generic regression や no-spawn を証明できない | focused E2E と full root regression を分離 P2 | #2180 の参照が粗く、#2393との順序も曖昧 | 将来の実装者が誤った起点や並列編集を選び得る | exact incident comment と明示的な直列化を記載P0 — root executor の配線だけでは正規フローが閉じない
現在の
.claude/skills/issue-refinement-loop/SKILL.mdが列挙する canonicalNEXT_ACTIONは、で、
apply_deterministic_structural_repairが含まれていません。詳細な後続処理も generic のapply_deterministic_repair → repair_action.apply → --apply-repair-actionだけが定義されています。一方、PR #2400 後の preflight は structural deadlock override 成立時に、
を返します。しかし
commandsは structural arbitration より前に_commands_from_plan()から構築され、その後 structural next action が選ばれても専用 command が追加されません。つまりCOMMANDS_JSONが自動的に欠落を補う設計にもなっていません。#2402 は
SKILL.mdを Required Design Reference に指定しながら、Allowed Paths には含めていません。現行の4ファイルだけで Outcome の「typed structural repair dispatch」を主張するのは過剰です。必須修正
.claude/skills/issue-refinement-loop/SKILL.mdを Allowed Paths に追加し、generic route と並べて次を明文化する必要があります。consumer の戻り値は少なくとも次のように扱うべきです。
この結果判定は generic route の既存規則を structural result shape に読み替えるだけでよく、新しい state machine や schema は不要です。
P1 —
Runtime Verification Applicability: not_applicableは誤り#2402 は「fixture subprocess が exact child argv と stdout relay を証明する」と要求しながら、Runtime Verification を
not_applicableとしています。ところがリポジトリの正本では、
not_applicable: プロセス起動・通信・I/O が不要な静的検証immediate: 本 Issue 内でプロセス起動・I/O を伴う動作検証が成立すると区別されています。したがって、hermetic な subprocess test であっても
immediateが正しい分類です。これは live GitHub mutation を要求するという意味ではありません。ネットワーク、認証、実 Issue mutation を使わず、isolated Git fixture と fixture child だけで完結させれば十分です。同じリポジトリの #2401 も root-to-producer の hermetic process invocation を
immediateとしています。推奨形は次です。
execution_environment:
cli_tools: [python3, uv, git]
auth_required: false
network_required: false
skip_conditions:
do not convert it to PASS.
fallback_policy:
fallback_success_is_pass: false
artifact_requirements:
Targeted pytest output proving observed child argv, stdout, stderr,return code, and no-spawn rejection cases.
P1 — AC4 は false-green を許す
現行 AC4 は「fixture subprocess が exact child argv と stdout relay を証明する」だけです。これでは次の欠陥が残っても PASS できます。
subprocess.runや supervisor を monkeypatch し、実 registry を通していないstructural command が実際には generic branch に入っている
child stderr が捨てられる
child の非ゼロ終了が root で 0 に正規化される
invalid input を拒否した後も child が一度起動されている
現在の executor は、実 registry の
render_command()をロードして child を起動し、最後に stdout、stderr、returncode をそれぞれ親へ転送します。またコード内には、過去に stub renderer が undeclared params を無視したため、production registry では失敗する経路をテストが通してしまったという false-green の記録もあります。既存 generic test も、real executor・real policy・real registry・real child chain を通すことを明示しています。新しい structural test はこの形を踏襲すべきです。
Python の subprocess API でも return code、stdout、stderr は別の観測値です。stdout だけの確認では process relay の契約を証明できません。argv は文字列ではなく sequence のまま扱う現在の実装を維持するのが適切です。(Python documentation)
必要な test oracle
real root executor から real policy・real registry を経由し、fixture child だけを置き換えます。fixture child は、
受け取った
sys.argvを stdout に JSON 出力固有の sentinel を stderr に出力
意図的に
17などの非ゼロで終了とします。
親テストは次を検証します。
これは live mutation testではありません。実 child consumer の semantic correctness は PR #2400 で追加済みの consumer suitesが担当し、ここでは root wiring だけを production-shaped に証明します。
P1 — root で payload を再検証してはいけない
現行 AC3 の、
という表現は、
payloadsまで root executor の責務に読めます。しかし root が扱うべきなのは次だけです。
command ID
outer CLI flag
repo slug
Issue番号
artifact path
cwd / branch / active Issue context
repair_actionとstructural_repair_actionの nested payload、disposition、item schema、digest 等は child consumer の責務です。PR #2400 が追加した structural consumer は、structural bundle の provenance・disposition・item digest・body drift を既に検証します。root 側でも JSON を開いて同じ判定を行うと、consumer が二重化し、将来の schema変更で split-brain を起こします。AC3 は次のように狭めるべきです。
拒否時は child を起動しないouter argparse では両 apply flag を mutually exclusive group に入れられます。ただし、command ID と flag の対応関係は引き続き exact policy で検証します。(Python documentation)
P1 — 新しい安全ハーネスは不要
generic の exact apply parser は既に次を実装しています。
固定12 token shape
flag順序の固定
trusted repo slug
正の Issue番号
eligible command ID
Issue固有 artifact root
canonical root / default branch
active Issue worktree
また
_is_safe_issue_artifact_path()は absolute path、traversal、symlink component、別 Issue の artifact root、shlex round-tripで意味が変わるパスを拒否します。structural route ではこれをそのまま再利用すれば十分です。次は追加しない方がよいです。
新しい artifact schema
新しい authorization receipt
新しい persistent state / ledger
汎用 command broker
live GitHub canary
native / Claude-GPT の反復比較 matrix
permission bypass
exact parser family 全体の大規模リファクタリング
#2396 の敵対的レビューも、残すべき境界を provenance、single mutation、stale guard、authoritative readback、fresh validation、unknown outcome の blind retry 禁止に限定し、global state machine や enforcing hook 等は不要としています。
個人趣味開発としては、generic parserを大きく抽象化せず、structural sibling を1本追加して既存 helperを共有する程度が最も実用的です。
P2 — 参照元と scope collision を明確化する
#2180
#2180 自体の主題は percentile estimator の統一です。structural repair の契機は Issue本文ではなく、
Runtime Verification Applicability欠落により、となったコメント上のインシデントです。
したがって
goal_refは曖昧に「Issue #2180 described」とするのではなく、次を参照する方が追跡しやすくなります。実装: e2e performance benchmark の percentile estimator を before/after/provider/gate-ready 全経路で統一する #2180 の具体的な停止コメント
実装: template-derived structural_repair_action を controlled consumer へ接続し、blocked precedence deadlock を解消する #2396
merged PR feat: structural repair actionをcontrolled consumerへ接続する #2400
#2393
#2393 は現在 open で、
skill_runtime_command_policy.pyとskill_runtime_exec.py、さらにSKILL.mdを変更対象としています。また #2199 の完了待ちで、共有ファイルの並列編集を禁止しています。#2402 を #2393 に依存させる必要はありませんが、次の順序を明記すると実務上十分です。
最小の実装設計
skill_runtime_exec.py--apply-structural-repair-actionを追加generic flag と mutually exclusive にする
is_structural_repair_action_apply_commandを dedicated execution class から判定structural command 専用 exact-policy predicate を呼ぶ
structural render params へ
preflight_result_pathを渡すchild supervision、write checks、artifact projection、stdout/stderr/returncode relay は既存共通経路をそのまま使う
skill_runtime_command_policy.pyEXACT_STRUCTURAL_REPAIR_ACTION_APPLY相当の execution classを追加structural専用 parser / predicateを追加
command ID は
structural_repair_action.applyのみflag は
--apply-structural-repair-actionのみpath検証は既存
_is_safe_issue_artifact_path()を再利用generic parserの意味論は変更しない
SKILL.mdcanonical
NEXT_ACTIONenum にapply_deterministic_structural_repairを追加dedicated command / flag / artifact normalizationを記載
generic routeとの cross-route禁止を記載
mutation_outcome/phase/failure_codeに基づく後続処理を記載success後の fresh preflight / Step 2再開を記載
unknown / not_attempted / nonzeroのblind retry禁止を記載
Tests
policy parser positive/negative matrix
real root→real policy→real registry→fixture child
stdout・stderr・returncode relay
invalid input時の child no-spawn
full root test filesによる generic regression
-既存 structural consumer/deadlock suitesは無変更で実行
Issue本文の推奨差し替え
squne121 commentedon Aug 29, 2026
推奨アクションは、現行 #2402 のまま実装開始せず、指定コメントを OWNER の human-context anchor として
issue-refinement-loopを再実行し、reframe_in_placeを controlled mutation で反映してから実装へ handoff です。指定コメント自身がREQUEST_CHANGES / reframe_in_place / implementation_ready: falseとしており、P0 はSKILL.mdが Allowed Paths 外で canonical structural route が閉じていない点です。 現在の #2402 本文も Allowed Paths が4ファイルのみで、Runtime Verification はnot_applicableのままです。なお、レビューコメント投稿時点の
main=12806d...はすでに古く、現在のmainは132b08c257d6add00c51ff660761cb6e6c90bf53です。 ただし最新mainのSKILL.mdを再確認しても canonicalNEXT_ACTIONは genericapply_deterministic_repairまでで、apply_deterministic_structural_repairはまだありません。したがってレビューの中心的な P0 は現在も有効です。また #2393 は
SKILL.mdと root runtime 2ファイルを共有し、#2199 完了後に実施する契約です。 #2199 は現在も open で、さらに前提の #2197 も open なので、#2402 に形式的な依存を追加する必要はありませんが、共有ファイルの並行実装を避けて #2402 を先に完了させる方針が妥当です。Claude-GPT には以下を渡すのを推奨します。
あなたは
squne121/loop-protocolの root control-plane として、Issue #2402 を指定 OWNER comment を human-context anchor にして再 refinement し、implementation-ready になった場合だけ実装・レビューへ進んでください。対象:
Repository:
squne121/loop-protocolIssue:
#2402Human-context anchor:
https://github.com/squne121/loop-protocol/issues/2402#issuecomment-5463058036Related implementation:
Structural repair incident:
https://github.com/squne121/loop-protocol/issues/2180#issuecomment-5461103693Scope-collision context:
この anchor は OWNER による
REQUEST_CHANGES / reframe_in_placeであり、現行 #2402 をそのまま実装する authority ではありません。目的は次の順序です。
mainと repository/GitHub state を fresh に再確認する。issue-refinement-loopを実行する。reframe_in_placeする。最初に必ず current state を再取得する
プロンプト作成時点では
mainは132b08c257d6add00c51ff660761cb6e6c90bf53まで進んでいますが、この SHA を authority として固定しないでください。作業開始時に remote/currentmainを fresh に取得してください。指定 anchor が書かれた時点では
main=12806d85639567998ee5121f7196a3c8afe0d54eでした。したがって anchor 内の「current main」という表現をそのまま事実として再利用せず、各技術的 finding を current main に対して再検証してください。最低限、次を確認してください。
.claude/skills/issue-refinement-loop/SKILL.md.claude/skills/issue-refinement-loop/scripts/command_registry.py.claude/skills/issue-refinement-loop/scripts/run_refinement_preflight.pyscripts/agent-guards/skill_runtime_exec.pyscripts/agent-guards/skill_runtime_command_policy.pyscripts/agent-guards/tests/test_skill_runtime_policy_commands.pyscripts/agent-guards/tests/test_skill_runtime_exec_stdout.py古い anchor の finding が current main ですでに解消済みなら stale と明記し、不要な実装を行わないでください。
SubAgent 利用は必須
root/main thread から、read-only の bounded SubAgent を複数起動してください。
最低限、以下の3レーンを分担してください。
SubAgent A: runtime wiring fact check
current main 上で以下を独立調査してください。
structural_repair_action.applyregistry entryapply_deterministic_structural_repairproducer/arbitrationSKILL.mdcanonical NEXT_ACTION / orchestration route の有無repair_action.applyの既存 exact-policy patternSubAgent B: test/evidence fact check
以下を調査してください。
SubAgent C: dependency/scope collision fact check
GitHub Issue/PR/current repository stateから以下を調査してください。
必要な外部仕様が disposition に影響する場合のみ、追加で
web-researcher相当を使用してください。Pythonargparse/subprocess等の既知仕様を再確認する程度に留め、大規模な一般調査は不要です。SubAgent の厳守事項
Phase 1: #2402 を canonical refinement する
指定 anchor は必ず human-context lane として扱ってください。URLだけから origin を推定し直したり、agent-report / unlabeled lane に渡したりしないでください。
canonical main root / default branch から current registry に従い fresh:
preflight.run.with_human_contextを実行してください。
過去の preflight artifact やレビュー結果を implementation authority として再利用しないでください。
trusted contract patch plan が生成された場合は current canonical contract に従って:
contract_update.run.with_human_context相当の controlled mutation phase を root/main thread から実行してください。
raw
gh issue editや自由記述による直接書き換えで迂回しないでください。もし controlled update が
issue_editor_required/full_rewrite_requiredを返すなら、現在のSKILL.mdに定義された controlledissue-editor/edit-issuehandoff に従ってください。同一 contract update の no-progress retry はしないでください。mutation 後は必ず GitHub から body を readback し、fresh preflight と fresh Step 2 review を実行してください。
blocked/environment_failure/human_judgment_requiredが残る場合は bypass せず、その exact blocker と evidence を報告して停止してください。#2402 の reframe で維持すべき意図
current main の fact check で anchor の findings が維持される場合、Issue は概ね次の契約へ reframe してください。
Scope
root executor wiring だけでなく、
fresh preflight→
NEXT_ACTION: apply_deterministic_structural_repair→ root/main orchestrator
→
structural_repair_action.apply→
--apply-structural-repair-action <repo-relative preflight artifact>までの canonical route を #2402 の Outcome に含めてください。
.claude/skills/issue-refinement-loop/SKILL.mdを Allowed Paths に追加してください。Runtime Verification
not_applicableではなくimmediateを基本候補としてください。ただし live GitHub mutation canary は不要です。
production-shaped な hermetic subprocess chain:
real root executor
→ real exact policy
→ real command registry
→ fixture child
で runtime wiring を検証してください。
network/auth/live GitHub Issue mutation を runtime verification の条件にしないでください。
Root/consumer responsibility
root runtime が検証するのは outer transport boundary に限定してください。
structural_repair_action内部の nested payload、disposition、item digest、body drift、provenance 等を root で再パース・再実装しないでください。それらは PR #2400 の structural consumer の責務です。新規 schema、ledger、persistent state、汎用 command broker、新規 authorization infrastructure は追加しないでください。
Cross-route isolation
最低限以下を fail-closed で固定してください。
outer argparse で mutually exclusive group を使えるなら current implementationとの整合を確認した上で採用してください。ただし command ID ↔ flag の exact pairing は policy 側でも維持してください。
Success semantics
structural consumer 実行後に fresh preflight / Step 2 review を再開できるのは最低限:
phase == completefailure_code == nullmutation_outcome in {applied, no_change}の場合だけとしてください。
unknown/not_attempted/ nonzero / incomplete phase は blind retry しないでください。generic lane の現在の結果処理を structural result shape に読み替えて再利用し、新しい state machine を作らないでください。
Scope collision
#2393 は
SKILL.md、skill_runtime_exec.py、skill_runtime_command_policy.pyと重複します。current GitHub state を再確認した上で、重複実装がまだ開始されていないなら:
という coordination を Issue #2402 に記録してください。
ただし #2393 を不必要に formal dependency として追加しないでください。current evidence が変わっている場合は current state を優先してください。
Phase 2: approved 後だけ implementation
fresh refinement loop が
approvedに到達し、current canonicalLOOP_HANDOFF_RESULT_V1/root_entry_routerが implementation handoff を許可した場合だけ implementation に進んでください。古い #2402 body の
phase/implementationlabel だけを implementation authority とみなさないでください。canonical handoff が許可しなければ実装を開始しないでください。
Implementation 方針
1 Issue = 1 PR。
専用 isolated implementation worktree を使用してください。
最小差分を優先し、大規模 refactor はしないでください。
想定変更先は reframe 後の Allowed Paths を authority としますが、current evidence が anchor と一致する場合は概ね:
.claude/skills/issue-refinement-loop/SKILL.mdscripts/agent-guards/skill_runtime_exec.pyscripts/agent-guards/skill_runtime_command_policy.pyscripts/agent-guards/tests/test_skill_runtime_policy_commands.pyscripts/agent-guards/tests/test_skill_runtime_exec_stdout.pyです。
skill_runtime_exec.py--apply-structural-repair-actionouter flagskill_runtime_command_policy.pystructural_repair_action.applyのみを受理helper 名は anchor の記述を盲目的にコピーせず current source を確認してください。
SKILL.mdapply_deterministic_structural_repairを generic repair route と整合する形で追加してください。
thin-entrypoint の設計を壊して別の state machine を埋め込まないでください。
Test oracle
mock/stub-only test を acceptance evidence にしないでください。
少なくとも production root executor、production exact policy、production registry を実際に通し、fixture child だけを controlled substitute とする test を追加してください。
fixture child は例えば:
sys.argvを JSON で stdout に出す形にし、親から以下を検証してください。
structural invocation の expected argv は current registry を authority として検証してください。
negative matrix では invalid input 時に「エラーになった」だけでなく child spawn が0回であることを確認してください。
generic repair lane が壊れていないことも full root test files で確認してください。
既存 PR #2400 の structural consumer / deadlock arbitration suites は変更せず PASS させてください。
Verification
Issue reframe 後の Verification Commands を authority とし、最低限:
git diff --checkを実行してください。
SKIP、environment-blocked、fallback success を PASS に読み替えないでください。
live GitHub mutation を runtime verification として実行しないでください。
PR
全 AC が evidence 付きで満たされたら Draft PR を作成してください。
PR body に:
Closes #2402を入れてください。
PR body には少なくとも:
を記録してください。
その後 current repository の canonical implementation/review loop に従い、SubAgent reviewer を含む必要なレビューを実行してください。
レビュー用 SubAgent を起動した場合も 全員の terminal completion を wait/join してください。
request changes が出た場合は blocker を current head で再現・fact-checkしてから必要な fix delta のみを実装し、focused + regression tests を再実行してください。
merge-ready まで進めますが、merge は実行しないでください。
自律実行と停止条件
通常の read、GitHub調査、controlled Issue refinement、isolated worktree作成、実装、test、commit、push、Draft PR作成、review/fix iteration は、リポジトリの canonical workflow が許可する範囲で自律的に進めてください。
以下だけは停止してください。
human_judgment_requiredを返す停止時は bypass 案を実行せず、exact blocker、確認した evidence、completed SubAgents、未完了作業、推奨 next action を報告してください。
最終報告
最後に簡潔に以下を報告してください。
過去のログや anchor の結論を再掲するだけではなく、current repository/GitHub state を authority とした実行結果を返してください。
この形なら、今回のコメントを単なる「実装指示」と誤解せず、まずレビュー指摘を Issue 契約へ正規反映し、その fresh contract を実装 authority にする流れになります。特に今回の欠陥は「root commandを足せば終わり」ではなく「通常の refinement loop からその command に到達できること」が本丸なので、reframe を先に通すのが重要です。
squne121 commentedon Aug 29, 2026
今回の「実装禁止条件」は、#2402 の Issue 契約から出たものではありません。実行時に与えられたオーケストレーション指示に、独自の停止条件として
が入っています。
そして Claude Code は、PR #2398 が
SKILL.mdを変更している → #2402 の reframe 後もSKILL.mdを Allowed Paths に追加する必要がある → 同一ファイルなので「並行実装禁止条件」に該当、という判定をしています。この判定は強すぎます
現在の #2402 本文はむしろ逆です。#2393 と
skill_runtime_command_policy.py/skill_runtime_exec.pyが重複することを認識しつつ、対象 profile が別なので coordination は必要だが dependency は宣言しないと明記されています。これはリポジトリ内の既存方針とも一致します。#2152 は、Allowed Paths の文字列重複自体は停止理由にせず、実際の Git conflict は worktree / PR 作成時に検出する、と明文化しています。 #2403 も、#2402/#2393 と
skill_runtime_exec.pyを共有しながら、validated edit intent が異なるので dependency にはしない、PR 作成時に line-level coordination を行う、としています。さらに、まさにこのための #387
scope_collision_checkがあります。そこでも path overlap は collision candidate にすぎず、C1 相当の「同じ path だが意味的 conflict なし」はedit_intent/non_conflict_reasonの追加情報で分類する設計です。逆に predecessor が open で順序依存が明確な場合だけwait_for_predecessorになります。したがって、ユーザーが今説明した基準の方が、このリポジトリで既に形成されている設計に近いです。
私なら判定基準をこう直します
ファイル重複は停止条件ではなく、調査トリガーにします。同じファイル・同じ行付近・同じ関数・同じ route を編集していても、最終状態が両立するなら並行作業を許可します。
止めるのは、「同じ decision point に対して A は残す、B は消す」「同じ enum/route の意味を別々に変更する」「先行 Issue の成果物がなければ後続 Issue の実装自体を定義できない」といった semantic conflict / genuine ordering dependency が確認された場合です。
実 Git conflict はさらに別です。これは運用上の conflict なので、ユーザーが意図している通り owner coordination の対象にはしてよいですが、Git conflict が起こり得るというだけで dependency に昇格させる必要はありません。
そして genuine dependency と判定された場合は、ユーザーの案でよいです。つまり、実装をただ止めるのではなく、まず対象 Issue を controlled reframe して依存理由・edit intent・predecessor を本文へ反映し、GitHub native
blocked byを設定して readback した後、コード実装を開始せず終了する。ちなみに現時点の #2402 の nativeblocked_byは空です。#2402について
現時点では、PR #2398 が
SKILL.mdを触っているという理由だけで #2402 を止めるべきではありません。取得した #2398 の差分は Step 2 routing table 側の変更で、一方 #2402 が必要としている structuralNEXT_ACTIONの canonical dispatch は preflight / deterministic repair routing 側です。少なくとも現在確認できる差分から「残す vs 消す」のような semantic contradiction は確認できません。したがって次回は、fresh diff で edit intent を比較し、semantic conflict がなければ #2402 の controlled reframe → fresh review → implementation に進む、が妥当です。
また、ワークフロー修正の Issue は新規起票する価値があります。#387 は collision evidence producer / issue-contract-review 最小 wiring が主目的で、#385 自身も「impl-review-loop などでの consumer wiring は別 Issue」と明記しています。 なので、新 Issue は別の collision checker を作るのではなく、consumer が C1/shared-file overlap を hard stop に誤変換しないことに限定するのがよいです。
Claude Codeには、今のセッションを次の指示で再開させるのが適切です。
#2402
の作業を再開してください。
今回の停止判断について OWNER 方針を明示します。
「OPEN PR / Issue と Allowed Paths または変更ファイルが重複している」こと自体を implementation hard stop にしないでください。
特に
active shared-file PR collisionのような、ファイル単位の重複だけを理由とする停止条件は採用しません。Scope Collision は次の基準で再評価してください。
shared file / directory overlap は advisory evidence とする。
ファイル名が一致するだけでは dependency / implementation prohibition にしない。
current Issue と OPEN Issue/PR の actual diff、対象 symbol/function/route/section、Acceptance Criteria、Outcome、edit intent を比較する。
次のような semantic conflict がある場合だけ OWNER judgment / dependency candidate とする。
同じファイルでも別 section / 別 function / 別 profile で、双方の Outcome が同時に成立するなら並行作業を許可する。
edit_intentとnon_conflict_reasonを Issue/作業記録に残し、通常どおり進める。将来的な軽微な rebase/merge conflict の可能性だけを dependency と解釈しない。
actual Git conflict、または同一 hunk / symbol に対する競合が実際に発生した場合は、勝手に片方を捨てず OWNER coordination の対象とする。
ただし textual conflict と semantic dependency は区別する。
genuine dependency が確認された場合は、単に実装を停止して終わらない。
先に current GitHub Issue を controlled transaction で修正し、
を反映する。
その後 GitHub native Issue dependency の
blocked byを設定し、Issue body と native dependency の両方を readback する。ここまで完了してから、その Issue のコード実装は開始せず終了する。
実装: structural_repair_action.apply を root skill runtime executor へ配線する #2402 について fresh state で PR feat: route_canonical_step2_result() に verified failure_class ベースの operator intervention route を追加する #2398、実装: Migrate contract_update control-plane mutation profiles to the dedicated runtime worktree #2393、実装: preflight.run の GH_CONFIG_DIR を command-scoped に伝播する #2403 その他 relevant OPEN work を確認する。
PR feat: route_canonical_step2_result() に verified failure_class ベースの operator intervention route を追加する #2398 が
.claude/skills/issue-refinement-loop/SKILL.mdを変更しているという理由だけで停止しない。actual diff と 実装: structural_repair_action.apply を root skill runtime executor へ配線する #2402 が追加する structural repair canonical route の edit intent を比較し、semantic conflict がなければ 実装: structural_repair_action.apply を root skill runtime executor へ配線する #2402 の controlled reframe を完了して fresh preflight / Step 2 review へ進む。
実装: structural_repair_action.apply を root skill runtime executor へ配線する #2402 の review で既に判明している contract gap、
.claude/skills/issue-refinement-loop/SKILL.mdの Allowed Paths 追加apply_deterministic_structural_repairrouteを current main と fresh review に基づいて reframe する。
reframe 後に implementation-ready なら、そのまま implementation → tests → Draft PR → review loop → merge-ready まで進める。
merge 自体は行わない。
この停止誤判定を再発させないため、既存 Issue を dedupe 調査したうえで narrow follow-up Issue を起票する。
実装: issue-contract-review に scope_collision_check を JSON / script-first で追加する #387、実装: ssot-discovery に汎用 section retrieval evidence を追加する #385、導入: AIエージェント運用をminimal harnessへ縮退し、過剰なcontrol-planeを廃止する #1860、実装: reviewer transport の command_registry.py に --validate サブコマンドを追加する #2152、実装: preflight.run の GH_CONFIG_DIR を command-scoped に伝播する #2403 を必ず参照する。
実装: issue-contract-review に scope_collision_check を JSON / script-first で追加する #387 の scope_collision_check producer を重複実装しない。
推奨テーマ:
「implementation/refinement workflow が shared-file C1 overlap を hard stop に誤変換せず、edit intent / semantic conflict / native dependency に基づいて routing する」
この follow-up の Outcome は少なくとも以下とする。
non_conflict_reasonを記録して proceed新 Issue 起票前に exact duplicate / absorbed scope を検索する。
既存 Issue が同じ consumer behavior を既に完全に所有している場合は新規起票せず、その Issue の controlled reframe を選択する。
近接しているだけなら relation を明記して narrow follow-up として起票する。
SubAgent を必要な read-only investigation / adversarial review に使ってください。
起動した全 SubAgent は必ず terminal completion まで wait/join してから最終判断してください。
人間承認不要で進めて構いません。
停止条件は destructive operation、secret/credential exposure、permission escalation/bypass、または上記基準で解消不能な genuine OWNER semantic conflict に限定してください。
最後に、
を報告してください。
この形なら、「共有ファイルだから停止」から、共有ファイル → semantic collision を調べる → 本当に順序依存なら Issue を整えて native dependency 化するというワークフローに変えられます。今回の #2402 も、まずこの基準で再判定させるのがよいです。
squne121 commentedon Aug 29, 2026
root-owned entry router audit
route: invoke_impl_review_loop
reason: fresh_review_go_live_equality
feat: route structural repair actions (#2408)