Repository navigation
fix: performance close-grade materializer をtopology-aware実装に修正しmonolith armのeligible run生成を可能にする - #2575
Conversation
…th armのeligible run生成を可能にする (#2554) production の Performance close-grade materialization path (run_evidence_gate() / _pair_by_workflow_run_id() / provider post-filter sample count / percentile・assessment input / build_close_grade_receipt() / _materialize_close_grade_arm()) が manifest topology (monolith / split) を無視しており、monolith arm が 構造的に performance_eligible_workflow_run_ids == [] になる gap が #2155 の44-run本番experimentのhard blockerだった。 新設した共通helper _layout_aware_provider_baselines() が、呼び出し側 から渡される明示的な topology tag (monolith / split -- baseline内容 からの自動推定はしない) に基づき、monolith runでは同一の e2e-core baselineをcore/responsive両レーンへ渡すことで既存の _pair_by_workflow_run_id() / _provider_critical_path_paired_p50_p95() / _materialize_close_grade_arm() のシグネチャ・2-sided pair不変条件 を変更せずにself-pairingさせ、test_e2e_ci + test_e2e_monolith_ responsiveの合計を一度だけ観測値として使う。splitはmax(core, responsive)のまま変更なし。 run_evidence_gate()とbuild_close_grade_receipt()の両方をこの共通 helperへ収束させ、sample count・percentile/assessment input・ run-details・close-grade receipt eligibilityがすべて同一の layout-aware観測を消費するようにした。 Co-Authored-By: Claude Sonnet 5 <[email protected]>
Preview URL✅ verified live assets: https://squne121.github.io/loop-protocol/pr-2575/ The preview will be removed when this PR is closed. |
impl-review-loop verdict (iteration 0)Mergeability: Evidence Check:
Blockers: []
verdict: APPROVE
reviewed_head_sha: "72d1c730fce209bd8c820866971a137ee567b980"
blockers: []
warnings:
- "PR is Draft; not merging per operator instruction."
- "Non-required check ci-verdict-summary failed with overall_status=gh_error (transient); required_status_checks all SUCCESS." |
判定REQUEST_CHANGES。P1 の merge blocker を1件だけ修正すれば、承認寄りです。 PR #2575 の中心設計――monolith では同一 ただし、monolith を eligible にする新しい成功経路が、monolith の Performance observation 自体が完全であることを確認していません。 Severity | Finding | Disposition -- | -- | -- P1 / merge blocker | monolith e2e-core に必要な2 phaseの片方が欠けても、self-pairによって有効な Performance sample / eligible run として通る | このPRで修正推奨 P2 | monolith に予期せぬ responsive_baselines が入っても捨ててしまい、topology contamination を診断しない | 非blocking。#2155 blocks=1 smokeで観測されるなら別途修正P1 — partial monolith timing evidence が valid sample になるrefined #2554 の前提では、monolith の物理 provider は
を一度だけ合計したものが1 runの Performance observation です。 実 workflow もその形になっています。通常 E2E を ところが現在の さらに #2575 では monolith に対して、 という self-pair を作ります。 したがって例えば、本来 である run が、何らかの evidence collection 異常で responsive phase を欠き、 だけになっていても、120 sec の valid monolith sample として数えられます。 そして close-grade materializer は provider pair・fingerprint・gate-ready evidence は検査しますが、provider baseline の required phase completeness は検査しません。そのため、その run は 特に問題なのは、新規 fixture generator が常に両 phase を入れているため、この反例を現在の AC1〜AC6 が一切踏んでいない点です。 最小修正大きな abstraction や schema は不要です。この PR の思想のまま局所修正できます。
これなら #2575 が狙っている sample-count / assessment / receipt の同一 materialization を維持できます。新 schema、manifest-v2 file input、SLSA/OIDC、追加 approval gate、別 harness は不要です。 P2 — unexpected monolith responsive evidence を黙って捨てる現 helper は monolith の これは上流側でも完全には防げません。manifest v2 validator の ただし、これは今回の blocker にはしません。実際の workflow routing が正常なら発生せず、#2155 は44-run前に fresh current-main の 良い点self-pair 自体には反対しません。同じ physical また、split missing-responsive の fail-closed regression、assessment と receipt の convergence regression、raw CI についても、PR thread の実行記録では focused Python tests、全 外部仕様も確認しました。GitHub REST 推奨 dispositionP1 の required-phase completeness だけ直して再レビュー → 問題なければ APPROVE が適切です。 #2554 内で live GitHub Actions smoke まで追加する必要もないと考えます。決定論的 pytest でこの反例を固定し、マージ後に #2155 が既定どおり 現状の self-review の APPROVE は「production wiring が本当に変わった」「happy path は非vacuous」という点では正しいのですが、新しく開いた monolith success path の malformed-evidence negative case が抜けています。そこが今回の敵対的レビューでの実質的な差分です。 ## 判定REQUEST_CHANGES。P1 の merge blocker を1件だけ修正すれば、承認寄りです。 PR #2575 の中心設計――monolith では同一 ただし、monolith を eligible にする新しい成功経路が、monolith の Performance observation 自体が完全であることを確認していません。
P1 — partial monolith timing evidence が valid sample になるrefined #2554 の前提では、monolith の物理 provider は
を一度だけ合計したものが1 runの Performance observation です。 実 workflow もその形になっています。通常 E2E を ところが現在の さらに #2575 では monolith に対して、 という self-pair を作ります。 したがって例えば、本来 である run が、何らかの evidence collection 異常で responsive phase を欠き、 だけになっていても、120 sec の valid monolith sample として数えられます。 そして close-grade materializer は provider pair・fingerprint・gate-ready evidence は検査しますが、provider baseline の required phase completeness は検査しません。そのため、その run は 特に問題なのは、新規 fixture generator が常に両 phase を入れているため、この反例を現在の AC1〜AC6 が一切踏んでいない点です。 最小修正大きな abstraction や schema は不要です。この PR の思想のまま局所修正できます。
これなら #2575 が狙っている sample-count / assessment / receipt の同一 materialization を維持できます。新 schema、manifest-v2 file input、SLSA/OIDC、追加 approval gate、別 harness は不要です。 P2 — unexpected monolith responsive evidence を黙って捨てる現 helper は monolith の これは上流側でも完全には防げません。manifest v2 validator の ただし、これは今回の blocker にはしません。実際の workflow routing が正常なら発生せず、#2155 は44-run前に fresh current-main の 良い点self-pair 自体には反対しません。同じ physical また、split missing-responsive の fail-closed regression、assessment と receipt の convergence regression、raw CI についても、PR thread の実行記録では focused Python tests、全 外部仕様も確認しました。GitHub REST 推奨 dispositionP1 の required-phase completeness だけ直して再レビュー → 問題なければ APPROVE が適切です。 #2554 内で live GitHub Actions smoke まで追加する必要もないと考えます。決定論的 pytest でこの反例を固定し、マージ後に #2155 が既定どおり 現状の self-review の APPROVE は「production wiring が本当に変わった」「happy path は非vacuous」という点では正しいのですが、新しく開いた monolith success path の malformed-evidence negative case が抜けています。そこが今回の敵対的レビューでの実質的な差分です。 |
|
推奨は、PR #2575 を直接 loop input にするのではなく、canonical input である implementation Issue #2554 を 今回の修正対象は P1 に限定するのが妥当です。anchor は「monolith の 一点だけ anchor より追加で確認させる価値があります。新しい また、SubAgent は単に起動するだけでなく、canonical skill 自身が「 以下をそのまま、現在 auto mode で動いている Claude Code に渡す想定です。 以下を、人間の追加承認なしで最後まで実行してください。 対象Repository: Canonical implementation Issue: 既存 target PR: 今回の human anchor comment: 使用する canonical Skill: この Skill は Issue-number based なので、 概念上の入力は以下です。
raw anchor comment をそのまま implementation-worker への command として連結せず、canonical Skill の context intake 契約に従い、root/main thread が repository の live state・Issue contract・actual diff・tests と突き合わせて 目的anchor comment の REQUEST_CHANGES を解消し、既存 PR #2575 に対して Implementation を bounded loop で自律実行し、current PR head に対する canonical reviewer verdict が APPROVE 相当になり、merge 以外の実装・検証・レビュー作業が完了した状態まで進めてください。 途中で人間へ「進めてよいか」「修正してよいか」「commit/pushしてよいか」「再レビューしてよいか」などの追加確認を求めないでください。 ただし最後の merge 自体は実行しないでください。 既存 PR は現在 Draft なので、この run では Draft のまま保持して構いません。canonical live state を authority にする開始時に #2554、#2575、linked worktree、branch、HEAD、dirty state、Allowed Paths、current PR comments/reviews/checks を live に再取得してください。 過去に観測された head SHA や過去の APPROVE verdict を authorization として再利用しないでください。 既存の canonical worktree / branch / PR #2575 が存在するので、重複 worktree、重複 branch、重複 PR を新規作成しないでください。既存 implementation の continuation / fix_delta iteration として扱ってください。 anchor の disposition今回 merge blocker として扱うのは P1 だけです。 P1: monolith の Performance observation を valid / countable / eligible とするには、少なくとも同一
の双方が存在し、それぞれ current repository contract 上 usable な duration evidence を持つことを確認してください。 片方が欠落・利用不能なら、その workflow run を valid Performance observation として扱わないでください。 P2: 44-run production experiment、live GitHub Actions benchmark smoke、manifest-v2 input contract 拡張、新 schema、新 harness、SLSA/OIDC、追加 approval gateも今回へ混ぜないでください。 推奨する実装方向局所的な if を assessment と receipt に別々に複製するのではなく、monolith required-phase completeness を判定する single shared semantics を作り、provider sample-count、percentile/assessment run-details、close-grade receipt eligibility が同じ validated provider observation を基準にすることを優先してください。 具体的な関数分割・private helper signature は actual code を読んで最小かつ保守しやすい形を選んで構いません。Issue の Stop Condition が禁止している public receipt schema / fixed contract の変更は行わないでください。 不完全な monolith run は、 provider post-filter sample count のすべてから除外される必要があります。 同時に、その workflow_run_id 自体を root set から silent drop してはいけません。close-grade receipt の anchor が例示した 現在の Allowed Paths 外の consumer 修正が必要になる場合、理由を偽装するために既存の unrelated reason を流用したり、Allowed Paths 外を黙って変更したりしないでください。 まず current semantics を評価し、 Allowed Paths 外の contract change が本当に不可避だと確認された場合だけ canonical hard-stop としてください。単なる可能性だけで停止しないでください。 必須 regression最低限、anchor の counterexample を直接固定してください。 20-run monolith fixture のうち1 runから provider post-filter sample count == 19 その workflow_run_id が その workflow_run_id が explicit assessment/run-details 側でもその不完全 run が valid observation として使われない ことを確認してください。 さらに対称ケースとして 既存の happy-path 20-run monolith、split SubAgent orchestrationcanonical Step 1: Step 2: Step 4: REQUEST_CHANGES が返れば、その blockers と review URL を canonical root/main thread 自身が implementation-worker、test-runner、pr-reviewer の仕事を代行して shortcut しないでください。 SubAgent の完了待ちを必須にする各 canonical Common Completion Protocol に従い、 spawn 時に返された canonical task name を保存する。
SubAgent が途中で VerificationIssue #2554 の live body にある Verification Commands を literal command として current head 上で実行してください。 加えて今回追加した required-phase completeness regression を focused pytest で直接実行してください。 修正後は少なくとも既存契約に従って、
および live Issue の Verification Commands を満たしてください。 test-runner は implementation-worker の自己申告を信用せず、current head から独立実行してください。 Allowed Paths が引き続き
だけであることも current diff から再検証してください。 Commit / push / PR 更新修正が必要なら既存 #2575 の branch に commit / push してください。 push 後は必ず live PR head SHA を再取得し、古い head に対する Verification / review を stale として扱ってください。 必要なら PR body の checks / AC evidence を actual result に合わせて更新して構いません。ただし issue/PR scope や public schema を勝手に変更しないでください。 CI と再レビューpush 後は current head に紐づく required CI を確認してください。 required checks の実装起因 failure は fix_delta に戻してください。 非-required check の transient infrastructure/API error だけを implementation blocker と誤認しないでください。ただし「transient」と決め打ちせず、job/log evidence を確認して分類してください。 CI が揃ったら current-head gate を再評価し、必ず fresh reviewed_head_sha と live PR head が不一致なら APPROVE を採用せず、fresh head で再レビューしてください。 終了条件以下を満たすまで自律的に loop を継続してください。 current head に必要な実装が入っている。 到達したら merge はせず停止してください。 最終報告では、 Issue #2554 を簡潔に報告してください。 max_iterations 以内で APPROVE に届かなければ、canonical それ以外では人間の追加承認を待たず、今すぐ実行を開始してください。 この形なら、今回の anchor を「別レビューコメントだから手作業で修正する」のではなく、既存の human-context → normalized fix_delta → implementation-worker → independent test-runner → fresh pr-reviewer という loop-protocol 自身の経路に乗せられます。PR は現在も Draft・1 changed file・head |
) PR #2575 REQUEST_CHANGES (issuecomment-5584055868) P1: monolith topology の self-pairでは `_job_duration_seconds()` が存在する test_e2e* phaseを無条件に 合算するため、e2e-core baselineが test_e2e_ci / test_e2e_monolith_responsive のいずれか片方しか持たなくても有効なPerformance sampleとして provider post-filter sample countおよびclose-grade receiptの performance_eligible_workflow_run_idsに算入されてしまっていた。 _layout_aware_provider_baselines()に両phase必須の完全性チェックを追加し、 不完全なmonolith runをself-pair対象から除外。run_evidence_gate()と build_close_grade_receipt()の両方で、除外されたrun_idをroot setから silent dropさせず missing_monolith_performance_phase という明示的な evidence_errors reasonとして残す(scripts/ci/build_ci_reliability_assessment_v1.py のRECEIPT_PERFORMANCE_ONLY_EVIDENCE_ERROR_REASONS allowlistが未分類の 既存reasonを誤流用しないよう、専用reasonを新設)。 completeness checkは test_e2e_ci / test_e2e_monolith_responsive のいずれか 片方でも存在するbaselineにのみ適用し、無関係な既存fixture(split arm用の 汎用test_e2e_core単一phase shape等)を誤検知しないよう限定した。 _pair_by_workflow_run_id() / _provider_critical_path_paired_p50_p95() / _materialize_close_grade_arm() 自体は無変更(シグネチャ・2-sided pair 不変条件を維持)。 Co-Authored-By: Claude Sonnet 5 <[email protected]>
Summary
Issue #2554 の実装です。
tests/ci/test_ci_performance_gate.pyの production Performance close-grade materialization path(run_evidence_gate()→_pair_by_workflow_run_id()→ provider post-filter sample count → percentile/assessment input →build_close_grade_receipt()→_materialize_close_grade_arm())が manifest topology(monolith / split)を無視しており、monolith arm が構造的にperformance_eligible_workflow_run_ids == []になる gap を修正しました。この gap は #2155 の44-run本番experiment実行のhard prerequisiteとして OWNER anchor comment(issuecomment-5568218806)で指摘されたものです。_layout_aware_provider_baselines(topology, core_baselines, responsive_baselines)をtests/ci/test_ci_performance_gate.pyに追加しました。呼び出し側が渡す明示的な topology 引数("monolith"/"split"-- baseline の内容から自動推定はしない)に応じて、_pair_by_workflow_run_id()/_provider_post_filter_sample_count()/_materialize_close_grade_arm()へ渡す(core_baselines, responsive_baselines)ペアを組み立てます。e2e-core1個のみ。同一のe2e-corebaseline を core レーン・responsive レーン双方へ渡すことで(self-fingerprint-matching)、_pair_by_workflow_run_id()はその run を自分自身とペアリングします。_provider_critical_path_paired_p50_p95()のmax(core, responsive)は同一 baseline の値へ collapse するため、test_e2e_ci+test_e2e_monolith_responsiveの合計を一度だけ観測値として使い、二重計上しません。synthetic なe2e-responsive-matrixレコードは一切生成しません。_layout_aware_provider_baselines()は(core_baselines, responsive_baselines)をそのまま返し、既存のmax(core, responsive)critical-path semantics は無変更です。responsive provider が本当に欠落する split run は引き続きmissing_pair_e2e-responsive-matrixの fail-closed error になります。run_evidence_gate()(pairing / sample count / assessment input)とbuild_close_grade_receipt()(_materialize_close_grade_arm()呼び出し)の両方をこの共通 helper へ収束させ、既存のarms.monolith<-fixture["before"]/arms.split<-fixture["after"]stand-in convention をそのまま topology tag として使っています。_pair_by_workflow_run_id()/_provider_critical_path_paired_p50_p95()/_materialize_close_grade_arm()自体のシグネチャ・不変条件は変更していません。Checks
uv run --locked pytest tests/ci/test_ci_performance_gate.py -q(22 passed, 3 skipped -- skip は既存の実CI history依存exploratory testで無関係)uv run --locked pytest tests/ci/ -q(全 satellite test file を含む -- 113 passed, 5 skipped)pnpm typecheckpnpm lintpnpm test(Vitest 1939 件 PASS)pnpm builduv run pytest .claude/skills/gemini-cli-headless-delegation/tests/test_model_routing.py(24 件 PASS)uv run ruff check tests/ci/test_ci_performance_gate.py(エラーなし)受け入れ条件の達成状況
test_monolith_provider_post_filter_sample_count_equals_run_count_with_no_responsive_provider-- monolith 20-run fixture(各 run が単一のe2e-corebaseline のみを持ち、measurements[]にtest_e2e_ci+test_e2e_monolith_responsiveを含み、responsive_baselines=[])で provider post-filter sample count が 20 であることを確認。test_monolith_arm_close_grade_receipt_eligible_ids_has_20_entries_via_before_stand_in-- AC1 と同じ fixture をfixture["before"]に配置し、build_close_grade_receipt()のarms.monolith.performance_eligible_workflow_run_idsが 20 件であることを確認。test_monolith_run_duration_equals_sum_of_core_and_monolith_responsive_phases_no_synthetic_record-- 1 run の Performance duration observation が同一e2e-corebaseline の対象2 phase の合計と一致し、job == "e2e-responsive-matrix"の synthetic record が生成されないことを確認(monolith_responsive is monolith_coreかつ self-pair であることも直接アサート)。test_split_arm_preserves_max_core_responsive_critical_path_semantics_via_after_stand_in-- split 20-run fixture(e2e-core+e2e-responsive-matrix)をfixture["after"]に配置し、max(core, responsive)critical-path semantics(duration・provider count・receipt eligibility)が既存通り成立することを確認。test_split_arm_genuinely_missing_responsive_provider_still_fails_closed(negative regression)-- split fixture で responsive provider が本当に欠落する run について、既存のmissing_pair_e2e-responsive-matrixfail-closed error が引き続き発生することを確認。test_production_assessment_input_uses_same_layout_aware_observation_as_close_grade_receipt--run_evidence_gate()の production assessment input(percentile 計算・run-details)が monolith/split 両 fixture で同一の layout-aware materialized observation を経由し、build_close_grade_receipt()の eligible ids と収束することを確認(sample count・run-details duration・eligible ids の全てが一致)。pnpm typecheck/pnpm lint/pnpm test/pnpm buildが全て PASS。uv run --locked pytest tests/ci/test_ci_performance_gate.py -qが PASS(22 passed, 3 skipped)。既存テストへの影響と1件の修正について
既存の regression test は全て無修正で PASS しますが、1件のみ fixture を修正しました。
test_close_grade_result_receipt_complete_sourced_from_gate_status_not_local_evidence_errors(#2423 fix_delta P0-1 のgate_status独立性を証明するテスト)は、beforearm のresponsive_baselines: []を「unpaired -> evidence_errors」として使っていましたが、本 PR の修正により monolith topology ではresponsive_baselinesが空でも self-pairing で正しく eligible になるため(これがまさに本 Issue が修正する構造的欠陥です)、このテストの前提が崩れます。テストの本来の意図(performance_assessment.completeがgate_statusのみに従い、receipt 自身のevidence_errorsを再導出しないこと)を保ったまま、gate_ready_baselines: []にしてmissing_gate_ready_evidenceという別の genuine な evidence error を発生させるよう修正しました(topology に依存しない evidence error のため、本 PR の修正と無矛盾です)。それ以外の既存 close-grade materializer テスト(_materialize_close_grade_arm()を直接呼ぶもの)は、本 PR がその private helper のシグネチャ・内部ロジックを一切変更していないため無影響です。また_manifest_v2_provider_jobs_to_baselinesの regression test(1717行付近)と fingerprint_mismatch / fingerprint_placeholder / run_attempt_identity_collision の regression test(2207/2253/2272行付近)は Issue の Out of Scope により無変更のままです。検証コマンド結果
Allowed Paths 遵守
git diff --name-only main...HEADで確認した変更ファイルは以下の1件であり、Issue #2554 の Allowed Paths(tests/ci/test_ci_performance_gate.py)と完全に一致します(Allowed Paths 外の変更なし):Runtime Verification Evidence(実行証跡)
本 Issue の Runtime Verification Applicability は
decision: not_applicable(pytest による静的/決定論的な evidence-shape 検証のみで完結し、実CI dispatch や runtime smoke を必要としないため)。live GitHub Actions dispatch / 44-run 本番 experiment の実行は #2155 側が別途所有します。上記「検証コマンド結果」の focused pytest 実行ログが本 Issue の検証証跡です。Schema Change Applicability
CI_PERFORMANCE_CLOSE_GRADE_RESULT_V1(build_close_grade_receipt()の出力 schema)のフィールド名・形状は変更していません。変更対象は production の provider observation materialization ロジック(run_evidence_gate()/build_close_grade_receipt()の内部呼び出し配線)と、それを検証するテストのみです。_pair_by_workflow_run_id()/_provider_critical_path_paired_p50_p95()/_materialize_close_grade_arm()の private helper シグネチャも無変更です。Schema Consumer Inventory
N/A
reason: schema_change ではないため該当なし。
Safety Claim Matrix
N/A
reason: 変更対象は
tests/ci/test_ci_performance_gate.py内のテストロジック(production の provider observation materialization を検証する pytest コード)のみであり、SAFETY_SENSITIVE_PATH_PATTERNS(transport / permission / sandbox / auth / mcp /.claude/skills//.github/workflows/)のいずれにも一致しません。Notes
performance_eligible_workflow_run_ids == []になる gap)を解消するものです。検証: #2119 AC9/AC10 の close-grade 実CI証跡を確認する #2155 側の44-run本番experiment実行そのものは本 PR のスコープ外です(別途 検証: #2119 AC9/AC10 の close-grade 実CI証跡を確認する #2155 側で実施)。RECEIPT_PERFORMANCE_ONLY_EVIDENCE_ERROR_REASONSallowlist のmissing_pair_e2e-responsive-matrixエントリの要否判断は本 PR では扱いません(独立判断が必要、Issue 本文の Remaining Parent Gaps 参照)。