Repository navigation
Closed as not planned
Closed as not planned
Copy link
Labels
agent/implementerAI implementer agentenhancementNew feature or requestphase/implementationImplementation phasetriage-requiredNeeds owner triage for priority decision
Description
Parent Issue
none
Machine-Readable Contract
contract_schema_version: v1
issue_kind: implementation
parent_issue: "none"
goal_ref: "Stop/SubagentStop の external manifest publish テストを、イベント固有の stderr 契約と scope-rollup 環境分離を用いて決定論的に検証できる状態にする"
change_kind: codeParent Goal Ref
- Goal: なし(単独改善)
- Desired Destination: なし
Current Validated Scope
Stopは scope-rollup capture gate の対象外で stderr は空、SubagentStopは source-bound eligibility artifact が存在しないときに stderr へ固定のeligibility_missing診断を出しつつ manifest flow を継続する。- 現在のテストは両イベントに Stop 用 fixture と空 stderr 期待を使い、scope-rollup/test seam の環境変数を継承するため、上記契約を決定論的に再現していない。
Remaining Parent Gaps
なし
Outcome
tests/session_recording/codex/test_external_manifest_publish.py::test_stop_and_subagentstop_hooks_write_external_manifest_with_empty_repo_delta が、イベント固有 fixture、固定された missing eligibility/readiness/capture path、およびイベント別の stdout/stderr 完全一致によって Stop/SubagentStop の external manifest publish 契約を検証する状態にする。
In Scope
_isolated_env()を拡張し、SCOPE_ROLLUP_ELIGIBILITY_ARTIFACT_PATH、SCOPE_ROLLUP_READINESS_ARTIFACT_PATH、SCOPE_ROLLUP_CAPTURE_DIR、SCOPE_ROLLUP_REQUIRE_SOURCE_BOUND_ELIGIBILITY、SCOPE_ROLLUP_REPO_ROOT、CODEX_SCOPE_ROLLUP_CAPTURE_SCRIPT、CODEX_SESSION_RECORDING_PRODUCER、NODE_ENVを継承しない。テストごとにtmp_path配下の存在しない eligibility/readiness path と capture directory を明示する。- 対象テストを event 固有の payload で実行する。
Stopにはtests/fixtures/codex/positive_fixture.json、SubagentStopにはtests/fixtures/hooks/codex-subagent-stop-allow.jsonを使い、CLI event と payload のhook_event_nameを一致させる。 - stdout は各 event で
{"continue":true}と完全一致、stderr はStopで空文字列、SubagentStopで[codex-hook-adapter] info: scope-rollup capture skipped (eligibility_missing)\nと完全一致させる。 - 各 event で return code 0、Git porcelain status の before/after 一致、external manifest が Stop/SubagentStop 各1件、capture directory が未作成または空、missing eligibility/readiness path が未作成であることを検証する。
tests/hooks/codex-scope-rollup-capture.test.tsのeligibility_missing正常系期待を維持する。PR 本文には、adapter の診断仕様を変更せずテストのみを修正した根拠を記録する。
Out of Scope
scripts/session-recording/codex-hook-adapter.mjs、scope-rollup capture 判定、skip 診断、ログレベル、reason code の変更tests/hooks/codex-scope-rollup-capture.test.tsの変更- missing eligibility を無音化するための Issue 実装: Codex の SubagentStop scope-rollup capture を復旧する #1527 の契約・policy・専用テストの変更
- Issue 実装: node-backed-hook-tests に test_external_manifest_publish.py の実行 step を追加し既知の宣言・実行不一致を解消する #1725(node-backed-hook-tests の実行 step 追加)本体の対応
Acceptance Criteria
- AC1: Stop payload を
Stopevent で実行し、return code 0、stdout{"continue":true}、stderr 空文字列を完全一致で検証する。 - AC2: SubagentStop payload を
SubagentStopevent で実行し、return code 0、stdout{"continue":true}、stderr のeligibility_missing診断一行を完全一致で検証する。 - AC3: 各 event の payload の
hook_event_nameと CLI event を一致させ、scope-rollup/test seam の継承環境を除去したtmp_path配下の missing eligibility/readiness/capture path を使用する。 - AC4: 各 event 後に Git porcelain status が不変で、external manifest が Stop/SubagentStop 各1件、capture directory が未作成または空、missing eligibility/readiness path が未作成であることを検証する。
- AC5:
tests/session_recording/codex/test_external_manifest_publish.pyの全テストが PASS する。 - AC6:
tests/hooks/codex-scope-rollup-capture.test.tsが PASS し、eligibility_missingを正常な capture-skip 診断として扱う既存契約を維持する。 - AC7: PR 本文に、adapter の診断仕様を変更せず test-only で修正した選定根拠を記録する。
Runtime Verification Applicability
- decision: not_applicable
- reason: 本 Issue は既存の Python/Vitest regression test の期待値・fixture・環境分離を修正する test-only 変更であり、別途の実行時統合検証 AC を追加しない。
Verification Commands
# AC1
# preflight-scope: pr_review_only
$ uv run --locked pytest -q tests/session_recording/codex/test_external_manifest_publish.py::test_stop_and_subagentstop_hooks_write_external_manifest_with_empty_repo_delta -p no:xdist
# AC2
# preflight-scope: pr_review_only
$ uv run --locked pytest -q tests/session_recording/codex/test_external_manifest_publish.py::test_stop_and_subagentstop_hooks_write_external_manifest_with_empty_repo_delta -p no:xdist
# AC3
# preflight-scope: pr_review_only
$ uv run --locked pytest -q tests/session_recording/codex/test_external_manifest_publish.py::test_stop_and_subagentstop_hooks_write_external_manifest_with_empty_repo_delta -p no:xdist
# AC4
# preflight-scope: pr_review_only
$ uv run --locked pytest -q tests/session_recording/codex/test_external_manifest_publish.py::test_stop_and_subagentstop_hooks_write_external_manifest_with_empty_repo_delta -p no:xdist
# AC5
# preflight-scope: pr_review_only
$ uv run --locked pytest -q tests/session_recording/codex/test_external_manifest_publish.py -p no:xdist
# AC6
# preflight-scope: pr_review_only
$ pnpm test -- tests/hooks/codex-scope-rollup-capture.test.ts
# AC7
# preflight-scope: pr_review_only
$ gh pr view --json body --jq .bodyAllowed Paths
- tests/session_recording/codex/test_external_manifest_publish.py
Stop Conditions
- Allowed Paths 外の変更が必要と判明した場合
- adapter の scope-rollup capture 判定、skip 診断、ログレベル、reason code の変更が必要と判明した場合
- In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
- 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
- 後続 Phase / 別スコープへの波及が判明した場合
- nested SubAgent delegation が必要になった場合
tests/hooks/codex-scope-rollup-capture.test.tsの変更が必要と判明した場合- 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
Required Skills
- なし
Required Design References
- docs/dev/session-recording-policy.md
- .claude/skills/session-recording-policy/SKILL.md
Scope Delta(任意)
- Anchor comment
issuecomment-5107189019に従い、adapter 修正選択肢と adapter の Allowed Path を除外し、test-only の event-specific contract に置換する。
Depends On
なし
Blocks
- 実装: node-backed-hook-tests に test_external_manifest_publish.py の実行 step を追加し既知の宣言・実行不一致を解消する #1725(Issue 実装: node-backed-hook-tests に test_external_manifest_publish.py の実行 step を追加し既知の宣言・実行不一致を解消する #1725 の AC6「
test_external_manifest_publish.pyがローカルで PASS すること」の前提条件)
Notes for Reviewer
- Issue 実装: Codex の SubagentStop scope-rollup capture を復旧する #1527 の source-bound eligibility/readiness gate は正本である。
eligibility_missingを SubagentStop の正常な capture-skip 診断として維持し、adapter を変更しない。 - Issue 実装: test_stop_event_scrubs_producer_failure_stderr が実際の失敗 producer を起動するよう修正する #1435 は adapter の test-only producer override seam を対象とするため、本 Issue の Allowed Paths から adapter を除外して競合を避ける。
- 実装: existing-branch publish guard の実行ホスト context 注入を復旧する #1688 は完了済みで adapter の main は起票時から変化している。実装時は fresh main を基準にする。
Metadata
Metadata
Assignees
Labels
agent/implementerAI implementer agentenhancementNew feature or requestphase/implementationImplementation phasetriage-requiredNeeds owner triage for priority decision
Activity
squne121 commentedon Jul 27, 2026
create-issue transaction partial-failure
Issue: #1828
Failure stage: issue-ids
Message: issue-ids failed
Requested:
Completed steps: create, label, label-readback
Failure context: command=gh api graphql -f query=
query($owner:String!,$name:String!,$number:Int!){repository(owner:$owner,name:$name){issue(number:$number){id databaseId}}} -F owner=squne121 -F name=loop-protocol -F number=0
output=gh: Could not resolve to an Issue with the number of 0.
matching_issue_numbers=[1828]
issue_number=1828
Recovery hint: stage 'issue-ids' encountered an unexpected failure.
Generic guidance: verify the issue state manually and re-run the transaction if safe.
gh issue view 1828 --repo squne121/loop-protocol --json number,title,labels,state
idempotent re-run: depends on the specific failure
Please recover deterministically before re-running the create issue transaction.
squne121 commentedon Jul 28, 2026
判定
REQUEST_CHANGES — 問題の発見自体は正しいですが、現状の Issue 契約では実装に着手すべきではありません。
原因はほぼ テスト側の stale expectation と環境分離不足です。
codex-hook-adapter.mjsを修正候補として残すと、Issue #1527 で意図的に導入した fail-closed capture gate の診断を消す誤修正へ誘導します。P0-1. 「テスト修正か adapter 修正か」という二択が不適切
adapter は「empty repo delta」を見て診断を出しているわけではありません。
実際の条件は次のとおりです。
Stopは scope-rollup gate の対象外SubagentStopだけが gate の対象eligibility_missingを stderr に出すこの分岐は明示的に実装されています。
さらに Issue #1527 は、eligibility/readiness が missing・invalid・stale の場合に producer を起動せず、固定 reason code で skip することを要求しています。 専用 Vitest も
eligibility_missingを正常系として検証しています。したがって、Issue 本文の次の表現は誤っています。
repo delta は adapter の入力でも判定材料でもありません。正しくは次です。
必要な修正
scripts/session-recording/codex-hook-adapter.mjsを外すstdout と stderr は独立したストリームです。stderr に診断を出しても、stdout の
{"continue":true}プロトコルは壊れません。Node.js も subprocess の stdout/stderr を別々の pipe として扱います。(Node.js)P0-2.
_isolated_envが実際には isolation になっていない現在の
_isolated_env()は親プロセスの環境をコピーし、削除するのはCODEX_HOOK_MANIFEST_ROOTだけです。次の値を継承してしまいます。
SCOPE_ROLLUP_ELIGIBILITY_ARTIFACT_PATHSCOPE_ROLLUP_READINESS_ARTIFACT_PATHSCOPE_ROLLUP_CAPTURE_DIRSCOPE_ROLLUP_REQUIRE_SOURCE_BOUND_ELIGIBILITYSCOPE_ROLLUP_REPO_ROOTCODEX_SCOPE_ROLLUP_CAPTURE_SCRIPTCODEX_SESSION_RECORDING_PRODUCERNODE_ENVoverride がなければ、adapter は repo 内の
.claude/tmp/session-recording/にある固定 artifact を参照します。その結果、開発環境の状態によって挙動が変わります。
eligibility_missingを出して producer を起動しないNODE_ENV=test等を継承: test-only seam が有効になる可能性がある専用 Vitest はこの問題を避けるため、eligibility・readiness・capture directory をすべて一時ディレクトリへ明示的に向けています。
この非決定性の解消が #1828 の本質です。 単に
stderrassertion を緩めるだけでは不十分です。P0-3.
SubagentStopに Stop 用 fixture を渡している対象テストは同じ payload を使い、CLI の
--eventだけをStop/SubagentStopに切り替えています。しかし fixture 内の
hook_event_nameは常にStopです。つまり現在のテストは、docstring が主張する「real SubagentStop entrypoint」を再現していません。既に SubagentStop 用 fixture が存在し、
session_id、agent_id、agent_type、last_assistant_messageを含んでいます。修正後はイベントごとに payload を分けるべきです。
外部調査でも、Codex の root agent と subagent の hook identity は現在も仕様整備中で、公式リポジトリでは
SubagentStopparity が未完成として扱われています。したがって、曖昧な疑似 payload ではなく、このリポジトリ自身の #1527 契約と official-wire fixture を正本にすべきです。([GitHub]2)P1-1. stderr はイベント別に完全一致させる
推奨する期待値は次です。
"eligibility_missing" in result.stderrのような部分一致では不十分です。別の warning や複数診断が混入しても PASS してしまいます。同じリポジトリでも、PR #1741 のレビュー対応で scope-rollup transport 診断を「部分一致」から「固定された単一行の完全一致」へ強化しています。
同時に以下も維持すべきです。
JSON decode だけでは、余分な stdout や trailing garbage の混入を検出できません。
P1-2. 「empty repo delta」という証跡は過大主張
現在の
_git_status()は次を比較しています。しかし
.claude/tmp/は ignore 対象です。 Git の--ignored=matchingは、ディレクトリ自体が ignore pattern に一致すると、そのディレクトリを表示するだけで内部ファイルを列挙しません。(Git)さらに capture producer の既定出力先は
/tmpであり、semantic rejection でも.capture.yamlsidecar を書けます。 これらは Git status には一切現れません。したがって、現在の比較が証明するのは厳密には次だけです。
「repository filesystem への書き込みが一切なかった」や「capture side effect がなかった」ことは証明していません。
修正後は、少なくとも次を別々に検証すべきです。
P1-3. Acceptance Criteria が原因ではなく結果しか固定していない
現在の AC1~AC3 は主に「テストが PASS する」ことを要求しており、どの契約で PASS すべきかが不足しています。
最低限、次に置き換えるべきです。
Stopは stdout exact JSON、stderr exact empty。SubagentStopは stdout exact JSON、stderr はeligibility_missingの単一固定行。hook_event_nameが一致する。tmp_path配下の存在しない固定 path に強制する。codex-scope-rollup-capture.test.tsが引き続き PASS する。推奨する実装骨子
テスト本体は概ね次の構造が妥当です。
XDG_STATE_HOMEをtmp_path配下へ向ける現在の方針自体は妥当です。XDG Base Directory Specification でも state data は$XDG_STATE_HOME配下とし、相対 path は無効として扱うよう定めています。([Freedesktop.org Specifications]4)関連 Issue・運用上の問題
#0を GraphQL に渡して部分失敗しています。再実行前に native dependency 状態を確認し、不要な recovery comment・不整合 metadata を整理すべきです。推奨する Issue の最終形
タイトル
Allowed Paths
実装方針
この形なら小規模かつ低リスクです。現契約のままでは、実装エージェントが adapter の正常な診断を抑制して #1527 を回帰させる可能性があるため、
triage-requiredを外すべきではありません。なお、今回は GitHub connector で current main のファイル・Issue・PR・コメントを確認しましたが、この実行環境にはリポジトリのローカル checkout がないため、記載された pytest/Vitest コマンド自体の再実行は行っていません。
[-]実装: test_external_manifest_publish.py の empty repo delta テストを scope-rollup capture skip 診断出力に対応させる[/-][+]test: external manifest publish の Stop/SubagentStop stderr 契約と scope-rollup 環境分離を修正する[/+]squne121 commentedon Jul 28, 2026
Contract Review Result
squne121 commentedon Jul 28, 2026
Refinement Loop: Approved
The issue has been approved and is ready for implementation.
approvedsqune121 commentedon Aug 12, 2026
disposition 確認: KEEP(現状維持)
#1782 の OWNER 敵対的レビュー(https://github.com/squne121/loop-protocol/issues/1782#issuecomment-5266277591)を確認した。本 Issue は #1725 が対象とする test(
test_external_manifest_publish.py)の Stop/SubagentStop stderr 契約・環境分離という実 test defect を扱う具体的な修正であり、KEEP(変更なし)と判定された。本文・スコープの変更は行わない。squne121 commentedon Aug 12, 2026
これはhooksの導入に関わるテストでhooksは基本実装しないのであれば不要では?
squne121 commentedon Aug 12, 2026
結論
Issue #1828 は、現行
mainに対してはCLOSE / not_plannedが妥当です。指定コメントの「この Hook 系テストは不要では?」という方向性は正しいです。ただし理由は「Hooks を基本実装しないから」ではなく、#1828 が対象としている enforcing/scope-rollup 時代のStop/SubagentStop契約が、#1830 / PR #1849 によって既に quarantine・削除され、Issue の前提そのものが消滅したからです。一方、Codex Hook 自体は不要になっていません。現行リポジトリでは
[features].hooks = trueのまま、project-local hook としてSessionEndとSubagentStopの passive recorder を明示的に維持しています。OpenAI Codex の現行実装にもSessionEnd/SubagentStop/Stopは存在し、root turn と thread-spawn subagent で Stop/SubagentStop を分離しています。したがって、現行 passive Hook の最小テストは残すべきです。 (GitHub)敵対的レビュー結果
Severity | 判定 -- | -- P0 | #1828 の Current Validated Scope / AC / VC が live repository と不整合です。 Issue は test_stop_and_subagentstop_hooks_write_external_manifest_with_empty_repo_delta、scope-rollup の eligibility_missing stderr、eligibility/readiness 環境変数を修正対象にしていますが、現行 test_external_manifest_publish.py は passive recorder の2テストだけです。現行 adapter も SessionEnd / SubagentStop のみで、scope-rollup・eligibility/readiness・Stop warning path はありません。 P0 | 直前の KEEP 判定は撤回すべきです。 #1782 のレビューは「#1828 は Stop/SubagentStop fixture / stderr / env isolation の実在する defect」と判定し、そのまま #1828 に KEEP コメントが転記されています。しかし live main にはそのテスト・stderr path がありません。これは典型的な stale-snapshot review です。 P1 | #1725 は #1828 と一緒に閉じてはいけません。reframe が必要です。 python-test-plan.json は現在も test_external_manifest_publish.py を node-backed-hook-tests が提供すると宣言していますが、workflow の実行部分は test_hook_adapter.py と test_initial_branch_create_lane.py までで、対象ファイルの execution step が見当たりません。pytest の --collect-only は文字通り「収集のみで実行しない」ため、この false-green は独立した実 defect です。 (pytest) P1 | ドキュメントの historical/current 境界が弱く、今回の stale review を再発させます。 session-recording-policy.md 冒頭では #1830 以降の scope-rollup/Stop 等を「履歴・再導入時の設計資料」と明記している一方、その直後には eligibility/readiness、固定 private location、capture transport 等が現在形の normative text として大量に残っています。機械的・LLM 的 review では active contract と誤認しやすい構造です。 P2 | 現行 passive recorder 側には別の低コスト hardening 候補がありますが、#1828 に混ぜるべきではありません。 appendFile(..., mode: 0o600) の mode は新規作成時しか効かず、既存ファイルの権限を修正しません。また Node は promise-based FS の同一ファイルへの並行変更について同期されない点を注意しています。複数 SubagentStop が同じ JSONL に並行 append する test は現状確認できません。telemetry が advisory の間は P2 ですが、後に evidence として使うなら重要になります。 (Node.js)#1849 が #1828 を実質的に supersede している
PR #1849 の契約はかなり明確です。active hook を
SessionEndと任意のSubagentStopに限定し、SubagentStop stdout を{"continue":true}に固定し、recorder から decision・通信・Git 操作・transcript 解析を除去しています。さらに enforcement 再導入には別 Issue が必要と明記しています。現行テストもこの設計に既に追随しています。
test_hook_adapter.pyは SessionEnd の no-transcript、SubagentStop の exact continuation JSON、malformed/EACCES の fail-open、quarantined event の no-op を検証しています。Vitest 側にも allowlist、fail-open、recorder boundary があり、旧 #1828 が要求する scope-rollup stderr helper を追加する余地はありません。したがって #1828 を今実装すると「壊れたテストを直す」のではなく、quarantine 済みの scope-rollup/Stop contract をテストコードへ再導入する危険がある、というのが最大の blocker です。
WEB調査を踏まえた現行 Hook 方針
OpenAI Codex 本体では Hook は現在も正式な実装面です。現行 source は root turn では
Stop、thread-spawn subagent ではSubagentStopを dispatch し、SessionEndは root-only としています。output parser も Stop/SubagentStop の command output と universalcontinuefield を処理します。したがって loop-protocol が main thread の「毎 turn Stop」ではなく「session 終了時 SessionEnd」を passive telemetry に使い、subagent だけ SubagentStop にする設計は合理的です。(GitHub)ただし OpenAI の公式 repository には、2026年6〜7月時点で
codex execや linked worktree で project-local hooks が dispatch されないという報告も残っています。これは確定仕様ではなく未解決のバグ報告ですが、direct adapter test の成功を live Codex hook delivery の証明にしてはいけないという現在の loop-protocol documentation の判断を補強します。passive telemetry なので、ここを required gate に戻す必要はありません。(GitHub)推奨 disposition
#1828:
CLOSE / not_plannedを推奨します。close reason は「Hooks 全廃」ではなく、superseded by #1830 / PR #1849; referenced Stop/scope-rollup test and stderr/env contract no longer exist on current mainとするのが正確です。直前の KEEP コメントも stale と明示すると、後続 agent が再び拾いません。#1725 は KEEP / reframe が妥当です。#1828 dependency、旧 Stop failure、eligibility warning の説明を削除し、「現行
test_external_manifest_publish.pyの passive-recorder tests をnode-backed-hook-testsで実際に execution する」という1点だけに縮小すべきです。これなら minimal harness 方針とも矛盾しません。さらに別途、
session-recording-policy.mdの旧 scope-rollup 部分を Historical / Quarantined と視覚的・構造的に隔離する価値があります。今回の誤判定は単なる Issue 放置ではなく、「削除済み production path の詳細な契約文が SSOT 内に現役風に残り、reviewer が live symbol existence を確認せず KEEP した」ことが再発要因です。最終判定は
## 結論REQUEST_CHANGES(既存 KEEP 判定に対して)です。#1828 は実装せず閉じ、#1725 だけ現行 passive test coverage に reframe するのが最小かつ整合的です。Issue #1828 は、現行
mainに対してはCLOSE / not_plannedが妥当です。指定コメントの「この Hook 系テストは不要では?」という方向性は正しいです。ただし理由は「Hooks を基本実装しないから」ではなく、#1828 が対象としている enforcing/scope-rollup 時代のStop/SubagentStop契約が、#1830 / PR #1849 によって既に quarantine・削除され、Issue の前提そのものが消滅したからです。一方、Codex Hook 自体は不要になっていません。現行リポジトリでは
[features].hooks = trueのまま、project-local hook としてSessionEndとSubagentStopの passive recorder を明示的に維持しています。OpenAI Codex の現行実装にもSessionEnd/SubagentStop/Stopは存在し、root turn と thread-spawn subagent で Stop/SubagentStop を分離しています。したがって、現行 passive Hook の最小テストは残すべきです。 ([GitHub]1)敵対的レビュー結果
test_stop_and_subagentstop_hooks_write_external_manifest_with_empty_repo_delta、scope-rollup のeligibility_missingstderr、eligibility/readiness 環境変数を修正対象にしていますが、現行test_external_manifest_publish.pyは passive recorder の2テストだけです。現行 adapter もSessionEnd/SubagentStopのみで、scope-rollup・eligibility/readiness・Stopwarning path はありません。KEEP判定は撤回すべきです。 #1782 のレビューは「#1828 は Stop/SubagentStop fixture / stderr / env isolation の実在する defect」と判定し、そのまま #1828 に KEEP コメントが転記されています。しかし livemainにはそのテスト・stderr path がありません。これは典型的な stale-snapshot review です。python-test-plan.jsonは現在もtest_external_manifest_publish.pyをnode-backed-hook-testsが提供すると宣言していますが、workflow の実行部分はtest_hook_adapter.pyとtest_initial_branch_create_lane.pyまでで、対象ファイルの execution step が見当たりません。pytest の--collect-onlyは文字通り「収集のみで実行しない」ため、この false-green は独立した実 defect です。 (pytest)session-recording-policy.md冒頭では #1830 以降の scope-rollup/Stop 等を「履歴・再導入時の設計資料」と明記している一方、その直後には eligibility/readiness、固定 private location、capture transport 等が現在形の normative text として大量に残っています。機械的・LLM 的 review では active contract と誤認しやすい構造です。appendFile(..., mode: 0o600)のmodeは新規作成時しか効かず、既存ファイルの権限を修正しません。また Node は promise-based FS の同一ファイルへの並行変更について同期されない点を注意しています。複数 SubagentStop が同じ JSONL に並行 append する test は現状確認できません。telemetry が advisory の間は P2 ですが、後に evidence として使うなら重要になります。 ([Node.js]3)#1849 が #1828 を実質的に supersede している
PR #1849 の契約はかなり明確です。active hook を
SessionEndと任意のSubagentStopに限定し、SubagentStop stdout を{"continue":true}に固定し、recorder から decision・通信・Git 操作・transcript 解析を除去しています。さらに enforcement 再導入には別 Issue が必要と明記しています。現行テストもこの設計に既に追随しています。
test_hook_adapter.pyは SessionEnd の no-transcript、SubagentStop の exact continuation JSON、malformed/EACCES の fail-open、quarantined event の no-op を検証しています。Vitest 側にも allowlist、fail-open、recorder boundary があり、旧 #1828 が要求する scope-rollup stderr helper を追加する余地はありません。したがって #1828 を今実装すると「壊れたテストを直す」のではなく、quarantine 済みの scope-rollup/Stop contract をテストコードへ再導入する危険がある、というのが最大の blocker です。
WEB調査を踏まえた現行 Hook 方針
OpenAI Codex 本体では Hook は現在も正式な実装面です。現行 source は root turn では
Stop、thread-spawn subagent ではSubagentStopを dispatch し、SessionEndは root-only としています。output parser も Stop/SubagentStop の command output と universalcontinuefield を処理します。したがって loop-protocol が main thread の「毎 turn Stop」ではなく「session 終了時 SessionEnd」を passive telemetry に使い、subagent だけ SubagentStop にする設計は合理的です。([GitHub]1)ただし OpenAI の公式 repository には、2026年6〜7月時点で
codex execや linked worktree で project-local hooks が dispatch されないという報告も残っています。これは確定仕様ではなく未解決のバグ報告ですが、direct adapter test の成功を live Codex hook delivery の証明にしてはいけないという現在の loop-protocol documentation の判断を補強します。passive telemetry なので、ここを required gate に戻す必要はありません。([GitHub]4)推奨 disposition
#1828:
CLOSE / not_plannedを推奨します。close reason は「Hooks 全廃」ではなく、superseded by #1830 / PR #1849; referenced Stop/scope-rollup test and stderr/env contract no longer exist on current mainとするのが正確です。直前の KEEP コメントも stale と明示すると、後続 agent が再び拾いません。#1725 は KEEP / reframe が妥当です。#1828 dependency、旧 Stop failure、eligibility warning の説明を削除し、「現行
test_external_manifest_publish.pyの passive-recorder tests をnode-backed-hook-testsで実際に execution する」という1点だけに縮小すべきです。これなら minimal harness 方針とも矛盾しません。さらに別途、
session-recording-policy.mdの旧 scope-rollup 部分を Historical / Quarantined と視覚的・構造的に隔離する価値があります。今回の誤判定は単なる Issue 放置ではなく、「削除済み production path の詳細な契約文が SSOT 内に現役風に残り、reviewer が live symbol existence を確認せず KEEP した」ことが再発要因です。最終判定は
REQUEST_CHANGES(既存 KEEP 判定に対して)です。#1828 は実装せず閉じ、#1725 だけ現行 passive test coverage に reframe するのが最小かつ整合的です。squne121 commentedon Aug 12, 2026
issue-refinement-loop 停止記録
指定された OWNER コメントを human-context anchor として、canonical
mainからpreflight.run.with_human_contextを実行しましたが、preflight は次の fail-closed postcondition で停止しました。reason_code:unauthorized_write_pathtmp/session-manifests/codex/stop/baseline-manifest.jsondo_not_write_outside_allowed_rootこのパスは Issue-scoped artifact root の外であり、現行ポリシーでも Codex session manifest の正規出力先は repository 外の XDG state root です。repo-local
tmp/session-manifests/**への新規 write は許容・抑制できません。したがって、executor の迂回、allowlist の拡張、または repo-local manifest の削除・変更は行っていません。再開には、runtime の manifest writer を正規の external state root へ戻したうえで、同じ human-context preflight を canonical
mainから fresh に再実行する必要があります。指定コメント自体が示す #1828 の
CLOSE / not_planneddisposition は、この環境ブロッカーにより planner/review/writeback まで到達できていないため、今回の loop では確定・適用していません。根拠:
docs/dev/agent-skill-boundaries.mdの Codex session manifest output boundary、scripts/session-recording/resolve-codex-session-manifest-root.mjs、scripts/agent-guards/skill_runtime_exec.py。squne121 commentedon Aug 12, 2026
issue-refinement-loop 停止記録(再開後)
指定 OWNER コメントを human-context anchor とする preflight は再実行で
STATUS: passとなり、必須の repository 調査と external web research を完了まで実施しました。repository 調査結果
現行
mainでは #1828 が参照するStop/ scope-rollup の test・stderr・環境分離契約は存在しません。active Codex hook は passive なSessionEnd/SubagentStopに限定され、対象テストも passive recorder の 2 テストです。したがって、指定コメントの #1828 をCLOSE / not_plannedとする repository-side 根拠は確認できました。#1725 の node-backed-hook-tests 実行不足は別問題として維持・reframe が必要です。fail-closed blocker
planner が必須とした external web research は
agy_web_grounding_tool_call_missingで停止しました。critical external claims(Codex の Stop/SubagentStop/SessionEnd event behavior と{"continue":true}output)について、認識可能な grounded tool trace を得られなかったため未検証です。この loop は critical external claim の未検証時に human escalation へ倒す契約のため、Issue 本文の rewrite、
CLOSE / not_plannedへの state mutation、#1725 の更新は実行していません。executor の迂回や direct web-search fallback も行っていません。再開条件は、grounded external research が machine-verifiable な tool trace と sources を返せること、または当該 external claim を close disposition の根拠から除外することです。
squne121 commentedon Aug 12, 2026
はい。今回のケースは、Codex CLI 自体より
loop-protocolのissue-refinement-loop/web-researcherの設計に主因があります。今回の #1828 は特に分かりやすいです。repository-side の調査だけで「現行
mainに対象契約が存在しない → #1828 はnot_plannedが妥当」という disposition までほぼ確定しているのに、その結論に必須ではない外部仕様確認が失敗したため、mutation 全体まで止まっています。何が設計上まずいか
現在の
web-research-routing.mdはかなり機械的で、critical_external_claimsがある状態で web research がfailed/inconclusiveなら、そのまま human escalation に送ります。「その external claim が最終判断に本当に必要か」という decision dependency がありません。さらに
web-researcherは AGY-only、Gemini fallback 禁止、direct WebSearch/WebFetch fallback 禁止という single-path 構成です。それ自体は provenance を厳格にしたいなら成立しますが、citation_count == 0、critical claim の evidence 不足、grounding failure まで fail-closed にしているため、AGY の観測能力が一時的に欠けただけで上位 workflow 全体が止まりやすい構造です。しかも、この問題はリポジトリ内ですでに認識されています。#2059 は現在、AGY 内部の
search_web/read_url_contentevent や provider provenance、grounding trace を completion gate にせず、正常終了した parseable / non-empty final result を caller に返せればよいという契約へ縮小されています。canonical web event/source record が 0 件というだけで delegation を失敗にしてはいけない、と明示されています。また #2054 では、reviewer についてすでに「transport failure と semantic judgment は別物」と設計されています。spawn/timeout/malformed output 等は
environment_failure/semantic_verdict: nullにし、human_judgment_requiredと混同しない方針です。同じ原則を web-research routing に適用すべきです。これは #1860 の「live Issue/PR、実 diff、実 test、current-head CI、独立 review を authority にし、過剰な control-plane を減らす」という方針にも合います。現状はむしろ、補助的な evidence transport が live repository state より強い completion gate になっており、minimal-harness 方針と逆転しています。
OpenAI が公開している Codex の運用方針も、技術的境界を明確にしつつ低リスク操作は迅速に進め、高リスク操作を明示的に扱うという risk-based な考え方です。「観測証拠が1種類欠けたら常に人間へ」という設計である必要はありません。 (OpenAI)
改善案
優先順位はこうします。
優先度 | 改善 | 期待効果 -- | -- | -- P0 | #2059 を完了し、grounding trace を AGY delegation 成功条件から外す | agy_web_grounding_tool_call_missing 系停止を直接減らす P0 | external claim に dispositive / corroborative を導入 | 結論に不要な外部調査失敗で mutation が止まらない P0 | transport/evidence failure と semantic ambiguity を分離 | tooling 障害を human_judgment_required にしない P0 | #1828 相当の regression test を追加 | 今回と同じ停止を再発させない P1 | human escalation 条件を限定 | owner conflict / security / irreversible action / disposition に必須な証拠不足だけ人間へ P1 | bounded retry 後は non-dispositive failure を note 化 | AGY 一時障害で作業全体が失敗しない P2 | termination comment を「本当に人間入力が必要な場合」に限定 | GitHub に停止報告ばかり蓄積する状態を減らす重要なのは WebSearch fallback を安易に再有効化しないこと です。#2059 も fallback prohibition 自体は維持しています。
問題は fallback がないことではなく、唯一の調査経路の失敗を、関係のない semantic decision までブロックさせていることです。
#1828 なら、理想的な routing は次です。
current main に対象実装なし→ repository evidence が disposition を独立に決定 → external Codex hook semantics はcorroborative/non-dispositive→ AGY grounding failure は unresolved note として保存 →CLOSE / not_plannedを続行 → #1725 は別 concern として維持。逆に、「現行 Codex がその hook contract を本当にサポートするか」が Issue の実装可否そのものを決めるケースなら
dispositiveとし、その調査に失敗したときだけ human escalation を許します。つまり、fail-closed を捨てるのではなく、fail-closed の適用範囲を正しく狭めるのが適切です。
以下を Codex CLI に渡すのを推奨します。#2059 と重複する AGY provider 修正を再実装せず、
issue-refinement-loop側に残る routing gap を独立して直すようにしています。CodexCLI 作業プロンプト — issue-refinement-loop の過剰 human escalation を解消する
Repository:
squne121/loop-protocol背景
以下の停止事例を起点に、
issue-refinement-loopの過剰な human escalation を改善してください。Target incident:
https://github.com/squne121/loop-protocol/issues/1828#issuecomment-5267301558この停止では repository 調査により、
current
mainには test: external manifest publish の Stop/SubagentStop stderr 契約と scope-rollup 環境分離を修正する #1828 が前提とする Stop / scope-rollup の実装・test・stderr・environment isolation contract が存在しないactive Codex hook は現行 repository 上の別契約へ移行済み
repository-side evidence だけで test: external manifest publish の Stop/SubagentStop stderr 契約と scope-rollup 環境分離を修正する #1828 の
CLOSE / not_planneddisposition を支持できる実装: node-backed-hook-tests に test_external_manifest_publish.py の実行 step を追加し既知の宣言・実行不一致を解消する #1725 の node-backed-hook-tests 問題は別 concern
という状態まで確定していた。
しかし external web research が
agy_web_grounding_tool_call_missingになり、Codex hook の historical/current external semantics を machine-grounded trace として検証できなかったことだけを理由に、Issue rewrite / close / related update の全 mutation が停止しhuman_judgment_requiredになった。これは改善対象とする。
関連 authority / precedent
必ず live state を再取得して確認すること。
test: external manifest publish の Stop/SubagentStop stderr 契約と scope-rollup 環境分離を修正する #1828
実装: web-researcher を AGY-first + native Web fallback にする #2059
implement: recover reviewer transport failures and cryptographically bind compact verdicts to artifacts #2054
導入: AIエージェント運用をminimal harnessへ縮退し、過剰なcontrol-planeを廃止する #1860
.claude/skills/issue-refinement-loop/SKILL.md.claude/skills/issue-refinement-loop/references/web-research-routing.md.claude/skills/issue-refinement-loop/scripts/plan_refinement_loop.py.claude/skills/issue-refinement-loop/scripts/decide_next_loop_action.py.claude/agents/web-researcher.md.codex/agents/web-researcher.toml関連する planner / router / preflight / web research tests
特に以下を設計上の precedent として扱うこと。
実装: web-researcher を AGY-first + native Web fallback にする #2059:
provider 内部の web-tool provenance / grounding trace を AGY final-result handoff の completion condition にしない方向。
implement: recover reviewer transport failures and cryptographically bind compact verdicts to artifacts #2054:
transport failure と semantic judgment を分離し、transport failure を
human_judgment_requiredと混同しない方向。導入: AIエージェント運用をminimal harnessへ縮退し、過剰なcontrol-planeを廃止する #1860:
live Issue/PR、current repository state、実 diff、実 test、current-head CI、独立 review を authority とする minimal harness 方針。
新しい巨大な control-plane、ledger、digest/state-machine を安易に追加しない。
Objective
issue-refinement-loopにおいて、external research の transport / grounding / evidence materialization failure が、最終 semantic decision に必須でない場合は human escalation を発生させない
ようにする。
fail-open 化は禁止する。
security boundary、authority boundary、external fact verification 自体を弱めるのではなく、
evidence acquisition failure
semantic uncertainty
decision dependency
を分離する。
Required semantics
external claim を少なくとも semantic 上、次の2クラスへ分類できるようにすること。
dispositive: この claim の真偽が Outcome / disposition / In Scope / AC / VC / safety decision を変えるため、検証不能なら自律判断できない。
corroborativeまたはnon_dispositive: 補強・背景説明には有用だが、repository-owned evidence 等によって requested decision が独立に確定できる。
新しい大規模 schema を追加することを前提にしない。
既存 planner/result に最小の field / decision information を追加する方式を優先する。
Routing
以下を成立させること。
repository evidence が decision を独立に決定できる
+
external claim が non-dispositive
+
web research が failed / inconclusive / grounding_failure
human_judgment_required にしない。
unresolved external evidence を note / risk として保存し、通常 routing を続行する。
一方、
repository evidence だけでは decision を確定できない
+
dispositive external claim が failed / inconclusive
human_judgment_required を許可する。
Transport failure
AGY / web-researcher の以下のような失敗を semantic disagreement と混同しないこと。
timeout
auth/capability unavailable
malformed/empty transport result
agy_web_grounding_tool_call_missingcitation/source materialization failure
provider provenance unavailable
既存 repository に
environment_failure/ transport-failure convention がある場合は再利用する。新しい route/schemaを追加しなければならない場合は、まず既存の #2054 等の convention を再利用できない理由を確認すること。
Retry
transient transport failure について bounded retry が既存 consumer に存在する場合は再利用する。
無制限 retry は禁止。
retry budget 消費後も、claim が non-dispositive なら human escalation に変換しない。
#2059 との境界
#2059 が所有する AGY provider / final-result handoff 修正を重複実装しないこと。
#2059 が未完了の場合でも、
「AGY 内部 trace が取得不能だった場合に、issue-refinement-loop がどう routing するか」
という consumer-side concern は独立して評価する。
同一 concern を所有する既存 OPEN Issue があるなら新規 Issue を作らず、その Issue を current authority とする。
存在しない場合、このセッションでは root/main thread に exactly one implementation Issue の起票を明示的に許可する。
新規 Issue が必要であること自体を human escalation / stop reason にしてはならない。
Issue を作成する場合は少なくとも #1828、#2059、#2054、#1860 を Related / precedent として記録する。
1 Issue = 1 PRを維持する。Regression requirement
#1828 を抽象化した regression fixture/test を必ず追加する。
Case A:
current repository investigation: requested legacy contract no longer exists
repository evidence alone:
close / not_plannedが deterministicexternal claim: historical/current CLI hook semantics
external research result:
failedまたはgrounding_failureexternal claim role: non-dispositive
Expected:
human_judgment_requiredにならないclose/not-planned disposition に向けた routing を維持する
external evidence unavailable を note/risk として保持する
Case B:
repository evidence: inconclusive
external specification が implementation/disposition を決定する唯一の authority
external research: failed/inconclusive
claim role: dispositive
Expected:
fail-closed
human_judgment_requiredCase C:
external transport failure
semantic reviewer resultは存在しない
Expected:
transport/environment failure と semantic judgment を混同しない
Human escalation policy
以下のみを原則的な human escalation 候補とする。
trusted OWNER directives が実質的に矛盾する
requested decision を決める dispositive evidence が取得不能
security / credential / permission boundary の変更判断が必要
destructive または回復不能な mutation が必要
semantic scope が複数の妥当な選択肢に分岐し repository authority だけでは解消不能
authorization が本当に不足している
以下だけでは停止しない。
AGY transport failure
grounding trace 不足
citation materialization 不足
transient provider failure
non-dispositive external claim の未検証
今回明示的に許可した implementation Issue の起票
separate follow-up concern が発見されたこと
merely overlapping paths / related Issue の存在
External research policy
direct WebSearch/WebFetch fallback を無断で再有効化しない。
Gemini fallback prohibition も勝手に解除しない。
今回の目的は fallback を増やすことではなく、
external evidence provider の失敗を unrelated semantic decision の global blocker にしないこと
である。
Implementation workflow
サブエージェントを使用してよい。
必要な read-only investigation は並列化してよいが、全 SubAgent の terminal completion を待ち、dangling agent を残さないこと。
推奨 investigation roles:
current routing / planner investigator
実装: web-researcher を AGY-first + native Web fallback にする #2059 boundary investigator
implement: recover reviewer transport failures and cryptographically bind compact verdicts to artifacts #2054 transport precedent investigator
regression-test / architecture investigator
SubAgent は read-only investigation に限定し、root/main thread が routing、GitHub mutation、Issue/PR作成、最終判断を所有する。
調査完了後:
current main を authority として再確認
concern owner Issue の有無を検索
必要なら authorized implementation Issue を起票
worktree を作成
implementation
targeted tests
relevant issue-refinement-loop regression suite
lint/static checks
Draft PR 作成
adversarial review
blocker が実装修正可能なら承認不要で修正
CI / review を merge 直前まで収束
merge 自体は実行しない。
Stop policy
今回の目的は autonomous recovery なので、単なる tooling inconvenience を human escalation に変換しないこと。
本当に停止してよいのは以下。
destructive operation が必要
credential / secret の取得・露出が必要
repository authorization がなく代替の許可済み経路もない
trusted OWNER authority が矛盾し機械的に解消不能
security boundary を弱めなければ実装不能
current repository contract と本指示が実質的に矛盾し、自律的な narrow interpretation が不可能
それ以外の recoverable error は、bounded retry、alternate existing repository path、scope-preserving fix、または explicit unresolved note により継続する。
「安全側だから」という理由だけで human_judgment_required にしない。
Final report
最後に以下を報告する。
root cause
existing Issue を使用したか / 新規 Issue を起票したか
Issue number
PR number
main SHA
PR head SHA
changed paths
tests
CI
SubAgent launched/completed/failed/dangling
実装: web-researcher を AGY-first + native Web fallback にする #2059 との ownership boundary
implement: recover reviewer transport failures and cryptographically bind compact verdicts to artifacts #2054 precedent をどう再利用したか
test: external manifest publish の Stop/SubagentStop stderr 契約と scope-rollup 環境分離を修正する #1828 regression の結果
remaining genuine human decisions
remaining genuine human decisionsが空ならnoneと明記する。この修正を入れたあとに #1828 を fresh rerun するのが順序として適切です。#1828 を個別に「今回は例外として進める」だけでは、別 Issue で同じ
はい。今回のケースは、**Codex CLI 自体より `loop-protocol` の `issue-refinement-loop` / `web-researcher` の設計に主因があります**。failed external research → human escalationが再発します。 #2059 の完了だけでも停止頻度は下がりますが、web-research-routing.md自体が現在failed + critical_external_claims → human escalationなので、consumer-side の routing 修正も必要です。今回の #1828 は特に分かりやすいです。repository-side の調査だけで「現行
mainに対象契約が存在しない → #1828 はnot_plannedが妥当」という disposition までほぼ確定しているのに、その結論に必須ではない外部仕様確認が失敗したため、mutation 全体まで止まっています。何が設計上まずいか
現在の
web-research-routing.mdはかなり機械的で、critical_external_claimsがある状態で web research がfailed/inconclusiveなら、そのまま human escalation に送ります。「その external claim が最終判断に本当に必要か」という decision dependency がありません。さらに
web-researcherは AGY-only、Gemini fallback 禁止、direct WebSearch/WebFetch fallback 禁止という single-path 構成です。それ自体は provenance を厳格にしたいなら成立しますが、citation_count == 0、critical claim の evidence 不足、grounding failure まで fail-closed にしているため、AGY の観測能力が一時的に欠けただけで上位 workflow 全体が止まりやすい構造です。しかも、この問題はリポジトリ内ですでに認識されています。#2059 は現在、AGY 内部の
search_web/read_url_contentevent や provider provenance、grounding trace を completion gate にせず、正常終了した parseable / non-empty final result を caller に返せればよいという契約へ縮小されています。canonical web event/source record が 0 件というだけで delegation を失敗にしてはいけない、と明示されています。また #2054 では、reviewer についてすでに「transport failure と semantic judgment は別物」と設計されています。spawn/timeout/malformed output 等は
environment_failure/semantic_verdict: nullにし、human_judgment_requiredと混同しない方針です。同じ原則を web-research routing に適用すべきです。これは #1860 の「live Issue/PR、実 diff、実 test、current-head CI、独立 review を authority にし、過剰な control-plane を減らす」という方針にも合います。現状はむしろ、補助的な evidence transport が live repository state より強い completion gate になっており、minimal-harness 方針と逆転しています。
OpenAI が公開している Codex の運用方針も、技術的境界を明確にしつつ低リスク操作は迅速に進め、高リスク操作を明示的に扱うという risk-based な考え方です。「観測証拠が1種類欠けたら常に人間へ」という設計である必要はありません。 ([OpenAI]1)
改善案
優先順位はこうします。
agy_web_grounding_tool_call_missing系停止を直接減らすdispositive/corroborativeを導入human_judgment_requiredにしない重要なのは WebSearch fallback を安易に再有効化しないこと です。#2059 も fallback prohibition 自体は維持しています。
問題は fallback がないことではなく、唯一の調査経路の失敗を、関係のない semantic decision までブロックさせていることです。
#1828 なら、理想的な routing は次です。
current main に対象実装なし→ repository evidence が disposition を独立に決定 → external Codex hook semantics はcorroborative/non-dispositive→ AGY grounding failure は unresolved note として保存 →CLOSE / not_plannedを続行 → #1725 は別 concern として維持。逆に、「現行 Codex がその hook contract を本当にサポートするか」が Issue の実装可否そのものを決めるケースなら
dispositiveとし、その調査に失敗したときだけ human escalation を許します。つまり、fail-closed を捨てるのではなく、fail-closed の適用範囲を正しく狭めるのが適切です。
以下を Codex CLI に渡すのを推奨します。#2059 と重複する AGY provider 修正を再実装せず、
issue-refinement-loop側に残る routing gap を独立して直すようにしています。CodexCLI 作業プロンプト — issue-refinement-loop の過剰 human escalation を解消する
Repository:
squne121/loop-protocol背景
以下の停止事例を起点に、
issue-refinement-loopの過剰な human escalation を改善してください。Target incident:
https://github.com/squne121/loop-protocol/issues/1828#issuecomment-5267301558この停止では repository 調査により、
mainには test: external manifest publish の Stop/SubagentStop stderr 契約と scope-rollup 環境分離を修正する #1828 が前提とする Stop / scope-rollup の実装・test・stderr・environment isolation contract が存在しないCLOSE / not_planneddisposition を支持できるという状態まで確定していた。
しかし external web research が
agy_web_grounding_tool_call_missingになり、Codex hook の historical/current external semantics を machine-grounded trace として検証できなかったことだけを理由に、Issue rewrite / close / related update の全 mutation が停止しhuman_judgment_requiredになった。これは改善対象とする。
関連 authority / precedent
必ず live state を再取得して確認すること。
.claude/skills/issue-refinement-loop/SKILL.md.claude/skills/issue-refinement-loop/references/web-research-routing.md.claude/skills/issue-refinement-loop/scripts/plan_refinement_loop.py.claude/skills/issue-refinement-loop/scripts/decide_next_loop_action.py.claude/agents/web-researcher.md.codex/agents/web-researcher.toml特に以下を設計上の precedent として扱うこと。
実装: web-researcher を AGY-first + native Web fallback にする #2059:
provider 内部の web-tool provenance / grounding trace を AGY final-result handoff の completion condition にしない方向。
implement: recover reviewer transport failures and cryptographically bind compact verdicts to artifacts #2054:
transport failure と semantic judgment を分離し、transport failure を
human_judgment_requiredと混同しない方向。導入: AIエージェント運用をminimal harnessへ縮退し、過剰なcontrol-planeを廃止する #1860:
live Issue/PR、current repository state、実 diff、実 test、current-head CI、独立 review を authority とする minimal harness 方針。
新しい巨大な control-plane、ledger、digest/state-machine を安易に追加しない。
Objective
issue-refinement-loopにおいて、external research の transport / grounding / evidence materialization failure が、最終 semantic decision に必須でない場合は human escalation を発生させない
ようにする。
fail-open 化は禁止する。
security boundary、authority boundary、external fact verification 自体を弱めるのではなく、
を分離する。
Required semantics
external claim を少なくとも semantic 上、次の2クラスへ分類できるようにすること。
dispositive: この claim の真偽が Outcome / disposition / In Scope / AC / VC / safety decision を変えるため、検証不能なら自律判断できない。
corroborativeまたはnon_dispositive: 補強・背景説明には有用だが、repository-owned evidence 等によって requested decision が独立に確定できる。
新しい大規模 schema を追加することを前提にしない。
既存 planner/result に最小の field / decision information を追加する方式を優先する。
Routing
以下を成立させること。
repository evidence が decision を独立に決定できる
+
external claim が non-dispositive
+
web research が failed / inconclusive / grounding_failure
human_judgment_required にしない。
unresolved external evidence を note / risk として保存し、通常 routing を続行する。
一方、
repository evidence だけでは decision を確定できない
+
dispositive external claim が failed / inconclusive
human_judgment_required を許可する。
Transport failure
AGY / web-researcher の以下のような失敗を semantic disagreement と混同しないこと。
agy_web_grounding_tool_call_missing既存 repository に
environment_failure/ transport-failure convention がある場合は再利用する。新しい route/schemaを追加しなければならない場合は、まず既存の #2054 等の convention を再利用できない理由を確認すること。
Retry
transient transport failure について bounded retry が既存 consumer に存在する場合は再利用する。
無制限 retry は禁止。
retry budget 消費後も、claim が non-dispositive なら human escalation に変換しない。
#2059 との境界
#2059 が所有する AGY provider / final-result handoff 修正を重複実装しないこと。
#2059 が未完了の場合でも、
「AGY 内部 trace が取得不能だった場合に、issue-refinement-loop がどう routing するか」
という consumer-side concern は独立して評価する。
同一 concern を所有する既存 OPEN Issue があるなら新規 Issue を作らず、その Issue を current authority とする。
存在しない場合、このセッションでは root/main thread に exactly one implementation Issue の起票を明示的に許可する。
新規 Issue が必要であること自体を human escalation / stop reason にしてはならない。
Issue を作成する場合は少なくとも #1828、#2059、#2054、#1860 を Related / precedent として記録する。
1 Issue = 1 PRを維持する。Regression requirement
#1828 を抽象化した regression fixture/test を必ず追加する。
Case A:
close / not_plannedが deterministicfailedまたはgrounding_failureExpected:
human_judgment_requiredにならないCase B:
Expected:
human_judgment_requiredCase C:
Expected:
Human escalation policy
以下のみを原則的な human escalation 候補とする。
以下だけでは停止しない。
External research policy
direct WebSearch/WebFetch fallback を無断で再有効化しない。
Gemini fallback prohibition も勝手に解除しない。
今回の目的は fallback を増やすことではなく、
external evidence provider の失敗を unrelated semantic decision の global blocker にしないこと
である。
Implementation workflow
サブエージェントを使用してよい。
必要な read-only investigation は並列化してよいが、全 SubAgent の terminal completion を待ち、dangling agent を残さないこと。
推奨 investigation roles:
SubAgent は read-only investigation に限定し、root/main thread が routing、GitHub mutation、Issue/PR作成、最終判断を所有する。
調査完了後:
merge 自体は実行しない。
Stop policy
今回の目的は autonomous recovery なので、単なる tooling inconvenience を human escalation に変換しないこと。
本当に停止してよいのは以下。
それ以外の recoverable error は、bounded retry、alternate existing repository path、scope-preserving fix、または explicit unresolved note により継続する。
「安全側だから」という理由だけで human_judgment_required にしない。
Final report
最後に以下を報告する。
remaining genuine human decisionsが空ならnoneと明記する。この修正を入れたあとに #1828 を fresh rerun するのが順序として適切です。#1828 を個別に「今回は例外として進める」だけでは、別 Issue で同じ
failed external research → human escalationが再発します。 #2059 の完了だけでも停止頻度は下がりますが、web-research-routing.md自体が現在failed + critical_external_claims → human escalationなので、consumer-side の routing 修正も必要です。squne121 commentedon Oct 2, 2026
Backlog audit (2026-10-02): close as not planned / superseded. The Issue's Stop/scope-rollup test and stderr/environment contract belonged to the enforcing-harness design that was quarantined by #1830 and merged PR #1849 (merged 2026-07-29). The Issue thread already records that current main no longer contains the referenced contract and recommends CLOSE / not_planned. Current passive hook coverage is separate scope and should not revive #1828.