Skip to content

実装: refinement_approved signal で未 claim の Issue を FACT_TASK_IDENTITY_CONFLICT と誤報告しない #2826

Closed

Description

@squne121

Machine-Readable Contract

contract_schema_version: v1
issue_kind: implementation
parent_issue: "none"
goal_ref: "refinement_approved signal の claim 不在と origin Task の Issue identity 不一致を区別して分類する"
change_kind: code

Parent Issue

none

Parent Goal Ref

  • Goal: refinement_approved の workflow signal consumer が、genuine な claim 不在(origin Task に conflicting な Issue identity がない)と genuine な Task identity conflict(stale origin / wrong canonical Task / 別 Task が claim 済み)を正確に分類する状態にする
  • Desired Destination: 単独改善(親 Issue なし)

Current Validated Scope

  • scripts/task-context/task_context_workflow_signals.py の refinement_approved 経路で、target Issue claim と origin Task の live Issue identity を独立に確認する refinement 専用の narrow な検証を用いる
  • cleanup_completed が使う既存の _validate_required_claims_tx() の意味論は変更しない
  • tests/task-context/ に origin Task identity を含む境界 test を追加する

Remaining Parent Gaps

なし

Outcome

refinement_approved の claim 検証が、target Issue claim と origin Task の live Issue identity を独立に確認し、次の matrix どおりに分類する状態になり、境界 test が PASS している。cleanup_completed の既存挙動は変わらない。

target Issue claim origin Task の live Issue identity expected outcome
origin Task 自身が target を claim target 既存の normal / applied path
なし origin Task に live Issue claim なし non-mutating deferred / TARGET_ISSUE_UNCLAIMED
なし origin Task が別 Issue を claim conflict / FACT_TASK_IDENTITY_CONFLICT
別 Task が claim any conflict / FACT_TASK_IDENTITY_CONFLICT

Runtime Verification Applicability

  • decision: not_applicable
  • reason: Task Context DB fixture による hermetic test で完結し、実 runtime 環境の観測を要しないため

Background

  • 事象: 実装: Claude-GPT model/proxy 更新の runtime migration を完了工程に含め、人間介入を genuine blocker に限定する #2810 の issue-refinement-loop を approved 終了させた際、.claude/skills/issue-refinement-loop/scripts/publish_termination_report.py の _emit_refinement_approved_signal() が task_contextctl.py signal apply を呼び、signal_disposition='conflict' / reason_code='FACT_TASK_IDENTITY_CONFLICT'(task_context_signal_not_applied)が返った。コメント投稿自体は成功している。
  • 実 failure class は「pure な未 claim」ではない。実装: Claude-GPT model/proxy 更新の runtime migration を完了工程に含め、人間介入を genuine blocker に限定する #2810 の live claim は 0 件だったが、origin session の canonical Task は別 Issue (実装: scope_signal_delta.py の _BULLET_LINE_RE / extract_directive_items() を Markdown 順序付きリスト検出に対応させる #2812) の identity を保持していた(stale origin / wrong canonical Task)。これは genuine な identity conflict であり、FACT_TASK_IDENTITY_CONFLICT の分類自体は正しい。したがって 実装: Claude-GPT model/proxy 更新の runtime migration を完了工程に含め、人間介入を genuine blocker に限定する #2810 の exact regression は deferred の positive fixture ではなく、conflict の negative regression として固定する。
  • 現状の問題: _validate_required_claims_tx() は if not issue or issue["task_id"] != task_id により、target claim の「不在」と「別 Task が claim」を区別せず、さらに origin Task が別 Issue に bound 済みかも見ない。origin に conflicting な Issue identity がない pure な claim 不在まで conflict になり、診断上 stale origin と区別できない。
  • repository 内の前例: _validate_implementation_claims_tx() は target claim の有無とは別に、origin Task が unrelated な live Issue claim を持つか(other_issue query)を検証している。_validate_merged_prerequisites_tx() は claim 不在を deferred / IMPLEMENTATION_NOT_READY として区別している。repository 自身が「target claim」と「origin identity」を別概念として扱っている。
  • replay の現状(repository probe で実測): accepted な refinement_approved event が存在し、その後 claim が release された状態で同一 dedupe key が replay されると、claim 検証が dedupe 判定より先に走るため conflict / FACT_TASK_IDENTITY_CONFLICT になる(duplicate_noop ではない)。「claim 不在なら deferred」へ単純に変更すると、accepted business fact の Task identity が「現在 claim が無い」ことで隠れる false-green が成立する。
  • refinement_approved と cleanup_completed は _validate_required_claims_tx() を共有している。cleanup_completed は先に accepted merge fact を要求するため、「target Issue claim がまだ無い」という refinement の状態とは意味が異なる。
  • 既存 test は claim 済みの正常系 1 件のみで、origin Task の identity を変えた境界 test が無い。
  • outcome の reason_code は closed enum / schema ではなく、_outcome() に文字列を直接渡している。repository probe では reason code を宣言する別ファイル・docs 上の contract 文書は見つかっていない。
  • 制約: /task <target> は user-typed slash command だけが ACTIVE Task を変更できる(実装: Task ContextのUserPromptSubmit wrong-session guardをadvisory-only化し通常workflowをhard blockしない #2625)。stale origin を通常フローで発生させない責務(ordinary prompt での ACTIVE Task 追従)は OPEN 実装: 通常のIssue/PR promptでACTIVE Taskを自動rebindし /task 必須切替を撤廃する #2827 が所有する。本 Issue は workflow signal consumer 内の分類だけを所有し、cross-Task identity strictness を緩めず、auto-rebind・自動 claim 付与も行わない。
  • 注記: Issue title の「未 claim」は、上記 matrix の「origin Task に conflicting な Issue identity がない pure な claim 不在」だけを指す。

In Scope

  • refinement_approved 専用の narrow な claim 検証(関数名・実装形は任意。current code に合わせる)で上記 matrix を処理する
    • target claim を別 Task が保持 → conflict / FACT_TASK_IDENTITY_CONFLICT
    • target claim なし かつ origin Task が target 以外の live Issue claim を保持(_validate_implementation_claims_tx() の other_issue と同じ意味)→ conflict / FACT_TASK_IDENTITY_CONFLICT
    • target claim なし かつ origin Task に live Issue claim なし かつ当該 dedupe key の accepted event が存在しない → non-mutating な deferred / TARGET_ISSUE_UNCLAIMED
    • accepted な同一 dedupe key の event が存在する場合は deferred にしない(下記 replay 規則)
  • pure claim 不在用 reason code TARGET_ISSUE_UNCLAIMED の意味を固定する
    • applicability: origin Task に conflicting な live Issue identity がなく、target claim も存在しない場合のみ
    • disposition: deferred(success ではない。diagnostic / retry classification)
    • non-mutating: event・Task・Activity・Claim を一切変更しない
    • publish_termination_report.py の best-effort semantics(applied / duplicate_noop 以外は task_context_signal_not_applied artifact に残すだけで、approved handoff comment を rollback しない)は変更しない
  • replay 規則: accepted な refinement_approved event が既にあり target claim が存在しない場合、deferred にせず、別 Task の event なら conflict / FACT_TASK_IDENTITY_CONFLICT、同一 Task の replay は現行挙動(conflict / FACT_TASK_IDENTITY_CONFLICT)を変更せず test で固定する(同一 Task replay の再分類は本 Issue の対象外)
  • cleanup_completed の既存挙動(accepted merge 後に issue / PR claim が欠ければ conflict / FACT_TASK_IDENTITY_CONFLICT)を変更せず、test で non-regression として固定する
  • 境界 test を新規 file に追加する(fixture は既存の test_signal_workflow_contract._origin 等を再利用してよい)

Out of Scope

Acceptance Criteria

  • AC1: origin Task が target B を claim し signal target も B の場合、既存どおり applied になる(既存 test と新規 test の双方が PASS)
  • AC2: origin Task に live Issue claim がなく target B が未 claim の場合、deferred / TARGET_ISSUE_UNCLAIMED を返し、event・claim・Activity(refine が ACTIVE のまま)を一切変更しない
  • AC3: origin Task が別 Issue A を claim し target B が未 claim の場合、conflict / FACT_TASK_IDENTITY_CONFLICT を返し、DB を一切変更しない。この case を 実装: Claude-GPT model/proxy 更新の runtime migration を完了工程に含め、人間介入を genuine blocker に限定する #2810 の failure class の negative regression として独立した test にする(deferred の positive fixture にしない)
  • AC4: 別 Task C が target B を claim している場合、origin Task が Issue claim を持つ場合と持たない場合の双方で conflict / FACT_TASK_IDENTITY_CONFLICT を返す
  • AC5: accepted な refinement_approved event が存在し claim が release された後の replay で、別 Task で claim を持たない origin からの replay は conflict / FACT_TASK_IDENTITY_CONFLICT(deferred ではない)、同一 Task の replay は現行挙動の conflict / FACT_TASK_IDENTITY_CONFLICT のままである
  • AC6: cleanup_completed は accepted merge 後に issue claim が欠けても従来どおり conflict / FACT_TASK_IDENTITY_CONFLICT を返し、TARGET_ISSUE_UNCLAIMED を返さない。既存の cleanup 関連 test が変更なしで PASS する
  • AC7: TARGET_ISSUE_UNCLAIMED は AC2 の case でのみ返る。reason code は _outcome() への文字列であり、新しい enum・schema・registry・wrapper を追加しない。.claude/skills/issue-refinement-loop/scripts/publish_termination_report.py は変更しない

Verification Commands

# AC1
$ uv run --locked pytest tests/task-context/test_signal_refinement_approved.py tests/task-context/test_signal_refinement_claim_identity.py -q
# AC2
$ uv run --locked pytest tests/task-context/test_signal_refinement_claim_identity.py -q
# AC3
$ uv run --locked pytest tests/task-context/test_signal_refinement_claim_identity.py -q
# AC4
$ uv run --locked pytest tests/task-context/test_signal_refinement_claim_identity.py -q
# AC5
$ uv run --locked pytest tests/task-context/test_signal_refinement_claim_identity.py -q
# AC6
$ uv run --locked pytest tests/task-context/ -q
# AC7
$ rg -n "TARGET_ISSUE_UNCLAIMED" scripts/task-context/task_context_workflow_signals.py
# baseline-expect: pass
$ git diff --exit-code origin/main...HEAD -- .claude/skills/issue-refinement-loop/scripts/publish_termination_report.py
$ pnpm typecheck
$ pnpm lint
$ pnpm test
$ pnpm build

Allowed Paths

  • scripts/task-context/task_context_workflow_signals.py
  • tests/task-context/test_signal_refinement_approved.py
  • tests/task-context/test_signal_refinement_claim_identity.py(新規)

Stop Conditions

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

Required Skills

なし

Required Design References

  • docs/dev/workflow.md
  • docs/dev/agent-skill-boundaries.md

Scope Delta

N/A

Delivery Rule

Activity

  1. added
    phase/implementation
    agent/implementer
    enhancement
    on Sep 28, 2026
  2. squne121 commented on Sep 28, 2026

    @squne121
    OwnerAuthor

    Findings

    P1 — #2826 の AC1 は広すぎ、#2810 の実事象を誤って「claim 不在だけの問題」と定義している

    current main 070f99fc34605178791ccc4969dd3ac9614af6d3 と live #2826 / #2565 / #2810 / #2827、現行実装を確認した。#2826 は OPEN、コメント 0、関連 PR 0。

    task_context_workflow_signals.py::_validate_required_claims_tx() が現在、

    issue = _claim_for_tx(...)if not issue or issue["task_id"] != task_id:    return conflict / FACT_TASK_IDENTITY_CONFLICT

    として「target claim 不在」と「target を別 Task が claim」を潰している、という観察自体は正しい。

    しかし #2810 で実際に起きた状態は単純な「#2810 が未 claim」ではない。

    #2565 の canonical signal contract は、origin session から canonical Task を解決した後に claim/Task consistency を検証し、different resolved/claimed Task は conflict / FACT_TASK_IDENTITY_CONFLICT とする設計になっている。

    さらに現行 _validate_implementation_claims_tx() は既に、target claim の有無とは別に「origin Task が unrelated Issue claim を持つか」を other_issue query で検証している。つまり repository 自身がこの2軸を別概念として扱っている。

    したがって、

    target Issue が unclaimed → 常に deferred

    にすると、#2810 のような stale origin / wrong canonical Task を genuine identity conflict から単なる prerequisite-missing へ downgrade する。

    #2827 も、workflow signal の cross-Task strictness は維持し、根本修正を prompt-side ACTIVE Task rebind に置いている。これは #2565 と整合している。

    最小修正: #2826 の契約を次のように狭めるべき。

    target Issue claim | origin Task の live Issue identity | outcome -- | -- | -- origin Task 自身 | target | existing normal path なし | なし | deferred / なし | 別 Issue | conflict / FACT_TASK_IDENTITY_CONFLICT 別 Task | any | conflict / FACT_TASK_IDENTITY_CONFLICT

    つまり issue title / AC1 も「未 claim を常に conflict にしない」ではなく、claim absence と origin identity mismatch を区別する契約へ変更するのが妥当。


    P1 — 現在のテスト計画は target claim しか見ておらず、exact #2810 regression が false-green になり得る

    #2826 は「未 claim / 別 Task claim の境界 test」を求めているが、重要なのは target claim の状態だけではない。origin Task が何を claim しているかが抜けている。

    tests/task-context/test_signal_refinement_approved.py の current coverage は正常系1件だけ。一方、ordinary Issue prompt の正常経路では hook が Issue claim を作成してから refinement_approved が成功することも既存 integration regression で確認できる。

    したがって production で refinement_approved の target が unclaimed になった #2810 は、単純な「正常な claim-missing」ではなく、current ACTIVE Task が target に追従しなかったことによる異常状態だった可能性が高い。

    最低でも次の4ケースを独立 test にする必要がある。

    1. origin Task claims B / signal B → applied(既存正常系)
    2. origin Task has no Issue claim / B unclaimed → deferred
    3. origin Task claims A / B unclaimed → conflict ← 実装: Claude-GPT model/proxy 更新の runtime migration を完了工程に含め、人間介入を genuine blocker に限定する #2810 failure class
    4. Task C claims B / origin Task A → conflict

    加えて、accepted refinement_approved event が既に別 Task に存在する replay を claim release 後にどう分類するかも固定した方がよい。accepted business fact の Task identity を単なる「現在 claim が無い」によって隠してはいけない。


    P2 — shared _validate_required_claims_tx() をそのまま変更すると cleanup_completed まで意味が変わる

    現在、

    • refinement_approved
    • cleanup_completed

    が _validate_required_claims_tx() を共有している。

    ただし cleanup_completed は先に _matching_accepted_merge_tx() を通り、accepted merge fact と Task/PR/merge identity を要求する。これは refinement の「target Issue claim がまだ無い」という状態とは意味が違う。

    #2826 AC4 は「既存挙動を明示的に決めて test」としているが、期待 outcome が明記されていないため、implementation worker が helper 全体を

    missing claim => deferred

    へ変更しても AC4 を自己解釈で満たせてしまう。

    最小修正: generic framework は増やさず、

    • _validate_required_claims_tx() は cleanup semantics 用として現状維持する、または
    • refinement_approved 専用の narrow validator を追加する

    方が安全。

    例えば _validate_refinement_claim_tx() のような局所関数で上記2軸 matrix を処理し、cleanup_completed には一切波及させない。この方が個人開発としても変更面積と regression risk が小さい。


    P2 — 「新 reason_code」の contract ownership が未定義

    #2826 は「新 reason_code(conflict ではない)」を要求しつつ、

    名称は既存 enum/schema と整合させる

    としている。しかし current task_context_workflow_signals.py の outcome reason は closed enum/schema ではなく、_outcome() に文字列を直接渡している。今回の用途に対応する既存 enum は確認できなかった。

    一方 #2565 の workflow-signal v1 contract には outcome semantics がかなり具体的に定義されている。新しい public diagnostic reason を追加するなら、コードだけでなく current normative contract との parity を明示した方がよい。

    新しい schema/wrapper/approval layer を追加する必要はない。例えば TARGET_ISSUE_UNCLAIMED のような bounded reason を採用するなら、

    • exact applicability: origin Task に conflicting primary Issue claim がない場合のみ
    • disposition: deferred
    • consumer semantics: retry/success ではなく diagnostic
    • publish_termination_report.py の best-effort behavior は変更なし

    まで Issue 本文で固定すれば十分。

    現行 producer は applied / duplicate_noop 以外を task_context_signal_not_applied artifact に残すだけで、approved handoff comment を rollback しない。このため reason-code変更は成功経路を増やす修正ではなく、あくまで taxonomy 修正である。

    外部仕様との照合

    current Claude Code 公式 Hooks Reference は UserPromptSubmit を「ユーザーが prompt を submit した時」、UserPromptExpansion を「user-typed command が展開される時」と定義している。Claude Code ただし upstream #16952 では Claude Code 2.1.1 で SubAgent completion 時にも UserPromptSubmit が発火した再現報告がある。GitHub

    したがって #2827 が human turn provenance を actual runtime で確認しながら prompt-side rebind を直す方向は妥当で、その runtime uncertainty を理由に workflow-signal consumer の cross-Task identity check を緩めるべきではない。

    SQLite 側は BEGIN IMMEDIATE が transaction 開始時に write transaction を確保する仕様なので、claim validation より前に write を行わない今回の consumer classification は hermetic DB fixture で十分検証可能。SQLite その意味では #2826 の Runtime Verification Applicability: not_applicable 自体は問題ではない。

    推奨する Issue 修正

    レビュー判定は REQUEST_CHANGES 相当。実装を始める前に #2826 の contract を修正した方がよい。

    特に Outcome / AC1 を、

    refinement_approved の target Issue claim が存在しない場合、origin Task 自身が別の live primary Issue claim を保持しているかを区別する。origin が別 Issue に bound 済みなら従来どおり FACT_TASK_IDENTITY_CONFLICT。origin Task に conflicting Issue identity が無い pure claim-missing の場合のみ non-mutating deferred / <new reason>。

    へ変更し、#2810 exact regression を「deferred の positive fixture」ではなく stale-origin conflict の negative fixture として固定するのが重要。

    この修正なら #2827 と責務がきれいに分かれる。

    新しい security gate、generic signal framework、runtime harness は不要。局所 validator + 境界 regression tests で十分です。

    ## Findings

    P1 — #2826 の AC1 は広すぎ、#2810 の実事象を誤って「claim 不在だけの問題」と定義している

    current main 070f99fc34605178791ccc4969dd3ac9614af6d3 と live #2826 / #2565 / #2810 / #2827、現行実装を確認した。#2826 は OPEN、コメント 0、関連 PR 0。

    task_context_workflow_signals.py::_validate_required_claims_tx() が現在、

    issue = _claim_for_tx(...)
    if not issue or issue["task_id"] != task_id:
        return conflict / FACT_TASK_IDENTITY_CONFLICT

    として「target claim 不在」と「target を別 Task が claim」を潰している、という観察自体は正しい。

    しかし #2810 で実際に起きた状態は単純な「#2810 が未 claim」ではない。

    #2565 の canonical signal contract は、origin session から canonical Task を解決した後に claim/Task consistency を検証し、different resolved/claimed Task は conflict / FACT_TASK_IDENTITY_CONFLICT とする設計になっている。

    さらに現行 _validate_implementation_claims_tx() は既に、target claim の有無とは別に「origin Task が unrelated Issue claim を持つか」を other_issue query で検証している。つまり repository 自身がこの2軸を別概念として扱っている。

    したがって、

    target Issue が unclaimed → 常に deferred

    にすると、#2810 のような stale origin / wrong canonical Task を genuine identity conflict から単なる prerequisite-missing へ downgrade する。

    #2827 も、workflow signal の cross-Task strictness は維持し、根本修正を prompt-side ACTIVE Task rebind に置いている。これは #2565 と整合している。

    最小修正: #2826 の契約を次のように狭めるべき。

    target Issue claim origin Task の live Issue identity outcome
    origin Task 自身 target existing normal path
    なし なし deferred / <claim-missing reason>
    なし 別 Issue conflict / FACT_TASK_IDENTITY_CONFLICT
    別 Task any conflict / FACT_TASK_IDENTITY_CONFLICT

    つまり issue title / AC1 も「未 claim を常に conflict にしない」ではなく、claim absence と origin identity mismatch を区別する契約へ変更するのが妥当。


    P1 — 現在のテスト計画は target claim しか見ておらず、exact #2810 regression が false-green になり得る

    #2826 は「未 claim / 別 Task claim の境界 test」を求めているが、重要なのは target claim の状態だけではない。origin Task が何を claim しているかが抜けている。

    tests/task-context/test_signal_refinement_approved.py の current coverage は正常系1件だけ。一方、ordinary Issue prompt の正常経路では hook が Issue claim を作成してから refinement_approved が成功することも既存 integration regression で確認できる。

    したがって production で refinement_approved の target が unclaimed になった #2810 は、単純な「正常な claim-missing」ではなく、current ACTIVE Task が target に追従しなかったことによる異常状態だった可能性が高い。

    最低でも次の4ケースを独立 test にする必要がある。

    1. origin Task claims B / signal B → applied(既存正常系)
    2. origin Task has no Issue claim / B unclaimed → deferred
    3. origin Task claims A / B unclaimed → conflict ← 実装: Claude-GPT model/proxy 更新の runtime migration を完了工程に含め、人間介入を genuine blocker に限定する #2810 failure class
    4. Task C claims B / origin Task A → conflict

    加えて、accepted refinement_approved event が既に別 Task に存在する replay を claim release 後にどう分類するかも固定した方がよい。accepted business fact の Task identity を単なる「現在 claim が無い」によって隠してはいけない。


    P2 — shared _validate_required_claims_tx() をそのまま変更すると cleanup_completed まで意味が変わる

    現在、

    • refinement_approved
    • cleanup_completed

    が _validate_required_claims_tx() を共有している。

    ただし cleanup_completed は先に _matching_accepted_merge_tx() を通り、accepted merge fact と Task/PR/merge identity を要求する。これは refinement の「target Issue claim がまだ無い」という状態とは意味が違う。

    #2826 AC4 は「既存挙動を明示的に決めて test」としているが、期待 outcome が明記されていないため、implementation worker が helper 全体を

    missing claim => deferred
    

    へ変更しても AC4 を自己解釈で満たせてしまう。

    最小修正: generic framework は増やさず、

    • _validate_required_claims_tx() は cleanup semantics 用として現状維持する、または
    • refinement_approved 専用の narrow validator を追加する

    方が安全。

    例えば _validate_refinement_claim_tx() のような局所関数で上記2軸 matrix を処理し、cleanup_completed には一切波及させない。この方が個人開発としても変更面積と regression risk が小さい。


    P2 — 「新 reason_code」の contract ownership が未定義

    #2826 は「新 reason_code(conflict ではない)」を要求しつつ、

    名称は既存 enum/schema と整合させる

    としている。しかし current task_context_workflow_signals.py の outcome reason は closed enum/schema ではなく、_outcome() に文字列を直接渡している。今回の用途に対応する既存 enum は確認できなかった。

    一方 #2565 の workflow-signal v1 contract には outcome semantics がかなり具体的に定義されている。新しい public diagnostic reason を追加するなら、コードだけでなく current normative contract との parity を明示した方がよい。

    新しい schema/wrapper/approval layer を追加する必要はない。例えば TARGET_ISSUE_UNCLAIMED のような bounded reason を採用するなら、

    • exact applicability: origin Task に conflicting primary Issue claim がない場合のみ
    • disposition: deferred
    • consumer semantics: retry/success ではなく diagnostic
    • publish_termination_report.py の best-effort behavior は変更なし

    まで Issue 本文で固定すれば十分。

    現行 producer は applied / duplicate_noop 以外を task_context_signal_not_applied artifact に残すだけで、approved handoff comment を rollback しない。このため reason-code変更は成功経路を増やす修正ではなく、あくまで taxonomy 修正である。

    外部仕様との照合

    current Claude Code 公式 Hooks Reference は UserPromptSubmit を「ユーザーが prompt を submit した時」、UserPromptExpansion を「user-typed command が展開される時」と定義している。:chatgpt-content-reference{index="0"} ただし upstream #16952 では Claude Code 2.1.1 で SubAgent completion 時にも UserPromptSubmit が発火した再現報告がある。:chatgpt-content-reference{index="1"}

    したがって #2827 が human turn provenance を actual runtime で確認しながら prompt-side rebind を直す方向は妥当で、その runtime uncertainty を理由に workflow-signal consumer の cross-Task identity check を緩めるべきではない。

    SQLite 側は BEGIN IMMEDIATE が transaction 開始時に write transaction を確保する仕様なので、claim validation より前に write を行わない今回の consumer classification は hermetic DB fixture で十分検証可能。:chatgpt-content-reference{index="2"} その意味では #2826 の Runtime Verification Applicability: not_applicable 自体は問題ではない。

    推奨する Issue 修正

    レビュー判定は REQUEST_CHANGES 相当。実装を始める前に #2826 の contract を修正した方がよい。

    特に Outcome / AC1 を、

    refinement_approved の target Issue claim が存在しない場合、origin Task 自身が別の live primary Issue claim を保持しているかを区別する。origin が別 Issue に bound 済みなら従来どおり FACT_TASK_IDENTITY_CONFLICT。origin Task に conflicting Issue identity が無い pure claim-missing の場合のみ non-mutating deferred / <new reason>。

    へ変更し、#2810 exact regression を「deferred の positive fixture」ではなく stale-origin conflict の negative fixture として固定するのが重要。

    この修正なら #2827 と責務がきれいに分かれる。

    新しい security gate、generic signal framework、runtime harness は不要。局所 validator + 境界 regression tests で十分です。

  3. squne121 commented on Sep 28, 2026

    @squne121
    OwnerAuthor

    確認した current main は 070f99fc34605178791ccc4969dd3ac9614af6d3、#2826 は OPEN、関連 PR はまだありません。指定コメント #issuecomment-5879445043 は OWNER author association なので、現行 issue-refinement-loop の with_human_context lane に渡す trusted human-context anchor として扱うのが適切です。

    推奨する到達点は、#2826 を「unclaimed なら常に deferred」から、target claim の状態と origin Task の live Issue identity を独立に分類する契約へ refinement することです。特に #2810 を deferred positive case にしてはいけず、origin Task=A / target B unclaimed → FACT_TASK_IDENTITY_CONFLICT の stale-origin regression として固定する必要があります。cleanup_completed への意味変更を避け、可能なら refinement 専用の局所 validator に閉じる方向です。

    また current Claude Code では SubAgent は foreground/background の双方を取り得て、interactive session では background になるケースもあります。したがって「dispatch 済み」を完了扱いせず、実結果を受領する join barrier を明記するのは妥当です。Claude Code 現行公式仕様上も UserPromptSubmit と user-typed command の UserPromptExpansion は別イベントです。Claude Code

    再発防止については、stale origin 自体を通常フローで発生させない責務は既存 OPEN Issue #2827 がすでに所有しています。したがって現時点では重複 Issue は起票しません。refinement 中に #2827 と非重複の恒久対策が見つかった場合だけ、dedupe 後に新規 Issue を materialize させるのが適切です。

    以下を、既に auto mode で起動中の対話的 Claude Code にそのまま貼れます。

    repo は squne121/loop-protocol。

    対象:
    https://github.com/squne121/loop-protocol/issues/2826

    trusted human-context anchor:
    https://github.com/squne121/loop-protocol/issues/2826#issuecomment-5879445043

    現在の interactive Claude Code session / auto mode をそのまま継続し、issue-refinement-loop を対象 Issue #2826 に対して実行してください。loop iteration ごとの人間承認は要求せず、current repository の canonical issue-refinement-loop contract に従って bounded に自律継続してください。Claude Code の permission mode を変更したり、bypassPermissions / --dangerously-skip-permissions を使用したりしないでください。

    最初に必ず live state を fresh 取得してください。私がこの prompt を作成した時点の main は 070f99fc34605178791ccc4969dd3ac9614af6d3 でしたが、これは execution authority ではありません。開始時点の current main、Issue #2826 本文、全コメント、指定 OWNER anchor、関連 Issue #2810 / #2565 / #2625 / #2740 / #2827、関連 PR、current repository assets を再取得し、fresh state を authority にしてください。

    current HEAD の以下を実際に読み、過去知識で procedure を再構成しないでください。

    .claude/skills/issue-refinement-loop/SKILL.md
    .claude/skills/issue-refinement-loop/references/anchor-comment-handling.md
    .claude/skills/issue-refinement-loop/references/semantic-design-review.md
    .claude/skills/issue-refinement-loop/references/follow-up-materialization.md
    .claude/skills/issue-refinement-loop/references/termination-policy.md
    docs/dev/workflow.md
    docs/dev/agent-skill-boundaries.md

    また、対象契約の判断に必要な current implementation と tests、特に以下を fresh HEAD で確認してください。

    scripts/task-context/task_context_workflow_signals.py
    tests/task-context/test_signal_refinement_approved.py

    指定コメントは OWNER による explicit review directive です。URL 単独の unlabeled anchor としてではなく、current issue-refinement-loop が定める direct trusted human context として処理してください。canonical preflight/contract-update route が current HEAD でも同じなら、preflight.run.with_human_context → 必要に応じて contract_update.run.with_human_context の正規経路を使ってください。command syntax は current SKILL.md / command registry を authority とし、この prompt の記述より repository 側が更新されていれば repository 側を優先してください。

    今回の refinement で最優先に吸収すべき OWNER directive は次の意味です。

    #2826 の現状の「target Issue が unclaimed なら deferred」という広すぎる契約を修正し、refinement_approved の claim validation を少なくとも次の二軸で扱う契約にしてください。

    target Issue claim と origin Task の live primary Issue identity を独立に確認すること。

    期待する semantic matrix は次のとおりです。

    target Issue claim | origin Task live Issue identity | expected outcome -- | -- | -- origin Task 自身が target を claim | target | existing normal/applied path target claim なし | origin Task に Issue claim なし | non-mutating deferred / target claim なし | origin Task が別 Issue を claim | conflict / FACT_TASK_IDENTITY_CONFLICT target を別 Task が claim | any | conflict / FACT_TASK_IDENTITY_CONFLICT

    特に #2810 の実 failure class は「pure unclaimed」ではありません。origin session の canonical Task が別 Issue identity を保持していた stale-origin / wrong-canonical-Task case なので、#2810 exact regression は deferred positive fixture にせず、origin Task A claims A / signal target B unclaimed → conflict / FACT_TASK_IDENTITY_CONFLICT の negative regression として固定する契約にしてください。

    テスト契約には最低限、次の意味的境界が独立に表現されるよう refinement してください。

    1. origin Task claims B / signal B → existing applied path。

    2. origin Task has no live Issue claim / B unclaimed → deferred。

    3. origin Task claims A / B unclaimed → conflict。これが 実装: Claude-GPT model/proxy 更新の runtime migration を完了工程に含め、人間介入を genuine blocker に限定する #2810 failure class。

    4. Task C claims B / origin Task A → conflict。

    accepted refinement_approved fact が既に別 Task identity で存在した後に claim が release された replay caseについても、current implementation / canonical contract を調査してください。accepted business fact の identity を current claim absence だけで隠せる false-green が成立するなら #2826 contract 内で明確に固定してください。別責務なら follow-up として分離してください。推測で AC を増やさず、repository evidence に基づいて判断してください。

    refinement_approved と cleanup_completed が shared validator を使っている current implementation を確認してください。OWNER directive の意図は cleanup_completed まで一律 missing claim => deferred に変えることではありません。generic signal framework、新しい schema registry、新しい approval layerを追加せず、変更面積を最小化してください。current architecture と整合するなら refinement 専用の narrow validator(例えば _validate_refinement_claim_tx() 相当)に semantic difference を閉じ、cleanup_completed semantics は明示的に non-regression として固定する方向を優先してください。ただし関数名や実装形は Issue contract で過剰指定せず、current code evidenceに合わせてください。

    新しい reason code は既存 closed enum があると仮定しないでください。current declarations / consumers を調査し、実際に closed enum/schema が存在する場合だけ同期対象にしてください。pure claim-missing 用の bounded diagnostic reason を定義する場合、その applicability は「origin Task に conflicting live Issue identity がない場合」に限定し、disposition=deferred、success扱いではなく diagnostic/retry classification であること、publish_termination_report.py の best-effort termination semanticsを変更しないことを Issue contract に明記してください。

    #2827 との ownership boundary を維持してください。

    #2827 は ordinary actual-user prompt で ACTIVE Task / origin Task を正しい target へ追従させ、stale origin 自体を通常フローで発生させない責務を所有します。

    #2826 は workflow signal consumer 内で genuine claim absence と genuine Task identity conflict を正確に分類する責務だけを所有します。

    したがって #2826 を理由に workflow signal consumer の cross-Task identity strictness を緩めたり、workflow signal に auto-rebind authority を追加したりしないでください。Task auto-rebind、/task authority 変更、自動 claim は #2826 に吸収しないでください。

    SubAgent は current repository contract に従って使用してください。単に dispatch しただけで完了扱いにしてはいけません。各 downstream 判断へ進む前に、その SubAgent の terminal result / completion を実際に受領してください。

    Step 1 が current skill 上 codebase-investigator の対象なら使用し、完了結果を取得してから進んでください。

    critical external claim が refinement decision に影響し、current planner が web research を要求する場合は current web-researcher を使用してください。公式 Claude Code docs、SQLite docs、upstream repository/Issue 等の一次資料を優先してください。外部仕様を理由に #2826 の local consumer scope を不要に拡大しないでください。

    canonical Step 2 は current contract 上 root-owned run_root_review_pipeline.py produce です。旧 issue-reviewer SubAgent を canonical Step 2 reviewer として起動しないでください。

    Step 2.5 semantic design review が applicable なら current .claude/agents/issue-design-reviewer.md と references/semantic-design-review.md に従い、issue-design-reviewer を sibling SubAgent として起動してください。SubAgent の作業完了と actual result の受領を待ってから record-result / join / downstream routing に進んでください。background/foreground の推測だけで completion を判定しないでください。

    rewrite が必要なら current issue-editor / edit-issue controlled transaction route を使って #2826 本文を更新してください。raw gh issue edit を独自に組み立てないでください。OWNER anchor が current body の Goal / Outcome / AC / test matrix を変えること自体は、この trusted human-context refinement の目的です。current anchor-handling contract が許す正規 route で吸収してください。

    review → rewrite → fresh review は current canonical max-iteration contractに従って bounded に繰り返してください。通常の needs-fix、semantic high/blocker finding、deterministic repair可能な contract defectについて iteration ごとの人間承認を要求せず、repository-native repair/rewrite route で自動継続してください。

    ただし canonical human_judgment_required、scope-signal-guard、evidence integrity failure、max_iterations 到達等の current skill が明示する terminal stop condition は迂回しないでください。「人間承認不要」は permission bypass や canonical stop condition 無視を意味しません。

    今回の invocation は Issue refinement のみです。approved になっても implementation、impl-review-loop、implementation worktree、production code変更、commit、push、PR作成へ進まないでください。current #2740 / termination policy のとおり、refinement_approved は implementation authorization ではありません。

    Task Context の current ACTIVE Task が #2826 と異なる場合でも、それだけを理由に私へ /task 2826 の手入力を要求して refinement を中断しないでください。current normal workflow の範囲で refinement を完遂してください。approved termination comment が成功した後の refinement_approved workflow signal が stale origin 等により task_context_signal_not_applied になる場合は、その exact disposition / reason code を diagnostic evidence として報告してください。ただし current publish_termination_report.py の best-effort contract が termination comment を rollback しない限り、signal telemetry の非適用だけを refinement failure に再分類しないでください。cross-Task safety rule自体も緩めないでください。

    follow-up / 再発防止については current Step 4.5 materialization contract を使ってください。まず open Issue を dedupe_key / semantic ownership で検索してください。stale origin / ordinary prompt ACTIVE Task auto-rebind の再発防止は既存 OPEN #2827 が所有しているため、同趣旨 Issue を重複起票しないでください。

    refinement 中に、#2826/#2827 のどちらにも所有されていない別の recurrent defect class が evidence付きで見つかった場合のみ、scopeへ押し込まず別 Issue にしてください。その場合は current issue-creator / create-issue flow を使い、dedupe search → existing OPEN reuse または新規 materializationまで実行してください。単なる一般的 hardening、generic framework、追加 security gate は起票理由にしないでください。

    終了時には最低限、fresh main/head、使用した trusted anchor、iteration 数、最終 Issue body の状態と主要な contract 修正、deterministic review結果、semantic review結果(実行した場合)、follow-up materialization結果、termination reason/cause、approved なら approved body hash、Task Context signal diagnostic、残 blockerを簡潔に報告してください。

    成功条件は「SubAgent を投げた」「Issue を編集した」ではなく、current canonical issue-refinement-loop が terminal state まで到達し、その terminal result が fresh Issue readback / review evidence と整合していることです。

    この prompt では /task 2826 を人間側の前提操作にしていません。今回の refinement と #2827 の root-cause remediation を混ぜず、#2826 の契約精度だけを先に上げる構成です。

    確認した current main は `070f99fc34605178791ccc4969dd3ac9614af6d3`、#2826 は OPEN、関連 PR はまだありません。指定コメント `#issuecomment-5879445043` は `OWNER` author association なので、現行 `issue-refinement-loop` の `with_human_context` lane に渡す trusted human-context anchor として扱うのが適切です。

    推奨する到達点は、#2826 を「unclaimed なら常に deferred」から、target claim の状態と origin Task の live Issue identity を独立に分類する契約へ refinement することです。特に #2810 を deferred positive case にしてはいけず、origin Task=A / target B unclaimed → FACT_TASK_IDENTITY_CONFLICT の stale-origin regression として固定する必要があります。cleanup_completed への意味変更を避け、可能なら refinement 専用の局所 validator に閉じる方向です。

    また current Claude Code では SubAgent は foreground/background の双方を取り得て、interactive session では background になるケースもあります。したがって「dispatch 済み」を完了扱いせず、実結果を受領する join barrier を明記するのは妥当です。:chatgpt-content-reference{index="0"} 現行公式仕様上も UserPromptSubmit と user-typed command の UserPromptExpansion は別イベントです。:chatgpt-content-reference{index="1"}

    再発防止については、stale origin 自体を通常フローで発生させない責務は既存 OPEN Issue #2827 がすでに所有しています。したがって現時点では重複 Issue は起票しません。refinement 中に #2827 と非重複の恒久対策が見つかった場合だけ、dedupe 後に新規 Issue を materialize させるのが適切です。

    以下を、既に auto mode で起動中の対話的 Claude Code にそのまま貼れます。

    repo は squne121/loop-protocol。

    対象:
    https://github.com/squne121/loop-protocol/issues/2826

    trusted human-context anchor:
    https://github.com/squne121/loop-protocol/issues/2826#issuecomment-5879445043

    現在の interactive Claude Code session / auto mode をそのまま継続し、issue-refinement-loop を対象 Issue #2826 に対して実行してください。loop iteration ごとの人間承認は要求せず、current repository の canonical issue-refinement-loop contract に従って bounded に自律継続してください。Claude Code の permission mode を変更したり、bypassPermissions / --dangerously-skip-permissions を使用したりしないでください。

    最初に必ず live state を fresh 取得してください。私がこの prompt を作成した時点の main は 070f99fc34605178791ccc4969dd3ac9614af6d3 でしたが、これは execution authority ではありません。開始時点の current main、Issue #2826 本文、全コメント、指定 OWNER anchor、関連 Issue #2810 / #2565 / #2625 / #2740 / #2827、関連 PR、current repository assets を再取得し、fresh state を authority にしてください。

    current HEAD の以下を実際に読み、過去知識で procedure を再構成しないでください。

    .claude/skills/issue-refinement-loop/SKILL.md
    .claude/skills/issue-refinement-loop/references/anchor-comment-handling.md
    .claude/skills/issue-refinement-loop/references/semantic-design-review.md
    .claude/skills/issue-refinement-loop/references/follow-up-materialization.md
    .claude/skills/issue-refinement-loop/references/termination-policy.md
    docs/dev/workflow.md
    docs/dev/agent-skill-boundaries.md

    また、対象契約の判断に必要な current implementation と tests、特に以下を fresh HEAD で確認してください。

    scripts/task-context/task_context_workflow_signals.py
    tests/task-context/test_signal_refinement_approved.py

    指定コメントは OWNER による explicit review directive です。URL 単独の unlabeled anchor としてではなく、current issue-refinement-loop が定める direct trusted human context として処理してください。canonical preflight/contract-update route が current HEAD でも同じなら、preflight.run.with_human_context → 必要に応じて contract_update.run.with_human_context の正規経路を使ってください。command syntax は current SKILL.md / command registry を authority とし、この prompt の記述より repository 側が更新されていれば repository 側を優先してください。

    今回の refinement で最優先に吸収すべき OWNER directive は次の意味です。

    #2826 の現状の「target Issue が unclaimed なら deferred」という広すぎる契約を修正し、refinement_approved の claim validation を少なくとも次の二軸で扱う契約にしてください。

    target Issue claim と origin Task の live primary Issue identity を独立に確認すること。

    期待する semantic matrix は次のとおりです。

    target Issue claim origin Task live Issue identity expected outcome
    origin Task 自身が target を claim target existing normal/applied path
    target claim なし origin Task に Issue claim なし non-mutating deferred / <bounded claim-missing reason>
    target claim なし origin Task が別 Issue を claim conflict / FACT_TASK_IDENTITY_CONFLICT
    target を別 Task が claim any conflict / FACT_TASK_IDENTITY_CONFLICT

    特に #2810 の実 failure class は「pure unclaimed」ではありません。origin session の canonical Task が別 Issue identity を保持していた stale-origin / wrong-canonical-Task case なので、#2810 exact regression は deferred positive fixture にせず、origin Task A claims A / signal target B unclaimed → conflict / FACT_TASK_IDENTITY_CONFLICT の negative regression として固定する契約にしてください。

    テスト契約には最低限、次の意味的境界が独立に表現されるよう refinement してください。

    1. origin Task claims B / signal B → existing applied path。
    2. origin Task has no live Issue claim / B unclaimed → deferred。
    3. origin Task claims A / B unclaimed → conflict。これが 実装: Claude-GPT model/proxy 更新の runtime migration を完了工程に含め、人間介入を genuine blocker に限定する #2810 failure class。
    4. Task C claims B / origin Task A → conflict。

    accepted refinement_approved fact が既に別 Task identity で存在した後に claim が release された replay caseについても、current implementation / canonical contract を調査してください。accepted business fact の identity を current claim absence だけで隠せる false-green が成立するなら #2826 contract 内で明確に固定してください。別責務なら follow-up として分離してください。推測で AC を増やさず、repository evidence に基づいて判断してください。

    refinement_approved と cleanup_completed が shared validator を使っている current implementation を確認してください。OWNER directive の意図は cleanup_completed まで一律 missing claim => deferred に変えることではありません。generic signal framework、新しい schema registry、新しい approval layerを追加せず、変更面積を最小化してください。current architecture と整合するなら refinement 専用の narrow validator(例えば _validate_refinement_claim_tx() 相当)に semantic difference を閉じ、cleanup_completed semantics は明示的に non-regression として固定する方向を優先してください。ただし関数名や実装形は Issue contract で過剰指定せず、current code evidenceに合わせてください。

    新しい reason code は既存 closed enum があると仮定しないでください。current declarations / consumers を調査し、実際に closed enum/schema が存在する場合だけ同期対象にしてください。pure claim-missing 用の bounded diagnostic reason を定義する場合、その applicability は「origin Task に conflicting live Issue identity がない場合」に限定し、disposition=deferred、success扱いではなく diagnostic/retry classification であること、publish_termination_report.py の best-effort termination semanticsを変更しないことを Issue contract に明記してください。

    #2827 との ownership boundary を維持してください。

    #2827 は ordinary actual-user prompt で ACTIVE Task / origin Task を正しい target へ追従させ、stale origin 自体を通常フローで発生させない責務を所有します。

    #2826 は workflow signal consumer 内で genuine claim absence と genuine Task identity conflict を正確に分類する責務だけを所有します。

    したがって #2826 を理由に workflow signal consumer の cross-Task identity strictness を緩めたり、workflow signal に auto-rebind authority を追加したりしないでください。Task auto-rebind、/task authority 変更、自動 claim は #2826 に吸収しないでください。

    SubAgent は current repository contract に従って使用してください。単に dispatch しただけで完了扱いにしてはいけません。各 downstream 判断へ進む前に、その SubAgent の terminal result / completion を実際に受領してください。

    Step 1 が current skill 上 codebase-investigator の対象なら使用し、完了結果を取得してから進んでください。

    critical external claim が refinement decision に影響し、current planner が web research を要求する場合は current web-researcher を使用してください。公式 Claude Code docs、SQLite docs、upstream repository/Issue 等の一次資料を優先してください。外部仕様を理由に #2826 の local consumer scope を不要に拡大しないでください。

    canonical Step 2 は current contract 上 root-owned run_root_review_pipeline.py produce です。旧 issue-reviewer SubAgent を canonical Step 2 reviewer として起動しないでください。

    Step 2.5 semantic design review が applicable なら current .claude/agents/issue-design-reviewer.md と references/semantic-design-review.md に従い、issue-design-reviewer を sibling SubAgent として起動してください。SubAgent の作業完了と actual result の受領を待ってから record-result / join / downstream routing に進んでください。background/foreground の推測だけで completion を判定しないでください。

    rewrite が必要なら current issue-editor / edit-issue controlled transaction route を使って #2826 本文を更新してください。raw gh issue edit を独自に組み立てないでください。OWNER anchor が current body の Goal / Outcome / AC / test matrix を変えること自体は、この trusted human-context refinement の目的です。current anchor-handling contract が許す正規 route で吸収してください。

    review → rewrite → fresh review は current canonical max-iteration contractに従って bounded に繰り返してください。通常の needs-fix、semantic high/blocker finding、deterministic repair可能な contract defectについて iteration ごとの人間承認を要求せず、repository-native repair/rewrite route で自動継続してください。

    ただし canonical human_judgment_required、scope-signal-guard、evidence integrity failure、max_iterations 到達等の current skill が明示する terminal stop condition は迂回しないでください。「人間承認不要」は permission bypass や canonical stop condition 無視を意味しません。

    今回の invocation は Issue refinement のみです。approved になっても implementation、impl-review-loop、implementation worktree、production code変更、commit、push、PR作成へ進まないでください。current #2740 / termination policy のとおり、refinement_approved は implementation authorization ではありません。

    Task Context の current ACTIVE Task が #2826 と異なる場合でも、それだけを理由に私へ /task 2826 の手入力を要求して refinement を中断しないでください。current normal workflow の範囲で refinement を完遂してください。approved termination comment が成功した後の refinement_approved workflow signal が stale origin 等により task_context_signal_not_applied になる場合は、その exact disposition / reason code を diagnostic evidence として報告してください。ただし current publish_termination_report.py の best-effort contract が termination comment を rollback しない限り、signal telemetry の非適用だけを refinement failure に再分類しないでください。cross-Task safety rule自体も緩めないでください。

    follow-up / 再発防止については current Step 4.5 materialization contract を使ってください。まず open Issue を dedupe_key / semantic ownership で検索してください。stale origin / ordinary prompt ACTIVE Task auto-rebind の再発防止は既存 OPEN #2827 が所有しているため、同趣旨 Issue を重複起票しないでください。

    refinement 中に、#2826/#2827 のどちらにも所有されていない別の recurrent defect class が evidence付きで見つかった場合のみ、scopeへ押し込まず別 Issue にしてください。その場合は current issue-creator / create-issue flow を使い、dedupe search → existing OPEN reuse または新規 materializationまで実行してください。単なる一般的 hardening、generic framework、追加 security gate は起票理由にしないでください。

    終了時には最低限、fresh main/head、使用した trusted anchor、iteration 数、最終 Issue body の状態と主要な contract 修正、deterministic review結果、semantic review結果(実行した場合)、follow-up materialization結果、termination reason/cause、approved なら approved body hash、Task Context signal diagnostic、残 blockerを簡潔に報告してください。

    成功条件は「SubAgent を投げた」「Issue を編集した」ではなく、current canonical issue-refinement-loop が terminal state まで到達し、その terminal result が fresh Issue readback / review evidence と整合していることです。

    この prompt では /task 2826 を人間側の前提操作にしていません。今回の refinement と #2827 の root-cause remediation を混ぜず、#2826 の契約精度だけを先に上げる構成です。

  4. squne121 commented on Sep 28, 2026

    @squne121
    OwnerAuthor

    issue-refinement-loop 終了報告(human_escalation / operator_intervention_required)

    実施した契約修正

    • OWNER directive を反映し、refinement_approved の claim 検証を「target Issue claim」と「origin Task の live Issue identity」の二軸 matrix に改めた。
    • 実装: Claude-GPT model/proxy 更新の runtime migration を完了工程に含め、人間介入を genuine blocker に限定する #2810 の exact regression は deferred の positive fixture ではなく、origin Task A が A を claim し target B が未 claim の conflict / FACT_TASK_IDENTITY_CONFLICT の negative regression として固定した。
    • cleanup_completed の意味論は変更しない non-regression として明記した。
    • 新 reason code TARGET_ISSUE_UNCLAIMED は closed enum / schema が存在しないことを確認した上で、applicability・disposition・diagnostic 扱い・publish_termination_report.py の best-effort 不変を本文で固定した。
    • replay 調査: repository probe で、accepted event の後に claim が release されると現行は conflict / FACT_TASK_IDENTITY_CONFLICT になることを実測した。単純な「claim 不在なら deferred」では accepted fact の identity が隠れるため、replay 規則と AC5 で固定した。
    • 実装: 通常のIssue/PR promptでACTIVE Taskを自動rebindし /task 必須切替を撤廃する #2827(stale origin の通常フローでの発生防止)との責務境界は維持し、auto-rebind・自動 claim は含めていない。

    停止の原因

    • iteration 1: baseline で unexpectedly pass した AC7 の VC に # baseline-expect: pass 注釈が無かった(本文修正で対応)。
    • iteration 2: 修正で AC7 に追加した VC が command substitution($(...))を含み、VC preflight が非対応のため contract_readiness_human_judgment となり、canonical_step2_route: step_5_operator_intervention_required で terminal 停止した。
    • この route は canonical な terminal stop であり、迂回しない。approved には到達していない。

    現在の Issue 本文

    • body sha256: 6d82aa6a721af2fa7a66dcd13ca85e4f9522d35b209f0090390ff5f3e01acc91(live readback で確認済み)
    • 残 blocker: AC7 の VC 1 件(command substitution を含まない直接コマンドへの置換)。その他の deterministic check は全て pass。
    • implementation、impl-review-loop、commit、push、PR 作成は行っていない。

    follow-up materialization

  5. squne121 commented on Sep 28, 2026

    @squne121
    OwnerAuthor

    推奨アクションは、#2826 の実装へ進まず、新しい issue-refinement-loop invocation で AC7 の VC だけを正規形へ修復して再レビューすることです。前回は operator_intervention_required で terminal stop しており、残 blocker は AC7 の shell substitution を含む VC 1件だけでした。:chatgpt-content-reference{index="0"}

    current main は引き続き 070f99fc34605178791ccc4969dd3ac9614af6d3 です。現行 baseline_vc_preflight.py は $(...) / backtick / ${...} を明示的に unsupported_shell_syntax として拒否し、「direct command を使う」ことを要求しています。一方、git diff 自体は read-only allowlist 内です。したがって AC7 の

    test -z "$(git diff --name-only ...)"

    は、次の直接コマンドへ置換するのが最小です。

    git diff --exit-code origin/main...HEAD -- .claude/skills/issue-refinement-loop/scripts/publish_termination_report.py

    # baseline-expect: pass は維持します。

    また、前回はこの事象を単発として follow-up を起票していませんでしたが、追加調査で構造的な再発原因を確認しました。:chatgpt-content-reference{index="1"} contract_readiness_check.py は既に command_not_allowed と vc_grep_syntax_error を body-fixable needs_fix に明示 mapping しているのに、unsupported_shell_syntax は未登録で default human_judgment に落ちます。これは #2397、OPEN #2760 と同系列の taxonomy gap です。重複検索後、以下を起票済みです。

    [#2832 — 再発防止: unsupported_shell_syntax を body-author-fixable needs_fix として Step 4 に戻す](#2832)

    以下を、auto mode で起動済みの対話的 Claude Code にそのまま貼れます。

    repo は squne121/loop-protocol。

    対象 Issue:
    https://github.com/squne121/loop-protocol/issues/2826

    前回の canonical termination report:
    https://github.com/squne121/loop-protocol/issues/2826#issuecomment-5879701180

    前回使用した trusted OWNER anchor:
    https://github.com/squne121/loop-protocol/issues/2826#issuecomment-5879445043

    再発防止 follow-up:
    https://github.com/squne121/loop-protocol/issues/2832

    現在の interactive Claude Code session / auto mode をそのまま継続し、Issue #2826 の issue-refinement-loop を新しい invocation として再開してください。今回も refinement のみを行い、iteration ごとの人間承認は要求せず、current repository の canonical contract に従って bounded に自律継続してください。permission mode を変更せず、bypassPermissions / --dangerously-skip-permissions は使用しないでください。

    最初に必ず live state を fresh 取得してください。前回確認時の main は 070f99fc34605178791ccc4969dd3ac9614af6d3 ですが、これは execution authority ではありません。current main、Issue #2826 の現在本文と全コメント、前回 termination comment、original OWNER anchor、関連 #2810 / #2565 / #2625 / #2740 / #2827 / #2832、関連 PR を再取得し、current state を authority にしてください。

    current HEAD から少なくとも以下を実際に読んでください。過去 transcript やこの prompt だけから procedure を再構成しないでください。

    .claude/skills/issue-refinement-loop/SKILL.md
    .claude/skills/issue-refinement-loop/references/anchor-comment-handling.md
    .claude/skills/issue-refinement-loop/references/semantic-design-review.md
    .claude/skills/issue-refinement-loop/references/follow-up-materialization.md
    .claude/skills/issue-refinement-loop/references/termination-policy.md
    .claude/skills/issue-contract-review/SKILL.md
    .claude/skills/issue-contract-review/scripts/baseline_vc_preflight.py
    .claude/skills/issue-contract-review/scripts/contract_readiness_check.py
    scripts/task-context/task_context_workflow_signals.py
    tests/task-context/test_signal_refinement_approved.py

    前回 termination comment #issuecomment-5879701180 は diagnostic / execution history として扱い、新しい scope authority と誤認しないでください。OWNER directive の authority は original trusted anchor #issuecomment-5879445043 と、既にその directive を吸収した live Issue body にあります。新 invocation で anchor を再指定すべきか、既存 body から通常 route で再開すべきかは current anchor-comment-handling.md / planner を authority に判断してください。同じ OWNER directive を二重適用するための独自 route は作らないでください。

    前回 loop で OWNER directive の主要な semantic repair は既に live body に反映済みです。target Issue claim と origin Task live Issue identity の二軸 matrix、#2810 stale-origin negative regression、TARGET_ISSUE_UNCLAIMED の限定 applicability、accepted-event replay 規則、cleanup_completed non-regression、#2827 との ownership boundary は弱めたり巻き戻したりしないでください。

    今回の primary repair は AC7 の Verification Command 1件です。current live body に現在、

    # baseline-expect: pass
    $ test -z "$(git diff --name-only origin/main...HEAD -- .claude/skills/issue-refinement-loop/scripts/publish_termination_report.py)"

    が残っていることを fresh readback で確認してください。

    current checker contract が前回と同じであることを確認できた場合、この VC を shell substitution を一切使わない read-only direct command、

    # baseline-expect: pass
    $ git diff --exit-code origin/main...HEAD -- .claude/skills/issue-refinement-loop/scripts/publish_termination_report.py

    へ置換する方向を採用してください。

    $(...)、backtick、${...}、compound shell、bash -c 等で同じ意味を再実装しないでください。current checker が上記 git diff --exit-code を許可しない形へ変更されている場合は、current baseline_vc_preflight.py が許可する同等の「対象 path に差分があれば non-zero、なければ zero」の直接コマンドを選んでください。security wrapper や新しい gate を追加する必要はありません。

    本文修正は current canonical Step 4 / controlled transaction を使ってください。raw gh issue edit を独自に組み立てないでください。current contract が issue-editor SubAgent を要求するなら issue-editor を起動し、dispatch した時点で完了扱いにせず、ISSUE_AUTHOR_RESULT_COMPACT_V1 の terminal result を実際に受領してください。その後、live GitHub Issue body を独立に readback し、expected body/hash と一致したことを確認してから downstream review へ進んでください。

    SubAgent completion barrier は厳守してください。planner が Step 1 investigation を required とする場合は current codebase-investigator を使用し、terminal result を受領してから次へ進んでください。今回の repair について investigator を使う場合は、少なくとも git diff --exit-code ...publish_termination_report.py が current VC allowlist に適合すること、unsupported_shell_syntax の current classification、#2826 の残 blocker が本当にその VC だけかを repository evidence で確認させてください。critical external claim が planner 上 required の場合のみ web-researcher を使用し、こちらも completion/result を受領してから進んでください。不要な Web 調査で local contract repair を拡大しないでください。

    fresh Step 2 は current canonical root-owned pipeline を使用してください。current contract が前回と同じなら、

    .claude/skills/issue-refinement-loop/scripts/run_root_review_pipeline.py produce --issue-number 2826 --repo squne121/loop-protocol

    を明示的 background 実行し、background launch を完了扱いにせず、task completion notification を join して actual JSON result を取得してから canonical_step2_route を読んでください。status / verdict / next_action から独自に route を再計算しないでください。旧 issue-reviewer SubAgent を canonical Step 2 reviewer として起動しないでください。

    Step 2 が step_4 を返す通常の body-fixable needs-fix なら、current max-iteration contract の範囲で repair → fresh review を自律継続してください。通常の deterministic needs-fix に人間承認を要求しないでください。一方、fresh result が再び step_5_operator_intervention_required、step_5_human_judgment_required、environment/integrity fail-closed、max_iterations 等の canonical terminal stop を返した場合は迂回せず停止してください。

    deterministic Step 2 が approve して step_2_5 に進んだ場合は、current semantic-design-review applicability contract を実行してください。applicable なら .claude/agents/issue-design-reviewer.md と current reference に従って issue-design-reviewer sibling SubAgent を起動し、terminal result を実際に受領するまで record-result / join / downstream routing を行わないでください。semantic review の needs-fix が自動修復可能なら bounded loop 内で修正し、fresh body で再レビューしてください。

    再発防止については、今回の exact recurrence class は既に OPEN #2832 が所有しています。fresh に #2832 を取得し、semantic ownership / dedupe_key を確認してください。unsupported_shell_syntax が body-author-fixable なのに readiness mapping 欠落で contract_readiness_human_judgment -> step_5_operator_intervention_required へ誤昇格する問題について新しい重複 Issue を作成しないでください。#2827 は stale-origin の通常フロー prevention、#2760 は invalid_baseline_expect_annotation の taxonomy gap、#2832 は今回の unsupported_shell_syntax taxonomy gap、という責務境界を維持してください。別の recurrent defect class を evidence 付きで新たに発見した場合だけ、current Step 4.5 materialization contract に従い dedupe search → existing OPEN reuse または issue-creator による新規 materialization まで実行してください。

    今回の invocation は Issue refinement のみです。approved に到達しても production implementation、impl-review-loop、implementation worktree 作成、commit、push、PR 作成へ進まないでください。refinement_approved は implementation authorization ではないという current #2740 / termination-policy contract を維持してください。

    成功条件は、Issue を一度編集したことではありません。current canonical issue-refinement-loop が fresh body に対して terminal approved へ到達し、deterministic review、必要なら semantic review、live body readback、termination artifact/comment が互いに整合することです。

    終了時には、fresh main/head、invocation route、使用した anchor/provenance、SubAgent 名とそれぞれの terminal completion/result 受領確認、iteration 数、AC7 の最終 VC、最終 body sha256、deterministic review result、semantic review result(applicable の場合)、termination reason/cause、Task Context signal diagnostic、#2832 の follow-up reuse 状態、残 blocker を簡潔に報告してください。approved でなければ実装開始可能とは扱わないでください。

    この prompt の狙いは、今回の blocker を body-fixable な一行修正として解消しつつ、canonical stop を手動で無効化しないことです。#2832 は別途実装対象なので、#2826 refinement の再開をそれの完了待ちにする必要はありません。

  6. squne121 commented on Sep 28, 2026

    @squne121
    OwnerAuthor

    issue-refinement-loop: 完了(approved)

    この loop での修復

    1. AC7 の Verification Command 1 行を、command substitution を使う test -z "$(git diff …)" から、# baseline-expect: pass を維持した git diff --exit-code origin/main...HEAD -- .claude/skills/issue-refinement-loop/scripts/publish_termination_report.py へ置換した。静的分類は許可(classify_static_command が None)で、baseline でも exit 0 になることを実測した。
    2. OWNER directive を反映済みの契約(二軸 matrix、実装: Claude-GPT model/proxy 更新の runtime migration を完了工程に含め、人間介入を genuine blocker に限定する #2810 stale-origin の negative regression、TARGET_ISSUE_UNCLAIMED の限定 applicability、accepted-event replay 規則、cleanup_completed non-regression、実装: 通常のIssue/PR promptでACTIVE Taskを自動rebindし /task 必須切替を撤廃する #2827 との責務境界)は変更していない。

    semantic review の残 warning(実装者向けの注意。blocker ではない)

    • matrix の行 2 は dedupe key の accepted event が無いことを暗黙の条件にしている。行 1 で origin が別 Issue も claim している組合せは現行挙動(applied)のまま。判定順序(別 Task の claim、別 Issue の claim、accepted event、deferred)を実装時に固定すること。
    • AC5 の fixture は、event を受理した Task と replay 元 Task を明示して独立に作ること。claim が live のままの replay が duplicate_noop のままであること、および deferred と activity_missing / activity_terminal の優先順位も test で固定すること。
    • AC6 の VC は tests/task-context/ 全体を再実行するだけなので、新規 test の存在を検証しない。cleanup 用 test を新規 file 内に置き、accepted merge を先に受理してから Issue claim を release する fixture にすること。
    • AC2 / AC3 の non-mutating は activities を含む全 table の snapshot 比較で検証すること。TARGET_ISSUE_UNCLAIMED が他の case で返らないことも assert すること。
    • deferred は診断分類のみで、自動 retry は存在しない。実装: workflow trusted signalsとIssue/PR Task equivalenceをTask Contextへ統合する #2565 の contract が reason code を列挙していないことも実装時に確認すること。

    follow-up materialization

    approved は実装開始の代替承認ではない。実装は別 invocation の /impl-review-loop 2826 で開始する。この invocation では実装・worktree・branch・commit・PR を作成していない。

    LOOP_HANDOFF_RESULT_V1:
      status: refinement_approved
      routing_action: none
      contract_review:
        status: go
        gate_result: fresh_go
        latest_comment_url: https://github.com/squne121/loop-protocol/issues/2826#issuecomment-5879445043
        generated_at: 2026-09-28T22:42:25Z
        body_sha256: sha256:d62ba22c40676cb6d43c91ec9a1f81ae99b70279368753ed0f223e43a07b357a
      metadata:
        title_prefix_ready: true
      label_sync_observation:
        kind: presentation_sync
        result: noop
        detail: labels are presentation-only; no sync attempted
      auto_fixes:
        result: auto_fixed
        required: []
        skipped: []
      blockers: []
      permissions:
        unavailable: []
      generated_at: 2026-09-28T22:42:25Z
      checked_body_sha256: sha256:d62ba22c40676cb6d43c91ec9a1f81ae99b70279368753ed0f223e43a07b357a
      checker_exit_code: 0
      missing_sections: []
      missing_contract_keys: []
  7. squne121 commented on Sep 28, 2026

    @squne121
    OwnerAuthor

    確認した live state では、#2826 は最新の issue-refinement-loop で approved 済みです。承認コメントは #issuecomment-5880050451、評価時 main は 070f99fc34605178791ccc4969dd3ac9614af6d3。現時点で #2826 に対応する既存 PR と 2826 branch は見つかっていません。したがって推奨アクションは、新たな refinement を挟まず current impl-review-loop の root-owned entry から実装 → 独立検証 → PR review → fix/re-review を自律実行し、draft_pr_ready / merge直前で止めることです。

    実装上は、refinement_approved 専用の narrow validator に閉じ、cleanup_completed が共有している _validate_required_claims_tx() の意味論を変えないのが重要です。latest semantic review の warning も実装時 evidence として引き継ぎ、特に「別Task claim → origin別Issue claim → accepted event → pure unclaimed/deferred」の優先順位、#2810 stale-origin negative regression、replay、全table non-mutation、cleanup non-regression を固定させるのがよいです。

    再発防止については、既知の recurrence class は既に OPEN Issue が所有しています。stale ACTIVE Task は [#2827](https://github.com/squne121/loop-protocol/issues/2827)、refinement の unsupported_shell_syntax 誤昇格は [#2832](#2832) です。したがって今回は重複 Issue を新規起票していません。実装・レビュー中にこれらと非重複の recurrent defect が見つかった場合だけ、impl-review-loop の follow-up materialization 契約で dedupe → issue-creator → terminal completion 確認まで実行させるのが適切です。

    以下を、auto mode で起動済みの対話的 Claude Code にそのまま貼れます。

    repo は squne121/loop-protocol。

    対象 Issue:
    #2826

    refinement approved の最新 canonical termination report:
    #2826 (comment)

    関連する既存 follow-up:
    #2827
    #2832

    現在 auto mode で起動済みの interactive Claude Code session をそのまま継続し、Issue #2826 を current repository の canonical impl-review-loop で実装・検証・PR review・修正ループしてください。

    目標は 人間の iteration ごとの承認を要求せず、実装を完了して PR を merge 判断可能な直前まで持っていくことです。実 merge、auto-merge、不可逆 cleanup は行わないでください。Claude Code の現在の permission mode は変更せず、bypassPermissions / --dangerously-skip-permissions 等も使用しないでください。

    最初に必ず live state を fresh 取得してください。ChatGPT 側で確認した時点では main は 070f99fc34605178791ccc4969dd3ac9614af6d3、#2826 は OPEN かつ refinement approved、関連 PR と 2826 branch は未検出でしたが、これらは execution authority ではありません。current main、live Issue body と comments、linked PR、existing branch/worktree、current CI/runtime state を再取得し、現在状態を authority にしてください。既存 PR / branch / canonical worktree が出現していれば再利用し、重複 PR・branch・worktree を作成しないでください。

    過去 transcript やこの prompt から impl-review-loop の procedure を再構成せず、current HEAD から少なくとも次を実際に読んでください。

    .claude/skills/impl-review-loop/SKILL.md
    .claude/skills/impl-review-loop/steps/preparation.md
    .claude/skills/impl-review-loop/steps/step-1-implementation.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/steps/step-5-mergeability-handling.md
    .claude/skills/implement-issue/SKILL.md
    .claude/skills/pr-review-judge/SKILL.md
    .claude/agents/implementation-worker.md
    .claude/agents/test-runner.md
    .claude/agents/pr-reviewer.md
    docs/dev/agent-skill-boundaries.md
    docs/dev/workflow.md
    scripts/task-context/task_context_workflow_signals.py
    tests/task-context/test_signal_refinement_approved.py

    Issue #2826 の live contract を正本としてください。latest refinement approval comment は execution history / semantic warning の evidence として参照してよいですが、live body と current repository contract を上書きする authority として扱わないでください。

    impl-review-loop の current root-owned synchronous entry transition を使用してください。intake capsule、current-run contract review、pre-Step-1 Evidence-Based Landing Disposition 等は current Skill の canonical producer/router に従い、prose で判定ロジックを再実装しないでください。landing disposition が existing_pr_resume なら既存 PR を resume、implementation_already_landed / already_satisfied なら canonical no-op route、reconciliation_required なら current contract に従って reconciliation してください。過去の「PRなし」という観測だけを理由に ordinary dispatch を決め打ちしないでください。

    Issue #2826 の implementation では scope を拡大しないでください。Allowed Paths は live Issue body から取得し、現在の契約が変わっていなければ対象は scripts/task-context/task_context_workflow_signals.py、tests/task-context/test_signal_refinement_approved.py、新規 tests/task-context/test_signal_refinement_claim_identity.py の範囲です。.claude/skills/issue-refinement-loop/scripts/publish_termination_report.py は変更しないでください。

    技術的には generic signal framework や新しい schema/registry/wrapper を導入せず、refinement_approved に限定した narrow な validator を追加する方向を第一候補にしてください。関数名は current code に合わせてよく、例えば _validate_refinement_claim_tx() 相当で構いません。cleanup_completed が使用する _validate_required_claims_tx() の既存 strict semantics は維持してください。

    判定 precedence は live Issue contract と latest approved semantic review を満たすよう明示的に固定してください。target Issue を別 Task が claim している場合は conflict / FACT_TASK_IDENTITY_CONFLICT。target が未 claim でも origin Task が別 Issue の live claim を持つなら同じく conflict。accepted refinement_approved event の replay identity を、その後の「現在 claim がない」という状態で隠さないこと。accepted event がなく、target が未 claim、かつ origin Task に conflicting live Issue identity がない pure claim absence の場合だけ non-mutating deferred / TARGET_ISSUE_UNCLAIMED にしてください。

    #2810 の failure class は deferred の positive fixture にしないでください。origin Task claims A / signal target B unclaimed を stale-origin の negative regression として conflict / FACT_TASK_IDENTITY_CONFLICT で固定してください。

    新規境界 test では、最低限 live AC に対応して次を明示的に検証してください。normal origin claims B / signal B の applied path、origin に Issue claim がなく B も unclaimed の TARGET_ISSUE_UNCLAIMED、origin claims A / B unclaimed の conflict、別 Task C が B を claim している conflict、accepted-event 後に claim を release した replay、cleanup_completed non-regression を独立 fixture として扱ってください。

    latest semantic review の warning も落とさないでください。claim が live のままの exact replay が既存 duplicate_noop semantics を維持すること、accepted event を受理した Task と replay 元 Task を fixture 上で明示すること、activity_missing / activity_terminal との precedence を確認すること、AC2/AC3 の non-mutating は event/claim/activity だけでなく relevant DB tables の before/after snapshot で検証すること、TARGET_ISSUE_UNCLAIMED が pure unclaimed case 以外では返らないことを assert してください。cleanup non-regression は accepted merge を先に成立させ、その後 Issue claim を release する production-shaped fixture にしてください。

    Step 1 は implementation-worker SubAgent に委譲し、current implement-issue を実行させてください。root thread が直接 implementation worker の仕事を肩代わりしないでください。worker には actual Issue URL/number、live Allowed Paths、current contract/fix delta、必要な technical recommendation を明示的に渡し、親会話の暗黙 context に依存させないでください。

    SubAgent dispatch を完了扱いにしてはいけません。 current Common Completion Protocol を全 dispatch site で厳守してください。spawn_agent の canonical task name を保持し、wait_agent は mailbox activity 待ちにだけ使用してください。timeout・途中 update・steer は成功扱いにしないでください。必ず SubAgent の final result を実際に受領・消費した後、list_agents でその canonical task name が terminal completed であることを確認してください。final result だけ、または completed だけの片方では downstream step に進まないでください。errored / interrupted / shutdown / not_found を成功へ読み替えないでください。current Skill に定義された bounded recovery がある場合だけそれを使用してください。

    Step 1 の implementation-worker が IMPLEMENT_RESULT_V1 の terminal result を返し、actual PR/head が確定した後にだけ Step 2 へ進んでください。

    Step 2 は test-runner SubAgent を新規 canonical task name で起動し、Issue #2826 の literal AC と literal Verification Commands、actual PR number、contract body SHA、current diff head SHA を明示的に渡してください。test-runner についても final read-only report の受領と list_agents terminal completed の両方を確認してください。current head SHA と literal command SHA256 を root/control-plane が独立に照合し、VC_ADJUDICATION_RESULT_V1 の canonical routing を使用してください。test-runner self-report だけで PASS と判断しないでください。

    Issue body の Verification Commands は current live body をそのまま実行してください。少なくとも focused task-context tests、TARGET_ISSUE_UNCLAIMED の確認、publish_termination_report.py に差分がないことを確認する git diff --exit-code ...、および live contract が要求する pnpm typecheck / pnpm lint / pnpm test / pnpm build を省略しないでください。通常の test failure は停止理由にせず、contract の範囲内で修正可能なら implementation-worker へ fix_delta として戻し、fresh head で再検証してください。

    Step 4 の pr-reviewer 起動前には current-head VC gate を canonical script/API で評価してください。required CI は current wait_ci_checks.sh --required contract に従って actual reviewed head に束縛して待機してください。stale head/body/command binding のまま reviewer を起動しないでください。

    PR review は pr-reviewer SubAgent に委譲し、current pr-review-judge contract を使用してください。pr-reviewer の final verdict/result を受領し、list_agents で terminal completed を確認してから route を決定してください。reviewer の自己申告 mergeability を authority にせず、root/control-plane が live PR の headRefOid / mergeable / mergeStateStatus を fresh 取得して route_loop_verdict_v2() へ渡してください。

    REQUEST_CHANGES、Allowed Paths blocker、CI failure、stale head、通常の deterministic failure は、current loop contract の範囲で自動修正 → fresh verification → fresh review を継続してください。iteration ごとに人間の承認を要求しないでください。route_to_update_branch の場合も current contract に従い implementation-worker へ mechanical update を委譲し、その SubAgent の terminal result/completed barrierを通過してから、必ず Step 2 と Step 4 を fresh head で再実行してください。

    current max_iterations と canonical termination policy を遵守してください。通常は既定 3 iteration の bounded loop を維持し、上限を独自に無限化しないでください。route_human_escalation、actual Git conflict、secret/protected-path boundary、明示的 human veto、authority 外変更が不可避、evidence integrity failure、max_iterations 等の canonical terminal condition が発生した場合だけ停止してください。SubAgent の単なる human_review_required: true を current Skill が warning と定義している場合は、それだけで勝手に停止しないでください。

    #2826 の Stop Conditions に抵触して Allowed Paths 外の production change や cleanup_completed semantics の変更が必要になった場合、scope を黙って拡張しないでください。現 Issue の completion に不可欠な scope split なら current canonical stop/materialization contract に従ってください。

    再発防止 follow-up は dedupe を必須にしてください。既知の recurrence class は次の OPEN Issue が既に所有しています。

    #2827: ordinary Issue/PR prompt で stale ACTIVE Task を残さない auto-rebind
    #2827

    #2832: unsupported_shell_syntax を body-author-fixable needs_fix として扱う readiness taxonomy
    #2832

    上記と同じ failure class を再発見しても新しい Issue を作らず、既存 Issue を reused_open として扱ってください。

    一方、実装・検証・PR review で これらと semantic ownership が異なる recurrent defect を evidence 付きで新たに発見した場合は、current impl-review-loop の follow-up materialization policy に従って dedupe search を実施してください。既存 OPEN Issue がなければ issue-creator SubAgent → current create-issue skill 経由で再発防止 Issue を起票してください。issue-creator についても dispatch だけで完了扱いにせず、final result を受領し list_agents terminal completed を確認してください。mandatory follow-up は APPROVE 確定前、optional non-blocking follow-up は APPROVE 後という current ordering を維持してください。

    新しい follow-up Issue は、具体的な observed failure class、root cause、再現/evidence、最小の恒久対策、regression test、既存 Issue との non-overlap、dedupe_key を明記してください。一般的な security hardening、generic framework、恒久 gate、schema、approval layer を recurrence evidence なしに追加しないでください。

    最終到達条件は「コードを書いた」「PR を作った」ではありません。current route_loop_verdict_v2() が current head に対する independent verification、required CI、fresh pr-reviewer verdict、live mergeability を使って approved を返し、IMPL_REVIEW_LOOP_RESULT_V1.status: draft_pr_ready まで到達することです。そこで停止し、人間が merge 判断できる状態を作ってください。merge / auto-merge は実行しないでください。

    終了時は、fresh main SHA、Issue body SHA、使用した branch/worktree、PR URL、PR head SHA、各 iteration、起動した各 SubAgent の canonical task name と「final result 受領 + terminal completed」確認、変更ファイル、AC/VC 結果、CI、PR review verdict、live mergeability、最終 route、残 blocker、follow-up materialization 結果(#2827/#2832 の reuse を含む場合はその状態)を簡潔に報告してください。

    実行の到達点は:

    fresh intake → canonical entry/landing disposition → implementation-worker → completion barrier → test-runner → completion barrier → current-head adjudication/CI → pr-reviewer → completion barrier → route → fix/retest/rereview as needed → follow-up dedupe/materialization → draft_pr_ready → STOP before merge

    です。

    この prompt は、#2826 の approved contract と現行 impl-review-loop の completion protocol に合わせて、通常の修正・再検証・再レビューを人間承認なしで回しつつ、merge だけを人間判断として残す構成です。

  8. squne121 commented on Sep 28, 2026

    @squne121
    OwnerAuthor

    implement-issue: 実装完了

  9. squne121 commented on Sep 28, 2026

    @squne121
    OwnerAuthor

    impl-review-loop: 完了 (2026-09-29)

    IMPL_REVIEW_LOOP_RESULT_V1:
      schema_version: 1
      status: draft_pr_ready
      pr_url: "https://github.com/squne121/loop-protocol/pull/2834"
      head_sha: "5476e29e9a072882e7f51146ddb6542effa40995"
      issue_number: 2826
      termination_reason: approved
      merge_ready: true
      iteration: 0
    
    FOLLOW_UP_MATERIALIZATION_RESULT_V1:
      schema_version: 1
      materialized_by: impl-review-loop
      follow_up_issues: []
      note_only_observations:
        - dedupe_key: "impl-review-loop:wait-ci-checks:required-context-not-yet-created:v1"
          source_url: "https://github.com/squne121/loop-protocol/pull/2834"
          source_note_id: "iteration-0-ci-wait"
          summary: "wait_ci_checks.sh --required は gh pr checks --required の集合のみを見るため、branch protection の required context python-test が未生成の時点で passed を返した(実際は python-test-core が pending で mergeStateStatus は BLOCKED)。root が live mergeability と ci run 完了を再確認して補償した。観測は 1 回のみで再発証跡がないため Issue 化せず記録のみ。既存 OPEN Issue は #2827 / #2832 と別の failure class(該当する既存 Issue なし)。"
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