Skip to content

実装: Codex/Claude 共通の phase status・final report publisher を実装する #2041

Open

Description

@squne121

Machine-Readable Contract

contract_schema_version: v1
issue_kind: implementation
parent_issue: "none"
goal_ref: "PR #2027 の follow-up として、Codex/Claude 共通の phase status・final report publisher を安全に実装する"
change_kind: workflow

Parent Issue

なし(単独改善)

Parent Goal Ref

  • Goal: PR feat: Codex issue creator と editor を分離 #2027 の Allowed Paths 外にある impl-review-loop の status/final report 公開経路を、provider 差異に依存しない決定論的 publisher として分離する。
  • Desired Destination: 新規 follow-up Issue として、設計・実装・検証を 1 Issue = 1 PR で完結する。

Current Validated Scope

  • impl-review-loop の root/control-plane が Codex/Claude 共通の閉じた phase status 入力を検証し、PR conversation comment を run 単位で marker-based upsert する経路。
  • implementation / verification / review / final の各 phase を current PR head に束縛し、publish 後の comment readback receipt を生成する経路。
  • publish 前に停止しても同一 run marker を再利用して再開でき、duplicate または malformed marker、head drift、GitHub API エラーを fail-closed に分類する検証。

Remaining Parent Gaps

なし。PR #2027 の issue-creator / issue-editor role 分離および current-head 修復は本 Issue の対象外。

Outcome

Codex/Claude 共通の phase status と final report を、current head と comment receipt に束縛して run ごとに単一の PR コメントへ安全に upsert できる impl-review-loop publisher と、その回帰テストが追加されている状態。

Background

PR #2027 のレビューコメントで、テスト phase のコメント欠如は現行仕様、PR review / final report の公開欠如は control-plane 契約違反、iteration progress の共通公開 schema は仕様不足と整理された。PR #2027 への混在は Allowed Paths 外のため禁止する。

決定論的修正(採用): root/control-plane が既存の GitHub Issue Comments API marker/upsert 基盤を再利用し、閉じた status schema の検証、ownership marker 検索、POST/PATCH、postcondition readback、head-bound receipt を一つの publisher に集約する。

workaround(不採用): 各 provider の prompt / hook / gh pr comment --edit-last にコメント投稿を委ねる。run/phase 所有権を識別できず、並行実行・クラッシュ再開・hook 未発火で誤更新または公開漏れを防げないため採用しない。

Source

In Scope

  • IMPL_REVIEW_LOOP_STATUS_V1 の入力 schema と、provider、issue/PR/run、iteration、phase、state、head SHA、source-result digest を必須にする publisher を実装する。
  • root/control-plane からのみ publisher を同期呼出しし、worker / test-runner / pr-reviewer に GitHub write authority を追加しない。
  • ownership marker と digest marker による run 単位の 0 件 POST / 1 件 PATCH / 2 件以上または malformed fail-closed、readback receipt、head drift 無効化、再開を実装する。
  • 403、404、422、secondary rate limit、network timeout を分類して publish 失敗を loop 成功へ昇格させない。
  • implementation / verification / review / final の phase と final report を current head に束縛して公開するよう、impl-review-loop の手順・テストを更新する。

Out of Scope

Acceptance Criteria

  • AC1: Codex/Claude 共通の閉じた IMPL_REVIEW_LOOP_STATUS_V1 schema が、repository、issue_number、pr_number、run_id、iteration、phase、state、provider、head_sha、source_result_sha256 を検証し、不正入力を publish 前に拒否する。
  • AC2: root/control-plane だけが publisher を呼び、worker / test-runner / pr-reviewer は GitHub write を行わない。
  • AC3: 同一 repository / issue / PR / run_id の ownership marker は 0 件で POST、1 件で同一 comment ID への PATCH、2 件以上または malformed marker で fail-closed となる。
  • AC4: implementation、verification、review、final の各公開値は publish 前後の current PR head と一致し、head drift 後の旧 APPROVE / final report は公開または成功扱いにならない。
  • AC5: publish 成功時の receipt は comment_id、URL、payload digest、target PR、head SHA、run_id を含む readback 結果に束縛される。
  • AC6: crash-after-result-before-publish を同じ run_id で再開しても、PR comment は 1 件だけになり、最終値へ更新される。
  • AC7: 403、404、422、secondary rate limit、network timeout の各失敗は分類され、publish 失敗を loop 成功または approved 終端にしない。
  • AC8: gh pr comment --edit-last を impl-review-loop の公開経路で使用せず、既存の marker comment 基盤を経由する。

Verification Commands

# AC1
$ uv run --locked pytest .claude/skills/impl-review-loop/tests/test_publish_impl_review_loop_status.py -q
# AC2
$ uv run --locked pytest .claude/skills/impl-review-loop/tests/test_publish_impl_review_loop_status.py -q
# AC3
$ uv run --locked pytest .claude/skills/impl-review-loop/tests/test_publish_impl_review_loop_status.py -q
# AC4
$ uv run --locked pytest .claude/skills/impl-review-loop/tests/test_publish_impl_review_loop_status.py -q
# AC5
$ uv run --locked pytest .claude/skills/impl-review-loop/tests/test_publish_impl_review_loop_status.py -q
# AC6
$ uv run --locked pytest .claude/skills/impl-review-loop/tests/test_publish_impl_review_loop_status.py -q
# AC7
$ uv run --locked pytest .claude/skills/impl-review-loop/tests/test_publish_impl_review_loop_status.py -q
# AC8
$ node --test tests/agent-logs/github-comment-upsert.test.ts

Allowed Paths

  • .claude/skills/impl-review-loop/SKILL.md
  • .claude/skills/impl-review-loop/steps/step-2-verification.md
  • .claude/skills/impl-review-loop/steps/step-4-pr-review.md
  • .claude/skills/impl-review-loop/steps/step-5-feedback-and-termination.md
  • .claude/skills/impl-review-loop/scripts/publish_impl_review_loop_status.py
  • .claude/skills/impl-review-loop/tests/test_publish_impl_review_loop_status.py
  • scripts/agent-logs/lib/github-comments.mjs
  • tests/agent-logs/github-comment-upsert.test.ts

Stop Conditions

  • Allowed Paths 外の変更が必要と判明した場合
  • In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
  • 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
  • 後続 Phase / 別スコープへの波及が判明した場合
  • nested SubAgent delegation が必要になった場合
  • 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合

Required Skills

なし

Required Design References

  • docs/dev/agent-skill-boundaries.md#オーケストレーター設計原則
  • docs/dev/agent-skill-boundaries.md#impl-review-loop V2 routing boundary
  • docs/dev/workflows/impl-review-loop-design.md#Artifact and Evidence Contract

Scope Delta

N/A

Runtime Verification Applicability

  • decision: not_applicable
  • reason: publisher の schema、marker upsert、head binding、failure classification は fixture と mock GitHub client を用いた決定論的検証で完結し、実 agent runtime の PASS 主張を含まない。

Notes for Reviewer

Delivery Rule

  • 1 Issue = 1 PR。専用 worktree と Draft PR を使用する。
  • PR feat: Codex issue creator と editor を分離 #2027 には変更を混在させない。
  • publisher の live GitHub mutation は root/control-plane の controlled executor に限定し、merge は人間が判断する。

Activity

  1. added
    phase/implementation
    agent/implementer
    enhancement
    follow-up
    on Aug 8, 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

    agent/implementerenhancementfollow-upphase/implementation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions