Repository navigation
Open
Labels
agent/implementerAI implementer agentenhancementNew feature or requestphase/implementationImplementation phasetriage-requiredNeeds owner triage for priority decision
Description
Machine-Readable Contract
contract_schema_version: v1
issue_kind: implementation
parent_issue: "#1580"
goal_ref: "Issue #1580 の go 判定: scope_rollup.run を specialized worker を維持した sibling exact profile として skill_runtime_exec の canonical admission/supervision 経路へ統合する"
change_kind: mixed
fixed_base_sha: "e52913ad198886e36999e40ec2668f73eb6d7559"
dependencies:
- "#1579 CLOSED (PR #1594)"
- "PR #1572 MERGED"
- "#1593 before worker integration"
- "#1595 before shared guard/parser integration"
- "#1565 before legacy classifier cutover"
- "#1573 before Claude settings cutover"
canonical_entrypoint: "uv run --locked --offline --no-sync python3 scripts/agent-guards/skill_runtime_exec.py --command-id scope_rollup.run --issue-number <N> --repo squne121/loop-protocol --invocation-id <ID> --requested-at <RFC3339>"
worker: "scripts/agent-guards/run_scope_rollup_preflight.py"
result_schema: "ISSUE_SCOPE_ROLLUP_RUN_RESULT_V1 compatibility preserved"
repository_write_roots: []
launcher_policy: "locked_offline_no_sync"
cancellation_policy: "staged_process_tree_v1"Parent Issue
Parent Goal Ref
- Goal: scope_rollup.run の canonical entrypoint と契約所有境界を安全に確定する。
- Desired Destination: 調査: scope_rollup.run exact executor を registry SSOT 経路(skill_runtime_exec 相当)へ統合すべきか検討する #1580 の decision record に従い、外側 control plane を統合し specialized worker を維持する。
Current Validated Scope
- registry、policy、outer executor、worker、Claude/Codex guard と caller/documentation を、scope_rollup.run 専用の sibling exact profile へ整合させる。
- canonical invocation を locked/offline/no-sync の一形状に固定し、legacy direct worker invocation を Claude/Codex 双方で fail-closed deny に切り替える。
- outer executor に profile ごとの zero repository write-root、bounded streaming、global deadline、検証可能な process-tree cancellation と cleanup を実装する。
Remaining Parent Gaps
- 実装 PR の merge と main 上の smoke 証跡を 調査: scope_rollup.run exact executor を registry SSOT 経路(skill_runtime_exec 相当)へ統合すべきか検討する #1580 に反映する。
- generic engine 化、registry data-only 化、GitHub CLI credential model の改善は別 Issue とする。
Outcome
scope_rollup.run が実 subprocess 境界で canonical outer executor から specialized worker を起動し、repository write root なし・bounded output・deadline/cancellation・cleanup・Claude/Codex legacy deny をテストで実証した 1 PR として main に取り込める状態。
In Scope
- command_registry.py を child worker argv の唯一の renderer とし、invocation_id と requested_at をそのまま child に渡す profile metadata を追加する。
- skill_runtime_command_policy.py を profile-driven に拡張し、canonical outer invocation、placeholder/type validation、child identity、required cwd/branch/repo、network effect、empty write roots を相互検証する。
- skill_runtime_exec.py に sibling profile dispatcher を実装する。scope 専用巨大分岐、domain transaction の移植、argv template 三重定義は行わない。
- outer executor で stdout/stderr を独立 bounded streaming し、単一 global deadline、graceful cancellation、bounded grace、hard termination を管理する。worker の別 session child/grandchild 残存を実プロセス試験で検証する。
- run_scope_rollup_preflight.py の GitHub inventory、pagination、planner/verifier、private invocation directory、domain result 構築を維持し、outer cancellation と cleanup failure を安全に伝播できるようにする。
- profile ごとに write audit を分離し、scope_rollup.run は
allowed_write_roots: []とする。既存 artifact/exclusion roots を暗黙継承しない。 - Claude settings/local-main/worktree/fastpath と Codex rules/execpolicy を canonical allow、legacy direct deny、malformed deny に揃える。
- runner/preparation/documentation の canonical command を差し替え、旧 direct command は許可例として残さない。
- listed test files で registry-policy parity、positive/negative exact parser、legacy deny、zero-write、output cap、deadline/process tree、cleanup、pagination/domain regression、real E2E identity を追加する。
Out of Scope
- GitHub inventory、pagination、planner、verifier、private artifact の domain logic を skill_runtime_exec.py へ移植する generic engine refactor。
if command_id == "scope_rollup.run"だけの一時分岐。- scope-rollup の result schema 意味変更、consumer migration、compatibility version bump。
- registry を data-only manifest に置換すること、GitHub credential store/認証方式の変更、Codex hook topology の変更。
- Allowed Paths 外の test fixture、lockfile、.venv、repository write root を必要とする方式。
Acceptance Criteria
- AC1: canonical command は
uv run --locked --offline --no-sync python3 scripts/agent-guards/skill_runtime_exec.py --command-id scope_rollup.run --issue-number <N> --repo squne121/loop-protocol --invocation-id <ID> --requested-at <RFC3339>の一形状だけで、registry render、policy parser、runner、Claude/Codex guard が同じ token order を受理する。 - AC2: scope_rollup.run profile は
allowed_write_roots: []を policy/registry/executor の相互検証で固定し、repo 内 create/update/delete/rename、既存 race-tolerant exclusions、uv.lock、.venv の mutation を fail-closed にする。 - AC3: direct run_scope_rollup_preflight.py invocation は Claude と Codex の全対象 surface で deny され、absolute path、./、uv option 変形、wrapper、env assignment、flag missing/duplicate/order change/equals/extra/wrong repo/invalid issue/invocation_id/requested_at は allow に落ちない。
- AC4: outer executor は worker の stdout/stderr を independent bounded streaming し、cap exceed の stable reason code、single global deadline、remaining budget を持つ stage timeout、graceful-to-hard cancellation を実装する。worker/child/new-session grandchild の PID が timeout 後に残らず、private artifacts は success/error/inner timeout/outer timeout/cap/malformed output/cancellation/cleanup failure の全経路で残らない。
- AC5: worker は GitHub inventory、server totalCount、PR files pagination、planner/verifier、SCOPE_ROLLUP_RUN_RESULT_V1/ISSUE_SCOPE_ROLLUP_RUN_RESULT_V1 構築を所有し続ける。producer→outer→worker→parser の実 subprocess E2E で invocation_id、requested_at、payload_sha256、candidates payload、既存 consumer compatibility を確認する。
- AC6: Claude/Codex parity と documentation/caller cutover が完了し、legacy direct command は許可例として残らない。Codex hooks topology に変更が不要なら変更しない。
- AC7: Allowed Paths だけを変更し、Ruff、targeted Python suites、guard/hook/Codex matrix、pnpm typecheck/lint/test/build、repository CI required lanes が current head で成功する。
- AC8: fixed_base_sha と dependency state を実装開始直前・push 前・merge 前に readback し、変更時は 調査: scope_rollup.run exact executor を registry SSOT 経路(skill_runtime_exec 相当)へ統合すべきか検討する #1580 の再レビューへ戻る。PR body に schema compatibility、safety evidence、rollback、Closes 本 Issue、Refs 調査: scope_rollup.run exact executor を registry SSOT 経路(skill_runtime_exec 相当)へ統合すべきか検討する #1580 を記録する。
Verification Commands
# AC1
$ uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_command_registry.py scripts/agent-guards/tests/test_skill_runtime_command_policy_anchor.py scripts/agent-guards/tests/test_skill_runtime_exec_anchor.py -v
# AC2
$ uv run --locked pytest scripts/agent-guards/tests/test_skill_runtime_exec_unauthorized_write_path.py tests/codex/test_scope_rollup_run_exact_executor.py -v
# AC3
$ uv run --locked pytest scripts/agent-guards/tests/test_local_main_branch_guard.py .claude/hooks/tests/test_local_main_branch_guard.py .claude/hooks/tests/test_worktree_scope_guard.py tests/codex/test_local_main_branch_guard.py -v
# AC4
$ uv run --locked pytest scripts/agent-guards/tests/test_skill_runtime_exec_anchor.py tests/codex/test_run_scope_rollup_preflight.py -v
# AC5
$ uv run --locked pytest tests/codex/test_run_scope_rollup_preflight.py .claude/skills/issue-refinement-loop/tests/test_verify_scope_rollup_result.py -v
# AC6
$ uv run --locked pytest scripts/agent-guards/tests/test_pretool_fastpath_classifier.py scripts/ci/tests/test_codex_execpolicy_matrix.py tests/codex/test_execpolicy_matrix.py -v
# AC7
$ uv run --locked ruff check .claude/skills/issue-refinement-loop/scripts/command_registry.py scripts/agent-guards/skill_runtime_command_policy.py scripts/agent-guards/skill_runtime_exec.py scripts/agent-guards/run_scope_rollup_preflight.py scripts/agent-guards/local_main_branch_guard.py scripts/agent-guards/pretool_fastpath_classifier.py
# Regression lane
$ pnpm typecheck
# Regression lane
$ pnpm lint
# Regression lane
$ pnpm test
# Regression lane
$ pnpm build
# AC8
$ git diff --checkAllowed Paths
- .claude/skills/issue-refinement-loop/scripts/command_registry.py
- .claude/skills/issue-refinement-loop/tests/test_command_registry.py
- scripts/agent-guards/skill_runtime_command_policy.py
- scripts/agent-guards/skill_runtime_exec.py
- scripts/agent-guards/run_scope_rollup_preflight.py
- scripts/agent-guards/local_main_branch_guard.py
- scripts/agent-guards/pretool_fastpath_classifier.py
- scripts/agent-guards/tests/test_skill_runtime_command_policy_anchor.py
- scripts/agent-guards/tests/test_skill_runtime_exec_anchor.py
- scripts/agent-guards/tests/test_skill_runtime_exec_unauthorized_write_path.py
- scripts/agent-guards/tests/test_local_main_branch_guard.py
- scripts/agent-guards/tests/test_pretool_fastpath_classifier.py
- .claude/hooks/worktree_scope_guard.py
- .claude/hooks/tests/test_worktree_scope_guard.py
- .claude/hooks/tests/test_local_main_branch_guard.py
- .claude/settings.json
- .codex/rules/default.rules
- scripts/ci/codex_execpolicy_matrix.py
- scripts/ci/tests/test_codex_execpolicy_matrix.py
- tests/codex/test_scope_rollup_run_exact_executor.py
- tests/codex/test_local_main_branch_guard.py
- tests/codex/test_run_scope_rollup_preflight.py
- .claude/agents/scope-rollup-runner.md
- .claude/skills/impl-review-loop/steps/preparation.md
- docs/dev/hook-boundaries.md
- docs/dev/agent-skill-boundaries.md
Stop Conditions
- Allowed Paths 外の変更が必要と判明した場合は、根拠、追加 path、rollback、追加 test を Issue の Scope Delta に先に記録する。
- In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合は、互換性判断と migration を Issue に先に記録する。
- 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)は、本 Issue を広げず narrow follow-up Issue に分離する。
- 後続 Phase / 別スコープへの波及が判明した場合は、current base SHA と dependency state を再読して 調査: scope_rollup.run exact executor を registry SSOT 経路(skill_runtime_exec 相当)へ統合すべきか検討する #1580 の Decision Record を更新する。
- nested SubAgent delegation が必要になった場合は、owner 相当の evidence review を Issue/PR に記録し、repository-native control を維持する。
- 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合は、追加課金・権限迂回を行わず、実行可能な local/CI test に限定する。
Required Skills
なし
Required Design References
- docs/dev/hook-boundaries.md#12c-scope_rolluprun
- docs/dev/agent-skill-boundaries.md
- .claude/agents/scope-rollup-runner.md
- .claude/skills/impl-review-loop/steps/preparation.md
- Issue 調査: scope_rollup.run exact executor を registry SSOT 経路(skill_runtime_exec 相当)へ統合すべきか検討する #1580 anchor review: 調査: scope_rollup.run exact executor を registry SSOT 経路(skill_runtime_exec 相当)へ統合すべきか検討する #1580 (comment)
Scope Delta(任意)
N/A
Scope Collision Evidence
Overlap preflight は C1(comment required)で完了した。#1593 は worker の pagination 専用変更、#1595 は shared launcher parser 抽出、#1565 は existing runtime classifier の argv-aware 化、#1573 は Claude settings の path anchoring を所有する。本 Issue はこれらを再実装せず、各 merge 後の main を再読して profile 統合と cutover の差分だけを実装する。#1598、#1588、#1429 および古い docs-only/issues は path のみ重複するが、command profile の outcome を所有しないため dependency にはせず、push 前に current main へ更新して conflict を解消する。
Delivery Rule
- 1 Issue = 1 PR。base は fixed_base_sha から開始する。
- 実装前、各 push 前、merge 前に main SHA と 実装: command_registry.py の scope_rollup.run argv テンプレートに --invocation-id/--requested-at を反映する #1579/実装: 契約実行ラッパーの unauthorized_write_path 誤検知を .guard_shadow_log.jsonl 専用の型付き exact-file ポリシーで解消する #1572 の state を再取得する。
- PR は最初 Draft とし、current head の validation、review threads、required checks が全成功後に ready/merge する。
- rollback は squash merge commit を revert して canonical outer allow を撤回し、legacy direct allow を復元する別 focused PR とする。worker domain transaction と result schema は revert 対象外として保持する。
- Refs 調査: scope_rollup.run exact executor を registry SSOT 経路(skill_runtime_exec 相当)へ統合すべきか検討する #1580
Metadata
Metadata
Assignees
Labels
agent/implementerAI implementer agentenhancementNew feature or requestphase/implementationImplementation phasetriage-requiredNeeds owner triage for priority decision
Activity
squne121 commentedon Aug 19, 2026
OWNER Decision(2026-08-19、Issue #2193 refinement 経由)
背景
Issue #2193(
pr-reviewer.md/scope-rollup-runner.md等の stale hook enforcement claim 訂正)の refinement loop 中、anchor review comment(issuecomment5334693502)が #1601 との semantic collision を指摘した。OWNER 判断として以下を確定する。#2193 before #1601)。実装: pr-reviewer.md/scope-rollup-runner.md のhook根拠記述を#1691後の実態に合わせて修正する #2193 は current main に存在する stale claim の即時 remediation であり、実装:scope_rollup.runをskill_runtime_execのsiblingexactprofileへ統合する #1601 の未解決実装に依存しない。integrate_sibling_profile:scope_rollup.runをskill_runtime_exec.pyの sibling exact profile へ統合する設計)自体は not_planned と断定しない。fresh review の対象として保持する。local_main_branch_guard.py経由の canonical-allow/legacy-deny 強制)は既定事項として引き継がない。調査: PreToolUse hook chain(local_main_branch_guard/worktree_scope_guard)の繰り返し誤ブロックを踏まえ無効化・縮小・現状維持の方針を決定する #1690(completed)・PR chore: local_main_branch_guard / worktree_scope_guard の2 hook を緊急停止する #1691(merged, hook削除)・導入: AIエージェント運用をminimal harnessへ縮退し、過剰なcontrol-planeを廃止する #1860(minimal-harness Owner Decision)・実装: Agent/Skill の重複を削減し progressive disclosure へ移行する #1732(Agent/Skill ownership、hook non-authority方針)が現在の policy authority である。docs/dev/hook-boundaries.mdは current.claude/settings.jsonとの topology drift があり、無条件の active-topology SSOT として扱わない。#1601 の実装着手条件
#1601 は実装着手前に、current main / #1690 / #1860 / #1732 を基準とした fresh な issue-refinement-loop の再実行を要する。特に以下の古い前提を再評価すること:
本コメントは調査結果(read-only SubAgent調査: current main 上の
command_registry.py/skill_runtime_command_policy.py/skill_runtime_exec.pyを確認した結果、scope_rollup.runは現在も独立レーンでありskill_runtime_exec.pyに統合されていないことを確認済み)に基づく。