Repository navigation
Description
Machine-Readable Contract
contract_schema_version: v1
issue_kind: implementation
parent_issue: "none"
goal_ref: "controller-owned actual AGY invocation trusted boundary"
change_kind: workflowParent Issue
なし(単独改善)。本 Issue は分割しない。
Parent Goal Ref
- Goal: caller-supplied delegation result ではなく controller-owned actual invocation を唯一の production trust boundary にする。
- Destination: advisory の controller-owned operational/provider availability failure は fallback、request/policy/permission violation・不整合・
explicitly_requiredfailure は fail-close。
Current Validated Scope
- 現行 smoke は precompleted fake result と旧 opt-in flag を prompt に渡す composed proof であり、canonical builder、actual wrapper output、production controller の所有境界を証明していない。
build_request.pyは canonical builder、run_gemini_headless.pyは failure 時にも actual output file を生成する wrapper で、AGY_BINhermetic fake seam とshell=Falseがある。- 実装: AGY fallback failure_class を capability_preflight_result へ渡す production 配線を issue-refinement-loop SKILL.md に追加する #2360 と merged feat: codebase-investigator に agy_advisory_native_fallback_allowed opt-in native fallback を追加 #2365 の negative deny policy を維持する。canonical producer
run_gemini_headless.pyの actualdelegation_result/v1output に、最小 additive な producer-ownedagy_failure_kinddiscriminator を導入する。taxonomy mirror、root control plane、CODEBASE_INVESTIGATION_RESULT_V1は変更しない。
Remaining Parent Gaps
- AGY OAuth、credential/keyring/config、retry、実 provider availability/behavior は変更しない。crypto signature、persistent DB、self-declared provenance/flag、taxonomy mirror/positive allowlist、consumer-side full schema duplicate は trusted boundary の代替にしない。
Outcome
Public controller accepts only exact AGY_ADVISORY_INVOCATION_REQUEST_V1: schema: "AGY_ADVISORY_INVOCATION_REQUEST_V1", schema_version: 1, mode: "codebase_local_asset", nonempty purpose, nonempty repo-relative target_paths list, optional repo-relative context_paths list, and agy_investigation_requirement: advisory|explicitly_required. No public field accepts raw prompt, wrapper result/output path/projection, failure class, provenance, or old opt-in flag. Before spawn it validates requirement and fields and resolves every public local target/context path from the controller repository root. It rejects an absolute path, any .. traversal, a normalized/resolved target outside that root (including a symlink resolving outside it), a non-regular or nonexistent file, and a request exceeding 32 combined paths, 1 MiB per file, or 4 MiB aggregate. Validated target_paths and context_paths use the sole canonical target-first/context-second --context-file serialization specified below; neither can select an output or executable path.
Every production actual-wrapper spawn uses a controller-owned child environment with AGY_BIN removed. No public CLI/API field, request value, or AGY_BIN environment value can select the executable. The wrapper resolves the literal agy command through its inherited deployment PATH; that PATH and installed binary identity are explicitly deployment-boundary concerns outside the caller-provenance guarantee, not public controller inputs. Only a module-private/test-only invocation seam can inject an AGY_BIN fake; public request mode/CLI/API cannot reach it. The sole new module-private fixed-proposal_only actual-wrapper smoke driver deterministically reaches that fake, shares controller-owned builder → wrapper → exact-output readback → decision core, changes no production local_asset_research profile, and replaces the retired legacy composed smoke.
The controller uses private TemporaryDirectory request/output paths and argv lists, shell=False, bounded subprocesses: canonical builder → actual wrapper → exact same-invocation output readback including nonzero → minimal projection → shared internal pure decision core. Before parsing, it reads at most 1 MiB of the controller-owned wrapper result file; oversize, partial, unreadable, or strict-JSON-invalid output (including a duplicate key) yields only failed/fail_closed, no sidecar, and no native fallback. A local-asset failure before _run_agy (e.g. Serena), or any non-AGY/pre-AGY result, is explicit failed/fail_closed, never operational fallback.
The canonical run_gemini_headless.py normalizer emits producer-owned agy_failure_kind and agy_invocation_attempted: boolean on every AGY delegation_result/v1 output. Attempted transitions to true through a producer-owned pre-exec callback immediately before the actual agy -p subprocess execution, and remains false for validation, Serena, policy-before-exec, and every pre-AGY result. Success is attempted:true/kind:null; actual attempted failure is attempted:true/non-null kind; pre/non-AGY is attempted:false. The producer alone exports canonical_agy_failure_kind(failure_class) -> operational|policy_or_permission|contract|null: it returns the canonical kind only for producer-defined actual agy_* values and null for unknown/non-AGY values. The controller invokes it without mirroring taxonomy and requires its non-null returned kind to exactly equal the readback agy_failure_kind; unknown, malformed, or kind/class-inconsistent pairs fail closed. For a success result only, it also requires actual readback response_text to be a nonempty string of at most 256 KiB UTF-8; the controller copies that exact same-invocation value byte-for-byte into the success sidecar and must not generate, substitute, truncate, or reconstruct it from caller input. The sidecar envelope is controller-produced, while its response_text is invocation-derived untrusted research content. Fallback requires attempted:true, the canonical pair to be operational, and a valid actual agy_*; all other values fail closed. The existing explicit deny fields remain deny behavior; no taxonomy mirror, positive allowlist, or full producer-schema duplicate is introduced.
AGY_ADVISORY_FALLBACK_ROUTE_DECISION_V1 is exact closed stdout JSON, not taxonomy SSOT: exactly schema: "AGY_ADVISORY_FALLBACK_ROUTE_DECISION_V1"; schema_version: 1; status: ok|degraded|failed; next_action: continue_agy_result|native_non_mutating_fallback|fail_closed; failure_class: null|string; reason_code: controller_input_invalid|builder_failed|wrapper_result_invalid|deny_policy|explicitly_required|non_agy_or_pre_agy|agy_success|advisory_operational. reason_code is routing-only. ok/continue_agy_result requires null failure_class; degraded/native_non_mutating_fallback requires nonempty actual agy_*; failed/fail_closed permits nullable. Other combinations, missing/extra keys, or invalid types are malformed. stdout is the UTF-8 encoding of exactly one strict duplicate-key-rejecting decision JSON object, optionally followed by one LF byte and with no other byte, diagnostic, or JSON value. On the same successful invocation only, stderr is the UTF-8 byte encoding of exactly one controller-owned AGY_ADVISORY_SUCCESS_RESULT_V1 JSON object, optionally followed by one LF byte and with no other bytes, diagnostics, child stderr, or JSON values. It has exactly schema: "AGY_ADVISORY_SUCCESS_RESULT_V1", schema_version: 1, and nonempty response_text: string; the response text is the <=256 KiB exact value projected from the validated same-invocation actual output, not a generated, substituted, truncated, or caller-reconstructed value. Strict parsing rejects duplicate keys. It is a narrow result delivery surface, not the raw wrapper result, projection, path, executable selection, or caller-supplied data. Non-ok decisions emit no success sidecar. Agent/caller captures stdout and stderr separately; it uses the sidecar only with an exact ok/continue_agy_result exit-0 decision, and treats a missing/multiple/malformed/unpaired sidecar or decision as fail-close/no native. Exit 0 is valid ok/degraded, exit 1 valid failed, exit 2 transport/runtime with no trusted decision. Agent/caller require exact closed decision plus allowed status/action/exit pairing; only degraded/native enables native. malformed/missing/multiple/exit2/unpaired always fail-close/no native.
-
target_paths(nonempty) and optionalcontext_pathsare validated as deduplicated ordered lists. The canonical builder argv appends everytarget_pathselement in list order first as--context-file <resolved path>, then everycontext_pathselement in list order as additional--context-file <resolved path>; duplicates across lists reject pre-spawn. This is the sole builder serialization, so target-only has at least one canonical context file and reacheslocal_asset_research. The fixed controller prompt includes target paths underTargets:and context paths underAdditional context:but no raw caller prompt. Controller enforces the same existing local-asset downstream limits of 32 total files, 1 MiB each, and 4 MiB aggregate before spawn. Do not useevidence_targetsand do not changebuild_request.py. -
Existing
agy_failure_kindcontract is EXTENDED, never replaced, by producer-owned top-levelagy_invocation_attempted: booleanfor every AGYdelegation_result/v1output. It is true iff the producer-owned pre-exec callback has run immediately before canonicalagy -psubprocess execution; it is false for validation, local_asset/Serena, policy-before-exec, and every other pre-AGY result. Success is attempted:true + kind:null; actual attempted failure is attempted:true + non-null kind; pre/non-AGY is false.agy_failure_kindremainsnull|operational|policy_or_permission|contract. Producer-ownedcanonical_agy_failure_kind(failure_class)returns the canonical kind only for known actualagy_*values; controller requires that returned non-null kind to equal the observed kind and never mirrors the taxonomy. Fallback requires attempted:true and anoperationalcanonical pair; missing/nonbool/false attempt, unknown class, or other inconsistency always failclose. -
Exact legacy adapter is at
agent/issue-refinement-looppre-controller compatibility ingress, not public controller: it accepts only optionalagy_investigation_requirementstrict enum and optional legacyagy_advisory_native_fallback_allowedstrict boolean. requirement present + legacy absent -> requirement unchanged; requirement absent + legacy true -> advisory; requirement absent + legacy false -> explicitly_required; both absent -> explicitly_required; both present -> fail_closed, even if semantically same; any nonboolean legacy/type-invalid enum -> fail_closed. Adapter constructs exact V1 with requirement and deletes legacy; controller rejects legacy field/unknown keys. No other layer sees old flag.
Runtime Verification Applicability
decision: immediate
reason: "actual wrapper exact-output readback, shared decision core, and real codebase-investigator native sentinel require end-to-end evidence"
applicable_acs: [AC8]
execution_environment: "clean worktree; module-private fixed-proposal_only test driver with AGY_BIN fake; canonical builder; actual wrapper; shared controller core; real codebase-investigator. OAuth/network/provider are unnecessary"
skip_conditions: "Only unavailable SubAgent launch runtime may report exit 77 SKIP; artifact records reason"
fallback_policy:
fallback_success_is_pass: false
notes: "fake failure, unconsumed exact output, absent sentinel, mutation, or tracked-status change never becomes PASS"
artifact_requirements: ["tracked status before/after", "fake invocation evidence", "actual output consumption", "native sentinel"]In Scope
-
Add public controller exact request validation, repository-root-contained target/context path validation with 32-combined-path, 1-MiB-per-file, and 4-MiB-aggregate limits plus mode mapping, fixed canonical prompt, and
local_asset_researchprofile mapping. -
Strip ambient
AGY_BINfrom production child env; reject public executable injection; allow fake only through module-private/test-only seam and fixed-proposal_onlysmoke driver sharing owned builder/readback/decision core. -
Implement private paths → canonical builder → actual wrapper → exact nonzero-inclusive readback → projection → exact decision. Builder/request/pre-AGY/non-AGY failures fail-close.
-
Preserve legacy alias only as current compatibility ingress: one-way map only when requirement absent; dual input fail-close; requirement only downstream.
-
Update router, agent, loop caller, focused units, retire/delete the legacy composed smoke, and add the sole new actual-wrapper smoke. Native only on exact degraded/native with valid exit pairing.
-
Add canonical producer-owned
agy_failure_kind,agy_invocation_attempted, andcanonical_agy_failure_kind(failure_class)returning the exact known producer kind or null; controller consumes and pair-validates it without mirroring taxonomy. Enforce 1-MiB raw wrapper read limit and strict duplicate-key-rejecting parse for wrapper output, controller decision stdout, and success sidecar stderr. Preserve the small explicit deny set: advisory fallback is only for attempted actual producer-markedoperationalrequiredagy_*; future operational classes require that explicit producer update, while policy/boundary classes are producer-markedpolicy_or_permissionand fail-close with same-PR deny-set/controller-test updates. No taxonomy mirror, positive allowlist, full schema duplicate, or regex classification. -
Implement the target-first/context-second sole
--context-fileserialization, fixedTargets:/Additional context:prompt, duplicate rejection, and matching 32-total-file/1-MiB-each/4-MiB-aggregate boundary acceptance/rejection tests withoutevidence_targetsorbuild_request.pychanges. -
Implement producer
run_gemini_headless.pytop-levelagy_invocation_attemptedextension by wiring a producer-owned pre-exec callback immediately before the actualagy -psubprocess, and add focused timing coverage intest_agy_provider.pythat proves callback-to-subprocess ordering, false pre-AGY behavior, and success/failure correlation; implement controller consumption and actual-wrapper smoke consumption. -
Implement the exact five legacy mappings and controller rejection with focused units; old flag exists only at the named pre-controller ingress.
Out of Scope
build_request.py、failure taxonomy producer の変更(ただし canonicalrun_gemini_headless.pyの最小 additiveagy_failure_kindoutput とその producer test は In Scope)- OAuth、credentials/token、GH_CONFIG_DIR、keyring/config mutation、実 provider invocation/availability、retry redesign
- crypto signature、persistent DB、self-declared provenance/flag、taxonomy mirror/positive allowlist、full schema duplicate、
CODEBASE_INVESTIGATION_RESULT_V1の変更、root control-plane routing、second smoke、新規 Issue、branch/PR/Issue 分割、native fallback 中の write/GitHub/Issue mutation
Acceptance Criteria
-
AC1: Public controller accepts only exact closed
AGY_ADVISORY_INVOCATION_REQUEST_V1fields/types: literal schema/version, fixed mode, nonempty purpose, nonempty target_paths, optional context_paths, requirement enum; raw prompt/result/output/projection/failure_class/provenance/old flag reject before spawn. -
AC2: Before spawn, target_paths and context_paths are deduplicated ordered lists. Duplicates within/across lists, absolute paths,
.., nonexistent/non-regular files, outside-root resolution/symlinks, and violations of 32 total files/1 MiB each/4 MiB aggregate reject. The sole builder serialization is targets first then contexts, each as--context-file <resolved path>; fixedTargets:/Additional context:prompt and unchanged builder profile are used. -
AC3: Production wrapper child env strips AGY_BIN; no public CLI/API field, request value, or AGY_BIN environment value can select executable. Literal
agyresolution through inherited PATH/installed identity is explicitly deployment-boundary behavior outside caller provenance. Focused proof covers AGY_BIN stripping and public injection rejection. -
AC4: Private TemporaryDirectory → builder → actual wrapper (argv/shell=False/bounded) → at-most-1MiB exact output readback including nonzero → strict duplicate-key-rejecting parse → projection → shared deterministic core. Oversize, partial, unreadable, or malformed wrapper output and request/builder failures emit only failed/fail_closed, no sidecar, and no native fallback.
-
AC5: Focused unit proves production
local_asset_researchmapping and pre-_run_agy/non-agy result is failed/fail_closed, never operational fallback. -
AC6: Canonical producer actual
delegation_result/v1output contains producer-ownedagy_failure_kindandagy_invocation_attempted, plus solecanonical_agy_failure_kind(failure_class)returning the exact known producer kind or null. Attempted transitions true only through a producer-owned pre-exec callback immediately before the actualagy -psubprocess, and is false pre-AGY; success is attempted:true/kind:null and actual attempted failure is attempted:true/non-null kind. Controller invokes the classifier without a taxonomy mirror and requires its non-null result to equal observed kind. A successful response additionally requires actual same-invocationresponse_textto be nonempty and at most 256 KiB UTF-8; controller-focused tests prove the success sidecar copies that exact value only, rejects invalid/oversize text, and never generates, substitutes, truncates, or reconstructs it from caller input. Unknown, invalid, contradictory, false-attempt, non-AGY, or nonconforming values fail closed. Fallback requires attempted:true + canonical operational pair + actualagy_*; policy_or_permission, contract, and explicitly_required fail close. -
AC7: stdout is exactly the UTF-8 bytes of one strict duplicate-key-rejecting closed decision JSON object, optionally followed by one LF and with no other byte, diagnostic, or second JSON value. On
ok/continue_agy_resultonly, stderr is exactly the UTF-8 bytes of one closedAGY_ADVISORY_SUCCESS_RESULT_V1, optionally followed by one LF, with no other byte, diagnostic, child stderr, second JSON value, or duplicate key. It has only literal schema/version and a nonempty <=256 KiBresponse_textcopied byte-for-byte from the validated actual same-invocation success output; it is untrusted research content, and controller never generates, substitutes, truncates, or reconstructs it from caller input. No raw wrapper result/projection/path/caller data is delivered. Non-okemits no sidecar. Agent/caller capture streams separately, require the exact exit-0ok/continue+ strict-sidecar pairing before consuming the success text, and reject malformed/missing/multiple/unpaired output; native remains permitted only by exact degraded/native. Exit 0 only valid ok/degraded, exit 1 only valid failed, exit 2 no trusted decision. -
AC8: The sole new actual-wrapper smoke uses module-private fixed-proposal_only driver and AGY_BIN fake through shared builder→canonical producer wrapper→exact-output (including
agy_failure_kindandagy_invocation_attempted)→decision core before real codebase-investigator/native sentinel; proves fake evidence, ambient strip, public injection rejection, private seam core, producer discriminator consumption, unchanged tracked status/no mutation. The old legacy smoke is retired/deleted; no second smoke/harness; exit77 is SKIP not PASS; no OAuth/provider/network/keyring/config mutation or credential artifact. -
AC9: Focused controller tests prove target/context ordered serialization, duplicate rejection within/across lists, target-only canonical context reachability, fixed prompt sections/no raw caller prompt, and matching local-asset 32/1MiB/4MiB boundary acceptance/rejection; no
evidence_targetsorbuild_request.pychange. -
AC10:
run_gemini_headless.pywires producer-ownedagy_invocation_attemptedtransition through a pre-exec callback immediately before the actualagy -psubprocess, and focusedtest_agy_provider.pytiming coverage proves callback-to-subprocess ordering, false pre-AGY behavior, and success/attempted-failure correlation; controller and actual-wrapper smoke consume both fields and fallback only for attempted:true + operational + actualagy_*. -
AC11: Focused units prove all five exact legacy mappings at
agent/issue-refinement-looppre-controller ingress and controller legacy/unknown-key rejection.
Verification Commands
# AC1
# baseline-expect: fail
$ uv run --locked pytest .claude/skills/issue-refinement-loop/scripts/tests/test_run_codebase_investigator_agy_advisory.py -q
# AC2
# baseline-expect: fail
$ uv run --locked pytest .claude/skills/issue-refinement-loop/scripts/tests/test_run_codebase_investigator_agy_advisory.py -q
# AC3
# baseline-expect: fail
$ uv run --locked pytest .claude/skills/issue-refinement-loop/scripts/tests/test_run_codebase_investigator_agy_advisory.py -q
# AC4
# baseline-expect: fail
$ uv run --locked pytest .claude/skills/issue-refinement-loop/scripts/tests/test_run_codebase_investigator_agy_advisory.py -q
# AC5
# baseline-expect: fail
$ uv run --locked pytest .claude/skills/issue-refinement-loop/scripts/tests/test_run_codebase_investigator_agy_advisory.py -q
# AC6
# baseline-expect: fail
$ uv run --locked pytest .claude/skills/issue-refinement-loop/scripts/tests/test_route_agy_advisory_fallback.py -q
# AC7
# baseline-expect: fail
$ uv run --locked pytest .claude/skills/issue-refinement-loop/scripts/tests/test_route_agy_advisory_fallback.py -q
# AC8
# preflight-scope: runtime_only
$ uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_codebase_investigator_actual_wrapper_fallback_smoke.py -q -m claude_live
# AC9
# baseline-expect: fail
$ uv run --locked pytest .claude/skills/issue-refinement-loop/scripts/tests/test_run_codebase_investigator_agy_advisory.py -q
# Producer discriminator
$ uv run --locked pytest .claude/skills/gemini-cli-headless-delegation/tests/test_agy_provider.py -q
# AC10
# baseline-expect: fail
$ uv run --locked pytest .claude/skills/issue-refinement-loop/scripts/tests/test_route_agy_advisory_fallback.py -q
# AC11
# baseline-expect: fail
$ uv run --locked pytest .claude/skills/issue-refinement-loop/scripts/tests/test_run_codebase_investigator_agy_advisory.py -qAllowed Paths
.claude/agents/codebase-investigator.md.claude/skills/issue-refinement-loop/SKILL.md.claude/skills/issue-refinement-loop/scripts/route_agy_advisory_fallback.py.claude/skills/issue-refinement-loop/scripts/tests/test_route_agy_advisory_fallback.py.claude/skills/issue-refinement-loop/scripts/run_codebase_investigator_agy_advisory.py.claude/skills/issue-refinement-loop/scripts/tests/test_run_codebase_investigator_agy_advisory.py.claude/skills/issue-refinement-loop/tests/test_codebase_investigator_actual_wrapper_fallback_smoke.py.claude/skills/issue-refinement-loop/tests/test_codebase_investigator_agy_fallback_smoke.py(delete).claude/skills/gemini-cli-headless-delegation/scripts/run_gemini_headless.py.claude/skills/gemini-cli-headless-delegation/tests/test_agy_provider.py.claude/skills/gemini-cli-headless-delegation/tests/test_agy_invocation_argv_allowlist.py.claude/skills/gemini-cli-headless-delegation/scripts/run_agy_github_research_e2e.py.claude/skills/gemini-cli-headless-delegation/tests/test_agy_github_research_e2e.py
Anchor Finding Disposition
-
P0: resolved: production strips ambient AGY_BIN; fake injection is module-private test-only. PATH/installed identity is deployment-boundary outside caller provenance.
-
P1: resolved: producer-owned attempted/kind/class correlation makes actual AGY invocation controller-verifiable; only attempted:true, producer-marked operational valid actual
agy_*failures may fall back. Exact decision protocol, target-first/context-second serialization, pre-AGY fail-close, focused producer/controller tests, sole new actual-wrapper smoke, and old-smoke retirement are retained; no taxonomy mirror, positive allowlist, regex, or full schema duplicate. -
P2: resolved: exact pre-controller-only five-case legacy mapping deletes the old field before exact V1; controller legacy/unknown-key rejection is retained.
-
P0: resolved by target-first/context-second
--context-fileserialization, target-only reachability, and matching downstream limit tests. -
P1: resolved by producer-owned
agy_invocation_attemptedextending existingagy_failure_kind, controller attempted/kind/class correlation, producer/controller/actual-wrapper consumption, and no taxonomy mirror/regex/full schema duplication. -
P2: resolved by exact pre-controller-only legacy adapter mappings, deletion of old flag before exact V1, and controller legacy/unknown-key rejection.
Stop Conditions
-
Allowed Paths 外の変更が必要と判明した場合
-
In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
-
新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
-
後続 Phase / 別スコープへの波及が判明した場合
-
nested SubAgent delegation が必要になった場合
-
外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
-
Exact public request, repository-root path containment/32-path/1-MiB-per-file/4-MiB-aggregate/mode mapping, requirement-only policy, AGY_BIN-stripped production env, private test seam, canonical builder/wrapper sequence, producer-owned attempted/kind correlation, exact decision protocol, or the sole new actual-wrapper smoke plus old-smoke retirement cannot be retained.
-
PATH/installed AGY deployment management, taxonomy mirror/positive allowlist/full schema duplicate/regex classification, root routing/CODEBASE result change, mutating native work, GitHub/Issue mutation, OAuth/credential/keyring/config mutation, or real provider availability is required.
-
Stop if target-first/context-second canonical
--context-fileserialization, same existing downstream limits, no-evidence_targets/no-build_request.pyboundary, producer-owned pre-exec callback transition immediately before actualagy -psubprocess with focused timing coverage, producer attempted/kind correlation, exact pre-controller legacy adapter, single new smoke plus old-smoke retirement, or all focused producer/controller/smoke consumptions cannot be retained.
Required Skills
なし
Required Design References
.claude/agents/codebase-investigator.md.claude/skills/issue-refinement-loop/SKILL.md.claude/skills/gemini-cli-headless-delegation/scripts/build_request.py.claude/skills/gemini-cli-headless-delegation/scripts/run_gemini_headless.py.claude/skills/gemini-cli-headless-delegation/references/failure-class-taxonomy.mddocs/dev/runtime-verification-policy.md
Scope Delta(任意)
-
Remove caller-owned result/projection trust and ambient-production AGY_BIN trust; add stripped child env, exact canonical request/profile/repository-root-contained path mapping with 32-path/1-MiB-per-file/4-MiB-aggregate/mode limits, private fake seam, and owned invocation/private paths.
-
Add producer-owned attempted/kind correlation, target-first/context-second canonical context-file serialization, exact prompt sections, and exact pre-controller legacy ingress mapping; retain the sole-new-actual-wrapper-smoke/old-smoke-retirement contract without builder, taxonomy, or public-controller compatibility expansion.
-
Add target-first/context-second canonical context-file serialization and exact prompt sections; add producer-owned attempted boolean correlation and exact legacy ingress mapping. Restore the fixed single-new-smoke/old-smoke-retirement contract. This is a narrow contract clarification, not a builder, taxonomy, or public-controller compatibility expansion.
Delivery Rule
1 Issue = 1 PR は repository delivery rule として維持するが、本 Issue 本文の semantic rewrite は canonical controlled transaction のみで行い、new Issue、branch、PR、Issue split は作成しない。
Notes for Reviewer
-
Ambient AGY_BIN is stripped in production; fake injection is module-private/test-only only. PATH/installed agy identity is deployment boundary, not caller provenance.
-
reason_code is routing-only. The small explicit deny set remains; advisory fallback requires a canonical producer-marked
agy_failure_kind: operationaland conformingagy_*class, while policy/boundary and invalid/unknown results fail close. -
Agent/caller require exact closed decision plus exit pairing; only degraded/native starts native work.
-
The sole new actual-wrapper smoke uses proposal_only only in private driver, not production local_asset; exit77 SKIP is not PASS.
-
agy_invocation_attemptedis producer-owned top-level output, not caller provenance; its true transition is immediately before canonical subprocess exec.agy_failure_kindis extended, never replaced. -
Legacy
agy_advisory_native_fallback_allowedis accepted nowhere except the named pre-controller ingress and is deleted before controller validation. -
Keep AGY_BIN strip/private seam, exact decision protocol, producer allowed path, P0/P1/P2, single new smoke, and old-smoke retirement unchanged.
-
The existing owner boundary is explicit: deployment-managed inherited PATH/installed
agyis outside caller provenance; only public request/API fields and ambientAGY_BINare executable-selection inputs that the controller rejects or strips. -
Wrapper output is capped at 1 MiB before strict parsing. Wrapper/stdout/stderr duplicate keys, extra bytes, partial data, or unpaired streams fail close without native fallback.
Source
- source_kind: user_requested_implementation
- source_url: 実装: AGY fallback failure_class を capability_preflight_result へ渡す production 配線を issue-refinement-loop SKILL.md に追加する #2360
- related_refs: ["実装: Claude-GPT workflow の actor-scoped capability handoff を導入し issue-refinement-loop の auth/delegation parity を安定化する #2340", "実装: AGY fallback failure_class を capability_preflight_result へ渡す production 配線を issue-refinement-loop SKILL.md に追加する #2360", "feat: codebase-investigator に agy_advisory_native_fallback_allowed opt-in native fallback を追加 #2365", "実装: refactor: PR #2357由来のdead root-level AGY post-runtime override一式を削除する #2368", "実装: issue-refinement-loop の structural repair producer に known_scalars/source_spans の実抽出を配線する #2431"]
- dedupe_key: "implementation:squne121/loop-protocol:agy-controller-owned-advisory-fallback:v3"
Activity
squne121 commentedon Aug 30, 2026
結論
判定: REQUEST_CHANGES —
reframe_in_place推奨。#2434 の方向性そのもの、つまり
prose / mirror predicate ではなく production deterministic helper に fallback 判定を集約する
test-only
AGY_BINを使い、canonical builder → actualrun_gemini_headless.py→ route decision → realcodebase-investigatornative fallback を通すroot/preflight へ AGY post-runtime routing を戻さず、SubAgent-local architecture を維持する
の3点は妥当です。特に
run_gemini_headless.pyは既にAGY_BINの hermetic test injection を意図して実装しているため、実OAuthや実providerを使わず wrapper 境界を検証する設計はきれいです。ただし、fallback policy が現行 main と過去のOwner判断から後退しています。ここは実装前に直すべきです。
Findings
Severity | Finding | 判定 -- | -- | -- P0 | agy_auth_required / agy_timeout / agy_not_found の3種類だけを fallback allowlist にする設計 | 変更必須 P0 | 既存 agy_advisory_native_fallback_allowed と新規 agy_investigation_requirement が二重のpolicy inputになる | 変更必須 P1 | wrapper result 全体を closed-schema として再定義すると producer schema と二重管理になる | 変更推奨 P1 | unknown failure_class を一律 fail-close にすると taxonomy 追加で advisory workflow が突然停止する | 変更推奨 P1 | AC5 の実wrapper smoke は価値があるが、恒久ハーネスを広げすぎる余地がある | 縮小推奨 P2 | #2155 を Required Design References に置く意味がほぼない | 削除推奨P0: 3-class allowlist は現行設計の可用性を壊す
ここが最大の問題です。
現行
codebase-investigator.mdは既に明示的に negative policy を採用しています。すなわち「taxonomy の値を全部allowlist化しない。advisory AGY failure は原則 native fallback し、明白な contract / policy / permission-boundary violation だけ止める」という設計です。これは偶然ではなく、#2360 の敵対的レビューでもOwnerがまさに同じ結論を出しています。大量の failure class allowlist をconsumer側に複製するのではなく、advisory provider failure は原則 fallback、boundary/policy violation のみ block が個人開発には適切だと整理されています。 PR #2365 のレビューでも、この「小さなdenylist」方式が再度推奨され、その後 main に反映されています。
ところが #2434 は再び
agy_auth_requiredagy_timeoutagy_not_foundだけを許可します。Issue本文でもそれ以外の既知classを全部 fail-close と明記しています。
これは taxonomy とも噛み合いません。現行 taxonomy には
agy_rate_limited、agy_capacity_exhausted、agy_web_grounding_quota_exhaustedなど、明らかに「AGY が今使えないだけ」で native repository investigation を止める理由にならない operational failure が存在します。たとえば、
は、ユーザーの用途では完全に逆です。
Web側の現状もこの判断を補強します。Antigravity CLI は headless permission の設定が期待通り作用しない報告や、非対話認証の未解決要求が現在もあり、
-pautomation の availability は完全に安定した前提にはできません。(GitHub) upstream自身も過去に headless permission、keyring、sandbox、noninteractive behavior を継続的に修正しています。(GitHub)推奨policyは次です。
deny対象だけ小さく固定するのがよいです。具体的には少なくとも、
request_schema_invalidrequest_policy_deniedgithub_research_command_deniedagy_invocation_policy_deniedagy_permission_deniedagy_permission_boundary_unavailableagy_permission_boundary_inconclusiveあたりです。
rate-limit / capacity / quota / timeout / auth / executable unavailable / ordinary nonzero provider termination は advisory なら fallback でよいです。
P0: policy input が二重になる
現行 Step 1 は
codebase-investigatorにagy_advisory_native_fallback_allowed: trueを渡す契約です。
#2434 はさらに、
agy_investigation_requirement: advisory | explicitly_requiredを追加します。
すると、
のような矛盾状態が生まれます。
しかも issue-refinement-loop の現行 Step 1 には「誰がどの根拠で explicitly_required を決めるのか」という deterministic producer がありません。つまり failure判定だけhelper化しても、required/advisory の判定は依然prompt semantics です。
ここは単一入力にした方がいいです。
そして
advisory自体が fallback opt-in を意味する形にして、旧agy_advisory_native_fallback_allowedは削除またはcompatibility aliasとして一時的にのみ扱うことを勧めます。少なくとも二つを独立したpolicy truthとして残すべきではありません。
P1: closed-schema にする場所が違う
AGY_ADVISORY_FALLBACK_ROUTE_DECISION_V1出力を closed schema にするのは賛成です。一方、
run_gemini_headless.pyのdelegation_result/v1全体を新helperでもexact closed-schema validationするのは避けた方がいいです。そうすると、
という二重authorityになります。
将来wrapperに harmless な追加fieldが1つ増えただけで、fallback consumerが突然fail-closeする可能性があります。
helperが必要なのはせいぜい、
と要求種別だけです。
helper自身のinput envelopeはclosed、埋め込まれたwrapper resultは必要fieldだけprojectして検証くらいが適切です。taxonomy全値のコピーも不要です。
P1: unknown class の扱いも availability 寄りでよい
#2434 は unknown failure class を全部 fail-close にします。
これは malformed JSON と同一視しない方がいいです。
例えば upstream に将来、
agy_service_unavailableが追加された場合、wrapper result自体は完全にvalidなのに、issue-refinement-loop が更新されるまで全調査が停止します。
私なら、
とします。
これなら、contract破損にはfail-closeしつつ、provider taxonomy追加ではworkflowを止めません。
実wrapper smoke は採用してよい。ただし1本で十分
ここは #2434 の改善点です。
現在の smoke は実
codebase-investigatorを起動するものの、promptへ pre-completed fakedelegation_result/v1を渡しており、wrapper producerまでは通していません。つまりconsumer proofとしては有効でも「wrapper-to-fallback E2E」と呼ぶには弱いです。一方で
AGY_BINinjection は既存wrapperの正式なtest seamです。したがって、という1本だけのthin integration smokeは追加価値があります。
ただし、ここから新しい sandbox、permission broker、OAuth emulator、keyring emulator、永久permission baseline、巨大なtool-trace auditorへ広げるべきではありません。
Claude Code公式も
tools/disallowedToolsとpermissionMode: dontAskを組み合わせて非対話のbounded SubAgentを構成できるとしています。dontAskはpromptを自動拒否し、明示許可されたtoolは動作します。(Claude) 現行Read/Grep/Glob + bounded Bashのままで十分です。PR #2365 では、意図したpermission変更まで止めていた
pre_migration_git_history恒久テストが「harness scope leakage」と判断され削除対象になった前例もあります。 同じ失敗を #2434 で再導入しない方がよいです。#2155 は参照から外してよい
#2155 は #2119 の performance/reliability close-grade 実CI evidenceを扱う verification-only Issue です。
#2434 自身も「dependencyではない」「実CI evidenceは対象外」と書いています。
であれば Required Design References に置くメリットがなく、むしろ「runtime verificationなら #2155 型の重いevidence governanceも必要なのか」という誤読を誘います。削除を推奨します。
#2431 の overlap は確認しましたが、こちらは Step 0f structural repair producer の
known_scalars/source_spanswiring が目的で、今回の AGY fallback decision boundary とは編集意図が別です。directory-level C1 advisory の扱いで問題ありません。推奨する #2434 の着地点
Issueを分割する必要はありません。その場でreframeすれば十分です。
中心契約は、
が最も整合しています。
実装優先度としては、P0の2点を修正してから implementation-ready にするのを推奨します。 deterministic helper と wrapper smoke はそのまま進めてよく、問題は「deterministic化の中身を3-class allowlistとして固定してしまっていること」です。そこさえ直せば、#2360/#2365/#2368 で積み上げた設計を壊さず、AGY障害で作業が不要に止まる問題もかなり減らせます。
## 結論判定: REQUEST_CHANGES —
reframe_in_place推奨。#2434 の方向性そのもの、つまり
AGY_BINを使い、canonical builder → actualrun_gemini_headless.py→ route decision → realcodebase-investigatornative fallback を通すの3点は妥当です。特に
run_gemini_headless.pyは既にAGY_BINの hermetic test injection を意図して実装しているため、実OAuthや実providerを使わず wrapper 境界を検証する設計はきれいです。ただし、fallback policy が現行 main と過去のOwner判断から後退しています。ここは実装前に直すべきです。
Findings
agy_auth_required / agy_timeout / agy_not_foundの3種類だけを fallback allowlist にする設計agy_advisory_native_fallback_allowedと新規agy_investigation_requirementが二重のpolicy inputになるfailure_classを一律 fail-close にすると taxonomy 追加で advisory workflow が突然停止するP0: 3-class allowlist は現行設計の可用性を壊す
ここが最大の問題です。
現行
codebase-investigator.mdは既に明示的に negative policy を採用しています。すなわち「taxonomy の値を全部allowlist化しない。advisory AGY failure は原則 native fallback し、明白な contract / policy / permission-boundary violation だけ止める」という設計です。これは偶然ではなく、#2360 の敵対的レビューでもOwnerがまさに同じ結論を出しています。大量の failure class allowlist をconsumer側に複製するのではなく、advisory provider failure は原則 fallback、boundary/policy violation のみ block が個人開発には適切だと整理されています。 PR #2365 のレビューでも、この「小さなdenylist」方式が再度推奨され、その後 main に反映されています。
ところが #2434 は再び
agy_auth_requiredagy_timeoutagy_not_foundだけを許可します。Issue本文でもそれ以外の既知classを全部 fail-close と明記しています。
これは taxonomy とも噛み合いません。現行 taxonomy には
agy_rate_limited、agy_capacity_exhausted、agy_web_grounding_quota_exhaustedなど、明らかに「AGY が今使えないだけ」で native repository investigation を止める理由にならない operational failure が存在します。たとえば、
は、ユーザーの用途では完全に逆です。
Web側の現状もこの判断を補強します。Antigravity CLI は headless permission の設定が期待通り作用しない報告や、非対話認証の未解決要求が現在もあり、
-pautomation の availability は完全に安定した前提にはできません。([GitHub]1) upstream自身も過去に headless permission、keyring、sandbox、noninteractive behavior を継続的に修正しています。([GitHub]2)推奨policyは次です。
deny対象だけ小さく固定するのがよいです。具体的には少なくとも、
request_schema_invalidrequest_policy_deniedgithub_research_command_deniedagy_invocation_policy_deniedagy_permission_deniedagy_permission_boundary_unavailableagy_permission_boundary_inconclusiveあたりです。
rate-limit / capacity / quota / timeout / auth / executable unavailable / ordinary nonzero provider termination は advisory なら fallback でよいです。
P0: policy input が二重になる
現行 Step 1 は
codebase-investigatorにagy_advisory_native_fallback_allowed: trueを渡す契約です。
#2434 はさらに、
agy_investigation_requirement: advisory | explicitly_requiredを追加します。
すると、
のような矛盾状態が生まれます。
しかも issue-refinement-loop の現行 Step 1 には「誰がどの根拠で explicitly_required を決めるのか」という deterministic producer がありません。つまり failure判定だけhelper化しても、required/advisory の判定は依然prompt semantics です。
ここは単一入力にした方がいいです。
そして
advisory自体が fallback opt-in を意味する形にして、旧agy_advisory_native_fallback_allowedは削除またはcompatibility aliasとして一時的にのみ扱うことを勧めます。少なくとも二つを独立したpolicy truthとして残すべきではありません。
P1: closed-schema にする場所が違う
AGY_ADVISORY_FALLBACK_ROUTE_DECISION_V1出力を closed schema にするのは賛成です。一方、
run_gemini_headless.pyのdelegation_result/v1全体を新helperでもexact closed-schema validationするのは避けた方がいいです。そうすると、
という二重authorityになります。
将来wrapperに harmless な追加fieldが1つ増えただけで、fallback consumerが突然fail-closeする可能性があります。
helperが必要なのはせいぜい、
と要求種別だけです。
helper自身のinput envelopeはclosed、埋め込まれたwrapper resultは必要fieldだけprojectして検証くらいが適切です。taxonomy全値のコピーも不要です。
P1: unknown class の扱いも availability 寄りでよい
#2434 は unknown failure class を全部 fail-close にします。
これは malformed JSON と同一視しない方がいいです。
例えば upstream に将来、
agy_service_unavailableが追加された場合、wrapper result自体は完全にvalidなのに、issue-refinement-loop が更新されるまで全調査が停止します。
私なら、
とします。
これなら、contract破損にはfail-closeしつつ、provider taxonomy追加ではworkflowを止めません。
実wrapper smoke は採用してよい。ただし1本で十分
ここは #2434 の改善点です。
現在の smoke は実
codebase-investigatorを起動するものの、promptへ pre-completed fakedelegation_result/v1を渡しており、wrapper producerまでは通していません。つまりconsumer proofとしては有効でも「wrapper-to-fallback E2E」と呼ぶには弱いです。一方で
AGY_BINinjection は既存wrapperの正式なtest seamです。したがって、という1本だけのthin integration smokeは追加価値があります。
ただし、ここから新しい sandbox、permission broker、OAuth emulator、keyring emulator、永久permission baseline、巨大なtool-trace auditorへ広げるべきではありません。
Claude Code公式も
tools/disallowedToolsとpermissionMode: dontAskを組み合わせて非対話のbounded SubAgentを構成できるとしています。dontAskはpromptを自動拒否し、明示許可されたtoolは動作します。(Claude) 現行Read/Grep/Glob + bounded Bashのままで十分です。PR #2365 では、意図したpermission変更まで止めていた
pre_migration_git_history恒久テストが「harness scope leakage」と判断され削除対象になった前例もあります。 同じ失敗を #2434 で再導入しない方がよいです。#2155 は参照から外してよい
#2155 は #2119 の performance/reliability close-grade 実CI evidenceを扱う verification-only Issue です。
#2434 自身も「dependencyではない」「実CI evidenceは対象外」と書いています。
であれば Required Design References に置くメリットがなく、むしろ「runtime verificationなら #2155 型の重いevidence governanceも必要なのか」という誤読を誘います。削除を推奨します。
#2431 の overlap は確認しましたが、こちらは Step 0f structural repair producer の
known_scalars/source_spanswiring が目的で、今回の AGY fallback decision boundary とは編集意図が別です。directory-level C1 advisory の扱いで問題ありません。推奨する #2434 の着地点
Issueを分割する必要はありません。その場でreframeすれば十分です。
中心契約は、
が最も整合しています。
実装優先度としては、P0の2点を修正してから implementation-ready にするのを推奨します。 deterministic helper と wrapper smoke はそのまま進めてよく、問題は「deterministic化の中身を3-class allowlistとして固定してしまっていること」です。そこさえ直せば、#2360/#2365/#2368 で積み上げた設計を壊さず、AGY障害で作業が不要に止まる問題もかなり減らせます。
squne121 commentedon Aug 30, 2026
推奨は、#2434 を分割せず、指定コメントを OWNER の explicit human context として
reframe_in_placeし、そのままissue-refinement-loopを approval-less で完走させることです。現行
issue-refinement-loop自体、iteration gate は既定で承認不要です。また anchor comment 付きの direct human context にはpreflight.run.with_human_context→ 必要ならcontract_update.run.with_human_contextという canonical mutation lane が既にあります。 現行codebase-investigatorも「taxonomy 全値の allowlist を作らず、明白な contract/policy/boundary violation だけ deny」という negative policy を既に採用しています。指定コメントの P0 は特にそのまま反映すべきです。つまり、3-class allowlist を撤回し、
agy_advisory_native_fallback_allowedとagy_investigation_requirementの二重 policy truth を一本化することです。wrapper 全体の schema 複製を避ける、valid な未知agy_*operational failure は原則 fallback、actual-wrapper smoke は1本の thin integration に留める、#2155 は design reference から外す、という P1/P2 も一緒に reframe するのが適切です。 upstream AGY には現在も headless permission や noninteractive auth の未解決事例があるため、operational failure で refinement 全体を止めない availability-oriented な設計とも整合します。([GitHub]1)以下をそのまま Claude-GPT に渡せます。
以下の対象に対して
issue-refinement-loopを実行してください。対象リポジトリ:
https://github.com/squne121/loop-protocol
対象 Issue:
#2434
authoritative anchor comment:
#2434 (comment)
目的
Issue #2434 を、上記 OWNER anchor comment の REQUEST_CHANGES /
reframe_in_place指示に従って refinement し、実装着手可能な Issue contract まで改善してください。今回は issue refinement のみ が対象です。
impl-review-loopを開始しないこの依頼は explicit human authorization である
このメッセージは、リポジトリオーナーによる明示的な human instruction として扱ってください。
指定 anchor comment は
agent_reportや unlabeled anchor として扱わず、canonical な direct human context として扱ってください。したがって、必要なら canonical lane:
preflight.run.with_human_context→
contract_update.run.with_human_context→ fresh preflight
→ fresh review
を使用してください。
anchor comment が既に明示的に決定している事項について、再度人間へ承認を求めてはいけません。
特に、anchor comment に明示された以下の reframe は、このプロンプトによって適用を承認します。
必須 reframe
P0-1: 3-class fallback allowlist を撤回する
現在の Issue #2434 にある
agy_auth_requiredagy_timeoutagy_not_foundだけを automatic native fallback の eligible class とする positive allowlist 方針は撤回してください。
現行 main / #2360 / PR #2365 で確立された思想に合わせ、
advisory AGY investigation では valid な AGY operational failure は原則 native non-mutating fallback し、明白な contract / request / policy / permission violation だけ small negative policy で fail-close
という契約へ reframe してください。
少なくとも anchor comment が列挙した以下は fail-close 側として扱ってください。
request_schema_invalidrequest_policy_deniedgithub_research_command_deniedagy_invocation_policy_deniedagy_permission_deniedagy_permission_boundary_unavailableagy_permission_boundary_inconclusive一方、以下のような provider availability / operational failure は advisory なら原則 native fallback 可能な方向にしてください。
taxonomy 全値を consumer 側にコピーした巨大 allowlist を作る契約にはしないでください。
P0-2: policy input を一本化する
現行の
agy_advisory_native_fallback_allowedと、新たに提案されている
agy_investigation_requirement: advisory | explicitly_requiredを独立した二つの policy truth として残さないでください。
矛盾状態を作れない single source of truth に reframe してください。
推奨形は:
agy_investigation_requirement: advisory | explicitly_requiredを唯一の semantic policy input とし、
advisory= AGY-first。ただし eligible failure 時の native non-mutating fallback を許可explicitly_required= AGY failure 時は fail-closeとする形です。
既存
agy_advisory_native_fallback_allowedを即時削除することで migration 問題が出る場合のみ、compatibility alias / migration detail として扱って構いません。ただし、二つを独立した authority として残すことは禁止します。
P1-1: wrapper result schema の二重 authority を作らない
新 helper の output
AGY_ADVISORY_FALLBACK_ROUTE_DECISION_V1は closed / deterministic schema で構いません。しかし
run_gemini_headless.pyが生成するdelegation_result/v1全体の schema を helper 側でも完全複製しないでください。helper input envelope 自体は必要なら closed にしてよいですが、embedded wrapper result は routing に必要な projection のみ検証する契約にしてください。
例:
など。
wrapper producer schema に harmless field が追加されただけで fallback consumer が停止する設計にしないでください。
P1-2: unknown class と malformed result を区別する
malformed / contradictory wrapper result は fail-close のままにしてください。
例:
okとfailure_classの矛盾一方、
well-formed result かつ
failure_classが valid なagy_*provider failure で、明示 deny category に該当しない場合は、将来 taxonomy に operational class が追加されても advisory workflow が即停止しないようにしてください。つまり「unknown enumだから即 fail-close」という taxonomy mirror allowlist を避けてください。
P1-3: actual-wrapper smoke は thin integration 1本にする
以下を実際につなぐ verification contract は維持してください。
canonical builder
→ test-only
AGY_BINfake→ actual
run_gemini_headless.py→ real
delegation_result/v1→ production route helper
→ real
codebase-investigator→ native non-mutating fallback evidence
ただし 1本の thin integration smoke に限定してください。
以下の新規ハーネスを #2434 に持ち込まないでください。
既存の test-only
AGY_BINseam、既存 SubAgent permissions、既存 non-mutating investigation policy を利用してください。smoke の claim は実測できる範囲に限定してください。
例:
「全 side effect が存在しない」等の過剰 claim は作らないでください。
P2: #2155 を Required Design References から外す
#2155 は reference-only の verification issue であり #2434 の dependency ではありません。
Required Design References から削除してください。
必要なら historical/background mention 程度に留めてください。
維持する設計
以下は anchor comment が approve しているため維持してください。
CODEBASE_INVESTIGATION_RESULT_V1の既存 contract は変更しないcodebase-investigator/ SubAgent-local architecture 内で完結させるAGY_BINfake で実 OAuth / credential mutation / provider invocation を不要にする#2431 は Step 0f structural repair producer の
known_scalars/source_spanswiring が目的であり、#2434 の AGY wrapper-result decision/fallback boundary とは semantic scope が異なります。単なる directory-level overlap を human approval gate にしないでください。
issue-refinement-loop の実行
まず repository の現行
issue-refinement-loopskill と関連 SSOT を読み、独自の refinement 手順を再実装しないでください。canonical planner / reviewer / consumer の出力をそのまま consume してください。
対象 anchor は direct human context なので、必要に応じて canonical human-context preflight / contract-update route を使ってください。
preflight が deterministic repair / deterministic structural repair / trusted contract update / issue-editor rewrite を要求した場合は、canonical consumer を使って自動適用してください。
raw な ad-hoc GitHub Issue edit で canonical control-plane を迂回しないでください。
人間承認不要の実行権限
今回の refinement を完遂するために必要な以下の操作を事前承認します。
これらについて逐次「実行してよいですか」と聞かないでください。
loop iteration approval gate は不要です。
human_judgment_required の扱い
anchor comment とこのプロンプトで既に結論が与えられている事項を、再度
human_judgment_requiredに送らないでください。たとえば、
はすでに human decision 済みです。
preflight がこれらの既決事項を human context として認識できず停止した場合は、勝手に別方針を選ぶのではなく、canonical
with_human_contextlane / trusted anchor consumption が正しく使われているか確認し、可能な範囲で正規 route を再実行してください。ただし次のような、本プロンプトにも anchor comment にも答えがなく semantic contract を新たに決める必要がある真の未解決事項だけは、repository の hard stop contract に従って停止して構いません。
単なる routine repair、known template normalization、readback、label hygiene、path overlap、既決 reframe の適用を human escalation にしないでください。
SubAgent 実行指示
planner / skill が SubAgent investigation を要求する場合は、適切な SubAgent を使用してください。
特に repository investigation が必要なら
codebase-investigatorを使用し、現行 skill contract の AGY-first / advisory native fallback を尊重してください。重要:
推奨する refinement 後の #2434 contract
最終 Issue が概ね次の中心契約になるよう refinement してください。
agy_*operational failure は small deny policy に該当しない限り advisory fallback を阻害しないCODEBASE_INVESTIGATION_RESULT_V1は変更しないAGY_BINfake を使う actual-wrapper thin integration smoke を1本追加Acceptance Criteria / In Scope / Out of Scope / Verification Commands / Stop Conditions / Allowed Paths も、この reframe と矛盾しないよう全面的に整合させてください。
特に旧方針で残りやすい、
agy_advisory_native_fallback_allowedとagy_investigation_requirementの二重 truthを stale text として残さないでください。
完了条件
次の状態まで、途中の人間承認なしで refinement loop を継続してください。
最大 iteration に達する前に needs-fix が出た場合は自動で rewrite → fresh review を継続してください。
最終報告
最後に簡潔に以下を報告してください。
途中経過だけで終了せず、起動した SubAgent の完了を待ち、refinement loop の terminal state まで実行してください。
この形なら、単に「
--no-approvalで回して」と言うより、今回の anchor comment 自体を human decision として canonical human-context lane に供給する点を明示しているため、以前のように「semantic reframe なので人間判断待ち」で止まる可能性をかなり減らせます。特に #2434 は Issue 本文そのものが既に implementation phase なので、今回は「refinement 完了後も実装には入らない」を明示的に入れています。squne121 commentedon Aug 30, 2026
結論として、今回の
semantic review: blocker / needs-fixは、現在の #2434 の契約に対しては妥当です。ただし、3-class allowlist や small negative deny policy が悪いという判定ではありません。止められているのは 「このfailure_classが本当に canonical wrapper producer から来た値だと、どう機械的に保証するのか」 が未定義だからです。現在の #2434 はかなり改善されていて、
agy_investigation_requirementの単一 policy truth、small negative deny policy、future validagy_*の availability 寄り fallback、wrapper 全体の schema 複製回避まで反映されています。 これは anchor comment の P0/P1 の方向とも一致し、PR #2365 でも small negative policy が明示的に採用されています。問題は、現在の契約が「actual
run_gemini_headless.py --output-fileJSON を渡す」としながら、同時に「任意に作ったagy_fooは拒否するが、将来 producer が追加した正規agy_fooは許可する」と要求している点です。JSON の中身だけ見れば両者は同じ文字列なので、provenance を別に定義しない限り判別不能です。実際、最終 semantic finding も「future validagy_*と arbitrary prefix-only を決定論的に区別できない」を blocker としています。 そのため deterministic review は approve でも、最終 join が needs-fix になっています。ここで provenance flag や taxonomy allowlist を新設する必要はありません。一番小さく、実装もしやすい解決は「production route helper 自身が wrapper invocation を所有する」ことです。
run_gemini_headless.pyは既に_classify_agy_failure()で stdout/stderr から canonical class を作り、_normalize_agy_result()がそれをdelegation_result/v1.failure_classに格納しています。 現行 taxonomy も rate limit / capacity / quota / auth / timeout / ordinary nonzero 等を canonical producer の分類として定義しています。したがって、production API に arbitrary result JSON を渡させないのが推奨です。route helper/controller が canonical request を受け、自分で private temporary output path を作り、
run_gemini_headless.pyをshell=Falseで起動し、その自分で生成させた output だけを読み、minimal projection → route decision とします。内部の pure decision function は unit test 用に dict を受けてもよいですが、production caller から直接呼べる contract にはしません。これなら self-declaredcanonicalized: trueも、全 taxonomy mirror も不要です。なお、途中の「Issue edit permission denied」は この semantic blocker とは別問題です。自動 repair lane は permission denied になりましたが、その後同じセッションで canonical
edit_issue_txn.pyを使った更新自体は成功しています。 したがって次のプロンプトでは、#2434 の refinement に必要な controlled Issue body mutation を今回の明示的 human authorization として扱わせ、同じ承認を再度聞かせないようにしています。以下を Claude-GPT にそのまま渡すのを推奨します。
以下の対象に対して
issue-refinement-loopを継続実行してください。対象リポジトリ:
https://github.com/squne121/loop-protocol
対象 Issue:
#2434
canonical direct human context / anchor:
#2434 (comment)
目的は Issue #2434 自体を reframe し、fresh deterministic review と fresh semantic design review の両方が terminal approve / implementation-ready 相当になるまで refinement を完了することです。
Issue の分割、新規 Issue 起票、実装、branch 作成、Draft PR 作成は行わないでください。今回は Issue refinement のみです。
Explicit human authorization
これはリポジトリオーナーによる明示的な human instruction / owner decision です。
このメッセージを、今回の
issue-refinement-loopに必要な以下の作業に対する直接の human authorization として扱ってください。Issue #2434 の本文を canonical controlled mutation lane で必要回数更新すること、candidate body / transaction input / review artifact / temporary artifact を作成すること、
preflight.run.with_human_context、contract readiness、root deterministic review、semantic design review、join review を必要回数実行すること、repository の read-only 調査、関連 Issue / PR / canonical artifact の readback、read-onlygh/ Git operations を行うことを許可します。edit_issue_txn.py等の repository-sanctioned controlled Issue mutation を使った #2434 本文更新について、同じ human approval を再度要求しないでください。auto repair dispatcher / permission wrapper が permission/control-plane 理由だけで mutation を拒否した場合でも、この explicit authorization が失われたとは解釈しないでください。repository が許可している別の canonical controlled transaction lane が存在する場合はそれを使用してください。ただし raw
gh issue edit、permission bypass flag、guard 無効化、credential manipulation 等で迂回してはいけません。Issue body の semantic refinement に必要なら、#2434 自体の Allowed Paths / In Scope / AC / Verification Commands / Stop Conditions を in-place で狭く整合させることも許可します。これを理由に新規 Issue を起票したり、人間承認を再要求したりしないでください。
今回の semantic blocker に対する owner decision
直前の semantic review の blocker:
future valid agy_* operational failureと、任意に偽造された prefix-onlyagy_* failure_classを rawdelegation_result/v1JSON だけから区別できないについて、owner decision は以下です。
production trust boundary は「caller が渡した JSON の自己申告 provenance」ではなく、「production routing entry point が canonical wrapper invocation 自体を所有していること」で確立してください。
つまり、production entry point が caller-supplied
delegation_result/v1JSON、caller-created routing projection、caller-suppliedfailure_classoverride、canonicalized: trueのような self-declared provenance flag を直接 trust する設計にはしないでください。推奨する contract は、production routing entry point/controller が canonical request を受け、自身で collision-resistant / private temporary output path を作成し、actual
.claude/skills/gemini-cli-headless-delegation/scripts/run_gemini_headless.pyをshell=Falseの bounded subprocess として起動し、その invocation が生成した exact output のみを直後に読み取って routing projection を構築する形です。その invocation-owned result に対してのみ、schema/version、provider、
ok、failure_class、requirement、および相関する failure state の minimal projection validation を行ってください。内部実装上、pure decision function が dict/projection を受けること自体は構いません。ただしそれを caller-facing production trust boundary にしてはいけません。fixture / unit test が直接 pure function に値を渡す経路は test-only と明確に分離してください。
この設計により、
canonical wrapper producer が生成した将来の valid
agy_*operational failureと
prompt / caller / arbitrary JSON から注入された prefix-only
agy_*を production contract 上区別してください。
暗号署名、persistent provenance DB、自己申告 provenance field、failure taxonomy 全値 mirror、巨大な harness は導入しないでください。
canonical producer を再実装しない
現行 main の
run_gemini_headless.py::_classify_agy_failure()/ AGY result normalization が canonical failure classification producer です。consumer 側に classification regex、全 failure-class allowlist、producer schema 全体の duplicate validator を作らないでください。
必要なのは canonical producer invocation の ownership と、その actual output の minimal routing projection です。
まず既存 implementation / taxonomy / #2360 / merged PR #2365 を repository evidence で再確認してください。
fallback policy
agy_investigation_requirement: advisory | explicitly_requiredを fallback semantics の唯一の semantic policy authority としてください。agy_advisory_native_fallback_allowedを残す必要がある場合は transitional compatibility alias に限定し、独立した二つ目の policy truth として扱わないでください。advisoryかつ canonical actual AGY wrapper invocation が well-formed failure を返した場合、small negative deny policy に該当しない operational/provider-availability failure は native non-mutating fallback eligible としてください。rate limit、capacity exhaustion、quota exhaustion、auth unavailable、binary/provider unavailable、timeout、ordinary AGY nonzero termination、および将来 canonical producer が生成する valid AGY operational failure を、taxonomy mirror / positive allowlist を作らず fallback 可能にしてください。
一方、少なくとも
request_schema_invalidrequest_policy_deniedgithub_research_command_deniedagy_invocation_policy_deniedagy_permission_deniedagy_permission_boundary_unavailableagy_permission_boundary_inconclusiveは small negative deny policy として fail-close にしてください。
explicitly_requiredは AGY failure 時に native fallback せず fail-close としてください。malformed wrapper result、non-AGY provider、schema/version mismatch、
okと failure state の contradiction、missing/type-invalid requirement 等も fail-close としてください。「unknown class だから」という理由だけで、canonical wrapper invocation から来た future valid AGY operational failure を fail-close にしてはいけません。
#2434 の reframe 方針
現在の Issue にある
route_actual_agy_wrapper_resultという名前または contract が「caller が arbitrary result JSON を production input として渡す」意味を持つなら、その名前・signature・説明を維持する必要はありません。実装可能性を優先し、たとえば production controller と internal pure projector/decision function の二層に整理してください。
production controller:
canonical request / requirement を受ける
→ private output path を確保
→ actual wrapper invocation
→ exact output readback
→ minimal projection
→ deterministic route decision
internal pure decision:
production controller が構築した projection を評価
→ AGY success continuation / native non-mutating fallback / fail-close を決定
という責務分離を Issue contract 上で明確にしてください。
ただし exact function name は repository の既存 naming / implementation conventions を調査した上で最適化して構いません。
AGY_ADVISORY_FALLBACK_ROUTE_DECISION_V1を維持する場合も、それが provider taxonomy の SSOT にならないようにしてください。Allowed Paths の扱い
第一選択は、現在の #2434 の Allowed Paths 内で解決することです。
特に routing helper 自身が
run_gemini_headless.pysubprocess invocation を所有する設計で解決できるなら、canonical producer file 自体を変更する必要はありません。repository evidence 上どうしても producer-side public interface の最小変更が必要であることを証明できた場合のみ、#2434 を分割せず in-place reframe し、必要最小限の producer file / focused test path を Allowed Paths に追加してください。この narrow Allowed Paths rewrite は本メッセージで明示的に許可します。
ただし security framework、permission broker、OAuth/keyring emulator、persistent permission baseline、taxonomy registry の大規模再設計等へ scope expansion してはいけません。
thin runtime smoke
actual-wrapper smoke は一つだけにしてください。
証明する経路は概ね、
canonical builder
→ test-only
AGY_BINfake→ actual
run_gemini_headless.py→ canonical
delegation_result/v1→ production invocation-owned routing entry point
→ deterministic route decision
→ real
codebase-investigator→ native non-mutating fallback sentinel
です。
実 OAuth、実 provider、実 network availability、credential/keyring/config mutation は不要です。
runtime unavailable の場合のみ canonical policy に従って exit 77 / SKIP を記録し、SKIP を PASS に変換しないでください。
tracked worktree status unchanged、mutating tool use なし、fake invocation evidence、actual wrapper output consumption、native fallback sentinel だけを必要な runtime claim にしてください。
smoke を複数追加したり、大型 harness を追加したりしないでください。
anchor finding disposition
anchor comment の P0/P1/P2 をすべて fresh Issue body に照合してください。
3-class positive allowlist は撤回済みであることを確認すること。
dual policy truth は撤回し
agy_investigation_requirementに一本化すること。wrapper full-schema duplicated validation は行わず minimal routing projection にすること。
future canonical
agy_*operational failure は unknown だけを理由に fail-close しないこと。actual-wrapper smoke は one thin integration smoke に限定すること。
#2155 を dependency / required design authority として残さないこと。reference-only としても不要なら削除してください。
stale text が別節、AC、Verification Commands、Notes、Machine-Readable Contract、Source 等に残っていないか全文検索してください。
SubAgent を使用すること
repository investigation、semantic design review、必要な Issue rewrite review には適切な SubAgent を使用してください。
少なくとも repository/canonical contract の独立確認と semantic design review は、利用可能な適切な SubAgent に委譲してください。
SubAgent には現在の Issue body SHA、調査対象、必要な canonical refs を明示してください。
SubAgent の self-report を blindly trust せず、返却結果を repository evidence / pinned artifact / canonical review artifact と照合してください。
起動した SubAgent は必ず完了を待ってから次の依存ステップへ進んでください。
background のまま最終回答してはいけません。
既存の別 Herdr tab、別 Claude Code session、人間が操作中の session へプロンプトを送ったり、そこで作業させたりしないでください。今回の current session から起動した bounded SubAgent のみを使ってください。
repository Stop Condition が nested delegation を禁止している場合、SubAgent にさらに SubAgent を起動させないでください。
review loop
fresh remote Issue readback から開始してください。以前の tmp candidate、古い semantic bundle、古い body SHA を現在値として再利用しないでください。
canonical preflight を fresh に実行してください。
deterministic/root review が approve でも、semantic review applicability が true ならそこで終了せず semantic review まで完了してください。
semantic review は canonical
semantic-design-reviewprocedure に従い、fresh body を pin し、issue-design reviewer の完了を待ち、その fresh result を transport してください。body SHA の
sha256:prefix 有無を独自推測で混在させず、canonical transport が要求する exact representation を使用し、freshness mismatch を発生させないでください。semantic review が blocker/high finding を返した場合は、自動的に semantic rewrite lane へ進み、finding の recommended fix と本 owner decision を Issue body に反映し、fresh preflight → fresh deterministic review → fresh semantic review を繰り返してください。
今回明示した「invocation-owned trusted boundary」を採用するかどうかについて人間へ再質問しないでください。これは既に owner decision 済みです。
requires_owner_choiceが同じ trusted-boundary 論点について再度出た場合も、このメッセージを owner choice として consume し、contract を具体化して fresh review を続行してください。最大 iteration に達する前に no-progress を検出した場合は、同じ文章の言い換えを繰り返さず、semantic finding が要求する実装可能な interface / trust boundary / validation order が AC と In Scope に具体化されているかを確認してください。
本メッセージで決めていない、本当に別の不可逆・scope-changing owner decision が新たに必要になった場合だけ Stop Condition としてください。
terminal condition
以下をすべて満たすまで refinement 完了として扱わないでください。
fresh preflight: pass / proceed
fresh deterministic/root review: approve
fresh semantic review: clear / approve 相当で、open blocker/high finding がない
join/effective verdict: approve / implementation-ready 相当
Issue body SHA と各 review artifact の binding が fresh
anchor comment の P0/P1/P2 disposition がすべて説明可能
unresolved blocker がない
SubAgent がすべて完了している
最終報告
最後に簡潔に、
refinement の最終 verdict
最終 body SHA
Issue #2434 をどう reframe したか
semantic blocker をどう解消したか
anchor P0/P1/P2 各 finding の disposition
preflight / deterministic review / semantic review の最終結果
SubAgent の完了状況
最終 Issue URL
を報告してください。
Issue #2434:
#2434
このプロンプトのポイントは、「semantic reviewer を無視して approve 扱いにする」のではなく、reviewer が要求している trusted boundary を、現在の small-denylist 方針を壊さない形で実装可能な契約に変えることです。これなら #2434 のまま terminal approve を目指せる可能性が高いです。
squne121 commentedon Aug 30, 2026
確認した限り、#2434 は現在の Issue 本文を SSOT として、そのまま
impl-review-loopに入れるのが推奨です。旧 adversarial review の P0/P1 はすでに本文へかなり詳細に織り込まれており、AC1〜AC11、Verification Commands、Allowed Paths、Stop Conditions まで固定されています。特に、producer-ownedagy_failure_kind/agy_invocation_attempted、actual-wrapper smoke 1本、旧 smoke 削除、build_request.py非変更、productionAGY_BINstrip などが明文化されています。また
impl-review-loop自体が、implementation-worker → test-runner → pr-reviewer → judgmentを SubAgent で回し、APPROVEと live mergeability が揃った時点でdraft_pr_readyとして終了し、マージ判断は人間に残す設計です。SubAgent の単なるhuman_review_required: true自己申告は原則停止権限を持たず、正式なHUMAN_REVIEW_REQUIREDverdict、secret gate、実 Git conflict などが真の停止条件です。したがって、旧レビューコメントを直接仕様として再解釈せず、実行開始時に live Issue を再取得し、current-run contract review を通して現在本文を正本にするのが重要です。旧コメントでは reframe が要求されていましたが、現在本文はその後更新されています。
以下を Claude-GPT にそのまま渡すのを推奨します。
対象リポジトリ:
https://github.com/squne121/loop-protocol
対象 Issue:
#2434
Issue #2434 を対象に、repository-native の
impl-review-loopを実行してください。目的は、現在の live Issue contract を正本として、
実装
→ 独立検証
→ PR 作成
→ PR review
→ review finding 修正
→ 再検証
→ current-head 再レビュー
→ CI / live mergeability 確認
を自律的に反復し、マージ操作そのものを行う直前の
draft_pr_ready/ approved 状態まで、人間の途中承認なしで到達することです。Owner authorization
これは repository owner からの明示的な実行承認です。
以下の通常作業について、追加の人間承認を求めず実行してください。
impl-review-loopの canonical root-owned synchronous entry transitionCloses #2434の設定update_branchimpl-review-loopが通常の mechanical operation として定義しているその他の bounded actionこれらについて「実行してよいですか」「PRを作ってよいですか」「pushしてよいですか」「修正してよいですか」と逐次確認しないでください。
ユーザーの目的は、マージ直前まで unattended で完走させることです。
ただし、この承認は Issue contract や repository policy を無視する権限ではありません。
Semantic authority
開始時に必ず live Issue #2434 を再取得してください。
現在の live Issue 本文を semantic SSOT としてください。
過去の Issue コメント、旧 contract snapshot、過去の adversarial review、以前の planning output は historical context / evidence として利用できますが、現在の Issue 本文と矛盾する場合は 現在本文を優先してください。
特に、過去コメントにあった旧設計をそのまま復活させないでください。
現在の Issue が固定している以下の設計を維持してください。
AGY_ADVISORY_INVOCATION_REQUEST_V1AGY_BINを stripagy_failure_kindagy_invocation_attemptedcanonical_agy_failure_kind(...)--context-fileserializationbuild_request.pyを変更しないCODEBASE_INVESTIGATION_RESULT_V1を変更しないIssue の Acceptance Criteria、Allowed Paths、Out of Scope、Stop Conditions を literal に確認し、それらを implementation contract としてください。
Entry procedure
.claude/skills/impl-review-loop/SKILL.mdと、その参照先の current repository version を読んでください。独自の簡略化ループを作らず、repository-native
impl-review-loopを使用してください。開始時には canonical な root-owned synchronous entry transition を実行してください。
すなわち、同一の継続した root invocation 内で、
issue-contract-reviewまで実施してください。
古い snapshot、過去コメント、以前の authorization packet、artifact、digest だけを Step 1 authorization として使わないでください。
現在 Issue の label や過去の report を人間の承認要求へ短絡させず、canonical current-run routing を正本にしてください。
SubAgent requirement
この作業では SubAgent を実際に使用してください。
少なくとも repository workflow が定義する、
implementation-workertest-runnerpr-reviewerを canonical な役割で使用してください。
root/main thread が worker / verifier / reviewer の仕事を肩代わりしないでください。
各 SubAgent の dispatch では placeholder を残さず、
などを具体値へ materialize して渡してください。
非同期放置禁止
SubAgent を fire-and-forget にしないでください。
SubAgent を起動したら、その SubAgent の canonical completion/result が返るまで待ってください。
完了を待たずに同じ責務を root が並行実行したり、次ステップへ進んだりしないでください。
複数 SubAgent を並列化できる場合でも、依存関係を壊さない独立作業だけに限定し、spawn した全 SubAgent の完了を回収してから routing 判断してください。
nested SubAgent delegation が Issue #2434 の Stop Condition に該当する場合は、worker 自身からさらに nested delegation させないでください。必要な top-level SubAgent orchestration は root
impl-review-loopが担ってください。Implementation loop
canonical loop を次の通り完走してください。
Step 1 — Implementation
implementation-workerにimplement-issueを実行させてください。Issue #2434 の現在の Allowed Paths を厳守してください。
まず existing implementation / tests / related assets を読み、Issue contract に対する最小かつ一貫した変更を実装してください。
不要な harness、sandbox、permission broker、OAuth emulator、credential fixture、第二の smoke、taxonomy mirror、generic framework を増やさないでください。
変更後は必要な focused verification を実施し、PR がなければ作成してください。
PR body に Issue の契約・検証結果を反映し、
Closes #2434を含めてください。
Step 2 — Verification
test-runnerに独立検証させてください。Issue #2434 の Verification Commands を literal に確認し、current head に対して実行してください。
特に AC8 の runtime verification は Issue の指定通り扱ってください。
proposal_onlydriverAGY_BINfakerun_gemini_headless.pyagy_failure_kindagy_invocation_attemptedを証明してください。
Issue の規定通り、exit 77 / SKIP を PASS へ昇格させないでください。
real OAuth、real provider availability、credential/keyring/config mutation は行わないでください。
Verification Commands 以外にも、変更したコードに対して repository 標準の必要十分な regression gate がある場合は実行してください。
Step 4 — PR Review
current-head verification gate が通った後だけ
pr-reviewerを起動してください。reviewer は current PR head をレビューし、canonical
LOOP_VERDICTを返してください。review 対象には少なくとも、
build_request.pynon-changeCODEBASE_INVESTIGATION_RESULT_V1non-changeを含めてください。
Step 5 — Judgment
review verdict と live GitHub mergeability を repository の
route_loop_verdict_v2()で評価してください。REQUEST_CHANGES
REQUEST_CHANGESの場合は停止せず、fix_deltaに materializeimplementation-workerに修正委譲まで続けてください。
stale review
reviewed_head_shaが current head と異なる場合、人間を呼ばず current head で re-review してください。BEHIND
repository-defined routing が
route_to_update_branchを返した場合、mechanicalupdate_branchをimplementation-workerへ委譲し、完了を待ってから verification と PR review を再実行してください。transient / deferred mergeability
UNKNOWN、required-CI propagation、BLOCKED/UNSTABLE等について repository workflow が bounded retry / CI evaluator へ委ねるよう定義している場合、すぐ人間へ escalation しないでください。current-head factsを再取得して repository-defined routing を続けてください。
Permission / approval handling
SubAgent が単に
human_review_required: trueを返しただけでは停止しないでください。
repository の現行
impl-review-loopcontract に従い、それは warning/evidence として扱い、正式な hard gate でない限りループを継続してください。「慎重のため」「semanticに見える」「artifactがない」「snapshotが古い」「overlapがある」「確認した方が安全」といった理由だけで人間承認を要求しないでください。
routine な implementation / test / review / PR hygiene / update-branch / CI retry は、このプロンプトによって事前承認されています。
ツール側で通常操作に approval prompt が発生し、repository policy 上 auto execution が許可される操作である場合は、この owner authorization を根拠に canonical permitted lane を使用してください。
permission prompt の回避だけを目的に unauthorized alternate path、手動 force operation、別 runtime、別 credential source へ fallback しないでください。
Genuine stop conditions
以下の場合のみ停止し、具体的な evidence と必要な owner decision を報告してください。
HUMAN_REVIEW_REQUIREDverdict を返し、repository routing がroute_human_escalationを要求「念のため確認」は停止理由ではありません。
Explicitly prohibited actions
以下は実行しないでください。
gh pr mergebuild_request.pyの変更CODEBASE_INVESTIGATION_RESULT_V1の変更Review-fix policy
レビューで blocker が見つかった場合、ユーザーへ修正許可を聞かず、自動修正してください。
修正 → tests → push → current-head verification → re-review を繰り返してください。
ただし review finding が current Issue contract 自体の変更を要求している場合は、実装で contract を勝手に書き換えて解決せず Genuine stop condition としてください。
reviewer の stylistic preference や speculative overengineering は、そのまま blocker とせず Issue contract / regression / repository facts に照らして判断してください。
Completion target
次の状態まで自律的に進めてください。
APPROVEblockers == []approvedroute 条件を満たすCloses #2434を持つimpl-review-loopがdraft_pr_ready/termination_reason: approved相当で終了するここまで到達したら 停止してください。マージは実行しないでください。
Final report
最後に、簡潔に以下を報告してください。
Closes #2434の有無IMPL_REVIEW_LOOP_RESULT_V1/ termination reason途中経過のために人間の返信を待たず、上記の genuine stop condition が発生しない限り、SubAgent の完了を同期的に待ちながらループを継続してください。
特に重要なのは、「approval-less」を
impl-review-loopの安全境界を無効化する意味にしないことです。現在の skill は、単なる SubAgent の自己申告や transient mergeability では止まらず、正式な reviewer verdict・実 conflict・secret gate 等だけを hard stop にする設計なので、その既存機構をそのまま利用する方が今回の目的に合っています。また、#2434 は Allowed Paths を10ファイルに限定し、single actual-wrapper smoke と旧 smoke 削除まで明示しています。このため 実装中に「より一般的なハーネスを作ろう」「別 Issue に分けよう」と膨らませないこともプロンプトで強く固定しています。
squne121 commentedon Aug 30, 2026
root-owned entry router audit
route: invoke_impl_review_loop
reason: fresh_review_go_live_equality
test: cover AGY advisory fallback boundaries (#2434)
fix: preserve AGY fallback smoke immutability (#2434)
fix: isolate AGY smoke controller execution (#2434)
fix: wire AGY legacy ingress and bounds (#2434)
test: preserve controller-owned AGY smoke boundary (#2434)
fix: remove obsolete Graphify fallback route (#2434)
15 remaining items
fix: preserve global investigator compatibility (#2434)
fix: restore global investigator routing (#2434)
fix: require bare native JSON result output (#2434)
fix: mark github AGY execution attempts (#2434)
test: assert direct AGY attempt boundary (#2434)
test: strengthen AGY invocation timing coverage (#2434)
squne121 commentedon Sep 1, 2026
root-owned entry router audit
route: invoke_impl_review_loop
reason: fresh_review_go_live_equality
fix: fail closed when bwrap does not reach AGY (#2434)
fix: prove bwrap child invocation before fallback (#2434)
fix: preserve AGY attempt proof on bwrap timeout (#2434)
test: align bwrap argv fixture (#2434)
fix: require bwrap child proof for GitHub AGY (#2434)
fix: make grounded_research argv tests hermetic against host bwrap st…
feat: add controller-owned AGY advisory fallback (#2459)