Repository navigation
docs: issue-refinement-loop Step 0f を parent-owned preflight 運用で明文化する - #1481
Conversation
…#1478) isolation worktree agent への preflight.run 委譲は、required_cwd: canonical_main_root / required_branch: default_branch invariant と isolation worktree の cwd が衝突するため、parent(orchestrator 自身)が preflight.run を実行し bounded な結果のみを isolation agent へ渡す 「parent-owned preflight」運用を Step 0f に明記した。isolation agent が skill_runtime_exec.py / run_refinement_preflight.py を自ら実行しないこと、 agent-* 等の未保証な worktree 命名を認可根拠に追加しないことも固定した。 Refs #1464 Co-Authored-By: Claude Sonnet 5 <[email protected]>
Preview URLPreview removed (PR #1481 closed). |
squne121
left a comment
There was a problem hiding this comment.
LOOP_VERDICT_V2
verdict: REQUEST_CHANGES
reviewed_head_sha: "6bacfa46e8832749d49c45183704b1feee29c86f"
merge_ready: false
mergeability:
mergeable: "MERGEABLE"
merge_state_status: "BEHIND"
blockers:
- "ci_verdict_summary.py exit 10 (failed): deploy-pr (deploy-pages workflow) job FAILURE at head 6bacfa4. Root cause per job log: pnpm/action-setup self-installer crash (Cannot use in operator to search for integrity in undefined) while switching pnpm 11.1.1 to 11.12.0, unrelated to this PR diff (docs prose plus new pytest file only). Core CI (typecheck, lint, test, build, e2e, python-test, actionlint, check-hook-integrity, PR Body Japanese Check) is all SUCCESS at the reviewed head. Per PR_REVIEW_JUDGE_VC_EVIDENCE_POLICY exit-10 is treated as a mechanical CI blocker regardless of apparent infra-flake cause. Recommend a CI re-run before merge, as no required_auto_actions.kind exists for CI re-run in this skill vocabulary."
AC / Contract Verification (review_subagent independent re-verification)
- Files changed (2, matches Allowed Paths exactly):
- .claude/skills/issue-refinement-loop/SKILL.md (+10)
- .claude/skills/issue-refinement-loop/tests/test_step_0f_parent_owned_preflight.py (+97, new)
- AC1: literal string "parent-owned preflight" present in new Step 0f subsection, confirmed via git diff (merge-base 840a724 to head 6bacfa4).
- AC2: both "isolation agent は...skill_runtime_exec.py...自ら実行しない" and "...run_refinement_preflight.py...自ら実行しない" patterns present, confirmed.
- AC3: "認可根拠として追加しない" present, confirmed.
- AC4: "isolation worktree agent からは...実行しない" present, confirmed.
- AC5/AC6: new test file content read directly (7 tests). python-test CI job SUCCESS at reviewed head.
- Diff scope: no unrelated file changes, diff is docs-prose plus new contract-test only. No scope creep observed.
Allowed Paths Gate (ALLOWED_PATHS_GATE_RESULT_V1, producer_role: review_subagent)
status: ok
producer_role: review_subagent
worker_report_used_as_canonical: false
changed_files_count: 2
violations: []
Schema Change Applicability
- PR declares not_schema_change, consistent with actual diff. No Schema Consumer Inventory required.
Safety Claim Gate
- Safety-sensitive (path under .claude/skills). PR includes a Safety Claim Matrix with a non-empty Not controlled column and a linked open follow-up (#1464, verified OPEN). Gate satisfied.
Deterministic Gate G4 (head_sha_consistency)
- pass.
required_auto_actions:
- kind: update_branch
executor: implementation-worker
skill: implement-issue.update_branch
blocking_merge_ready: true
mechanical: true
expected_head_sha: "6bacfa46e8832749d49c45183704b1feee29c86f"
auto_fix_applied: []
follow_up_issue_requests: []
Summary
AC1-AC6 all confirmed by independent re-verification, Allowed Paths gate ok, Safety Claim Matrix and Schema gate satisfied, G4 pass. Sole blocker is the deploy-pr CI job failure (exit 10, mechanical policy). Recommend re-running CI to confirm it clears (likely a pnpm/action-setup version-switch infra flake unrelated to this diff) before merge. Also BEHIND plus MERGEABLE implies update_branch recommended per mechanical rule.
…arent-owned-preflight
squne121
left a comment
There was a problem hiding this comment.
LOOP_VERDICT_V2 (iteration 2)
verdict: APPROVE
reviewed_head_sha: "81bf459f6fb95af01669b8dc0474d6481f6907aa"
merge_ready: true
mergeability:
mergeable: "MERGEABLE"
merge_state_status: "UNSTABLE"
blockers: []
required_auto_actions: []
auto_fix_applied: []
follow_up_issue_requests: []
Iteration 1 からの変更点(blocker 解消)
- BEHIND 解消:
git merge-base main 81bf459f...==origin/maintip(63a02ffe)。branch は最新、update_branch不要。 - deploy-pr CI failure は non-blocking と確認:
wait_pr_checks.py(gh pr checks --requiredスコープ、DEFAULT_NON_BLOCKING_RULES = {("deploy-pages","deploy-pr")})でdecision: pass、failed_blocking_count: 0。required checks =build, typecheck, lint, test, python-test, validate-generated-artifactにdeploy-prは含まれない(branch protection query と一致)。gh run list --workflow deploy-pages.yml --limit 8で直近8回中4回failがmain含む無関係branch群に分散しており、repo全体のpnpm/action-setupinfra flake(本PRの差分と無関係)と確認。
独立再検証(head 81bf459)
- diff:
git diff --name-status -M -z 63a02ffe...81bf459f→ 2ファイルのみ、両方 Issue #1478 Allowed Paths 内、rename なし。 - AC1〜AC4:
git show 81bf459f:.claude/skills/issue-refinement-loop/SKILL.mdで直接再確認、全て Step 0f セクション内に存在。 - AC5: 新規テストファイル内容を直接読み、7 assertion、placeholder なし。
- AC6: 対象外ファイル、python-test CI SUCCESS。
- Allowed Paths Gate: status: ok, violations: []。
- Schema Change Applicability: not_schema_change(正しい、schema file 変更なし)。
- Safety Claim Gate:
.claude/skills/**は safety-sensitive。Matrix 存在、Not controlled 非空、follow-up #1464(OPEN)リンク済み。 - G4 (head_sha_consistency): pass。
- Draft 状態: PR は Draft のまま。skill 規約によりこれは blocker ではなく merge_ready に影響しない。
新規 blocker なし。APPROVE。
Summary
issue-refinement-loopの Step 0f(Planner Consumption)に「parent-owned preflight」セクションを追加し、isolation worktree agent への preflight.run 委譲時の運用を明文化した(Issue 実装: issue-refinement-loop Step 0f を parent-owned preflight 運用で明文化し isolation agent の exact executor 実行を契約テストで禁止する #1478 / 親 Issue 調査: worktree_scope_guard の issue番号命名要求が汎用 isolation worktree agent の preflight.run 実行を妨げる問題の対応方針を決定する #1464 の対応方針 (d))。preflight.runが要求するrequired_cwd: canonical_main_root/required_branch: default_branchinvariant と、Agent tool のisolation: "worktree"で生成される汎用 worktree の cwd が衝突する問題に対し、parent(orchestrator 自身、canonical main root・default branch で稼働)が preflight.run を実行し、bounded な結果(NEXT_ACTION/MUST_READ/ARTIFACT等の canonical stdout フィールドのみ)を isolation agent へ渡す運用を契約として固定した。skill_runtime_exec.py(exact executor)もrun_refinement_preflight.py(direct wrapper)も自ら実行しないこと、agent-*等の未保証な isolation worktree 命名パターンをpreflight.runの認可根拠として追加しないことも明記した。run_refinement_preflight.pyを直接呼ぶ例)は、orchestrator 自身が canonical main root もしくは canonically-named issue worktree から直接実行する場合に限定される旨の注記を追加した。.claude/skills/issue-refinement-loop/tests/test_step_0f_parent_owned_preflight.pyを追加した(AC1〜AC4 の文言存在+Step 0f 内包含+line budget 回帰の 7 テスト)。Checks
pnpm typecheckpnpm lintpnpm testpnpm builduv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_step_0f_parent_owned_preflight.py -q(7 passed)uv run --locked pytest scripts/agent-guards/tests/test_skill_runtime_preflight_no_worktree.py -q(20 passed、regression なし)uv run --locked pytest .claude/skills/issue-refinement-loop/tests/ -q(1265 passed、既存 wiring テスト含め regression なし)Schema Change Applicability
not_schema_change.claude/skills/issue-refinement-loop/SKILL.mdのプロース(運用手順の文章)追加と、その文言存在を検証する pytest テストファイルの新規追加のみであり、producer-consumer 間の machine-readable contract(JSON schema・stdout フィールド定義)は変更していない。Schema Consumer Inventory
N/A —
not_schema_changeのため対象外(schema の追加・変更を伴わない docs + test の変更のみ)。Compatibility Decision(互換性判定)
N/AN/AN/AN/ASafety Claim Matrix
.claude/skills/issue-refinement-loop/SKILL.mdの Step 0f に「parent-owned preflight」運用を明文化し、isolation agent が exact executor(skill_runtime_exec.py)・direct wrapper(run_refinement_preflight.py)を自ら実行しないことを契約テストで固定した.claude/hooks/*やscripts/agent-guards/*の guard コード自体(local_main_branch_guard.py/worktree_scope_guard.py/skill_runtime_command_policy.py)は変更していない。実際に isolation worktree agent が preflight.run を実行できないことを runtime で強制する mechanism(guard 側の拡張)は本 PR のスコープ外であり、親 Issue #1464 の残タスク(continuation/supersede/duplicate 判定記録を含む)として引き続き扱う。uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_step_0f_parent_owned_preflight.py -q→ 7 passed(AC1〜AC4 文言存在確認)。uv run --locked pytest scripts/agent-guards/tests/test_skill_runtime_preflight_no_worktree.py -q→ 20 passed(既存 guard 契約への regression なし)記載ルール確認:
Not controlledが非空のため、PR title / summary / docs で無限定のsafe/read-only/sandboxed/isolated/completeは使用していない。Evidenceは本 PR で実行した Verification Commands(Issue 実装: issue-refinement-loop Step 0f を parent-owned preflight 運用で明文化し isolation agent の exact executor 実行を契約テストで禁止する #1478 の AC5 / AC6)の結果と対応している。Not controlledが非空のため、Follow-up に親 Issue 調査: worktree_scope_guard の issue番号命名要求が汎用 isolation worktree agent の preflight.run 実行を妨げる問題の対応方針を決定する #1464(OPEN、guard 側の runtime 強制拡張の責務を引き続き保持)を記載した。Notes
M4: Upgrade Loop (v0.4.x)の直接スコープ外(.claudeagent-ops 基盤の contract 整備)。