Repository navigation
Description
Machine-Readable Contract
contract_schema_version: v1
issue_kind: research
parent_issue: "none"
goal_ref: "root canonical preflight.run 経路(決定論的 skill runtime executor 経由)で anchor comment を指定した issue-refinement-loop 実行を、command registry の正規 placeholder を通じて行えるようにする"
change_kind: research-onlyParent Issue
none(単独改善)
Outcome
.claude/skills/issue-refinement-loop/scripts/command_registry.py の ISSUE_REFINEMENT_COMMAND_REGISTRY_V1["preflight.run"] に anchor_comment_url(複数指定可能)を安全に受け渡す方式の調査結果が本 Issue 本文に記載され、採用方針(registry 側 placeholder スキーマの拡張方法、repeatable 引数の表現方法、既存 render_command() / validate_shell_string() 契約との整合性)を確定した implementation Issue が起票され、本 Issue がそれを link している状態。
In Scope
command_registry.pyのpreflight.runエントリのplaceholdersにanchor_comment_url(0 個以上・複数指定可能)を追加する場合の設計選択肢の調査(例:argvテンプレートでの repeatable placeholder 表現方法、positional/variadic型を_validate_placeholder_valueにどう追加するか)render_command()が現在 1 placeholder = 1 argv token 前提で書かれている実装(for token in entry["argv"]の単純トークン置換)が、--anchor-comment-url URL1 --anchor-comment-url URL2 ...のような repeatable フラグをどう扱えるかの技術調査run_refinement_preflight.py側の--anchor-comment-url(action="append",dest="anchor_comment_urls")の既存契約を変更せずに registry 側だけで解決できるか、両方の変更が必要かの判定- 既存の
preflight.run呼び出し元(root 経路 / 決定論的 skill runtime executor 経由)が--anchor-comment-urlを渡せないことによる実害範囲の特定(他の privileged command でも同様の repeatable-placeholder gap があるかの横断確認を含む)
Out of Scope
command_registry.py/run_refinement_preflight.pyの実コード変更(実装は本調査結果をもとに起票する implementation Issue で行う)- 決定論的 skill runtime executor(scripts/agent-guards/ 配下)の unauthorized-write 誤検知(bytecode cache 問題)。これは既存 Issue 実装: root preflight の bytecode cache 誤検知を防止する #1439(実装: root preflight の bytecode cache 誤検知を防止する)が扱う別 concern であり、本 Issue では扱わない
preflight.run以外の command の new placeholder 追加(横断確認は行うが、変更は行わない)
Acceptance Criteria
- AC1:
command_registry.pyのpreflight.runplaceholders に repeatable なanchor_comment_urlを追加する場合の実装方式(案A/案B等)が比較され、採用案が本 Issue 本文に記載されている - AC2: 採用案を実装する implementation Issue が起票され、本 Issue がそれを link している
- AC3: 本 Issue は close 可能、もしくは追加調査要件が明示されている
Verification Commands
# AC1
$ gh issue view THIS_ISSUE_NUMBER --json body# AC2
$ gh issue view NEW_IMPLEMENTATION_ISSUE_NUMBER# AC3
$ gh issue view THIS_ISSUE_NUMBER --json state,bodyAllowed Paths
- 読み取り専用。リポジトリ変更なし(既定)
Stop Conditions
- Outcome / Scope / AC が検索可能な形で記載されていない場合は即停止
- Allowed Paths 外への書き込みを試みた場合は即停止
- 権限不足(permission denied)により操作が完了できない場合は即停止
- 成果物の書き込みに失敗した場合(I/O エラー等)は即停止
Handoff Contract
Current ObjectiveBounded Current ContextOpen QuestionsNext ActionArtifact Refs
Background
Issue #1386 に対して issue-refinement-loop を実行しようとした際、以下の再現手順で判明した:
uv run python3 scripts/agent-guards/skill_runtime_exec.py --command-id preflight.run --issue-number 1386 --repo squne121/loop-protocol上記コマンドに anchor comment(人間の Decision コメント等)を指定したい場合、.claude/skills/issue-refinement-loop/scripts/command_registry.py の REGISTRY["preflight.run"]["placeholders"] は issue_number と repo のみを許可しており、--anchor-comment-url を追加パラメータとして渡すと render_command() の Extra params not defined for command 「preflight.run」 で拒否される。
一方、run_refinement_preflight.py 自体は --anchor-comment-url(dest="anchor_comment_urls", action="append")を既にサポートしている(.claude/skills/issue-refinement-loop/scripts/run_refinement_preflight.py:2524-2529)。つまり実行対象スクリプトは anchor comment 指定に対応済みだが、skill_runtime_exec.py が要求する正規の command registry 経由の呼び出し経路には、その受け口が存在しない。
なお、同じ調査セッションで scripts/agent-guards/skill_runtime_exec.py の bytecode cache 誤検知(unauthorized_write_path, target=.claude/skills/issue-refinement-loop/scripts/__pycache__/plan_refinement_loop.cpython-312.pyc)も観測されたが、これは既存 OPEN Issue #1439 が同一 concern を扱っているため本 Issue のスコープには含めない。
Notes for Reviewer
render_command()は現状 1 placeholder = 1 argv token の単純置換実装であり、repeatable な--anchor-comment-url URLを複数回追加する機能は registry スキーマに存在しない。調査時に variadic placeholder 表現の要否を判断すること。- 横断確認の結果、他の command にも同様の repeatable-placeholder gap があった場合は、本 Issue の Out of Scope 通り実装はせず、調査結果として記載するに留める。
調査結果・採用判断
現行契約の再確認
render_command("preflight.run", {"issue_number": ..., "repo": ..., "anchor_comment_url": ...})はcommand_registry.pyのrender_command()のextra_paramsチェックによりValueError: Extra params not defined for command 'preflight.run': ['anchor_comment_url']で拒否される(.claude/skills/issue-refinement-loop/scripts/command_registry.pyのrender_command()実装、placeholdersにanchor_comment_urlが存在しないため)。scripts/agent-guards/skill_runtime_exec.pyのargparse.ArgumentParserは--command-id/--issue-number/--repo/--fixtureのみを定義しており、--anchor-comment-urlは未定義引数のためargparseレベルで即座に拒否される。加えてskill_runtime_command_policy.pyのparse_exact_skill_runtime_command()はトークン数10個への厳密一致(uv run python3 <exec> --command-id <id> --issue-number <n> --repo <repo>)であり、--anchor-comment-urlを追加すると即座にトークン数不一致でNoneを返し拒否される。run_refinement_preflight.pyに異なる anchor URL を2件(--anchor-comment-url URL1 --anchor-comment-url URL2)渡すと、_validate_anchor_comments_batch()が dedupe 後len(sorted_urls) > 1でBLOCKER_ANCHOR_COMMENT_MULTIPLE_UNSUPPORTEDを返しblockedになる(.claude/skills/issue-refinement-loop/tests/test_anchor_comment_multiple_urls.py::test_multiple_anchor_comment_urls_are_blocked_fail_closedで固定済み)。同一URLの重複投入はこの dedupe ロジックにより単一URL扱いへ収束する(duplicate と distinct-multiple は別区分)。command_registry.pyのpreflight.runエントリのargv/placeholders(issue_number,repoの2つのみ)は PR fix: preflight provenance の pyc 生成を防止する #1444(Issue 実装: root preflight の bytecode cache 誤検知を防止する #1439 Scope Delta 2)マージ後も一切変更されていない。同 PR で追加されたpreflight.run.fixtureはpreflight.runを汎用化・拡張したものではなく、独立した sibling exact profile(別execution_class: exact_skill_runtime_fixture、別 argv テンプレート、skill_runtime_command_policy.pyに別関数parse_exact_skill_runtime_fixture_command/is_exact_skill_runtime_fixture_executor_command)として実装されている。この設計を今回のanchor_comment_url対応の前例として採用する。
cardinality と duplicate policy
- 現行
run_refinement_preflight.pyの--anchor-comment-url(action="append")は複数回指定を argparse レベルでは許容するが、業務契約としては 0..1 件のみが有効であり、2件以上の異なる URL は fail-closed で拒否される(ANCHOR_COMMENT_MULTIPLE_UNSUPPORTED)。action="append"は実装上の受け口が repeatable であることを意味するだけで、業務カーディナリティが複数を意味するものではない。 - 同一 URL の重複指定は
_validate_anchor_comments_batch()のseen_urlsdedupe により単一 URL として扱われる(後方互換のため既存動作を維持)。 - 本 Issue が新規追加する
command_registry.py/skill_runtime_command_policy.pyのpreflight.run.with_anchorexact profile は、--anchor-comment-urlを required scalar(1個のみ、repeatable でない)として固定 argv に埋め込む。これにより新しい実行経路ではそもそも複数指定という入力形状自体が構文的に成立しない(cardinality 0..1 を argv shape レベルで強制する)。
実装方式の比較
| 方式 | 概要 | 判定 |
|---|---|---|
A. dedicated exact profile(preflight.run.with_anchor) |
preflight.run は無変更のまま、anchor_comment_url を扱う新しい sibling exact command-id を registry / policy / executor に追加する。PR #1444 の preflight.run.fixture と同型の設計。 |
採用 |
| B. registry V2 optional-segment / variadic placeholder 汎用化 | render_command() の argv テンプレートに optional token 除去や repeatable placeholder 展開を一般化する。 |
不採用。render_command() は他の多数の command(plan.run 等)と契約を共有する共通関数であり、汎用化は攻撃面と回帰リスクを全 command に波及させる。Issue #1439 の Stop Conditions でも production preflight.run の固定契約変更・registry の汎用化は明示的に禁止されており、同じ理由でこの Issue でも production 契約を変更しない dedicated profile 方式を踏襲する。 |
採用案は A. dedicated exact profile。registry のみの修正では、skill_runtime_exec.py の exact-match executor 層(parse_exact_skill_runtime_command() のトークン数固定チェック)を通過できないため、registry・policy・executor の3層すべてに sibling entry を追加する必要がある。
validate_shell_string() について
validate_shell_string() は untrusted shell 文字列を検査する関数であり、registry-generated argv(render_command() の戻り値である list[str])の production path では使用されていない(skill_runtime_exec.py は subprocess.run(child_argv, shell=False, ...) で list[str] を直接実行する)。今回の変更の主要な対象ではなく、変更しない。
URL 検証の責務分担
| 層 | 責務 |
|---|---|
registry(command_registry.py) |
canonical GitHub issue comment URL の構文検証(新設する github_issue_comment_url placeholder type)。https://github.com/{owner}/{repo}/issues/{number}#issuecomment-{id} の厳密な shape のみを許可し、query / extra fragment / trailing slash / userinfo / port / 非 https / 非 github.com host / pull request review comment URL / discussion_r 形式を拒否する。 |
executor(skill_runtime_command_policy.py の新設パーサ) |
URL 内の owner/repo と issue 番号を、CLI 引数の --repo / --issue-number に束縛(一致検証)する。不一致は fail-closed で拒否する。 |
wrapper(run_refinement_preflight.py、既存) |
GitHub API(または --fixture 経由のオフライン fixture)で実際にそのコメントが対象 issue に存在し、issue に属していることを再検証する(既存の _validate_anchor_comment_url / ANCHOR_NOT_IN_ISSUE 相当のロジックを維持)。 |
既存前例
Issue #1439 / PR #1444(マージ済み)は、production preflight.run の固定契約を一切変更せず、test-only sibling exact profile preflight.run.fixture を command_registry.py / skill_runtime_command_policy.py / skill_runtime_exec.py の3層に追加することで、real executor → real preflight → real planner の subprocess chain を deterministic に検証した。本 Issue が採用する preflight.run.with_anchor(production)の設計は、この前例の構造(sibling profile、production 契約不変、専用 parser/validator 関数)を踏襲する。
consumer inventory
.claude/skills/issue-refinement-loop/scripts/command_registry.py(producer:REGISTRY,render_command())scripts/agent-guards/skill_runtime_command_policy.py(SKILL_RUNTIME_COMMAND_POLICY_V2["eligible_command_ids"],parse_exact_skill_runtime_command(),_EXPECTED_ARGV_BY_COMMAND,_EXPECTED_PLACEHOLDERS_BY_COMMAND,validate_registry_entry())scripts/agent-guards/skill_runtime_exec.py(main()の command-id 分岐、_validate_runtime_context()).claude/hooks/worktree_scope_guard.py(_is_skill_runtime_executor_command()。現状is_exact_skill_runtime_executor_commandのみを呼び、is_exact_skill_runtime_fixture_executor_commandは呼んでいない=test-only profile はそもそも hook allow 対象外。production の anchor profile はこの hook にも新規許可を追加する必要がある)scripts/agent-guards/local_main_branch_guard.py(_is_skill_runtime_executor_command()。同様に production executor command のみを consume。anchor profile 用の許可を同様に追加する必要がある)tests/codex/test_local_main_branch_guard.py(Claude/Codex parity test).claude/settings.json(permissions.allowの exact Bash allowlist。現在preflight.runのみ許可されており、preflight.run.fixtureは許可されていない=test-only なので agent の直接呼び出し経路には現れない。anchor profile は agent が直接呼ぶ想定のため新規 allow entry が必要).claude/skills/issue-refinement-loop/SKILL.md(呼び出し例のドキュメント).claude/skills/issue-refinement-loop/scripts/run_refinement_preflight.py(既存の--anchor-comment-urlCLI 引数・単数契約は維持するが、help text の「複数指定可能」という誤解を招く表現を修正する)
Implementation Issue
採用設計を実装する implementation Issue として Issue #1498(実装: preflight.run に anchor comment 対応の sibling exact profile (preflight.run.with_anchor) を追加する, #1498 )を起票し、本 Issue にリンクした。
Acceptance Criteria の状態
AC1(実装方式比較・採用案記載)、AC2(implementation Issue 起票・リンク)は本更新で満たす。AC3(close 可能)は implementation Issue 起票・リンク後に満たされる。
Activity
squne121 commentedon Jul 13, 2026
判定: REQUEST_CHANGES
Issue #1492 が発見した「canonical
preflight.run経路から anchor comment を渡せない」という不具合自体は正しいです。ただし、現在の Issue は次の二点を誤認しています。run_refinement_preflight.pyは複数 anchor を実質的にはサポートしていない修正対象は command registry だけではなく、privileged exact executor の認可境界全体
このまま implementation Issue を起票すると、既存の単数-anchor契約を意図せず破壊するか、registryだけ更新しても実際には呼び出せない実装になります。なお、Issue #1492 自体にコメントはありません。
P0-1:
action="append"を「複数anchor対応」と解釈している確かにCLI parserは
action="append"で、同じオプションを複数回受け取ってリストへ格納します。Python公式でも、appendは各出現値をリストへ追加する構文上の収集機能です。アプリケーションが複数値を受理することまでは保証しません。 (Python documentation)現行実装は、重複排除・ソート後に異なるURLが2件以上あれば、即座に
ANCHOR_COMMENT_MULTIPLE_UNSUPPORTEDでblockします。専用回帰テストも、2件のanchor URLを必ず拒否する契約を固定しています。さらに、下流契約もすべて単数です。
SKILL.mdの入力は単数anchor_comment_urlLOOP_STATEはanchor_commentオブジェクト1件anchor handling文書も単数snapshot、単数classificationを前提
これは偶発的な制限ではありません。PR #1043で「複数URLはfail-closed」という契約が意図的に導入されています。
修正要求: Issue #1492は最初にcardinalityを確定してください。
推奨: 0..1件を維持
0..N件を本当に実装する場合: registry改善ではなく、wrapper、LOOP_STATE、schema、planner input、artifact、分類処理を変更するbreaking contract Issueへ分離
「複数指定可能」という記述は、現行契約を維持するなら削除が必要です。
P0-2: registryだけを変更してもexact executorから値が到達しない
現在の
preflight.runregistry entryは、issue_numberとrepoの2placeholderしか持ちません。しかし、より重大なのはregistryの外側です。
skill_runtime_exec.pyは以下の3オプションしか受け付けません。さらに
render_command()へ渡すparamsもissue_numberとrepoだけです。認可ポリシー側も、
token数を厳密に10個へ固定
flag位置を固定
dataclassにanchor fieldがない
registry argv templateを完全一致で固定
placeholder集合を完全一致で固定
しています。
Claude Codeのpermission ruleも、
--repo squne121/loop-protocolで終了する現在の形だけをallowしています。したがって、正しい判定は次です。
最低限のconsumer inventoryは以下です。
実際にexecutor参照はこれらのsettings、docs、Claude/Codex guard testsへ広がっています。
P0-3:
required: falseを足すだけではoptional flagにならない現在のrendererは、registryの各template tokenを必ず1個の出力tokenへ変換します。値が与えられていないoptional placeholderを削除する処理はありません。
そのため、例えば次のように追加しても、
anchor未指定時には、次のliteral tokenが残ります。
未解決placeholderの検出も
required: trueのwhole-tokenしかerrorにしないため、optional placeholderはそのまま返ります。既存の
decide.runにも、optionalと宣言されながらargv内に常駐するmax_iterations、phase_state_fileがあり、同じ潜在問題を抱えています。つまり必要なのは単なる
variadic型追加ではありません。optionalな flag + valueグループ
反復する flag + valueグループ
未指定時のグループ全体削除
cardinality
duplicate policy
canonical ordering
placeholder 1件から複数argv tokenを生成する規則
を表現するschemaが必要です。
この一般化を行うなら、
ISSUE_REFINEMENT_COMMAND_REGISTRY_V1の意味変更として扱い、V2 schemaへ更新すべきです。現在のテストはregistry templateをlist[str]として固定しています。P0-4:
validate_shell_string()は主要な設計対象ではないIssue #1492は
validate_shell_string()との整合性を調査対象に含めていますが、registry-generated argvはproductionでこの関数を通りません。現行テストにも、registry argvは
subprocess(..., shell=False)へ直接渡され、validate_shell_string()はstring入力用であると明記されています。Python公式も、外部コマンドには文字列ではなくargument sequenceを渡す方式を推奨しており、
shellの既定値はFalseです。(Python documentation)したがって重点はshell文字列検査ではなく、以下です。
argvの固定形
exact command class
context binding
URLの意味検証
unknown・duplicate・省略flagのfail-closed
validate_shell_string()をvariadic placeholder対応へ拡張する必要はありません。P0-5: 既存の
urlplaceholder型は認可境界として弱すぎるregistryの現在の
urlvalidatorは、非空文字列かつhttps://で始まることしか確認しません。一方、wrapperはより厳格です。
GitHub issue comment URLの完全なshape
owner/repo一致
issue番号一致
comment ID
PR review commentとの区別
REST APIでcommentを取得
responseの
issue_urlが対象Issueと一致GitHub REST APIも、comment取得を
owner、repo、comment_idに束縛し、responseにhtml_url、issue_url、author_association等を返します。(GitHub Docs)実装Issueでは、汎用
urlではなく次のようなdomain typeが必要です。責務分離は次が妥当です。
registry: URLのcanonical shapeを検証
executor: URL内のrepo/issueを現在の
repo/issue_numberへ束縛wrapper: GitHub REST responseで存在と所属を再検証
推奨設計
採用推奨: 単数anchorを維持し、exact command profileを分ける
既存V1 rendererを一般化せず、固定argvの別command IDを追加する案が最も安全です。
これにより、
anchorなし:
preflight.runanchorあり:
preflight.run.with_anchorという2つの完全固定command classになります。
利点は以下です。
registry V1の「固定
list[str]」を維持optional token削除処理が不要
generic variadic rendererを増やさない
exact policyで10-token profileと12-token profileを別々に検証可能
既存の単数
LOOP_STATE.anchor_commentと整合既存のmultiple-anchor fail-closed契約を維持
Issue #1492の「同一
preflight.runentryへ追加」というgoalは変更になりますが、#1154で確立されたdeny-by-defaultのexact executor設計にはこちらの方が適合します。同じcommand IDを必須とするなら、registry V2でoptional argument groupを正式に設計してください。
required:falseのscalar placeholder追加だけでは不可です。P1: exact CLIではoption abbreviationも禁止すべき
skill_runtime_exec.pyとwrapperは通常のArgumentParser()を使っています。Pythonのargparseは既定で、曖昧でないlong optionの省略形を許可します。 (Python documentation)privileged exact commandでは次を明示すべきです。
これにより、例えば以下を拒否できます。
公式ドキュメントでも
allow_abbrev=Falseによってlong option prefix matchingを無効化できます。(Python documentation)P1: ACとVerification Commandsが調査品質を証明していない
現在のACは、
比較結果が本文にある
implementation Issueを作る
close可能である
だけです。
Verification Commandsも
gh issue viewで本文やstateを見るだけなので、調査内容が正しいことを一切証明しません。少なくとも次のACへ置き換えるべきです。
必須negative matrix
ケース | 期待結果 -- | -- anchorなし | 既存 preflight.run を許可 正しいanchor 1件 | 許可 異なるanchor 2件 | 現行契約では拒否 同一URLの重複 | 重複を拒否、またはcanonical dedupeを明文化 他repoのURL | 拒否 他IssueのURL | 拒否 PR #discussion_r... | 拒否 query・余分なfragment・末尾文字列付きURL | 拒否 --anchor-comment-url=URL | exact形でないなら拒否 option省略形 | 拒否 flagのみで値なし | 拒否 unknown extra flag | 拒否 flag順序変更 | exact policyに従い拒否 guardとexecutorの判定不一致 | テスト失敗 Claude/Codex側の認可差異 | テスト失敗配列契約を導入する場合は、cardinalityとduplicate policyを文章だけでなく
maxItemsとuniqueItems相当で機械的に固定すべきです。JSON Schemaではこれらが配列長と一意性の標準的な制約です。(JSON Schema)#1439との関係
bytecode cache誤検知を別concernとしてOut of Scopeにした判断は正しいです。
ただし #1439と今回のimplementationは、ともに以下へ触れる可能性があります。
#1439自身も、canonical argv、command registry、exact-command policyの変更が必要なら停止する契約です。したがって、#1492から起票するimplementation Issueには、#1439との依存関係、merge順序、rebase後の回帰コマンドを明記する必要があります。
最終結論
Issue #1492は、問題発見は正しいが、研究契約は修正必須です。
最も安全な着地点は次です。
現行本文の「0個以上・複数指定可能」と「registry側だけで解決可能か」という表現は、そのまま採用すべきではありません。
# 判定: **REQUEST_CHANGES**Issue #1492 が発見した「canonical
preflight.run経路から anchor comment を渡せない」という不具合自体は正しいです。ただし、現在の Issue は次の二点を誤認しています。run_refinement_preflight.pyは複数 anchor を実質的にはサポートしていないこのまま implementation Issue を起票すると、既存の単数-anchor契約を意図せず破壊するか、registryだけ更新しても実際には呼び出せない実装になります。なお、Issue #1492 自体にコメントはありません。
P0-1:
action="append"を「複数anchor対応」と解釈している確かにCLI parserは
action="append"で、同じオプションを複数回受け取ってリストへ格納します。Python公式でも、appendは各出現値をリストへ追加する構文上の収集機能です。アプリケーションが複数値を受理することまでは保証しません。 ([Python documentation]1)現行実装は、重複排除・ソート後に異なるURLが2件以上あれば、即座に
ANCHOR_COMMENT_MULTIPLE_UNSUPPORTEDでblockします。専用回帰テストも、2件のanchor URLを必ず拒否する契約を固定しています。さらに、下流契約もすべて単数です。
SKILL.mdの入力は単数anchor_comment_urlLOOP_STATEはanchor_commentオブジェクト1件anchor handling文書も単数snapshot、単数classificationを前提
これは偶発的な制限ではありません。PR #1043で「複数URLはfail-closed」という契約が意図的に導入されています。
修正要求: Issue #1492は最初にcardinalityを確定してください。
「複数指定可能」という記述は、現行契約を維持するなら削除が必要です。
P0-2: registryだけを変更してもexact executorから値が到達しない
現在の
preflight.runregistry entryは、issue_numberとrepoの2placeholderしか持ちません。しかし、より重大なのはregistryの外側です。
skill_runtime_exec.pyは以下の3オプションしか受け付けません。さらに
render_command()へ渡すparamsもissue_numberとrepoだけです。認可ポリシー側も、
しています。
Claude Codeのpermission ruleも、
--repo squne121/loop-protocolで終了する現在の形だけをallowしています。したがって、正しい判定は次です。
最低限のconsumer inventoryは以下です。
実際にexecutor参照はこれらのsettings、docs、Claude/Codex guard testsへ広がっています。
P0-3:
required: falseを足すだけではoptional flagにならない現在のrendererは、registryの各template tokenを必ず1個の出力tokenへ変換します。値が与えられていないoptional placeholderを削除する処理はありません。
そのため、例えば次のように追加しても、
anchor未指定時には、次のliteral tokenが残ります。
未解決placeholderの検出も
required: trueのwhole-tokenしかerrorにしないため、optional placeholderはそのまま返ります。既存の
decide.runにも、optionalと宣言されながらargv内に常駐するmax_iterations、phase_state_fileがあり、同じ潜在問題を抱えています。つまり必要なのは単なる
variadic型追加ではありません。を表現するschemaが必要です。
この一般化を行うなら、
ISSUE_REFINEMENT_COMMAND_REGISTRY_V1の意味変更として扱い、V2 schemaへ更新すべきです。現在のテストはregistry templateをlist[str]として固定しています。P0-4:
validate_shell_string()は主要な設計対象ではないIssue #1492は
validate_shell_string()との整合性を調査対象に含めていますが、registry-generated argvはproductionでこの関数を通りません。現行テストにも、registry argvは
subprocess(..., shell=False)へ直接渡され、validate_shell_string()はstring入力用であると明記されています。Python公式も、外部コマンドには文字列ではなくargument sequenceを渡す方式を推奨しており、
shellの既定値はFalseです。([Python documentation]2)したがって重点はshell文字列検査ではなく、以下です。
validate_shell_string()をvariadic placeholder対応へ拡張する必要はありません。P0-5: 既存の
urlplaceholder型は認可境界として弱すぎるregistryの現在の
urlvalidatorは、非空文字列かつhttps://で始まることしか確認しません。一方、wrapperはより厳格です。
GitHub issue comment URLの完全なshape
owner/repo一致
issue番号一致
comment ID
PR review commentとの区別
REST APIでcommentを取得
responseの
issue_urlが対象Issueと一致GitHub REST APIも、comment取得を
owner、repo、comment_idに束縛し、responseにhtml_url、issue_url、author_association等を返します。([GitHub Docs]3)実装Issueでは、汎用
urlではなく次のようなdomain typeが必要です。責務分離は次が妥当です。
repo/issue_numberへ束縛推奨設計
採用推奨: 単数anchorを維持し、exact command profileを分ける
既存V1 rendererを一般化せず、固定argvの別command IDを追加する案が最も安全です。
これにより、
preflight.runpreflight.run.with_anchorという2つの完全固定command classになります。
利点は以下です。
list[str]」を維持LOOP_STATE.anchor_commentと整合Issue #1492の「同一
preflight.runentryへ追加」というgoalは変更になりますが、#1154で確立されたdeny-by-defaultのexact executor設計にはこちらの方が適合します。同じcommand IDを必須とするなら、registry V2でoptional argument groupを正式に設計してください。
required:falseのscalar placeholder追加だけでは不可です。P1: exact CLIではoption abbreviationも禁止すべき
skill_runtime_exec.pyとwrapperは通常のArgumentParser()を使っています。Pythonのargparseは既定で、曖昧でないlong optionの省略形を許可します。 ([Python documentation]1)privileged exact commandでは次を明示すべきです。
これにより、例えば以下を拒否できます。
公式ドキュメントでも
allow_abbrev=Falseによってlong option prefix matchingを無効化できます。([Python documentation]1)P1: ACとVerification Commandsが調査品質を証明していない
現在のACは、
だけです。
Verification Commandsも
gh issue viewで本文やstateを見るだけなので、調査内容が正しいことを一切証明しません。少なくとも次のACへ置き換えるべきです。
必須negative matrix
preflight.runを許可#discussion_r...--anchor-comment-url=URL配列契約を導入する場合は、cardinalityとduplicate policyを文章だけでなく
maxItemsとuniqueItems相当で機械的に固定すべきです。JSON Schemaではこれらが配列長と一意性の標準的な制約です。(JSON Schema)#1439との関係
bytecode cache誤検知を別concernとしてOut of Scopeにした判断は正しいです。
ただし #1439と今回のimplementationは、ともに以下へ触れる可能性があります。
#1439自身も、canonical argv、command registry、exact-command policyの変更が必要なら停止する契約です。したがって、#1492から起票するimplementation Issueには、#1439との依存関係、merge順序、rebase後の回帰コマンドを明記する必要があります。
最終結論
Issue #1492は、問題発見は正しいが、研究契約は修正必須です。
最も安全な着地点は次です。
現行本文の「0個以上・複数指定可能」と「registry側だけで解決可能か」という表現は、そのまま採用すべきではありません。
squne121 commentedon Jul 13, 2026
Refinement Loop: Approved
The issue has been approved and is ready for implementation.
approvedsqune121 commentedon Jul 13, 2026
調査完了・クローズ
本 Issue の調査に基づき、採用設計(dedicated exact profile
preflight.run.with_anchor、productionpreflight.run契約不変)を実装する implementation Issue #1498 を起票し、本 Issue へリンクしました。preflight.runは無変更のまま、command registry / exact command policy / privileged executor / hooks / settings.json に anchor comment 専用の sibling exact profile を追加する。cardinality は 0..1 件を維持し、複数の異なる anchor URL は fail-closed で拒否する。Acceptance Criteria (AC1-AC3) をすべて満たしたため、本 Issue を completed としてクローズします。
(internal marker: ISSUE_1492_CLOSE_COMMENT_MARKER_V1)