Skip to content

P0: agent-retrospective の Claude-GPT self-hosted run を完走可能にし all-terminal fan-in と runtime coverage を統合する #2642

Closed
3 of 3 issues completed

Description

@squne121

Machine-Readable Contract

contract_schema_version: v1
issue_kind: parent
parent_issue: "none"
parent_mode: delivery-rollup
closure_mode: child-complete
goal_ref: >-
  agent-retrospective の明示的 manual run を Claude-GPT auto mode 上で self-host しても、
  current headless transport を正しく解釈し、required observer 3体を全て起動・terminal まで収束させ、
  validated fan-in 後にのみ evaluator を実行し、requested runtime source coverage の不足を false-green にせず、
  retrospective 自身が検出した改善点を人間の追加判断なしで修正可能な delivery unit に分解して完了できる状態にする
change_kind: workflow

Summary

2026-09-15 の明示的 manual agent-retrospective 実行が、最初の retrospective-runtime-observer で malformed_output / payload_not_object により fail-closed し、codebase-investigator / web-researcher / retrospective-evaluator が一切起動しなかった。current main の run_retrospective.py readback により、独立した3つの gap が残っていることを確認した。

  1. Claude-GPT headless transport compatibility — invoke_agent() が subprocess stdout 全体を単一 JSON object として要求し、実 Claude-GPT invocation で観測される JSON event array を payload_not_object として拒否する。
  2. observer wave completion barrier — run_observer_wave() が sequential 実行で最初の failure に即 raise し、required 3 observer 全員の terminal state 回収ができない。
  3. runtime source coverage integration — session-window / since-last-retrospective 側の runtime source 不足を orchestration success と混同しうる統合になっている。

この run が partial evidence で synthesis/evaluator/publication を行わなかった fail-closed 判断自体は正しく、修正でこの境界を弱めない。本 Issue はこの3 gap を A/B/C の独立 child に分解し、実装・検証・merge-ready 化までを追跡する delivery-rollup parent である。

Goal

agent-retrospective の Claude-GPT self-hosted manual run が、strict validation(schema / identity binding / partial_agent_output: reject)を一切弱めずに、以下をすべて満たせる状態にする。

  • Claude-GPT headless transport の実 payload 形(object / event-array)を、既存の terminal-result envelope / business validation を再実装せずに正しく正規化できる。
  • required observer 3体を、先行 observer の completion を待たずに全 dispatch し、1体の failure でも残り observer を terminal まで回収できる(all-terminal fan-out/fan-in barrier)。
  • evaluator は required observer が全て successful + validated の場合だけ fan-in 後に1回起動する。
  • requested runtime source coverage の不足を false-green にせず、「source/window を観測できたか」と「要求された指標をそのevidenceから計算できるか」を分離して表現する。
  • retrospective が検出した改善点を、人間の追加判断なしで修正可能な narrow child delivery unit(A/B/C)に分解し、最終的に original 2026-09-15 retrospective scenario 相当を live acceptance として再実行できる。

詳細な destination の分解は下記 Desired Destination を参照する。

Parent Issue

なし。2026-09-15 の explicit manual agent-retrospective 実行で発見された self-hosting reliability gap をまとめる delivery-rollup parent。

Background / Observed Evidence

2026-09-15 の current checkout に対する manual retrospective run では、stable entrypoint は最初の retrospective-runtime-observer で malformed_output / payload_not_object により fail-closed した。sanitized execution record は次のとおり。

  • retrospective-runtime-observer: failed (malformed_output, payload_not_object)
  • codebase-investigator: 未起動
  • web-researcher: 未起動
  • retrospective-evaluator: 未起動
  • deterministic retrospective tests: 218 passed
  • live CLI adapter test: payload_not_object で失敗

current main の run_retrospective.py を readback すると、以下の3つの独立した gap が残っている。

  1. Claude-GPT headless transport compatibility: invoke_agent() は subprocess stdout 全体を json.loads() し、単一 JSON object でない場合を payload_not_object として拒否する。一方、実 Claude-GPT invocation では JSON event array が観測された。配列を無条件に business payload として受理してはならず、transport owner と terminal-result envelope を current runtime に基づき特定し、schema validation 前の canonical result normalization を厳密に定義する必要がある。
  2. observer wave completion barrier: run_observer_wave() は current implementation 上で sequential に observer を呼び、最初の failure で即 raise する。そのため observer wave を起動した後に required 3 observer 全員を terminal state まで待つことができず、failure evidence も1体分しか残らない。
  3. runtime source coverage integration: canonical full run_cli() の collector set は repository collector のみで開始する。一方 session-window / since-last-retrospective 側では Claude Code / Claude-GPT required sources が unavailable になり得る。orchestration success と runtime-analysis completeness を分離し、requested runtime evidence を観測していない run を complete と誤認させない統合が必要である。

この run では partial evidence で synthesis/evaluator/publication を行わなかった点は正しい。修正でこの fail-closed boundary を弱めない。

Existing Work / Dedupe Boundary

以下は historical / related owner であり、そのまま再実装しない。current main と current runtime で gap が再発・残存しているかを child refinement 時に readback して、reuse / reframe / new follow-up を判断する。

dedupe rule: closed Issue の成果が current main に存在し、今回の failure class を既に完全に所有している場合は新規 child を作らず regression follow-up としてその provenance を明示する。逆に current failure shape / ownership が異なる場合だけ narrow child を materialize する。

Desired Destination

次の3 workstream がそれぞれ narrow child として ready → implementation → review → merge-ready まで完了し、最後に original retrospective scenario を live acceptance として再実行できる状態。

Workstream A — Claude-GPT transport normalization

  • current installed Claude/Claude-GPT transport の実出力 shape を再現し、json object / event-array / stream representation の ownership を特定する。
  • event-array を許容する場合も「terminal result event が一意に存在し、その payload が既存 result-wrapper contract と一致する」場合だけ canonical object に正規化する。
  • unknown/multiple terminal events、partial event stream、business payload 直書き、schema mismatch は fail-closed。
  • existing _structured_output_from_result_compat() と strict JSON Schema validation を弱めない。
  • Native Claude Code の既存 live round-trip を regression させない。
  • 変更は既存 business validation(type="result" / subtype="success" / is_error 判定、structured_output 欠落時の compatibility recovery、schema/identity/role-adapter validation)の前段に置く薄い transport normalization に限定し、既存 validation を再実装しない。

Workstream B — all-terminal observer fan-out/fan-in barrier

  • required observers (retrospective-runtime-observer, codebase-investigator, web-researcher) を、先に dispatch した observer の completion を待たずに 全て dispatch する。
  • 1 observer が malformed/timeout/nonzero/typed failure でも、process-wide fatal interruption でない限り残り observer の dispatch/completion を妨げない。
  • 3 observer 全てが terminal (ok | failed | timeout | aborted/cancelled 等の typed terminal result) になるまで待つ。 subprocess launch を completion とみなさない。
  • fan-in 後に全 per-observer status/reason_code を bounded public-safe execution record として保持し、CLI 呼び出し元(main() の例外を含む)まで取り出せる経路を持つ。
  • evaluator は required observer が全て successful + validated の場合だけ1回起動する。1件でも failure の場合 evaluator は起動しない。
  • partial_agent_output: reject、identity/base_sha/source_set_digest validation、cleanup を維持する。
  • future の cancel と実行中 subprocess の終了は別物として扱う。通常の observer failure では残り observer を cancel せず terminal まで回収し、外部中断時だけ終了処理を分ける。

Workstream C — runtime source coverage integration

  • current --since-last-retrospective / session-window implementationと canonical full run の接続境界を readback する。
  • runtime behavior / human-confirmation / rework metrics を要求する run では Claude Code + Claude-GPT の required source coverage を explicit input/gate とする。
  • source unavailable/partial/collector-not-configured は indeterminate / degraded とし、0件観測・complete と混同しない。
  • 「source/window を観測できたか」と「今回要求された指標をそのevidenceから計算できるか」を分離する。observed でも指標算出に必要な individual evidence(例: 人間確認イベント)が欠ける場合、その指標は unavailable とし、0 に変換しない。
  • 収集・coverage 計算と checkpoint/watermark commit を分離する。observer/evaluator が収集後に失敗した場合、分析済み checkpoint は進めず、次回実行で同じ未完了 window が対象に残るようにする。checkpoint は fixed window の analysis/evaluator/finalize が正常完了し authorization を満たした場合にのみ確定する。
  • 今回の required runtime source が未観測・partial の場合、そのsourceに依存する過去findingについて、今回候補に存在しないことだけを理由に resolved へ遷移させない(repository evidence だけで判定できる finding は通常通り扱い、runtime依存の解消判定だけを indeterminate にする)。
  • repository-only evidence で回答可能な finding は保持してよいが、runtime count/comparison を捏造しない。
  • P0: agent-retrospective の --since-last-retrospective で session collector 未配線を false-green にしない #2601 の merged contract が既にこの invariant を提供している場合は、重複実装ではなく full-run integration の最小 follow-up に限定する。

Current Validated Scope

Decisions Fixed

  • A/B/C を独立 child とし、1 Issue = 1 PR を維持する。transport parsing・observer orchestration・runtime coverage integration を1 child へ混載しない。
  • Child A の transport normalization は、既存 business validation(type="result"/subtype="success"/is_error 判定、structured_output compatibility recovery、schema/identity/role-adapter validation)の前段に置く薄い canonical normalization に限定し、_structured_output_from_result_compat() 等の既存 validation を再実装・弱体化しない。
  • Child B は required observer 全件の dispatch を、先に dispatch した observer の completion を待たずに行う(逐次 try/except による見かけ上の合格を許容しない)。observer failure 時にも残り observer を terminal まで回収し、evaluator は required observer 全成功・validated 後にのみ fan-in 後1回起動する。aggregate per-observer status/reason_code は失敗後も CLI 呼び出し元から取得可能にする。
  • Child C は runtime source coverage(observed できたか)と metric computability(要求指標をそのevidenceから計算できるか)を分離して表現する。evidence が存在しない metric を 0 として扱わない。
  • 今回の required runtime source が未観測・partial の場合、そのsourceに依存する過去findingを、今回候補に存在しないことだけを理由に resolved へ遷移させない(runtime-dependent finding は indeterminate とし、repository evidence のみで判定可能な finding は通常通り扱う)。
  • 収集・coverage 計算と checkpoint/watermark commit を分離し、fixed window の analysis/evaluator/finalize が successful completion/authorization を満たした場合にのみ checkpoint を確定する。observer/evaluator failure 時は checkpoint を進めず、再実行時に同じ未完了 window が対象に残る。
  • 通常の deterministic regression 対象は .claude/skills/agent-retrospective/scripts/tests/ ディレクトリ全体とし、実装: agent-retrospective の structured output compatibility recovery が fence 前後の地の文で decode failure する missing_structured_output を解消する #2348 由来の test_run_retrospective_structured_output_prose_fence.py を明示的に含める。live CLI test は別枠の runtime verification とする。
  • parent refinement の完了後も impl-review-loop / PR 作成 / merge へ自動的に進まない。parent が repository implementation を直接開始することはない。

Quality Decision Record

  • parent_mode: delivery-rollup の tracking/refinement issue であり、quality-gate ではない。Status: N/A(quality-gate の擬似判定は行わない)。
  • anchor comment #5695924032(OWNER, REQUEST_CHANGES、レビュー基準 base commit b1f8e675b26987b541fb3b68a895fc40bbcc9981)の P1 3件・P2 3件は本 refinement で本文へ disposition 済み(Decisions Fixed、Remaining Parent Gaps、Parent Closure Rule、Verification Strategy を参照)。個別 child の quality gate 判定は各 child の impl-review-loop が所有する。

Child Issues

この parent の refinement で current-head dedupe を行った後、上記 A/B/C を 独立 child として materialize する。1 Issue = 1 PR を維持し、transport parsing・observer orchestration・runtime coverage を1 PRへ混載しない。

Remaining Parent Gaps

  • Child A/B/C の refinement / materialization(本 Issue の Step 4.5 で実施)。
  • Child A/B/C の implementation → review → merge-ready 到達(impl-review-loop は child 側で個別実行)。
  • current main(または統合 HEAD)上での original 2026-09-15 retrospective scenario 相当の live success-path acceptance。

親の完了判定は以下の3分類を区別し、いずれかの証拠を明示する。

判定 必要な証拠
Failure-path verified 失敗注入時も required observer 3体の terminal record が揃い、evaluator は0回起動
Success-path verified 実タスク相当で3体が検証成功し、その後 evaluator が1回、finalize まで成功
Runtime verification pending 対象 runtime unavailable 等で正常系 live が未確認

Runtime unavailable は Runtime verification pending として implementation/review/merge-ready の進行を妨げないが、正常系 live success の代替証拠として Success-path verified に昇格させない。A/B/C が全て merge-ready でも current main へ未マージなら、current main へ統合済みとはみなさない(統合 HEAD で検証するか、merge 後の current main acceptance を別段階にする)。

Phase Handoff Contract

Acceptance Criteria

  • AC1: Child A/B/C が current main / current runtime evidence に基づいて materialize され、既存 Issue との dedupe record を持つ。
  • AC2: Claude-GPT live invocation で observed transport shape が canonical result wrapper へ厳密に正規化され、payload_not_object 由来の false failure が解消する。unknown/ambiguous/partial transport は fail-closed のまま。
  • AC3: required observer 3体のうち1体を deterministic failure にした test で、残り2体も必ず terminal まで実行・回収され、evaluator call count は0になる。
  • AC4: required observer 3体が全て successful + schema-valid の test で、fan-in 完了後にのみ evaluator が1回起動する。
  • AC5: timeout / malformed output / nonzero exit の各 observer failure class で、全 required observer に terminal status が存在し、partial output が evaluator input に入らない。
  • AC6: runtime source が unavailable/partial/not-configured の scenario で orchestration status と analysis completeness が分離され、runtime comparison/count を complete と報告しない。
  • AC7: Claude Code + Claude-GPT runtime source が両方 complete かつ window selection 0件の場合は「coverage complete + zero observed」を表現でき、未観測と区別できる。
  • AC8: original 2026-09-15 retrospective task 相当を current main 上で再実行し、3 observer を全て terminal まで待った execution record が得られる。全成功なら evaluator/finalize まで到達し Success-path verified、失敗があれば全 observer status を収束させた上で typed failure になり Failure-path verified。runtime unavailable の場合は Runtime verification pending とし、いずれの判定かを execution record に明記する。
  • AC9: existing deterministic agent-retrospective suite と relevant live CLI regression が PASS する。
  • AC10: required runtime source が未観測・partial な run で、その source に依存する既存 finding が「今回候補に存在しない」ことだけを理由に resolved へ遷移しない regression test が存在する(previous available + current runtime unavailable + current candidate absent → indeterminate)。

Verification Strategy

Child refinement で exact node-id を current main に合わせて固定すること。最低限以下を含む。

# agent-retrospective deterministic regression 全体(#2348 由来の prose+fenced JSON compatibility test を含む)
uv run --locked pytest .claude/skills/agent-retrospective/scripts/tests/ -q

# observer orchestration / transport / identity / cleanup regression
uv run --locked pytest .claude/skills/agent-retrospective/scripts/tests/test_run_retrospective.py -q

# #2348 由来の prose + fenced JSON compatibility(transport 直後の既存 compatibility 経路として明示的に regression scope に含める)
uv run --locked pytest .claude/skills/agent-retrospective/scripts/tests/test_run_retrospective_structured_output_prose_fence.py -q

# current live CLI adapter regressions(別枠の runtime verification、通常 CI の必須ゲートには追加しない)
uv run --locked pytest .claude/skills/agent-retrospective/scripts/tests/test_run_retrospective_live_cli.py -m claude_live -q

# session-window / source coverage focused suite
uv run --locked pytest .claude/skills/agent-retrospective/scripts/tests/test_session_window_coverage.py -q

上記に存在しない test/node-id が current main で必要なら child 側で追加する。fixture-only success を AC2/AC8 の live PASS に昇格しない。

Runtime Verification Applicability

decision: immediate
applicable_acs: [AC2, AC8]
reason: >-
  observed blocker は actual Claude-GPT headless transport と observer subprocess orchestration の境界でのみ発現するため。
execution_environment: >-
  current installed Claude/Claude-GPT runtime + current main checkout; public-safe bounded evidence only.
skip_conditions: >-
  target runtime 自体が unavailable の場合は SKIP/unavailable とし fixture PASS で代替しない。
fallback_policy:
  fallback_success_is_pass: false
artifact_requirements:
  - runtime profile/version class
  - tested base SHA
  - per-observer terminal status/reason_code
  - evaluator started true/false
  - source coverage/completeness classification
  - no raw transcript/credential/absolute local path

Allowed Paths

Parent は tracking/refinement only。repository implementation は child Issue の Allowed Paths で所有する。初期候補は以下だが、child refinement で最小化する。

  • .claude/skills/agent-retrospective/SKILL.md
  • .claude/skills/agent-retrospective/references/**
  • .claude/skills/agent-retrospective/scripts/run_retrospective.py
  • .claude/skills/agent-retrospective/scripts/tests/**
  • scripts/claude-gpt/** は transport owner が repository launcher/proxy 側だと current-head evidence で確認された child に限る

Stop Conditions

  • schema validation / identity binding / partial_agent_output: reject を弱める必要がある。
  • event array を「配列だから成功」と無条件受理する設計になる。
  • evaluator を observer failure 中または未terminal observer が存在する状態で起動する。
  • runtime source 未観測を 0件・complete と表現する。
  • required runtime source が未観測・partial であることだけを理由に、その source に依存する既存 finding を resolved へ遷移させる設計になる。
  • 収集・coverage 計算と checkpoint/watermark commit の分離を維持できず、observer/evaluator failure 後も checkpoint が進んでしまう設計になる。
  • raw transcript、secret、credential、absolute local path を public artifact に出す必要がある。
  • unrelated permission/security broker、generic orchestration framework、重量級な新規 harness を導入しないと成立しない場合は、まず既存 primitive 再利用で解けない根拠を示す。
  • 動作検証 AC の VC が SKIP(exit 77)を返した場合(実行環境不可のためエスカレーション)
  • fallback 経由でのみ「成功」する場合(FAIL として扱い、実行環境を確認)

Parent Closure Rule

  • A/B/C の required child がすべて merge-ready/merged である。子が全て merge-ready でも current main へ未マージなら、current main へ統合済みとはみなさない(統合 HEAD で検証するか、merge 後の current main acceptance を別段階にする)。
  • AC8 の live acceptance が current main で Success-path verified(PASS)または Failure-path verified(fail-closed 動作の PASS)のいずれかで確認されていることを既定路線とする。
  • Runtime verification pending のみで closure する例外路線は、以下をすべて満たす場合に限り認める(anchor comment #5695924032 の「runtime unavailableでも実装・レビュー・merge-readyへの進行は妨げない。一方、親の『正常系の動作確認済み』という扱いにはしない、という分離が個人開発には適しています」という OWNER 判断に基づく、solo-dev 向けの意図的な pragmatic exception であり、無制限の standing route ではない)。
    • Runtime verification pending の理由(対象 runtime unavailable の具体的根拠)を closure 時点の evidence として明記する。
    • Success-path verified / Failure-path verified へ後日昇格させる意図の有無(再挑戦予定か、恒久的に runtime 不可か)を明記する。
    • Runtime verification pending を理由にした closure であることを、closure を実行する human が merge 時に明示的に確認する(merge 操作自体は人間が行う の一環として、この特定の disposition を承知した上での merge であることを含む)。
  • unresolved P0/P1 finding がこの parent に残っていない。
  • merge 操作自体は人間が行う。

Delivery Rule

1 Issue = 1 PR。まずこの parent を .claude/skills/issue-refinement-loop で current-head evidence に再精緻化し、SubAgent を使って A/B/C の ownership/dedupe を独立調査する。全 SubAgent の terminal completion を待ってから child contract を確定する。その後各 child を .claude/skills/impl-review-loop で実装・レビューし、全 child 完了後に parent acceptance を実行する。人間への確認は irreversible/external authorization または repository evidence で解けない真の要件分岐に限定する。

Sub-issues

Sub-issues

3 of 3 Issues completed
Loading 3 sub-issues

Activity

  1. added
    enhancement
    triage-required
    on Sep 15, 2026
  2. squne121 commented on Sep 16, 2026

    @squne121
    OwnerAuthor

    結論:REQUEST_CHANGES

    A/B/Cへ分割する方針と、**「observerが失敗したらevaluatorへ部分結果を渡さない。ただし、残りのobserverの完了回収は続ける」**という方向は妥当です。一方、現状の契約には、完走を確認しないまま親Issueを閉じられることと、runtime coverageを既存の差分判定・checkpointへ接続するときの欠落があります。ここはchild実装前に明文化した方がよいです。

    レビュー基準は、取得時のmain **b1f8e675b26987b541fb3b68a895fc40bbcc9981**です。Issue本文、関連する #2348・#2601、#2601のコメント、マージ済みPR #2612、runner・既存liveテスト・SKILL・Claude-GPT launcherを照合しました。#2642は取得時点でコメント0件です。

    優先度はP1が3件、P2が3件。新規の権限ブローカーや汎用ハーネスを追加する必要はなく、既存関数の接続と受入条件の修正で対処する案を推奨します。


    1. P1:正常系を一度も完走しなくても、親Issueを閉じられる

    対象:AC8、Parent Closure Rule、Desired Destination

    AC8は、全observerが成功してfinalizeへ到達する場合に加え、全observerの失敗状態を回収してtyped failureになる場合も許容しています。さらにParent Closure Ruleでは、live acceptanceのPASSだけでなく、runtime unavailableのblocked evidenceも閉じる条件に含めています。

    この組み合わせでは、例えば次の状態でも契約上の完了に近づけてしまいます。

    transportのpayload_not_objectは解消したが、別の理由で毎回observerが失敗する。
    3体のterminal recordは揃うものの、実タスクでevaluator/finalizeへ到達した実績はない。

    これは**「失敗しても診断を回収できるようになった」証明であって、「self-hosted runを完走可能にした」証明ではありません**。

    また、子の条件がmerge-ready/mergedなのに、親の実行対象がcurrent mainである点も整理が必要です。子がすべてmerge-readyでも未マージなら、mainに修正が揃っている保証はありません。

    推奨修正

    受入判定を以下の三つに分けてください。

    判定 | 必要な証拠 -- | -- Failure-path verified | 失敗注入時も3体のterminal recordが揃い、evaluatorは0回 Success-path verified | 実タスク相当で3体が検証成功し、その後evaluatorが1回、finalizeまで成功 Runtime verification pending | 対象runtime unavailableなどで、正常系liveを未確認

    Child Bでは、recordを内部で作るだけでなく、CLIの呼び出し元まで返すことが重要です。現行main()の失敗出力はstatus/reason_code/exit_code/reason中心なので、例外に集約結果を保持させて返すなど、失敗後も3体分の結果を取り出せる経路を確認してください。raw stdoutや巨大なログの公開は不要です。

    最終推奨

    A/B/C分割は維持し、先に「親の完了判定」「今回coverageとdeltaの関係」「checkpoint確定タイミング」の3点を修正してください。 transport修正は薄く、並列化は固定3体の既存呼び出しを包む程度に留め、runtime不足は取得済みの有用な分析まで止めない設計がよいです。

    この環境にはclaude実行ファイルがないため、リポジトリのpytestおよびNative/Claude-GPTのlive検証は未実行です。確認済みなのは、GitHub上の実装・契約・関連議論の照合、外部一次資料の調査、およびcompute_delta()の隔離した関数レベルの再現です。「テストが通ること」と「実タスクを完走したこと」を分ける修正が、このIssueの有用性を最も高めます。

    ## 結論:`REQUEST_CHANGES`

    A/B/Cへ分割する方針と、**「observerが失敗したらevaluatorへ部分結果を渡さない。ただし、残りのobserverの完了回収は続ける」**という方向は妥当です。一方、現状の契約には、完走を確認しないまま親Issueを閉じられることと、runtime coverageを既存の差分判定・checkpointへ接続するときの欠落があります。ここはchild実装前に明文化した方がよいです。

    レビュー基準は、取得時のmain **b1f8e675b26987b541fb3b68a895fc40bbcc9981**です。Issue本文、関連する #2348・#2601、#2601のコメント、マージ済みPR #2612、runner・既存liveテスト・SKILL・Claude-GPT launcherを照合しました。#2642は取得時点でコメント0件です。

    優先度はP1が3件、P2が3件。新規の権限ブローカーや汎用ハーネスを追加する必要はなく、既存関数の接続と受入条件の修正で対処する案を推奨します。


    1. P1:正常系を一度も完走しなくても、親Issueを閉じられる

    対象:AC8、Parent Closure Rule、Desired Destination

    AC8は、全observerが成功してfinalizeへ到達する場合に加え、全observerの失敗状態を回収してtyped failureになる場合も許容しています。さらにParent Closure Ruleでは、live acceptanceのPASSだけでなく、runtime unavailableのblocked evidenceも閉じる条件に含めています。

    この組み合わせでは、例えば次の状態でも契約上の完了に近づけてしまいます。

    transportのpayload_not_objectは解消したが、別の理由で毎回observerが失敗する。
    3体のterminal recordは揃うものの、実タスクでevaluator/finalizeへ到達した実績はない。

    これは**「失敗しても診断を回収できるようになった」証明であって、「self-hosted runを完走可能にした」証明ではありません**。

    また、子の条件がmerge-ready/mergedなのに、親の実行対象がcurrent mainである点も整理が必要です。子がすべてmerge-readyでも未マージなら、mainに修正が揃っている保証はありません。

    推奨修正

    受入判定を以下の三つに分けてください。

    判定 必要な証拠
    Failure-path verified 失敗注入時も3体のterminal recordが揃い、evaluatorは0回
    Success-path verified 実タスク相当で3体が検証成功し、その後evaluatorが1回、finalizeまで成功
    Runtime verification pending 対象runtime unavailableなどで、正常系liveを未確認

    runtime unavailableでも実装・レビュー・merge-readyへの進行は妨げない。一方、親の「正常系の動作確認済み」という扱いにはしない、という分離が個人開発には適しています。

    マージ前に親の統合確認を行うなら、A/B/Cを含む統合HEADを対象にする。current main限定を維持するなら、子のマージ後の確認を独立した最終段階にしてください。


    2. P1:今回のruntimeが未観測でも、過去のruntime問題をresolvedにできる

    対象:Workstream C、compute_delta()、finalize()

    今回の重要な追加指摘です。

    現行のcompute_delta(previous, current_candidates)は、coverage不足によるindeterminateを過去状態のprevious.statusがpartial/staleかどうかで判断します。今回のcoverageを受け取る引数はありません。過去がavailableで、今回の候補から過去のfindingが消えると、そのfindingをresolvedにします。

    さらに、finalize()は渡されたdelta_resultsをそのままPublishRequestへ格納します。そこで今回のsource coverageを使って解消判定を取り消す処理はありません。

    読み取った関数を隔離して、次の入力を確認しました。

    previous.status = available
    previous.candidates = [過去に検出したruntime_behaviorの問題]
    current_candidates = []
    

    結果は次のとおりです。

    {
      "finding_identity": "runtime-permission-friction",
      "evaluation_status": "classified",
      "delta_status": "resolved"
    }

    関数単体の動作確認であり、リポジトリ全体のテスト実行ではありません。ただし、今回のruntime evidenceを取得できなかったため候補が出なかったケースと、本当に問題が解消したケースを、この関数の入力では区別できないことは確認できます。

    #2642のCは「未観測を0件・completeとしない」「runtime count/comparisonを捏造しない」を要求していますが、未検出を解消扱いにする経路までは明記していません。

    推奨修正

    Child Cに次の不変条件を追加してください。

    今回のrequired runtime sourceが未観測・partialの場合、そのsourceに依存する過去findingについて、今回候補に存在しないことだけを理由にresolvedへ遷移させない。

    全findingを一律に止める必要はありません。repository evidenceだけで判定できるfindingは通常どおり扱い、runtime依存の解消判定だけをindeterminateにするのが望ましいです。

    最低限の回帰テストは、**「過去available+今回runtime unavailable+今回候補なし → runtime findingはresolvedにならない」**です。関係のないrepository findingまで止まらないことも併せて確認してください。


    3. P1:coverage確認を前処理として流用すると、分析失敗前にcheckpointが進む

    対象:Workstream C、run_since_last_retrospective_cli()とfull-runの接続

    現行のrun_since_last_retrospective_cli()は、意図的にobserver/evaluatorを呼ばない独立モードです。一方、coverageが揃い、authorization条件を満たすと、同じ呼び出しの中でwatermarkファイルを書き戻します。これはPR #2612で追加済みの挙動です。

    したがって、Child Cを次のように実装すると問題になります。

    run_since_last_retrospective_cli()を前処理として呼ぶ
      → coverage complete、watermark更新
      → observer wave実行
      → observerまたはevaluatorが失敗
      → 次回は更新済みwatermark以降だけ収集
    

    収集できたが分析を完了できなかったwindowが、次回の処理対象から落ちます。

    これは現時点でfull-runにその接続が存在するという指摘ではなく、既存機能の「最小統合」を行う際に明確に防ぐべき設計上の穴です。現行mainでは、session-windowモードはfull-runと別経路になっています。

    推奨修正

    既存の低レベル関数を再利用し、収集・coverage計算とcheckpoint確定を分けてください。

    windowを固定
      → source収集とcoverage計算
      → 同じ収集結果をobserver入力・source identityへ接続
      → 全observerのterminal回収・検証
      → evaluator / finalize
      → 定義済みの完了条件とauthorizationを満たしたときだけcheckpoint確定
    

    新規DBや複雑なトランザクション機構は不要です。既存のatomic file writeを最後に呼ぶ構成で十分です。

    Child CのACには、次を追加するのが重要です。

    収集後にobserver/evaluatorが失敗した場合、分析済みcheckpointは進まず、再実行時に同じ未完了windowが対象に残る。

    また、coverageを後から別収集してラベルだけ付けるのではなく、実際に分析へ渡したsource/windowとcoverageが一致することも要求してください。


    4. P2:現行ACでは、逐次実行のままでもfan-out/fan-in修正として合格できる

    対象:Workstream B、AC3〜AC5

    現行run_observer_wave()は逐次呼び出しで、最初の失敗でraiseします。一方、SKILLはobserver_parallelism: 3を掲げています。

    AC3〜AC5が確認するのは主に「全員がterminal」「失敗時evaluatorは0回」です。そのため、次の変更だけでも合格し得ます。

    for observer in observers:
        try:
            run_and_validate(observer)
        except Exception:
            record_failure(observer)

    これでは失敗回収は改善しますが、3体が順番待ちする挙動は残ります。

    推奨修正

    Child Bに、次の条件を明記してください。

    required observer全件のdispatchは、先にdispatchしたobserverのcompletionを待たずに行う。

    テストは実CLIや時間計測に頼らず、既存の注入可能なinvokeへ同期用のbarrierを入れれば足ります。3体が開始地点に到達するまで、どのobserverも完了できないテストにすれば、逐次実装を確実に落とせます。

    実装は固定3体なら標準ライブラリのexecutor等で十分です。ただし、futureのcancelと、実行中subprocessの終了は別物です。Pythonのcancel_futuresは実行中のfutureをキャンセルしないため、通常のobserver失敗では他の2体をcancelせず回収し、外部中断時だけ終了処理を分けてください。([Python documentation]1)


    5. P2:「session sourceを読めた」と「要求された指標を計算できる」がまだ混同される

    対象:Workstream C、compute_analysis_completeness()、compute_cross_runtime_comparison()

    現行実装は、required sourceのstatusがすべてobservedなら、analysis_completeness="complete"、cross-runtime comparisonをavailableにします。個別指標の観測可能性はこの判定に入りません。

    また、現在のselected_session_countはsource間で意味が異なります。

    Source 現在の算出元
    Claude Code sessions_read、またはsession_count
    Claude-GPT UserPromptSubmitとStopが対応したcomplete_sessionsの件数

    つまり、両方ともobservedであることだけから、完了率・中断率・人間確認回数などを同じ基準で比較できるとは限りません。

    #2642はruntime behavior・human-confirmation・rework metricsに言及しているため、ここを曖昧にすると、coverageラベルだけ正しくなって分析結果は依然として過大評価される可能性があります。

    推奨修正

    大きなmetrics基盤は追加せず、次の意味を分離するだけでよいです。

    • source/windowを観測できたか。
    • 今回要求された指標を、そのevidenceから計算できるか。

    例えばsession件数は観測できても、人間確認のイベントが記録されていなければ、その指標はunavailableとする。取得できたsession一覧やrepository findingは残すが、指標不足を0回に変換しない、という形です。

    また、Claude Codeだけの分析を明示的に要求したrunまで、Claude-GPT不足で止めないよう、required sourceは要求内容に従わせてください。既存のcoverage計算にはnot_requestedや単一source時の扱いがあるので、それを維持する方が簡潔です。


    6. P2:回帰確認コマンドから、既存のcompatibility専用テストが漏れる

    対象:Verification Strategy、Child Aのregression scope

    #2348はprose+fenced JSONの回復処理を修正し、専用の

    test_run_retrospective_structured_output_prose_fence.py
    

    を追加する契約です。しかし、#2642に列挙されたコマンドは、mainのテストファイル・live CLIテスト・session-windowテストで、この専用ファイルを含みません。

    Child refinementで追加可能とは書かれていますが、今回触るtransport層の直後にある既存compatibility経路なので、任意の追加ではなく明示的な回帰対象にした方がよいです。

    通常確認は、既存のdeterministicテストディレクトリを対象にする方が取りこぼしを減らせます。

    uv run --locked pytest .claude/skills/agent-retrospective/scripts/tests/ -q

    liveは従来どおり別枠とし、日常の開発・通常CIへ追加の実CLI必須ゲートを持ち込まない構成を推奨します。既存liveテストも、その分離を前提に設計されています。


    外部調査から、Child Aの実装方針を具体化すると

    Claude-GPT固有の配列仕様だと決めつけない

    Anthropicのupstream Issue #84784では、Native Claude Code 2.1.220について、--output-format jsonが--verboseまたはviewMode: verboseによって単一objectからevent arrayへ変わる再現が報告されています。CLI引数に--verboseがなくても設定で発生するという内容です。これはユーザー報告であり、今回のローカル環境の原因を確定する証拠ではありませんが、切り分けには直接有用です。([GitHub]2)

    リポジトリのClaude-GPT launcherはraine/claude-code-proxyを利用する構成で、そのproxyはClaude CodeからのAPI通信を変換するものです。したがって、proxyのAPIレスポンス形式と、Claude Codeがstdoutへ出すCLI形式を別の層として調べるべきです。 ([GitHub]3)

    変更点は、既存business validationの前にある薄いtransport正規化へ限定する

    推奨する流れは次です。

    subprocessの終了状態を確認
      → stdoutをtransportとしてdecode
      → 当該invocationのterminal result wrapperを一意に選ぶ
      → 既存のtype / subtype / is_error判定
      → 既存structured_output取得・compatibility recovery
      → 既存schema / identity / role-adapter validation
    

    既存コードは、wrapperのtype="result"、subtype="success"、is_errorを確認し、structured_outputの欠落時だけcompatibility recoveryへ進む構造です。ここを再実装せず、その前段へobject/event-arrayの正規化を足すのが最小変更です。

    公式Python SDKでも、CLI transportの構築とtype="result"のメッセージ解釈は別の場所に分かれています。参考にするべきなのはこの責務分離であって、今回SDK全体へ置き換える必要はありません。

    避けたい実装は、配列の最後を無条件採用する、assistant本文から任意のJSONを探す、設定全体を無効化して配列が出ない環境へ変える、といった対応です。一方、関係のない非terminal telemetryが増えただけで失敗させる過剰なevent種別制限も避け、成功判定に使うterminal wrapperを厳密に扱うのがよいです。


    Child化する前に追加したい受入条件

    大きな仕様追加ではなく、次のケースを既存テストへ載せる構成で十分です。

    Child 追加すべき確認
    A objectとevent-arrayの両方から、同じ既存validationへ到達する。terminal欠落・複数・error subtypeは拒否
    A Native/Claude-GPTそれぞれについて、実行したruntime profileと有効な出力設定を記録する
    B 3体がcompletion待ちなしでdispatchされる。最初の1体が失敗しても残り2体を回収する
    B subprocess失敗だけでなく、schema不一致・identity不一致でも全terminal recordが呼び出し元へ残る
    C 今回runtime未観測なら、過去のruntime findingを欠落だけでresolvedにしない
    C 収集後にobserver/evaluatorが失敗しても、未処理windowがcheckpoint更新で消えない
    親 失敗回収のlive確認と、正常系のevaluator/finalize到達を別判定にする

    Child Bでは、recordを内部で作るだけでなく、CLIの呼び出し元まで返すことが重要です。現行main()の失敗出力はstatus/reason_code/exit_code/reason中心なので、例外に集約結果を保持させて返すなど、失敗後も3体分の結果を取り出せる経路を確認してください。raw stdoutや巨大なログの公開は不要です。

    最終推奨

    A/B/C分割は維持し、先に「親の完了判定」「今回coverageとdeltaの関係」「checkpoint確定タイミング」の3点を修正してください。 transport修正は薄く、並列化は固定3体の既存呼び出しを包む程度に留め、runtime不足は取得済みの有用な分析まで止めない設計がよいです。

    この環境にはclaude実行ファイルがないため、リポジトリのpytestおよびNative/Claude-GPTのlive検証は未実行です。確認済みなのは、GitHub上の実装・契約・関連議論の照合、外部一次資料の調査、およびcompute_delta()の隔離した関数レベルの再現です。「テストが通ること」と「実タスクを完走したこと」を分ける修正が、このIssueの有用性を最も高めます。

  3. squne121 commented on Sep 16, 2026

    @squne121
    OwnerAuthor

    推奨アクションは、対象コメントを direct human context の trusted anchor として扱い、手作業で Issue 本文を直すのではなく、preflight.run.with_human_context → controlled contract update / rewrite → fresh review の正規経路で #2642 を再精緻化することです。現行 skill は loop iteration ごとの承認を既定で要求せず、Step 1/1b の SubAgent は両方必要なら並列実行し、Step 2 前に両方を join する契約です。また Step 2 自体も background 起動だけでは完了扱いにせず、完了結果を待つ必要があります。

    対象レビューの核心は、A/B/C 分割を維持しつつ、①正常系完走と失敗回収を別判定にする、②current runtime coverage 不足時に過去 runtime finding を resolved にしない、③checkpoint を分析完了前に進めない、④3 observer を実際に completion 待ちなしで dispatch する、⑤source coverage と metric computability を分離する、⑥transport compatibility の既存回帰テストを落とさない、の6点です。

    そのまま既に auto mode の Claude Code に貼るなら、以下を推奨します。

    対象:
    #2642

    trusted human-context anchor:
    #2642 (comment)

    .claude/skills/issue-refinement-loop を正本として、Issue #2642 を上記 anchor comment の REQUEST_CHANGES を反映するまで refinement loop してください。

    目的は Issue 契約の精緻化と delivery-rollup child の materialization までです。
    repository implementation、impl-review-loop、PR作成、マージには進まないでください。

    自律実行方針

    • 既に Claude Code は auto mode で起動済みです。
    • loop iteration 間の人間承認は求めず、自動継続してください。
    • skill が許可する controlled mutation、Issue rewrite、コメント投稿、child materialization の途中確認も求めないでください。
    • Claude Code の permission mode 自体は変更しないでください。--dangerously-skip-permissions 等を追加しないでください。
    • max_iterations は skill 既定値 3 を使用してください。
    • canonical routing が human_judgment_required、解消不能な environment/integrity failure、または本当に外部 authorization が必要だと判定した場合だけ停止してください。
    • prose で独自 routing を再実装せず、planner / canonical command / canonical Step 2 route の結果に従ってください。

    Step 0 / anchor handling

    最初に current checkout / current main / Issue 本文 / anchor comment を readback し、anchor の repository・Issue binding を確認してください。

    anchor comment は今回ユーザーが明示的に指定した direct human context として扱ってください。

    canonical main root / default branch から .claude/skills/issue-refinement-loop/SKILL.md の正規手順に従い、まず preflight.run.with_human_context を使用してください。

    概念的には次の対象です。

    preflight が trusted contract patch/update lane を返した場合は、正規の contract_update.run.with_human_context consumer を使用してください。
    raw gh issue edit 等で正規経路を迂回しないでください。

    contract update 後は必ず final readback → fresh preflight → fresh review を行い、古い review 結果を再利用しないでください。

    SubAgent investigation — 必須

    Issue 本文自身が A/B/C の ownership/dedupe を独立調査することを要求しているため、SubAgent を使用してください。

    可能なら以下を read-only の独立 investigation lane として並列 dispatch してください。

    A — Claude-GPT / Claude Code transport

    codebase-investigator を使用し、current main を基準に以下を調査:

    B — observer all-terminal fan-out/fan-in

    別の codebase-investigator を使用し、以下を調査:

    • run_observer_wave()
    • required observer 3体の dispatch/completion semantics
    • 最初の failure で現在どこまで short-circuit するか
    • evaluator invocation gate
    • timeout / malformed / nonzero / schema mismatch / identity mismatch の terminal representation
    • aggregate result を CLI caller まで取り出せる経路
    • current main で重複 owner がないか
    • Child B の最小 Allowed Paths / verification scope

    C — runtime coverage / delta / checkpoint

    別の codebase-investigator を使用し、以下を調査:

    planner が external research を required とした場合は web-researcher も起動し、anchor comment 中の外部 claim、特に Claude Code JSON/event-array behavior と Python concurrency/cancellation semantics を一次資料中心に確認してください。

    SubAgent completion barrier

    ここは厳守してください。

    SubAgent を dispatch したことを完了とみなさないでください。

    起動した A/B/C、および web-researcher がある場合はそれも含め、全 SubAgent が terminal completion になり、実際の結果を取得するまで Step 2 へ進まないでください。

    早く終了した1体の結果だけで Issue contract を確定しないでください。
    SubAgent が background/task 型なら、必ず全 task notification/result を join してください。

    各結果について current main evidence、dedupe disposition、unresolved uncertainty を main thread で統合してから review へ進んでください。

    anchor REQUEST_CHANGES の必須 disposition

    Issue rewrite では anchor comment の P1/P2 全件を disposition してください。特に以下を契約上曖昧に残さないでください。

    1. 親の完了判定

      • Failure-path verified
      • Success-path verified
      • Runtime verification pending
        を区別する。
      • observer failure を全件回収できただけでは「self-hosted run 完走確認済み」としない。
      • runtime unavailable は implementation/review/merge-ready の進行を妨げなくてよいが、正常系 live success の代替証拠にはしない。
      • A/B/C が未mergeなら current main に統合済みと仮定しない。統合HEADで検証するか、merge後 current main acceptance を別段階にする。
    2. current coverage と delta

      • required runtime source が current run で unavailable / partial / not-observed の場合、その source に依存する過去 finding を「今回候補から消えた」という理由だけで resolved にしない。
      • runtime-dependent resolution は indeterminate 等へ落とし、repository-only finding は必要以上に止めない。
      • 「previous available + current runtime unavailable + current candidate absent」で runtime finding が resolved にならない regression test を要求する。
    3. checkpoint commit point

      • source collection / coverage calculation と checkpoint/watermark commit を分離する。
      • fixed window → collection/coverage → observer analysis → all-terminal validation → evaluator/finalize → successful completion/authorization の後にだけ checkpoint を確定する。
      • observer/evaluator/finalize failure 時は checkpoint を進めず、再実行時に同じ未完了 window が残ることを AC 化する。
      • coverage label は、実際に分析へ渡した同じ source/window と binding する。
    4. 本当の fan-out/fan-in

      • required observer 3体について「先に dispatch した observer の completion を待たず、全 required observer を dispatch する」を Child B の invariant にする。
      • 単なる逐次 try/except で AC を通過できないようにする。
      • observer 通常 failure では残り observer を cancel せず terminal まで回収する。
      • evaluator は全 required observer が successful + validated の場合だけ、fan-in 後に1回。
      • aggregate per-observer status/reason_code が失敗後も caller から取得可能であることを要求する。
    5. coverage と metric computability

      • 「source/window を観測できた」と「requested metric をその evidence から計算可能」を分離する。
      • evidence が存在しない metric を 0 と扱わない。
      • run が要求していない runtime source は既存の not_requested semantics を維持する。
      • repository evidence で回答可能な finding まで unnecessarily block しない。
    6. transport regression scope

      • Child A は object / event-array の双方を同じ既存 business validation へ正規化する薄い transport normalization とする。
      • terminal result 欠落、複数 terminal、error subtype、ambiguous/partial transport は fail-closed。
      • array 最後の要素を無条件採用したり assistant prose から任意 JSON を拾ったりしない。
      • _structured_output_from_result_compat() 等の既存 validation を再実装しない。
      • deterministic regression は取りこぼし防止のため agent-retrospective の tests directory 全体を候補にし、既存 test_run_retrospective_structured_output_prose_fence.py も明示的に coverage する。
      • live CLI tests は deterministic suite と別枠の runtime verification とする。

    A/B/C の 1 Issue = 1 PR 境界は維持してください。
    transport parsing・observer orchestration・runtime coverage integration を1 childへ混載しないでください。

    Step 2 review

    canonical Step 2 は issue-reviewer SubAgent を直接起動する方式に戻さないでください。

    .claude/skills/issue-refinement-loop/scripts/run_root_review_pipeline.py produce の正規 route を使用してください。

    skill の契約どおり、Claude Code Bash tool では 明示的 background execution とし、さらに mandatory completion join を行ってください。

    重要:

    background task を起動した時点では Step 2 完了ではありません。

    task notification を待ち、実際の完了 JSON を取得してから routing してください。

    routing は producer が返す canonical_step2_route を唯一の authority とし、status/verdict/next_action から独自に再判定しないでください。

    Rewrite loop

    review が needs-fix / request_changes を返した場合:

    • 人間に「続けてよいか」を質問しない。
    • canonical issue-editor / controlled transaction route で修正する。
    • readback を確認する。
    • fresh preflight / investigation が必要なら再実行する。
    • fresh Step 2 review を background + join で行う。
    • max_iterations まで自律継続する。

    同じ body hash のまま no-progress retry を繰り返さず、skill の termination / rewrite router に従ってください。

    Step 4.5 — Child materialization

    最終 review が approve になったら、Issue #2642 は issue_kind: parent / delivery-rollup なので Step 5 前に child materialization gate を通してください。

    A/B/C の child slot を current-head evidence と既存 Issue/PR で dedupe し、title 類似だけではなく canonical dedupe_key で判定してください。

    必要な child が missing なら issue-creator の正規経路へ委譲してください。
    既存 open owner があるなら再利用してください。
    closed issue を勝手に reopen しないでください。

    ここでも issue-creator 等の SubAgent を起動した場合は、全 SubAgent の terminal completion と GitHub readback を待ってから parent の終了処理へ進んでください。

    materialize された各 child は、少なくとも以下が明確な implementation contract になるようにしてください。

    Termination

    Issue #2642 は parent issue なので、refinement 完了後に impl-review-loop へ自動 handoff しないでください。
    LOOP_HANDOFF_RESULT_V1 を implementation issue のように出さないでください。

    skill の termination report route を使用して Issue に終了報告を投稿し、少なくとも以下をまとめてください。

    • final verdict
    • iteration count
    • anchor comment の P1/P2 disposition
    • 実行した SubAgent と各 terminal status
    • current-head dedupe 結果
    • materialized/reused child A/B/C の Issue 番号とURL
    • verification scope
    • live runtime verification が verified / pending のどちらか
    • unresolved blocker がある場合は正規 termination cause

    最後にローカルの変更状態と GitHub readback を確認し、Issue refinement と child materialization の結果を簡潔に報告してください。

    実装コードの変更、Child の impl-review-loop 開始、PR 作成、マージはここでは行わず終了してください。

    この形なら、#2642 が明示している「A/B/C の独立調査 → 全 SubAgent terminal completion 待ち → child contract 確定」という順序も維持できます。親が approve した後は Step 4.5 で未 materialize child を issue-creator に委譲し、dedupe_key で重複判定するのが現行契約です。

  4. squne121 commented on Sep 16, 2026

    @squne121
    OwnerAuthor

    issue-refinement-loop: human_escalation

    Step 0f preflight 結果

    preflight.run.with_human_context(anchor: https://github.com/squne121/loop-protocol/issues/2642#issuecomment-5695924032)が以下を返した。

    • STATUS: blocked
    • NEXT_ACTION: human_judgment_required
    • BLOCKERS:
      • PLANNER_FAIL_CLOSED
      • missing_required_parent_section
      • structural_repair_action:structural_human_review_required_items_present

    structural_repair_action.disposition_summary: human_review_required(auto_apply_safe ではない)。.github/ISSUE_TEMPLATE/parent.yml が要求する以下 7 セクションが本文に存在せず、既存本文から exact source を自動 derivation できない(reason_codes: ["missing_required_field_without_exact_source"]、各 item derivation: null):

    • Summary
    • Goal
    • Current Validated Scope
    • Decisions Fixed
    • Quality Decision Record
    • Remaining Parent Gaps
    • Phase Handoff Contract

    rewrite_constraints.override_policy.overridable_in_current_result は空であり、この fail-closed 判定は今回の入力(anchor comment を含む)では override 不可。この gap は anchor comment の REQUEST_CHANGES 内容とは独立した、Issue #2642 の template 構造準拠の問題である。

    anchor comment(REQUEST_CHANGES)の内容確認

    anchor comment 全文(P1 3件・P2 3件、および Child 化前の追加受入条件表)は readback 済みで、下記に要約する。ただし Step 0f preflight が Step 1/Step 2 に到達する前に blocked したため、これらの disposition を Issue 本文へ反映する rewrite loop はまだ実行できていない(iteration 0 段階の記録として保持する)。

    1. P1 — 正常系を一度も完走しなくても親 Issue を閉じられる: Failure-path verified / Success-path verified / Runtime verification pending の 3 分類を要求。child が merge-ready でも current main 未反映のケースの整理も必要。
    2. P1 — coverage/delta 判定の反映漏れ: previous.status=available, current_candidates=[] の入力で delta_status=resolved になる現状挙動(関数単体で確認済み)。runtime-dependent finding は indeterminate にすべきで resolved にしてはならない、という不変条件を Child C に追加要求。
    3. P1 — checkpoint 確定タイミング: run_since_last_retrospective_cli() の watermark 書き戻しを前処理として使うと、収集済みだが分析未完了の window が checkpoint 更新で落ちる。収集/coverage 計算と checkpoint 確定を分離する要求。
    4. P2 — fan-out/fan-in の実質性: 逐次 try/except でも AC3〜AC5 に見かけ上合格しうるため、「先にdispatchしたobserverのcompletionを待たずに全required observerをdispatchする」ことを明記要求。futureのcancelと実行中subprocessの終了は別物という技術的指摘。
    5. P2 — coverage と metric computability の混同: 「source/windowを観測できた」と「要求された指標を計算できる」を分離要求。session件数は観測できても人間確認イベント未記録なら該当指標はunavailableとする。
    6. P2 — 回帰確認コマンドの漏れ: test_run_retrospective_structured_output_prose_fence.py(実装: agent-retrospective の structured output compatibility recovery が fence 前後の地の文で decode failure する missing_structured_output を解消する #2348 由来)を含む .claude/skills/agent-retrospective/scripts/tests/ 全体を通常回帰対象に明記要求。

    外部一次資料(Anthropic upstream #84784、raine/claude-code-proxy)への言及もあり、Child A の transport normalization 方針(薄い正規化層をbusiness validation前段に追加、既存_structured_output_from_result_compat()は再実装しない)を裏付ける。

    実行した SubAgent と terminal status

    なし。Step 0f preflight が blocked したため、Step 1 の codebase-investigator(A/B/C 3系統)、web-researcher は起動していない。

    current-head dedupe 結果

    未実施(Step 1 investigation 未着手のため)。

    materialized/reused child A/B/C

    なし(Step 4.5 child materialization gate に到達していない)。

    verification scope

    なし。

    live runtime verification

    pending(未評価)。anchor comment 自身も「この環境には claude 実行ファイルがないため live 検証は未実行」と明記しており、同様の制約下にある。

    次のアクションについて

    missing_required_parent_section の fail-closed は、Issue 本文を .github/ISSUE_TEMPLATE/parent.yml の必須セクション構造に合わせて人間が(または明示的な承認付きで)再構成する判断を要求している。既存本文の内容(Background/Observed Evidence, Existing Work/Dedupe Boundary, Desired Destination, Workstream A/B/C 等)をどのテンプレートセクションへどう写像するかは、内容の要約・優先順位判断を伴うため structural_repair_action が human_review_required としている。

    人間承認後、contract_update.run.with_human_context の trusted contract patch lane、または通常の issue-editor 経由の構造修正を経て、fresh preflight.run → Step 1 investigation(A/B/C 並列 dispatch + 完了 join)→ Step 2 review のサイクルを再開できる。

  5. squne121 commented on Sep 16, 2026

    @squne121
    OwnerAuthor

    今回の停止理由は確認できました。結論として、現行実装としては意図どおりの fail-closed ですが、#2642 のような既存本文に十分な情報があるケースまで人間停止させるのは自動化ワークフローとして過剰です。

    parent.yml は実際に Summary / Goal / Current Validated Scope / Decisions Fixed / Quality Decision Record / Remaining Parent Gaps / Phase Handoff Contract を必須にしています。 一方 #2642 本文にはすでに Background / Observed Evidence、Existing Work / Dedupe Boundary、Desired Destination、Workstream A/B/C、Child Issues、Acceptance Criteria、Parent Closure Rule など、再構成に使える情報がかなり揃っています。

    なぜ「人間承認」になるのか

    単に「必須セクションがないから」ではありません。現在の structural-repair policy は、セクションの中身を意味的に考えて書くこと自体を human judgment と定義しているからです。

    この設計は Issue #995 でかなり明示的に固定されています。自動修復できる derivation は template_value_exact、source_span_exact、derived_scalar_exact の3種類に限定され、semantic free-form prose、要約・解釈、複数ソースからの意味的統合、exact source がない Scope/Outcome/AC 等は human_review_required とされています。

    その結果、今回の preflight は7セクションについて derivation: null と判断し、overridable_in_current_result: [] のまま止まりました。実際のセッションでも STATUS: blocked → NEXT_ACTION: human_judgment_required になっています。

    つまり境界は現在こうなっています。

    「既存文章を byte-exact にコピーできる」→ 自動可
    「既存文章を読んで、この内容は Goal、この内容は Decisions Fixed と意味的に再編する」→ 人間

    これは安全側の設計としては一貫しています。ただし #2642 のように、内容はすでに存在していてテンプレートが後から要求する構造へリホームするだけのケースでは、自律ワークフローを不必要に止めています。

    今回については、あなたが今「必須セクションなら既存情報から自動修正してよい」と明示したので、これを human judgment の解決として扱うのが妥当です。raw gh issue edit などで preflight を迂回するのではなく、canonical contract_update / issue-editor controlled transaction で一度 #2642 を構造修復し、readback → fresh preflight → A/B/C SubAgent investigation → completion barrier → Step 2 review と再開するのを推奨します。consumer 側には既に repair_action を controlled Issue transaction へ適用する設計もあります。

    以下を、そのまま現在 auto mode で起動中の Claude Code に入力できます。

    対象:
    #2642

    直前の termination report:
    #2642 (comment)

    original trusted REQUEST_CHANGES anchor:
    #2642 (comment)

    .claude/skills/issue-refinement-loop を正本として、Issue #2642 の refinement loop を再開してください。

    このメッセージは、直前の human_judgment_required に対する明示的な人間判断です。

    Human decision: structural repair を承認する

    直前の preflight が検出した以下の missing required parent sections は、workflow/template 準拠のために自動修復してください。

    • Summary
    • Goal
    • Current Validated Scope
    • Decisions Fixed
    • Quality Decision Record
    • Remaining Parent Gaps
    • Phase Handoff Contract

    この7セクションについて、人間への追加確認は不要です。

    Issue #2642 の既存本文、Machine-Readable Contract、original anchor comment #5695924032、current-main repository evidence に既に存在する内容を根拠として、parent.yml の構造へ再配置・最小限の要約を行うことを承認します。

    これは新しい product requirement や scope を自由に創作してよいという承認ではありません。既存 evidence から支持できない新規 semantic commitment、相互に矛盾する authoritative source、又は本当に選択肢が複数あり repository evidence で決められない要求分岐が生じた場合だけ、新しい human_judgment_required として停止してください。

    直前と同じ missing_required_parent_section を理由に再度人間確認を要求しないでください。この specific blocker に対する人間判断はこのメッセージで完了しています。

    推奨する既存本文 → required section mapping

    既存契約を保持しながら、概ね以下の意味対応で再構成してください。必要に応じ current body / anchor のより正確な evidence に基づいて調整して構いません。

    • Summary

      • Background / Observed Evidence の問題要約
      • self-hosted retrospective が transport failure で最初の observer から進めなかった事実
      • A/B/C の3 failure class を短く要約
    • Goal

      • Machine-Readable Contract の goal_ref
      • Desired Destination
      • Claude-GPT self-hosted retrospective が strict validation を維持したまま fan-out/fan-in、coverage integration、final acceptance まで進められる状態
    • Current Validated Scope

      • current-main で確認済みの failure shape
      • Existing Work / Dedupe Boundary
      • Workstream A/B/C の ownership boundary
      • parent 自身は tracking/refinement only で implementation を所有しないこと
    • Decisions Fixed

      • A/B/C を独立 child とし 1 Issue = 1 PR を維持
      • transport normalization は business validation 前の薄い canonical normalization とする
      • existing _structured_output_from_result_compat() / strict schema validation を再実装・弱体化しない
      • required observers は completion を待たず全体を dispatch してから all-terminal join
      • observer failure 時にも残り observer を terminal まで回収
      • evaluator は required observers 全成功・validated 後のみ1回
      • runtime coverage と metric computability を分離
      • runtime-dependent finding は source/window 未観測なら resolved ではなく indeterminate
      • collection/coverage と checkpoint commit を分離し、successful finalize/authorization 後のみ checkpoint 確定
      • normal regression は agent-retrospective tests directory 全体を対象にする
      • parent refinement から impl-review-loop / PR / merge へは進まない
    • Quality Decision Record

      • parent_mode: delivery-rollup なので quality-gate ではないことを明記
      • Status は N/A
      • REQUEST_CHANGES が parent contract refinement に反映済みかを evidence として記録
      • quality-gate の擬似判定は作らない
    • Remaining Parent Gaps

      • Child A/B/C の refinement/materialization
      • Child A/B/C implementation/review/merge-ready
      • current-main または integration HEAD での live success-path acceptance
      • runtime unavailable の場合は Runtime verification pending として success-path verified と混同しない
    • Phase Handoff Contract

      • parent.yml の要求項目を満たす
      • Child A/B/C ごとに narrow goal / provenance / dedupe evidence / Allowed Paths / AC / deterministic verification / runtime verification applicability / Stop Conditions を引き継ぐ
      • transport / orchestration / coverage を1 childへ混載しない
      • A/B/C すべてで 1 Issue = 1 PR
      • parent から implementation を直接開始しない

    既存の useful content、AC、verification、runtime applicability、Allowed Paths、Parent Closure Rule、Delivery Rule は失わないでください。
    REQUEST_CHANGES の P1 3件 / P2 3件をすべて disposition し、意味を後退させないでください。

    Structural repair の実行経路

    raw gh issue edit 等で canonical route を迂回しないでください。

    skill が提供する trusted contract_update.run.with_human_context、canonical issue-editor、controlled transaction / repair consumer のうち、現在の SKILL と current main が指定する正規経路を使用してください。

    修復後は必ず:

    1. authoritative GitHub readback
    2. body/hash/freshness 確認
    3. fresh preflight.run.with_human_context
    4. fresh investigation
    5. fresh canonical Step 2 review

    を行ってください。

    古い preflight / review result を再利用しないでください。

    Step 1 — SubAgent investigation

    fresh preflight が通過したら、SubAgent を使用してください。

    最低限、独立した codebase-investigator を A/B/C の3系統で dispatch してください。

    A — transport normalization

    調査対象:

    B — observer fan-out/fan-in

    調査対象:

    • run_observer_wave()
    • required observer 3体の dispatch/completion semantics
    • first failure short-circuit
    • evaluator invocation gate
    • timeout/nonzero/malformed failure 後の aggregate result retrieval
    • concurrency/cancellation semantics
    • Child B の最小 Allowed Paths / verification

    C — runtime coverage/checkpoint integration

    調査対象:

    planner が external research を required とする場合は web-researcher も dispatch し、anchor の外部 claim を一次資料中心に確認してください。

    Mandatory SubAgent completion barrier

    SubAgent は dispatch しただけで完了扱いにしないでください。

    可能な限り A/B/C(および required な web-researcher)を先に dispatch し、先に起動した SubAgent の completion を待ってから次を dispatch する逐次実行にしないでください。

    全 required SubAgent が terminal state になるまで必ず join / wait してください。

    1体が失敗しても、process-wide fatal error でない限り残りの required SubAgent の completion 回収を続けてください。

    全 required SubAgent の terminal result を取得する前に synthesis、Issue rewrite、Step 2 review、child materialization へ進まないでください。

    各 SubAgent の status と主要 evidence を統合してから次工程へ進んでください。

    Step 2 review

    canonical Step 2 は direct issue-reviewer invocation で代用せず、

    .claude/skills/issue-refinement-loop/scripts/run_root_review_pipeline.py produce

    の current canonical route を使用してください。

    SKILL が要求する場合は Bash tool で明示的 background execution とし、その後 mandatory completion join を行ってください。

    review が needs-fix / request_changes の場合:

    • 人間に続行確認を求めない
    • canonical issue-editor / controlled transaction で修正
    • authoritative readback
    • 必要なら fresh preflight / investigation
    • fresh Step 2 review
    • max_iterations=3 まで自律継続

    同じ body hash の no-progress retry は行わず canonical router に従ってください。

    Anchor REQUEST_CHANGES の必須 disposition

    original anchor の P1/P2 全件を契約へ反映してください。

    特に:

    • Failure-path verified
    • Success-path verified
    • Runtime verification pending

    を明確に区別する。

    A/B/C が merge-ready でも current main に未mergeなら current main 統合済みとは扱わない。

    runtime-dependent finding で required source/window が未観測なら resolved にせず indeterminate。

    checkpoint は collection 開始時ではなく、fixed window の analysis/evaluator/finalize が正常完了した後にだけ確定する。

    required observer は、先行 observer の completion を待たず全 required observer を dispatch してから all-terminal join する。

    source/window coverage と metric computability を別々に表現する。

    .claude/skills/agent-retrospective/scripts/tests/ 全体を deterministic regression scope とし、#2348 由来の test_run_retrospective_structured_output_prose_fence.py を明示的に取りこぼさない。

    Child materialization

    最終 review が approve / canonical final gate を通過したら Step 4.5 child materialization gate を実行してください。

    A/B/C は独立 child とし、それぞれ:

    を持たせてください。

    全 child materialization operation の completion/readback を待ってください。

    Termination

    Issue #2642 は issue_kind: parent / delivery-rollup です。

    refinement と child materialization 完了後も impl-review-loop を開始しないでください。
    implementation code を変更しないでください。
    PR を作成しないでください。
    merge しないでください。

    最後に GitHub authoritative readback と local working tree status を確認し、

    • structural repair の結果
    • fresh preflight の結果
    • 実行した全 SubAgent と terminal status
    • REQUEST_CHANGES disposition
    • Step 2 最終 verdict
    • materialized/reused Child A/B/C
    • verification scope
    • live runtime verification applicability/pending 状態
    • residual blockers

    を簡潔に報告して終了してください。

    なお、今回解消済みの missing_required_parent_section とは異なる、新しい genuinely semantic な human_judgment_required、解消不能な environment/integrity failure、外部 authorization 必須の場合だけ停止してください。

    別 Issue として直したい点

    新規改善 Issue では、「意味的な新規情報の生成」と「既存契約のテンプレートへの再配置」を同じ human_review_required にまとめていることを切るのがよいです。

    #995 は現在、semantic prose を自動生成しないという強い境界を意図的に持っています。 したがって #995 の思想を単純に撤回するより、evidence-preserving structural rehome という狭い中間 lane を追加する案が適しています。既存本文・trusted human context に必要な意味が存在するなら自動再編を許し、新規 requirement、矛盾、authority conflict が生じるときだけ従来どおり停止させます。

    implementation template は Current Validated Scope、Outcome、Acceptance Criteria、Verification Commands、Allowed Paths などを要求しているので、以下はその形式に寄せています。

    実装: issue-refinement-loop で既存 evidence から required section を自動 rehome し不要な human escalation を回避する

    Machine-Readable Contract

    contract_schema_version: v1
    issue_kind: implementation
    parent_issue: "none"
    goal_ref: >-
      required template section が欠けていても、必要な semantic content が既存 Issue body
      または trusted human context に既に存在する場合は evidence-preserving な構造再配置を
      controlled transaction で自動適用し、真に新しい semantic judgment が必要な場合だけ
      human_review_required とする
    change_kind: workflow

    Parent Issue

    none

    Parent Goal Ref

    • Goal: issue-refinement-loop の structural repair が、legacy/custom heading を使用している既存 Issue を不要に human escalation させない。
    • Desired Destination: exact byte-copy だけでなく、既存 evidence の意味を変更しない bounded structural rehome を自律適用でき、fresh preflight から refinement loop を継続できる。

    Current Validated Scope

    current structural-repair policy は template_value_exact / source_span_exact / derived_scalar_exact の closed derivation のみを auto_apply_safe とし、semantic free-form prose、要約・解釈、exact source のない semantic field は human_review_required とする。

    この境界は新規 requirement の捏造防止には有効だが、必要な意味が既存 Issue body に存在し、単に template の canonical heading と異なる構造で書かれている場合も停止する。

    source incident として Issue #2642 では、既存本文に Background / Desired Destination / Existing Work / Workstream A/B/C / Child Issues / Acceptance Criteria / Parent Closure Rule 等が存在したにもかかわらず、parent template の以下 required sections に exact single-source derivation を作れず preflight が iteration 0 で停止した。

    • Summary
    • Goal
    • Current Validated Scope
    • Decisions Fixed
    • Quality Decision Record
    • Remaining Parent Gaps
    • Phase Handoff Contract

    本 Issue は #2642 の agent-retrospective business requirements を実装しない。structural-repair classification / planning / controlled application の改善だけを所有する。

    Remaining Parent Gaps

    なし。#2642 自体の refinement、Child A/B/C、agent-retrospective implementation は本 Issue の scope 外。

    Outcome

    structural-repair producer が、required field に exact single-span source がなくても、必要な情報が既存 Issue body / trusted human context に明示的に存在し、内容を追加・変更せず canonical template section へ再配置できる場合を新しい bounded disposition として分類できる。

    この lane は例えば evidence_preserving_rehome とし、少なくとも以下を満たす。

    1. source は current Issue body、resolved template、trusted human-context のみに限定する。
    2. source block/span と target required field の provenance を全件保持する。
    3. 新規 scope、acceptance criterion、policy decision、authority decision を生成しない。
    4. contradictory source、authority conflict、意味的な選択肢が複数ある場合は従来どおり human_review_required。
    5. empty source を「それらしい文章」で補完しない。
    6. post-apply authoritative readback と fresh preflight を必須にする。
    7. raw GitHub mutation を追加せず、既存 controlled transaction consumer を再利用する。
    8. auto mode では repair 成功後に refinement loop をそのまま継続し、同じ structural blocker に対する再承認を要求しない。

    可能なら semantic rewrite を広く許可するのではなく、次の順序で安全側に分類する。

    exact derivation
    → evidence-preserving structural rehome
    → human_review_required

    Runtime Verification Applicability

    decision: not_applicable
    reason: >-
      structural repair classifier / planner / controlled Issue transaction の
      deterministic workflow behavior で検証可能であり、
      product runtime の live verification を必要としない。

    In Scope

    • missing required section classification の refinement
    • legacy/custom heading から canonical required section への bounded rehome
    • source-span/provenance を保持した multi-source assembly
    • auto_apply_safe と human_review_required の間の明確な policy boundary
    • current repair_action.apply controlled consumer の再利用
    • mutation 後 authoritative readback
    • fresh preflight 自動継続
    • P0: agent-retrospective の Claude-GPT self-hosted run を完走可能にし all-terminal fan-in と runtime coverage を統合する #2642 shape を再現する deterministic regression fixture
    • semantic content が本当に不足している negative fixture
    • source conflict / authority conflict negative fixture

    Out of Scope

    Acceptance Criteria

    • AC1: required section が欠けていても、その semantic content が legacy/custom heading 下の既存 body に存在する fixture は human_review_required ではなく bounded structural-rehome candidate になる。
    • AC2: candidate は target field ごとに source body identity、source heading/span、source digest、target template field、candidate digest を保持する。
    • AC3: auto repair は既存 evidence で支持されない新しい scope / decision / AC / VC / Allowed Paths を生成しない。
    • AC4: 複数 source が矛盾する、authority が競合する、target field の内容が実際に存在しない、又は semantic decision が必要な fixture は従来どおり human_review_required になる。
    • AC5: unknown_issue_kind、template resolution failure、schema/internal error 等の既存 never-override class は自動修復対象にならない。
    • AC6: safe structural rehome は existing controlled transaction consumer を通して最大1回適用され、raw GitHub mutation path を追加しない。
    • AC7: mutation 後 authoritative readback と fresh preflight を行い、required sections が解消した場合は同一 refinement invocation が Step 1 へ自動継続する。
    • AC8: post-apply body drift / provenance mismatch / unknown mutation outcome は既存 fail-closed semantics を維持する。
    • AC9: P0: agent-retrospective の Claude-GPT self-hosted run を完走可能にし all-terminal fan-in と runtime coverage を統合する #2642 相当 fixture では Summary / Goal / Current Validated Scope / Decisions Fixed / Quality Decision Record / Remaining Parent Gaps / Phase Handoff Contract を既存 evidence から再構成し、preflight が missing_required_parent_section で停止しない。
    • AC10: semantic information自体が欠落した control fixture は P0: agent-retrospective の Claude-GPT self-hosted run を完走可能にし all-terminal fan-in と runtime coverage を統合する #2642 fixture と区別され、human_review_required のままになる。
    • AC11: existing structural-repair / controlled transaction regression suite が PASS し、実装: fail_closed rewrite constraints を issue-author へ強制転送し、template-derived required sections を初回修復する #995 が保持する「evidence がない semantic completion は禁止」の不変条件を後退させない。

    Verification Commands

    current main の exact test inventory を implementation refinement 時に readback して固定する。

    最低限、以下の既存系統を回帰対象に含める。

    uv run --locked pytest -p no:cacheprovider \
      .claude/skills/issue-refinement-loop/tests/test_template_section_repair.py \
      .claude/skills/issue-refinement-loop/tests/test_repair_diagnostics_routing.py \
      .claude/skills/issue-refinement-loop/tests/test_plan_refinement_loop.py \
      .claude/skills/issue-refinement-loop/tests/test_refinement_preflight.py \
      -q

    controlled repair consumer を変更する場合は、その既存 consumer tests も追加する。

    repository standard gates は current main の canonical verification profile に従う。

    Allowed Paths

    initial candidates。issue-refinement-loop refinement 時に current main を readback して最小化する。

    • .claude/skills/issue-refinement-loop/scripts/repair_issue_contract.py
    • .claude/skills/issue-refinement-loop/scripts/plan_refinement_loop.py
    • .claude/skills/issue-refinement-loop/scripts/run_refinement_preflight.py
    • .claude/skills/issue-refinement-loop/schemas/**
    • .claude/skills/issue-refinement-loop/tests/**
    • .claude/skills/issue-refinement-loop/SKILL.md

    既存 repair_action.apply consumer に schema/interface extension が必要と current-head evidence で確認された場合だけ、その consumer と対応 tests を追加する。

    Stop Conditions

    • evidence に存在しない semantic prose を auto-safe として生成する必要がある場合
    • source / authority conflict を LLM 判断で自動解決する必要がある場合
    • unknown issue kind / template resolution error / schema error を override する必要がある場合
    • existing controlled transaction を迂回して別 GitHub mutation path が必要になる場合
    • 実装: fail_closed rewrite constraints を issue-author へ強制転送し、template-derived required sections を初回修復する #995 の exact/evidence-bound invariant を削除しなければ成立しない場合
    • generic orchestration framework、permission broker、重量級 harness が必要になる場合

    Required Skills

    • Python deterministic text transformation
    • CommonMark heading / source-span parsing
    • JSON Schema
    • issue-refinement-loop structural-repair policy
    • controlled Issue transaction / provenance validation

    Required Design References

    Scope Delta

    N/A

    この改善 Issue は #2642 の要件とは別物として切るのが適切です。#2642 は agent-retrospective の修復、こちらは issue-refinement-loop 自体が古い/非canonicalな Issue 構造を自律的に正規化できるようにする control-plane 改善です。現時点では草案のみで、GitHubへの新規Issue作成は行っていません。

  6. squne121 commented on Sep 16, 2026

    @squne121
    OwnerAuthor

    issue-refinement-loop: approved

    経緯サマリー

    1. Step 0f preflight(1回目): STATUS: blocked / human_judgment_required。.github/ISSUE_TEMPLATE/parent.yml の必須7セクション(Summary/Goal/Current Validated Scope/Decisions Fixed/Quality Decision Record/Remaining Parent Gaps/Phase Handoff Contract)欠落、structural_repair_action.disposition_summary: human_review_required(自動derivation不可)。
    2. Human decision(trusted): OWNER が structural repair を明示承認し、既存本文→required section の写像方針を指示。
    3. Structural repair 適用: issue-editor 経由で7セクション追加+anchor comment(#5695924032)のP1/P2disposition を本文へ反映。fresh preflight → STATUS: pass。
    4. Step 1 investigation(A/B/C並列、全SubAgent terminal completion join済み): codebase-investigator ×3が current main の関連実装箇所を特定し、closed Issue(実装: agent-retrospective canonical run が retrospective-runtime-observer の missing_structured_output で fail-closed する回帰を解消する #2341/実装: agent-retrospective の structured output compatibility recovery が fence 前後の地の文で decode failure する missing_structured_output を解消する #2348/実装: agent-retrospective の codebase observer を role-specific contract で接続し、AGY operational failure 時の native fallback 結果を base_sha-bound な OBSERVER_RESULT_V1 へ正規化する #2374/P0: agent-retrospective の --since-last-retrospective で session collector 未配線を false-green にしない #2601)との非重複、各childの最小Allowed Paths/verification候補を確認。
    5. Step 2 review(1回目): canonical_step2_route: step_2_5(deterministic approve)。
    6. Step 2.5 semantic design review(1回目): issue-design-reviewer が high severity finding 2件(Parent Closure Rule の runtime-pending closure 経路が無制限の standing route/ requires_owner_choice: true、および docs/dev/runtime-verification-policy.md §6 必須 Stop Conditions bullet欠落 / requires_owner_choice: false)を検出。join_review_results.py → effective_verdict: needs-fix。
    7. Step 4 semantic rewrite: anchor comment自身の「runtime unavailableでも実装・レビュー・merge-readyへの進行は妨げない。一方、親の『正常系の動作確認済み』という扱いにはしない、という分離が個人開発には適しています」を根拠に、closure経路を完全撤去せず条件付き例外(理由明記・昇格意図明記・human merge時の明示確認)として明文化。Stop Conditions に policy必須2bulletを逐語追加。issue-editor 経由で反映。
    8. Fresh preflight → fresh Step 2 review(2回目): 両方 pass/approve。
    9. Step 2.5 semantic design review(2回目): 前回2件の fix を十分と判定。medium severity finding 1件(requires_owner_choice: false、human確認要件の具体的artifact未定義)を新規検出したが non-blocking warning。join_review_results.py → effective_verdict: approve。
    10. Step 4.5 child materialization: GitHub open issue検索で重複なしを確認後、issue-creator ×3(並列dispatch・全terminal completion join済み)で Child A/B/C を起票、create_issue_txn.py による sub-issue登録・readback検証済み。parent本文の Child Issues checklist に実際の Issue番号を追記(issue-editor 経由)。

    anchor comment(REQUEST_CHANGES #5695924032)P1/P2 disposition

    # 内容 disposition
    P1-1 正常系を一度も完走しなくても親Issueを閉じられる Failure-path verified / Success-path verified / Runtime verification pending の3分類を Remaining Parent Gaps に明記。Parent Closure Rule の runtime-pending例外を条件付き(理由・昇格意図・human merge時確認)に限定(Step 2.5 round1で指摘・round2で十分性確認済み)
    P1-2 今回runtime未観測でも過去findingがresolvedになる Decisions Fixed / Workstream C / AC10 に indeterminate 不変条件を明記
    P1-3 coverage前処理流用でcheckpointが分析失敗前に進む Decisions Fixed / Workstream C / Stop Conditions に collection-coverage/checkpoint分離を明記
    P2-4 逐次実行でもfan-out/fan-in修正として合格できる Decisions Fixed / Workstream B に「先行observerのcompletionを待たない全dispatch」を明記
    P2-5 source観測とmetric computabilityの混同 Decisions Fixed / Workstream C に分離invariantを明記
    P2-6 回帰確認コマンドからcompatibility専用テストが漏れる Verification Strategy に .claude/skills/agent-retrospective/scripts/tests/ 全体+test_run_retrospective_structured_output_prose_fence.py を明示

    Child化前提条件表(A/B/C追加AC)も各child issueのAcceptance Criteriaへ反映済み。

    実行した SubAgent と terminal status

    SubAgent 用途 terminal status
    codebase-investigator ×3(A/B/C) current main調査・dedupe completed(3件とも)
    issue-design-reviewer ×2 Step 2.5 semantic review completed(round1: needs-fix、round2: approve+1 warning)
    issue-editor ×3 structural repair / semantic rewrite / child-link update completed(3件とも STATUS: ok、body_sha256一致確認済み)
    issue-creator ×3(A/B/C) child issue起票 completed(3件とも status: success、sub-issue登録・readback確認済み)

    web-researcher は planner が external research を required としなかったため未起動(anchor comment内の外部一次資料言及は anchor comment 自体の記述として repository evidence 扱いで disposition 済み)。

    current-head dedupe 結果

    gh issue list --search で各Workstreamのキーワード検索を実施し、#2642自身以外のopen重複なしを確認。closed Issue(#2341/#2348/#2374/#2601)は investigation で個別に「今回の3 gapとは異なる failure class を所有」と確認済み(詳細は各investigation SubAgent報告参照)。

    materialized child A/B/C

    • Child A(transport normalization): #2645 — open、sub-issue登録済み
    • Child B(observer fan-out/fan-in barrier): #2646 — open、sub-issue登録済み
    • Child C(runtime coverage/checkpoint integration): #2644 — open、sub-issue登録済み

    いずれも check_issue_overlap.py で parent (#2642) との parent_child_collision(想定内・advisory)のみを検出し、他の無関係な重複はなし。3件とも post-create ready tuple validation(GUARD_EXIT=0)を通過済み。

    verification scope

    なし。本 refinement loop では repository のコード・テストファイルへの変更は一切行っていない(Issue本文のmutationのみ)。

    live runtime verification

    pending(未実施)。anchor comment自身も「この環境には claude 実行ファイルがないため live 検証は未実行」と明記しており、同様の制約下にある。各 child issue の Runtime Verification Applicability: decision: immediate は child の実装・レビュー段階で live 検証を要求する。

    residual(non-blocking)

    Step 2.5 round2 で medium severity finding 1件が残存: Parent Closure Rule の Runtime verification pending closure 経路の「human が merge時に明示確認する」という要件に対し、確認済みと判定する具体的 artifact(例: close comment への disposition明記)が未定義。requires_owner_choice: false かつ non-blocking warning のため effective_verdict: approve の成立を妨げないが、parent closure 実行時(Step 5 相当、本 refinement loopのスコープ外)に検討の余地がある。

    次の段階

    repository implementation・impl-review-loop・PR作成・マージには進んでいません(本 refinement loop のスコープ外、ユーザー指示通り)。各 child issue(#2644, #2645, #2646)の実装は、別途 impl-review-loop を個別起動して進める。

  7. squne121 commented on Sep 18, 2026

    @squne121
    OwnerAuthor

    Children complete: #2644 (PR #2660), #2645, #2646 すべて closed/completed。post-merge-cleanup (PR #2660) の parent_issue_status.recommended_action: close に基づき自動クローズ。follow-up (source digest runtime collector gap) は別 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

    enhancementtriage-required

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions