Skip to content

実装: issue-refinement-loop canonical runtime の hook allowlist を整備する #1395

Closed
6 of 6 issues completed

Description

@squne121

Machine-Readable Contract

contract_schema_version: v1
issue_kind: implementation
parent_issue: "#1384"
goal_ref: "issue-refinement-loop の canonical preflight runtime が root checkout 保護と raw mutation deny を保ったまま hook で誤判定されないようにする"
change_kind: workflow
preflight_scope: implementation
runtime_verification:
  required: true
  mode: immediate
  evidence_type: hook-evaluation-tests

Parent Issue

#1384

Parent Goal Ref

  • 実装: VRT overlay rollout の baseline maturity registry を定義する #1384 refinement 中、run_refinement_preflight.py などの canonical preflight 経路が local_main_branch_guard により issue_refinement_direct / compound_wrapper_blocked として止まり、手順が controlled edit fallback へ逸れた。
  • ただし現行の安全境界は direct skill script allow ではなく、skill_runtime_exec.py --command-id preflight.run の exact executor allow を正本とする。

Current Validated Scope

  • local_main_branch_guard / Codex hook parity / Claude hook parity / repair hint の allow/block 境界だけを扱う。
  • 本 Issue は preflight.run executor 境界に縮小し、build_refinement_phase_state.py と decide_next_loop_action.py の direct allow は扱わない。
  • GitHub Issue mutation の raw bypass は許可しない。

Remaining Parent Gaps

Outcome

issue-refinement-loop の root preflight は direct skill script 実行ではなく、uv run python3 scripts/agent-guards/skill_runtime_exec.py --command-id preflight.run --issue-number <N> --repo squne121/loop-protocol の exact executor 経由でのみ allow される。direct .claude/skills/issue-refinement-loop/scripts/*.py、raw gh issue edit/comment、unsafe compound/wrapper は引き続き fail-closed で deny され、Claude/Codex hook parity tests と repair hint で再現可能に検証できる。

In Scope

  • local_main_branch_guard.py で exact skill_runtime_exec.py --command-id preflight.run を skill_runtime_executor_command として allow する境界を regression test に固定する。
  • direct .claude/skills/issue-refinement-loop/scripts/run_refinement_preflight.py は引き続き issue_refinement_direct / unparseable_branch_mutation 系で block されることを固定する。
  • rtk wrapper は exact inner executor command に限って unwrap/allow され、rtk run uv ...、rtk bash -lc ...、rtk gh issue edit ...、direct skill script wrapper は block されることを固定する。
  • hook_repair_hints.py に、direct script ではなく exact executor command を提示する HOOK_COMMAND_REPAIR_HINT_V1 を追加または補強する。
  • Claude / Codex hook parity tests で同じ allow/deny matrix を検証する。
  • docs/dev/hook-boundaries.md の raw gh issue edit/comment/create 分類が現行の raw mutation deny 方針と矛盾する場合は、分類 drift を修正する。

Out of Scope

  • direct .claude/skills/issue-refinement-loop/scripts/*.py の root allow
  • build_refinement_phase_state.py / decide_next_loop_action.py の executor allow 追加
  • skill_runtime_exec.py / skill_runtime_command_policy.py / command registry の新規 command id 追加
  • Issue 本文更新 helper の仕様変更
  • raw gh issue edit / gh issue comment / mutating gh api -f body=... の許可
  • --dangerously-skip-permissions や Codex permission mode の変更
  • issue-refinement-loop planner 判定ロジックの変更
  • 実装: VRT overlay rollout の baseline maturity registry を定義する #1384 registry docs 本体の変更

Acceptance Criteria

  • AC1: root default branch で、uv run python3 scripts/agent-guards/skill_runtime_exec.py --command-id preflight.run --issue-number 1395 --repo squne121/loop-protocol が Claude hook evaluation で allow され、reason_code は skill_runtime_executor_command である。
  • AC2: root default branch で、同じ exact executor command が Codex hook evaluation で allow され、reason_code は skill_runtime_executor_command である。
  • AC3: direct uv run python3 .claude/skills/issue-refinement-loop/scripts/run_refinement_preflight.py --issue-number 1395 --repo squne121/loop-protocol は Claude/Codex hook evaluation で block され、issue_refinement_direct または同等の unsafe direct runtime diagnostic が出る。
  • AC4: rtk uv run python3 scripts/agent-guards/skill_runtime_exec.py --command-id preflight.run --issue-number 1395 --repo squne121/loop-protocol の exact inner executor command だけが allow される。
  • AC5: rtk run uv ...、rtk bash -lc ...、rtk gh issue edit ...、rtk uv run python3 .claude/skills/issue-refinement-loop/scripts/run_refinement_preflight.py ... は block される。
  • AC6: raw gh issue edit、gh issue comment、gh api -f body=... は引き続き block される。
  • AC7: issue_refinement_direct または unsafe direct runtime block の repair hint は、direct script ではなく uv run python3 scripts/agent-guards/skill_runtime_exec.py --command-id preflight.run --issue-number <N> --repo squne121/loop-protocol を suggested command として提示する。
  • AC8: .claude/hooks/tests/test_local_main_branch_guard.py と tests/codex/test_local_main_branch_guard.py が skill_runtime_executor を検証し、少なくとも Claude hook 側で issue_refinement_direct の deny regression を検証する。
  • AC9: docs/dev/hook-boundaries.md に raw GitHub mutation command の分類 drift が残らない。

Runtime Verification Applicability

runtime_verification_applicability:
  decision: immediate
  reason: "hook evaluation の allow/block/reason_code/repair hint は実テストで即時検証できる"
  applicable_acs:
    - AC1
    - AC2
    - AC3
    - AC4
    - AC5
    - AC6
    - AC7
    - AC8
    - AC9
  execution_environment: "local WSL2 Ubuntu 24.04 / repo hook tests"
  skip_conditions:
    - "ローカル依存関係が欠落し、hook test harness 自体が起動できない場合"
    - "Stop Conditions に該当する executor policy 拡張が必要と判明した場合"
  fallback_policy: "テストで再現不能な hook 実経路差分が出た場合は実装を停止し、follow-up Issue に分離する"
  artifact_requirements:
    - "Claude hook evaluation test output"
    - "Codex hook evaluation test output"
    - "repair hint payload or stderr assertion"
    - "docs drift check result"

Verification Commands

# AC1
$ uv run --locked pytest .claude/hooks/tests/test_local_main_branch_guard.py -k skill_runtime_executor -v

# AC2
$ uv run --locked pytest tests/codex/test_local_main_branch_guard.py -k skill_runtime_executor -v

# AC3
$ uv run --locked pytest .claude/hooks/tests/test_local_main_branch_guard.py -k direct_preflight_script_not_in_root_allowlist -v

# AC4
$ uv run --locked pytest tests/codex/test_local_main_branch_guard.py -k skill_runtime_executor -v

# AC5
$ uv run --locked pytest tests/codex/test_local_main_branch_guard.py -k rtk -v

# AC6
$ uv run --locked pytest .claude/hooks/tests/test_local_main_branch_guard.py -k gh_issue_edit -v

# AC7
# baseline-expect: pass
$ rg -n "skill_runtime_exec.py --command-id preflight.run" scripts/agent-guards/hook_repair_hints.py scripts/agent-guards/local_main_branch_guard.py .claude/hooks/tests/test_local_main_branch_guard.py tests/codex/test_local_main_branch_guard.py

# AC8
$ uv run --locked pytest .claude/hooks/tests/test_local_main_branch_guard.py tests/codex/test_local_main_branch_guard.py -k "skill_runtime_executor or direct_preflight_script_not_in_root_allowlist" -v

# AC9
# baseline-expect: pass
$ rg -n "gh issue edit" docs/dev/hook-boundaries.md scripts/agent-guards/local_main_branch_guard.py .claude/hooks/tests/test_local_main_branch_guard.py tests/codex/test_local_main_branch_guard.py

Allowed Paths

  • scripts/agent-guards/local_main_branch_guard.py
  • scripts/agent-guards/hook_repair_hints.py
  • scripts/agent-guards/tests/test_local_main_branch_guard.py
  • .claude/hooks/tests/test_local_main_branch_guard.py
  • tests/codex/test_local_main_branch_guard.py
  • docs/dev/hook-boundaries.md
  • docs/dev/agent-skill-boundaries.md

Stop Conditions

  • Allowed Paths 外の変更が必要と判明した場合
  • skill_runtime_exec.py / skill_runtime_command_policy.py / command registry の新規 command id 追加が必要と判明した場合
  • build_refinement_phase_state.py / decide_next_loop_action.py の executor allow が必要と判明した場合
  • .claude/skills/issue-refinement-loop/SKILL.md の direct command 手順修正が本 Issue の実装完了条件になると判明した場合
  • In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
  • 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
  • 後続 Phase / 別スコープへの波及が判明した場合
  • nested SubAgent delegation が必要になった場合
  • 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
  • raw GitHub mutation の許可が必要になった場合

Required Skills

  • Python
  • Hook policy

Required Design References

  • docs/dev/hook-boundaries.md
  • docs/dev/agent-skill-boundaries.md
  • .claude/skills/issue-refinement-loop/SKILL.md
  • scripts/agent-guards/skill_runtime_exec.py
  • scripts/agent-guards/skill_runtime_command_policy.py

Scope Delta

Delivery Rule

  • 1 Issue = 1 PR
  • 作業前に issue-contract-review で fresh CONTRACT_REVIEW_RESULT_V1 status: go を取得する。
  • raw mutation allowlist を広げず、exact executor command と deterministic tests で完結させる。

Sub-issues

Sub-issues

6 of 6 Issues completed
Loading 6 sub-issues

Activity

  1. added
    phase/implementation
    agent/implementer
    enhancement
    on Jul 7, 2026
  2. squne121 commented on Jul 8, 2026

    @squne121
    OwnerAuthor

    判定: REQUEST_CHANGES

    #1395 の目的は妥当です。#1384 refinement 中に run_refinement_preflight.py や SSOT discovery / worktree setup 系の read-only/canonical command が local_main_branch_guard に issue_refinement_direct / compound_wrapper_blocked として止められた、という問題設定は具体的です。#1395 は raw mutation を引き続き deny し、Codex/Claude parity と repair hint で canonical command と raw mutation を分離する方針も正しいです。

    ただし、現行 contract のまま実装に入ると、既存の preflight.run 専用 privileged executor 境界と衝突します。特に「canonical run_refinement_preflight.py command」を direct script allow と解釈できる書き方、build_refinement_phase_state.py / decide_next_loop_action.py まで同一Issueで扱うスコープ、rtk wrapper の曖昧さ、SKILL.md の direct command 記述との不整合が P0 です。

    #1395 自体にはコメントはありません。関連文脈としては、#1154 が preflight.run 専用 privileged executor を導入し、PR #1177 がそれを merged 実装として閉じています。#1228 は no-worktree / no-env の root preflight allow を preflight.run に限って解消した後続です。#1026 は command registry を導入し、#1383 は controlled metadata mutation lane を別スコープで扱っています。

    P0-1: AC1 が direct script allow と executor allow を分離していない

    現行実装は、skill_runtime_exec.py --command-id preflight.run ... だけを exact executor として allow し、.claude/skills/issue-refinement-loop/scripts/run_refinement_preflight.py の direct root 実行は明示的に block します。local_main_branch_guard.py も exact executor を REASON_SKILL_RUNTIME_EXECUTOR で allow し、lookalike/direct issue-refinement runtime を issue_refinement_direct として block する分岐を持っています。

    この既存境界はテストでも固定済みです。Claude 側テストは exact skill_runtime_exec.py --command-id preflight.run を allow し、direct run_refinement_preflight.py は block することを確認しています。Codex 側も同じ exact executor 契約を持ち、noncanonical lexical form を block します。

    修正案: #1395 の AC1 は次のように書き換えるべきです。

    - [ ] AC1a: root default branch で、canonical executor command
      `uv run python3 scripts/agent-guards/skill_runtime_exec.py --command-id preflight.run --issue-number <N> --repo squne121/loop-protocol`
      が Claude/Codex hook evaluation で allow され、reason_code は `skill_runtime_executor_command` である。
    - [ ] AC1b: direct
      `uv run python3 .claude/skills/issue-refinement-loop/scripts/run_refinement_preflight.py ...`
      は引き続き `issue_refinement_direct` / `unparseable_branch_mutation` 系で block される。

    run_refinement_preflight.py という文字列を repair hint に出す場合も、direct script ではなく executor 経由の canonical shape を出す必要があります。

    P0-2: build_refinement_phase_state.py / decide_next_loop_action.py は現行 Allowed Paths では安全に許可できない

    #1395 は run_refinement_preflight.py、build_refinement_phase_state.py、decide_next_loop_action.py の許可境界を tests に固定するとしています。 しかし現行 SKILL_RUNTIME_COMMAND_POLICY_V2 の eligible command は preflight.run のみです。policy は root/no-worktree allow も preflight.run に限定しています。

    さらに skill_runtime_exec.py 側も registry から preflight.run を検証し、実行対象 script は run_refinement_preflight.py に固定されています。build_refinement_phase_state.py や decide_next_loop_action.py を executor 経由で安全に通す設計にはなっていません。

    command registry には preflight.run と decide.run はありますが、preflight.run だけが executor 契約に必要な execution_class / required_cwd / required_branch / allowed_write_roots / network_effect を持っています。build_refinement_phase_state.py の registry entry は確認できません。

    修正案は二択です。

    1. 実装: issue-refinement-loop canonical runtime の hook allowlist を整備する #1395 を preflight.run / local_main_branch_guard false-positive の修正に縮小し、build_refinement_phase_state.py と decide_next_loop_action.py は別 Issue に分離する。
    2. 実装: issue-refinement-loop canonical runtime の hook allowlist を整備する #1395 の Allowed Paths に skill_runtime_command_policy.py、skill_runtime_exec.py、command_registry.py、.claude/skills/issue-refinement-loop/SKILL.md、必要なら .claude/hooks/worktree_scope_guard.py を追加し、各 script ごとの effect inventory / path containment / argv schema / positive-negative hook tests を AC に追加する。

    現状の Allowed Paths は guard、repair hint、tests、docs に寄っており、Required Design References として SKILL.md を挙げながら、SKILL.md 自体の修正は許容していません。

    P0-3: SKILL.md の手順が direct command を案内しており、#1395 の実装だけでは運用上の false-green になる

    issue-refinement-loop/SKILL.md は Step 0f で direct uv run --locked python3 .claude/skills/.../run_refinement_preflight.py を示し、その直後に build_refinement_phase_state.py も direct 実行する手順を載せています。 Review phase 以降でも direct build_refinement_phase_state.py と direct decide_next_loop_action.py が記載されています。

    一方で repo の command registry は「SubAgent / main thread は手書き shell string を consume しない」という SSOT 方針を掲げています。 この矛盾を直さずに local_main_branch_guard.py のテストだけを green にしても、実際の loop procedure は direct command を出し続け、guard と衝突します。

    修正案: #1395 に SKILL.md / references の更新を含めるか、少なくとも Stop Condition に「SKILL.md の direct command 記述変更が必要なら本Issueを停止し、command registry / executor 対応Issueへ分割する」を追加してください。

    P0-4: rtk wrapper AC が曖昧で、wrapper bypass の再導入になり得る

    #1395 の AC2 は「rtk wrapper 経由の canonical command が compound_wrapper_blocked にならない」としていますが、rtk のどの lexical shape を許可するのかが未定義です。現行 local_main_branch_guard.py は compound/wrapped command を先に block し、その後 rtk inner command を解析します。unknown な rtk inner command は最終的に block されます。

    #1383 でも、rtk run uv ... や rtk gh issue edit が拒否され、controlled mutation executor lane が必要になった実観測が記載されています。 したがって、AC2 は「rtk wrapper なら canonical」と読める余地を排除する必要があります。

    修正案:

    - [ ] AC2a: `rtk uv run python3 scripts/agent-guards/skill_runtime_exec.py --command-id preflight.run ...`
      のような exact inner executor command だけが allow される。
    - [ ] AC2b: `rtk run uv ...`, `rtk bash -lc ...`, `rtk gh issue edit ...`,
      `rtk uv run python3 .claude/skills/.../run_refinement_preflight.py ...`
      は block される。

    P0-5: repair hint AC5 が現在の実装と検証方法では弱い

    hook_repair_hints.py の現在の reason-specific hint は direct_bypass_requires_rtk、rtk_unknown_inner、git add/commit/push、worktree context などに寄っており、issue_refinement_direct / compound_wrapper_blocked / run_refinement_preflight.py 用の exact executor hint はありません。

    また docs/dev/agent-skill-boundaries.md は、HOOK_COMMAND_REPAIR_HINT_V1 は steering 用 diagnostics であり、hook authorization を上書きしない、wrapper 展開や bypass shell を agent が自動採用してはならない、と定義しています。

    修正案: AC5 の検証は単なる rg -n "run_refinement_preflight.py" scripts/agent-guards/hook_repair_hints.py では不足です。少なくとも block stderr または result payload に以下を assert してください。

    HOOK_COMMAND_REPAIR_HINT_V1:
      blocked_command_class: "issue_refinement_direct"
      reason_code: "unparseable_branch_mutation"
      suggested_command: "uv run python3 scripts/agent-guards/skill_runtime_exec.py --command-id preflight.run --issue-number <N> --repo squne121/loop-protocol"
      forbidden_alternatives:
        - "direct .claude/skills/issue-refinement-loop/scripts/run_refinement_preflight.py"
        - "bash -lc ..."
        - "python -c ..."

    P1: hook-boundaries.md に gh mutation 分類の drift がある

    docs/dev/hook-boundaries.md は gh issue create または gh issue edit <N> が --repo と --body-file tmp/... を満たせば allow と説明しています。 しかし現行テストは raw gh issue edit を block する fixtures を持ち、Codex/Claude の mutation deny テストでも gh issue edit を block としています。

    GitHub CLI 公式 manual 上も gh issue edit は --body-file や title/label/assignee/project 等を編集できる remote mutation command です。gh issue create も issue を作成し、--body-file は body 入力元にすぎません。([GitHub CLI]1) (GitHub CLI) したがって #1395 が raw mutation deny を回帰テストに残すなら、docs 側の分類 drift を同時に整理する必要があります。

    P1: verification が hook 実経路ではなく、false-green を作りやすい

    Claude Code hooks は command hook に JSON context を stdin で渡し、PreToolUse は tool call の前に発火します。exit code 2 は PreToolUse では tool call を block し、PermissionRequest では permission を deny します。([Claude Platform Docs]3) ([Claude Platform Docs]3)

    そのため #1395 の verification は evaluate() 関数単体だけでは弱いです。最低限、以下の実 stdin JSON 経路を追加してください。

    uv run pytest .claude/hooks/tests/test_local_main_branch_guard.py -k "skill_runtime_executor or issue_refinement_direct" -v
    uv run pytest tests/codex/test_local_main_branch_guard.py -k "skill_runtime_executor or issue_refinement_direct" -v

    加えて、scripts/agent-guards/tests/test_local_main_branch_guard.py は shim であり、実体は .claude/hooks/tests/test_local_main_branch_guard.py にあります。#1395 の VC は shim 経由だけでなく、Claude/Codex の両実体を直接指定する方が安全です。

    Web検索を踏まえた実装品質条件

    実装方針は「shell string を緩く許す」ではなく、「exact argv / shell=False / deny-by-default / postcondition」です。Python 公式 docs は、subprocess は暗黙に shell を呼ばないため shell metacharacter を安全に子プロセスへ渡せる一方、shell=True を明示した場合は shell injection を避けるため quoting 責任がアプリ側にあると説明しています。([Python documentation]4) shlex は Unix shell 風の tokenization には使えますが、shell の完全 parser ではなく、返った token の semantic validation は利用側で必要です。([Python documentation]5)

    gh api は parameter を追加すると通常 POST に切り替わるため、gh api -f body=... や --raw-field を read-only と誤分類すると remote mutation 経路になります。([GitHub CLI]6) GitHub Issue 操作も gh issue edit --body-file や gh issue create --body-file は body 入力方式であって、操作自体は remote mutation です。([GitHub CLI]1) ([GitHub CLI]2)

    Git worktree は main worktree と linked worktree を分け、同一 repo で複数 branch を checkout するための公式機構です。#1395 が「dedicated worktree または controlled executor lane」を掲げるなら、main root direct script allow ではなく、linked worktree 分離または exact executor のどちらかに明確化すべきです。([Git]7)

    #1395 本文への具体的な修正案

    現行 Issue を通すなら、以下の形に直すのが安全です。

    ## Outcome
    `issue-refinement-loop` の root preflight は direct skill script 実行ではなく、
    `skill_runtime_exec.py --command-id preflight.run` の exact executor 経由でのみ allow される。
    direct `.claude/skills/issue-refinement-loop/scripts/*.py`、raw `gh issue edit/comment`、
    unsafe compound/wrapper は引き続き fail-closed で deny される。
    
    ## In Scope
    - `local_main_branch_guard.py` の `issue_refinement_direct` block に、
      canonical executor shape を示す repair hint を追加する。
    - `rtk` wrapper は exact inner executor command に限って unwrap される。
    - direct `run_refinement_preflight.py` は allow しない。
    - `build_refinement_phase_state.py` / `decide_next_loop_action.py` は本Issueでは direct allow しない。
      必要なら command_registry / skill_runtime policy / executor 対応を含む別Issueへ分離する。
    
    ## Acceptance Criteria
    - [ ] exact `skill_runtime_exec.py --command-id preflight.run` は Claude/Codex hook evaluation で allow。
    - [ ] direct `.claude/skills/issue-refinement-loop/scripts/run_refinement_preflight.py` は block。
    - [ ] exact `rtk` wrapper 以外の `rtk run uv ...`, `bash -lc`, `python -c`, pipe/redirect/chain は block。
    - [ ] raw `gh issue edit`, `gh issue comment`, `gh api -f body=...` は block。
    - [ ] repair hint は direct script ではなく exact executor command を提示する。
    - [ ] `.claude/hooks/tests/test_local_main_branch_guard.py` と `tests/codex/test_local_main_branch_guard.py` の parity tests が PASS。

    この修正を入れない場合、#1395 は #1154/#1177/#1228 で作った安全境界を「read-only/canonical だから direct skill script を許す」という古い失敗モードへ戻すリスクがあります。

  3. squne121 commented on Jul 8, 2026

    @squne121
    OwnerAuthor

    Refinement Loop: Approved

    The issue has been approved and is ready for implementation.

  4. squne121 commented on Jul 8, 2026

    @squne121
    OwnerAuthor

    Contract Review Result

    CONTRACT_REVIEW_RESULT_V1:
      status: go
      generated_at: "2026-07-08T12:40:51Z"
      generated_by: issue-contract-review
      issue_url: https://github.com/squne121/loop-protocol/issues/1395
      body_sha256: "sha256:c9fab15cc2c8341e37bae28dd2828edbea257afc11dbd06c859d22b87f0ad3f9"
      checks:
        readiness: go
        blockers: pass
        product_spec: pass
        vc_preflight: pass
      source: ensure_contract_snapshot_auto
  5. squne121 commented on Jul 8, 2026

    @squne121
    OwnerAuthor

    scope 統合メモ

    #1383 との Allowed Paths overlap を人間判断で scope 統合として扱います。

  6. squne121 commented on Jul 8, 2026

    @squne121
    OwnerAuthor

    impl-review-loop: 完了 (2026-07-08T13:45:00Z)

    IMPL_REVIEW_LOOP_RESULT_V1:
      schema_version: 1
      status: draft_pr_ready
      draft_pr_ready: true
      github_merge_ready: true
      merge_ready: true
      github_merge_state_status: CLEAN
      pr_url: "https://github.com/squne121/loop-protocol/pull/1399"
      head_sha: "c6cc85ae66e641a2e5b51892f9b55f192373c4d2"
      issue_number: 1395
      termination_reason: approved
      iteration: 1
      required_auto_actions: []
      contract_snapshot_url: "https://github.com/squne121/loop-protocol/issues/1395#issuecomment-4914868932"
      scope_integration:
        integrated_issue: 1383
        integrated_issue_status: closed
        integration_comment_url: "https://github.com/squne121/loop-protocol/issues/1395#issuecomment-4914941940"
      verification:
        test_verdict: PASS
        verification_commands_pass: 9
        verification_commands_fail: 0
        verification_skipped_count: 0
        required_checks: pass
      final_pr_state:
        is_draft: false
        mergeable: MERGEABLE
        merge_state_status: CLEAN
    
    FOLLOW_UP_MATERIALIZATION_RESULT_V1:
      schema_version: 1
      materialized_by: impl-review-loop
      follow_up_issues: []
  7. squne121 commented on Jul 8, 2026

    @squne121
    OwnerAuthor

    改善点追記: #1395 周辺の後続候補

    PR #1399 の reviewer 指摘対応中に、同種 Issue / PR / agent 運用へ再利用できる改善点を整理しました。

    IMPROVEMENT_TRIAGE_APPEND_V1:
      source_pr: 1399
      source_issue: 1395
      current_head: "548a586282307908903b917c49102f20d267d4e1"
      append_target: "#1395"
      items:
        - id: G1
          priority: high
          status: covered_by_pr_1399
          summary: "raw gh api -f body=... は gh_mutation_denied ではなく gh_api_not_allowed / github_api_command 系として扱う方針を docs と tests で揃える"
        - id: G2
          priority: high
          status: covered_by_pr_1399
          summary: "Claude / Codex hook parity tests に gh api の negative variants と reason_code assertion を追加する"
        - id: G3
          priority: medium
          status: follow_up_context
          summary: "issue-refinement-loop SKILL の direct execution 文言は executor / registry policy と衝突しないよう継続監視する"
        - id: G5
          priority: medium
          status: follow_up_context
          summary: "issue_refinement_direct の repair hint は direct script ではなく exact executor command を提示する分岐を維持する"

    G1/G2 は PR #1399 head 548a586282307908903b917c49102f20d267d4e1 で対応済みです。G3/G5 は #1395 の実装境界と reviewer コメントに紐づく運用上の注意点として、この Issue に追記します。

  8. squne121 commented on Jul 8, 2026

    @squne121
    OwnerAuthor

    impl-review-loop: 完了更新 (current head)

    PR #1399 は current head a8e7e3eb20ee24694387c4233e68a04a7f98b56b で再同期され、検証と PR review loop が完了しました。

    IMPL_REVIEW_LOOP_RESULT_V1:
      schema_version: 1
      status: draft_pr_ready
      draft_pr_ready: true
      github_merge_ready: true
      merge_ready: true
      github_merge_state_status: CLEAN
      pr_url: "https://github.com/squne121/loop-protocol/pull/1399"
      head_sha: "a8e7e3eb20ee24694387c4233e68a04a7f98b56b"
      issue_number: 1395
      termination_reason: approved
      iteration: 2
      required_auto_actions: []
      contract_snapshot_url: "https://github.com/squne121/loop-protocol/issues/1395#issuecomment-4914868932"
      verification:
        test_verdict: PASS
        verification_commands_pass: 9
        verification_commands_fail: 0
        verification_skipped_count: 0
        ci_verdict_summary: all_pass
        required_checks: pass
      final_pr_state:
        is_draft: false
        mergeable: MERGEABLE
        merge_state_status: CLEAN
      follow_up_materialization:
        created_issues:
          - "https://github.com/squne121/loop-protocol/issues/1401"
          - "https://github.com/squne121/loop-protocol/issues/1402"
    
    FOLLOW_UP_MATERIALIZATION_RESULT_V1:
      schema_version: 1
      materialized_by: impl-review-loop
      follow_up_issues:
        - issue: 1401
          url: "https://github.com/squne121/loop-protocol/issues/1401"
          reason: "impl-review-loop PR continuation / resume checklist"
        - issue: 1402
          url: "https://github.com/squne121/loop-protocol/issues/1402"
          reason: "agent publish lane の手動介入依存解消"

    次アクション: 人間レビュー → マージ → post-merge-cleanup

  9. squne121 commented on Jul 8, 2026

    @squne121
    OwnerAuthor

    post-merge-cleanup: 完了 (2026-07-08T17:44:00Z)

    • status: partial
    • 次アクション: ローカル branch worktree-issue-1395-hook-allowlist は ancestry 上 not fully merged 扱いのため残存。worktree は削除済み。
    POST_MERGE_CLEANUP_REPORT_V1:
      status: partial
      generated_at: "2026-07-08T17:44:00Z"
      generated_by: post-merge-cleanup
      human_review_required: true
      cleaned_branches: []
      cleaned_worktrees:
        - "/home/squne/projects/LOOP_PROTOCOL/.claude/worktrees/issue-1395-hook-allowlist"
      unresolved_cleanup_items:
        - "branch_delete_failed: worktree-issue-1395-hook-allowlist は diff empty だが ancestry 上 not fully merged。git branch -d は拒否、git branch -D は hook policy で拒否。"
        - "root_untracked_residue: .tmp/"
        - "parent_issue_1384_has_open_child: #1396"
      parent_issue_status:
        parent_issue_number: 1384
        all_children_closed: false
        recommended_action: n/a
      superseded_prs: []
      follow_up_issue_requests: []
      stash_restored: n/a
      stash_entry_ref: null
      warnings:
        - "worker が superseded_prs として挙げた #1398 は #1373 に紐づくため close しない"
        - "worker が superseded_prs として挙げた #1400 は #1382 に紐づき、すでに MERGED のため close しない"
        - "main は origin/main の merge commit 0dcd7b0a5c4c56e1ea0cbfd05c58944fd94421f7 に整合済み"
      errors:
        - "cleanup_exec.py returned status:error with reason_code=branch_delete_failed"
    
    FOLLOW_UP_MATERIALIZATION_RESULT_V1:
      schema_version: 1
      materialized_by: post-merge-cleanup
      follow_up_issues: []
      note_only_observations:
        - dedupe_key: "post-merge-cleanup:1399:branch-delete-not-fully-merged"
          source_url: "https://github.com/squne121/loop-protocol/pull/1399"
          source_note_id: "branch-delete-not-fully-merged"
          summary: "PR merge 後の dedicated branch は diff empty だが ancestry 上 not fully merged。force delete は hook policy で拒否された。"
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

    agent/implementerenhancementphase/implementation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions