Repository navigation
feat(hooks): preflight.run 専用 skill runtime executor を root guard に追加 (#1154) - #1177
Conversation
Add a deny-by-default skill runtime policy and exact executor for preflight.run, wire both root guards to the shared command class, and cover the new root-allow/fail-closed paths with hook tests.
Preview URLPreview removed (PR #1177 closed). |
|
TEST_VERDICT_MACHINE/v1: |
squne121
left a comment
There was a problem hiding this comment.
Verdict: REQUEST_CHANGES
Mergeability
- mergeable=
MERGEABLE, merge_state_status=BEHIND
Evidence Check
- AC / standard gate: linked issue #1154 の AC13 は未達です。canonical CI summary で
python-testが failure になっており、標準ゲート PASS を満たしていません。 - Allowed Paths: changed files 9件は issue #1154 の Allowed Paths 内に収まっています。
- TEST_VERDICT_MACHINE: reviewed head
e87da0e27d01dd24f53ac20e2bbbfc6530bcdc74に一致していますが、canonical CI summary ではpython-testfailure のため APPROVE には進めません。
Blockers
- severity: high
evidence_refs:- linked issue #1154 AC13
- CI_VERDICT_SUMMARY_V1: PR #1177, head
e87da0e27d01dd24f53ac20e2bbbfc6530bcdc74, failed_checks=[python-test] - failed log:
tests/codex/test_local_main_branch_guard.py::TestExactAllowlist::test_exact_allowlist_run_refinement_preflight - failed log:
tests/codex/test_local_main_branch_guard.py::TestExactAllowlist::test_deterministic_checker_command_reason_code
next_action:tests/codex/test_local_main_branch_guard.py側の Codex parity expectations を今回の exact executor 契約へ更新し、python-testを green にしてください。
Non-blockers
- PR 本文は
Closes #1154を満たしています。 - AC coverage / 検証結果 / Allowed Paths を専用 section 形へ寄せる PR body hygiene 更新は mechanical action として扱います。
LOOP_VERDICT_V2
verdict: REQUEST_CHANGES
reviewed_head_sha: "e87da0e27d01dd24f53ac20e2bbbfc6530bcdc74"
merge_ready: false
mergeability:
mergeable: "MERGEABLE"
merge_state_status: "BEHIND"
blockers:
- "CI_VERDICT_SUMMARY_V1 at reviewed head reports failed_checks=[python-test]; tests/codex/test_local_main_branch_guard.py still fails old direct-preflight allowlist expectations, so issue #1154 AC13 and Claude/Codex parity are not satisfied."
required_auto_actions:
- kind: update_pr_body_hygiene
executor: implementation-worker
skill: open-pr.update_pr
blocking_merge_ready: true
mechanical: true
- kind: update_branch
executor: implementation-worker
skill: implement-issue.update_branch
blocking_merge_ready: true
mechanical: true
expected_head_sha: "e87da0e27d01dd24f53ac20e2bbbfc6530bcdc74"
auto_fix_applied: []
follow_up_issue_requests: []
allowed_paths_gate:
status: ok
allowed_paths_gate_source: review_subagent|
TEST_VERDICT_MACHINE/v1: |
squne121
left a comment
There was a problem hiding this comment.
Verdict: REQUEST_CHANGES
Mergeability
- mergeable=MERGEABLE, merge_state_status=BEHIND
Evidence Check
- AC coverage: linked issue #1154 の AC/VC/Allowed Paths は確認済みで、fresh contract snapshot (
status: go) も存在します。 - Allowed Paths: current head の changed files は issue #1154 の Allowed Paths 内に収まっています。
- CI Verification: current head
36cd1f3ed20c3642a7e742fc5802a33a26fe11c2に束縛したci_verdict_summary.pyはnode-backed-hook-testsとpython-testの failure を返しました。 - 検証コマンド結果: current head に一致する
TEST_VERDICT_MACHINE/v1は pass ですが、PR body は required section (## 受け入れ条件の達成状況/## 検証コマンド結果/## Allowed Paths 遵守) を満たしていません。
Blockers
- current head
36cd1f3ed20c3642a7e742fc5802a33a26fe11c2の CI summary が failed (node-backed-hook-tests,python-test) のため、fresh head では APPROVE できません。
Non-blockers
merge_state_status=BEHINDのため update branch は mechanical auto action として扱います。- PR body hygiene の更新は mechanical auto action として扱います。
LOOP_VERDICT_V2
verdict: REQUEST_CHANGES
reviewed_head_sha: "36cd1f3ed20c3642a7e742fc5802a33a26fe11c2"
merge_ready: false
mergeability:
mergeable: "MERGEABLE"
merge_state_status: "BEHIND"
blockers:
- "CI summary for current head 36cd1f3ed20c3642a7e742fc5802a33a26fe11c2 reports failed checks: node-backed-hook-tests, python-test"
allowed_paths_gate:
status: ok
allowed_paths_gate_source: review_subagent
required_auto_actions:
- kind: update_pr_body_hygiene
executor: implementation-worker
skill: open-pr.update_pr
blocking_merge_ready: true
mechanical: true
- kind: update_branch
executor: implementation-worker
skill: implement-issue.update_branch
blocking_merge_ready: true
mechanical: true
expected_head_sha: "36cd1f3ed20c3642a7e742fc5802a33a26fe11c2"
auto_fix_applied: []
follow_up_issue_requests: []|
probe2 |
|
TEST_VERDICT_MACHINE/v1 issue_number 1154 pr_number 1177 head_sha e427f76 mergeable CONFLICTING merge_state_status DIRTY status FAIL required_checks typecheck lint test build python-test validate-generated-artifact pnpm_typecheck PASS pnpm_lint PASS pnpm_test FAIL pnpm_build PASS ci_test_selection not_confirmed |
squne121
left a comment
There was a problem hiding this comment.
Verdict: REQUEST_CHANGES
Mergeability
- mergeable=MERGEABLE, merge_state_status=CLEAN
Evidence Check
- Allowed Paths: 変更ファイル 14 件はいずれも Issue #1154 の Allowed Paths 内です。
- CI Verification: current checks は Passed 13 / Failed 0 を確認しました。mergeable=MERGEABLE, mergeStateStatus=CLEAN です。
- 検証契約: PR 本文には
## 受け入れ条件の達成状況/## 検証コマンド結果/## Allowed Paths 遵守の必須 section がなく、AC/VC/Allowed Paths の照合をテンプレートどおりに完了できません。 - CI 追加 gate:
.github/ci/python-test-plan.jsonとci_test_selection関連変更を含む一方、CI_TEST_PERFORMANCE_DECISION_V1の証跡が PR 本文または artifact にありません。
Blockers
- PR body hygiene を正規テンプレートへ修正し、各 AC と VC の根拠を
## 受け入れ条件の達成状況/## 検証コマンド結果/## Allowed Paths 遵守に明示してください。 - CI/test-lane 変更の reviewer evidence として
CI_TEST_PERFORMANCE_DECISION_V1を PR 本文または artifact に追加してください。
LOOP_VERDICT_V2
verdict: REQUEST_CHANGES
reviewed_head_sha: "53d2a42de72f443bff6403b9186f16037073bb84"
merge_ready: false
mergeability:
mergeable: "MERGEABLE"
merge_state_status: "CLEAN"
allowed_paths_gate:
status: "ok"
allowed_paths_gate_source: "review_subagent"
blockers:
- severity: medium
summary: "PR body に必須 section が欠けており、AC/VC/Allowed Paths の契約照合を fail-closed で完了できない"
evidence_refs:
- "PR #1177 body"
- "docs/dev/workflow.md (PR テンプレート必須 section)"
- ".claude/skills/pr-review-judge/references/ac-evidence-checks.md"
next_action: "PR 本文を正規テンプレートへ更新し、各 AC と VC の根拠を section ごとに明示する"
- severity: medium
summary: "CI/test-lane 関連変更に対する CI_TEST_PERFORMANCE_DECISION_V1 証跡がなく、CI reviewer gate を満たしていない"
evidence_refs:
- "PR #1177 changed files"
- ".claude/skills/ci-test-performance/SKILL.md"
next_action: "CI_TEST_PERFORMANCE_DECISION_V1 を PR 本文または artifact に追加する"
required_auto_actions:
- kind: update_pr_body_hygiene
executor: implementation-worker
skill: open-pr.update_pr
blocking_merge_ready: true
mechanical: true
auto_fix_applied: []
follow_up_issue_requests: []
squne121
left a comment
There was a problem hiding this comment.
Verdict: REQUEST_CHANGES
Mergeability
- mergeable=
MERGEABLE, merge_state_status=UNSTABLE
Evidence Check
- AC coverage: linked issue #1154 の live body と
CONTRACT_REVIEW_RESULT_V1 status: go(2026-06-25T21:40:32Z, issue comment#issuecomment-4804398416)は current contract として確認しました。 - Allowed Paths: PR #1177 の changed files 14 件は issue #1154 の
## Allowed Pathsにすべて含まれており、Allowed Paths gate はokです。 - CI Verification:
ci_verdict_summary.py --pr 1177 --repo squne121/loop-protocol --expected-head-sha 53d2a42de72f443bff6403b9186f16037073bb84は head 一致を確認した一方、status=failedを返し、PR Body Japanese Checkfailure を current head に束縛して報告しました。 - 検証コマンド結果: PR 本文の
## Summary/## 受け入れ条件の達成状況/## 検証コマンド結果/## Allowed Paths 遵守とCI_TEST_PERFORMANCE_DECISION_V1evidence は current body に存在し、body hygiene / CI-test-performance evidence 欠落は解消済みです。
Blockers
- severity: high
evidence_refs:PR #1177 current head 53d2a42de72f443bff6403b9186f16037073bb84CI_VERDICT_SUMMARY_V1 status=failedfailed_checks=[PR Body Japanese Check]gh pr view 1177 --json mergeable,mergeStateStatus,updatedAt=>mergeable=MERGEABLE,mergeStateStatus=UNSTABLE,updatedAt=2026-06-25T23:26:38Z
next_action:PR Body Japanese Checkを green に戻し、current head 53d2a42 に束縛した fresh CI evidence で required checks success / mergeStateStatus=CLEAN(or allowed clean state) を再確認してください。
Non-blockers
Closes #1154は current PR body で維持されています。- CI/test-lane 変更に対する
CI_TEST_PERFORMANCE_DECISION_V1evidence は current PR body に反映済みです。
LOOP_VERDICT_V2
verdict: REQUEST_CHANGES
reviewed_head_sha: "53d2a42de72f443bff6403b9186f16037073bb84"
merge_ready: false
mergeability:
mergeable: "MERGEABLE"
merge_state_status: "UNSTABLE"
blockers:
- severity: high
summary: "Current head 53d2a42de72f443bff6403b9186f16037073bb84 is bound to a failed required check: PR Body Japanese Check, so required checks success is no longer true and mergeStateStatus is UNSTABLE."
evidence_refs:
- "CI_VERDICT_SUMMARY_V1 for PR #1177 expected_head_sha=53d2a42de72f443bff6403b9186f16037073bb84"
- "gh pr view 1177 mergeStateStatus=UNSTABLE updatedAt=2026-06-25T23:26:38Z"
next_action: "Fix the PR body so PR Body Japanese Check passes, then rerun or wait for fresh required-check evidence on the same head."
required_auto_actions: []
auto_fix_applied: []
follow_up_issue_requests: []
allowed_paths_gate:
status: ok
allowed_paths_gate_source: review_subagent
squne121
left a comment
There was a problem hiding this comment.
LOOP_VERDICT_V2
verdict: REQUEST_CHANGES
reviewed_head_sha: "53d2a42de72f443bff6403b9186f16037073bb84"
merge_ready: false
mergeability:
mergeable: "MERGEABLE"
merge_state_status: "CLEAN"
blockers:
- severity: high
summary: "current head 53d2a42de72f443bff6403b9186f16037073bb84 に束縛した ci_verdict_summary.py が status=failed を返し、required-check evidence を green と判定できない"
evidence_refs:
- "CI_VERDICT_SUMMARY_V1 generated_at=2026-06-25T23:37:11.687248Z expected_head_sha=53d2a42de72f443bff6403b9186f16037073bb84"
- "failed_checks=[PR Body Japanese Check]"
- "rtk gh pr checks 1177 => Passed 14 / Failed 0"
next_action: "PR Body Japanese Check の current-head evidence を再確定し、ci_verdict_summary.py が failed ではなく all_pass を返す状態にしてください"
- severity: medium
summary: "current PR body は safety-sensitive / CI-related 変更に必要な hygiene gate を満たしていない"
evidence_refs:
- "PR #1177 body: missing `## Schema Change Applicability`"
- "PR #1177 body: missing `## Safety Claim Matrix`"
- "PR #1177 body: missing `## Notes`"
- ".claude/skills/open-pr/scripts/validate_pr_body.py LP052/LP051"
- ".claude/skills/pr-review-judge/references/safety-claim-gate.md"
- ".claude/skills/pr-review-judge/references/schema-consumer-gate.md"
next_action: "PR body に Schema Change Applicability(diff と整合する `not_schema_change` など)と Safety Claim Matrix、Notes を追加し、safety-sensitive PR として fail-closed 条件を満たしてください"
required_auto_actions: []
auto_fix_applied: []
follow_up_issue_requests: []
allowed_paths_gate:
status: ok
allowed_paths_gate_source: review_subagent
review_comment_url: null
squne121
left a comment
There was a problem hiding this comment.
LOOP_VERDICT_V2
verdict: REQUEST_CHANGES
reviewed_head_sha: "b80797f467d2f391ed67308b31abb6dc2e03d974"
merge_ready: false
mergeability:
mergeable: "MERGEABLE"
merge_state_status: "CLEAN"
blockers:
- severity: medium
summary: "live PR body が `pr-review-judge` の必須 section である `## 受け入れ条件の達成状況` / `## 検証コマンド結果` / `## Allowed Paths 遵守` を current head で満たしておらず、linked issue #1154 の AC / VC / Allowed Paths を section 単位で fail-closed に再照合できない"
evidence_refs:
- "PR #1177 live body at head b80797f467d2f391ed67308b31abb6dc2e03d974"
- "Issue #1154 live body"
- "docs/dev/workflow.md"
- ".claude/skills/pr-review-judge/references/ac-evidence-checks.md"
- ".claude/skills/open-pr/scripts/validate_pr_body.py (REQUIRED_SECTIONS=Summary/Checks/Schema Change Applicability/Schema Consumer Inventory/Safety Claim Matrix/Notes)"
next_action: "PR body を `## Summary` / `## 受け入れ条件の達成状況` / `## 検証コマンド結果` / `## Allowed Paths 遵守` を含む review-ready 形へ更新し、Issue #1154 の各 AC・VC・Allowed Paths 根拠を各 section に明示する"
required_auto_actions:
- kind: update_pr_body_hygiene
executor: implementation-worker
skill: open-pr.update_pr
blocking_merge_ready: true
mechanical: true
auto_fix_applied: []
follow_up_issue_requests: []
allowed_paths_gate:
status: ok
allowed_paths_gate_source: review_subagent
review_comment_url: null
squne121
left a comment
There was a problem hiding this comment.
LOOP_VERDICT_V2
verdict: REQUEST_CHANGES
reviewed_head_sha: "b80797f467d2f391ed67308b31abb6dc2e03d974"
merge_ready: false
mergeability:
mergeable: "MERGEABLE"
merge_state_status: "CLEAN"
blockers:
- severity: high
summary: "`scripts/agent-guards/skill_runtime_exec.py` が `validate_registry_entry()` を通過できず、Issue #1154 の中核である `preflight.run` executor が runtime で常に失敗する"
evidence_refs:
- "Issue #1154 AC3-AC5 / Outcome"
- "scripts/agent-guards/skill_runtime_exec.py:125-128 (`validate_registry_entry(args.command_id, entry, str(args.issue_number))`)"
- "scripts/agent-guards/skill_runtime_command_policy.py:286-291 (`for token in argv: if _PLACEHOLDER_RE.match(token): raise ValueError(\"unresolved_whole_token_placeholder\")`)"
- "PR head b80797f467d2f391ed67308b31abb6dc2e03d974"
next_action: "`validate_registry_entry()` が合法な placeholder template を reject しないよう修正し、`skill_runtime_exec.py --command-id preflight.run ...` の実行経路を直接検証するテストを追加したうえで current-head CI evidence を更新する"
required_auto_actions: []
auto_fix_applied: []
follow_up_issue_requests: []
allowed_paths_gate:
status: ok
allowed_paths_gate_source: review_subagent
review_comment_url: null
判定REQUEST_CHANGES。 Issue #1154 は、 Blocker 1 — active issue worktree binding が実 worktree ではなく stale directory で成立する
さらに その結果、executor 本体の これは Issue #1154 の AC9/AC10、特に「temp repo + real issue worktree」「no-active-worktree fail-closed」に反します。#1137/#1143 でも、env だけの状態擬装や実 hook 経路を回避するテストが blocker とされ、実 catalog preflight へ寄せ直されています。 要求修正: privileged executor 経路では directory glob fallback を削除してください。 Blocker 2 — allowed_write_roots の postcondition が
|
squne121
left a comment
There was a problem hiding this comment.
LOOP_VERDICT_V2
verdict: REQUEST_CHANGES
reviewed_head_sha: "4b981b71f3d7bb980bbd372c9ff2430d0c7c55c4"
merge_ready: false
mergeability:
mergeable: "MERGEABLE"
merge_state_status: "CLEAN"
allowed_paths_gate:
status: ok
allowed_paths_gate_source: review_subagent
blockers:
- severity: high
finding: "active issue worktree binding が実 worktree catalog ではなく .claude/worktrees/issue-<N>-* の単一 prefix match でも成立する"
evidence_refs:
- "scripts/agent-guards/skill_runtime_command_policy.py#resolve_active_issue"
- ".claude/hooks/worktree_scope_guard.py#_is_skill_runtime_executor_command"
next_action: "git worktree list --porcelain -z 由来の catalog entry に一致する active issue worktree のみを許可し、stale directory fixture を Claude hook / Codex guard / executor の 3 経路で追加する"
- severity: high
finding: "exact privileged executor command class が 1 形に固定されておらず、parser は direct python3 .../skill_runtime_exec.py と absolute-path alias も受理し、executor の self-check もその非 canonical 形を使う"
evidence_refs:
- "scripts/agent-guards/skill_runtime_command_policy.py#parse_exact_skill_runtime_command"
- "scripts/agent-guards/skill_runtime_exec.py#main"
next_action: "許可 lexical form を uv run python3 scripts/agent-guards/skill_runtime_exec.py --command-id preflight.run --issue-number <N> --repo squne121/loop-protocol の 1 経路に固定し、parser・self-check・tests・docs を揃える"
- severity: high
finding: "executor の postcondition / env hardening が弱く、書き込み監査は git status --porcelain --untracked-files=all 差分のみ、env sanitize も PYTHONPATH 削除に留まるため ignored/transient outside write と PATH poisoning を fail-close できない"
evidence_refs:
- "scripts/agent-guards/skill_runtime_exec.py#_tracked_and_untracked_paths"
- "scripts/agent-guards/skill_runtime_exec.py#_sanitize_env"
- "scripts/agent-guards/skill_runtime_exec.py#main"
next_action: "ignored path を含む outside write と PATH poisoning の adversarial fixture を追加し、env allowlist と write-boundary enforcement を strengthen する"
- severity: medium
finding: "canonical repo binding の remote parser が github.com/ substring 依存で、host/path の strict validation になっていない"
evidence_refs:
- "scripts/agent-guards/skill_runtime_command_policy.py#resolve_repo_slug"
next_action: "HTTPS は exact host github.com と /<owner>/<repo>(.git)、SSH は [email protected]:<owner>/<repo>(.git) のみ許可する strict parser に置き換える"
required_auto_actions:
- kind: update_pr_body_hygiene
executor: implementation-worker
skill: open-pr.update_pr
blocking_merge_ready: true
mechanical: true
note: "PR body の current-head CI が b80797f467d2f391ed67308b31abb6dc2e03d974 のままで stale。受け入れ条件の達成状況 も issue contract の各 AC を [x]/[ ] + 根拠 で束縛していない"
auto_fix_applied: []
follow_up_issue_requests: []
review_comment_url: pending
Issue #1154 をクローズする PR です。Closes #1154。
Summary
CONTRACT_REVIEW_RESULT_V1 status: go)に従う実装です。preflight.run専用 privileged executor、Claude/Codex guard parity、関連 docs/tests、ci_test_selectionと.github/ci/python-test-plan.jsonの整合に限定しています。.claude/settings.json、.claude/hooks/**、scripts/agent-guards/**、.claude/skills/**を含み、CI-related な変更として.github/ci/python-test-plan.jsonとgenerate_ci_test_selection_artifact.py系を含みます。Checks
status: go(2026-06-25T21:40:30Z)ですpnpm typecheck/pnpm lint/pnpm test/pnpm buildはすべて PASS ですrtk gh pr checks 1177を canonical readback とし、最新 headb80797f467d2f391ed67308b31abb6dc2e03d974の required checks success を current-head 基準で確認しますSchema Change Applicability
Schema Consumer Inventory
not_schema_changeのため consumer inventory は不要です。Safety Claim Matrix
preflight.runの exact privileged executor 1 経路に限定し、deny-by-default を維持する.claude/hooks/worktree_scope_guard.py、scripts/agent-guards/local_main_branch_guard.py、scripts/agent-guards/skill_runtime_exec.pytests/codex/test_local_main_branch_guard.py、.claude/hooks/tests/test_worktree_scope_guard.py、.claude/hooks/tests/test_local_main_branch_guard.pyci_test_selectionartifact generator の coverage parity を壊さない.github/ci/python-test-plan.json、generate_ci_test_selection_artifact.py系、rtk gh pr checks 1177Notes
.claude/hooks/tests/test_local_main_branch_guard.py.claude/hooks/tests/test_worktree_scope_guard.py.claude/hooks/worktree_scope_guard.py.claude/settings.json.claude/skills/issue-refinement-loop/scripts/command_registry.py.claude/skills/pr-review-judge/scripts/generate_ci_test_selection_artifact.py.claude/skills/pr-review-judge/scripts/tests/test_generate_ci_test_selection_fail_close.py.claude/skills/pr-review-judge/tests/test_generate_ci_test_selection_artifact.py.github/ci/python-test-plan.jsondocs/dev/agent-skill-boundaries.mdscripts/agent-guards/local_main_branch_guard.pyscripts/agent-guards/skill_runtime_command_policy.pyscripts/agent-guards/skill_runtime_exec.pytests/codex/test_local_main_branch_guard.py受け入れ条件の達成状況
preflight.runの exact privileged executor 1 経路に限定し、deny-by-default を維持する実装とテストを追加しました。.claude/hooks/**とscripts/agent-guards/**に反映しました。.github/ci/python-test-plan.jsonとgenerate_ci_test_selection_artifact.py系を更新し、dedicated codex lane とci_test_selectionartifact generator の coverage parity を維持しました。検証コマンド結果
pnpm typecheck: PASSpnpm lint: PASSpnpm test: PASSpnpm build: PASSrtk gh pr checks 1177: 最新 headb80797f467d2f391ed67308b31abb6dc2e03d974で required checks success を current-head 基準で確認します。Allowed Paths 遵守
.claude/hooks/**、.claude/settings.json、.claude/skills/**、.github/ci/python-test-plan.json、docs/dev/agent-skill-boundaries.md、scripts/agent-guards/**、tests/codex/**で、いずれも Allowed Paths 内です。assets/とLICENSES/は変更していません。