Open
Labels
phase/researchResearch phase issue
Description
Machine-Readable Contract
contract_schema_version: v1
issue_kind: research
parent_issue: "none"
goal_ref: "#1659 の issue-refinement-loop Step 1 で AGY advisory 成功と current-main に束縛された検証済み repository evidence を区別し、再現可能な取得・判定経路を確定する"
change_kind: research-only
dedupe_key: "follow-up:squne121/loop-protocol:1659:named-advisory-step1-verified-evidence-handoff"Parent Issue
none
発見元は #1659。この Issue を #1659 の production implementation child として扱わない。
Background / Observed Evidence
- 発見元: 実装: scope_rollup.run の GraphQL inventory query を分割し partial-error 耐性を上げる #1659 。2026-10-08 の fresh refinement で Step 1 の named
codebase-investigatoradvisory controller はok/continue_agy_resultと非空のresponse_textsidecar を返したが、最終CODEBASE_INVESTIGATION_RESULT_V1はstatus: inconclusive、evidence_refs: []だった。実際の AGY 成功は repository fact-check の成功ではない。current-main の source を親 control-plane が読んだことも Step 1 の検証済み SubAgent evidence には昇格しない。 - 実装: AGY advisory調査のfallback判定をdeterministic化し実wrapper smokeを追加する #2434 の controller sidecar は意図的に untrusted research text の輸送面だけを提供する。
ok成功時にdegraded/native_non_mutating_fallbackが明示されていないなら、SubAgent native fallback は許されない。controller の exact request / stdout decision / stderr sidecar を拡張して証拠を自己申告させる案は採用しない。 - 実装: fix: recover source evidence before refinement human escalation #2195 / PR fix: recover source evidence before refinement human escalation (#2195) #2315 の source-evidence acquisition は、既に選択された commit SHA・path・line range に対して
local_git/github_blobからREPO_EVIDENCE_REF_V1を検証できる。一方、実装: scope_rollup.run の GraphQL inventory query を分割し partial-error 耐性を上げる #1659 の一般的な Step 1 について、AGY text に依存せず claim を指定し fresh remote main を pin し関連する source span と意味的 disposition を決定する汎用 handoff は今回の実行で成立していない。調査: main-drift の upstream-only 取込みと Issue 外の新規変更を区別して再開できる条件を確定する #2889 専用の C1 Step 1 overlay を 実装: scope_rollup.run の GraphQL inventory query を分割し partial-error 耐性を上げる #1659 へ読み替えない。 - 同じ時点で 実装: scope_rollup.run の GraphQL inventory query を分割し partial-error 耐性を上げる #1659 の
scope_rollup.runはinventory_total_bytes_exceeded、manifest: null/plan: null。GraphQL inventory query / byte-budget の決定論的修正は既存 実装: scope_rollup.run の GraphQL inventory query を分割し partial-error 耐性を上げる #1659 の Outcome・Allowed Paths・AC が所有するため、本 Issue へ重複起票・移動しない。planner の repo-local/web claim 分類は既存 実装: refinement planner が repo-local 証跡を dispositive external claim に誤分類しない #2857 の責務であり、この Issue では改変しない。 desired_destination: named Step 1 の成功輸送と verified repository evidence の間の、再利用可能で bounded な正規 handoff の判断。validated_scope_delta: AGY success に refs がない事実と、既存 実装: fix: recover source evidence before refinement human escalation #2195 collector の「入力済み座標を検証する」境界のみ。source-consumer の新規欠陥や実装方法を未検証のまま断定しない。今回の直接 operator 指示による独立調査であり、実装: scope_rollup.run の GraphQL inventory query を分割し partial-error 耐性を上げる #1659 の Step 4.5 follow-up materialization 達成とは主張しない。
Outcome
この Issue の Decision Record に #1659 の Step 1 failure を再現した入力・証拠境界、既存 #2195 経路で完結できるかの判定、汎用 handoff の採否・所有者・負例を記録し、既存正規経路での再取得または重複しない implementation Issue の起票へ進める状態にする。
In Scope
- 実装: scope_rollup.run の GraphQL inventory query を分割し partial-error 耐性を上げる #1659 の named advisory
ok/continue_agy_result、sidecar text、空の verified refs の関係を、controller / SubAgent / source-evidence consumer の各責務別に再現・分類する。実テキストを証拠へ昇格せず、current-main の固定と実 source hash を別に確認する。 - 既存 実装: fix: recover source evidence before refinement human escalation #2195 の
local_git/github_blob、validate_repo_evidence_ref、consumer route を 実装: scope_rollup.run の GraphQL inventory query を分割し partial-error 耐性を上げる #1659 の一般的な Step 1 に適用できる条件・できない条件を調べる。調査: main-drift の upstream-only 取込みと Issue 外の新規変更を区別して再開できる条件を確定する #2889 専用 overlay は別扱いにする。 - 汎用実装が必要な場合、root-owned claim specification の信頼境界、fresh remote main SHA と drift 判定、bounded source-span 選択、検証済み ref と claim の意味的関連性、strict controller 成功後の引き渡し、budget / fail-close / negative tests の所有者を決定し、具体的な implementation Issue contract 案(Outcome / Allowed Paths / AC / VC / Stop Conditions)を提示する。
- 決定論的修正と運用 workaround を比較する。AGY の prose を信頼する、AGY 選択の SHA・座標をそのまま使う、role を手で変更する、許可のない native fallback、単なる prompt 注記は採用しない。既存経路だけで正しく取得できる場合は新規 implementation Issue を増やさず、その再取得手順と実証条件を記録する。
Out of Scope
- repository tracked file の編集、新しい provider / evidence schema、実装: AGY advisory調査のfallback判定をdeterministic化し実wrapper smokeを追加する #2434 controller protocol・permission・fallback 境界の変更、実装: fix: recover source evidence before refinement human escalation #2195 collector の再実装。
- 実装: scope_rollup.run の GraphQL inventory query を分割し partial-error 耐性を上げる #1659 の GraphQL inventory query・byte cap・Allowed Paths / AC10・production implementation の変更、partial inventory を complete とみなすこと、実装: refinement planner が repo-local 証跡を dispositive external claim に誤分類しない #2857 の body または planner producer の変更。
- 既存 Issue / PR の merge・close・auto-merge、外部 Web verdict の書き換え、今回の 実装: scope_rollup.run の GraphQL inventory query を分割し partial-error 耐性を上げる #1659 refinement を同じ条件で再試行すること。
Acceptance Criteria
- AC1: 実装: scope_rollup.run の GraphQL inventory query を分割し partial-error 耐性を上げる #1659 の Step 1 で controller
ok/ untrusted sidecar とevidence_refs: []が同時成立した事実を、実装: AGY advisory調査のfallback判定をdeterministic化し実wrapper smokeを追加する #2434 の exact pairing とCODEBASE_INVESTIGATION_RESULT_V1の責務に分け、verified source fact が未成立となる理由を Decision Record に記載する。 - AC2: 実装: fix: recover source evidence before refinement human escalation #2195 の既存 collectors / validator / consumer と 調査: main-drift の upstream-only 取込みと Issue 外の新規変更を区別して再開できる条件を確定する #2889 専用 overlay を区別し、実装: scope_rollup.run の GraphQL inventory query を分割し partial-error 耐性を上げる #1659 の claim-relevant ref を実際に再取得できる条件と、入力 SHA・座標・semantic verdict が未確定なら
inconclusiveのままにする条件を Decision Record に記載する。 - AC3: 独立した root claim authority、fresh remote-main pin / drift、source span の一意性、ref と claim の関連性、strict post-controller handoff の五境界について、汎用実装の可否・採否・各負例と fail-close の所有者を決める。実装: scope_rollup.run の GraphQL inventory query を分割し partial-error 耐性を上げる #1659 固有の一回限りの hardcoded helper や自己申告の証拠を恒久仕様にしない。
- AC4: 既存正規経路で 実装: scope_rollup.run の GraphQL inventory query を分割し partial-error 耐性を上げる #1659 Step 1 の source evidence を得る実証手順を確定するか、Decision Record から重複しない implementation Issue(具体的な Outcome / Allowed Paths / AC / VC / Stop Conditions)を起票し URL をリンクする。scope-rollup recovery は既存 実装: scope_rollup.run の GraphQL inventory query を分割し partial-error 耐性を上げる #1659 を正本に保つ。
Verification Commands
以下は source/contract の read-only baseline 照合。AC の意味的な結論と後続 Issue の重複判定は、Decision Record と GitHub readback を別途レビューする。baseline の exit 0 を調査完了の証明とみなさない。
# AC1
$ uv run --locked pytest .claude/skills/issue-refinement-loop/scripts/tests/test_run_codebase_investigator_agy_advisory.py -q
# AC2
$ uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_source_evidence_recovery.py -q
# AC3
$ rg -n 'REPO_EVIDENCE_REF_V1' .claude/agents/codebase-investigator.md
# AC4
$ gh issue view 1659 --repo squne121/loop-protocol --json bodyAllowed Paths
- (none) — read-only 調査。Decision Record は本 Issue のコメント、後続契約は新規 Issue に記録し、repo-tracked file は変更しない。
Stop Conditions
- Outcome / Scope / AC が検索可能な形で記載されていない場合は即停止。
- Allowed Paths 外への書き込みを試みた場合は即停止。
- 権限不足(permission denied)により操作が完了できない場合は即停止。
- 成果物の書き込みに失敗した場合(I/O エラー等)は即停止。
- controller の成功輸送だけで verified source claim を主張する必要が生じた場合、または既存 実装: fix: recover source evidence before refinement human escalation #2195 lane の権限・trust boundary を越える必要が生じた場合は停止して人間判断へ送る。
Handoff Contract
Current Objective: 実装: scope_rollup.run の GraphQL inventory query を分割し partial-error 耐性を上げる #1659 の Step 1 evidence を、AGY sidecar と独立した current-main source validation に結び付ける。Bounded Current Context: 2026-10-08 の一回の inconclusive Step 1、実装: AGY advisory調査のfallback判定をdeterministic化し実wrapper smokeを追加する #2434 exact protocol、実装: fix: recover source evidence before refinement human escalation #2195 source evidence、実装: scope_rollup.run の GraphQL inventory query を分割し partial-error 耐性を上げる #1659 inventory error。Open Questions: root claim authority、live-main binding、span selection、semantic verdict、正規 consumer integration の所有者。Next Action: 既存経路による再取得の実証、または検証可能な implementation Issue を一件だけ起票してその URL をリンク。Artifact Refs: 実装: scope_rollup.run の GraphQL inventory query を分割し partial-error 耐性を上げる #1659、実装: AGY advisory調査のfallback判定をdeterministic化し実wrapper smokeを追加する #2434、実装: fix: recover source evidence before refinement human escalation #2195 / PR fix: recover source evidence before refinement human escalation (#2195) #2315 と本 Issue の Decision Record。token、raw provider transcript、未検証 refs は公開しない。
Metadata
Metadata
Assignees
Labels
phase/researchResearch phase issue
Activity