Repository navigation
Description
Summary
PR #2749 で、current-head review / live verification 済みの HEAD 5457a88... に対して main を取り込んだ結果、PR-owned の変更3ファイル自体は不変のまま HEAD が 9ce36ee... へ移動し、impl-review-loop の current-head binding が stale になった。
現行契約ではこれは意図どおりであり、route_stale_head_rereview と VC current-head binding に従って verification / PR review を再実行する必要がある。一方、頻繁に main を追随する運用では、PR差分に無関係な base-only drift でも高価な live verification が繰り返され、bounded loop の iteration 消費・Claude CLI 実行コスト・手戻りが増える可能性がある。
本 Issue は current-head authority を弱めずに、この再実行コストを安全に削減できる条件が存在するかを調査する。
Trigger / Evidence
- PR fix: 完了済み structured runtime-smoke の post-session statusLine を not_applicable として扱う #2749 target comment: fix: 完了済み structured runtime-smoke の post-session statusLine を not_applicable として扱う #2749 (comment)
- reviewed/live-verified HEAD:
5457a88a5beaf610d213786a2a381c0fd8c43ff1 - current PR HEAD after main integration:
9ce36ee8a28227fac9035b402489321e88695ada - PR-owned changed files remain:
scripts/task-context/task_context_runtime_smoke_verifier.pytests/task-context/test_runtime_smoke_verifier.pytests/task-context/test_runtime_smoke_verifier_live_shadow_isolation.py
- HEAD drift between the prior verification target and current PR HEAD was reported as unrelated
agent-retrospectivechanges from main.
Existing Contracts to Preserve
- 実装: impl-review-loop の終了条件を APPROVE && merge_ready && required_auto_actions == [] に統一し終了 gate を実装する #632:
update_branchchanges HEAD and therefore verification + PR review are rerun. - 実装: impl-review-loop の runtime_only VC adjudication を current-head evidence に安全に接続する #2467: runtime-only VC adjudication requires current-head independent binding and stale binding fails closed.
- 導入: AIエージェント運用をminimal harnessへ縮退し、過剰なcontrol-planeを廃止する #1860: live Issue/PR, actual diff, tests, current-head CI, and independent review remain authority.
- 実装: SHA-bound evidence index と command fingerprint budget で再読・重複調査・wait polling による context churn を抑制する #2052 explicitly does not cache/suppress tests, CI, current-head checks, or review decisions.
This Issue must not weaken those guarantees by simply accepting a stale SHA-bound verdict.
Existing Partial Mechanism / Narrowed Gap
Issue #2102 already implements route_scope_clean_reconciliation for main drift and selectively invalidates/rebinds base-bound snapshot / CI / review evidence without spending the ordinary implementation iteration budget. That mechanism is a required precedent and must be reused rather than reimplemented.
The remaining question in this Issue is narrower:
VC_ADJUDICATION_RESULT_V1/ Step 4 current-head gating binds verification evidence tohead_sha.update_branchis explicitly specified by 実装: impl-review-loop の終了条件を APPROVE && merge_ready && required_auto_actions == [] に統一し終了 gate を実装する #632 to rerun verification + PR review because HEAD changes.- A fresh impl-review-loop invocation against an existing PR also cannot simply reuse a verification result from the previous HEAD.
- Therefore 実装: issue-refinement-loop / impl-review-loop の main drift を自動再束縛・scope-clean reconciliation する #2102's scope-clean reconciliation can reduce base-bound evidence churn, but does not by itself prove that an expensive live/runtime VC result is reusable across a base-only PR HEAD change.
This Issue must investigate only that integration boundary. Any implementation should extend or compose with #2102 rather than adding a parallel drift/reconciliation framework.
Goal
Determine whether a narrow, deterministic fast path can distinguish:
- review staleness — current HEAD must always be reviewed again; from
- verification invalidation — expensive VC/live verification must be rerun only when its actual semantic inputs changed,
while keeping full rerun as the fail-closed default.
Investigation Scope
- Characterize
update_branch/ main integration cases where:- PR patch/diff is unchanged,
- PR-owned files are unchanged,
- verification commands are unchanged,
- but commit SHA changes only because base history advanced.
- Inventory current
VC_ADJUDICATION_RESULT_V1binding inputs and identify which inputs are safety-critical versus conservative identity-only coupling. - Evaluate whether a content/tree/dependency-closure fingerprint can prove verification-input equivalence across two HEADs without trusting agent self-report.
- Evaluate whether current-head PR review can be rerun while selectively reusing a prior expensive verification result only when equivalence is deterministically proven.
- Treat runtime/integration/live-Claude verification as non-reusable unless the investigation can prove that all relevant runtime inputs are unchanged.
- Measure the proposed rule against PR fix: 完了済み structured runtime-smoke の post-session statusLine を not_applicable として扱う #2749 as a concrete case.
Safety / Non-Goals
- Do not bypass current-head PR review.
- Do not reuse a prior verification result merely because PR changed filenames or textual patch look unchanged.
- Do not replace current-head CI with cached CI.
- Do not introduce TTL-based trust, agent self-attested equivalence, or a broad generic command cache.
- Do not change PR fix: 完了済み structured runtime-smoke の post-session statusLine を not_applicable として扱う #2749's current execution path; that PR should complete the existing full current-head verification/review contract independently of this investigation.
Acceptance Criteria
- AC1: current
route_stale_head_rereview, 実装: impl-review-loop の終了条件を APPROVE && merge_ready && required_auto_actions == [] に統一し終了 gate を実装する #632 update-branch rerun behavior, and 実装: impl-review-loop の runtime_only VC adjudication を current-head evidence に安全に接続する #2467 current-head VC binding are documented with exact producer/consumer paths. - AC2: at least the PR fix: 完了済み structured runtime-smoke の post-session statusLine を not_applicable として扱う #2749 case is reconstructed and classified as either safely optimizable or necessarily full-rerun, with evidence.
- AC3: any proposed fast path defines deterministic equivalence inputs and a fail-closed fallback to full verification.
- AC4: the proposal explicitly preserves current-head independent PR review and current-head CI authority.
- AC5: runtime/live verification reuse is either rejected or backed by a concrete dependency/input equivalence proof; no assumption-only reuse.
- AC6: existing 実装: SHA-bound evidence index と command fingerprint budget で再読・重複調査・wait polling による context churn を抑制する #2052 cache boundaries are respected; no generic cross-head command cache is introduced.
- AC7: conclude with one of:
implement_narrow_fast_path,keep_full_rerun, orsplit_followup, with rationale and bounded implementation scope if applicable.
Likely Relevant Files
.claude/skills/impl-review-loop/SKILL.md.claude/skills/impl-review-loop/steps/step-5-mergeability-handling.md.claude/skills/impl-review-loop/steps/step-5-feedback-and-termination.md.claude/skills/impl-review-loop/scripts/route_loop_verdict_v2.py.claude/skills/impl-review-loop/scripts/adjudicate_vc_result.py- related tests under
.claude/skills/impl-review-loop/tests/
Notes
This is an optimization/reliability investigation, not a blocker for PR #2749. Until a safe rule is implemented and reviewed, current behavior remains authoritative: changed HEAD => current-head verification/review according to the existing loop contract.
Activity
[-]調査: impl-review-loop の base-only HEAD drift で current-head verification 全再実行が必要になるコストを安全に削減できるか[/-][+]調査: #2102 scope-clean reconciliation と VC current-head binding の間で base-only HEAD drift 時の live verification 再実行を最小化できるか[/+]