Repository navigation
Description
Machine-Readable Contract
contract_schema_version: v1
issue_kind: research
parent_issue: "#2230"
goal_ref: "#2284 Phase B が main へ merge された後、production V3 artifact protocol を同一 same-repository pull_request CI run の attempt 1/2 で一度だけ実証する"
change_kind: research-onlyParent Issue
Outcome
#2284 Phase B を含む main を base とする same-repository PR の pull_request 起点 ci run を、適格性確認後に full workflow rerun で一度だけ attempt 2 にし、attempt 1/2 の post-Phase-B production artifact と trusted consumer を直接検証した verification-result comment が #2287 に一件だけ記録される。全 AC が PASS の場合に限り #2287 を close できる。現時点では dependency 未充足のため runtime verification、CI rerun、verification-result comment、close は blocked である。
Dependencies and Execution Gate
- Depends on: 実装: visual-impact evidence manifest schema を V3 化し run_attempt を digest 対象に含める #2284 Phase B merged to main
- Case A execution gate: 実装: visual-impact evidence manifest schema を V3 化し run_attempt を digest 対象に含める #2284 Phase B が main に merge されるまで、runtime verification を開始しない。CI rerun、CI rerun の待機、verification-result comment、close は禁止/blocked とする。
- Phase B merge 後にも fresh human-context preflight と canonical gates が ready/proceed を返すまで operational mutation を開始しない。
- 実装: visual-impact evidence manifest schema を V3 化し run_attempt を digest 対象に含める #2284 が Phase B を廃止して not planned で終了した場合、旧 V2 path のために rerun を消費せず 調査: visual-impact-policy-trusted の attempt-specific artifact naming を実 CI rerun (run_attempt>=2) で検証する #2287 を not planned として close する。
Source
dedupe_key: "follow-up:squne121/loop-protocol:pr/2279:1"
source: post_merge_cleanup
source_url: "https://github.com/squne121/loop-protocol/pull/2279"
authoritative_anchors:
structured: "https://github.com/squne121/loop-protocol/issues/2287#issuecomment-5457998707"
adversarial: "https://github.com/squne121/loop-protocol/issues/2287#issuecomment-5456842673"The structured anchor is approved_by_trusted_anchor. Its authorized delta is exactly: GitHub Issue #2287 contract body only; repository files prohibited. This rewrite materializes the normalized adversarial-anchor requirements and the user authorization; it does not authorize their future execution before the execution gate.
In Scope
- Reframe this Issue contract only for the post-Phase-B production V3 protocol.
- After the execution gate, select one eligible
cirun and perform exactly one future-only full workflow rerun equivalent togh run rerun RUN_ID. - Read Actions run metadata, attempts, jobs, logs, artifacts, and CheckRuns; download run-scoped artifact ZIPs and validate their JSON directly.
- Post exactly one 調査: visual-impact-policy-trusted の attempt-specific artifact naming を実 CI rerun (run_attempt>=2) で検証する #2287 verification-result comment after evidence collection; close only if every AC passes.
- If evidence finds a product defect, retain 調査: visual-impact-policy-trusted の attempt-specific artifact naming を実 CI rerun (run_attempt>=2) で検証する #2287 open and create a minimal implementation Issue only when an independent fix is required; do not repair repository code in 調査: visual-impact-policy-trusted の attempt-specific artifact naming を実 CI rerun (run_attempt>=2) で検証する #2287.
Out of Scope
- Any runtime verification, CI rerun, verification-result comment, or close before
#2284 Phase B merged to mainand fresh canonical gates pass. - Repository file, branch, commit, PR, PR body, workflow, label, or repository configuration mutation.
workflow_dispatch, dummy commits, failed-only reruns, job-only reruns, a second or later rerun, new security/permission/verification harnesses, and unrelated GitHub mutation.- Treating CheckRun display text as a substitute for direct artifact JSON type validation.
Allowed Paths
- GitHub Issue 調査: visual-impact-policy-trusted の attempt-specific artifact naming を実 CI rerun (run_attempt>=2) で検証する #2287 contract body only; repository files prohibited
Allowed Operations
Only after the Dependencies and Execution Gate is satisfied:
- Execute one full rerun for the selected eligible workflow run; the only permitted semantic operation is
gh run rerun RUN_ID(no--failed, no--job). - Read Actions metadata, attempts, jobs, logs, artifacts, and CheckRuns.
- Download and inspect artifact ZIPs scoped to that run.
- Publish exactly one 調査: visual-impact-policy-trusted の attempt-specific artifact naming を実 CI rerun (run_attempt>=2) で検証する #2287 verification-result comment after complete evidence collection.
- Close 調査: visual-impact-policy-trusted の attempt-specific artifact naming を実 CI rerun (run_attempt>=2) で検証する #2287 only after every AC passes.
Repository Mutation
Repository mutation is prohibited at all times: repository files, branches, commits, PR creation or modification, PR body, workflow files, and workflow-dispatch alternative-run generation. Future operational GitHub mutations above are distinct from repository mutation and remain prohibited until the execution gate passes.
Acceptance Criteria
- AC1: Runtime execution starts only after
#2284 Phase B merged to mainand fresh canonical gates pass. The selected candidate is a completed initial attempt (run_attempt == 1) of workflowci, eventpull_request, from a same-repository PR; its current PR head SHA equals the runhead_sha; its base contains the Phase B merge commit; and it is within GitHub's 30-day rerun eligibility window. - AC2: Exactly one full workflow rerun is initiated for that RUN_ID, reaches
run_attempt == 2, and no failed-only, job-only, workflow_dispatch, or additional rerun is used. During selection and rerun, the PR head is not updated and concurrentciactivity capable of contaminating correlation is avoided; any detected stale head or contamination blocks further mutation. - AC3: A fully paginated run-scoped artifact listing, using producer SSOT post-Phase-B exact names, contains for each attempt 1 and 2 exactly one nonexpired decision artifact and exactly one nonexpired evidence-manifest artifact. Each selected artifact metadata record has strict expected
workflow_run.id == RUN_IDandworkflow_run.head_sha == HEAD_SHAidentity. - AC4: ZIP contents of both decision artifacts directly validate JSON
workflow_run_id,run_attempt, andhead_shaas the strict expected tuple(RUN_ID, 1|2, HEAD_SHA); the first two are JSON numbers with integer semantics, not strings or fractional numbers, and the decision schema isVISUAL_IMPACT_DECISION_V1. - AC5: ZIP contents of both V3 evidence artifacts directly validate top-level
workflow_run_id,run_attempt, andhead_shawith the same strict typed tuple; schema isVISUAL_BASELINE_REVIEW_EVIDENCE_V3; whensurfaces[]is nonempty every record matches the envelope tuple, and an emptysurfaces: []still has envelope identity. - AC6: The attempt-2 trusted consumer execution is correlated uniquely through existing evidence (source run/attempt summary if present, otherwise consumer run ID, timestamps, event chain, and logs), trusted artifact acquisition succeeds, and the relevant
visual-impact-policy-trustedCheckRun/workflow conclusion issuccess. - AC7: Exactly one 調査: visual-impact-policy-trusted の attempt-specific artifact naming を実 CI rerun (run_attempt>=2) で検証する #2287 verification-result comment records source PR, base/head SHA, RUN_ID, attempts, producer-SSOT artifact names/IDs/expired values, direct JSON tuples, consumer run ID, CheckRun ID, and PASS/FAIL outcome. If all ACs pass, and only then, 調査: visual-impact-policy-trusted の attempt-specific artifact naming を実 CI rerun (run_attempt>=2) で検証する #2287 is closed.
- AC8: No repository file, branch, commit, PR, PR body, workflow, label, or configuration mutation occurs for this Issue.
Verification Commands
Case A (#2284 Phase B unmerged) is baseline-deferred: do not execute dependency-gated Actions commands. Their # baseline-expect: deferred annotation makes the canonical baseline preflight skip them rather than treating the current restricted read-only allowlist or unavailable V3 target as a result for the future protocol. After the execution gate passes, Case B is immediate: execute the same commands under the then-authorized operational gate and retain the resulting evidence. Producer exact names and JSON filenames are resolved from the post-Phase-B production workflow SSOT before use.
# AC1
# baseline-expect: deferred
$ gh api "repos/squne121/loop-protocol/actions/runs/RUN_ID"
# baseline-expect: deferred
$ gh api "repos/squne121/loop-protocol/pulls/PR_NUMBER"
# baseline-expect: deferred
$ gh api "repos/squne121/loop-protocol/compare/PHASE_B_MERGE_SHA...BASE_SHA"Inspect returned metadata for ci, pull_request, completed initial attempt, same-repository PR, current head equality, 30-day eligibility, and Phase-B base containment before any mutation.
# AC2
# baseline-expect: deferred
$ gh run rerun RUN_ID --repo squne121/loop-protocol
# baseline-expect: deferred
$ gh run watch RUN_ID --repo squne121/loop-protocol --exit-status
# baseline-expect: deferred
$ gh api "repos/squne121/loop-protocol/actions/runs/RUN_ID"Use the full rerun command exactly once without --failed or --job; re-read PR head and concurrent activity before and during rerun.
# AC3
# baseline-expect: deferred
$ gh api --paginate "repos/squne121/loop-protocol/actions/runs/RUN_ID/artifacts?per_page=100"Collect every page and use producer-SSOT exact names to assert exactly one nonexpired decision and evidence artifact for each attempt and strict RUN_ID/HEAD_SHA metadata identity.
# AC4
# baseline-expect: deferred
$ gh api "repos/squne121/loop-protocol/actions/artifacts/DECISION_ARTIFACT_ID/zip"Download and unzip each decision ZIP; directly validate VISUAL_IMPACT_DECISION_V1, numeric integer fields, and exact (RUN_ID, attempt, HEAD_SHA) tuple.
# AC5
# baseline-expect: deferred
$ gh api "repos/squne121/loop-protocol/actions/artifacts/EVIDENCE_ARTIFACT_ID/zip"Download and unzip each evidence ZIP; directly validate V3 envelope typed tuple and every nonempty surfaces[] record; empty surfaces still require envelope identity.
# AC6
# baseline-expect: deferred
$ gh api "repos/squne121/loop-protocol/actions/runs/RUN_ID/jobs"
# baseline-expect: deferred
$ gh api "repos/squne121/loop-protocol/commits/HEAD_SHA/check-runs"Use existing consumer run metadata, timestamps, event chain, and logs to uniquely correlate attempt 2; confirm trusted acquisition and relevant conclusion success.
# AC7
# baseline-expect: pass
$ gh issue view 2287 --repo squne121/loop-protocol --json comments,stateAfter complete evidence collection, verify exactly one verification-result comment and close only when every AC passes.
# AC8
# baseline-expect: pass
$ git status --short
# baseline-expect: pass
$ gh issue view 2287 --repo squne121/loop-protocol --json body,stateConfirm no repository or prohibited GitHub mutation occurred.
Runtime Verification Applicability
- decision: deferred
- reason: Case A cannot establish the production V3 runtime target while
#2284 Phase Bis unmerged; current baseline validation must not execute or infer an Actions-runtime result from restricted read-only command availability. - deferred_destination:
- destination_type: issue
- destination_ref: "調査: visual-impact-policy-trusted の attempt-specific artifact naming を実 CI rerun (run_attempt>=2) で検証する #2287 (Case B execution after the gate)"
- deferred_verification_condition:
#2284 Phase Bis merged to main, then fresh human-context preflight and canonical gates return ready/proceed; only then Case B becomes immediate for this Issue's existing one-rerun protocol, evidence collection, sole verification-result comment, and conditional close.
Stop Conditions
-
Outcome / Scope / AC が検索可能な形で記載されていない場合は即停止
-
Allowed Paths 外への書き込みを試みた場合は即停止
-
権限不足(permission denied)により操作が完了できない場合は即停止
-
成果物の書き込みに失敗した場合(I/O エラー等)は即停止
-
CI rerun 発生に失敗する、または
run_attempt >= 2の実 run に到達できない場合は即停止し人間判断を仰ぐ -
cardinality 違反・型不一致が発見された場合は本 Issue を close せず修正 implementation Issue を起票してから停止する
-
Before the execution gate, stop as blocked with dependency evidence; do not rerun, comment a verification result, or close.
-
If no eligible candidate exists, eligibility is expired, head becomes stale, a concurrent CI run prevents unambiguous correlation, permissions fail, rerun does not reach attempt 2, or any AC fails: perform no additional rerun, preserve blocked/FAIL evidence, and stop.
-
If artifact cardinality, expiry, typed tuple, V3 envelope/surface identity, trusted acquisition, or consumer correlation/conclusion fails: do not repair repository code in 調査: visual-impact-policy-trusted の attempt-specific artifact naming を実 CI rerun (run_attempt>=2) で検証する #2287; create a minimal implementation Issue only when required and retain 調査: visual-impact-policy-trusted の attempt-specific artifact naming を実 CI rerun (run_attempt>=2) で検証する #2287 open.
-
Never bypass fresh preflight, canonical gates, or the repository-mutation prohibition.
Handoff Contract
Current Objective: Case A: complete this contract reframe only; await#2284 Phase B merged to mainbefore any runtime operation.Bounded Current Context: main at9f3b2fb7a48354661de325e42b0239a6903c3899remains pre-Phase-B: V2 writer, legacy filename, and legacy consumer; therefore the production V3 runtime target is unavailable.Open Questions: Which eligible, nonstale, within-window same-repository PRcirun exists after the Phase B merge; determine only after the execution gate.Next Action: After Phase B merges to main, obtain fresh human-context preflight and canonical gates; if ready/proceed, execute the one-rerun procedure and record the sole verification-result comment.Artifact Refs: 実装: visual-impact-policy-trusted の decision/evidence artifact に run_attempt identity を結合する #2230, 実装: visual-impact evidence manifest schema を V3 化し run_attempt を digest 対象に含める #2284 Phase B, PR 実装: visual-impact-policy-trusted の decision/evidence artifact に run_attempt identity を結合する #2279, adversarial anchor#issuecomment-5456842673, structured authorization#issuecomment-5457998707.
Required Skills
なし
Unblocked by
- PR feat: ci.yml の evidence manifest producer を V3 schema/generic filename へ切り替える #2388 merged to main
- Phase B merge SHA:
d182eea59415aac31556e6ebfaf652965506841c
Issue #2384 / PR #2388(ci.yml の producer を V3 evidence manifest schema へ切り替える Phase B 実装)が上記コミットで main にマージ済み。本 Issue #2287 の実行ゲート(旧記述「#2284 Phase B が main へ merge」)は、実際の Phase B 実装単位である Issue #2384 / PR #2388 のマージをもって満たされた。
Activity
squne121 commentedon Aug 28, 2026
判定
#2287 の検証目的そのものは有用です。
ただし、現在の本文のままでは、一部のVerification Commandsが実在しないAPIを呼び、対象runの選定条件も誤っており、さらに進行中の #2284 より前に実行すると旧V2経路を検証して終わるため、後で同じ検証をやり直すことになります。
したがって、今クローズするのも、今実行するのも不適切です。#2284 Phase B後のproduction V3経路を一度だけ検証するIssueへ改稿するのが妥当です。
#2287 は2026年8月21日の起票後、コメント0件・本文更新なしで、現在も「V3はOut of Scope」「Open Questionsなし」「次はrerun」としています。一方、#2284はその後、V3 envelopeとproducer切替をPhase A/Bで実施し、GitHub-hosted実rerunは#2287に委譲する契約へ更新されています。現状の#2287は、この後続設計をまだ反映していません。
敵対的レビュー findings
[P1-1] #2284 Phase Bより前に実行すると、検証対象がすぐ旧式になる
#2284は、V3 envelopeを導入したうえで、Phase Bとして実producerをV3 writer・generic filenameへ切り替えるところまでを完了条件にしています。さらに、GitHub-hostedの
run_attempt >= 2検証は明示的に#2287へ委譲されています。ところが#2287は、現在も次の前提です。
このまま今実行すると、V2のattempt-specific artifact namingをPASSにした直後、#2284 Phase Bでproducerや内部manifest形式が変わります。すると、本当に稼働確認したい最終構成を再度rerunする必要が生じます。
修正要求
Depends on: #2284 Phase B mergedを明示するstate/blocked相当として扱うnot plannedで閉じる[P1-2] AC2・AC3のartifact APIは存在しない
AC1で使用している次のworkflow run attempt取得APIは実在します。
一方、AC2・AC3に書かれた次のAPIは存在しません。
GitHub Actionsのartifact一覧APIは、attempt別ではなくrun全体に対する次のendpointだけです。
指定できるquery parameterは
name、per_page、page、directionで、attempt番号による絞り込みはありません。したがって、attempt-specific suffixで名前を分ける設計自体は妥当ですが、#2287のAC2・AC3は現状のままでは実行不能です。([GitHub ドキュメント]1)修正要求
run全体のartifact一覧を最後のページまで取得し、その中から以下4名称をそれぞれexactly oneで検証します。
visual-impact-decision-v1-1component-vrt-evidence-manifest-1visual-impact-decision-v1-2component-vrt-evidence-manifest-2[P1-3] 「main上のCI run」という対象指定ではAC5が成立しない
現在のtrusted consumerは、source
cirunのeventがpull_requestの場合だけ実行されます。push、workflow_dispatch、merge_groupのrunは明示的に無視されます。したがって、「main上のCI run」をmainへの
pushrunと解釈すると、visual-impact-policy-trustedはskipされ、AC5を満たせません。正しい対象は次です。
さらにGitHubのrerunは、元runと同じ
GITHUB_SHAとGITHUB_REFを使います。現在のtrusted consumerは、元runのhead SHAとPRの現在head SHAが異なる場合にstaleとして拒否します。したがって、対象PRのheadが更新された後に古いrunをrerunしてはいけません。([GitHub Docs]2)対象runの必須条件
event == pull_requestrun_attempt == 1status == completedhead_shaが一致cirunを同時に発生させない[P1-4]
Allowed Paths: 読み取り専用とAC1が矛盾している#2287は「読み取り専用」「Allowed Paths外への書き込みで即停止」としていますが、AC1ではworkflow rerunを必須とし、AC6ではIssueコメントを書き込みます。
GitHub ActionsのrerunはREST上の
POST操作で、Actionsのwrite permissionを必要とします。Issueコメントも書き込みです。([GitHub Docs]1)この矛盾は、最近のClaude Code/Claude-GPTの権限制御問題と特に相性が悪く、agentが「read-only契約違反」と判定してAC1より前で停止する可能性があります。
修正要求
Allowed Pathsではなく、次のようにファイル変更とGitHub操作を分離します。[P1-5] AC4はdecision artifactのJSON型を検証していない
AC4は次を実行する契約です。
gh api repos/.../check-runs/CHECK_RUN_ID --jq '.output'しかし、これはCheckRunの表示用summary/textを取得するだけです。JSON artifact内で値がintegerなのか、文字列なのかは判定できません。
さらに現在の
visual-impact-policy-trustedCheckRun summaryには、workflow_run_idもrun_attemptも出力されていません。成功時はPR番号とhead SHAを記録するだけです。親Issue #2230が要求しているのは、decisionとevidenceの両artifactが、exact
(workflow_run_id, run_attempt, head_sha)tupleを持つことです。修正要求
attempt 1・2の両方について、実artifact ZIPをダウンロードして
jqで検証します。workflow_run_id | type == "number"run_attempt | type == "number"workflow_run_id == RUN_IDrun_attempt == 1または2head_sha == HEAD_SHAsurfaces[]が存在する場合は各recordもenvelopeと一致[P1-6] evidenceだけを数えており、decision側の重複・欠落を見逃す
現行AC2は
component-vrt-evidence-manifest-*しか確認しません。しかし、#2230の契約はdecisionとevidenceの両方をattempt identityへ結合するものです。decision側だけ重複・欠落しても、現在のAC2はPASSします。また、Outcomeでは
actions/download-artifactのexact-name解決を検証すると書かれていますが、trusted consumerのproduction経路は現在、resolve_visual_impact.py --mode acquire-trusted-artifactを呼び出し、name=filter、全ページ取得、cardinality、expired、head SHAを検証してからartifact IDでダウンロードしています。修正要求
検証対象を実装に合わせます。
acquire-trusted-artifactが成功したことを確認visual-impact-policy-trustedがsuccessであることを確認actions/download-artifactそのものを別途検証するための新しいharnessは作らない[P1-7] AC5は同じhead上の別CheckRunを誤採用できる
現在のAC5はcommit全体のCheckRun一覧を取得し、
visual-impact-policy-trustedがsuccessかを見るだけです。同じhead SHAに対して複数回CIやrerunが行われると、同名CheckRunが複数存在し得ます。現在のCheckRun summaryにはsource run ID/attemptがないため、「どれか1件がsuccess」だけでは、attempt 2を処理した結果だと確定できません。
最小コストの改善
#2284で既に
.github/workflows/visual-impact-trusted-consumer.ymlを編集するため、Phase BのついでにCheckRun summaryへ次だけ追加するのがよいです。これは新しいsecurity harnessではなく、単なる監査可能性の改善です。新Issueは不要です。
この変更を入れない場合は、#2287の実行中に他の
cirunを完了させない「quiet window」を作り、attempt 2完了直後に生成されたconsumer workflow run IDとCheckRun IDを時刻で相関させる必要があります。[P2-1] full rerunとfailed/job rerunが区別されていない
GitHubは次を別操作として扱います。
この検証ではproducer jobを確実に再実行し、
-2artifactを生成する必要があるため、full rerun限定です。--failedや--jobでは、attempt 1で成功したproducerが再実行されず、必要なartifactが生成されない可能性があります。([GitHub Docs]2)gh run rerun "$RUN_ID" --repo squne121/loop-protocolのみを許可し、次は禁止すべきです。
GitHubでは
GITHUB_RUN_IDはrerunしても変わらず、GITHUB_RUN_ATTEMPTだけが1から増加します。したがって、同一run ID内で-1と-2を比較する現在の基本設計は正しいです。([GitHub Docs]3)[P2-2] 「research」とStop Conditionsが実務に合っていない
このIssueにはOpen Questionsがなく、やることは決定済みの一回限りの運用検証です。それにもかかわらず、
phase/research、agent/researchで、失敗時には即停止・人間判断・別Issue作成を要求しています。検証Issueでは、次は「停止条件」ではなくFAILとして記録すべき結果です。
権限不足や秘密情報要求は停止条件でよいですが、検証対象の不具合を見つけた時点で停止すると、診断に必要な残りのartifactやログを回収できません。
また、不具合発見時に必ず新Issueを起票する必要もありません。まず#2287へFAIL証跡を記録し、#2284で扱える問題なら#2284へ戻し、独立した修正が必要な場合だけ新Issueを作る方が軽量です。
現在どこまで実証済みか
2026年8月28日の実run
33200591485では、少なくとも次のattempt 1 artifactが実際に生成されています。visual-impact-decision-v1-1component-vrt-evidence-manifest-1いずれも
expired: falseで、同じrun ID・head SHAに結び付いています。一方、そのrun内に-2artifactはありません。したがって、現時点で残っている価値ある確認点は、基本的なsuffix生成ではなく、同一run IDでattempt 1と2が共存し、attempt 2のtrusted consumerが正しく選択できるかです。PR #2279の敵対的レビューでも、移行前runを使ったAC9 PASSは誤りであり、post-migrationのattempt 2以上が存在するまで
SKIP/OPENとするべきだと明示されています。推奨する改稿内容
新タイトル
Machine-Readable Contract
既存schemaのenum制約を増やさないため、
issue_kindを変えられない場合はresearchのままで構いません。ただしgoalを更新します。Dependencies
改訂Acceptance Criteria
cirunをfull rerunし、同一RUN_IDでrun_attempt == 2へ到達する-1/-2計4名称が各exactly one、expired == falseで存在するworkflow_run.idとhead_shaを持つ(workflow_run_id, run_attempt, head_sha)tupleを持つvisual-impact-policy-trustedCheckRunがsuccess修正版Verification Commands
1. 対象runのpreflightとfull rerun
2. run全体から4 artifactを検証
3. artifactをID指定で取得し、JSON型とtupleを検証
最終推奨
#2287は残す。ただし今は実行せず、#2284 Phase B後の一回限りのoperational verificationへ改稿するのが最も有用です。
追加のattestation、OIDC、scheduled canary、専用verification workflowは不要です。既存のbase-locked consumerとartifact resolverを維持し、次の3点だけ直せば十分です。
PASS後は#2287をそのままcloseし、#2284に記載されたlegacy V2 fallback削除のPhase Cへ進めます。
squne121 commentedon Aug 28, 2026
Issue refinement stopped: scope decision required
The anchor comment requests GitHub Actions mutation (
gh run rerun) and a verification comment, which expands the current read-only contract. The canonical preflight classified this asexpands_allowed_pathsand does not permit an automated contract update because the anchor lacks a structured scope-reframe authorization.No repository file, branch, commit, PR, workflow, or Issue body was changed. No workflow rerun was performed.
Choose one of the following before rerunning refinement:
Evidence:
.claude/artifacts/issue-refinement-loop/2287/refinement_preflight_result_v1.json.squne121 commentedon Aug 28, 2026
推奨アクション
選択肢2をそのまま選ぶのではなく、「#2287 の契約だけ今 reframe し、実 CI rerun は #2284 Phase B 後まで保留する」形が最適です。
理由は明確です。
blocked_by: "#2284 Phase B の main マージ"と明示し、さらに現行 AC の artifact API、run 選定、read-only と rerun の矛盾などを指摘しています。POST /actions/runs/{run_id}/rerunという明示的な mutation で Actions write 権限が必要です。また rerun は元 run と同じGITHUB_SHA/GITHUB_REFを使い、初回実行から30日以内という制約があります。([GitHub ドキュメント]1)/attempts/{N}/artifactsという API はありません。attempt-specific naming を利用して run 全体の artifact 集合から判定する設計が正しいです。([GitHub ドキュメント]2)したがって、今やるべきなのは **「scope reframe は承認する。ただし rerun の実行権限は Phase B merge 後の fresh preflight 成功を条件にする」**ことです。これなら今回の停止を単に回避するのではなく、preflight が検出した本物の契約矛盾を修正できます。
以下を Claude Code にそのまま渡すのを推奨します。
Issue #2287 の refinement loop を再開し、以下の方針で人間の追加承認なしに最後まで処理してください。
対象:
調査: visual-impact-policy-trusted の attempt-specific artifact naming を実 CI rerun (run_attempt>=2) で検証する #2287 (comment)
調査: visual-impact-policy-trusted の attempt-specific artifact naming を実 CI rerun (run_attempt>=2) で検証する #2287 (comment)
Issue 実装: visual-impact evidence manifest schema を V3 化し run_attempt を digest 対象に含める #2284
Human authorization / intent
このプロンプトは、Issue #2287 に対する scope reframe の明示的な人間承認 である。
ただし、承認範囲を次の2段階に分ける。
今すぐ承認する mutation
Allowed Paths: read-onlyと GitHub mutation の矛盾を解消し、repository file mutation と GitHub operational mutation を別契約として表現すること今は実行してはならない mutation
#2284 Phase B が main に入ったことを repository evidence で確認し、かつその状態を入力にした fresh human-context preflight が許可するまでは、以下を実行しないこと。
つまり、「contract を将来実行可能な形へ reframe すること」は今承認するが、「CI rerun を今実行すること」は承認しない。
#2284 Phase B 完了後については、fresh preflight が ready/proceed を返した場合に限り、次を追加の人間承認なしで許可する。
禁止:
gh run rerun --failed上記の human authorization を repository が要求する canonical structured scope-reframe authorization schema に変換する必要がある場合、schema を repository asset から特定してその形式を使用すること。独自 schema を発明しないこと。
0. Subagent delegation — 必須
main agent が結論を先取りしないこと。
最低3つの read-only subagent を並列に起動すること。
Subagent A: dependency / implementation-state audit
以下を調査する。
VISUAL_BASELINE_REVIEW_EVIDENCE_V3が存在するか.github/workflows/ci.ymlが V3 writer + generic filename へ production cutover 済みかmutation は禁止。
Subagent B: refinement-contract / authorization audit
以下を調査する。
.claude/skills/issue-refinement-loop/run_refinement_preflight.pyplan_refinement_loop.pyworkflow_start_entry.pyskill_runtime_exec.pypreflight.run.with_human_contextcontract_update.run.with_human_contextNEXT_ACTION: issue_editor_required今回の human authorization を canonical workflow にどう入力すべきか確定する。
guard を迂回する提案は禁止。
Subagent C: GitHub Actions verification audit
repository implementation と最新 GitHub Actions 仕様を照合して以下を確定する。
GITHUB_SHA/GITHUB_REF新しい harness は設計しない。
Join barrier
3つの subagent がすべて作業を完了して結果を返すまで、Issue body更新、label更新、CI rerun、Issue comment投稿など一切の mutation を開始してはならない。
「十分分かった」と判断して subagent を途中で放置しないこと。
Task/Agent が asynchronous に返る場合も、全 subagent の terminal result を取得するまで待つこと。
全結果を main agent で reconcile し、矛盾がある場合は repository evidence を優先して解消すること。
1. Current-state decision
subagent join 後、最初に #2284 Phase B の状態を判定する。
Case A: #2284 Phase B が未完了
今回はこちらが想定される primary path。
#2284 Phase B merged to mainと明示するCase B: #2284 Phase B が main に merge 済み
Case C: #2284 が closed as not planned / Phase B が明示的に廃止
#2287 は旧 V2 production path だけを検証するために rerun を消費しない。
not plannedで close単に #2284 が open で停滞しているだけなら Case C に分類しないこと。
2. #2287 contract reframe requirements
anchor comment #5456842673 を authority としつつ、現在の repository state と公式 GitHub semantics で再検証すること。
少なくとも次を反映する。
Dependency
明示的に:
Depends on: #2284 Phase B merged to main#2284 Phase B 前は runtime verification を開始しない。
Verification target
旧:
ではなく、
pull_request起点cirunを検証対象とする。
Allowed Operations
repository path mutation と GitHub operational mutation を混在させない。
将来 execution gate 通過後にのみ:
を許可する。
Repository Mutation
明示的に禁止:
Run selection
candidate run は最低でも以下を満たすこと。
cipull_requestrun_attempt == 1適格 run が存在しなければ、workflow_dispatch や dummy commit を生成して代替しない。
その場合は blocked evidence を残して停止する。
Full rerun semantics
必ず workflow 全体の rerun を使用する。
許可:
gh run rerun <RUN_ID>禁止:
gh run rerun <RUN_ID> --failedgh run rerun --job ...actual command は repository の canonical command / permission policy が別 route を要求する場合はそちらを優先する。
Artifact verification
存在しない endpoint:
/actions/runs/{run_id}/attempts/{attempt}/artifactsを使用しない。
workflow run 全体の artifact collection を pagination 完了まで取得し、attempt-specific artifact names から identity を判断する。
Phase B 後の実際の producer 名を repository から再確認した上で、少なくとも attempt 1 / 2 の:
について expected exact names の cardinality がそれぞれ exactly one であることを確認する。
名前は Issue の古い文字列を盲目的に使わず、Phase B 後の production workflow を SSOT とする。
Artifact content
attempt 1 / attempt 2 の実 artifact ZIP を取得して JSON を直接検証する。
少なくとも:
workflow_run_idrun_attempthead_shaについて
を検証する。
V3 evidence envelopeについて:
surfaces[]が存在する場合は各 record と envelope の一致surfaces: []の場合も envelope identity が存在することを確認する。
表示用 CheckRun summary のみを JSON type 検証の代替にしてはならない。
Trusted consumer
attempt 2 に由来する trusted consumer execution を特定して:
を確認する。
同一 head SHA 上に同名 CheckRun が複数ある可能性を考慮し、「同名で success が1件ある」だけで attempt 2 と結び付けない。
#2284 Phase B が source run id / attempt を summary に追加している場合はそれを使う。
追加されていない場合は workflow run ID、timestamps、event chain、logs 等の既存 evidence で一意に相関させる。
このためだけに新しい harness を作らない。
3. Controlled contract update
Subagent B が特定した canonical route を厳守する。
anchor を direct human context として扱うために新しい structured authorization comment が必要なら、このプロンプトの authorization intent を canonical schema に変換し、必要最小限の comment を1件作成する。
既にこの prompt/session context を human authorization として canonical command が consume できる場合は、不要な duplicate comment を作成しない。
preflight.run.with_human_context→ trusted contract patch plan
→
contract_update.run.with_human_contextの route が適用されるならその順で使用する。
NEXT_ACTION: issue_editor_required/full_rewrite_requiredの場合は、同じ contract update を再試行せず、repository が定義する既存issue-editorcontrolled transaction route へ handoff する。Issue body rewrite 後は必ず:
を行う。
古い preflight artifact を implementation/runtime authorization として再利用しない。
4. Runtime verification after Phase B only
Case B かつ fresh gates が全て PASS の場合のみ実行する。
CI と delegated verification task の完了を待たずに最終判定してはならない。
rerun API request が成功しただけで AC1 PASS としない。
5. Failure handling
以下の場合は追加 rerun せず停止する。
プロダクト上の不具合が見つかった場合:
権限問題を解消するための security harness / permission bypass の実装はしない。
6. Completion
Phase B 未完了の場合
成功条件は「runtime verification 完了」ではない。
以下を満たせば今回の作業を完了としてよい。
Phase B 完了済みの場合
すべての AC が PASS なら:
7. Final report
最終回答には必ず以下を含める。
追加の人間承認を求めず、上記契約の範囲内で進めること。
ただし、秘密情報の開示・取得が必要になる場合、不可逆な破壊的操作が必要になる場合、またはこの human authorization の明示的な禁止事項を破らなければ進められない場合のみ停止すること。
このプロンプトのポイントは、preflight を無効化して進めるのではなく、preflight が検出した scope mismatch を正規の contract-update route で解消することです。現在の #2284 の状態なら、おそらく今回の着地点は Case A = #2287 の改稿まで、CI rerun は0回になります。Phase B 後に同じ Issue を再開すれば、価値のある最終 production 構成だけに rerun 1回を使えます。
squne121 commentedon Aug 28, 2026
squne121 commentedon Aug 28, 2026
squne121 commentedon Aug 29, 2026
post-merge-cleanup: follow-up note (2026-08-29)
PR #2388(Issue #2284 Phase B:
.github/workflows/ci.ymlの evidence manifest producer を V3 schema/generic filename へ切り替え)が main へマージされました(merged_at: 2026-08-29T02:21:10Z)。本 Issue の直近コメントに記載された
blocked_by: "#2284 Phase B の main マージ"の条件はこれで解消しています。Phase B の producer cutover が production 経路(ci.yml→visual-impact-policy/visual-impact-policy-trusted)で実際に通ることは PR #2388 の review evidence(gh pr checksbounded poll、trusted consumer の実 run 検証)で確認済みです。本コメントは post-merge-cleanup の follow-up 候補として自動生成された note のみであり、Issue #2287 自体の contract 判定・scope reframe の実行判断は行いません。次アクション(実 CI rerun による attempt-specific artifact naming 検証の再開)は既存の Issue #2287 の直近コメント(ANCHOR_SCOPE_REFRAME_V1)に従ってください。
Source: #2388