Skip to content

導入: AI Agent 運用改善 — preflight / hook / PR body / worktree 周辺制御の決定論的整備 #1047

Open
7 of 11 issues completed

Description

@squne121

Machine-Readable Contract

contract_schema_version: v1
issue_kind: parent
goal_ref: "impl-review-loop / post-merge-cleanup の周辺制御(preflight / hook / PR body / worktree)で発生するトークン浪費とノイズを根絶し、決定論的整備を行う"
change_kind: workflow
parent_mode: delivery-rollup
closure_mode: child-complete

Summary

Issue #1040 → PR #1045 のログで連鎖した EACCES/posix_spawn(36回)・worktree_scope_guard 誤ブロック(22回)・PR body 日本語チェック失敗・contract スナップショット未生成・CLI 引数不整合を根本原因別に分解し、9件の子 Issue で決定論的に解消する。実装能力ではなく「事前ゲート・Hook・PR メタデータ・cleanup の周辺制御」がトークンを燃やしている現状への対処。

Goal

impl-review-loop 開始時の readiness 確認・Hook 実行可能性・PR body 構造・worktree cleanup の周辺制御を deterministic script に集約し、不要な往復トークン消費を根絶する。

Desired Destination

  • impl-review-loop 開始前に agent-run-preflight が readiness を 1 コマンドで確定する
  • Hook EACCES が作業フローにノイズを混入しない
  • PR body が日本語チェック・Safety Matrix・Draft 解除を一発で通過する
  • post-merge-cleanup が agent 自律で完了する(手動依頼不要)
  • Skill/SubAgent context が肥大化せず routing に必要な情報のみを保持する

Current Validated Scope

9 件の child issue が扱う Allowed Paths の集合:

  • .claude/skills/agent-run-preflight/**(新規 skill)
  • .claude/hooks/check_hook_integrity.py / .claude/hooks/tests/test_check_hook_integrity.py
  • .github/workflows/check-hook-integrity.yml
  • .claude/skills/open-pr/scripts/generate_pr_body.py / validate_pr_body_hygiene.py
  • .claude/skills/open-pr/templates/pr_body.ja.md / .claude/skills/open-pr/tests/test_pr_body_hygiene.py
  • .claude/hooks/worktree_scope_guard.py / .claude/hooks/worktree_scope_guard.sh / .claude/hooks/tests/test_worktree_scope_guard.py
  • .claude/skills/post-merge-cleanup/SKILL.md
  • .claude/skills/issue-contract-review/scripts/baseline_vc_preflight.py / check_product_spec_contract.py / validate_script_cli_contracts.py
  • .claude/skills/impl-review-loop/scripts/ensure_contract_snapshot.py
  • .claude/skills/pr-review-judge/scripts/build_review_requirement_inventory.py / validate_review_requirement_inventory.py / wait_pr_checks.py
  • .claude/skills/pr-review-judge/references/review-requirement-inventory.md
  • .claude/skills/agent-context-audit/**(新規 skill)
  • .claude/hooks/generate_session_manifest_from_hook.mjs / session_manifest_coordinator.sh / session_manifest_debounce.mjs
  • .claude/hooks/tests/test_session_manifest_debounce.py

Decisions Fixed

  • 2026-06-21: impl-review-loop の auto-run 復帰は行わず、fail-only gate を維持したうえで readiness preflight を追加する
  • 2026-06-21: 実装優先順序: Issue 2(Hook Guard)→ Issue 4(worktree 分類)→ Issue 3(PR body 生成)→ Issue 1(Preflight)→ 残り

Quality Decision Record

N/A

Parent Closure Rule

  • delivery-rollup: 全 9 件の child issue がクローズされた時点でこの parent をクローズする
  • quality-gate: N/A
  • routing-map: N/A
  • decision-log: N/A

Child Issues

起票完了(2026-06-21):

Remaining Parent Gaps

  • なし(全 9 件起票済み)

Phase Handoff Contract

  • Desired Destination: 上記参照
  • Current Validated Scope: 上記参照
  • Remaining Parent Gaps: 上記参照
  • Current Objective: 各 child issue の Outcome 参照
  • Normative References: .claude/hooks/worktree_scope_guard.py, .claude/settings.json, .claude/skills/impl-review-loop/SKILL.md
  • Stop Conditions: 各 child issue の Stop Conditions 参照

Acceptance Criteria

  • 全 9 件の child issue がクローズされている
  • 実施前後で impl-review-loop の不要な往復ログが削減されている

Notes

なし

Sub-issues

Sub-issues

7 of 11 Issues completed
Loading 11 sub-issues

Activity

  1. added
    tracking
    state/in-progress
    on Jun 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    state/in-progresstracking

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions