Skip to content

docs: issue-refinement-loop Step 0f を parent-owned preflight 運用で明文化する - #1481

Merged
squne121 merged 2 commits into
mainfrom
worktree-issue-1478-parent-owned-preflight
Jul 12, 2026
Merged

squne121 merged 2 commits into
mainfrom
worktree-issue-1478-parent-owned-preflight

Conversation

@squne121

Copy link
Copy Markdown
Owner

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_branch invariant と、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 へ渡す運用を契約として固定した。
  • isolation agent が skill_runtime_exec.py(exact executor)も run_refinement_preflight.py(direct wrapper)も自ら実行しないこと、agent-* 等の未保証な isolation worktree 命名パターンを preflight.run の認可根拠として追加しないことも明記した。
  • 既存の Step 0f 直接実行 bash block(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 typecheck
  • pnpm lint
  • pnpm test
  • pnpm build
  • uv 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

  • decision: not_schema_change
  • reason: 本 PR は .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(互換性判定)

  • change_type: N/A
  • compatibility: N/A
  • migration_required: N/A
  • migration_or_followup: N/A
  • reason: schema 変更を伴わないため該当なし。

Safety Claim Matrix

Claim Implemented? Not controlled Evidence Follow-up
.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)を自ら実行しないことを契約テストで固定した yes 本 PR は SKILL.md のプロースと契約テストの追加のみであり、.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 なし) #1464

記載ルール確認:

Notes

…#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]>
@github-actions

github-actions Bot commented Jul 12, 2026 •

Copy link
Copy Markdown
Contributor

Preview URL

Preview removed (PR #1481 closed).

@squne121 squne121 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@squne121 squne121 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/main tip(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-setup infra 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。

@squne121
squne121 marked this pull request as ready for review July 12, 2026 02:13
@squne121
squne121 merged commit 99ecaf8 into main Jul 12, 2026
21 of 22 checks passed
@squne121
squne121 deleted the worktree-issue-1478-parent-owned-preflight branch July 12, 2026 02:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant