Repository navigation
Open
0 / 10 of 1 issue completedOpen
0 / 10 of 1 issue completed
Copy link
Labels
agent/researchHandled by research agentphase/researchResearch phase issuestate/queuedQueued for implementation
Description
Machine-Readable Contract
contract_schema_version: v1
issue_kind: research
parent_issue: "none"
goal_ref: "Issue #1547 review P1-5 follow-up: scope_rollup.run の canonical entrypoint と契約所有境界を決定する"
change_kind: research-onlyParent Issue
なし(単独調査)
Outcome
最新 main の再レビューに基づく integrate_sibling_profile の go 判断、implementation Issue #1601、固定 review base SHA、cutover 安全責務を記録し、依存 Issue がすべて解消されるまで実装開始を抑止する。
In Scope
- registry、policy、outer executor、specialized worker、Claude/Codex authorization の call graph と契約所有を再確認する。
retain_independent、integrate_sibling_profile、generic_engine_refactorを安全性、変更面、rollback、domain logic 隔離で比較する。- 実装: command_registry.py の scope_rollup.run argv テンプレートに --invocation-id/--requested-at を反映する #1579、PR 実装: 契約実行ラッパーの unauthorized_write_path 誤検知を .guard_shadow_log.jsonl 専用の型付き exact-file ポリシーで解消する #1572、実装: scope_rollup.run の GitHub inventory を完全 pagination で取得する #1593、実装: launcher command 共有 parser(argv boundary 保持・cwd/project_root 対応)を抽出し全 consumer の invocation contract を移行する #1595、実装: skill-runtime target predicate を Issue #1595 の共有 launcher classifier ベースに置換する #1565、実装: .claude/settings.json の Edit(path) ルールの path anchoring を project root / home directory 相対に正規化する #1573 と最新 main を live readback し、実装開始条件を記録する。
- canonical outer invocation、legacy direct deny、zero repository write root、output/deadline/cancellation/cleanup、schema compatibility の責務境界を固定する。
Out of Scope
- scope_rollup.run 統合コード、テスト、設定、documentation の実装。
- GitHub inventory、pagination、planner、verifier、private invocation directory、domain result construction を outer executor へ吸収する generic engine refactor。
skill_runtime_exec.py内のif command_id == "scope_rollup.run"のみの暫定分岐。- 実装:scope_rollup.runをskill_runtime_execのsiblingexactprofileへ統合する #1601 の dependency Issue が未解消の間に同一 path の重複実装を開始すること。
Decision Record
SCOPE_ROLLUP_EXECUTOR_DECISION_V1:
verdict: go
decision: integrate_sibling_profile
rationale: "canonical admission/supervision を skill_runtime_exec.py に一本化しつつ、GitHub inventory、pagination、planner/verifier、private artifact、domain result は specialized worker に隔離する。これにより独立 lane の contract drift を解消し、generic engine 化と単純分岐の双方を避ける。"
observed_dependencies:
registry_contract_issue:
number: 1579
current_state: CLOSED
closing_pr: 1594
overlapping_runtime_pr:
number: 1572
current_state: MERGED
resolution_pr: 1572
implementation_blockers:
- number: 1593
current_state: OPEN
- number: 1595
current_state: OPEN
- number: 1565
current_state: OPEN
- number: 1573
current_state: OPEN
base_sha: "c0048fab6e5544c5b599cd0feb8f85571a9bd4b8"
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>"
legacy_direct_entrypoint: blocked_after_cutover
worker: "scripts/agent-guards/run_scope_rollup_preflight.py"
implementation_issue: 1601
result_schema_compatibility: "SCOPE_ROLLUP_RUN_RESULT_V1 and ISSUE_SCOPE_ROLLUP_RUN_RESULT_V1 semantics preserved"
re_review_trigger: "base SHA または dependency state が変わった場合"Current Call Graph and Contract Ownership
| 契約次元 | 現行所有者 | cutover 後の責務 |
|---|---|---|
| canonical user-facing argv / child argv | registry と direct worker caller | registry は specialized worker の child argv を render、policy は outer argv を exact validate |
| placeholders / type validation | registry と caller | registry/policy の profile metadata が invocation_id と requested_at を required string として一致検証 |
| execution class / cwd / branch / repo | policy、local/worktree guard、Codex rules | sibling profile metadata が required cwd、default branch、repo identity を検証 |
| write roots / environment sanitation | direct scope policy と worker | outer が empty write roots と sanitized environment を監督 |
| launcher / timeout / deadline / output | worker と preflight executor | outer が locked/no-sync launcher、bounded streaming、global deadline、process-tree cancellation を所有 |
| private artifact / cleanup / result schema | worker と parser | worker が private data と domain result を構築・cleanup、outer は result を再解釈せず forward |
| callers / consumers / authorization | runner、preparation、docs、Claude/Codex guards | caller を canonical outer command へ移行し、双方で canonical allow・legacy deny を一致させる |
Options Compared
| 案 | canonical path 数 | duplicated policy/supervision | safety property の証明可能性 | change surface / current conflict | rollback | specialized domain logic | 判定 |
|---|---|---|---|---|---|---|---|
| retain_independent | 2 | 高い | split-brain と registry drift が残る | 小 / 低い | 容易 | 隔離維持 | 不採用 |
| integrate_sibling_profile | 1 | control plane に限定 | outer safety と worker domain safety を個別に証明可能 | 中 / dependencies 解消後 | 1 squash revert | worker に隔離維持 | 採用 |
| generic_engine_refactor | 1 | 一見低い | pagination/artifact/schema の境界を失う | 大 / 高い | 困難 | outer に流出 | 不採用 |
Safety Responsibility and Cutover Conditions
- scope profile の repository write roots は空配列であり、既存 artifact/exclusion root を継承しない。任意 repository mutation は fail-closed とする。
- outer と worker の双方が stdout/stderr cap を持つ。outer は unbounded
capture_output=Trueを用いない。 - outer の global deadline は stage ごとの remaining budget を上限にし、graceful cancellation、bounded grace、hard termination を実装する。別 session の child/grandchild も実プロセス試験で残存なしを確認する。
- worker の private artifact cleanup は success、worker error、inner/outer timeout、cap exceed、malformed output、cancellation、cleanup failure の全経路で hard failure とする。
- launcher は
--locked --offline --no-syncで uv lock/sync mutation を防止し、uv.lock と .venv unchanged を検証する。 - worker は GitHub inventory、pagination、server totalCount cross-check、planner/verifier、domain schema を所有し続ける。
- Claude/Codex は canonical outer command のみを allow し、direct worker の absolute/relative/wrapper/uv-option variant を deny する。
- runner、preparation、docs は legacy direct command を許可例として残さない。
Acceptance Criteria
- AC1: 現行 call graph と契約所有者を argv、child argv、placeholders、execution class、cwd/branch/repo、write roots、environment、launcher、deadline、output、process tree、artifact、result schema、caller/consumer、authorization の観点で列挙した。
- AC2: retain_independent、integrate_sibling_profile、generic_engine_refactor を canonical path 数、policy 重複、安全性、変更面、競合、schema、rollback、domain 隔離で比較した。
- AC3: SCOPE_ROLLUP_EXECUTOR_DECISION_V1 に go verdict、decision、current base SHA、依存状態、canonical entrypoint、worker、implementation Issue を記録した。
- AC4: zero-write、output bound、global deadline/process tree、cleanup、launcher、pagination、schema responsibility を implementation contract へ引き継いだ。
- AC5: canonical allow と legacy direct deny の Claude/Codex parity、caller/documentation cutover 条件を記録した。
- AC6: implementation Issue 実装:scope_rollup.runをskill_runtime_execのsiblingexactprofileへ統合する #1601 に exact Allowed Paths、test matrix、dependencies、fixed base SHA、schema compatibility、process-tree design、rollback plan を記載して link した。
- AC7: 実装: command_registry.py の scope_rollup.run argv テンプレートに --invocation-id/--requested-at を反映する #1579 CLOSED(PR feat: scope-rollup registry invocation metadata #1594)および PR 実装: 契約実行ラッパーの unauthorized_write_path 誤検知を .guard_shadow_log.jsonl 専用の型付き exact-file ポリシーで解消する #1572 MERGED を readback し、main c0048fa で再レビューした。実装: scope_rollup.run の GitHub inventory を完全 pagination で取得する #1593、実装: launcher command 共有 parser(argv boundary 保持・cwd/project_root 対応)を抽出し全 consumer の invocation contract を移行する #1595、実装: skill-runtime target predicate を Issue #1595 の共有 launcher classifier ベースに置換する #1565、実装: .claude/settings.json の Edit(path) ルールの path anchoring を project root / home directory 相対に正規化する #1573 は OPEN のため、実装:scope_rollup.runをskill_runtime_execのsiblingexactprofileへ統合する #1601 の実装開始は blocked である。
Verification Commands
# AC1
$ gh issue view 1580 --repo squne121/loop-protocol --json body
# AC2
$ gh issue view 1580 --repo squne121/loop-protocol --json body
# AC3
$ gh issue view 1580 --repo squne121/loop-protocol --json body
# AC4
$ gh issue view 1601 --repo squne121/loop-protocol --json body
# AC5
$ gh issue view 1601 --repo squne121/loop-protocol --json body
# AC6
$ gh issue view 1601 --repo squne121/loop-protocol --json state,body
# AC7
$ gh issue view 1579 --repo squne121/loop-protocol --json stateAllowed Paths
- 読み取り専用。リポジトリ変更なし(既定)。
- 成果物は本 Issue の Decision Record、Issue 実装:scope_rollup.runをskill_runtime_execのsiblingexactprofileへ統合する #1601 の implementation contract、後続 PR の evidence に限定する。
Stop Conditions
- Outcome / Scope / AC が検索可能な形で記載されていない場合は即停止
- Allowed Paths 外への書き込みを試みた場合は即停止
- 権限不足(permission denied)により操作が完了できない場合は即停止
- 成果物の書き込みに失敗した場合(I/O エラー等)は即停止
- base SHA または 実装: command_registry.py の scope_rollup.run argv テンプレートに --invocation-id/--requested-at を反映する #1579/実装: 契約実行ラッパーの unauthorized_write_path 誤検知を .guard_shadow_log.jsonl 専用の型付き exact-file ポリシーで解消する #1572/実装: scope_rollup.run の GitHub inventory を完全 pagination で取得する #1593/実装: launcher command 共有 parser(argv boundary 保持・cwd/project_root 対応)を抽出し全 consumer の invocation contract を移行する #1595/実装: skill-runtime target predicate を Issue #1595 の共有 launcher classifier ベースに置換する #1565/実装: .claude/settings.json の Edit(path) ルールの path anchoring を project root / home directory 相対に正規化する #1573 の状態が変わった場合は Decision Record を更新せず再レビューへ戻る。
- Required Safety Properties の責務分担または検証方法を示せない場合は verdict: go にしない。
Handoff Contract
- Current Objective: 実装:scope_rollup.runをskill_runtime_execのsiblingexactprofileへ統合する #1601 の dependencies 解消後、scope_rollup.run を profile-driven outer executor へ統合する。
- Bounded Current Context: 実装: command_registry.py の scope_rollup.run argv テンプレートに --invocation-id/--requested-at を反映する #1579 CLOSED、PR 実装: 契約実行ラッパーの unauthorized_write_path 誤検知を .guard_shadow_log.jsonl 専用の型付き exact-file ポリシーで解消する #1572 MERGED、main c0048fa、実装:scope_rollup.runをskill_runtime_execのsiblingexactprofileへ統合する #1601 contract、re-review result。
- Open Questions: dependency merge 後の actual diff により fixed base SHA が変わるため、implementation start 前に exact Allowed Paths と profile metadata を再読する。
- Next Action: 実装: scope_rollup.run の GitHub inventory を完全 pagination で取得する #1593、実装: launcher command 共有 parser(argv boundary 保持・cwd/project_root 対応)を抽出し全 consumer の invocation contract を移行する #1595、実装: skill-runtime target predicate を Issue #1595 の共有 launcher classifier ベースに置換する #1565、実装: .claude/settings.json の Edit(path) ルールの path anchoring を project root / home directory 相対に正規化する #1573 を解消して main を再取得し、実装:scope_rollup.runをskill_runtime_execのsiblingexactprofileへ統合する #1601 の fixed base と contract snapshot を更新して実装する。
- Artifact Refs: Issue 実装:scope_rollup.runをskill_runtime_execのsiblingexactprofileへ統合する #1601、docs/dev/hook-boundaries.md、docs/dev/agent-skill-boundaries.md、scope-rollup-runner.md、parse_scope_rollup_run_result.py。
Source
- Anchor review: 調査: scope_rollup.run exact executor を registry SSOT 経路(skill_runtime_exec 相当)へ統合すべきか検討する #1580 (comment)
- Implementation contract: 実装:scope_rollup.runをskill_runtime_execのsiblingexactprofileへ統合する #1601
- Registry prerequisite: feat: scope-rollup registry invocation metadata #1594
- Overlapping runtime resolution: 実装: 契約実行ラッパーの unauthorized_write_path 誤検知を .guard_shadow_log.jsonl 専用の型付き exact-file ポリシーで解消する #1572
Sub-issues
Collapse Sub-issuesSub-issues
Loading 1 sub-issues
Metadata
Metadata
Assignees
Labels
agent/researchHandled by research agentphase/researchResearch phase issuestate/queuedQueued for implementation
Activity
squne121 commentedon Jul 18, 2026
判定
REQUEST_CHANGES —
reframe_in_place。Issue #1580の問題意識、すなわち「
scope_rollup.runだけが別のexact-executorレーンを持つことで、契約ドリフトや二重実装が発生している」という指摘は妥当です。ただし、Issue本文が前提としている「既存のregistry SSOT経路」は、現行実装上は汎用的なregistry → render → validate → dispatchエンジンではありません。設計判断は次のように分けるべきです。
Issue #1580の現行本文: No-Go。前提、比較軸、依存関係、ACを修正する必要がある。
アーキテクチャ判断: 条件付きGo。
推奨方式:
skill_runtime_exec.pyを外側のcanonical admission/supervision entrypointに統合する。ただし、run_scope_rollup_preflight.pyのドメイン固有transaction実装はworkerとして維持する。非推奨方式: scope-rollupのGitHub取得・pagination・一時ファイル・planner/verifier処理を
skill_runtime_exec.pyへ吸収する。禁止すべき方式: 現行
skill_runtime_exec.pyへ単純なif command_id == "scope_rollup.run"分岐だけを追加する。2026年7月18日時点で#1580はopenかつコメント0件で、本文以外の合意形成証跡はありません。別途、registry argv修正用の#1579がopen、
skill_runtime_exec.pyを変更するPR #1572がopen draftです。直前には同ファイルへ1,707行追加したPR #1552がマージされています。したがって「500行超の別PRとの衝突リスク」は抽象的な懸念ではなく、現在進行中の具体的な依存関係です。マージブロッカー
P0-1. 「SSOT」が何を意味するか未定義で、Issueの比較対象が成立していない
command_registry.pyは、自身をoperator/orchestrator向けコマンドのSSOTと定義し、呼び出し側がshell文字列を手組みせずargvを構築する契約を掲げています。一方、現行の
scope_rollup.runエントリはコメント上も実装上も、次の状態です。registry登録は「documentation/SSOT registration」
実際のdispatchは
skill_runtime_exec.pyを通らないlocal_main_branch_guard.pyとskill_runtime_command_policy.pyの専用parserが直接許可するregistry argvは
--issue-numberと--repoまでの旧形状で、現行executorが必須とする--invocation-idと--requested-atを含まないこれはregistryが実効SSOTではなく、非実行カタログになっていることを明記した実装です。
さらに、汎用側の
validate_registry_entry()は対象command-idごとのargvとplaceholderをPythonリテラルで再定義し、write rootを.claude/artifacts/issue-refinement-loop/{active_issue}/へ固定しています。scope_rollup.runはこのexpected-mapに存在せず、allowed_write_roots: []も受理できません。skill_runtime_exec.py自身も汎用dispatcherではありません。CLI形状はpreflight.run系の3profileを前提に分岐し、最終的に実行するscript pathをrun_refinement_preflight.pyへハードコードしています。したがって、現在の契約所有者は少なくとも4つあります。
契約 | 現在の所有箇所 -- | -- argv生成 | command_registry.py exact admission | skill_runtime_command_policy.py 実行監督・write監査 | skill_runtime_exec.py scope-rollup transaction | run_scope_rollup_preflight.py実装前提
実装Issueの起票条件を次のように固定すべきです。
#1579のregistry argv/placeholder契約が確定していること。
PR #1572の扱いが確定し、
skill_runtime_exec.pyの最新base SHAへrebase済みであること。#1552以降のwrite-path policyを前提に再レビューすること。
implementation issueに
base_sha、依存Issue/PR、変更予定pathを記録すること。変更中にbase SHAまたは#1572のstateが変わった場合、design reviewを再実行すること。
最小影響ファイル
実装IssueのAllowed Paths候補は少なくとも以下です。
Control plane
Caller / documentation
Tests
PR #1500の先例からも、registry・policy・executor・両guard・settings・parity testsを横断しない変更は、split-brainを残す可能性が高いと判断できます。
改訂Acceptance Criteria案
Acceptance Criteriaは次の内容に置き換えるべきです。
AC1: 現行call graphと契約所有者を、argv、placeholder、execution class、write root、environment、timeout、result schemaごとに列挙する。
AC2: 「独立維持」「sibling profile統合」「generic engine refactor」の3案を、canonical path数、安全特性、変更面積、衝突リスク、rollback可能性で比較する。
AC3: 判断を上記machine-readable blockで固定し、base SHAと依存Issue/PRのstateを記録する。
AC4: 統合案では次の安全特性をすべて維持する。
repository write root 0件
outer/inner双方のstdout/stderr cap
global deadline
process-tree cancellation
private artifact cleanup
uv lock/sync mutationなし
trusted executable/environment
PR filesを含むpagination完走
producer → executor → worker → consumerのE2E
AC5: cutover後にcanonical invocationが1本だけ存在し、旧direct invocationがClaude/Codex双方でdenyされる。
AC6: implementation issueにexact Allowed Paths、test matrix、dependencies、base SHA、rollback planを記載する。
AC7:
ISSUE_NUMBER_PLACEHOLDERを残さず、verification commandがdecision blockとimplementation issue番号を実際にassertする。必須テスト行列
実装Issueには最低限、次を要求すべきです。
registry renderとpolicy parseのpositive parity
flag欠落、重複、順序変更、
--flag=value、extra flaginvalid repo、invalid invocation ID、calendar上無効なtimestamp
Claude/Codex両guardのallow/deny parity
cutover後の旧direct形状deny
registry/policy mismatch時のfail-close
.claude/artifacts/issue-refinement-loop/<issue>/を含む全repo path書込み拒否uv.lockと.venvが生成・変更されないことouter stdout/stderr cap
outer timeout後にchild process、process group、一時directoryが残らないこと
PR変更ファイル101件以上の完走
server totalと取得件数不一致のfail-close
runner → outer executor → worker → parserの実subprocess E2E
result payload hash、invocation ID、requested-atのend-to-end一致
GitHubコメント用要約
# 判定REQUEST_CHANGES —
reframe_in_place。Issue #1580の問題意識、すなわち「
scope_rollup.runだけが別のexact-executorレーンを持つことで、契約ドリフトや二重実装が発生している」という指摘は妥当です。ただし、Issue本文が前提としている「既存のregistry SSOT経路」は、現行実装上は汎用的なregistry → render → validate → dispatchエンジンではありません。設計判断は次のように分けるべきです。
skill_runtime_exec.pyを外側のcanonical admission/supervision entrypointに統合する。ただし、run_scope_rollup_preflight.pyのドメイン固有transaction実装はworkerとして維持する。skill_runtime_exec.pyへ吸収する。skill_runtime_exec.pyへ単純なif command_id == "scope_rollup.run"分岐だけを追加する。2026年7月18日時点で#1580はopenかつコメント0件で、本文以外の合意形成証跡はありません。別途、registry argv修正用の#1579がopen、
skill_runtime_exec.pyを変更するPR #1572がopen draftです。直前には同ファイルへ1,707行追加したPR #1552がマージされています。したがって「500行超の別PRとの衝突リスク」は抽象的な懸念ではなく、現在進行中の具体的な依存関係です。マージブロッカー
P0-1. 「SSOT」が何を意味するか未定義で、Issueの比較対象が成立していない
command_registry.pyは、自身をoperator/orchestrator向けコマンドのSSOTと定義し、呼び出し側がshell文字列を手組みせずargvを構築する契約を掲げています。一方、現行の
scope_rollup.runエントリはコメント上も実装上も、次の状態です。skill_runtime_exec.pyを通らないlocal_main_branch_guard.pyとskill_runtime_command_policy.pyの専用parserが直接許可する--issue-numberと--repoまでの旧形状で、現行executorが必須とする--invocation-idと--requested-atを含まないこれはregistryが実効SSOTではなく、非実行カタログになっていることを明記した実装です。
さらに、汎用側の
validate_registry_entry()は対象command-idごとのargvとplaceholderをPythonリテラルで再定義し、write rootを.claude/artifacts/issue-refinement-loop/{active_issue}/へ固定しています。scope_rollup.runはこのexpected-mapに存在せず、allowed_write_roots: []も受理できません。skill_runtime_exec.py自身も汎用dispatcherではありません。CLI形状はpreflight.run系の3profileを前提に分岐し、最終的に実行するscript pathをrun_refinement_preflight.pyへハードコードしています。したがって、現在の契約所有者は少なくとも4つあります。
command_registry.pyskill_runtime_command_policy.pyskill_runtime_exec.pyrun_scope_rollup_preflight.pyここで独立policyを単純に「重複だから削除」と扱うのも不適切です。argvを生成するregistryと、argvを独立に認可するpolicyが別実装であることは、防御層としては合理性があります。解消すべきなのは独立検証そのものではなく、どの層が何の正本で、どの不一致をfail-closeするかが定義されていないことです。
IssueのOutcomeは「単一SSOT」ではなく、次に変更すべきです。
P0-2. 現行
skill_runtime_exec.pyへ単純統合すると、no repo writes契約が弱くなるscope_rollup.runのpolicyはallowed_write_roots: []です。つまりrepository内には一切書き込まないprofileです。しかし、現行
skill_runtime_exec.pyのsnapshot処理はregistry entryを読む前に、issue番号から次のpathを無条件に「許可artifact root」として除外します。そのrootと配下はsnapshotへ記録されないため、後段のunauthorized-write検査対象にも入りません。
したがって、現行executorへ
scope_rollup.runの分岐だけを追加すると、と宣言しながら、実際にはissue artifact rootへの書込みを検出しないsplit-brainが発生します。
統合実装では、snapshot除外を
issue_numberから自動生成してはなりません。registry/policy profileから導出し、次の意味を厳密に固定する必要があります。この修正がない統合案は、独立レーン維持より安全性が低下するためNo-Goです。
P0-3. 外側のexecutorを追加すると、既存workerのbounded executionとcleanup保証を破壊し得る
run_scope_rollup_preflight.pyはPR #1560のレビュー後、以下を専用実装しています。stdout/stderr双方のstreaming byte cap
cap超過またはtimeout時のprocess group kill
start_new_session=Trueprivate invocation directory
O_EXCL、O_NOFOLLOW、0600hardlink-based exclusive finalize
成功・失敗・timeoutを問わないcleanup
cleanup失敗のhard failure化
GitHub inventory、planner、verifierの個別timeout
これに対し、現行
skill_runtime_exec.pyのchild実行は次の単純なsubprocess.run()です。outer layerにはstdout/stderr byte capも、process-tree単位のstaged cancellationもありません。
Pythonの
capture_output=Trueはstdout/stderrをPIPEで取得し、communicate()系の読取データはmemoryへbufferされます。Python公式文書も、大きい、または上限のない出力には使用しないよう明記しています。 ([Python documentation]1)より重大なのはtimeout時です。
subprocess.run()は直接のchildをkillしますが、scope workerは内部childを別sessionで起動しています。外側からworkerだけを強制終了した場合、finallyが完走しないghまたはplanner process groupが残るという経路が成立します。
統合には単一のmonotonic deadlineと、少なくとも次の終了protocolが必要です。
registryの
timeout_seconds: 180をそのまま外側timeoutにするだけでは不十分です。worker内部には複数の60秒・30秒timeoutがあり、独立したtimeoutの総和がouter deadlineを超える可能性があります。global deadlineから各処理へ残時間を配分する必要があります。P0-4. bare
uv runはexecutor起動前にrepositoryを変更し得るため、write監査の外側にある現在のcanonical呼出しはbareな次の形です。
uv公式文書によれば、
uv runは対象コマンドを起動する前にprojectのlockとsyncを自動実行します。--lockedはlockfile更新を拒否し、--no-syncはenvironment syncを停止します。project environmentがなければ.venvも作成され、uv.lockもuv invocationによって自動作成・更新され得ます。 ([Astral Docs]2) ([Astral Docs]3)つまり、
という順序になります。executorは自分が起動する前のmutationを検出できません。
同じregistry内には既に、
mutation: Falseとnetwork_effect: local_onlyを実動作と一致させるため、次のlauncher形状を使う先例があります。scope-rollup統合時も、少なくとも次のどちらかを採用すべきです。
uv run --locked --offline --no-syncをouter launcherで使用するさらにnested
uv runを避ける必要があります。outer executorがuv経由で起動され、registry-rendered childも再びuv経由で起動される構造は、lock/sync判断、binary trust、timeout、エラー責任範囲を二重化します。必須の回帰テストは次です。
P0-5. cutover条件がなく、統合後も旧direct laneが残る可能性がある
現在のcaller文書は
run_scope_rollup_preflight.pyを直接実行するよう指示しており、policyにもそのdirect 12-token shape専用parserがあります。統合実装で新しい
skill_runtime_exec.py --command-id scope_rollup.run ...を追加するだけでは、canonical pathが2本になります。必要なのは追加ではなくcutoverです。
PR #1500は、既存exact profileへsibling profileを追加した最も近い先例です。この変更ではregistry、policy、executor、複数guard、settings、文書、Claude/Codex parity testまで更新され、実際に「追加command-idが旧10-token parserからsuffixなしで許可される」というlatent wideningが検出されています。
したがって、#1580の「Allowed Paths拡張範囲」は
skill_runtime_exec.py単体では成立しません。Major findings
P1-1. registryはdataではなく、検証前に実行されるPython codeである
load_registry_entry()はrepository内のcommand_registry.pyをexec_module()で実行してからentryを取得します。skill_runtime_exec.pyも再度同ファイルをimportし、render_commandを呼び出します。したがって、registryを「privileged executorが検証するuntrusted declaration」と位置づけることはできません。検証より先に任意のmodule top-level codeが実行されます。
脅威モデルを次のどちらかに固定すべきです。
Trusted-project model
repository checkout全体を信頼し、registryは実行可能なtrusted configurationと明記する。
Untrusted-declaration model
registryをJSON/TOML/YAML等のdata-only manifestへ分離し、schema検証後に利用する。あるいはmodule hashをpinする。
現行Codex rule文書自身も、hooks/rulesはsecurity boundaryではなく、untrusted project stateやparent runtime overrideで弱められると明記しています。
「SSOT統合によってsecurityが向上する」と主張する場合、このtrust modelを曖昧にしてはなりません。
P1-2.
requested_atはISO 8601の意味検証ではなくregex shape検証に留まるpolicyとworkerの双方は、
requested_atを次のようなregexだけで検証しています。これは例えば月99、時刻99:99:99のようなcalendar上無効な値もshape上は受理します。
registryへplaceholderを追加する#1579では、汎用
string型に落とすべきではありません。現行placeholder validatorはstringについてPythonのstrであることしか確認しません。次のsemantic typeが必要です。
parserは
datetime.fromisoformat()等で実在日時を検証し、必要ならZ形式へcanonicalizeすべきです。P1-3. GitHub CLI環境のdeterminismをもう一段固定できる
専用workerはtrusted search dirsから
ghを解決し、GH_HOST、prompt、PATH-shadowing等を制御しています。これは維持すべき実装です。ただしGitHub CLIは環境変数によってhost、repository、TTY formatting、configuration directory、update notification、telemetry等の挙動が変わります。公式文書上、
ghは24時間に一度version確認を行い得ます。 (GitHub CLI)automation用environment profileでは、明示的に次を固定する方が堅牢です。
HOMEやXDG_CONFIG_HOMEを残してstored credentialを利用するのか、token-only profileにするのかも契約化が必要です。P1-4. 専用workerのGraphQL paginationを汎用executorへ移してはならない
GitHub GraphQL APIのconnectionは、
firstまたはlastを1〜100で指定し、pageInfo.endCursorとhasNextPageを用いて完走する必要があります。 ([GitHub Docs]5)現在のworkerは、
gh pr list --json filesのnested connectionが100件で切れる問題に対し、changedFilesとの差を検出してcursor paginationを行い、不一致ならtransaction全体をfail-closeします。この処理はregistryや汎用executorの責任ではなく、scope-rollup workerのdomain logicです。統合後もworker側に残すべきです。
P1-5. 現行Acceptance Criteriaは判断結果を機械的に検証できない
#1580のVerification Commandsには次の問題があります。
git grep "12c. scope_rollup.run"は、docs sectionの存在しか検証しないclosedByPullRequestsReferencesは実装Issueへのlinkを検証しないISSUE_NUMBER_PLACEHOLDERが残っており、そのまま実行できないresearch issueであっても、結果はmachine-readable blockとして固定すべきです。
推奨設計
採用案: explicit sibling profileによるcontrol-plane統合
重要なのは、outer control planeだけを共通化し、worker data planeは維持することです。
registry entryには少なくとも次のprofile metadataが必要です。
registryはargv生成の正本とし、authorization policyは独立したexpected contractを持ってfail-closeする構造を維持します。「同じregistryが自分自身を認可する」構造にはしません。
比較結果
skill_runtime_exec.pyへ吸収実装前提
実装Issueの起票条件を次のように固定すべきです。
skill_runtime_exec.pyの最新base SHAへrebase済みであること。base_sha、依存Issue/PR、変更予定pathを記録すること。最小影響ファイル
実装IssueのAllowed Paths候補は少なくとも以下です。
Control plane
Caller / documentation
Tests
PR #1500の先例からも、registry・policy・executor・両guard・settings・parity testsを横断しない変更は、split-brainを残す可能性が高いと判断できます。
改訂Acceptance Criteria案
Acceptance Criteriaは次の内容に置き換えるべきです。
AC1: 現行call graphと契約所有者を、argv、placeholder、execution class、write root、environment、timeout、result schemaごとに列挙する。
AC2: 「独立維持」「sibling profile統合」「generic engine refactor」の3案を、canonical path数、安全特性、変更面積、衝突リスク、rollback可能性で比較する。
AC3: 判断を上記machine-readable blockで固定し、base SHAと依存Issue/PRのstateを記録する。
AC4: 統合案では次の安全特性をすべて維持する。
AC5: cutover後にcanonical invocationが1本だけ存在し、旧direct invocationがClaude/Codex双方でdenyされる。
AC6: implementation issueにexact Allowed Paths、test matrix、dependencies、base SHA、rollback planを記載する。
AC7:
ISSUE_NUMBER_PLACEHOLDERを残さず、verification commandがdecision blockとimplementation issue番号を実際にassertする。必須テスト行列
実装Issueには最低限、次を要求すべきです。
--flag=value、extra flag.claude/artifacts/issue-refinement-loop/<issue>/を含む全repo path書込み拒否uv.lockと.venvが生成・変更されないことGitHubコメント用要約