Repository navigation
Description
Machine-Readable Contract
contract_schema_version: v1
issue_kind: implementation
parent_issue: "#2093"
goal_ref: "#2093 Goal(2): component-VRT CheckRun provenance を triggering workflow_run と strict attempt に結合する"
change_kind: mixed
external_interfaces:
- "GitHub Actions workflow runs/jobs REST API (read-only)"
- "GitHub Checks exact CheckRun REST API (read-only)"Parent Issue
Parent Goal Ref
- Goal:
component-vrt-reportCheckRun provenance を exact triggering workflow run / attempt に結合し、同じ head/name/App でも別 run/attempt 由来の証拠を拒否する。 - Desired Destination:
visual-impact-policy-trustedが exact CheckRun provenance の残存 bypass を final verdict で fail-closed にできる。
Current Validated Scope
- Fresh source baseline is main
acb422b5f24b93c4ee6aea5518ad57b072f384e0; the decision/evidence record is issuecomment-5305059057. - The old premise is retracted: exact
GET /check-runs/{id}re-verification and an Actions jobs join are not implemented in the base-locked trusted consumer.visual-impact-trusted-consumer.ymlre-derives other trusted inputs but neither retrieves triggeringworkflow_run.idplusrun_attemptattempt-specific jobs, uniquely identifiescomponent-vrt-report, follows that job'scheck_run_url, nor independently fetches its exact CheckRun. - In
scripts/agent-ops/resolve_visual_impact.py,build_evidence_from_manifest_v2()currently establishescheckrun_boundfrom non-emptytrusted_check_run_idplustrusted_check_conclusion == "success";verify_trusted_artifact()accepts no expected workflow-run identity or attempt. It therefore cannot prove the job/run/attempt ↔ exact CheckRun relation. ci.ymlis candidate-controlled producer context. Its metadata or commit-level CheckRun selection cannot be a trust root for the final verdict. This aligns with PR fix: visual-impact-policy-trusted の trusted-side re-derivation で forged-self-consistent artifact bypass を fail-closed に修正する #2094's Safety Claim Matrix residual gap and its 実装: visual-impact-policy-trusted の残存検証ギャップ(TS import graph 到達可能性・CheckRun identity・reusable workflow pinning)を縮小する #2093 follow-up.- fix: visual-impact-policy-trusted の trusted-side re-derivation で forged-self-consistent artifact bypass を fail-closed に修正する #2094's residual provenance gap is addressed here. The evidence-recovery harness failure is isolated to 実装: fix: recover source evidence before refinement human escalation #2195.
Remaining Parent Gaps
- Same-run candidate-controlled producer integrity remains with 調査: visual-impact-policy の same-run producer authenticity 保証(固定 producer / full-SHA pinned reusable workflow / artifact attestation)採用可否を決定する #2101.
- Evidence-recovery harness remediation remains with 実装: fix: recover source evidence before refinement human escalation #2195.
Security Property
- Controlled: fail-closed rejection of a
component-vrt-reportCheckRun substituted from a differentworkflow_run.idorrun_attempt, even when head SHA, CheckRun name, andgithub-actionsApp identity match. - Not controlled: a candidate-controlled producer forging a job, artifact, or evidence within the same workflow run. That producer-integrity boundary belongs to 調査: visual-impact-policy の same-run producer authenticity 保証(固定 producer / full-SHA pinned reusable workflow / artifact attestation)採用可否を決定する #2101 (immutable producer / attestation) and is not claimed as solved here.
Outcome
The visual-impact-policy-trusted base-locked consumer uses triggering workflow_run.id and strict run_attempt to retrieve attempt-specific jobs, joins the exactly-one component-vrt-report job's check_run_url to an independently fetched exact CheckRun API response, and validates that trusted tuple at the final verify_trusted_artifact() or provenance final-authentication point. A different-run or different-attempt same-head/name/App CheckRun substitution is rejected fail-closed by the final trusted verdict, with positive and adversarial tests proving that limited boundary.
In Scope
- Implement trusted-side acquisition in
.github/workflows/visual-impact-trusted-consumer.yml: triggering run identity, strict attempt-specific jobs pagination, exact job cardinality, and exact CheckRun retrieval. Candidate-head code must not be checked out or executed. - Implement a pure fail-closed provenance verifier and thread the trusted tuple to the final verdict in
scripts/agent-ops/resolve_visual_impact.py. - Add trusted-consumer and pure-verifier regression tests, including exact positive and single-field run-identity mutants.
- Record fresh source evidence in the PR and preserve the scoped security boundary above.
Out of Scope
- Changing
ci.ymlor treating candidate-producer metadata as the final-verdict trust root. - Same-run candidate-controlled producer integrity, immutable producer, or attestation work (調査: visual-impact-policy の same-run producer authenticity 保証(固定 producer / full-SHA pinned reusable workflow / artifact attestation)採用可否を決定する #2101).
- Trusted transitive reachability and other 実装: visual-impact-policy-trusted の残存検証ギャップ(TS import graph 到達可能性・CheckRun identity・reusable workflow pinning)を縮小する #2093 children.
- Evidence-recovery harness failures (実装: fix: recover source evidence before refinement human escalation #2195).
Acceptance Criteria
- AC1: The PR records fresh source evidence and baseline commit
acb422b5f24b93c4ee6aea5518ad57b072f384e0, including the current missing trusted run/attempt/jobs/CheckRun join and the fix: visual-impact-policy-trusted の trusted-side re-derivation で forged-self-consistent artifact bypass を fail-closed に修正する #2094 residual-gap correlation. - AC2: The trusted consumer treats
github.event.workflow_run.idandgithub.event.workflow_run.run_attemptas trusted root identity. The policy is strict: jobs and CheckRuns from an earlier attempt of the same run are not accepted. - AC3: The consumer retrieves all pages of the expected run/attempt-specific Actions jobs resource and selects exact-name
component-vrt-reportwith cardinality exactly one. Zero or multiple matches, or incomplete pagination, fail closed. - AC4: From the unique job's
check_run_url, the consumer extracts the exact CheckRun ID and independently retrieves that exact CheckRun API resource. The job URL must be an expected repository Checks path and responseidmust equal requested ID. - AC5: The trusted-side verifier validates the complete tuple: CheckRun
id, exactname(component-vrt-report),head_sha,status == completed,conclusion == success,app.id, andapp.slug; jobrun_id,head_sha,name,conclusion, and exact job→CheckRun relation; and expected workflow-run ID plus strict run attempt. App metadata is derived from the exact trusted CheckRun response, never producer self-report. - AC6: API error, malformed JSON, missing or ill-typed required field, incomplete pagination, and zero/multiple job cardinality all fail closed at the final trusted verdict.
- AC7: A positive exact fixture (expected run, attempt, job, and CheckRun) is accepted by final
verify_trusted_artifact()or the provenance final-authentication point. - AC8: A single run-identity-field mutant of that positive fixture makes final
verify_trusted_artifact()or the provenance final-authentication point returnok=falsewith a taxonomy-consistent reason. The formal literal reason name must follow the source taxonomy. The different-run mutant changes onlyjob.run_idor another single run-identity field while preserving head SHA, CheckRun ID/name/App/conclusion, and artifact digest. - AC9: Regression tests cover wrong attempt, zero job, duplicate job, malformed or missing trusted API payload, API failure, and incomplete pagination; each expects a final fail-closed verdict.
- AC10: A sanitized live GitHub API proof reads an existing workflow run, its strict-attempt jobs, and the exact job CheckRun without mutating GitHub state, and verifies the trusted run/attempt join.
Verification Commands
# Pre-implementation baseline: the new adversarial module is absent, so this must fail until implementation exists.
# baseline-expect: fail
$ uv run --locked pytest scripts/agent-ops/tests/test_resolve_visual_impact_checkrun_adversarial.py -q
# AC1
# baseline-expect: pass
$ git show --no-patch --format='%H' acb422b5f24b93c4ee6aea5518ad57b072f384e0
# AC2
# baseline-expect: fail
$ uv run --locked pytest scripts/agent-ops/tests/test_resolve_visual_impact_checkrun_adversarial.py -q
# AC3
# baseline-expect: fail
$ uv run --locked pytest scripts/agent-ops/tests/test_resolve_visual_impact_checkrun_adversarial.py -q -k job_cardinality_or_pagination
# AC4
# baseline-expect: fail
$ uv run --locked pytest scripts/agent-ops/tests/test_resolve_visual_impact_checkrun_adversarial.py -q -k exact_checkrun_lookup
# AC5
# baseline-expect: fail
$ uv run --locked pytest scripts/agent-ops/tests/test_resolve_visual_impact_checkrun_adversarial.py -q -k trusted_provenance_tuple
# AC6
# baseline-expect: fail
$ uv run --locked pytest scripts/agent-ops/tests/test_resolve_visual_impact_checkrun_adversarial.py -q -k malformed_or_api_failure
# AC7
# baseline-expect: fail
$ uv run --locked pytest scripts/agent-ops/tests/test_resolve_visual_impact_checkrun_adversarial.py -q -k exact_checkrun_belongs_to_triggering_run_is_accepted
# AC8
# baseline-expect: fail
$ uv run --locked pytest scripts/agent-ops/tests/test_resolve_visual_impact_checkrun_adversarial.py -q -k same_identity_checkrun_from_different_run_is_rejected
# AC9
# baseline-expect: fail
$ uv run --locked pytest scripts/agent-ops/tests/test_resolve_visual_impact_checkrun_adversarial.py -q
# baseline-expect: pass
$ uv run --locked pytest scripts/agent-ops/tests/test_visual_impact_trusted_consumer.py -q
# baseline-expect: pass
$ uv run --locked pytest scripts/agent-ops/tests/test_visual_impact_v2_manifest_seams.py scripts/agent-ops/tests/test_visual_impact_decision_binding.py -q
# baseline-expect: fail
$ uv run --locked pytest scripts/agent-ops/tests/test_resolve_visual_impact_checkrun_adversarial.py -q
# baseline-expect: pass
$ git diff --check
# baseline-expect: pass
$ pnpm typecheck
# baseline-expect: pass
$ pnpm lint
# baseline-expect: pass
$ pnpm test
# baseline-expect: pass
$ pnpm build
# baseline-expect: pass
$ uv run --locked pytest .claude/skills/gemini-cli-headless-delegation/tests/test_model_routing.py -q
# AC10
# baseline-expect: fail
$ uv run --locked pytest scripts/agent-ops/tests/test_resolve_visual_impact_checkrun_adversarial.py -q -k runtime_verification- AC2–AC6: The trusted-consumer workflow must pass actionlint before merge; this prose requirement is not a formal preflight execution command.
- AC10: The sanitized read-only runtime API proof described below must run in its declared authenticated environment against a completed pull-request run, strict-attempt jobs, and the unique exact CheckRun; this is not a formal preflight execution command.
Runtime Verification Applicability
runtime_verification_applicability:
decision: immediate
reason: "This change adds trusted provenance GitHub API I/O; a sanitized read-only proof is pre-merge executable."
applicable_acs: [AC10]
execution_environment: "Authenticated GitHub Actions runner or test-runner environment with read-only gh API access"
skip_conditions: "gh unavailable; authentication unavailable; or network unavailable before proof execution"
fallback_policy: "No fallback endpoint, producer artifact, or alternate selection is accepted; any _*_fallback: true is FAIL (exit 1)."
artifact_requirements: "Test-runner writes artifacts/runtime-verification-AC10-<timestamp>.log with policy-required sanitized evidence."- Runtime VC: test-runner reads a completed
cipull-request run, exhausts its strict-attempt jobs endpoint, requires exactly onecomponent-vrt-report, and reads that job'scheck_run_urlas the exact CheckRun. Transport, HTTP, parse, missing-field, cardinality, or join failure is FAIL (exit 1). - SKIP: before proof execution, unavailable
gh, authentication, or network printsSKIP:first and exits 77; test-runner recordsstop_condition_triggered: true. SKIP is not PASS. - Evidence: record only sanitized identifiers, endpoint class, exit code, and verdict; never tokens or unredacted API bodies.
Allowed Paths
.github/workflows/visual-impact-trusted-consumer.ymlscripts/agent-ops/resolve_visual_impact.pyscripts/agent-ops/tests/test_visual_impact_trusted_consumer.pyscripts/agent-ops/tests/test_resolve_visual_impact_checkrun_adversarial.py
Stop Conditions
-
A required change outside Allowed Paths, including
ci.yml, or a requirement to trust candidate-controlled producer metadata as a trust root. -
Strict attempt-specific jobs or the exact CheckRun endpoint cannot be obtained with existing workflow-token permissions without privilege escalation.
-
Runtime VC returns SKIP (exit 77): escalate for execution environment; do not treat it as PASS. A fallback-only success is FAIL.
-
API error, ambiguous cardinality, malformed trusted response, or inability to produce a final fail-closed verdict.
-
A required change to 調査: visual-impact-policy の same-run producer authenticity 保証(固定 producer / full-SHA pinned reusable workflow / artifact attestation)採用可否を決定する #2101 same-run producer-integrity boundary or 実装: fix: recover source evidence before refinement human escalation #2195 evidence-recovery scope.
-
Allowed Paths 外の変更が必要と判明した場合
-
In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
-
新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
-
後続 Phase / 別スコープへの波及が判明した場合
-
nested SubAgent delegation が必要になった場合
-
外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
Required Skills
ci-test-performance— trusted-consumer workflow changes require lane classification andCI_TEST_PERFORMANCE_DECISION_V1PR evidence.
Required Design References
docs/dev/visual-impact.schema.jsondocs/dev/runtime-verification-policy.md.github/workflows/visual-impact-trusted-consumer.yml.github/workflows/ci.yml(read-only candidate-producer boundary reference; not an Allowed Path)scripts/agent-ops/tests/test_visual_impact_trusted_consumer.pyscripts/agent-ops/tests/test_visual_impact_v2_manifest_seams.pyscripts/agent-ops/tests/test_visual_impact_decision_binding.py- GitHub Checks REST: check runs
- GitHub Actions REST: workflow jobs
- GitHub Actions workflow_run security guidance
Scope Delta(任意)
test-only→trusted-side provenance implementation + adversarial tests.
Scope Collision Resolution
This section fixes only the boundary between already-defined siblings; it does not expand In Scope, Acceptance Criteria, or Allowed Paths.
Disjoint anchors
- 実装: visual-impact-policy-trusted の CheckRun provenance に exact workflow_run.id binding の adversarial negative control を追加する #2100 only: the trusted-consumer triggering
workflow_runidentity, strictrun_attemptjobs pagination/cardinality, exactcomponent-vrt-reportjob-to-check_run_urlacquisition and exact CheckRun retrieval, the pure provenance verifier, and the new adversarial module that proves the final fail-closed run/attempt binding. - 調査: visual-impact-policy の same-run producer authenticity 保証(固定 producer / full-SHA pinned reusable workflow / artifact attestation)採用可否を決定する #2101: reusable-workflow full-SHA pinning and artifact attestation / producer-integrity are disjoint. CheckRun provenance binding is explicitly out of scope for 調査: visual-impact-policy の same-run producer authenticity 保証(固定 producer / full-SHA pinned reusable workflow / artifact attestation)採用可否を決定する #2101; 実装: visual-impact-policy-trusted の CheckRun provenance に exact workflow_run.id binding の adversarial negative control を追加する #2100 does not implement pinning or attestation.
- 実装: visual-impact-policy-trusted の PR body 独立検証を producer 側改行取り扱いと一致させ pr_body_digest_mismatch 誤検知を解消する #2145: trusted-consumer PR-body retrieval newline handling only. CheckRun identity is explicitly out of scope for 実装: visual-impact-policy-trusted の PR body 独立検証を producer 側改行取り扱いと一致させ pr_body_digest_mismatch 誤検知を解消する #2145; 実装: visual-impact-policy-trusted の CheckRun provenance に exact workflow_run.id binding の adversarial negative control を追加する #2100 does not change PR-body retrieval or
pr_body_sha256handling. - 実装: visual-surface dependency registry と required visual-impact policy check を導入し、UI変更PR内でVRT処置を強制する #2019: the initial trusted-consumer, registry, policy, DAG, CODEOWNERS, and
ci.ymlscope. 実装: visual-impact-policy-trusted の CheckRun provenance に exact workflow_run.id binding の adversarial negative control を追加する #2100 is the separate 実装: visual-impact-policy-trusted の残存検証ギャップ(TS import graph 到達可能性・CheckRun identity・reusable workflow pinning)を縮小する #2093 Goal(2) child and does not change the registry, policy, DAG, CODEOWNERS, orci.yml.
Collision procedure
Before implementation, read back each named open issue and its merged or active PRs. If one has changed the same named anchor first, rebase the #2100 implementation branch onto current main, then inspect the resulting conflict and actual diff. If there is an actual code-diff conflict, stop rather than resolve it by broadening this contract; obtain owner coordination or a separate follow-up. Shared file presence alone is not a conflict.
Notes for Reviewer
- Priority P1. The OWNER decision/evidence comment authorizes
reframe_in_place; no residual human policy choice remains. - Confirm the formal reason-code literal against the existing taxonomy and assert the literal final reason as well as
ok=false; do not permit an unrelated failure to satisfy AC8. - Scope collision: fix: visual-impact-policy-trusted の trusted-side re-derivation で forged-self-consistent artifact bypass を fail-closed に修正する #2094 / PR 実装: visual-impact-policy-trusted に TS import graph transitive reachability の trusted-side 独立検証を追加する #2144 touched the visual-impact verifier and trusted consumer; 調査: visual-impact-policy の same-run producer authenticity 保証(固定 producer / full-SHA pinned reusable workflow / artifact attestation)採用可否を決定する #2101 owns same-run producer integrity; 実装: fix: recover source evidence before refinement human escalation #2195 owns evidence-recovery harness failure. Read back open collisions before implementation.
ci.ymlremains a required read-only design reference because it defines candidate-producer context, but it is explicitly not an Allowed Path.
Activity
squne121 commentedon Aug 15, 2026
結論
判定: REQUEST_CHANGES。現状の #2100 は「負のテスト追加だけで完了できる Issue」としては実装着手不可です。
最大の問題は、
Current Validated Scopeが「exact CheckRun API と Actions jobs API によるworkflow_run.id結合は既に実装済みで、欠けているのは adversarial test だけ」としている点です。2026年8月15日時点のmainHEAD1cc7515814d5f0142661e64cda450575eb8df7c3では、この前提は成立していません。むしろ、前提実装である PR #2094 自身の Safety Claim Matrix は、component-VRT CheckRun の live API 再取得を not controlled と明記しています。
また、OWNER の元指摘も、必要なのは単なる App identity 検証ではなく、exact CheckRun ID を exact Actions job に結び、さらに triggering
workflow_run.idと一致させることだとしています。#2100 自体にはコメントがなく、実装 PR も確認できませんでした。したがって、Issue 本文の誤った現状認識を補正する後続合意はまだありません。
実際に残っている攻撃面
現在のリポジトリでは、同一 commit SHA に同じ
component-vrt-report名、同じgithub-actionsApp を持つ複数の CheckRun が現実に発生しています。確認した実例では、一方が workflow run31887260548の成功 CheckRun、もう一方が run31887973613のキャンセル済み CheckRunでした。つまり、OWNER が想定した「same head/name/app, different run」の衝突は仮説ではなく、通常運用上すでに発生しています。現在の経路は次のとおりです。
ci.ymlは commit の CheckRun 一覧を取得します。name == component-vrt-report、status == completed、app.slug == github-actionsで絞り、completed_atの新しいものを選択します。checkrun_boundは、CheckRun ID が空でなく、conclusion がsuccessであることしか要求していません。visual-impact-trusted-consumer.ymlは、exact CheckRun API response や exact run の jobs response を取得せず、triggeringworkflow_run.idも verifier に渡していません。現在の commit-level 選択処理は、workflow run ID ではなく名前・App・完了時刻に依存しています。
Python 側も、
trusted_check_run_idが存在し conclusion が成功ならcheckrun_boundを成立させており、suite ID、App ID、App slug、workflow run ID の相互関係をその述語では検証していません。trusted consumer の verifier 呼び出しにも CheckRun/jobs の trusted API payload や expected workflow run ID はありません。
したがって、同一 SHA 上の別 run 由来 CheckRun を選んだ場合、それを当該 triggering run の証拠として区別できません。実際に bypass になるか availability failure になるかは、選択時の時系列と各 CheckRun の conclusion に依存しますが、少なくとも provenance claim は成立していません。
阻害事項
B1 —
Current Validated Scopeが事実と逆です#2100 は「実装済み、テストだけ欠落」としていますが、現在の実装は以下の状態です。
GET /check-runs/{id}による独立再取得が trusted consumer にないrun_idとgithub.event.workflow_run.idの一致検証がないworkflow_run_idに任意値を入れ、trusted 側からは CheckRun ID と成功 conclusion だけを渡して成功を期待している最後の点は、既存テスト自身が run binding の欠落を固定していることを意味します。
必要な修正: Issue kind は引き続き implementation でよいものの、Outcome と In Scope を「test-only」から「trusted-side provenance implementation + adversarial tests」へ変更する必要があります。
B2 — trust boundary が誤っています
ci.ymlは PR candidate が変更可能な producer workflow です。ここで取得・選択した CheckRun metadata は、trusted observation ではありません。GitHub は
workflow_runについて、triggering workflow が制限されていても、後続 workflow は secrets や write token を利用できるため、untrusted artifact や untrusted code の処理が脆弱性につながると明示しています。したがって、CheckRun provenance の取得と結合は、default branch から実行される trusted consumer 内で行う必要があります。([GitHub Docs]1)現在の Allowed Paths は以下だけに限定されており、正しい修正ができません。
scripts/agent-ops/resolve_visual_impact.py少なくとも次を追加すべきです。
ci.yml側の既存 producer selection は診断用途として残すことはできますが、trusted verdict の根拠にしてはいけません。B3 — AC3 の検証対象が誤っています
#2100 は negative fixture を
resolve_trusted_minimum()経由で検証しようとしています。しかし、この関数の主責務は trusted-side の最小 visual-impact requirement の再導出であり、CheckRun provenance の最終認証点ではありません。その経路でテストが green になっても、以下は証明できません。
verify_trusted_artifact()が不一致を拒否するvisual-impact-policy-trustedCheckRun が failure になる必要な修正: dedicated verifier を導入するか、少なくとも
verify_trusted_artifact()の最終ok=Falseと専用 reason code までテストしてください。推奨インターフェースは概ね次です。
その他の重大な不足
P1 — Verification Commands が実装の存在を証明しません
現在の AC1 は
rg workflow_run_idですが、workflow_run_idはすでに manifest schema のフィールドとして存在します。そのため、結合処理が一切なくてもコマンドは成功します。AC2 の
test -fもファイルの存在しか証明しません。AC3 のpytest -k different_run_idも、baseline の正常系が受理され、その単一フィールドだけを変えた mutant が最終 verdict で拒否されたことを保証しません。必要なのは、同一 fixture から作る一フィールド mutant です。
これにより、別の理由でたまたま失敗しているテストを排除できます。
P1 — rerun / run attempt の契約がありません
GitHub Actions では一つの workflow run ID に複数の run attempt が存在します。
公式 API では、通常の jobs endpoint は既定で最新 attempt の jobs を返し、
filter=allでは過去 attempt も含めます。さらに、attempt number を指定する専用 jobs endpoint もあります。([GitHub Docs]2)したがって #2100 は、次のどちらかを明示的に選ばなければなりません。
厳密 attempt binding
run-scoped binding
現在の Issue は単に
run_idとだけ書いており、partial rerun や failed-jobs rerun で何を正解とするか決まりません。安全性だけでなく、正常な rerun を誤拒否する可用性問題にもなります。P1 — API join の cardinality と pagination が未定義です
GitHub の exact CheckRun endpoint は、ID により一つの CheckRun を取得でき、レスポンスには
id、name、head_sha、status、conclusion、check_suite、appが含まれます。commit 上の一覧を時刻順に探索する必要はありません。([GitHub Docs]3)Actions jobs response には
run_id、workflow_name、head_sha、check_run_url等が含まれるため、exact CheckRun ID と exact run ID の結合が可能です。([GitHub Docs]2)契約には最低限、以下を追加すべきです。
idが requested ID と一致head_shaが live PR head と一致nameが exact expected namestatus == completedconclusion == successcheck_suite.id、app.id、app.slugは trusted response から導出check_run_urlが exact CheckRun ID を指す項目が ちょうど一件run_idが expected triggering run ID と一致head_sha、name、conclusionも一致workflow_nameは候補 branch が制御可能な表示名なので、それだけに依存せず、event または workflow run API のworkflow_id、path、repository identity も defense-in-depth として固定すべきです。workflow run API はrun_attempt、workflow_id、head_sha等を提供します。([GitHub Docs]4)P1 — #2100 が閉じる安全性境界を狭く明記すべきです
exact run binding が閉じるのは、別 workflow run からの CheckRun substitution です。
これは、candidate-controlled
ci.ymlが同一 run 内に偽のcomponent-vrt-reportjob を作り、それを成功させる攻撃までは防ぎません。すべての GitHub Actions job は同じgithub-actionsApp identity を持ち得るためです。この producer integrity 問題は #2101 が扱っており、同 Issue は candidate-controlled workflow が正しい名前・schema・digest の artifact を自作しても trusted gate を成功させられないことを目標にしています。
#2100 には明示的に次を追加してください。
「CheckRun provenance が完全に trusted になった」といった広すぎる claim は避けるべきです。
P2 — validated HEAD と collision inventory が古いです
#2100 の fact-check は
3559ad21を基準にしていますが、現在の main は1cc75158...です。その間に PR #2144 が同じ visual-impact verifier、trusted consumer、テスト資産を変更してマージされています。着手前に以下が必要です。
Current Validated Scopeを現行 main で再調査Scope Collision に 実装: visual-impact-policy-trusted に TS import graph transitive reachability の trusted-side 独立検証を追加する #2099 / PR 実装: visual-impact-policy-trusted に TS import graph transitive reachability の trusted-side 独立検証を追加する #2144 と 調査: visual-impact-policy の same-run producer authenticity 保証(固定 producer / full-SHA pinned reusable workflow / artifact attestation)採用可否を決定する #2101 を追加
Required Skills: なしを撤回Required Design References に以下を追加
.github/workflows/ci.yml.github/workflows/visual-impact-trusted-consumer.ymltest_visual_impact_trusted_consumer.pytest_visual_impact_v2_manifest_seams.pyworkflow_runsecurity guidanceRuntime Verification Applicability も追加し、unit fixture は即時実行、live GitHub API canary はネットワーク・権限依存として別扱いにするべきです。
推奨する修正版アーキテクチャ
重要なのは、artifact に書かれた
workflow_run_id、check_suite_id、App slug、conclusion を「証拠」として信頼しないことです。これらは trusted consumer が GitHub API から独立取得した値との照合対象に留めます。置き換えるべき Acceptance Criteria
Trusted acquisition
visual-impact-trusted-consumer.ymlが exact CheckRun ID と exact triggering workflow run の jobs を独立取得し、API payload を verifier に渡す。Positive control
exact CheckRun が expected run/attempt に属する fixture は、最終
verify_trusted_artifact()まで成功する。Different-run mutant
head SHA、CheckRun name、App、suite、conclusion、artifact digest を維持し、job の
run_idだけを変更した fixture が専用 reason code で拒否される。Cardinality
CheckRun ID に対応する job が0件または複数件なら拒否する。
Attempt semantics
initial run、rerun-all、failed-job rerun、過去 attempt の CheckRunについて、許容・拒否方針がテストで固定されている。
Fail-closed transport
GitHub API non-2xx、pagination 不完備、malformed JSON、missing field、型不正をすべて final failure にする。
Final-gate regression
dedicated verifier 単体だけでなく、trusted consumer の final CheckRun conclusion が failure になることを確認する。
Security boundary
PR evidence に「cross-run substitution は controlled、same-run fraudulent producer は 調査: visual-impact-policy の same-run producer authenticity 保証(固定 producer / full-SHA pinned reusable workflow / artifact attestation)採用可否を決定する #2101 まで not controlled」と明記する。
推奨 Verification Commands
個別テストには少なくとも次の名前を持たせ、positive control と一対で実行すべきです。
最終判定
#2100 の問題設定と P1 優先度は妥当です。しかし、現在の contract は「既存実装の negative test 補完」ではなく、trusted consumer に欠けている exact CheckRun → exact Actions job → exact workflow run/attempt binding の実装 Issueとして書き換える必要があります。
B1〜B3を修正せず、現在の Allowed Paths と Verification Commands のまま実装すると、テストは追加されても実際の provenance gap は閉じません。
squne121 commentedon Aug 15, 2026
Issue refinement loop: human escalation
insert_baseline_expect_failfailed_no_mutationhuman_judgment_requiredlive body の stale guard は一致しましたが、repair candidate の static readiness が
needs_fix (RDR001)だったため、controlled transaction は本文を更新せず停止しました。現在の本文 SHA-256:
1dead683661d24a93d734a50221d50fbdaf4b9ecff5c404da901b79813bc3dce次の自動処理には、RDR001 を解消した candidate body の再生成が必要です。
squne121 commentedon Aug 15, 2026
Issue #1997 の refinement を進め、本文とタイトルを実際に更新しました。readback も確認済みです。
主な改稿点は、アンカー #5302922408 の REQUEST_CHANGES を契約化したものです。
rmtree初回失敗の provenance、ENOTEMPTY/EEXISTに限定した最大1回の retry、EACCES/EPERM/EROFS/EBUSY/EIO等の fail-close、setsid()逃避 child の回帰試験、lstat(...)=ENOENTによる最終 postcondition、closed schema v1 の additive 拡張、AGY 1.1.13 と 1.1.10 の Phase A characterization を AC/VC に固定しました。Python 3.12 のrmtree(onexc=...)とsetsid()の process-group semantics も一次資料で確認しています。([docs.python.org]1)また、先行実行が停止した
PLANNER_FAIL_CLOSEDの原因だったMachine-Readable Contract/Outcome欠落も解消しています。最終状況を Issue にコメントしました:#issuecomment-5303173684。ただし、
implementation_readyは宣言していません。このChatGPT実行環境には repository-local のissue-contract-review/ SubAgent runtime を起動する executor と checkout がなく、canonical final gate の freshCONTRACT_REVIEW_RESULT_V1.status: goを実行できないためです。人間承認が必要な状態ではなく、残っているのは deterministic final gate の実行だけです。なお、「サブエージェントを使う」という指定についても、この環境では汎用 SubAgent executor が提供されていないため、使用したとは主張していません。GitHub connector で調査・改稿・readback・コメント投稿まで実施しました。repository の branch/file mutation は行っていません。
squne121 commentedon Aug 16, 2026
Issue refinement loop: human escalation
warn / proceed_with_notesinconclusivehuman_judgment_required調査では、現行の test-only 前提と、exact CheckRun API 再取得・Actions job join・
workflow_run.idbinding を実装すべきという既存レビュー指摘が整合しない可能性を検出しました。しかし、一次ソースとして必要なREPO_EVIDENCE_REF_V1の検証メタデータを得られず、repository decision を確定できませんでした。次の進行には、実装本体を含む scope へ Issue contract を改定するか、現行 test-only scope を維持する根拠の人間判断が必要です。
squne121 commentedon Aug 16, 2026
squne121 commentedon Aug 16, 2026
判断に必要な証跡のコメント投稿がなく、判断できない?
あるいは人間の認知負荷を下げるために推奨判断だけ投稿する?
なぜ「前提と、実装本体を要する既存レビュー指摘の整合性を一次ソースで確定」できないのか、なぜなぜ分析して判断する必要がある?
squne121 commentedon Aug 16, 2026
結論
#2100 は
human_judgment_requiredのまま止めず、reframe_in_placeして実装へ進めるのを推奨します。 人間に「test-only を維持するか、実装本体まで広げるか」を選ばせる案件ではありません。これは設計嗜好ではなく、current main の実装状態を確認すれば決まる事実問題です。今回の
inconclusiveは、技術的な不確定性というより evidence transport の失敗です。作業ログでは、AGY の GitHub route が source-level のREPO_EVIDENCE_REF_V1を生成できず、正しい local/Serena route は権限制約で起動できなかったため、codebase-investigator の契約上「ソースコード事実」に昇格できませんでした。にもかかわらず、その状態がrepository decision を決められない→human_judgment_requiredに変換されています。しかし、別経路で current main を直接確認すると、
resolve_visual_impact.pyの実効的な CheckRun binding はtrusted_check_run_idが非空かつ conclusion がsuccessか、という条件であり、expectedworkflow_run.idを受け取る契約がありません。 trusted consumer も triggeringworkflow_runの artifact は取得しますが、component-VRT の exact job → exact CheckRun を再取得して triggering run と結合していません。 一方、candidate 側ci.ymlは同一 head の CheckRun 群から name/App/completed_atで最新を選ぶため、run provenance の trusted binding にはなりません。さらに PR #2094 の Safety Claim Matrix 自身が、component-VRT CheckRun の live API 再照合を Implemented?
no、follow-up を #2093 と記録しています。これは #2100 の「既に実装済み、残りはテストだけ」という前提と直接矛盾します。 現在の trusted-consumer テストも、任意のworkflow_run_id="123"を manifest に置いた positive fixture が expected run ID との照合なしで通る形です。したがって推奨アクションは次です。
github.event.workflow_run.idとrun_attemptを起点に attempt-specific jobs を取得し、component-vrt-reportjob を一意に特定、そのcheck_run_urlから exact CheckRun ID を得て exact Checks API を再取得します。job のrun_id/head_sha/name/conclusionと CheckRun のid/head_sha/name/status/conclusion/appを trusted-side で照合し、0件・複数件・API failure・必須 field 欠落・pagination 不完備は fail-closed にします。GitHub の API contract 上、workflow job にはrun_id、head_sha、check_run_urlがあり、workflow run にはidとrun_attemptがあるため、この結合は構成可能です。([GitHub Docs]1)resolve_trusted_minimum()ではなく final trusted verdict に変更する。 positive fixture は exact run を受理し、そこから run identity だけを変えた single-field mutant が専用 reason code で拒否されることまで検証します。security property は「別 workflow run 由来 CheckRun substitution の拒否」に狭く限定し、同一 run 内の candidate-controlled producer integrity は 調査: visual-impact-policy の same-run producer authenticity 保証(固定 producer / full-SHA pinned reusable workflow / artifact attestation)採用可否を決定する #2101 の責務として残します。github_research → 必要なら local_asset_research/evidence_targetsの自動 recovery、environment_failureとhuman_judgment_requiredの分離、そして unavoidable escalation でも known facts / missing proof / 推奨判断 / 本当に人間が決める一点を必須化することです。issue-refinement-loop 自身も、未解決 external claim が dispositive で repository evidence から独立決定できない場合にだけ human escalation 候補とする設計です。なお、実装に GitHub API I/O が入る以上、#2100 の現在の
Runtime Verification Applicability: not_applicableも再判定対象です。リポジトリの SSOT では I/O を必要とする検証はimmediateの対象なので、read-onlygh apiを使った live positive/negative proof が pre-merge で成立するならimmediateが自然です。成立しない場合だけ、明示的な destination を持つdeferredにしてください。以下を Claude Code にそのまま渡せます。
Claude Code 作業プロンプト — Issue #2100 の再判定・契約改訂・実装再開
対象リポジトリ:
https://github.com/squne121/loop-protocol対象 Issue:
https://github.com/squne121/loop-protocol/issues/2100今回の human context:
目的は、#2100 が
human_judgment_requiredに停止した原因を解消し、事実確認で決定できる事項を人間判断へ送り返さず、Issue contract を current main の実装状態に整合させたうえで、可能なら実装・テスト・PR 作成・レビュー対応まで自律的に進めることです。最重要方針
今回の論点である
を、最初から人間の選択問題として扱わないでください。
これは current-main のソースコード・関連 PR / Issue・GitHub Actions API contract を調査すれば決められる fact question です。
調査結果が current main でも以下を示す場合、デフォルト判断は
reframe_in_placeとしてください。workflow_run.id/run_attemptを受け取っていないworkflow_run.idを最終 trusted verdict で照合していないci.ymlの commit-level CheckRun selection に依存しているこの状態なら #2100 の「実装済みで不足は adversarial test のみ」という Current Validated Scope は撤回し、trusted-side provenance implementation + adversarial tests へ改訂してください。
SubAgent 実行要件
メイン Claude Code が orchestration authority を保持してください。
必ず複数の SubAgent を使用してください。最低3系統を起動し、全 SubAgent の作業完了を待ってから、Issue コメント投稿・Issue 本文変更・最終分類・実装開始のいずれかを行ってください。
SubAgent を background 起動しただけで先へ進んではいけません。
各 SubAgent 起動後、
Task Output等の正規経路を使い、全 SubAgent が terminal state に到達するまで明示的に wait してください。1つでも未完了の SubAgent がある状態で synthesis / mutation をしてはいけません。
SubAgent 自身からの nested SubAgent delegation は禁止します。delegation はメイン Claude Code からの1階層だけにしてください。
SubAgent A — current-main source evidence
read-only で current
origin/mainを調査してください。最低限、以下を対象にします。
scripts/agent-ops/resolve_visual_impact.py.github/workflows/visual-impact-trusted-consumer.yml.github/workflows/ci.ymlscripts/agent-ops/tests/test_visual_impact_trusted_consumer.py可能なら
codebase-investigatorのlocal_asset_researchとevidence_targetsを使い、source-level claim に対して verifiedREPO_EVIDENCE_REF_V1を取得してください。特に以下を確認してください。
checkrun_boundの実際の条件verify_trusted_artifact()/ related final verifier が expected workflow run identity を入力として持つかgithub.event.workflow_run.id/run_attemptを verifier provenance に結び付けているか/check-runs/{id}を trusted consumer 内で取得するか/actions/runs/{run_id}/.../jobsを取得して exact CheckRun と join するかci.ymlの CheckRun 選択が name/App/completed_at に依存しているかworkflow_run_idを positive fixture として受理していないかlocal evidence route が権限・Serena・AGY の問題で起動不能なら、それを
environment_failure/ evidence acquisition failure として明示してください。その失敗をそのまま
human_judgment_requiredに変換しないでください。SubAgent B — refinement-loop failure の 5-Why / 再発防止
read-only で以下を調査してください。
.claude/agents/codebase-investigator.md.claude/skills/issue-refinement-loop/SKILL.md.claude/skills/issue-refinement-loop/references/anchor-comment-handling.md.claude/skills/gemini-cli-headless-delegation/references/usage-contract.mdREPO_EVIDENCE_REF_V1validator / producer今回の作業ログについて、次を5-Whyで分析してください。
inconclusiveになったかhuman_judgment_requiredになったかさらに GitHub Issue を dedupe 検索し、この failure mode を既に扱う OPEN Issue があるか確認してください。
既存 Issue が無ければ、#2100 とは別 scope で follow-up Issue の materialization を提案してください。
推奨テーマは概ね:
issue-refinement-loop の source-evidence recovery を自動化し、evidence取得失敗と human judgment を分離するですが、title / Allowed Paths / AC は current main の調査結果から決定してください。
#2100 の implementation PR にこの harness 修正を混ぜないでください。
SubAgent C — GitHub Actions API / security contract
公式 GitHub documentation の一次ソースだけを使って read-only 調査してください。
最低限:
workflow_runeventrun_attemptcheck_run_urlについて確認し、#2100 の provenance binding に必要な最小 trusted tuple を提案してください。
特に、以下のどちらを採るべきか判断してください。
workflow_run.id + run_attempt + attempt-specific jobs同一 run ID の過去 attempt を許容
安全性と決定性に問題がなければ strict attempt binding を優先してください。
全 SubAgent 完了後の synthesis
全 SubAgent の完了を確認してから、メイン Claude Code が最終判断してください。
次の evidence priority を使ってください。
fresh source と stale Issue prose が衝突した場合、stale Issue prose を authority にしてはいけません。
今回の current-main source が上記予想どおりなら、最終分類を:
reframe_in_placeとしてください。
#2100 に投稿する decision/evidence comment
Issue body を変える前に、または controlled transaction と同じ refinement flow の中で、簡潔な decision/evidence comment を残してください。
内容には必ず以下を含めてください。
inconclusiveが「技術判断不能」ではなく「要求された REPO_EVIDENCE_REF_V1 を canonical route で生成できなかった evidence acquisition failure」だったことtest-only 前提を撤回し trusted-side provenance implementation + adversarial tests に reframenoneであるなら明記「判断できないので人間が選んでください」だけのコメントは禁止です。
human escalation が本当に必要な場合でも、
を必ず書いてください。
#2100 Issue contract の推奨改訂
fresh evidence が一致した場合、controlled Issue-edit route を使用して #2100 を次の方向へ改訂してください。
Current Validated Scope
旧記述:
を撤回してください。
fresh current-main SHA と source evidence に基づき、実際に不足しているものを記述してください。
Outcome
Outcome は概ね:
visual-impact-policy-trustedの base-locked trusted consumer が、triggeringworkflow_run.id(および採用した場合run_attempt)から exact component-vrt-report Actions job と exact CheckRun を独立取得・結合し、別 workflow run / attempt 由来の同一 head・同一 name・同一 github-actions App の CheckRun substitution を final trusted verdict で fail-closed に拒否する。positive/negative adversarial tests がその境界を証明する。としてください。
Security property
明示してください。
Controlled:
別 workflow run / attempt 由来の component-vrt-report CheckRun substitution を拒否する。Not controlled:
同一 workflow run 内で candidate-controlled producer が偽 job / artifact / evidence を生成できる問題。これは #2101 の immutable producer / attestation boundary で扱う。「CheckRun provenance 全体が完全に trusted になる」など、#2101 の境界まで包含する過大 claim を禁止します。
推奨 Allowed Paths
fresh collision 調査をした上で、少なくとも必要性を評価してください。
.github/workflows/visual-impact-trusted-consumer.ymlscripts/agent-ops/resolve_visual_impact.pyscripts/agent-ops/tests/test_visual_impact_trusted_consumer.pyscripts/agent-ops/tests/test_resolve_visual_impact_checkrun_adversarial.py.github/workflows/ci.ymlは producer-side diagnostic metadata を残せるなら変更対象に含めないでください。trusted verdict の根拠を candidate-controlled
ci.ymlに置かないでください。Acceptance Criteria
最低限、次を machine-verifiable にしてください。
AC1:
fresh current-main において existing provenance behavior を調査した結果が source evidence 付きで記録される。
AC2:
trusted consumer が triggering
workflow_run.idと採用した rerun policy に必要なrun_attemptを trusted root identity として扱う。AC3:
expected run / attempt の Actions jobs を取得し、
component-vrt-reportjob を exact cardinality 1 で特定する。0件 / 複数件は fail-closed。AC4:
job の
check_run_urlから exact CheckRun ID を取得し、exact CheckRun API response を独立取得する。AC5:
少なくとも次を trusted-side で照合する。
AC6:
API error、malformed JSON、必須 field 欠落、pagination incomplete、0/multiple cardinality を fail-closed にする。
AC7:
positive fixture:
exact expected run / attempt / job / CheckRun の組を final trusted verifier が受理する。
AC8:
negative fixture:
positive fixture と同一で、run identity の一項目だけを変えた mutant が final trusted verifier で拒否される。
resolve_trusted_minimum()が失敗するだけを AC にしないでください。最終
verify_trusted_artifact()または provenance final authentication point がok=Falseになり、専用 reason code を返すことまで確認してください。例:
component_vrt_check_run_workflow_mismatchreason code の正式名は既存 taxonomy と整合させて決定してください。
AC9:
wrong run attempt / 0 job / duplicate job / malformed trusted API payload 等の adversarial cases を回帰テストする。
Verification Commands
rg workflow_run_idやtest -fのみを合格条件にしないでください。positive control と single-field negative mutant を同じ test module から実行し、
を確認できる VC にしてください。
workflow YAML の構造についても parser/static test と
actionlintを実行してください。Runtime Verification Applicability
現在の
decision: not_applicableをそのまま維持しないでください。GitHub API I/O を trusted provenance の実装に追加するため、
docs/dev/runtime-verification-policy.mdを読み直して再判定してください。read-only
gh apiを使い、既存 repository の実 workflow run / job / CheckRun を用いた sanitized live proof が pre-merge で実行可能なら:decision: immediateを優先してください。
この場合、runtime AC / VC / evidence / SKIP exit 77 / fallback FAIL の repository policy に従ってください。
candidate workflow の merge 後でないと意味のある proof が成立しないと厳密に確認できた場合だけ:
decision: deferredとし、具体的な
deferred_destinationとdeferred_verification_conditionを materialize してください。「面倒だから not_applicable/deferred」は禁止です。
Issue refinement 完了ゲート
Issue 更新後は必ず:
を再実行してください。
過去の preflight/review artifact を fresh result として再利用してはいけません。
この5つが implementation-ready になる前にコード変更へ進まないでください。
実装フェーズ
Issue contract が fresh gate を通過したら、専用 worktree で実装を開始してください。
repository root の canonical
maincheckout では:git switchgit checkoutを行わないでください。
root は control-plane / read-only 用とし、write-capable implementation は Issue #2100 専用 worktree のみで行ってください。
実装アーキテクチャ
trusted consumer は candidate-provided CheckRun metadata を trust root にしないでください。
推奨フロー:
github.event.workflow_run.id→ workflow run identity /
run_attempt→ attempt-specific jobs
→ exact
component-vrt-reportjob→ job
check_run_url→ exact CheckRun ID
→ exact Checks API response
→ trusted normalized provenance
→ final
verify_trusted_artifact()verdictproducer artifact 内の:
等は、存在するなら比較対象にはできますが trusted source にはしないでください。
API join の cardinality は曖昧な first/last/latest selection で解決せず fail-closed にしてください。
rerun
SubAgent C の公式仕様調査で反証されない限り:
workflow_run.id + run_attemptの strict attempt binding を採用してください。
attempt-specific jobs endpoint を使えるならそれを優先し、過去 attempt の同名 CheckRun を current triggering attempt の証拠として受理しないでください。
pagination
「最初の100件に無かったから不存在」と判断しないでください。
必要な API list に pagination がある場合、全ページ完了を確認するか、exact endpoint / more deterministic lookup に置き換えてください。
pagination failure / incomplete result は fail-closed としてください。
テスト
最低限:
actionlintgit diff --checkを実施してください。
Issue contract が要求する repository standard gates も実行してください。
runtime verification が
immediateなら、test-runner SubAgent を起動し、その完了を待って runtime VC を実行・証跡化してください。test-runner の完了前に PASS と報告しないでください。
impl-review-loop
実装完了後は
impl-review-loop/ repository canonical review workflow を使用してください。レビュー SubAgent を起動した場合も、必ず全レビュー SubAgent の完了を待ってから fix_delta を開始してください。
REQUEST_CHANGES が出た場合は、Issue scope 内の指摘を人間承認なしで修正し、再テスト・再レビューしてください。
bounded loop の上限までは自律継続してください。
人間停止条件は以下だけに限定してください。
単なる evidence-tool failure、テスト失敗、review finding、必要 section の追加、deterministic repair は human judgment の理由にしないでください。
PR
実装・review loop が通ったら PR を作成してください。
PR は:
Closes #2100を含めてください。
PR 本文には:
を明記してください。
マージそのものが repository policy 上 human action の場合はマージ直前まで進めて停止してください。
refinement-loop 自体の follow-up
SubAgent B が今回の evidence recovery defect を確認し、dedupe した OPEN Issue が無い場合は、#2100 の実装とは別の Issue を起票してください。
目的:
github_researchが repository prose までしか証明できず source evidence が必要な場合、local_asset_research/ targetedevidence_targetsへ自動 recovery できるhuman_judgment_requiredを別 terminal state にするこの follow-up の exact Allowed Paths / AC / VC は SubAgent B の current-main 調査から作成してください。
#2100 の Allowed Paths に無理に追加して同一 PR へ混ぜないでください。
最終報告
すべての SubAgent / test-runner / reviewer の完了を待った後、最終報告してください。
報告には:
を含めてください。
SubAgent の未完了状態で最終回答しないでください。
squne121 commentedon Aug 16, 2026
Decision / evidence:
reframe_in_placeacb422b5f24b93c4ee6aea5518ad57b072f384e0Current-main facts
visual-impact-trusted-consumer.ymlは triggeringworkflow_run.idを artifacts API のRUN_IDとして使いますが、expectedworkflow_run.id/run_attemptの attempt-specific Actions jobs を取得せず、component-vrt-reportjob を cardinality 1 で特定せず、job のcheck_run_urlから exact CheckRun API を独立取得・照合していません。resolve_visual_impact.pyのverify_trusted_artifact()は expected head SHA / repository / PR number と trusted re-derivation を検証しますが、expected workflow run identity または run attempt を入力として受け取りません。既存のcheckrun_boundは independently supplied CheckRun ID とsuccessconclusion のみで成立し、job/run/attempt との join を証明しません。これは PR #2094 の Safety Claim Matrix が residual gap として #2093 に繰り越した CheckRun provenance、run/run_attempt binding、jobs↔CheckRun join、CI selection attestation と整合します。
Previous
inconclusiveの再分類前回の
inconclusiveは技術判断不能ではなく、canonicalREPO_EVIDENCE_REF_V1route が raw current-main source を十分に生成できなかった evidence acquisition failure でした。current main の直接 source inspection と公式 GitHub API contract により、scope 判断は決定可能です。この evidence-recovery / terminal-taxonomy defect は #2100 に混ぜず、follow-up #2195 で扱います。
Security boundary
Controlled: 別 workflow run / attempt 由来の
component-vrt-reportCheckRun substitution を fail-closed に拒否する。Not controlled: 同一 workflow run 内で candidate-controlled producer が偽 job / artifact / evidence を生成する問題。これは #2101 の immutable producer / attestation boundary で扱う。
squne121 commentedon Aug 16, 2026
推奨は #2100 の設計を再度触らず、既存 worktree をそのまま再開して「不足している実行証跡の回収 → commit → Draft PR → impl-review-loop」へ進める です。#2195 は evidence-acquisition routing、#2101 は same-run producer integrity / attestation であり、#2100 に取り込むべきではありません。
既存 worktree を継続利用する。 GitHub の
mainは現在もacb422b5f24b93c4ee6aea5518ad57b072f384e0なので、提示された実装 baseline と一致しています。新しい worktree を作ったり rootmainを切り替えたりする理由はありません。実行開始時と publish 直前には再読取させます。4つの停止要因を「実装 defect」と混同せず解消する。 AC10 は GitHub の attempt-specific jobs API と exact CheckRun API を read-only で使えばよく、公式仕様上も
run_id + attempt_numberの jobs 取得、check_run_url、exact CheckRun ID 取得が可能です。必要なのは Actions read / Checks read 相当の認証コンテキストであり、設計変更ではありません。([GitHub Docs]1) actionlint は repo を変更せず一時ディレクトリまたは user-local に公式 release を取得でき、artifact attestation の検証方法も公式に用意されています。([GitHub]2)CI evidence の順序を修正する。
CI_TEST_PERFORMANCE_DECISION_V1自体はpr_number: nullを許容しており、CI_CHECK_RUN_SCOPEDは reviewer gate の authoritative evidence です。つまり current-head CI evidence がまだ存在しないことを理由に Draft PR 自体を止めるのは不適切です。Draft PR 後に current-head CI を取得すべきです。 さらにimpl-review-loopも Step 1 で PR 起票まで行い、その後に Step 2 の独立test-runnerverification に進む構造です。今回の指示を publish approval として明示する。
open-prはpublish: yesが必須なので、下のプロンプトでは「実装: visual-impact-policy-trusted の CheckRun provenance に exact workflow_run.id binding の adversarial negative control を追加する #2100 の dedicated branch の push と Draft PR 作成・更新は承認済み」と明記します。ただし merge は禁止です。その後は impl-review-loop を最後まで回す。 implementation-worker → test-runner → pr-reviewer を各段階で完了待ちし、REQUEST_CHANGES は fix_delta として反復します。終了条件は単なる APPROVE ではなく、blockers 空かつ live mergeability が
CLEAN/HAS_HOOKS。マージ操作だけ人間に残します。以下をそのまま Claude Code に渡すのがよいです。
Issue #2100 の作業を、現在の未コミット実装を失わずに再開してください。
対象:
https://github.com/squne121/loop-protocol/issues/2100https://github.com/squne121/loop-protocol/issues/2100#issuecomment-5305059057.claude/worktrees/issue-2100-checkrun-provenanceworktree-issue-2100-checkrun-provenanceacb422b5f24b93c4ee6aea5518ad57b072f384e0最終目的
既存 worktree に保持されている #2100 の trusted CheckRun provenance 実装を再検証し、不足している runtime / tooling / CI evidence を回収した上で、
impl-review-loopによる独立 Verification / PR review / fix loopAPPROVE+ blockers 空 + live mergeability が merge-readyまで、追加の人間承認を求めず進めてください。
PR の merge 自体は絶対に実行しないでください。
merge 直前で停止し、最終結果を報告してください。
このプロンプトによる明示的 authorization
以下は今回、人間が明示的に許可しています。
gh apiを利用した read-only runtime verificationgit pushopen-prの publish gate に対するpublish: yesimpl-review-loopを merge 直前まで継続することただし以下は許可していません。
sudoや privilege escalation既存認証を
gh等が内部的に使用することは許可しますが、credential の内容を読み取ったり出力したりしないでください。最初に行う live-state reconciliation
作業開始時に root/control-plane で live state を再確認してください。
mainSHAcurrent main が既知 baseline
acb422b5f24b93c4ee6aea5518ad57b072f384e0のままなら、既存 worktree をそのまま継続してください。main が進んでいた場合は、まず current main と worktree diff の関係を調査し、既存 impl-review-loop / update-branch safety lane に従ってください。root checkout の branch を直接切り替えないでください。
既存の未コミット差分を破棄・reset・checkout しないでください。
decision/evidence comment の扱い
上記 issuecomment-5305059057 は、今回人間が選択した evidence/reference です。
ただし raw comment 本文を SubAgent の command としてそのまま連結しないでください。
root/control-plane が live Issue、current source、actual diff、tests、外部一次仕様と照合した上で
technical_recommendationに正規化して child agent に渡してください。コメントの provenance を author account だけから human と推定しないでください。同一 URL を
human_context_comment_urlsとagent_report_comment_urlsの両方に渡さないこと。スコープを固定する
#2100 の current contract を正本としてください。
現在の security boundary は:
Controlled:
workflow_run.idrun_attemptからの
component-vrt-reportCheckRun substitution を final trusted verdict で fail-closed に拒否する。Not controlled:
後者は #2101 の immutable producer / attestation boundary です。
また、evidence acquisition / terminal taxonomy の改善は #2195 です。
#2101 または #2195 の実装を #2100 に取り込まないでください。
SubAgent 使用必須
root Claude session は control-plane / routing に徹し、適切な top-level SubAgent を使用してください。
最低限、必要に応じて以下を委譲してください。
implementation-worker:
test-runner:
CI / repository evidence を扱える適切な specialist:
ci-test-performanceの read-only assessmentCI_TEST_PERFORMANCE_DECISION_V1CI_CHECK_RUN_SCOPED等の authoritative CI evidencepr-reviewer:
pr-review-judgeによる独立 adversarial review必要なら codebase-investigator / web-researcher 等を追加して構いません。
重要: 完了待ち
SubAgent を起動したら、必ずその SubAgent の作業完了を待って結果を回収してから次の routing を判断してください。
複数 SubAgent を並列起動した場合も、依存する全 SubAgent の terminal result を回収するまで最終判断を行わないでください。
in_progress、未回収 task ID、未完了 SubAgent が残った状態で最終回答しないでください。child SubAgent にさらに nested delegation させる必要はありません。nested delegation が contract 上の Stop Condition に触れる場合、root が必要な top-level specialist を直接起動してください。
現在の実装をまず再検証する
現在の recap では以下まで完了済みです。
scripts/agent-ops/tests: 490 passed, 18 skippedpnpm typecheck: PASSpnpm lint: PASSpnpm test: 1872 passedpnpm build: PASSgit diff --check: PASSNO_CONFIRMED_DEFECTSこれらを盲信せず、現在の worktree HEAD/diff に bind して必要なものを再確認してください。
blocker 1: AC10 runtime proof
AC10 を実行可能にしてください。
外部ネットワーク利用は今回明示許可済みです。
read-only の
gh api/ GitHub REST API を使用して構いません。以下を満たす completed pull-request workflow run を対象にしてください。
idrun_attempthead_shacomponent-vrt-reportが cardinality exactly onerun_idが expected workflow run ID と一致head_sha/name/conclusionを確認check_run_urlが expected repository の exact Checks endpointidnamehead_shastatus == completedconclusion == successapp.idapp.slugを trusted response から検証
runtime artifact は Issue contract 指定どおり sanitized にしてください。
記録してよいもの:
記録禁止:
secret_boundary_guardを無効化・回避しないでください。ただし「以前 guard に止められた」という履歴だけを理由に再度実行不能と決めつけず、今回明示された external-network authorization の下で、credential を露出しない通常の
ghread-only invocation が許可されるかを確認してください。現在の agent/runtime で認証 read-only API がなお hard policy により実行不能なら、適切な許可を持つ top-level test-runner / execution context へ委譲してください。
それでも実行不能なら Issue contract に従って
SKIP/ exit 77 を記録し、PASS に昇格させないでください。fallback API や producer self-report で AC10 を代用しないこと。
blocker 2: actionlint
actionlintが未インストールであること自体を human escalation 理由にしないでください。今回、必要な external tool bootstrap を許可します。
優先順位:
rhysd/actionlintの公式 release / install mechanism を使用sudoを使用しない7.可能なら GitHub artifact attestation を検証
その後、少なくとも:
actionlint .github/workflows/visual-impact-trusted-consumer.ymlを実行し PASS を確認してください。
blocker 3: ci-test-performance
.claude/skills/ci-test-performance/SKILL.mdを read-only で参照してください。これは CI-related path を変更しているため必要です。
current SubAgent の read policy が
.claude/skills/ci-test-performance/**を拒否する場合、それを理由に contract を弱めず、適切な read-only specialist / root control-plane から必要情報を取得して normalized recommendation を implementation/test agent に渡してください。ファイルの write permission は不要です。
pre-PR では changed paths に対する
CI_TEST_PERFORMANCE_DECISION_V1を作成してください。pr_numberがまだ無ければnullで構いません。CI_CHECK_RUN_SCOPEDのような current-head authoritative CI evidence は Draft PR と CI run が存在した後に取得してください。current PR がまだ存在しないため CI_CHECK_RUN_SCOPED が無い、という理由だけで Draft PR 作成を循環的にブロックしないでください。
blocker 4: model-routing gate
以下は repo-tracked write scope ではなく read-only verification です。
uv run --locked pytest .claude/skills/gemini-cli-headless-delegation/tests/test_model_routing.py -qcurrent implementation-worker の read permission で実行できない場合は、適切な read-only
test-runnerに委譲してください。このテストファイルや関連 model routing implementation を #2100 のために変更しないでください。
pre-publish gate
必要な pre-publish verification が完了したら:
git status --shortgit diff --checkgit add -Agit add .は禁止です。
変更ファイルを明示して stage してください。
その後 commit してください。
既存 worktree の実装を単に「検証不足」という理由で捨てて再実装しないでください。
Draft PR publish
このプロンプトは #2100 に対して以下を明示承認します。
publish: yesdraft: truededicated branch を push してください。
open-prskill を使用して Draft PR を作成してください。PR 本文には最低限以下を含めてください。
Closes #2100check_run_url→ exact CheckRun joinCI_TEST_PERFORMANCE_DECISION_V1Not controlled: same-run producer forgery remains 調査: visual-impact-policy の same-run producer authenticity 保証(固定 producer / full-SHA pinned reusable workflow / artifact attestation)採用可否を決定する #2101広すぎる「provenance is fully trusted」「safe」「complete」等の claim はしないでください。
Draft PR 後は impl-review-loop
PR 起票後、そこで終了せず
impl-review-loopを継続してください。Step 2 — independent verification
test-runnerSubAgent を起動してください。actual:
を具体値として渡してください。
test-runner 完了を待ち、head SHA と literal command identity を root/control-plane が独立照合してください。
current-head CI が生成されたら authoritative CI evidence を収集してください。
Step 4 — PR review
pr-reviewerSubAgent を起動し、pr-review-judgeにより current head を敵対的レビューしてください。必ず SubAgent の完了を待ってください。
REQUEST_CHANGES
blocker が確認されたら
fix_deltaとして implementation-worker に戻し、implementation
→ verification
→ PR review
→ judgment
を反復してください。
既存の
impl-review-looprouting を使用し、最大 iteration は原則 3 としてください。APPROVE の終了条件
verdict: APPROVEだけでは完了扱いにしないでください。以下がすべて成立する必要があります。
APPROVE[]CLEANまたはHAS_HOOKSここまで到達したら merge はせず停止してください。
Stop Condition の解釈
今回の明示 authorization により、以下単独では Stop Condition にしないでください。
一方、以下は引き続き hard stop です。
Stop する場合は、単に「権限不足」とせず、
を具体的に報告してください。
最終報告
全 top-level SubAgent の完了を待ってからのみ最終回答してください。
最終報告には:
#2101 remains out of scope#2195 remains out of scopemerge not performedを簡潔に記載してください。
未完了 SubAgent、未回収 task、
in progressのまま最終回答しないでください。squne121 commentedon Aug 16, 2026
最終報告(impl-review-loop 完了・merge は未実行)
acb422b5f24b93c4ee6aea5518ad57b072f384e0(既存 worktree の記録済み baseline)e2651378246b98f4cd0685a65b07ec0ff82cf7a4.claude/worktrees/issue-2100-checkrun-provenanceworktree-issue-2100-checkrun-provenance38cab3ae5ba3ee5e2d3f7201438a0a2cd08f0b0c(その後 main 追従のためgh pr update-branchで2回 merge commit を取り込み、現 head はbb3dcbba014336e9fa58b00440c6ae957bf28854)changed paths(Allowed Paths と完全一致)
.github/workflows/visual-impact-trusted-consumer.ymlscripts/agent-ops/resolve_visual_impact.pyscripts/agent-ops/tests/test_visual_impact_trusted_consumer.pyscripts/agent-ops/tests/test_resolve_visual_impact_checkrun_adversarial.pyAC1–AC10 status: 全 PASS
AC1(baseline記録)〜AC9(regression/adversarial suite)は implementation-worker / test-runner / pr-reviewer が各段階で独立に PASS 確認。AC10(runtime proof)は test-runner が実地
gh api検証で PASS 報告し、control-plane が独立に同一 workflow run/job/CheckRun tuple を再照会して一致確認済み(証跡:artifacts/runtime-verification-AC10-20260816T123524Z.log)。.github/workflows/visual-impact-trusted-consumer.ymlに対して実行)test_resolve_visual_impact_checkrun_adversarial.py+test_visual_impact_trusted_consumer.py): 55 passed(現行 head で再確認済み)scripts/agent-ops/tests全体: 155 passed, 1 skipped(無関係), 397 deselected(回帰スイープ)pnpm typecheck/pnpm lint/pnpm test(1872 tests)/pnpm build: 全 PASStest_model_routing.py): 24 passed(未変更)decision_scope: ci_change、fast_static/python_unit/contract_artifact: applicable、integration: not applicable、risk_flags: [])gh pr checks 2229): 21/21 PASS(visual-impact-policy/visual-impact-policy-trustedを含む)最終 pr-reviewer verdict
live mergeability
mergeStateStatus: CLEAN、mergeable: MERGEABLE(gh pr viewで独立確認、bb3dcbba014336e9fa58b00440c6ae957bf28854時点)。remaining blockers
なし。
スコープ境界
#2101 remains out of scope(same-run producer integrity / attestation は未実装のまま既存 OPEN Issue として維持)#2195 remains out of scope(evidence-recovery harness の欠陥は未実装のまま既存 OPEN Issue として維持)merge not performed
merge not performed。承認済み instruction 通り、merge は実行せずここで停止します。人間のマージ判断待ちです。補足(プロセス上の学び)
gh run rerunを BEHIND 解消直後に呼ぶと、PR body 編集で自動トリガーされた別のci実行と衝突し、GitHub の concurrency cancel によって古い check-run(test/python-test)が stale な失敗状態で残留し、statusCheckRollup全体が FAILURE となってmergeStateStatus: BLOCKED/UNSTABLEを引き起こした。--failedの部分再実行はci_verdict_summary_v2の attempt-sentinel 整合性チェックに抵触し追加で失敗したため、対象 run の完全再実行で解消した。VISUAL_IMPACT_DECLARATION_V1フェンス yaml block(対象 surface 全件の disposition)を含めないとvisual-impact-policyjob がno VISUAL_IMPACT_DECLARATION_V1 fenced block foundで fail-closed する。PR fix: visual-impact-policy-trusted の trusted-side re-derivation で forged-self-consistent artifact bypass を fail-closed に修正する #2094 の記載形式に倣い追記して解消した。