Skip to content

fix(impl-review-loop): identity-bound runner unavailable をdeferredにする - #1809

Merged
squne121 merged 3 commits into
mainfrom
worktree-issue-1805-runner-unavailable-identity-deferred
Jul 26, 2026
Merged

squne121 merged 3 commits into
mainfrom
worktree-issue-1805-runner-unavailable-identity-deferred

Conversation

@squne121

@squne121 squne121 commented Jul 26, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • runner_unavailable marker を、repo・issue・invocation・requested_at・generated_at と時系列だけで deferred に決定するよう変更しました。
  • この status では script SHA、result payload、capture sidecar を要求しません。
  • identity は文字列・整数型をstrictに検証し、YAML native timestamp、bool、float、string coercionを含む型不正、malformed/stale marker、ok / failed の既存検証経路は stop_human です。

Checks

Issue #1805 のVerification Commandsを対象ファイルに対して実行しました。

  • 検証対象head: 9a744811211af8a9da772be1152ff6a8c3f21f23

  • uv run --locked pytest .claude/skills/impl-review-loop/tests/test_parse_scope_rollup_run_result.py -q -k runner_unavailable(runner unavailable回帰: 14 passed)

  • uv run --locked pytest .claude/skills/impl-review-loop/tests/test_parse_scope_rollup_run_result.py -q -k failed_marker_stops_human(failed route回帰: 1 passed)

  • uv run --locked pytest .claude/skills/impl-review-loop/tests/test_parse_scope_rollup_run_result.py -q -k "marker or capture or runner_unavailable"(marker/capture回帰: 37 passed)

  • rg -n "runner_unavailable" .claude/skills/impl-review-loop/steps/preparation.md(手順記載を確認)

  • uv run --locked pytest .claude/skills/impl-review-loop/tests/test_parse_scope_rollup_run_result.py -q(全対象: 42 passed)

受け入れ条件の達成状況

  • AC1: identity一致かつ generated_at > requested_at の runner_unavailable は、script SHA・payload・capture sidecarなしでも deferred。根拠: -k runner_unavailable は14 passed。
  • AC2: ok / failed は既存routeを維持。根拠: -k failed_marker_stops_human は1 passed、全対象は42 passed。
  • AC3: identity不一致、malformed/stale marker、capture failureは stop_human。根拠: -k "marker or capture or runner_unavailable" は37 passed。
  • AC4: preparation手順にstatus別のscript SHA必須性とstrict identity条件を記載。根拠: rg -n "runner_unavailable" .claude/skills/impl-review-loop/steps/preparation.md はPASS。
  • AC5: 対象parser pytest全件がPASS。根拠: uv run --locked pytest .claude/skills/impl-review-loop/tests/test_parse_scope_rollup_run_result.py -q は42 passed。

検証コマンド結果

対象 コマンド 結果
AC1 uv run --locked pytest .claude/skills/impl-review-loop/tests/test_parse_scope_rollup_run_result.py -q -k runner_unavailable 14 passed
AC2 uv run --locked pytest .claude/skills/impl-review-loop/tests/test_parse_scope_rollup_run_result.py -q -k failed_marker_stops_human 1 passed
AC3 uv run --locked pytest .claude/skills/impl-review-loop/tests/test_parse_scope_rollup_run_result.py -q -k "marker or capture or runner_unavailable" 37 passed
AC4 rg -n "runner_unavailable" .claude/skills/impl-review-loop/steps/preparation.md PASS
AC5 uv run --locked pytest .claude/skills/impl-review-loop/tests/test_parse_scope_rollup_run_result.py -q 42 passed

Allowed Paths 遵守

  • 判定: ok。Allowed Paths gateはcurrent head 9a744811211af8a9da772be1152ff6a8c3f21f23 に束縛して再計算済みです。
  • 変更パスは次の3件のみです。
    • .claude/skills/impl-review-loop/scripts/parse_scope_rollup_run_result.py
    • .claude/skills/impl-review-loop/tests/test_parse_scope_rollup_run_result.py
    • .claude/skills/impl-review-loop/steps/preparation.md

Schema Change Applicability

marker schemaの公開形状は維持し、検証順序だけを変更するための判定です。

  • decision: not_schema_change
  • reason: marker のキー集合・宣言型・enum は変更せず、既存identity fieldの型制約をstrictに検証します。

Schema Consumer Inventory

関連するconsumerはparser、回帰テスト、準備手順に限定して確認しました。

変更対象 schema: N/A(キー集合・型・enum の変更なし)

before/after 差分:

# before
# runner_unavailable は script SHA 検証後に deferred

# after
# runner_unavailable は identity と時系列を検証後に deferred

Consumer 列挙(rg コマンド例と結果):

rg -n "runner_unavailable" .claude/skills/impl-review-loop
# parser、対象pytest、preparation.md を確認

Consumer 更新状況:

Consumer ファイル 更新有無 備考
parse_scope_rollup_run_result.py 更新済み identity-only route を実装
test_parse_scope_rollup_run_result.py 更新済み artifactなしとfail-closed回帰を追加
preparation.md 更新済み route条件を明記

Compatibility Decision(互換性判断)

  • change_type: N/A
  • compatibility: N/A
  • migration_required: N/A
  • migration_or_followup: N/A
  • reason: marker schema 自体は不変です。

Safety Claim Matrix

下表の主張は parser のroute判定に限定し、runner自体の起動可否には拡張しません。

Claim Implemented? Not controlled Evidence Follow-up
runner_unavailable は一致済みidentityと時系列でのみ deferred になる yes targeted pytest 14 passed N/A
bool/float/string coercionとYAML native timestampは deferred に進まない yes strict型回帰を含む42 passed N/A
identity不一致・stale・malformedは deferred に進まない yes targeted pytest 37 passed N/A
ok / failed の既存routeは維持される yes targeted pytest 1 passed、全42 passed N/A

Notes

実装範囲と契約束縛、overlap preflightの結果を記録します。

@github-actions

github-actions Bot commented Jul 26, 2026 •

Copy link
Copy Markdown
Contributor

Preview URL

Preview removed (PR #1809 closed).

@squne121 squne121 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LOOP_VERDICT_V2

LOOP_VERDICT_V2:
  verdict: APPROVE
  reviewed_head_sha: "9a744811211af8a9da772be1152ff6a8c3f21f23"
  merge_ready: true
  mergeability:
    mergeable: "MERGEABLE"
    merge_state_status: "CLEAN"
  blockers: []
  required_auto_actions: []
  auto_fix_applied: []
  follow_up_issue_requests: []
  allowed_paths_gate:
    status: ok
    changed_files_source: github_pull_request_files_api_with_previous_filename
    changed_files:
      - .claude/skills/impl-review-loop/scripts/parse_scope_rollup_run_result.py
      - .claude/skills/impl-review-loop/steps/preparation.md
      - .claude/skills/impl-review-loop/tests/test_parse_scope_rollup_run_result.py

Issue #1805 のcontract snapshot、現行headに束縛したCI API/read-only verifier、Allowed Paths gateを照合しました。ブロッカーはありません。

@squne121

Copy link
Copy Markdown
Owner Author

you asked

message time: 2026-07-27 06:48:39

#1809
内容について関連Issue、PR、リポジトリ資産、コメントを参照した上で敵対的レビューして。
取り扱う技術や配布物の実装をWEB検索し高品質化してほしい。


chatgpt response

PR本体・差分・関連Issue/PR・レビュー履歴・CIを確認し、次にリポジトリ規約と外部の一次資料で実装妥当性を照合します。重大度順に、再現条件と修正方針まで落とします。

差分は小さいですが、信頼境界を「script SHA・capture証跡」から「自己申告markerのidentityと時刻」へ移しています。ここが本レビューの中心で、producer側の生成経路と既存ポリシーまで追います。

結論

REQUEST_CHANGES。現状のままではマージ不可です。

PR #1809 は Draft、対象 head は 9a744811211af8a9da772be1152ff6a8c3f21f23 です。CI は成功しており、既存レビューも APPROVE / blockers: [] ですが、新しいテストが「capture sidecarなしのmarkerを受理すること」自体を正解としているため、CI green は下記の設計欠陥を否定しません。

P0 — runner_unavailable でproducer provenanceを完全に迂回できる

変更後のparserは、identityと時刻を確認すると即座に runner_unavailable を返し、後段のcapture sidecar検証へ到達しません。追加された正常系テストも、任意の一時ファイルへmarkerを書き、sidecarを作らないまま deferred になることを明示的に期待しています。

これは「exact executorが動かなかった」と「markerを出したsubagentの出所が検証できない」を混同しています。runner_unavailable は、subagentがスクリプト欠落やexecutor errorを検出した後、自身の最終応答として生成するstatusです。つまりexecutor artifactはなくても、subagent final responseのcapture provenanceは存在するべきです。

Claude Codeの公式仕様でも、SubagentStop は agent_type と last_assistant_message を渡し、特定subagentの最終応答をtranscript解析なしで取得するためのイベントです。sidecarはexecutor成果物ではなく、まさにこのorigin bindingを記録するcontrol-plane証跡です。(Claude)

結果として、次のような自己申告markerだけでscope-rollupを deferred にできます。

ISSUE_SCOPE_ROLLUP_RUN_RESULT_V1:
  status: runner_unavailable
  repo: squne121/loop-protocol
  current_issue: 1805
  invocation_id: "<callerが生成した値>"
  requested_at: "<callerが生成した値>"
  generated_at: "9999-12-31T23:59:59Z"

script_blob_sha256、schema version、capture、agent type、capture sourceは不要です。preparationはdeferredを記録した後にStep 3へ進むため、誤ったagent出力、手動転記、残存ファイル、hallucinated markerによってscope-overlap preflightを事実上スキップできます。

この変更は、過去のIssue #873/PR #933が導入した「capture provenance不一致はstop_human」という設計を逆戻りさせています。

修正方針

  • runner_unavailableでもcapture sidecarを必須にする。
  • 免除するのはexact executor由来の script_blob_sha256、payload、result hashだけに限定する。
  • validなtarget-agent captureでは、hook側を capture_routing_action: deferred にする。
  • wrong agent_type、hook_unavailable、missing/duplicate/stale sidecarは従来どおり stop_human。
  • status名も、実態に合わせて将来的に executor_unavailable へ変更した方が誤解が少ないです。

P1 — producer・hook・consumer間の契約が矛盾している

現在のcapture hookは、ok 以外のstatusを一律 capture_routing_action: stop_human として記録します。ところがPR後のparserは、runner_unavailableではそのsidecar自体を読みません。

Codex版producerも引き続き以下を要求しています。

  • script_blob_sha256
  • marker_schema_version: 3
  • capture target agent type不一致時のfail-closed
  • hook availability未確認時にlive PASSを主張しないこと

PRの「consumerはparser・test・preparationだけ」「schema changeではない」という評価は不完全です。少なくともClaude producer、Codex producer、capture hook、coordinator、producer parity validatorがconsumer inventoryに含まれます。

またpreparation自身も、前段では「sidecar missing/mismatchはstop_human」、後段では「runner_unavailableはsidecar不要」と相反する説明になっています。

修正方針: schema consumer inventoryを再作成し、Claude/Codex両producer、hook、parser、preparationを同一PRまたは明示的なmigration sequenceで更新してください。


P1 — schema discriminatorを検証する前にearly returnしている

marker_schema_version の検証は runner_unavailable のearly returnより後です。そのため、次のmarkerも deferred になります。

status: runner_unavailable
marker_schema_version: 999

さらに、トップレベルの schema_version はrequired fieldですらありません。将来、同じstatus名で互換性のないmarkerが導入されても旧parserが黙って受理します。

修正方針: status別artifact検証より前に、共通envelopeとして以下を必須検証してください。

  • schema_version
  • marker_schema_version
  • statusごとの対応version
  • additional/unsupported versionの拒否

P1 — timestamp検証がidentity bindingになっていない

実装は datetime.fromisoformat() で両時刻をUTCへ変換して比較しています。そのため、callerが渡した文字列のverbatim echoではなく、同じ瞬間を示す別表記も受理します。

例:

expected: 2026-06-13T10:00:00+00:00
marker:   2026-06-13T12:00:00+02:00

Pythonの datetime.fromisoformat() はbasic形式、week date、空白区切り、任意の単一Unicode separatorなど、広いISO 8601表記を受理します。「canonical parser」という説明とは一致しません。 (Python documentation)

また generated_at > requested_at の上限がなく、数年後・西暦9999年でも通ります。sidecarを外した結果、trustedなhook receipt timeとのfreshness bindingも失われています。

修正方針

  • requested_at はcaller値との文字列完全一致を要求する。
  • RFC 3339の許可形式を正規表現または専用validatorで限定する。
  • generated_at <= trusted_hook_received_at + clock_skew を検証する。
  • 少なくとも極端なfuture timestampを拒否する。

P1 — Open Issue #1661と追加テストが直接衝突している

このPRは、PyYAMLがunquoted timestampをnative datetime に変換した場合に marker_malformed とするテストを追加しています。

しかしOpen Issue #1661は、まさにparserとhookからimplicit timestamp resolverを除去し、unquoted ISO timestampを文字列として保持・処理することを受け入れ条件にしています。YAML仕様上もtag resolutionはapplication-specificで、applicationがdefault resolutionをoverrideできることが推奨されています。 (YAML)

#1661が実装されれば、このPRのdatetime fixtureは意図どおりの入力を生成しなくなるか、期待値が逆転します。「#1661とは別スコープ」というoverlap判断では不十分です。

修正方針: timestampのinvalid-type testからdatetime fixtureを除外し、#1661のresolver方針を先に確定してください。bool、float、list、mappingなど、本当にschema違反となる型でstrictnessを検証すべきです。


P2 — 「planner script欠落」の実運用経路が成立しない

producerはplanner script欠落を runner_unavailable として返す仕様ですが、preparationはsubagent起動前に同じファイルへ sha256sum を実行しています。さらにparser CLIの --expected-script-sha は必須です。

したがってファイルが本当に欠落している場合、documented flowはrunner起動前に停止する可能性があります。今回のpytestは "not-required-for-runner-unavailable" というsentinelを直接渡しており、preparation全体を検証していません。

修正方針: hash取得失敗を明示的なsentinelへ変換するか、marker statusを先にparseしてからstatus別にexpected SHAを要求してください。preparation commandからhook、parserまでの統合テストが必要です。

必須の追加回帰テスト

マージ前に、少なくとも次をactual capture producer経由で固定すべきです。

  1. target scope-rollup-runner のvalid capture+runner_unavailable → deferred
  2. 同じmarkerでsidecar missing → stop_human
  3. wrong agent_type/hook_unavailable/duplicate capture → stop_human
  4. 任意temp fileへmarkerだけを書いたケース → stop_human
  5. unsupported marker_schema_version → stop_human
  6. equivalent-but-non-verbatim requested_at → reject
  7. future generated_at → reject
  8. Claude routeとCodex source-bound route双方のintegration fixture

現PRの目的である「不要なexecutor artifactを要求しない」は妥当です。ただし、executor artifactの免除とproducer provenanceの免除は別問題です。現在の実装は後者まで削除しており、過去に構築したfail-closed境界を弱めています。


you asked

message time: 2026-07-27 06:59:17

人間要望として個人趣味開発に過剰なサブエージェントの発火証跡自動確認機能とか、サイドカー?とかいらないって話なんだけど、レビューに反映されてる?


chatgpt response

十分には反映されていません。前のレビューは、あなたの運用方針よりも「厳格なcontrol-plane provenance」を優先しすぎました。

特に、「runner_unavailable でもcapture sidecarを必須にすべき」というP0指摘は撤回すべきです。Issue #1805自体が、個人開発で過剰なsession-recording・permission・credential検査を実装前提にしない方針を明示し、runner_unavailable ではscript SHA・payload・capture sidecarを要求しない契約になっています。

あなたの要望を前提にすると、このPRの設計意図は妥当です。

  • ok:実行結果を採用するので、SHA・payload・sidecarを厳格に検証
  • failed:人間対応で停止
  • runner_unavailable:結果を採用せず単にdeferredと記録するため、identityと時刻だけ確認
  • sidecarや発火証跡の欠落だけで趣味開発を停止させない

これはセキュリティ境界の弱体化というより、低リスクなdeferred状態に対する過剰検証の削減です。deferredからゲームコードの変更やGitHubへの書き込みが自動承認されるわけではないため、前レビューは影響を過大評価していました。

修正後のレビュー判断

APPROVE寄りです。ブロッカーなし。

前レビューの指摘は次のように修正します。

以前の指摘 修正判断
sidecarなしでdeferredになるのはP0 撤回。Issueの要求どおり
producer provenanceを必須にすべき 撤回。個人趣味開発には過剰
hook側がstop_humanなのにparserが無視する 意図的なstatus別契約。ブロッカーではない
schema versionをearly return前に検証すべき 任意の堅牢化。今回のMVPには不要
future timestamp上限が必要 低優先度。deferredだけなら費用対効果が悪い
Issue #1661とのtimestampテスト競合 軽微な将来調整リスクとしては残る
CLIがsidecar/SHA引数を常に要求する インターフェース上の冗長性。非ブロッキング

残すべき実質的なコメントは1点程度です。

runner_unavailableではsidecarを不要とする方針は妥当。ただし、将来Issue #1661でPyYAMLのtimestamp resolverを変更した際、今回追加したnative datetime 型テストの前提が変わる可能性があるため、そのマージ時にテスト期待値を再確認する。

したがって、あなたの人間要望を正しく反映したレビューなら、「過剰なサブエージェント発火証跡やsidecarを再導入しろ」と要求してはいけません。前レビューはそこを誤りました。


Powered by AI Exporter

@squne121 squne121 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: APPROVE

Mergeability

  • mergeable=MERGEABLE, merge_state_status=CLEAN

Evidence Check

  • Contract: Issue #1805 snapshot 5084311131(body SHA c9c94a7d…3e613d)と current head を照合。
  • AC coverage: AC1–AC5 は current head で確認済み。runner_unavailable は strict identity と時系列だけで deferred、型不正・identity 不一致・stale/malformed と ok/failed の不正経路は stop_human。
  • 検証コマンド結果: 対象 VC はすべて PASS(14 / 1 / 37 / documentation rg / 42)。
  • CI Verification: current head に束縛した ci_verdict_summary.py は all_pass。v2 artifact は overall_status: merge_ready、binding artifact と required checks の head 一致を確認。
  • Allowed Paths: gate=ok、3 changed files、violations=0(rename provenance 完全)。
  • Safety Claim Matrix: deferred の主張は runner_unavailable の identity/time ordering に限定され、script SHA・payload・capture sidecar の要求をこの status にのみ免除。文書と実装は一致。

Blockers

  • なし

LOOP_VERDICT_V2

LOOP_VERDICT_V2:
  verdict: APPROVE
  reviewed_head_sha: "01356052ee1d396b3df1dd8ef1b32cde23478a0c"
  merge_ready: true
  mergeability:
    mergeable: "MERGEABLE"
    merge_state_status: "CLEAN"
  blockers: []
  required_auto_actions: []
  auto_fix_applied: []
  follow_up_issue_requests: []
  allowed_paths_gate:
    status: ok
    changed_files_source: git_diff_name_status_find_renames_z
    changed_files:
      - .claude/skills/impl-review-loop/scripts/parse_scope_rollup_run_result.py
      - .claude/skills/impl-review-loop/steps/preparation.md
      - .claude/skills/impl-review-loop/tests/test_parse_scope_rollup_run_result.py

@squne121 squne121 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: APPROVE

Evidence Check

  • Contract snapshot #1805/5084311131 と current head を照合。
  • AC1–AC5: current head の対象 VC はすべて PASS(14 / 1 / 37 / documentation rg / 42)。
  • CI: ci_verdict_summary.py=all_pass。v2 artifact は同一 head、overall_status: merge_ready、binding artifact と required checks 成功を確認。
  • Allowed Paths: gate=ok、3 files、violations=0。
  • runner_unavailable は strict identity と時系列だけで deferred、その他・型不正は stop_human。文書と実装は一致。

Blockers

  • なし

LOOP_VERDICT_V2

LOOP_VERDICT_V2:
  verdict: APPROVE
  reviewed_head_sha: "01356052ee1d396b3df1dd8ef1b32cde23478a0c"
  merge_ready: true
  mergeability:
    mergeable: "MERGEABLE"
    merge_state_status: "CLEAN"
  blockers: []
  required_auto_actions: []
  auto_fix_applied: []
  follow_up_issue_requests: []
  allowed_paths_gate:
    status: ok
    changed_files_source: git_diff_name_status_find_renames_z
    changed_files:
      - .claude/skills/impl-review-loop/scripts/parse_scope_rollup_run_result.py
      - .claude/skills/impl-review-loop/steps/preparation.md
      - .claude/skills/impl-review-loop/tests/test_parse_scope_rollup_run_result.py

@squne121 squne121 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: APPROVE

Mergeability

  • mergeable=MERGEABLE, merge_state_status=CLEAN

Evidence Check

  • Current head 01356052ee1d396b3df1dd8ef1b32cde23478a0c に対して、Issue #1805 contract snapshot、CI v2 binding artifact、Allowed Paths gate、対象 VC 全 PASS を再照合。
  • runner_unavailable は strict identity と時系列のみで deferred、その他・型不正は stop_human。実装と preparation.md は一致。

Blockers

  • なし

LOOP_VERDICT_V2

LOOP_VERDICT_V2:
  verdict: APPROVE
  reviewed_head_sha: "01356052ee1d396b3df1dd8ef1b32cde23478a0c"
  merge_ready: true
  mergeability:
    mergeable: "MERGEABLE"
    merge_state_status: "CLEAN"
  blockers: []
  required_auto_actions: []
  auto_fix_applied: []
  follow_up_issue_requests: []
  allowed_paths_gate:
    status: ok
    changed_files_source: git_diff_name_status_find_renames_z
    changed_files:
      - .claude/skills/impl-review-loop/scripts/parse_scope_rollup_run_result.py
      - .claude/skills/impl-review-loop/steps/preparation.md
      - .claude/skills/impl-review-loop/tests/test_parse_scope_rollup_run_result.py

@squne121
squne121 marked this pull request as ready for review July 26, 2026 22:43
@squne121
squne121 merged commit ea93bcd into main Jul 26, 2026
31 checks passed
@squne121
squne121 deleted the worktree-issue-1805-runner-unavailable-identity-deferred branch July 26, 2026 22:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

実装: runner_unavailable を identity 検証付き deferred route にする

1 participant