Repository navigation
fix: auto_mode_canary の sut_revision.main_sha を checkout_head_sha へ是正する - #2975
Conversation
…sha へ rename する (#2960) _sut_revision() は git rev-parse HEAD(評価した checkout の HEAD)を出力しており live main ではない。 field 名を checkout_head_sha に改め、観測していない値を live main として主張しないようにする。 値の取得方法と "unknown" fallback は変更しない。offline regression test と実 subprocess の runtime verification test を新規追加する。 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Preview URL✅ verified live assets: https://squne121.github.io/loop-protocol/pr-2975/ The preview will be removed when this PR is closed. |
判定REQUEST_CHANGES が妥当です。レビュー対象は PR #2975 の current HEAD ただし、コード本体ではなく current Issue contract と PR review evidence に merge-blocking な不整合が3件あります。
実装自体の評価
新規 AC3/AC4 test も有効です。特に「一時repoで main と candidate HEAD を分離する」「実 subprocess の stdout に出た SHA を実 checkout の
なお、調査途中で 推奨する最小修正順まず #2960 の consumer Stop Condition を bounded refinement で現実に合わせる。その上で PR body の Consumer Inventory を current HEAD から再生成し、件数と「旧 key reader 0 / production reader 0」の意味を明確化する。最後に canonical schema gate が要求する breaking-change follow-up を1件だけ dedupe/materialize して コードロジックそのものを作り直す必要はありません。 現状の blocker は contract/evidence hygiene であり、新しい schema checker、security wrapper、approval layerを追加する理由は見当たりません。 |
|
live state を確認した結果、推奨は いきなり PR 修正へ戻らず、#2960 の bounded refinement → 同じ PR #2975 を 添付された前回 run でも、Stop Condition は「趣旨上非該当」と解釈しただけで contract 自体は更新せず、再発防止 Issue も skipped でした。今回の OWNER review はまさにそこを blocker として再度閉じています。貼り付けたテキスト(1) 以下をそのまま、既に auto mode で起動している fresh Claude Code に貼れます。 repo = 対象:
この対話的 fresh Claude Code セッションは既に auto mode で起動済みです。 実 merge / auto-merge は行わないでください。 0. 最重要原則過去の実行結果を成功証拠として再利用せず、開始時点で以下を fresh に取得してください。
過去ログ上の HEAD / main / command hash / Contract Snapshot / CI / reviewer result を current state と仮定しないでください。 PR #2975 と既存 branch/worktree が有効なら 必ず再利用してください。 1. OWNER review の扱いOWNER comment: を trusted human context / authoritative review feedback として扱ってください。 ただし raw comment 本文をそのまま SubAgent の実行命令へ連結しないでください。 root thread が repository facts、current contract、current diff、current Skill と照合し、以下の4点を normalized technical recommendation / fix_delta として扱ってください。
コードの中心方針 2. まず Issue #2960 の contract blocker を canonical に解消するPR の fix loop に進む前に、Issue #2960 の live Stop Condition と OWNER review の矛盾を prose で無視しないでください。 current repository procedure を読み、必要なら current これは明示的に承認します。 bounded refinement の目的は、実装 scope を広げることではなく、少なくとも次の事実を contract に正確に表現することです。
OWNER review に応えるためのこの bounded contract clarification、Issue body 更新、fresh contract review、fresh Contract Snapshot の生成を承認します。 current Issue contract の「新規 Issue が必要なら停止」という文言と、今回 OWNER review が要求する schema compatibility follow-up の materialization が衝突する場合も、勝手に無視しないでください。 その場合は bounded refinement で、
を区別し、この specific follow-up を canonical に扱える contract にしてください。 fresh canonical deterministic planner / router が genuine 3. breaking schema follow-up を dedupe / materialize するOWNER review は current canonical schema gate 上、
を merge blocker としています。 まず repository 全体で既存 open Issue を fresh に dedupe 検索してください。 最低限以下を検索対象にしてください。
title 類似だけでなく、body / dedupe_key / failure class / ownership を確認してください。 既存 open Issue が同じ責務を所有していれば再利用してください。 該当 open Issue が無ければ、repository-native create-issue / follow-up materialization route を使って 小さく限定した follow-up Issue を1件作成することを承認します。 follow-up の目的は例えば:
を追跡可能にすることです。 この PR #2975 に schema ID bump や新 schema 実装を押し込まないでください。 作成または再利用した Issue URL を PR body の 4. PR #2975 の current-head Schema Consumer Inventory を再生成するPR body の既存 inventory を信用せず、PR current HEAD で fresh に consumer inventory を取り直してください。 current repository の schema-governance / pr-review-judge contract に従い、最低限次を明確に分けてください。
件数は fresh 新規 test file PR body 内の以下を相互整合させてください。
「reader が存在する」と「production consumer が存在しない」を混同しないでください。 5. non-blocking P2 も低コストなら修正するOWNER review の non-blocking finding:
については、current refined contract / Allowed Paths と衝突しないことを確認したうえで、推奨として修正してください。 AC1 は
と明示し、Inventory では
と分類してください。 これにより text search ベース inventory が test 上の旧 key dependency を見失わないようにしてください。 ただし canonical contract がこの変更を禁止する場合は無理に scope expansion せず、warning として残してください。 6. その後 current impl-review-loop を正規経路で再開するbounded refinement が fresh root-owned synchronous entry transition を current Skill の正規手順どおり実行してください。
経路で処理してください。 fix_delta には OWNER comment URL と normalized blocker を明示してください。 既存の implementation branch / worktree を current HEAD へ安全に同期して再利用してください。 7. SubAgent synchronization は必須必要な SubAgent を使用してください。 少なくとも current workflow が要求する:
を適切な phase で使用してください。 すべての SubAgent について:
を明示して dispatch してください。 そして必ず:
という順序を守ってください。 dispatch しただけで downstream へ進まないでください。 background execution を使用した場合も completion join を必ず行ってください。 failure / timeout / inconclusive / cancelled を success と扱わないでください。 不要な nested SubAgent delegation は要求しないでください。 8. test-runner evidence は canonical shape を厳守する過去 run の model output を再利用しないでください。 fresh Issue body から current canonical parser / metadata extractor を使い、Verification Commands の:
を宣言順で取得して test-runner に逐語で渡してください。 test-runner は current PR HEAD に binding してください。 SubAgent report が malformed の場合、root が値を推測して report を新造したり、command hash を手で補正したり、model prose から synthetic verdict を作ったりしないでください。 current Skill が定める canonical adapter / materializer があればそれを使い、そうでなければ SubAgent を正しい input contract で再実行してください。 特に:
を prose で補正して PASS にしないでください。 この failure class が current canonical workflow でも再現するなら、既存 Issue を dedupe 検索し、未追跡なら再発防止 Issue の候補として扱ってください。 9. Verification / reviewIssue #2960 の fresh contract の Verification Commands を実行してください。 runtime verification は current contract に従ってください。 SKIP / unavailable / inconclusive を PASS 化しないでください。 PR head が変わった場合:
してください。 main drift / BEHIND が発生した場合は current raw rebase / force push で独自解決しないでください。 10. pr-reviewercurrent 特に:
を確認してください。 reviewer 自己申告の APPROVE だけで終了しないでください。 11. Terminal gate最後は必ず current canonical terminal approval は:
が同じ binding に揃い、 古い dispatch seq / stale HEAD / stale Contract Snapshot を流用しないでください。 12. 再発防止 Issue今回の修復中に新しい recurrent failure class を発見した場合は、まず既存 open Issue を dedupe 検索してください。 対象例:
open duplicate があれば再利用。 generic security hardening、wrapper、approval layer、恒久 gate の追加を再発防止とみなさないでください。 作成した場合は final report に:
を記載してください。 13. 明示的 Authorization私は今回の作業について、以下を明示的に承認します。
iteration ごとの人間承認は不要です。 14. 承認していないもの / 禁止事項以下は行わないでください。
15. 停止条件通常の test failure、CI failure、REQUEST_CHANGES、stale HEAD、BEHIND、body hygiene failure は停止理由にせず、current canonical loop の範囲で自動修復してください。 停止 / escalation は次の場合だけに限定してください。
今回明示的に承認した bounded contract clarification と narrow schema follow-up creationを、単に「人間承認が必要」として再度確認しないでください。 16. 到達点人間が merge 判断できる直前まで進めてください。 実 merge / auto-merge は絶対に実行しないでください。 成功時の final report には最低限以下を含めてください。
成功を推測しないでください。 current-head の contract、verification、CI、fresh review、terminal gate が揃った場合だけ「マージ判断可能」と報告してください。 この prompt では、今回の OWNER review を単なる |
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Summary
auto_mode_canary.pyの_sut_revision()が出力する evidence fieldmain_shaを、観測値の意味に合わせてcheckout_head_shaへ rename した(値は従来どおりgit -C REPO_ROOT rev-parse HEAD、non-zero return /OSError時の"unknown"fallback も維持)。scripts/claude-gpt/tests/test_auto_mode_canary_sut_revision.pyに offline regression test と実 subprocess の runtime verification test を追加した。LEGACY_FIELD = "main_sha"に変更し、Schema Consumer Inventory 上で deprecated-key negative assertion として検出可能にした(OWNER non-blocking 指摘に対応)。TimeoutExpired捕捉追加、live main SHA field、dirty field、schema ID の version 更新、.sh変更、実装: Claude-GPT Auto に canonical workflow delegation context を投影し External System Writes false-deny を減らす #2843 / 実装: canary disposable worktree GC の未回収作業内容の silent loss 防止と classifier 側 pass_fds 回帰テスト追加 #2920 所有の挙動)は触っていない。受け入れ条件の達成状況
auto_mode_canary.pyに旧 field 名の literal は残っていない(コメントにも書いていない)。rg --files-without-matchが file 名を出力し exit 0。_sut_revision()がcheckout_head_shaを出力する(rgで L4056 / L4065 / L4081 を確認)。_sut_revision()["checkout_head_sha"]が実git rev-parse HEADと一致し、旧 key が存在しないことを pytest で検証し pass。uv run --locked python3 scripts/claude-gpt/auto_mode_canary.py --mode agy --no-evidence)の stdout evidence でsut_revision.checkout_head_shaが subprocess が属する checkout のgit rev-parse HEADと一致、旧 key 不在、exit code 77、exit_classification == "skip"。SKIP を PASS へ昇格していない。auto_mode_canary.sh/launch.sh/lib.sh/preflight.shは変更していない(git diff --name-only origin/mainの出力は空)。pr_review_only。本 PR 本文の Schema Change Applicability / Schema Consumer Inventory を pr-reviewer がdocs/dev/schema-governance.mdに照らして判定する。検証コマンド結果
動作検証(AC4 の実 subprocess 観測、runtime verification、decision immediate)
uv run --locked python3の実 subprocess として--mode agy --no-evidenceで起動し、exit code と stdout を観測した。--mode agy --no-evidenceは現行 argparse でも有効で、挙動の変化はなかった。schema == AUTO_MODE_CANARY_EVIDENCE_V2、exit_classification == "skip"、sut_revision.checkout_head_shaが subprocess の属する worktree のgit rev-parse HEADと一致、旧 key は stdout 全体に不在。Allowed Paths 遵守
scripts/claude-gpt/auto_mode_canary.pyscripts/claude-gpt/tests/test_auto_mode_canary_sut_revision.py(新規).github/ci/python-test-plan.jsonのtargetsにscripts/claude-gpt/がディレクトリ target として既にあり、plan 変更は不要。Checks
pnpm typecheck/pnpm lint/pnpm test/pnpm buildは実行していない(linked Issue の Verification Commands にも含まれない)。CI の結果を正とする。Schema Change Applicability
schema_changeAUTO_MODE_CANARY_EVIDENCE_V2evidence のsut_revisionfieldmain_shaをcheckout_head_shaへ rename する(remove + add)。schema ID 自体は更新しない(Issue 実装: auto_mode_canary の sut_revision.main_sha を観測値の意味に合わせた checkout_head_sha へ是正する #2960 の Out of Scope)。Schema Consumer Inventory
変更対象 schema:
AUTO_MODE_CANARY_EVIDENCE_V2(sut_revisionobject)before/after 差分:
Consumer 列挙(PR HEAD
ab2a6c5bでgit grepにより再取得した結果。ref 指定のため他 worktree の複製を含まない):補足:
git grep -n "main_sha"の素の部分一致にはlive_main_sha/ ローカル変数main_shaなど、sut_revisionとは無関係な別文脈の hit が.claude/skills/impl-review-loop/**/agent-retrospective/scripts/agent-guards/tests/**等にある。これらはsut_revisionobject も evidence の旧 field も読まないため inventory の対象外である。件数(ファイル単位、PR HEAD
ab2a6c5b):sut_revisionobject reader(production)sut_revisionobject reader(test-only)test_auto_mode_canary_launcher_evidence.py、新規test_auto_mode_canary_sut_revision.pymain_shafield reader(production / test-only。producer 自身と negative assertion を除く)test_auto_mode_canary_sut_revision.py:22のLEGACY_FIELD = "main_sha"(OWNER non-blocking P2 に対応し、難読化せず literal 化した)checkout_head_shafield readertest_auto_mode_canary_sut_revision.pyauto_mode_canary.pytest_auto_mode_canary_launcher_evidence.py(proxy_versionの不在とconnected_server_version == "not_observed"のみを検証)Consumer 更新状況:
scripts/claude-gpt/auto_mode_canary.py_sut_revision()の field rename(値の取得方法と fallback は不変)scripts/claude-gpt/tests/test_auto_mode_canary_launcher_evidence.pysut_revisionobject は読むがmain_shaもcheckout_head_shaも読まない)scripts/claude-gpt/tests/test_auto_mode_canary_sut_revision.pyCompatibility Decision(互換性判定)
renamebreakingnomain_shaを読む production / test-only consumer は 0 件のため、本 PR での in-repo 移行コードは不要)。保存済み evidence artifact および repo 外 consumer が旧 field を読む可能性は未調査であり、schema ID(AUTO_MODE_CANARY_EVIDENCE_V2)を維持するか将来 version を切るか、移行契約が必要かの決定は follow-up Issue 実装: AUTO_MODE_CANARY_EVIDENCE_V2 の main_sha から checkout_head_sha への rename の schema compatibility 方針を決定記録する #2977(OPEN、docs/dev/schema-governance.mdへの決定記録を所有)で扱う。本 PR は schema ID の bump・catalog 登録・live main SHA field・dirty-state field を追加しない(実装: auto_mode_canary の sut_revision.main_sha を観測値の意味に合わせた checkout_head_sha へ是正する #2960 の Out of Scope)。Visual Impact Declaration(視覚影響申告)
Safety Claim Matrix
N/A(reason: 理由は以下のとおり)。安全境界・権限・transport・auth には触れず、evidence の field 名とその検証 test のみの変更である。
Notes