Skip to content

実装: performance close-grade materializer をtopology-aware実装に修正しmonolith armのeligible run生成を可能にする #2554

Closed

Description

@squne121

Machine-Readable Contract

contract_schema_version: v1
issue_kind: implementation
parent_issue: "#2155"
goal_ref: "production Performance provider observation/materialization を layout-aware にし、monolith arm が構造的に eligible run を生成できるようにする"
change_kind: code

Parent Issue

#2155

Parent Goal Ref

Current Validated Scope

  • tests/ci/test_ci_performance_gate.py 内に、production の Performance provider observation を manifest topology(monolith / split)に応じて materialize する共通 helper を新設する。
  • run_evidence_gate()(pairing / post-filter sample count)、_materialize_close_grade_arm()(close-grade receipt)、assessment percentile input、run-details の各 consumer が、この共通 helper が返す同一 materialized observation を消費するようにする。
  • monolith topology fixture 20 run と split topology fixture 20 run を使った deterministic production-path regression test を追加する。

Remaining Parent Gaps

Outcome

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)に応じて layout-aware に provider observation を materialize するよう修正され、以下が成立している状態。

  • monolith topology では、物理 provider e2e-core 1 個の ci_runtime_baseline_v1.measurements[] に含まれる有効な test_e2e* phase(test_e2e_ci + test_e2e_monolith_responsive)を一度だけ合計し、その workflow_run_id の Performance duration observation とする。synthetic な e2e-responsive-matrix baseline/record は生成しない。共通 helper は、monolith run について同一の e2e-core baseline object を _pair_by_workflow_run_id() の core レーン・responsive レーン双方の入力として渡す(両者が同一 object のため fingerprint 比較は自己一致し、_provider_critical_path_paired_p50_p95() の max(core, responsive) は core 側の値と一致する)ことで、_pair_by_workflow_run_id() / _provider_critical_path_paired_p50_p95() / _materialize_close_grade_arm() の既存シグネチャ・2-sided pair 不変条件を変更せずに済ませる。
  • split topology では、既存通り e2e-core と e2e-responsive-matrix の同一 workflow_run_id 2 provider を現行 attempt-selection/fingerprint policy で materialize し、duration は従来どおり max(core, responsive) とする。split の real 欠落(responsive provider が本当に存在しない)と monolith の構造的 non-pair(同一 object を意図的に再利用する pair)は、baseline の内容から自動推定しない。共通 helper の呼び出し側は、build_close_grade_receipt() の既存 arm-based 呼び出し規約(arms.monolith は fixture["before"]、arms.split は fixture["after"] に由来する既存 stand-in 規約、下記参照)に従い、どちらの topology の run 集合を処理しているかを明示的な引数として共通 helper に渡す。
  • production path の provider post-filter sample count、percentile/assessment input、run-details、close-grade receipt eligibility が、すべて同一の layout-aware observation semantics に収束し、adapter だけが直って production gate が壊れたままという状態を作らない。
  • split で responsive provider が本当に欠落する run は、引き続き missing_pair_e2e-responsive-matrix 等の既存 fail-closed error のままである(今回の topology gap とは無関係な既存 negative semantics を壊さない)。
  • pnpm typecheck / pnpm lint / pnpm test / pnpm build と uv run --locked pytest tests/ci/test_ci_performance_gate.py -q が全て PASS している。

Runtime Verification Applicability

Background

Issue #2155 の issue-refinement-loop 実行中に、OWNER anchor comment(issuecomment-5568218806)が指摘した P0 blocker(monolith arm が構造的に performance_eligible_workflow_run_ids == [] になる gap)を、read-only SubAgent が current origin/main のコードで独立検証し、confirmed=true と判定した。

本 Issue の当初案(_manifest_v2_provider_jobs_to_baselines() を manifest v2 の provider_placement[layout] を authority として使う topology-aware 実装に修正する)に対し、OWNER anchor comment(issuecomment-5575198296)が REQUEST_CHANGES を出し、choke point の特定自体が誤っていると指摘した。issue-refinement-loop の read-only codebase-investigator SubAgent が current origin/main(HEAD 1a9963c)のコードで独立に fact-check した結果は以下の通り(anchor の主張を鵜呑みにせず検証済み)。

以上の fact-check により、本 Issue の中心テーマを「manifest adapter 修正」から「production Performance provider observation/materialization を layout-aware にする」へ reframe する。manifest v2 の provider_placement[layout] は設計資料として参照するが、production CLI が manifest 本体を入力に持たないため、manifest-file wiring・新 artifact input・新 schema・新 broker は追加しない。

X-GitHub-Api-Version: 2022-11-28 ヘッダー pin(GitHub 公式ドキュメントで default version・support 終了日 2028-03-10 とも fact-check 済みで claim 自体は正しい)は、本 Issue の topology blocker とは無関係の housekeeping であるため、本 Issue のスコープには含めない。follow-up candidate として記録するに留める。

#2155 は本Issueをhard prerequisiteとして Blocked By に追加する予定(GitHub native blockedBy の同期は呼び出し元の issue-refinement-loop orchestrator が別途行う。本Issue自体はその配線を行わない)。

In Scope

  • tests/ci/test_ci_performance_gate.py 内に、呼び出し側が明示的な topology 引数(monolith / split)を渡す共通 helper を新設し、production Performance provider observation を materialize する。topology は baseline の内容から自動推定しない。既存の build_close_grade_receipt() の arm-based 呼び出し規約(arms.monolith は fixture["before"]、arms.split は fixture["after"] に由来する既存 stand-in 規約)に従い、どちらの run 集合を処理しているかを呼び出し側が伝える。
  • monolith: 物理 provider は e2e-core 1 個。ci_runtime_baseline_v1.measurements[] に含まれる有効な test_e2e* phase(test_e2e_ci + test_e2e_monolith_responsive)を一度だけ合計し、その workflow_run_id の Performance duration observation とする。synthetic な e2e-responsive-matrix baseline/record は生成しない。logical invocation が2個でも同一物理 provider の timing evidence を二重計上しない。共通 helper は、同一の e2e-core baseline object を _pair_by_workflow_run_id() の core レーン・responsive レーン双方の入力として渡すことで、この関数と _provider_critical_path_paired_p50_p95() / _materialize_close_grade_arm() の既存シグネチャ・2-sided pair 不変条件を変更せずに済ませる(同一 object のため fingerprint 比較は自己一致し、max(core, responsive) は core 側の値と一致する)。
  • split: 物理 provider は e2e-core と e2e-responsive-matrix。同一 workflow_run_id の2 provider を現行 attempt-selection/fingerprint policy で materialize し、duration は従来どおり max(core, responsive) とする(既存 critical-path semantics を変更しない)。responsive provider が本当に欠落する split run は、引き続き missing_pair_e2e-responsive-matrix 等の既存 fail-closed error のままとする。
  • run_evidence_gate()(pairing / post-filter sample count)、percentile/assessment input、run-details、build_close_grade_receipt() → _materialize_close_grade_arm()(close-grade receipt eligibility)が、すべて同じ共通 helper の materialized observation を消費するように配線する。adapter regression だけが green で production gate が壊れたままという状態を防ぐ。_pair_by_workflow_run_id() / _provider_critical_path_paired_p50_p95() / _materialize_close_grade_arm() 自体のシグネチャ・不変条件は変更しない(呼び出し側の共通 helper が topology に応じた入力を組み立てるだけであり、これらの private helper のシグネチャ変更は本 Issue の In Scope に含まれない)。
  • monolith 20 run fixture・split 20 run fixture・split の negative fixture(responsive provider 欠落)を使った deterministic production-path regression test を追加する。
  • 既存の tests/ci/test_ci_performance_gate.py:1717 付近の assert monolith_result["performance_eligible_workflow_run_ids"] == [](_manifest_v2_provider_jobs_to_baselines() adapter の regression test)は、本 Issue が修正する production path とは別の adapter に対するものであり、本 Issue のスコープでは変更しない(adapter 自体が production から呼ばれていないため、その規約を保つことは今回の production fix と矛盾しない)。同ファイル2207/2253/2272行付近の類似アサーションは fingerprint_mismatch / fingerprint_placeholder / run_attempt_identity_collision という別原因に起因するものであり、今回の topology gap とは無関係なため変更しない。

Out of Scope

  • manifest v2 本体ファイル/パスを production CLI の入力として追加する配線(新 artifact input・新 schema・新 broker を含む)。production CLI は --manifest-sha256 / --experiment-identity(digest/identity)のみを引き続き受け取る。
  • legacy(非 manifest-v2)materializer path の変更。
  • _manifest_v2_provider_jobs_to_baselines() adapter 自体の実装変更、および同 adapter の既存 regression test(tests/ci/test_ci_performance_gate.py:1717 付近)の期待値変更。production から呼ばれていないため本 Issue の choke point ではない。
  • scripts/ci/build_ci_reliability_assessment_v1.py(Reliability側、実装: 実CI raw attemptsからReliability V1 close evidenceをproduction生成する #2424 owner surface)の変更。既に layout-aware 実装済みのため触らない。
  • RECEIPT_PERFORMANCE_ONLY_EVIDENCE_ERROR_REASONS allowlist の missing_pair_e2e-responsive-matrix エントリの削除(split や異常系で依然発生しうる可能性があり、独立判断が必要なため今回は扱わない)。
  • scripts/ci/collect_e2e_performance_benchmark.py の X-GitHub-Api-Version: 2022-11-28 ヘッダー pin(topology blocker とは無関係の housekeeping。follow-up candidate として記録のみ)。
  • close-evidence bundle publication route の追加(別issueで扱う)。
  • 44-run本番実験の実行そのもの(#2155側で別途実施)。

Acceptance Criteria

  • AC1: monolith 20 run fixture(各 run が物理 e2e-core baseline 1件のみを持ち、その measurements[] に test_e2e_ci + test_e2e_monolith_responsive の両 phase を含み、responsive_baselines=[])を使った regression test で、provider post-filter sample count が 20 であることを assert し、PASS する。
  • AC2: AC1 と同じ monolith 20 run fixture(build_close_grade_receipt() の既存 stand-in 規約に従い fixture["before"] に配置する)で、arms.monolith.performance_eligible_workflow_run_ids が 20 件であることを assert し、PASS する。
  • AC3: AC1 と同じ monolith 20 run fixture で、任意の1 run の Performance duration observation が、同一 e2e-core baseline の対象2 phase(test_e2e_ci + test_e2e_monolith_responsive)の合計値と一致することを assert し、PASS する。また synthetic な e2e-responsive-matrix record が生成されていないことを assert する。
  • AC4: split 20 run fixture(e2e-core + e2e-responsive-matrix 両方を持つ run。既存 stand-in 規約に従い fixture["after"] に配置する)を使った regression test で、修正後も max(core, responsive) の critical-path semantics(duration・provider count・assessment・receipt eligibility)が既存通り成立することを assert し、PASS する。
  • AC5: split fixture のうち responsive provider が本当に欠落する run について、missing_pair_e2e-responsive-matrix 等の既存 fail-closed error が引き続き発生することを assert する negative regression test が PASS する。
  • AC6: production assessment input(percentile 計算・run-details)が、AC1-AC4 のいずれの fixture でも同一の layout-aware materialized observation を経由していることを assert する regression test が PASS する。
  • AC7: pnpm typecheck / pnpm lint / pnpm test / pnpm build が全て PASS する。
  • AC8: uv run --locked pytest tests/ci/test_ci_performance_gate.py -q が PASS する。

Verification Commands

# AC1
# AC2
# AC3
# AC4
# AC5
# AC6
# AC8
$ uv run --locked pytest tests/ci/test_ci_performance_gate.py -q
# AC7
$ pnpm typecheck
# AC7
$ pnpm lint
# AC7
$ pnpm test
# AC7
$ pnpm build

Allowed Paths

  • tests/ci/test_ci_performance_gate.py

Stop Conditions

  • Allowed Paths 外の変更が必要と判明した場合
  • In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合。本 Issue における該当対象は tests/ci/test_ci_performance_gate.py 内の production 公開 receipt schema(例: CI_PERFORMANCE_CLOSE_GRADE_RESULT_V1 のフィールド名/形状)であり、同ファイル内の private helper 関数(_pair_by_workflow_run_id() 等)の内部シグネチャ変更はこれに該当しない。
  • 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
  • 後続 Phase / 別スコープへの波及が判明した場合
  • nested SubAgent delegation が必要になった場合
  • 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
  • production CLI の入力契約(manifest本体ファイル読み取り等)を拡張する必要があると判明した場合

Required Skills

なし

Required Design References

  • docs/dev/e2e-performance-benchmark.md#expected_playwright_invocations-invocation-識別リストfix_delta-blocker-4
  • docs/dev/agent-skill-boundaries.md

Scope Delta(任意)

N/A

Activity

  1. added
    enhancement
    phase/implementation
    triage-required
    agent/implementer
    on Sep 7, 2026
  2. squne121 commented on Sep 7, 2026

    @squne121
    OwnerAuthor

    判定

    REQUEST_CHANGES。目的は正しいですが、Issue #2554 は現状のままだと「テストだけ直って production は直らない」実装になり得ます。

    #2155 の OWNER anchor は、monolith arm が構造的に performance eligible にならないことを 44-run 実験前の blocker として扱っており、その後の refinement も #2554/#2555 待ちで hard-stop しています。したがって #2554 自体の必要性は妥当です。

    ただし、修正対象の choke point の特定が間違っています。

    優先度 | Finding | 影響 -- | -- | -- P0 | _manifest_v2_provider_jobs_to_baselines() は production path から呼ばれていない | Issue記載どおりそこだけ直しても 44-run gate は直らない P0 | manifest v2 の provider_jobs[] には性能 measurements がない | manifest → baseline 変換だけでは duration を算出不能 P0 | production CLI は manifest 本体を読まず digest/identity しか受けない | provider_placement[layout] を「authority」にすること自体が現スコープでは不可能 P1 | logical invocation と physical provider を混同する余地がある | monolith の e2e-core を二重計上し得る P1 | AC が adapter regression に寄りすぎ | production gate の sample count / assessment / receipt が壊れたままでも PASS 可能 P2 | GitHub API version pin は妥当だが無関係 | #2554 に混ぜる価値は低い

    P0-1 — Issue が直そうとしている関数は、実際の Performance gate に配線されていない

    現在の _manifest_v2_provider_jobs_to_baselines() 自身のコメントにも「adapter/handoff fix」とあり、monolith responsive を空配列に変換するだけです。コード検索でも呼び出しは定義と regression test にしか出てきません。

    一方、本物の run_evidence_gate() は fixture["before/after"]["core_baselines"] / responsive_baselines を直接読み、即座に _pair_by_workflow_run_id() へ渡しています。post-filter sample count も同じ pairer を使っています。つまり monolith の responsive list が空なら、adapter をどれだけ賢くしても production provider count は 0 のままです。

    receipt 側も同様で、build_close_grade_receipt() → _materialize_close_grade_arm() → _pair_by_workflow_run_id() と直接進みます。

    したがって、**「adapter の regression が green」≠「#2155 の blocker 解消」**です。これは merge blocker にすべきです。

    P0-2 — manifest v2 だけでは Performance observation を作れない

    もう一段根本的な問題があります。manifest v2 の ProviderJob は job、workflow_job_id、conclusion、exact_runner_image を持ちますが、measurements[] は持ちません。

    実際の duration は _job_duration_seconds() が ci_runtime_baseline_v1 の measurements[] から phase_id.startswith("test_e2e") を合計して作っています。

    そして実 workflow の monolith e2e-core には、

    • test_e2e_ci

    • test_e2e_monolith_responsive

    が同じ physical job の measurements に入ります。したがって monolith の正しい Performance observation は、この1個の e2e-core baseline に含まれる2 phase の合計です。偽の responsive baseline は必要ありません。

    つまり必要なのは、

    manifest topology → physical provider 解決
    +
    ci_runtime_baseline_v1 timing evidence との join

    です。

    _manifest_v2_provider_jobs_to_baselines() の現在の返却値には measurements 自体がありません。
    これだけで「test-execution phases全体から observation を構成する」という Issue Outcome は成立しません。

    P0-3 — provider_placement を authority にすると書いてあるが、production gate は manifest 本体を持っていない

    CLI が受け取る manifest 関連引数は --manifest-sha256 と --experiment-identity だけです。実データは依然として --cohort-fixture から読みます。--manifest-v2 <path> のような入力はありません。

    これは偶然ではありません。PR #2501 自身が consumer inventory で、tests/ci/test_ci_performance_gate.py は **「実際に v2 manifest ファイルを読み取る配線は別変更」**として残したと明記しています。

    したがって #2554 の

    expected_playwright_invocations[].provider_placement[layout] を authority とする

    という要求を文字通り実装するなら、Issue の Allowed Paths / CLI input contract を広げる必要があります。

    ただし、個人趣味開発としてはそこまで広げるのを私は勧めません。manifest file wiring、別 artifact input、新 schema などを追加すると、この blocker 修正に対して重すぎます。

    推奨する #2554 の reframe

    一番実用的なのは、manifest adapter 修正 Issue ではなく「production Performance provider materialization を layout-aware にする Issue」へ変えることです。

    新しい共通 helper を tests/ci/test_ci_performance_gate.py 内に1つ置き、run_evidence_gate()、post-filter count、run-details、_materialize_close_grade_arm() が全て同じ materialized provider observationsを消費する構造にします。

    概念的にはこうです。

    provider_observations(layout, core_baselines, responsive_baselines)
    

    monolith:
    physical providers = {e2e-core}
    duration(run) = sum(e2e-core.measurements where phase_id startswith test_e2e)

    split:
    physical providers = {e2e-core, e2e-responsive-matrix}
    duration(run) = max(duration(core), duration(responsive))

    現在の arm_label は既に "monolith" / "split" として _materialize_close_grade_arm() まで渡っています。なので、新たな framework や schema を導入せず、この topology semantics を production path に通せます。

    特に重要なのが physical provider の dedupe です。manifest の logical core / responsive invocation は monolith ではどちらも e2e-core に配置されます。collector にも既に monolith: core -> e2e-core, responsive -> e2e-core、split では別 provider、という topology 定義があります。

    Reliability 実装が provider_placement[layout] を使うのは良い参考ですが、あちらは logical invocation ごとの Playwright JSON を扱っています。Performance がそれをそのまま模倣して invocation ごとに baseline を作ると、monolith の同じ e2e-core timing evidence を2回数える危険があります。Reliability と Performance で materialization granularity は違います。

    Acceptance Criteria も変えるべきです

    現在の「adapter を呼んで eligible が非空」だけでは弱すぎます。最低限、1本の決定論的 production-path regression で次を固定するのが適切です。

    • monolith 20 run、各 e2e-core に test_e2e_ci + test_e2e_monolith_responsive、responsive_baselines=[] → provider post-filter count が 20

    • 同 fixture の receipt → arms.monolith.performance_eligible_workflow_run_ids が 20件

    • monolith の1 run duration → 2 phase の sum

    • split → 従来どおり max(core, responsive)

    • split で responsive が本当に欠けた場合 → 引き続き missing_pair_e2e-responsive-matrix

    • synthetic e2e-responsive-matrix record は一切生成しない

    • _cli_run_details_from_pairs() 相当の assessment input まで topology-aware path を通る

    これなら live GitHub Actions smoke は #2554 では不要です。Runtime Verification = not_applicable は維持してよいです。大きな harness も不要で、focused pytest だけで十分です。その後 #2155 が予定している blocks=1/2 の smoke で実 wiring を確認してから 44-run に進むのが効率的です。

    GitHub API version pin

    Issue にある X-GitHub-Api-Version: 2022-11-28 の記述自体は現時点で正しいです。GitHub はヘッダー未指定時も現在は 2022-11-28 を既定とし、この version は 2028年3月10日までサポート予定です。2022 API では return_run_details が明示パラメータで、true 時 200 / false 時 204。現在の 2026-03-10 API では dispatch は run ID/URL を含む 200 response が標準になっています。(GitHub Docs) (GitHub Docs) (GitHub Docs)

    ただし #2554 からは外すのを推奨します。topology blocker と無関係で、collector に余計な変更を混ぜるだけです。必要なら後で1コミットの housekeeping で十分です。

    最終 disposition

    #2554 は必要。ただし現本文のまま implement に渡すのは非推奨です。

    最も重要な修正は、_manifest_v2_provider_jobs_to_baselines() を直すことではなく、pair-based しか扱えない production provider critical-path abstraction を monolith=1 physical provider / split=2 physical providers に一般化し、sample count・assessment・receipt の全3経路をそこへ収束させることです。

    SLSA、OIDC、署名、追加 approval、artifact broker、新 schema はこの修正には不要です。既存の fixture/binding 契約のまま、実際に #2155 を unblock する最小変更に絞るのが適切です。

    ## 判定

    REQUEST_CHANGES。目的は正しいですが、Issue #2554 は現状のままだと「テストだけ直って production は直らない」実装になり得ます。

    #2155 の OWNER anchor は、monolith arm が構造的に performance eligible にならないことを 44-run 実験前の blocker として扱っており、その後の refinement も #2554/#2555 待ちで hard-stop しています。したがって #2554 自体の必要性は妥当です。

    ただし、修正対象の choke point の特定が間違っています。

    優先度 Finding 影響
    P0 _manifest_v2_provider_jobs_to_baselines() は production path から呼ばれていない Issue記載どおりそこだけ直しても 44-run gate は直らない
    P0 manifest v2 の provider_jobs[] には性能 measurements がない manifest → baseline 変換だけでは duration を算出不能
    P0 production CLI は manifest 本体を読まず digest/identity しか受けない provider_placement[layout] を「authority」にすること自体が現スコープでは不可能
    P1 logical invocation と physical provider を混同する余地がある monolith の e2e-core を二重計上し得る
    P1 AC が adapter regression に寄りすぎ production gate の sample count / assessment / receipt が壊れたままでも PASS 可能
    P2 GitHub API version pin は妥当だが無関係 #2554 に混ぜる価値は低い

    P0-1 — Issue が直そうとしている関数は、実際の Performance gate に配線されていない

    現在の _manifest_v2_provider_jobs_to_baselines() 自身のコメントにも「adapter/handoff fix」とあり、monolith responsive を空配列に変換するだけです。コード検索でも呼び出しは定義と regression test にしか出てきません。

    一方、本物の run_evidence_gate() は fixture["before/after"]["core_baselines"] / responsive_baselines を直接読み、即座に _pair_by_workflow_run_id() へ渡しています。post-filter sample count も同じ pairer を使っています。つまり monolith の responsive list が空なら、adapter をどれだけ賢くしても production provider count は 0 のままです。

    receipt 側も同様で、build_close_grade_receipt() → _materialize_close_grade_arm() → _pair_by_workflow_run_id() と直接進みます。

    したがって、**「adapter の regression が green」≠「#2155 の blocker 解消」**です。これは merge blocker にすべきです。

    P0-2 — manifest v2 だけでは Performance observation を作れない

    もう一段根本的な問題があります。manifest v2 の ProviderJob は job、workflow_job_id、conclusion、exact_runner_image を持ちますが、measurements[] は持ちません。

    実際の duration は _job_duration_seconds() が ci_runtime_baseline_v1 の measurements[] から phase_id.startswith("test_e2e") を合計して作っています。

    そして実 workflow の monolith e2e-core には、

    • test_e2e_ci
    • test_e2e_monolith_responsive

    が同じ physical job の measurements に入ります。したがって monolith の正しい Performance observation は、この1個の e2e-core baseline に含まれる2 phase の合計です。偽の responsive baseline は必要ありません。

    つまり必要なのは、

    manifest topology → physical provider 解決
    +
    ci_runtime_baseline_v1 timing evidence との join

    です。

    _manifest_v2_provider_jobs_to_baselines() の現在の返却値には measurements 自体がありません。
    これだけで「test-execution phases全体から observation を構成する」という Issue Outcome は成立しません。

    P0-3 — provider_placement を authority にすると書いてあるが、production gate は manifest 本体を持っていない

    CLI が受け取る manifest 関連引数は --manifest-sha256 と --experiment-identity だけです。実データは依然として --cohort-fixture から読みます。--manifest-v2 <path> のような入力はありません。

    これは偶然ではありません。PR #2501 自身が consumer inventory で、tests/ci/test_ci_performance_gate.py は **「実際に v2 manifest ファイルを読み取る配線は別変更」**として残したと明記しています。

    したがって #2554 の

    expected_playwright_invocations[].provider_placement[layout] を authority とする

    という要求を文字通り実装するなら、Issue の Allowed Paths / CLI input contract を広げる必要があります。

    ただし、個人趣味開発としてはそこまで広げるのを私は勧めません。manifest file wiring、別 artifact input、新 schema などを追加すると、この blocker 修正に対して重すぎます。

    推奨する #2554 の reframe

    一番実用的なのは、manifest adapter 修正 Issue ではなく「production Performance provider materialization を layout-aware にする Issue」へ変えることです。

    新しい共通 helper を tests/ci/test_ci_performance_gate.py 内に1つ置き、run_evidence_gate()、post-filter count、run-details、_materialize_close_grade_arm() が全て同じ materialized provider observationsを消費する構造にします。

    概念的にはこうです。

    provider_observations(layout, core_baselines, responsive_baselines)
    
    monolith:
        physical providers = {e2e-core}
        duration(run) = sum(e2e-core.measurements where phase_id startswith test_e2e)
    
    split:
        physical providers = {e2e-core, e2e-responsive-matrix}
        duration(run) = max(duration(core), duration(responsive))
    

    現在の arm_label は既に "monolith" / "split" として _materialize_close_grade_arm() まで渡っています。なので、新たな framework や schema を導入せず、この topology semantics を production path に通せます。

    特に重要なのが physical provider の dedupe です。manifest の logical core / responsive invocation は monolith ではどちらも e2e-core に配置されます。collector にも既に monolith: core -> e2e-core, responsive -> e2e-core、split では別 provider、という topology 定義があります。

    Reliability 実装が provider_placement[layout] を使うのは良い参考ですが、あちらは logical invocation ごとの Playwright JSON を扱っています。Performance がそれをそのまま模倣して invocation ごとに baseline を作ると、monolith の同じ e2e-core timing evidence を2回数える危険があります。Reliability と Performance で materialization granularity は違います。

    Acceptance Criteria も変えるべきです

    現在の「adapter を呼んで eligible が非空」だけでは弱すぎます。最低限、1本の決定論的 production-path regression で次を固定するのが適切です。

    • monolith 20 run、各 e2e-core に test_e2e_ci + test_e2e_monolith_responsive、responsive_baselines=[] → provider post-filter count が 20
    • 同 fixture の receipt → arms.monolith.performance_eligible_workflow_run_ids が 20件
    • monolith の1 run duration → 2 phase の sum
    • split → 従来どおり max(core, responsive)
    • split で responsive が本当に欠けた場合 → 引き続き missing_pair_e2e-responsive-matrix
    • synthetic e2e-responsive-matrix record は一切生成しない
    • _cli_run_details_from_pairs() 相当の assessment input まで topology-aware path を通る

    これなら live GitHub Actions smoke は #2554 では不要です。Runtime Verification = not_applicable は維持してよいです。大きな harness も不要で、focused pytest だけで十分です。その後 #2155 が予定している blocks=1/2 の smoke で実 wiring を確認してから 44-run に進むのが効率的です。

    GitHub API version pin

    Issue にある X-GitHub-Api-Version: 2022-11-28 の記述自体は現時点で正しいです。GitHub はヘッダー未指定時も現在は 2022-11-28 を既定とし、この version は 2028年3月10日までサポート予定です。2022 API では return_run_details が明示パラメータで、true 時 200 / false 時 204。現在の 2026-03-10 API では dispatch は run ID/URL を含む 200 response が標準になっています。([GitHub Docs]1) ([GitHub Docs]2) ([GitHub Docs]3)

    ただし #2554 からは外すのを推奨します。topology blocker と無関係で、collector に余計な変更を混ぜるだけです。必要なら後で1コミットの housekeeping で十分です。

    最終 disposition

    #2554 は必要。ただし現本文のまま implement に渡すのは非推奨です。

    最も重要な修正は、_manifest_v2_provider_jobs_to_baselines() を直すことではなく、pair-based しか扱えない production provider critical-path abstraction を monolith=1 physical provider / split=2 physical providers に一般化し、sample count・assessment・receipt の全3経路をそこへ収束させることです。

    SLSA、OIDC、署名、追加 approval、artifact broker、新 schema はこの修正には不要です。既存の fixture/binding 契約のまま、実際に #2155 を unblock する最小変更に絞るのが適切です。

  3. squne121 commented on Sep 7, 2026

    @squne121
    OwnerAuthor

    推奨は #2554 を reframe_in_place で全面修正です。対象コメントの指摘どおり、現 Issue は _manifest_v2_provider_jobs_to_baselines() を主修正点にしていますが、production gate は core_baselines / responsive_baselines を直接 pairing しており、duration も ci_runtime_baseline_v1.measurements[] から計算しています。したがって adapter 修正中心の AC では #2155 を実際には unblock できません。

    また、このコメントは今回ユーザーが明示的に選択したものなので、Claude Code 側では operator_asserted_human_context として with_human_context lane に投入するのが適切です。これにより、コメントが要求している goal / scope / AC の semantic reframe を「追加の人間承認が必要」として止めず、fact-check 後に controlled reframe へ進めます。repo の skill 自体も、operator-selected human-context と read-only investigation による exact path 導出を想定しています。

    サブエージェントについては、P0 がすべて call graph・measurement shape・CLI wiring に関する事実主張なので codebase-investigator を使う価値が高いです。planner が Web research も要求した場合は web-researcher と並列実行できますが、起動した全 SubAgent の完了を待ってから Step 2 に合流することを明記します。これは skill の canonical flow とも一致します。

    そのまま Claude Code に投入するプロンプトです。

    既に auto mode で起動しているこの Claude Code セッションで、以下の作業を実行してください。

    対象リポジトリ:
    https://github.com/squne121/loop-protocol

    対象 Issue:
    https://github.com/squne121/loop-protocol/issues/2554

    human-context anchor:
    https://github.com/squne121/loop-protocol/issues/2554#issuecomment-5575198296

    目的は、.claude/skills/issue-refinement-loop を使って Issue #2554 を refinement し、実装着手可能な品質まで収束させることです。

    この invocation では loop iteration ごとの人間承認は不要です。既に Claude Code 自体は auto mode なので、permission mode を変更したり、追加の approval 設定を導入したりしないでください。issue-refinement-loop の canonical policy に従い、needs-fix は max_iterations の範囲内で自動継続してください。

    1. 最初に current repository state と Issue 実装: performance close-grade materializer をtopology-aware実装に修正しmonolith armのeligible run生成を可能にする #2554 の live body、対象 anchor comment の live snapshot、.claude/skills/issue-refinement-loop/SKILL.md および planner が要求する references/ を読み、古い記憶やこのプロンプトの要約だけで判断しないでください。max_iterations=3 とします。

    2. 今回ユーザーは上記 anchor comment を明示的に選択し、その内容を Issue refinement の authority として使用するよう指示しています。したがって anchor は operator_asserted_human_context として扱い、canonical with_human_context lane を使用してください。URL の prose style や GitHub principal だけを理由に agent_report / unlabeled lane へ再分類しないでください。anchor が要求する goal / scope / Acceptance Criteria の semantic reframe はこのユーザー指示によって承認済みです。anchor の範囲内の reframe だけを理由に人間承認を要求しないでください。

    3. issue-refinement-loop の canonical preflight / planner / trusted contract update 経路を使ってください。run_refinement_preflight.py 等の内部 wrapper を勝手に直呼びして governance を迂回しないでください。current ISSUE_REFINEMENT_COMMAND_REGISTRY_V1 と skill の current instructions を SSOT としてください。

    4. anchor comment は repository implementation に関する多数の factual claim を含むため、planner が investigation_policy.required=true とした場合は必ず read-only codebase-investigator SubAgent を起動してください。mutation は main control-plane / canonical issue-editor lane だけが所有し、investigator には GitHub Issue 更新や source mutation をさせないでください。

    5. SubAgent investigation では少なくとも次の事実を current main から独立確認してください。anchor の結論を最初から正しいものとして copy するのではなく、call graph と実データ shape から検証してください。

      a. _manifest_v2_provider_jobs_to_baselines() の production call sites が本当に存在するか。定義・regression test だけなのかを確認する。

      b. run_evidence_gate() が実際に何を入力として読み、_pair_by_workflow_run_id()、_provider_post_filter_sample_count()、provider percentile、assessment input へどう流しているか確認する。

      c. build_close_grade_receipt() → _materialize_close_grade_arm() が monolith / split をどう materialize しているか確認する。

      d. ci_runtime_baseline_v1 の measurements[] と _job_duration_seconds() の関係を確認し、monolith の physical e2e-core baseline に test_e2e_ci と test_e2e_monolith_responsive が入る場合、その同一 physical provider の test_e2e* phase sum が1 runの duration observationになるという主張を検証する。

      e. split では e2e-core と e2e-responsive-matrix の同一 workflow_run_id observation の max(core, responsive) が現在の critical-path semantics であることを確認する。

      f. manifest v2 provider_jobs[] に Performance timing measurements[] が存在するかを確認する。

      g. production CLI が manifest v2 本体/pathを読み取るのか、それとも --cohort-fixture と --manifest-sha256 / --experiment-identity 等だけを読むのか確認する。

      h. manifest の logical invocation → physical provider mapping をそのまま Performance baseline へ展開した場合、monolith の同一 e2e-core timing evidence を logical core / responsive の2件として二重計上する危険があるか確認する。

      i. 検証: #2119 AC9/AC10 の close-grade 実CI証跡を確認する #2155 と 実装: close-evidence bundle を手動 workflow_dispatch で build→validate→artifact upload→publication receipt まで配線する #2555、実装: frozen E2E benchmark を layout A/B/A/B dispatch 契約へ置換する #2422、実装: 性能ゲートの canonical cohort materialization と close-grade CLI を fail-closed 化する #2423、実装: 実CI raw attemptsからReliability V1 close evidenceをproduction生成する #2424、実装: #2423/#2424 の close-grade result を close_evidence.json bundle に束ねる producer/validator を実装する #2486 の ownership と 実装: performance close-grade materializer をtopology-aware実装に修正しmonolith armのeligible run生成を可能にする #2554 の boundary を確認し、この reframe が既存 Issue と重複実装にならないことを確認する。

    6. planner が web_research_policy.required=true とした場合のみ web-researcher SubAgent も起動してください。Step 1 の codebase-investigator と Step 1b の web-researcher は独立なら並列で構いません。ただし、起動したすべての SubAgent が terminal completion になるまで待ってください。Task/SubAgent を dispatch しただけで「完了」と扱わないでください。全結果を回収・join してから Step 2 review に進んでください。SubAgent に nested delegation はさせないでください。ただし current skill contract 自体が明示的に要求する内部 transport はその契約に従ってください。

    7. fact-check が anchor comment の主要 P0 finding を確認した場合、Issue 実装: performance close-grade materializer をtopology-aware実装に修正しmonolith armのeligible run生成を可能にする #2554 は小修正ではなく reframe_in_place してください。中心テーマを「manifest adapter 修正」から「production Performance provider observation/materialization を layout-aware にする」に変更してください。

      期待する設計方向は以下です。ただし exact helper 名や signature は current code を調査した上で最小・coherent なものを選んでください。

      monolith:
      physical provider は e2e-core 1個。
      同じ baseline の measurements[] に含まれる有効な test_e2e* phase を一度だけ合計して、その workflow_run_id の Performance duration observation とする。
      synthetic e2e-responsive-matrix baseline/record は生成しない。
      logical invocation が2個でも同じ physical provider timing evidence を二重計上しない。

      split:
      physical provider は e2e-core と e2e-responsive-matrix。
      同じ workflow_run_id の2 providerを現在の attempt-selection/fingerprint policyで materialize し、duration は従来どおり max(core, responsive)。
      responsive provider が本当に欠けている split run は引き続き missing_pair_e2e-responsive-matrix 等の fail-closed error とする。

    8. production path の sample-count、percentile/assessment input、run-details、close-grade receipt eligibility が別々の topology 解釈を持たないようにしてください。Issue Outcome / In Scope / AC は、これら全 consumer が同じ layout-aware physical-provider observation semantics に収束することを要求する内容にしてください。

      特に、adapter regression だけ green でも production gate が壊れたまま、という Issue を作らないでください。

    9. Acceptance Criteria は少なくとも deterministic production-path regression で次を証明できる内容に reframe してください。

      monolith 20 run:
      各 run は physical e2e-core baseline 1件のみを持ち、その measurements に core + monolith-responsive の test_e2e* phase を含む。
      responsive_baselines=[]。
      provider post-filter sample count が20。
      close-grade receipt の arms.monolith.performance_eligible_workflow_run_ids が20件。
      1 run の duration が同一 e2e-core の対象2 phaseの sum。
      synthetic responsive record が存在しない。

      split 20 run:
      e2e-core + e2e-responsive-matrix。
      従来の max(core, responsive) critical-path semantics が維持される。
      provider count / assessment / receipt が従来どおり成立する。

      negative regression:
      split で responsive が本当に欠落した run は fail-closed となり、既存 missing-pair semantics を維持する。

      assessment/run-details:
      production assessment input まで同じ topology-aware observation を通っていることを確認する。

    10. manifest v2 の provider_placement[layout] は topology semantics を理解する設計資料として参照して構いませんが、production CLI が manifest 本体を入力として持っていないことが確認された場合、実装: performance close-grade materializer をtopology-aware実装に修正しmonolith armのeligible run生成を可能にする #2554 に manifest-file wiring、新 artifact input、新 schema、新 broker を追加しないでください。この blocker 修正のためだけに production input contract を大きく拡張しないでください。

    11. anchor comment が推奨しているとおり、X-GitHub-Api-Version: 2022-11-28 pin は 実装: performance close-grade materializer をtopology-aware実装に修正しmonolith armのeligible run生成を可能にする #2554 の topology blocker とは分離してください。collector API housekeeping をこの Issue の optional scope に残さないでください。必要なら follow-up candidate として記録するだけにしてください。

    12. Allowed Paths は investigation で判明した production choke point に必要な最小集合へ更新してください。現時点では tests/ci/test_ci_performance_gate.py が主要 owner surface と想定されますが、このプロンプトを根拠に path を捏造しないでください。anchor の reframe を成立させるため exact additional path が必要なら、read-only investigation で exact repository-relative path を導出し、with_human_context の trusted scope-delta mechanism を使用してください。広すぎる glob や無関係な collector/workflow path は追加しないでください。

    13. Runtime Verification Applicability は、live GitHub Actions dispatch を 実装: performance close-grade materializer をtopology-aware実装に修正しmonolith armのeligible run生成を可能にする #2554 で新たに要求する必要がないことが確認できれば not_applicable を維持してください。focused deterministic pytest を主 verification とし、その後 検証: #2119 AC9/AC10 の close-grade 実CI証跡を確認する #2155 が本来の live smoke / 44-run verification を所有する境界を維持してください。

    14. Verification Commands は reframe 後の AC を実際に検証できるものにしてください。最低限 focused uv run --locked pytest ... と repository standard の pnpm typecheck / pnpm lint / pnpm test / pnpm build を整合させてください。Issue refinement 中に本実装を行う必要はありません。

    15. 検証: #2119 AC9/AC10 の close-grade 実CI証跡を確認する #2155 の native dependency が 実装: performance close-grade materializer をtopology-aware実装に修正しmonolith armのeligible run生成を可能にする #2554 のままであることは維持してください。実装: performance close-grade materializer をtopology-aware実装に修正しmonolith armのeligible run生成を可能にする #2554 の説明変更により 検証: #2119 AC9/AC10 の close-grade 実CI証跡を確認する #2155 本文の blocker prose が古くなる場合は、その不整合を follow-up/hygiene observation として記録して構いませんが、この request では 検証: #2119 AC9/AC10 の close-grade 実CI証跡を確認する #2155/実装: close-evidence bundle を手動 workflow_dispatch で build→validate→artifact upload→publication receipt まで配線する #2555 を無関係に書き換えないでください。dependency materializer 等の canonical skill contract が明示的に必要とする操作のみ例外とします。

    16. Step 2 review → Step 4 rewrite → 再review を max_iterations=3 の範囲で自動継続してください。「本文をこの内容で更新してよいですか」「次 iteration に進んでよいですか」等の承認質問はしないでください。deterministic repair / structural repair / issue-editor rewrite は canonical routing に従って自動実行してください。

    17. anchor によって明示的に承認されている reframe の範囲内の scope / goal / AC change は、人間判断が必要な新規 semantic change として扱わないでください。一方、調査の結果、anchor の範囲を越える destructive/non-idempotent operation、permission boundary変更、外部サービス境界変更、Issue split が必要、または別の owner decision が本当に必要と判明した場合は、skill の fail-closed / human_judgment_required を尊重してください。無理に承認済みと偽装しないでください。

    18. refinement の成功条件は、単なる issue-reviewer approve ではなく、current body に対して fresh な final contract review が CONTRACT_REVIEW_RESULT_V1.status == "go" となり、Issue が implementation_ready 相当まで到達することです。stale review snapshot を再利用しないでください。

    19. この依頼の作業範囲は Issue refinement までです。source code の実装・PR作成・merge は行わないでください。approved termination / handoff readiness を生成したところで止め、別 invocation の impl-review-loop に渡せる状態にしてください。

    20. 最終報告では、少なくとも以下を簡潔に示してください。
      Issue 実装: performance close-grade materializer をtopology-aware実装に修正しmonolith armのeligible run生成を可能にする #2554 の最終 classification。
      anchor comment の P0 finding ごとの fact-check 結果。
      Issue body の主要な変更点。
      最終 review verdict と fresh contract-review status。
      残った blocker / follow-up。
      起動した各 SubAgent の役割と、その全ての完了を待って結果を回収したこと。
      実装には着手していないこと。

    途中で人間への進捗確認や承認要求を挟まず、可能な範囲を最後まで連続実行してください。

    この形なら、対象コメントの semantic reframe を「人間判断待ち」で再停止する可能性をかなり抑えつつ、anchor を無検証で採用することも避けられます。最終 gate は approve だけではなく fresh な CONTRACT_REVIEW_RESULT_V1.status == go が必要です。

    なお、#2155 は現在 #2554 を hard blocker として保持していますが、その本文はまだ「manifest provider_placement を authority にする修正」という旧 framing です。#2554 refinement 完了後には #2155 側の説明だけ同期する余地がありますが、native dependency 自体はそのままで問題ありません。

  4. squne121 commented on Sep 7, 2026

    @squne121
    OwnerAuthor

    issue-refinement-loop 終了報告(approved)

    Issue #2554 は issue-refinement-loop により implementation_ready 相当まで収束し、impl-review-loop への handoff 準備が完了しました。

    実行サマリ

    • human-context anchor(issuecomment-5575198296、OWNER REQUEST_CHANGES)を operator_asserted_human_context / with_human_context lane として扱い、read-only codebase-investigator SubAgent が current main(当初 HEAD 1a9963c038ab4969b9cdc4ccf3bb47e33ef93361)のコードで anchor の P0-1/P0-2/P0-3 finding を独立検証し、全て confirmed と判定した。
    • web-researcher SubAgent が X-GitHub-Api-Version: 2022-11-28 関連の external claim を GitHub 公式ドキュメントで fact-check し、全て confirmed(変更不要)と判定した。
    • 上記 fact-check に基づき、Issue の中心テーマを「manifest adapter 修正」から「production Performance provider observation/materialization を layout-aware にする」へ reframe_in_place した。
    • Step 2(deterministic review)→ Step 2.5(semantic design review)を2周実行。1周目で issue-design-reviewer SubAgent が high/medium/low の semantic finding を検出(monolith の pairing 不変条件を満たす具体的機構が本文に未記載、等)、rewrite_lane: semantic で本文を修正。2周目で assessment: clear を得て effective_verdict: approve に到達。
    • 最終本文に対する fresh run_contract_review_once.py(evidence-mode: baseline)が status: go を返した(stale snapshot の再利用なし)。

    Fact-check 結果(anchor P0 findings)

    Finding 判定
    P0-1: _manifest_v2_provider_jobs_to_baselines() は production から呼ばれていない confirmed
    P0-2: manifest v2 ProviderJob に measurements[] が存在しない confirmed
    P0-3: production CLI は manifest 本体を入力に持たず digest/identity のみ受け取る confirmed
    split の critical-path semantics(max(core, responsive)) confirmed(既存実装)
    #2424 が既に provider_placement[layout] を authority として使用 confirmed
    #2155/#2555/#2422/#2423/#2424/#2486 との境界 重複なしを confirmed
    GitHub API version pin claim(default version / support 終了日 / return_run_details) 全て confirmed(一次資料)

    Issue body の主要な変更点

    • Outcome / In Scope を、production の run_evidence_gate() → _pair_by_workflow_run_id() → provider post-filter sample count → percentile/assessment input → build_close_grade_receipt() → _materialize_close_grade_arm() という単一 layout-aware observation に収束させる設計へ reframe。
    • monolith: 同一の e2e-core baseline object を _pair_by_workflow_run_id() の core/responsive 両レーンへ渡すことで、既存の private helper シグネチャ・2-sided pair 不変条件を変更せずに monolith を成立させる具体的機構を明記。
    • Acceptance Criteria を AC1〜AC8(monolith 20-run / split 20-run / negative regression / assessment topology-aware 収束 / typecheck・lint・test・build / pytest)に numbered 化。
    • Allowed Paths を investigation で確認した実際の production choke point 1点(tests/ci/test_ci_performance_gate.py)のみに縮小。scripts/ci/collect_e2e_performance_benchmark.py は本 Issue の変更対象外のため除外。
    • X-GitHub-Api-Version ヘッダー pin は topology blocker と無関係な housekeeping として Out of Scope に整理し、follow-up candidate としてのみ記録。
    • Stop Conditions に「production 公開 receipt schema の変更」と「private helper シグネチャ変更」を区別する一文を追加。

    最終 review verdict

    • Step 2(deterministic): VERDICT: approve(ISSUE_REVIEW_RESULT_COMPACT_V2、REVIEWED_BODY_SHA256: sha256:0635ee43dd2779fe8a1658c3a73f2f1f840d719ee91491481ccf83b6eee3fd0b)
    • Step 2.5(semantic): effective_verdict: approve(2周目、assessment: clear)
    • fresh contract review(run_contract_review_once.py, evidence-mode=baseline): status: go(body_sha256 一致、stale snapshot 不使用)

    起動した SubAgent とその役割

    • codebase-investigator(read-only): anchor P0 finding の独立 fact-check(a〜i 全項目)。完了・結果回収済み。
    • web-researcher(read-only): GitHub API version claim の一次資料 fact-check。完了・結果回収済み。
    • issue-editor(controlled executor 経由): reframe_in_place 本文置換(1回目)、semantic finding 反映の本文修正(2回目)。両方完了・readback 確認済み。
    • issue-design-reviewer(read-only): Step 2.5 semantic design review(1周目: findings、2周目: clear)。両方完了・結果回収済み。

    すべての SubAgent の terminal completion を待機し、結果を回収した上で次ステップへ進行した(dispatch のみで完了扱いにしていない)。

    残った blocker / follow-up

    実装状況

    本 invocation は Issue refinement のみを実施し、source code の実装・PR 作成・merge は行っていません。impl-review-loop への自動 handoff(run_root_transition())もこの invocation では起動していません(別 invocation での実行を想定)。

    LOOP_HANDOFF_RESULT_V1:
      status: impl_ready
      routing_action: run_impl_review_loop
      contract_review:
        status: go
        gate_result: fresh_go
        latest_comment_url: null
        generated_at: "2026-09-07T20:50:00Z"
        body_sha256: "sha256:0635ee43dd2779fe8a1658c3a73f2f1f840d719ee91491481ccf83b6eee3fd0b"
      metadata:
        title_prefix_ready: true
      label_sync_observation:
        kind: presentation_sync
        result: noop
        detail: "labels unchanged (enhancement, phase/implementation, agent/implementer, triage-required)"
      auto_fixes:
        result: auto_fixed
        required: []
        skipped: []
      blockers: []
      permissions:
        unavailable: []
      generated_at: "2026-09-07T20:50:00Z"
      checked_body_sha256: "sha256:0635ee43dd2779fe8a1658c3a73f2f1f840d719ee91491481ccf83b6eee3fd0b"
      checker_exit_code: 0
      missing_sections: []
      missing_contract_keys: []
  5. self-assigned this
    on Sep 7, 2026
  6. squne121 commented on Sep 7, 2026

    @squne121
    OwnerAuthor

    推奨は、#2554 の refinement をやり直さず、現在の live Issue 本文を実装契約として、そのまま canonical impl-review-loop に渡すことです。#2554 はすでに refinement 側で implementation_ready、fresh contract review status: go、routing_action: run_impl_review_loop まで到達しており、実装・PR作成は未着手と明記されています。

    実装上の重要点は、Allowed Paths を tests/ci/test_ci_performance_gate.py だけに固定し、monolith=1 physical provider / split=2 physical providers の production materialization を sample count・assessment・receipt の全経路で共通化することです。44-run 本番 experiment、manifest-file wiring、Reliability側、API version pin は対象外です。

    また「人間承認不要」は、通常の iteration / commit / push / PR / REQUEST_CHANGES 修正で承認を求めないという意味にするのが適切です。canonical Skill が定める actual Git conflict、明示的 human veto、HUMAN_REVIEW_REQUIRED、max iteration 超過などの hard stop まで無視させるのは Skill 契約と矛盾します。一方、SubAgent の単なる human_review_required: true 自己申告や BLOCKED/UNSTABLE 等だけでは即 human escalation せず、既定ルーティングを継続する仕様になっています。

    その前提で、以下をそのまま既に auto mode で動いている Claude Code に貼るのを推奨します。

    以下を、人間の追加承認なしで可能な限り最後まで連続実行してください。

    対象 repository:
    squne121/loop-protocol

    対象 Issue:
    https://github.com/squne121/loop-protocol/issues/2554

    使用する canonical Skill:
    .claude/skills/impl-review-loop

    目的:
    Issue #2554 の現在の live contract を実装し、canonical impl-review-loop の

    Implementation → Verification → PR Review → Judgment → 必要なら fix_delta を反映して再 Implementation

    を bounded loop で自律実行し、PR を merge する直前の draft_pr_ready / merge-ready 相当まで到達することです。

    実際の merge は行わないでください。
    auto-merge も有効化しないでください。

    重要な実行方針

    Claude Code は既に auto mode で起動しています。

    • permission mode を変更しない
    • --dangerously-skip-permissions 等を追加しない
    • loop iteration ごとの人間 approval を要求しない
    • commit / push / PR作成・更新 / review fix のたびに人間確認を求めない
    • canonical Skill が自動継続可能と定義している REQUEST_CHANGES、stale-head、BEHIND、CI再検証等は自動処理する
    • ただし canonical Skill が hard stop と定義している actual Git conflict、明示的な live human veto、真正の HUMAN_REVIEW_REQUIRED、max_iterations 超過などを勝手に無効化しない

    max_iterations=3 としてください。

    0. 必ず current live state から開始する

    過去の記憶やこのプロンプト内の Issue 要約を実装 authority にしないでください。

    最初に current repository state、live Issue #2554、current branch/HEAD/worktree state、および current canonical Skill を読み直してください。

    以下を正本として読んでください。

    過去の refinement 完了報告:

    https://github.com/squne121/loop-protocol/issues/2554#issuecomment-5575542127

    は agent_report_comment_urls 相当の provenance / telemetry として参照して構いませんが、Step 1 起動 authorization として使用しないでください。

    過去の OWNER REQUEST_CHANGES:

    https://github.com/squne121/loop-protocol/issues/2554#issuecomment-5575198296

    の finding は既に current Issue 本文へ反映済みです。
    旧コメントを raw execution instruction として再適用せず、current live Issue body を実装 scope / AC の authority としてください。

    1. Root-Owned Synchronous Entry Transition を正規経路で実行する

    過去の LOOP_HANDOFF_RESULT_V1.status: impl_ready をそのまま authorization に使わないでください。

    canonical policy に従い root/main thread が同一 continuous invocation 内で、

    1. capability preflight
    2. live Issue fetch
    3. current-run issue-contract-review
    4. 直後の live Issue 再取得
    5. root entry routing
    6. route が invoke_impl_review_loop ならそのまま Step 1 起動

    までを一続きで行ってください。

    body drift 等が存在する場合も canonical root-entry routing に従って処理し、artifact freshness や古い handoff comment だけを理由に人間承認へ戻さないでください。

    2. #2554 の確定済み scope を固定する

    current live Issue が変更されていない限り、実装変更を以下に限定してください。

    Allowed Paths:

    tests/ci/test_ci_performance_gate.py

    この Issue では以下を行わないでください。

    • manifest v2 本体ファイルを production CLI input に追加
    • 新 artifact input / schema / broker の導入
    • _manifest_v2_provider_jobs_to_baselines() adapter 自体の変更
    • Reliability materializer の変更
    • RECEIPT_PERFORMANCE_ONLY_EVIDENCE_ERROR_REASONS allowlist 整理
    • X-GitHub-Api-Version housekeeping
    • close-evidence publication route
    • 44-run 本番 experiment の dispatch
    • unrelated refactor
    • Allowed Paths 外の変更

    Allowed Paths 外の変更が本当に必要と判明した場合は、silent scope expansion をせず canonical Stop Condition として扱ってください。

    3. 実装時に守る semantic contract

    current live Issue 本文の AC1〜AC8 をすべて満たしてください。

    特に以下を implementation-worker に明示してください。

    monolith

    物理 Performance provider は e2e-core 1個です。

    同一 e2e-core baseline の ci_runtime_baseline_v1.measurements[] に存在する有効な test_e2e* phase、特に

    • test_e2e_ci
    • test_e2e_monolith_responsive

    を一度だけ合計し、その workflow_run_id の duration observation としてください。

    synthetic な e2e-responsive-matrix baseline / record を生成してはいけません。

    既存の _pair_by_workflow_run_id() 等の 2-sided pair invariant を維持するため、current Issue が定めている通り、monolith では同じ e2e-core baseline object を core / responsive 両レーンへ渡す方式を優先してください。

    同一 physical provider の timing evidence を二重計上してはいけません。

    split

    既存どおり

    • e2e-core
    • e2e-responsive-matrix

    を同一 workflow_run_id で pair し、duration は

    max(core, responsive)

    を維持してください。

    responsive provider が本当に欠落している split run は、既存の
    missing_pair_e2e-responsive-matrix
    等の fail-closed semantics を維持してください。

    consumer convergence

    以下すべてが同一 topology-aware materialization semantics を利用するようにしてください。

    • run_evidence_gate() pairing
    • provider post-filter sample count
    • percentile / assessment input
    • run-details
    • build_close_grade_receipt()
    • _materialize_close_grade_arm()

    adapter test だけ green で production path が壊れたまま、という実装を禁止します。

    4. SubAgent を必ず使用する

    root/main thread は control-plane に徹してください。

    canonical Skill に従い、少なくとも以下を SubAgent に委譲してください。

    Step 1

    implementation-worker

    implement-issue Skill を実行させ、

    • canonical worktree/branch の準備
    • implementation
    • focused verification
    • commit
    • push
    • PR 起票または既存PR更新

    まで行わせてください。

    Step 2

    test-runner

    candidate HEAD に対して Issue #2554 の Verification Commands を独立実行させてください。

    Step 4

    pr-reviewer

    candidate HEAD と live Issue contract を対象に pr-review-judge の canonical review を実行させてください。

    5. SubAgent の完了待機は必須

    これは重要です。

    SubAgent を dispatch しただけで完了扱いにしないでください。

    各 SubAgent について、

    1. dispatch
    2. terminal completion まで待機
    3. canonical structured result を回収
    4. schema / head binding / status を確認
    5. LOOP_STATE に反映
    6. その後でのみ次 Step へ進む

    という順序を守ってください。

    複数 SubAgent を並列起動した場合も、起動した全 SubAgent の terminal completion を待ち、全結果を回収してから control-plane に合流してください。

    散文の途中報告を canonical structured output の代替にしないでください。

    agent discovery が一時的に失敗した場合は canonical recovery routing に従い、bounded live-reload retry → candidate-head fresh direct invocation 等の既存 recovery を使ってください。回復可能な discovery failure だけで人間を呼ばないでください。

    6. Verification

    Issue #2554 の literal Verification Commands を current live body から取得し、そのまま authoritative command set としてください。

    少なくとも現在の contract では以下が必要です。

    uv run --locked pytest tests/ci/test_ci_performance_gate.py -q
    
    pnpm typecheck
    pnpm lint
    pnpm test
    pnpm build

    AC1〜AC6/AC8 は focused pytest で deterministic に検証してください。

    特に regression test で最低限確認すること:

    • monolith 20 run → provider post-filter sample count == 20
    • monolith 20 run → arms.monolith.performance_eligible_workflow_run_ids が20件
    • monolith 1 run duration == 2つの対象 test_e2e phase の合計
    • synthetic responsive record が存在しない
    • split 20 run → max(core, responsive) semantics 維持
    • split responsive missing → existing fail-closed behavior 維持
    • percentile / assessment / run-details / receipt が同一 materialized observation path に収束

    Runtime Verification Applicability は Issue contract の not_applicable を尊重してください。

    #2554 のために live 44-run experiment や追加 workflow_dispatch を実行しないでください。
    それは #2155 の責務です。

    通常の PR CI / required checks は別であり、merge-ready 判定のため必要に応じて完走を待ってください。

    7. Step 4 current-head gate を省略しない

    PR review 起動直前に canonical current-head gate を実行してください。

    Step 2 の verification result が、

    • current PR head SHA
    • current Issue body SHA256
    • current literal Verification Commands

    と一致していることを再確認してください。

    stale なら pr-reviewer を起動せず Step 2 を再実行してください。

    PR review 中または review 後に HEAD が変化した場合、古い review を再利用せず current HEAD で再 review してください。

    8. REQUEST_CHANGES は自動修正する

    pr-reviewer が REQUEST_CHANGES を返した場合、人間の承認を求めないでください。

    blockers を structured fix_delta として implementation-worker に渡し、

    Implementation
    → Verification
    → PR Review

    を再実行してください。

    fix_delta の修正だけを行い、Issue scope を勝手に拡大しないでください。

    BEHIND なら canonical update_branch route を実行し、その後 Verification / PR Review をやり直してください。

    reviewed head が stale なら current head で再 review してください。

    UNKNOWN mergeability は canonical bounded retry を行ってください。

    SubAgent が単に human_review_required: true を自己申告しただけでは停止せず、canonical #1860 routing に従って warning として扱って継続してください。

    9. 外部調査

    本 Issue は current repository 内の Performance materialization semantics と deterministic pytest が中心であり、refinement 段階で外部 claim の fact-check も完了しています。

    current implementation 中に新たな外部仕様依存が発生しない限り、追加 Web research は不要です。

    LOOP_STATE の external_research_skip_basis には例えば、

    internal-only topology/materialization change; live Issue contract and repository tests are authoritative; no new external API behavior introduced

    相当を記録してください。

    外部仕様が本当に implementation correctness を左右する新事実を発見した場合のみ、canonical external-research route を利用してください。

    10. PR と merge-ready 判定

    PR を作成または更新し、candidate branch を push してください。

    PR本文は current Issue #2554 の Outcome / AC / Verification と実装内容が対応するよう更新してください。

    Closes #2554 の扱いは repository の canonical open-pr policy に従ってください。

    最終終了条件は canonical impl-review-loop に従い、

    • pr-reviewer verdict == APPROVE
    • blockers == []
    • reviewed_head_sha == current PR head
    • live mergeability == CLEAN または HAS_HOOKS
    • current-head verification が有効
    • required CI / branch policy が merge-ready を妨げていない
    • Allowed Paths gate が通っている

    ことです。

    これを満たしたら、

    IMPL_REVIEW_LOOP_RESULT_V1.status: draft_pr_ready

    相当を emit して終了してください。

    PR は merge しないでください。
    auto-merge も有効化しないでください。

    11. 最終報告

    最後に簡潔に以下を報告してください。

    途中で通常の承認確認や進捗確認を人間へ求めず、canonical hard stop に該当しない限り最後まで連続実行してください。

    このプロンプトでは、過去の impl_ready コメントを直接 authorization にせず fresh root-entry review を通す点と、**「subagent dispatch ≠ completion」**を明示している点が特に重要です。Step 1 は実際に implementation-worker へ worktree作成・実装・検証・PR起票まで委譲することが canonical Skill に規定されています。

    また #2554 は live Issue 上で Runtime Verification が not_applicable とされているため、実装ループ中に44-run experimentまで広げない方がよいです。focused pytest と通常の PR CI までで merge直前状態を作り、44-run は #2155 に残すのが契約どおりです。

  7. squne121 commented on Sep 7, 2026

    @squne121
    OwnerAuthor

    root-owned entry router audit

    route: invoke_impl_review_loop
    reason: fresh_review_go_live_equality

  8. squne121 commented on Sep 7, 2026

    @squne121
    OwnerAuthor

    implement-issue: 実装完了 (2026-09-07T21:18:21Z)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

agent/implementerenhancementphase/implementationtriage-required

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions