Repository navigation
Description
Machine-Readable Contract
contract_schema_version: v1
issue_kind: implementation
parent_issue: "none"
goal_ref: "preflight.run の production 契約を一切変更せず、anchor comment を指定した issue-refinement-loop preflight 実行を、command registry / exact command policy / privileged executor の正規経路で行えるようにする"
change_kind: code
preflight_scope: implementationParent Issue
none(独立実装。調査元は Refs で示す research issue)
Refs
Refs #1492
Parent Goal Ref
- Goal: Issue 調査: preflight.run command registry に anchor-comment-url の受け口がない #1492(調査)が発見した、anchor comment 指定時の issue-refinement-loop preflight 実行が privileged executor 経由の正規経路を持たない gap を、preflight.run の契約を変更せずに埋める新しい sibling exact profile を追加すること
- Desired Destination: 本 Issue(独立実装、parent tracker なし)
Current Validated Scope
.claude/skills/issue-refinement-loop/scripts/command_registry.pyへのpreflight.run.with_anchorsibling exact profile 追加scripts/agent-guards/skill_runtime_command_policy.pyへの anchor 版 parser/executor 判定関数の追加scripts/agent-guards/skill_runtime_exec.pyの--anchor-comment-url分岐追加.claude/hooks/worktree_scope_guard.py/scripts/agent-guards/local_main_branch_guard.pyへの anchor executor 判定の追加呼び出し.claude/settings.jsonへの最小 exact permission entry 追加- 上記に対応する新規テスト・既存回帰テストの追加
Remaining Parent Gaps
なし(parent tracker が存在しない独立実装のため)
Outcome
.claude/skills/issue-refinement-loop/scripts/command_registry.py / scripts/agent-guards/skill_runtime_command_policy.py / scripts/agent-guards/skill_runtime_exec.py / .claude/hooks/worktree_scope_guard.py / scripts/agent-guards/local_main_branch_guard.py / .claude/settings.json に、preflight.run の既存契約を一切変更しない新しい sibling exact command-id preflight.run.with_anchor が追加され、単一(0..1件)の canonical GitHub issue comment URL を anchor として指定した run_refinement_preflight.py の実行が、正規の privileged executor 経路(scripts/agent-guards/skill_runtime_exec.py)と root checkout の PreToolUse hook(worktree_scope_guard.py / local_main_branch_guard.py)を通じて fail-closed に検証されながら実行できる状態にする。
In Scope
command registry (command_registry.py)
preflight.runエントリ(argv / placeholders / execution_class 等)は一切変更しない。- 新規エントリ
preflight.run.with_anchorを追加する。argv は固定8トークン+2トークン(--anchor-comment-url {anchor_comment_url})の計10トークンとする:uv run python3 .claude/skills/issue-refinement-loop/scripts/run_refinement_preflight.py --issue-number {issue_number} --repo {repo} --anchor-comment-url {anchor_comment_url} placeholdersにanchor_comment_url(新設 typegithub_issue_comment_url, required)を追加する。issue_number/repoはpreflight.runと同じ type を再利用する。execution_class: "exact_skill_runtime_anchor"、required_cwd: "canonical_main_root"、required_branch: "default_branch"、allowed_write_roots: [".claude/artifacts/issue-refinement-loop/{active_issue}/"]、network_effect: "github_read_only"、mutation: Falseとする(preflight.runと同じ安全境界)。_validate_placeholder_value()にgithub_issue_comment_urltype を新設する。canonical shape のみ許可する厳密な正規表現・パース検証(urlparse併用可)で以下を実装する:- scheme は
httpsのみ(http拒否) - host は正確に
github.com(サブドメイン・他ホスト拒否) - userinfo・port を含んではならない
- path は正確に
/{owner}/{repo}/issues/{digits}の形(pull request review comment URL の/pull/は拒否) - fragment は正確に
issuecomment-{digits}(discussion_r{digits}等は拒否) - query string は禁止
- path/fragment に余分な suffix・trailing slash・二重 fragment を含んではならない
- percent-encoding によるcanonical shape偽装(例:
%2e%2e、encoded#等)を拒否する(正規化後の文字列が canonical shape と厳密一致することを要求する。canonical化せず一致させるのではなく、デコード後に構造を再検証すること) - owner/repo/issue番号は正規表現の named group として抽出可能にする(後段の executor 側 context-binding で使用するため)
optionalはこの type には存在しない(preflight.run.with_anchorのanchor_comment_urlは常に required)
- scheme は
exact command policy (skill_runtime_command_policy.py)
SKILL_RUNTIME_EXECUTION_CLASS_ANCHOR = "exact_skill_runtime_anchor"を新設。SKILL_RUNTIME_COMMAND_POLICY_V2["eligible_command_ids"]にpreflight.run.with_anchorエントリを追加(execution_class/required_cwd/required_branch/allowed_write_roots/network_effect: "github_read_only")。ROOT_NO_WORKTREE_ALLOWED_COMMAND_IDSに"preflight.run.with_anchor"を追加し、_ROOT_NO_WORKTREE_POLICY_INVARIANTSにも対応するエントリを追加する(preflight.runと同じ root-no-worktree 許可パターン。既存 issue の refinement loop を root checkout から anchor 指定で実行するユースケース = Issue 調査: preflight.run command registry に anchor-comment-url の受け口がない #1492 の再現手順に対応するため)。parse_exact_skill_runtime_anchor_command(command: str, project_root: str | None = None) -> ExactSkillRuntimeCommand | Noneを新設する。parse_exact_skill_runtime_command()を token-for-token ミラーし、末尾に2トークン(--anchor-comment-urlフラグと値)を追加した12トークン厳密一致とする。以下を fail-closed で拒否する:- トークン数不一致(少ない/多い)
--anchor-comment-url=URL形式(=結合)- flag 順序違い
- duplicate flag(同じフラグが2回出現)
- unknown extra flag
- flag のみで値なし
- newline / NUL / shell metacharacter を含む値(既存
_METACHAR_REを再利用) - 値が
github_issue_comment_urlの canonical shape を満たさない場合 - URL 内の owner/repo が CLI の
--repoと一致しない場合 - URL 内の issue 番号が CLI の
--issue-numberと一致しない場合
is_exact_skill_runtime_anchor_executor_command(command, cwd, project_root, deadline=None) -> boolを新設する。is_exact_skill_runtime_executor_command()と同じ safety boundary(cwd 一致、branch 一致、repo_slug 一致、root-no-worktree 許可判定または active issue worktree 一致)を適用する。_EXPECTED_ARGV_BY_COMMAND/_EXPECTED_PLACEHOLDERS_BY_COMMANDにpreflight.run.with_anchorの期待値を追加し、validate_registry_entry()が既存の汎用ロジックでこの command-id も検証できるようにする(preflight.run/preflight.run.fixtureのロジック変更は不要、テーブル追加のみ)。
executor (skill_runtime_exec.py)
argparseに--anchor-comment-url(optional, defaultNone)を追加する。allow_abbrev=Falseを明示する(現状指定がなければ追加する)。main()の command-id 分岐を拡張する:command_id == "preflight.run.with_anchor"の場合:--anchor-comment-urlが必須(欠落時は exit 2)、--fixtureは禁止(指定時は exit 2)。12トークンのcommand_textを組み立て、is_exact_skill_runtime_anchor_executor_command()で検証する。command_id == "preflight.run"の場合:--anchor-comment-urlは禁止(指定時は exit 2、既存の--fixture禁止チェックと同様のパターン)。command_id == "preflight.run.fixture"の場合:--anchor-comment-urlは禁止(指定時は exit 2)。- その他の command-id: 両方禁止(既存動作を維持)。
render_command()呼び出し時のrender_paramsに、anchor コマンドの場合はanchor_comment_urlを追加する。subprocess.run(..., shell=False)、timeout=entry["timeout_seconds"]、_sanitize_env()、before/after snapshot 監査は既存ロジックをそのまま anchor 分岐にも適用する(変更不要、既存コードパスを共有)。
wrapper (run_refinement_preflight.py)
- 既存の
--anchor-comment-url(dest="anchor_comment_urls",action="append")の CLI 契約・_validate_anchor_comments_batch()の単数/dedupe/ANCHOR_COMMENT_MULTIPLE_UNSUPPORTEDロジックは変更しない。 --anchor-comment-urlのhelp=テキストを、実際の契約(0..1件有効、複数の異なるURLはblocked)に一致させる。「複数指定可能」という誤解を招く表現を除去する。argparse.ArgumentParser(...)の生成箇所にallow_abbrev=Falseを明示する(未設定の場合)。- LOOP_STATE / schema / 複数anchorサポートへの拡張は行わない(現状
LOOP_STATE.anchor_commentという文字列はこのファイルに存在しないことを確認済み。存在しない場合は新規追加もしない。out of scope)。
permission / hooks / parity
.claude/settings.jsonのpermissions.allowに、既存のpreflight.runallow entry と同じ形の exact entry を追加する:wildcard permission(Bash(uv run python3 scripts/agent-guards/skill_runtime_exec.py --command-id preflight.run.with_anchor --issue-number * --repo squne121/loop-protocol --anchor-comment-url *)preflight.run.*等)は追加しない。.claude/hooks/worktree_scope_guard.pyの_is_skill_runtime_executor_command()(行2328付近)に、is_exact_skill_runtime_anchor_executor_command()を追加で呼ぶ分岐を追加する(is_exact_skill_runtime_executor_command()が False の場合に anchor 版を試す、または OR 条件で判定する。import 文の追加も必要)。scripts/agent-guards/local_main_branch_guard.pyの_is_skill_runtime_executor_command()(行940付近)にも同様にis_exact_skill_runtime_anchor_executor_command()を追加で呼ぶ。import 文の追加も必要。tests/codex/test_local_main_branch_guard.pyに Claude/Codex parity test(anchor profile の positive/negative)を追加する。- production profile(
preflight.run.with_anchor)と test-only profile(preflight.run.fixtureおよび必要なら新設する test-only fixture 相当)を混同しないこと。 .claude/skills/issue-refinement-loop/SKILL.mdの呼び出し例に、anchor 指定時の呼び出し例(canonical executor 経由のpreflight.run.with_anchor呼び出し)を追記する。docs/dev/agent-skill-boundaries.mdの Privileged Skill Runtime Command Boundary 節に、preflight.run.with_anchorの追加を反映する(既存のpreflight.run/preflight.run.fixture記述と並記)。
CI 決定論的検証(real executor chain)
- Issue 実装: root preflight の bytecode cache 誤検知を防止する #1439 / PR fix: preflight provenance の pyc 生成を防止する #1444 の前例(
preflight.run.fixture)に倣い、CI で real executor -> real preflight -> real planner の chain を anchor 付きで決定論的に検証する必要があるかどうかを実装時に判断すること。 run_refinement_preflight.pyの--fixtureモードは、fixture JSON 内のanchor_comment_urlsキーを既に読み取れる(fixture_anchor_urls = fixture_data.get("anchor_comment_urls", anchor_comment_urls))。したがってpreflight.run.fixture(--fixtureのみ、--anchor-comment-urlは受け付けない)を使い、fixture JSON に anchor URL を埋め込む形で、wrapper レベルの anchor 業務ロジック(構造検証・issue 内存在確認相当)を決定論的に検証できる可能性がある。まずこの既存 fixture 経路で十分かを検討すること。- それでも
preflight.run.with_anchor自体の exact-argv・executor 層(--anchor-comment-urlを CLI から受け取り registry 経由で子プロセスに渡す経路)を real subprocess chain で決定論的に検証する必要がある場合に限り、test-only sibling profilepreflight.run.with_anchor.fixture(--anchor-comment-urlと--fixtureの両方を受け取る、12+2=14トークンの exact profile)を追加してよい。追加する場合は、その必要性(既存preflight.run.fixtureだけでは検証できない具体的なギャップ)を PR 本文に明記すること。productionpreflight.run/preflight.run.with_anchorの契約は緩めないこと。 - 上記のいずれの方式でも、実行不能な場合(環境依存で real live GitHub 呼び出しが必要な場合)は、read-only live smoke(Issue 調査: preflight.run command registry に anchor-comment-url の受け口がない #1492 の owner review comment を anchor に指定した canonical executor 実行)を追加証跡として実行してよいが、CI required gate にはしない。fixture-based test を正本とする。
Out of Scope
preflight.run本体の argv・placeholders・execution_class・timeout_seconds の変更preflight.run.fixture本体の変更(新規 fixture profile を追加する場合でも、既存preflight.run.fixtureの定義は変更しない)render_command()/parse_exact_skill_runtime_command()の汎用化・variadic placeholder 対応・registry V2 導入validate_shell_string()の変更run_refinement_preflight.pyの--anchor-comment-urlの cardinality を複数対応へ拡張すること、LOOP_STATE/ schema への anchor 複数化拡張preflight.run以外の既存 command-id(plan.run/decide.run/gh.issue.*/uv.pytest/pnpm.*)への変更- wildcard permission の追加
- security hook の disable / bypass
Cardinality と Duplicate Policy
preflight.run.with_anchorの--anchor-comment-urlは常に 必須の単一スカラー(0..1件のうち1件を選択する場合の専用経路。0件の場合は既存のpreflight.runを使う)。- registry の argv テンプレートに
--anchor-comment-urlフラグは1回のみ出現する固定 shape のため、CLI・executor 層では「複数指定」という入力形状自体が構文的に成立しない。 - wrapper (
run_refinement_preflight.py) 側はpreflight.run.with_anchorから呼ばれた場合、常に単一URL・単一--anchor-comment-url引数を受け取るため、既存の_validate_anchor_comments_batch()はsorted_urls長さ1で通過する(既存ロジック不変で両立する)。 - 同一URLの重複指定は、そもそも
preflight.run.with_anchorの12トークン厳密一致では成立しない(duplicate flag は unknown/deny 対象)。
URL Canonicalization / Context-Binding Contract
- registry:
github_issue_comment_urltype の構文検証(canonical shape のみ許可) - executor: URL 内 owner/repo と issue 番号を CLI の
--repo/--issue-numberに一致束縛 - wrapper: 既存の GitHub API(または
--fixture)ベースの実在性・所属確認(変更なし)
Consumer Inventory
.claude/skills/issue-refinement-loop/scripts/command_registry.pyscripts/agent-guards/skill_runtime_command_policy.pyscripts/agent-guards/skill_runtime_exec.py.claude/hooks/worktree_scope_guard.py.claude/hooks/tests/test_worktree_scope_guard.py.claude/hooks/tests/test_local_main_branch_guard.pyscripts/agent-guards/local_main_branch_guard.pyscripts/agent-guards/tests/test_local_main_branch_guard.pytests/codex/test_local_main_branch_guard.py.claude/settings.json.claude/skills/issue-refinement-loop/scripts/run_refinement_preflight.py.claude/skills/issue-refinement-loop/SKILL.mddocs/dev/agent-skill-boundaries.md.claude/skills/issue-refinement-loop/tests/test_command_registry.py.claude/skills/issue-refinement-loop/tests/test_command_registry_security.py.claude/skills/issue-refinement-loop/tests/test_anchor_comment_multiple_urls.pyscripts/agent-guards/tests/test_skill_runtime_preflight_no_worktree.pyscripts/agent-guards/tests/test_skill_runtime_preflight_bytecode_cache.pyscripts/agent-guards/tests/test_skill_runtime_exec_unauthorized_write_path.pyscripts/agent-guards/tests/test_skill_runtime_exec_session_manifest_lifecycle.py
Allowed Paths
.claude/skills/issue-refinement-loop/scripts/command_registry.py.claude/skills/issue-refinement-loop/scripts/run_refinement_preflight.py.claude/skills/issue-refinement-loop/tests/test_command_registry.py.claude/skills/issue-refinement-loop/tests/test_command_registry_security.py.claude/skills/issue-refinement-loop/tests/**(anchor profile 用の新規テストファイル追加を含む).claude/skills/issue-refinement-loop/SKILL.mdscripts/agent-guards/skill_runtime_command_policy.pyscripts/agent-guards/skill_runtime_exec.pyscripts/agent-guards/tests/**(anchor profile 用の新規テストファイル追加を含む).claude/hooks/worktree_scope_guard.py.claude/hooks/tests/test_worktree_scope_guard.py.claude/hooks/tests/test_local_main_branch_guard.pyscripts/agent-guards/local_main_branch_guard.pytests/codex/test_local_main_branch_guard.py.claude/settings.jsondocs/dev/agent-skill-boundaries.md
Positive / Negative Test Matrix
以下を自動テストで固定する(fail-closed、split-brain禁止、Claude/Codex parity):
| # | ケース | 期待結果 |
|---|---|---|
| 1 | anchorなし + preflight.run |
allow(既存動作不変) |
| 2 | 正しいanchor1件 + preflight.run.with_anchor |
allow |
| 3 | preflight.run.with_anchor でanchor欠落 |
deny |
| 4 | preflight.run にanchor追加 |
deny |
| 5 | 異なるanchor2件(preflight.run.with_anchor に2回 --anchor-comment-url) |
deny |
| 6 | 同一URLの重複(12トークン厳密一致では成立しないため構文的にdeny、または明示的canonical dedupe動作を記載) | deny |
| 7 | 別repositoryのURL | deny |
| 8 | 別IssueのURL | deny |
| 9 | pull request review comment URL(/pull/.../files#r...) |
deny |
| 10 | discussion_r形式fragment |
deny |
| 11 | query付きURL(?tab=...等) |
deny |
| 12 | 余分なfragment/suffix/trailing slash | deny |
| 13 | userinfo、port、非GitHub host、HTTP | deny |
| 14 | percent-encoding等でcanonical shapeを偽装 | deny |
| 15 | --anchor-comment-url=URL(=結合) |
deny |
| 16 | option abbreviation(--anchor-comment-u 等) |
deny |
| 17 | flagのみで値なし | deny |
| 18 | unknown extra flag | deny |
| 19 | duplicate flag | deny |
| 20 | flag順序変更 | deny |
| 21 | newline、NUL、shell metacharacter | deny |
| 22 | repo/issue context mismatch(URL内owner/repo/issueとCLI引数の不一致) | deny |
| 23 | guard allow・executor deny の split-brain | test failure として検出 |
| 24 | Claude allow・Codex deny の parity不一致 | test failure として検出 |
Verification Commands
# registry sibling profile added without modifying preflight.run argv/placeholders (new contract test, not yet created)
# AC1
$ uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_preflight_run_with_anchor.py::test_registry_sibling_profile_preserves_preflight_run
# github_issue_comment_url placeholder type rejects Matrix #9-#14 URL negatives
# AC2
$ uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_preflight_run_with_anchor.py::test_github_issue_comment_url_type_rejects_negative_matrix
# parse_exact_skill_runtime_anchor_command rejects Matrix #3, #5, #6, #15-#22
# AC3
$ uv run --locked pytest scripts/agent-guards/tests/test_skill_runtime_command_policy_anchor.py::test_parse_exact_anchor_command_rejects_negative_matrix
# executor reaches real subprocess for Matrix #2, and Matrix #4 (anchor on preflight.run) exits 2
# AC4
$ uv run --locked pytest scripts/agent-guards/tests/test_skill_runtime_exec_anchor.py::test_executor_reaches_subprocess_and_rejects_anchor_on_preflight_run
# worktree_scope_guard and local_main_branch_guard allow Matrix #2 and deny Matrix #3-#22 with no split-brain
# AC5
$ uv run --locked pytest .claude/hooks/tests/test_worktree_scope_guard_anchor.py::test_hook_matrix_allow_deny_no_split_brain
# Claude and Codex parity for anchor profile
# AC6
$ uv run --locked pytest tests/codex/test_local_main_branch_guard_anchor.py::test_claude_codex_parity_anchor_profile
# settings.json has the new exact permission entry (baseline: not yet present)
# AC7
$ rg -c "preflight.run.with_anchor" .claude/settings.json
# anchor help text updated, existing multiple-url logic unchanged
# AC8
$ uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_anchor_comment_multiple_urls.py
# real executor chain positive and negative smoke via subprocess
# AC9
$ uv run --locked pytest scripts/agent-guards/tests/test_skill_runtime_exec_anchor.py -k "real_subprocess"
# standard quality gates pass
# AC10
$ pnpm typecheck
$ pnpm lint
$ pnpm test
$ pnpm build
# full Positive and Negative Test Matrix (24 items) covered across the new test files
# AC11
$ uv run --locked pytest scripts/agent-guards/tests/test_skill_runtime_command_policy_anchor.py .claude/hooks/tests/test_worktree_scope_guard_anchor.py tests/codex/test_local_main_branch_guard_anchor.py -vAcceptance Criteria
- AC1:
command_registry.pyにpreflight.run.with_anchorが sibling exact profile として追加され、preflight.runの既存 argv/placeholders/execution_class が一切変更されていないことを diff で確認できる - AC2:
github_issue_comment_urlplaceholder type が新設され、Positive/Negative Test Matrix の Hooks(OS レベル防御)を整備し決定論的ガードレールを構築する #9-gemini-cli-headless-delegation の導入と改善 #14 相当のURL異常系を registry 単体テストレベルで拒否する - AC3:
skill_runtime_command_policy.pyにparse_exact_skill_runtime_anchor_command()/is_exact_skill_runtime_anchor_executor_command()が追加され、Positive/Negative Test Matrix の AI運用憲法と最小仕様正本を整備する #3, Claude Code ガードレールを .claude に実装する #5, docs: Issue #3 のドキュメント基盤と運用ルールを整備 #6, feat: per-directory CLAUDE.md + ssot-discovery skill 新設 #15-refactor: 補助系 (codebase-investigator) を LOOP_PROTOCOL 用に適合 (phase C-5) #22 を parser レベルで拒否する - AC4:
skill_runtime_exec.pyがpreflight.run.with_anchorを受理し、Matrix movement + projectile の最小仕様を固定する #2 が実際の subprocess 実行(render_command()->subprocess.run(shell=False))まで到達することを確認する。Matrix Issue駆動実装 skill と workflow 文書を整備する #4(preflight.runにanchor追加)が exit 2 になることを確認する - AC5:
.claude/hooks/worktree_scope_guard.pyとscripts/agent-guards/local_main_branch_guard.pyの両方が、実 PreToolUse hook 経路(stdin JSON、実 git worktree)で Matrix movement + projectile の最小仕様を固定する #2 を allow、Matrix AI運用憲法と最小仕様正本を整備する #3-refactor: 補助系 (codebase-investigator) を LOOP_PROTOCOL 用に適合 (phase C-5) #22 の該当ケースを deny する。Matrix docs: phase D 統合検証 - workflow.md SSOT 新設 + 不要アセット撤去 #23(guard allow・executor deny の split-brain)が存在しないことをテストで検証する - AC6:
tests/codex/test_local_main_branch_guard.pyに Claude/Codex parity test が追加され、Matrix chore: settings.json の deny ルールをツール接頭辞形式に修正 #24(parity不一致)が存在しないことを検証する - AC7:
.claude/settings.jsonにpreflight.run.with_anchor用の最小 exact permission entry が追加され、wildcard permission が追加されていないことを diff で確認できる - AC8:
run_refinement_preflight.pyの--anchor-comment-urlhelp text が実際の 0..1 件契約を正確に説明する内容に修正されている。既存の_validate_anchor_comments_batch()ロジック・ANCHOR_COMMENT_MULTIPLE_UNSUPPORTED挙動は変更されていない(test_anchor_comment_multiple_urls.pyが無改変で PASS する) - AC9: real executor chain(少なくとも1つの positive case、複数の negative case)が実際に起動され検証されている。CI では決定論的な fixture ベースの検証を正本とし、live smoke を行う場合は required gate にしない
- AC10:
pnpm typecheck/pnpm lint/pnpm test/pnpm buildが PASS する - AC11: Positive/Negative Test Matrix の全24項目が、いずれかの自動テストファイルで検証されている(テスト関数名とファイルパスを PR 本文に列挙する)
Runtime Verification Applicability
runtime_verification_applicability:
decision: immediate
reason: "一時 Git repository 上で real executor・real preflight(fixtureモード)を実行し、exact-argv 拒否・context-binding・split-brain 不在を即時検証できる"
applicable_acs:
- AC4
- AC5
- AC9
execution_environment: "WSL2 Ubuntu 24.04、uv、pytest、Git、ローカル一時 repository"
skip_conditions: "live GitHub API access がサンドボックスで利用不可な場合のみ fixture-based test に置き換える。fixture 経路も利用不可の場合は human_judgment に倒す"
fallback_policy: "live GitHub 呼び出しが必要な検証は fixture ベースの決定論的テストで代替し、CI required gate にしない"
artifact_requirements: "pytest -rA --show-capture=all の出力ログを PR 本文または comment に添付する"Stop Conditions
- Allowed Paths 外の変更が必要と判明した場合
- In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
- 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
- 後続 Phase / 別スコープへの波及が判明した場合
- nested SubAgent delegation が必要になった場合
- 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
Required Skills
- Python 3.12(argparse / urllib.parse / dataclass 中心の CLI・parser 実装)
- pytest(subprocess-based real executor 検証、fixture 設計)
- shell scripting(bash、PreToolUse hook の stdin JSON 契約)
Required Design References
- docs/dev/agent-skill-boundaries.md(Privileged Skill Runtime Command Boundary 節)
- Issue 調査: preflight.run command registry に anchor-comment-url の受け口がない #1492(本 Issue の調査元。root checkout での anchor comment 指定 preflight 実行が正規経路を持たない gap の再現手順)
Delivery Rule
- 1 Issue = 1 PR
- worktree 命名:
worktree-issue-{N}-preflight-anchor-exact-profile - Draft PR を既定とする
Activity
squne121 commentedon Jul 13, 2026
Contract Review Result
squne121 commentedon Jul 13, 2026
implement-issue: 実装完了
.claude/worktrees/issue-1498-preflight-anchor-exact-profileworktree-issue-1498-preflight-anchor-exact-profilefeat: preflight.run.with_anchor sibling exact profile を追加する (#1500)