Skip to content

調査: visual-impact-policy-trusted の base-locked evaluator が untrusted producer の自己申告 affected_surfaces を re-derive せず、forged-self-consistent artifact で bypass可能 #2090

Closed

Description

@squne121

Machine-Readable Contract

contract_schema_version: v1
issue_kind: research
parent_issue: "none"
goal_ref: "visual-impact-policy-trusted の trusted-consumer 検証境界における forged-self-consistent artifact bypass の技術的実体を調査し、修正方針を決めた implementation Issue が起票可能な状態にする"
change_kind: research-only

Parent Issue

なし(単独改善)

Background

PR #2085(Issue #2076、.github/workflows/visual-impact-trusted-consumer.yml の gh api --output 未対応バグ修正)のレビュー中、人間レビュアー(squne121)が PR #2085 のコメント(https://github.com/squne121/loop-protocol/pull/2085#issuecomment-5250392462)で、`visual-impact-policy-trusted` check の trusted consumer 検証ロジック自体に P0 の設計上の bypass が存在することを指摘した。#2085 の2行diffとは無関係の既存バグ(Issue #2019 の trusted-consumer 設計に起因)であり、見逃せない問題として新規Issue化するよう明示的に指示された。

PR #2085 は既に merge 済み(commit ee641da1、main の現在 HEAD 9aa2cb45 に含まれる)であり、--output バグそのものによる transport failure は解消済みである。ただし現状の branch protection required_status_checks(typecheck/lint/test/build/python-test/validate-generated-artifact)には visual-impact-policy-trusted はまだ含まれていないため、本 Issue の bypass は現時点でマージを直接ブロックする力を持たない。将来この check を required に昇格する前に、本 Issue で扱う設計ギャップを解消しておく必要がある。

control-plane が repo を直接確認した事実:

  • 該当関数: scripts/agent-ops/resolve_visual_impact.py の verify_trusted_artifact()(1324行目付近)
  • 現状のロジック: decision.get("affected_surfaces", []) をそのまま untrusted producer artifact(VISUAL_IMPACT_DECISION_V1)からの自己申告として受け取り、独立に PR diff / visual-surfaces registry から affected_surfaces を再計算・再照合していない
  • verify_trusted_artifact() が検証しているのは head_sha / repository / pull_request_number の一致と、evidence.get("evidence_manifest_digest") が truthy な場合のみ実施される evidence manifest の digest 整合性チェックのみ。evidence が {}(空 object、digest claim なし)の場合、この検証は一切実行されず reasons は追加されない
  • docs/dev/visual-impact.schema.json の evidence $def には required フィールドが定義されておらず、affected_surfaces 配列にも minItems 制約がない
  • 帰結(2つの独立した bypass 経路):
    1. affected_surfaces: [] を含む decision(component_vrt_report_check_run_id: null、artifact_id/artifact_digest: null)を producer が生成すれば、reasons リストが常に空になり ok=True を返す
    2. producer が正しい affected_surfaces の surface_id を並べつつ evidence: {}(digest claim を一切含めない)を返した場合も、digest 整合性チェック自体がスキップされるため同様に ok=True になる("evidence: {} coherent forgery")
  • load_registry_text()(同ファイル125行目付近)は git show <ref>:path が非ゼロ終了した場合、ref に registry が存在しなかったものとして synthetic empty registry(existed_at_ref=False)を返す。commit object がローカルに存在しない場合(shallow checkout 等)と file が本当に存在しない場合を区別できない
  • .github/workflows/visual-impact-trusted-consumer.yml の checkout step(actions/checkout@v6)は ref: を指定せず base/default branch のみを checkout し、PR head は一切 checkout しない設計。将来 trusted-side re-derivation のために resolve(head_ref=live_head_sha) のような実装を追加すると、shallow checkout に live head の commit object が存在せず git show が非ゼロ終了 → 上記 load_registry_text() のバグ経路で再び empty registry に縮退しうる(trusted-side re-derivation 自体が新たな bypass を生むリスク)
  • 既存テスト(AC33系、scripts/agent-ops/tests/test_visual_impact_trusted_consumer.py 等)は「producerがsuccessを偽装したがartifactが不整合/欠落」の negative controlのみをカバーしており、「producerがdecisionとevidence双方を意図的に整合させて偽造する」ケース(evidence: {} coherent forgery を含む)を検証していない
  • 参考: GitHub は workflow_run トリガーについて、先行workflowがuntrusted codeを実行し得る場合のsecurity riskを明示している

優先度は P0(既存 trust boundary の security-sensitive design gap)だが、緊急の悪用インパクトは限定的(このrepoのCI security gateの実効性低下であり、外部秘密情報の即時漏洩ではない)ため、緊急対応ではなく通常のIssueフローで扱う。

Outcome

verify_trusted_artifact() の forged-self-consistent artifact bypass(producer自己申告の affected_surfaces と evidence: {} coherent forgery を独立検証しない設計ギャップ)の技術的実体と修正方針を調査・整理する。修正方針は affected_surfaces の再導出だけに限定せず、trusted verdict を決定する全入力(head_sha だけでなく base_sha、PR body digest、changed-path digest、base/head registry、policy_version 等)を trusted side で独立取得・再計算する水準まで踏み込んで検討し、その修正方針に基づく implementation Issue が起票可能な状態にする。

In Scope

  • verify_trusted_artifact() が producer 自己申告の affected_surfaces を、live PR diff と docs/dev/visual-surfaces.yml registry から独立に再計算した結果と突合するように修正する方式(trusted-side re-derivation)を調査する。対象入力は affected_surfaces に限定せず、base_sha、PR body digest、changed-path digest、base/head registry、policy_version 等 trusted verdict を決定する全入力を含める
  • evidence: {} coherent forgery(正しい surface_id を並べつつ digest claim を一切出さない bypass)を Background で明記した内容を踏まえ、修正方針でどう塞ぐかを検討する
  • component-VRT CheckRun の App identity / conclusion、PR body digest、artifact metadata を GitHub API の live data と再照合する代替・補完設計を調査する(producer自己申告を信頼根にしない)。ただし App identity + conclusion の live API 再照合は補助証拠に留まり、単独の trust root としては不十分であることを明記し、full-SHA pinned reusable workflow 等 immutable な trusted evidence producer への移行の要否も調査項目に含める
  • load_registry_text() の missing-ref-object と missing-file の区別・fail-closed 化を修正方針に含める(trusted-side re-derivation を実装する際に、shallow checkout などで live head の commit object が取得できないケースを synthetic empty registry へ縮退させず fail-closed にする必要があるため)
  • 上記 forged-self-consistent artifact を確実に FAIL させる adversarial fixture 設計案をまとめる。最低限、以下のケースを含める:
    • affected_surfaces: [](自己申告そのものが空)
    • evidence: {} coherent forgery(surface_id は正しいが digest claim がない)
    • missing commit ref object(shallow checkout 等で git show が非ゼロ終了するケース)
    • >3000 files の PR や incomplete diff(REST files API のページング上限に起因するケース)
    • stale base(base_sha が live PR の実際の base と乖離しているケース)
  • live PR diff を REST files API で取得する設計を検討する場合、単一ページ 3,000 files 上限による incomplete-set リスクを調査事項として整理する
  • 上記調査結果に基づき implementation Issue を起票する

Out of Scope

  • PR fix: visual-impact-trusted-consumer.yml の gh api --output 未対応バグを修正する (#2076) #2085(.github/workflows/visual-impact-trusted-consumer.yml の --output バグ修正)自体の変更。#2085は既に merge 済みであり、この follow-up と混載しない
  • untrusted ZIP展開の resource bound 強化(展開前サイズ制限)は別途 P1 follow-up として扱う(本Issueでは触れる程度に留め、必須スコープに含めない)
  • visual-impact-policy-trusted を branch protection の required_status_checks に昇格させること(本Issue完了後の話)
  • 実装コード・テストコードの追加(src/ 改修・tests/ 追加は次の implementation Issue の責務)

Acceptance Criteria

Verification Commands

AC2 / AC4 / AC6 は本 Issue 本文の記述内容そのものを対象とする narrative AC のため、
gh issue view による本文取得を VC として使う。AC5 は implementation Issue(#2091)が
既に起票済みであり、実 issue 番号を用いた gh issue view 2091 が baseline-expect: pass
(exit 0)となる状態である。

# AC1
# baseline-expect: pass
$ rg -n "def verify_trusted_artifact" scripts/agent-ops/resolve_visual_impact.py
# AC2
# baseline-expect: pass
$ gh issue view 2090 --repo squne121/loop-protocol --json body --jq '.body'
# AC3
# baseline-expect: fail
$ rg -n "minItems" docs/dev/visual-impact.schema.json
# AC4
# baseline-expect: pass
$ gh issue view 2090 --repo squne121/loop-protocol --json body --jq '.body'
# AC5
# baseline-expect: pass
$ gh issue view 2091 --repo squne121/loop-protocol
# AC6
# baseline-expect: pass
$ gh issue view 2090 --repo squne121/loop-protocol --json state --jq '.state'

Allowed Paths

  • 読み取り専用(既定)。VC 対象ファイルのみ:
  • scripts/agent-ops/resolve_visual_impact.py
  • docs/dev/visual-impact.schema.json

Stop Conditions

  • Outcome / Scope / AC が検索可能な形で記載されていない場合は即停止
  • Allowed Paths 外への書き込みを試みた場合は即停止
  • 権限不足(permission denied)により操作が完了できない場合は即停止
  • 成果物の書き込みに失敗した場合(I/O エラー等)は即停止

Handoff Contract

Notes for Reviewer

  • 本 Issue は research issue として起票する(実装ではなく設計上の脆弱性の記録・追跡が目的)。修正実装は本 Issue 完了後に別 implementation Issue として起票する
  • OWNER コメント(issuecomment-5250978464)は root-cause diagnosis と P0 severity classification を APPROVE、Scope/AC の拡張(evidence: {} coherent forgery、trusted verdict 全入力への拡張、component-VRT trust root の限界、load_registry_text() fail-closed 化、REST API 上限リスク、adversarial fixture 拡充)を REQUEST_CHANGES とした。本改訂で反映済み

Activity

  1. added
    phase/research
    state/queued
    agent/research
    on Aug 11, 2026
  2. squne121 commented on Aug 11, 2026

    @squne121
    OwnerAuthor

    判定

    Issue #2090 の中核診断は正しいです。ただし、現状の research contract のまま implementation Issue を起票するのは REQUEST_CHANGES 相当です。

    affected_surfaces: [] bypass は current main でも実在します。verify_trusted_artifact() は producer artifact の head_sha / repository / pull_request_number と、列挙された surface の manifest digest 整合性しか実質確認せず、affected_surfaces 自体を再導出していません。さらに schema は空配列を許容しています。

    ただし、#2090 が現在想定している「trusted-side で affected surfaces を再導出する」だけでは P0 は閉じません。 ここが今回の最重要追加 finding です。

    Findings

    1. P0 — affected_surfaces 再導出後にも、もっと簡単な forged-evidence bypass が残ります。

      現行 schema では各 surface の evidence object 自体に必須フィールドがなく、component_vrt_report_check_run_id、decision artifact ID/digest も null を許します。一方 verifier は evidence manifest が無い場合、surface が evidence_manifest_digest を主張しているときしか failure を追加しません。

      したがって implementation が surface 集合だけ再計算して比較する実装だと、攻撃者は正しい surface ID を並べて次のような decision を出せます。

      affected_surfaces:
        - surface_id: combat-hud-critical
          contract_id: vrt-component
          disposition: verified_unchanged
          evidence: {}
        - surface_id: combat-hud-running
          contract_id: vrt-component
          disposition: verified_unchanged
          evidence: {}
      
      component_vrt_report_check_run_id: null
      artifact_id: null
      artifact_digest: null

      現在の registry では src/ui/combatHud.ts 等を変更するとこの2 surface が affected になりますが、上記ならsurface set は trusted re-derivation と一致しながら、VRT を何も証明していない状態を作れます。

      よって 調査: visual-impact-policy-trusted の base-locked evaluator が untrusted producer の自己申告 affected_surfaces を re-derive せず、forged-self-consistent artifact で bypass可能 #2090 の修正目標は「affected surface set の再導出」ではなく、

      trusted verdict を決定する全入力を trusted side で取得・再計算すること

      まで引き上げる必要があります。少なくとも base_sha、head_sha、PR body digest、changed-path digest、base/head registry、surface/contract、disposition semantics、VRT provenance、artifact provenance を対象にすべきです。Issue 実装: visual-surface dependency registry と required visual-impact policy check を導入し、UI変更PR内でVRT処置を強制する #2019 の元契約自体はそれらを decision に束縛する設計でしたが、trusted consumer が再検証していません。

    2. P0 — component-VRT CheckRun の App identity + success は trust root になりません。

      調査: visual-impact-policy-trusted の base-locked evaluator が untrusted producer の自己申告 affected_surfaces を re-derive せず、forged-self-consistent artifact で bypass可能 #2090 は App identity / conclusion の live API 再照合を候補にしていますが、これは補助証拠に限定すべきです。PR head が .github/workflows/ci.yml の producer job 定義を変更できるという元の threat model のままなら、攻撃側 workflow が同じ job 名を作って成功させても、それは通常の GitHub Actions CheckRun です。CheckRun/Workflow Job API は App、job name、conclusion、head SHA 等を提供しますが、「この job の実装が trusted な immutable workflow definition だった」ことまでは App identity だけでは証明しません。([GitHub Docs]1)

      このため PR fix: visual-impact-trusted-consumer.yml の gh api --output 未対応バグを修正する (#2076) #2085 のレビューコメントにある「CheckRun App/結論も照合」は defense-in-depth としては正しいものの、P0 解消の信頼根としては不足します。

      より堅い構成は trusted reusable workflow を full commit SHA で pin して evidence production をそこへ移すことです。GitHub も reusable workflow の fully-qualified @SHA を stability/security 上最も安全な参照方法としています。同一 commit を使う ./.github/workflows/... では candidate 側変更を分離できません。([GitHub Docs]2)

      Artifact Attestation を使う場合も、untrusted producer が自分で署名するだけでは意味が薄く、--signer-workflow 等で trusted signer workflow に provenance を束縛する必要があります。GitHub は reusable workflow を signer とした attestation verification を正式にサポートしています。([GitHub Docs]3)

    3. P0/P1 — 現行 resolve() を trusted consumer からそのまま再利用すると、別の empty-registry fail-open を作る危険があります。

      これは 調査: visual-impact-policy-trusted の base-locked evaluator が untrusted producer の自己申告 affected_surfaces を re-derive せず、forged-self-consistent artifact で bypass可能 #2090 本文にない、実装時に特に危険な箇所です。

      現行 load_registry_text() は、

      git show <ref>:docs/dev/visual-surfaces.yml
      

      が非ゼロになった場合、「registry がその ref には存在しなかった」ものとして synthetic empty registry を返します。ref object 自体がローカルに無いケースと、本当に file が存在しなかったケースを区別していません。

      一方、current trusted workflow の actions/checkout@v6 は ref/fetch-depth を指定していません。actions/checkout の既定は 1 commit の shallow fetch です。 ([github.com]4)

      したがって implementation が単純に

      resolve(base_ref=live_base_sha, head_ref=live_head_sha)
      

      と追加すると、その commit object が checkout に無い → git show failure → empty registry と誤認、という経路で 再び empty affected set に退化する可能性があります。

      後続 Issue では必ず「missing ref/object は fail-closed」「missing registry path と区別する」を AC に入れるべきです。安全な実装は、exact base/head commit/blob を API または限定的 git fetch で明示取得して identity を確認してから resolver に渡す方式です。PR head の script/workflow 自体は trusted context で実行しないでください。GitHub は workflow_run が write token/secrets を扱えるため、untrusted code 実行を明示的に警告しています。([GitHub Docs]5)

    4. P1 — 「live PR diff を API で取得する」設計には 3,000 files 上限があります。

      GitHub REST の List pull request files はレスポンスが最大 3,000 files です。ページングしてもこの上限は超えられません。([GitHub Docs]6)

      したがって 調査: visual-impact-policy-trusted の base-locked evaluator が untrusted producer の自己申告 affected_surfaces を re-derive せず、forged-self-consistent artifact で bypass可能 #2090 の Open Question にある「live PR diff 取得」を単純に REST files API で実装すると、大規模 PR では complete set である保証がなくなります。

      この repo では既に producer 側が exact base/head に対する

      git diff --name-status -z --find-renames
      

      と base/head registry union を実装しているため、その semantics を trusted side に移植する方が整合的です。

      REST を採用するなら、3,000件到達・pagination 不完全・取得不能のいずれも unknown → FAIL とする必要があります。

    5. P1 — head freshness だけでなく base/policy snapshot の freshness も契約化すべきです。

      current workflow は workflow_run.head_sha と live PR head が違えば failure にするため、head の stale 判定はあります。

      しかし VISUAL_IMPACT_DECISION_V1 に入っている base_sha や base/head registry blob SHA は verify_trusted_artifact() が確認していません。

      PR head が同じでも main が進み、registry/baseline/policy が変わった場合にどの snapshot へ verdict を bind するのかが 調査: visual-impact-policy-trusted の base-locked evaluator が untrusted producer の自己申告 affected_surfaces を re-derive せず、forged-self-consistent artifact で bypass可能 #2090 では未定義です。後続実装では head_sha だけでなく base SHA + policy/evaluator SHA を verdict identity の一部にするべきです。

    6. P1 — adversarial fixture の AC が不足しています。

      既存 test の「forced success」は、decision が manifest digest を主張したのに manifest が無いケースです。これは producer が coherent に嘘をつくケースではありません。正常系テストも synthetic decision + synthetic manifest の自己整合性だけで PASS します。

      後続 implementation Issue には最低でも、empty surfaces、correct surfaces + evidence:{}、decision+manifest を完全に自己整合偽造、同名 GitHub Actions CheckRun success の偽 evidence、PR body stale、registry mapping deletion、missing commit ref、>3000 files / incomplete diff、stale base、そして 本当に visual impact が無い PR の [] は PASS、を fixture として固定すべきです。

      最後が重要です。affected_surfaces.minItems: 1 を付けるだけの修正は禁止した方がよいです。本当に visual impact がない diff では空集合が正しいためで、しかも non-empty forged evidence bypass も防げません。

    7. P2 — Issue の current-state 記述は既に一部 stale です。

      PR fix: visual-impact-trusted-consumer.yml の gh api --output 未対応バグを修正する (#2076) #2085 は既に merge 済みで、main はその merge commit ee641da1... に進んでいます。つまり「fix: visual-impact-trusted-consumer.yml の gh api --output 未対応バグを修正する (#2076) #2085 merge によって transport failure が解消されると」という未来形ではなく、transport fix は 2026-08-11 17:29 JST 頃に main へ landing 済みです。

      一方、PR fix(contract-review): RVA 欠落を fail-closed に統一 #2070 の current head に残る visual-impact-policy-trusted failure は fix: visual-impact-trusted-consumer.yml の gh api --output 未対応バグを修正する (#2076) #2085 merge より前の run で、まだ post-merge genuine verification の成功証拠ではありません。

      また取得できた classic branch protection の required contexts に visual-impact-policy-trusted はまだ含まれていません。したがって現在の位置づけは「既存 required gate を今すぐ突破する脆弱性」というより、trusted check を enforcement に昇格できない P0 design blocker と表現するのが正確です。

    推奨する research 結論

    #2090 の Outcome は、次の設計へ収束させるのが妥当です。

    producer artifact を「検証対象の主張/hint」に格下げし、trusted consumer 自身が verdict をゼロから構築する。

    具体的には trusted side で current PR metadata、exact base/head SHA、完全な changed paths、base/head registry union、PR body、surface/contract を独立取得して resolver を再実行し、surface set と disposition を独立評価します。VRT evidence は candidate-controlled ci.yml の job name/App identity を信頼根にせず、full-SHA pinned reusable workflow など immutable な trusted evidence producer に移すのが第一候補です。Artifact REST の digest/head metadata は有用ですが、これは provenance 補強であって semantic correctness の代替ではありません。GitHub の Artifact API は digest、size、workflow run/head SHA を取得できます。([GitHub Docs]7)

    加えて、untrusted ZIP の workspace 展開は #2090 の OOS として分離して構いませんが、GitHub 自身の workflow_run 例でも untrusted artifact を workspace ではなく ${{ runner.temp }} へ展開するよう明示されています。これは別 P1 を起票する価値があります。([GitHub Docs]5)

    最終評価

    Root-cause diagnosis: APPROVE
    P0 severity classification: APPROVE
    Current research scope / AC: REQUEST_CHANGES
    Implementation Issue 起票 readiness: まだ不足

    特に後続 Issue の契約に 「surface set の再導出だけでは完了としない」「evidence:{} を含む non-empty coherent forgery MUST FAIL」「missing Git object を empty registry と解釈しない」「CheckRun App identity は trust root ではない」 の4点を追加しないと、P0 を修正したつもりで第二の bypass を残す可能性が高いです。

    Issue #2090 は現時点でコメント0件・後続 implementation Issue もまだ確認できません。

  3. squne121 commented on Aug 11, 2026

    @squne121
    OwnerAuthor

    issue-refinement-loop 終了報告(iteration 2、human_judgment_required)

    anchor comment(https://github.com/squne121/loop-protocol/issues/2090#issuecomment-5250978464、OWNER)を対象に issue-refinement-loop を実行した。

    実施内容

    1. anchor comment fact-check: OWNER コメントが提示した7つの技術的クレームを control-plane が repo 上で直接検証(grep / read / git log / gh api branch protection)し、全て verified と確認した。
      • verify_trusted_artifact()(scripts/agent-ops/resolve_visual_impact.py:1324)は evidence: {}(digest claim なし)を検証しない
      • schema に minItems / evidence required フィールドなし
      • load_registry_text() は missing-ref-object と missing-file を区別しない
      • checkout step は base/default branch のみ取得(PR head 非取得)で、将来の trusted-side re-derivation 実装が同バグ経路で empty registry に縮退しうる
      • PR fix: visual-impact-trusted-consumer.yml の gh api --output 未対応バグを修正する (#2076) #2085 は merge 済み(commit ee641da)
      • branch protection required_status_checks に visual-impact-policy-trusted は未含有
      • 既存テストに evidence:{} coherent forgery ケースなし
    2. iteration 1 review(issue-reviewer): VERDICT needs-fix(4 blockers: AC番号ラベル欠落・VC placeholder・VC broad-path×2)。
    3. Step 4 rewrite(issue-editor): 4 blocker 修正 + OWNER フィードバック7点を本文へ反映。post-mutation readback で反映確認済み(body_sha256: d891f5ca907b9acdb55532a26118560d563580764ab1726e5ca26da69db7071d)。
    4. iteration 2 review(issue-reviewer): 実質的な内容(機械チェック C1-C12・OWNER フィードバック7点)はすべて反映確認されたが、AC3 の VC annotation(baseline-expect: pass)が本文の記述(minItems 制約は現状存在しない)と矛盾しているとの指摘(VERDICT: needs-fix)。

    停止理由(human_judgment_required)

    iteration 2 の compact review 出力自体が validate_review_compact_output.py の契約検証で invalid(needs_fix_blockers_must_be_nonzero: VERDICT: needs-fix なのに BLOCKERS: 0)と判定された。これは checker/artifact 側の自己矛盾(producer 側の compact_review_result.py 出力バグ)であり、issue-refinement-loop の fail-closed 規約(validator 結果が invalid の場合は orchestrator が独自解釈せず human_judgment_required に固定する)に従い、ここで自動継続を停止する。

    残課題(人間判断向け)

  4. squne121 commented on Aug 11, 2026

    @squne121
    OwnerAuthor

    実装 Issue を起票しました: #2091

    上記修正方針(trusted-side re-derivation・evidence: {} coherent forgery 対策・load_registry_text() fail-closed 化・adversarial fixture 追加)を反映した implementation Issue です。AC5 の link 要件を満たします。

  5. squne121 commented on Aug 11, 2026

    @squne121
    OwnerAuthor

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

    anchor comment(https://github.com/squne121/loop-protocol/issues/2090#issuecomment-5250978464、OWNER)を対象に issue-refinement-loop を実行し、承認(approved)に至った。

    実施経緯

    1. anchor comment fact-check: OWNER が指摘した7つの技術的クレームを control-plane が repo 上で直接検証(grep / read / git log / gh api branch protection)し、全て verified と確認した(evidence: {} coherent forgery bypass、schema の minItems/required フィールド欠如、load_registry_text() の missing-ref-object と missing-file 非区別、checkout step の PR head 非取得設計、PR fix: visual-impact-trusted-consumer.yml の gh api --output 未対応バグを修正する (#2076) #2085 merge済み、branch protection 未含有、既存テストの coherent forgery 未カバー)。
    2. iteration 1: review で4 blocker(AC番号ラベル欠落・VC placeholder・VC broad-path×2)→ issue-editor が本文全面改訂し、OWNER フィードバック7点(trusted verdict 全入力への Outcome 拡張・evidence: {} coherent forgery 明記・component-VRT trust root 限界・load_registry_text() fail-closed化・REST API 3,000 files 上限・adversarial fixture 拡充・stale 事実関係の更新)を反映。
    3. iteration 2: 内容面は反映確認されたが、AC3 の VC annotation(minItems 検索の baseline-expect: pass)が本文記述と矛盾していると指摘。
    4. AC3 修正: baseline-expect: fail に修正(rg -n "minItems" docs/dev/visual-impact.schema.json は exit 1 であることを control-plane が独立確認済み)。
    5. iteration 3: 残課題は AC5(後続 implementation Issue 未起票)のみと確認。
    6. Step 4.5(child issue materialization): 調査結果に基づき implementation Issue 実装: visual-impact-policy-trusted の trusted-side re-derivation で forged-self-consistent artifact bypass を fail-closed に修正する #2091(https://github.com/squne121/loop-protocol/issues/2091)を起票し、#2090 にリンクコメントを投稿。調査: visual-impact-policy-trusted の base-locked evaluator が untrusted producer の自己申告 affected_surfaces を re-derive せず、forged-self-consistent artifact で bypass可能 #2090 の AC5/AC6 を [x] 化し、AC5 の VC を実 issue 番号(gh issue view 2091, baseline-expect: pass)に更新。
    7. iteration 4(最終): VERDICT: approve、BLOCKERS: 0。

    Final Gate

    issue-contract-review(run_contract_review_once.py --mode execute)で CONTRACT_REVIEW_RESULT_V1.status: go を確認済み(readiness_status: go、vc_preflight_status: pass、AC1/AC2/AC4/AC5/AC6 は expected_pass(exit 0)、AC3 は expected_fail(exit 1)でいずれも decision: go)。

    FOLLOW_UP_MATERIALIZATION_RESULT_V1

    FOLLOW_UP_MATERIALIZATION_RESULT_V1:
      schema_version: 1
      materialized_by: issue-refinement-loop
      follow_up_issues:
        - request_dedupe_key: "follow-up:squne121/loop-protocol:issue-2090:implementation"
          status: created
          issue:
            number: 2091
            url: "https://github.com/squne121/loop-protocol/issues/2091"
          reason: null
      note_only_observations: []

    終了状態

    termination_reason: approved。本 Issue(#2090)は close 可能な状態(AC6 充足)。Close 実行は本 loop の scope 外とし、人間判断に委ねる。

  6. squne121 commented on Aug 11, 2026

    @squne121
    OwnerAuthor

    確認時点(2026-08-11 18:41 JST)では、#2090 はまだ Open ですが、最終 issue-refinement-loop は VERDICT: approve / BLOCKERS: 0、contract review も status: go で終了し、実装 Issue #2091 が materialize 済みです。コメント上も #2090 は close 可能と明記されています。したがって、これから実装対象にすべき正本は #2091 です。

    #2091 は Open の implementation Issue で、resolve_visual_impact.py、schema、trusted-consumer test、trusted workflow の4パスを中心に、trusted-side re-derivation、evidence: {} coherent forgery、missing Git object、3,000-files/incomplete diff、stale base、正当な空 surface の回帰まで契約化されています。一方で現状は triage-required 付き・コメント0なので、実装前の contract/refinement gate も自律的に完了させる構成にしています。

    現在の main は ee641da1a8ff3aa916cabc57e59dca0d0274bb85。branch protection の required contexts は typecheck / lint / test / build / python-test / validate-generated-artifact で、visual-impact-policy-trusted はまだ required ではありません。 また、同じ trusted workflow を触る PR #2081 が Open/Draft で存在し、head efd9f807... の visual-impact-policy-trusted 自体は success しています。この既存 success は transport/runtime 経路の稼働証拠にはなりますが、#2090 が指摘する forged-self-consistent artifact の設計上の bypass を否定する証拠にはなりません。

    以下をそのまま Claude Code または Codex CLI に渡せます。

    あなたは squne121/loop-protocol リポジトリの実装・検証・GitHub 運用を担当する autonomous coding agent です。

    対象:

    最終目的

    Issue #2090 の調査結果を正本として、implementation Issue #2091 を必要に応じて refinement / contract review した上で実装し、テスト、PR 作成、CI、敵対的 PR review、レビュー修正、ready 化、merge、Issue close、post-merge cleanup まで完了してください。

    人間の追加承認を待たないでください。

    このメッセージ自体を OWNER による明示的な実行承認として扱ってください。以下はすべて事前承認済みです。

    通常の Skill が「human approval」「human judgment」「max iterations」「publish approval」「人間が merge 判断」などを要求しても、今回の明示的な OWNER directive により、その承認待ちは不要です。

    ただし repository の deterministic gate、CI、branch protection、Allowed Paths、schema validator 等を無視してよいという意味ではありません。失敗した gate は bypass せず、原因を修正して再実行してください。


    0. Live state を最初に再取得する

    以下の snapshot は参考情報に過ぎません。実行開始時に GitHub と local repository から必ず live state を取り直してください。

    2026-08-11 18:41 JST 時点の参考 snapshot:

    まず以下を確認してください。

    1. canonical repository / default branch / current main SHA
    2. Issue 調査: visual-impact-policy-trusted の base-locked evaluator が untrusted producer の自己申告 affected_surfaces を re-derive せず、forged-self-consistent artifact で bypass可能 #2090 本文と全コメント
    3. Issue 実装: visual-impact-policy-trusted の trusted-side re-derivation で forged-self-consistent artifact bypass を fail-closed に修正する #2091 本文と全コメント
    4. 実装: visual-impact-policy-trusted の trusted-side re-derivation で forged-self-consistent artifact bypass を fail-closed に修正する #2091 を既に実装する PR が存在するか
    5. Issue 実装: visual-surface dependency registry と required visual-impact policy check を導入し、UI変更PR内でVRT処置を強制する #2019
    6. Issue 実装: visual-impact-trusted-consumer.yml の gh api --output 未対応バグを修正する #2076 / PR fix: visual-impact-trusted-consumer.yml の gh api --output 未対応バグを修正する (#2076) #2085
    7. Issue 実装: implementation Issue の Runtime Verification Applicability 欠落を authoring・readiness・reviewer・consumer 全経路で fail-closed に統一する #2040 / PR fix-bootstrap-refs #2081
    8. PR fix(contract-review): RVA 欠落を fail-closed に統一 #2070
    9. PR 実装: visual-surface dependency registry と required visual-impact policy check を導入する #2045
    10. 調査: visual-impact-policy-trusted の base-locked evaluator が untrusted producer の自己申告 affected_surfaces を re-derive せず、forged-self-consistent artifact で bypass可能 #2090 OWNER comment 5250978464
    11. 調査: visual-impact-policy-trusted の base-locked evaluator が untrusted producer の自己申告 affected_surfaces を re-derive せず、forged-self-consistent artifact で bypass可能 #2090 final approved comment 5251493785
    12. PR fix: visual-impact-trusted-consumer.yml の gh api --output 未対応バグを修正する (#2076) #2085 で 調査: visual-impact-policy-trusted の base-locked evaluator が untrusted producer の自己申告 affected_surfaces を re-derive せず、forged-self-consistent artifact で bypass可能 #2090 起票の契機となった OWNER comment
    13. current branch protection
    14. current-head CI / CheckRuns
    15. fix-bootstrap-refs #2081 と 実装: visual-impact-policy-trusted の trusted-side re-derivation で forged-self-consistent artifact bypass を fail-closed に修正する #2091 の実変更範囲が衝突するか

    すでに #2091 の実装 PR または merge 済み実装が存在する場合は重複実装しないでください。既存成果物を検証し、足りない部分だけ修正して最終状態まで進めてください。


    1. Repository instructions / Skills を正本として読む

    最初に最低限以下を読んでください。

    • AGENTS.md
    • CLAUDE.md
    • docs/dev/workflow.md
    • docs/dev/secret-policy.md
    • docs/dev/visual-impact.schema.json
    • .claude/skills/issue-refinement-loop/SKILL.md
    • .claude/skills/issue-contract-review/SKILL.md
    • .claude/skills/implement-issue/SKILL.md
    • .claude/skills/impl-review-loop/SKILL.md
    • .claude/skills/open-pr/SKILL.md
    • .claude/skills/pr-review-judge/SKILL.md
    • .claude/skills/post-merge-cleanup/SKILL.md

    Claude Code / Codex CLI とも .claude/skills/**/SKILL.md を canonical procedure として利用してください。

    read-only Git probe について repository-approved probe script が存在する場合は raw git よりそちらを優先してください。


    2. #2090 の authority を確定する

    #2090 の最終 OWNER/refinement 結論を再確認してください。

    重要な research conclusion は以下です。

    Trust model

    untrusted producer が出した VISUAL_IMPACT_DECISION_V1 は trust root ではありません。

    producer artifact は最大でも「claim / hint / comparison target」として扱い、trusted consumer 自身が trusted verdict を構成してください。

    単に producer の affected_surfaces を再導出して比較するだけでは不十分です。

    trusted verdict を決定する入力を可能な限り trusted side で独立取得・再計算してください。

    最低限:

    • live PR number
    • repository identity
    • exact head_sha
    • exact base_sha
    • PR body
    • PR body digest
    • complete changed-path set
    • changed-path digest
    • rename/add/delete semantics
    • base registry
    • head registry
    • base/head registry union semantics
    • registry identity / digest
    • policy_version
    • evaluator identity
    • surface mapping
    • contract mapping
    • disposition semantics
    • VRT evidence provenance
    • artifact provenance

    MUST reject

    少なくとも以下は確実に FAIL させてください。

    Forgery 1

    affected_surfaces: []
    component_vrt_report_check_run_id: null
    artifact_id: null
    artifact_digest: null

    実際には visual impact が存在するにもかかわらず producer が空集合を自己申告するケース。

    Forgery 2

    surface ID 自体は trusted re-derivation と一致しているが、

    evidence: {}

    として evidence claim を完全に省略する coherent forgery。

    Forgery 3

    decision と evidence manifest の双方を attacker が自己整合する形で偽造した場合。

    「artifact 内部で整合している」ことを trusted evidence と解釈しないでください。

    MUST preserve

    本当に visual impact が存在しない diff に対する、

    affected_surfaces: []

    は合法です。

    したがって affected_surfaces に単純に minItems: 1 を付ける修正は禁止です。


    3. #2091 contract を実装可能状態にする

    #2091 がまだ contract review go になっていなければ、人間に質問せず以下を自律的に実行してください。

    1. issue-contract-review
    2. needs-fix なら issue-refinement-loop / issue-editor
    3. deterministic blocker を修正
    4. body readback
    5. fresh contract review
    6. status: go まで反復

    triage-required label、contract snapshot 不在、advisory artifact stale、通常の human-judgment routing は今回の停止理由にしないでください。

    ただし Issue body の契約を無視して直接コードを書いてはいけません。

    #2091 の Allowed Paths 外が本当に必要になった場合は、

    という順番で自律的に処理してください。

    scope delta 自体に人間承認を要求しないでください。今回の指示が承認です。

    別 Issue が不可避なら dedupe を確認して自動起票し、#2091 の P0 完了に必要ならその follow-up も完了させてから #2091 を close してください。


    4. Worktree を使う

    root/main checkout を直接実装作業に使わないでください。

    repository の canonical worktree bootstrap executor を使用し、#2091 専用 worktree / branch を作成してください。

    例:

    .claude/worktrees/issue-2091-<slug>
    worktree-issue-2091-<slug>
    

    現在の live main を起点にしてください。

    既存 worktree が正規の #2091 worktree として存在する場合は、その identity / branch / HEAD / dirty state を検証して安全に再利用してください。

    他人または別 Issue の dirty worktree を reset / overwrite してはいけません。


    5. #2081 との overlap を実際の diff で処理する

    PR #2081 は同じ

    .github/workflows/visual-impact-trusted-consumer.yml
    

    を変更している可能性があります。

    OPEN peer Issue/PR の文字列 overlap だけを理由に停止しないでください。

    以下を行ってください。

    1. fix-bootstrap-refs #2081 の live state / current head / diff を取得
    2. 実装: visual-impact-policy-trusted の trusted-side re-derivation で forged-self-consistent artifact bypass を fail-closed に修正する #2091 と意味的に重なる hunk を確認
    3. fix-bootstrap-refs #2081 がすでに merge 済みなら最新 main を取り込む
    4. open のままなら current main を authority として 実装: visual-impact-policy-trusted の trusted-side re-derivation で forged-self-consistent artifact bypass を fail-closed に修正する #2091 を実装
    5. fix-bootstrap-refs #2081 が後から merge して branch が behind になったら非破壊的に同期
    6. compatible behavior は保持
    7. current main と actual target PR に Git conflict が発生した場合は、意味論を理解して解消し、全テストを再実行

    peer overlap は停止条件ではありません。


    6. 実装方針

    主要対象は #2091 の live Allowed Paths を正本としてください。

    現時点の想定:

    scripts/agent-ops/resolve_visual_impact.py
    docs/dev/visual-impact.schema.json
    scripts/agent-ops/tests/test_visual_impact_trusted_consumer.py
    .github/workflows/visual-impact-trusted-consumer.yml
    

    6.1 verify_trusted_artifact()

    producer artifact の自己申告だけから ok=True を出さない構造にしてください。

    trusted side の live data / independently materialized data から verdict inputs を再構築し、producer decision と照合してください。

    特に:

    • live head mismatch → FAIL
    • stale base → FAIL
    • PR body digest mismatch → FAIL
    • changed path digest mismatch → FAIL
    • registry identity mismatch → FAIL
    • policy/evaluator identity mismatch → FAIL
    • claimed surface set mismatch → FAIL
    • required VRT evidence missing → FAIL
    • evidence: {} → visual evidence が必要な surface では FAIL
    • provenance が unknown → FAIL

    unknown を success に丸めないでください。

    6.2 CheckRun identity

    GitHub Actions CheckRun の:

    • App identity
    • name
    • conclusion
    • head SHA

    の live API 再照合は defense-in-depth として利用して構いません。

    しかし App identity + success だけを trust root にしてはいけません。

    candidate-controlled workflow が同名 job を生成できる threat model を維持してください。

    full-commit-SHA pinned reusable workflow 等、immutable trusted evidence producer が P0 を閉じるために必要かを実装時に判断してください。

    必要なら canonical scope expansion を自律実行してください。

    6.3 load_registry_text()

    以下を区別してください。

    • ref / commit object 自体が存在しない
    • ref は存在するが docs/dev/visual-surfaces.yml が存在しない

    前者を synthetic empty registry と解釈してはいけません。

    missing commit/ref/object は fail-closed。

    本当に bootstrap history 上 registry file が存在しない場合のみ、既存 contract が許す empty-registry semantics を維持してください。

    6.4 changed paths

    可能なら exact base/head commit を取得した上で既存 semantics と同じ

    git diff --name-status -z --find-renames
    

    に基づく complete changed path set を trusted side で作る方法を優先的に検討してください。

    GitHub REST List pull request files を利用する場合は 3,000 files 上限を complete set と誤認しないでください。

    • 3,000件到達
    • pagination incomplete
    • API response incomplete
    • identity 不明

    はいずれも unknown → FAIL としてください。


    7. Adversarial tests を先に固定する

    TDD で最低限以下を追加してください。

    1. visual impact があるのに affected_surfaces: [] → FAIL
    2. 正しい surface ID + evidence: {} → FAIL
    3. decision + evidence manifest が自己整合した forged artifact → FAIL
    4. missing commit/ref object → FAIL
    5. registry path 本当に不存在の bootstrap case → intended behavior
    6. stale base → FAIL
    7. PR body stale / digest mismatch → FAIL
    8. registry mapping deletion/change → trusted side で検出
    9. incomplete / >3000-files diff → FAIL
    10. same-name GitHub Actions CheckRun success だけでは trusted evidence にならない
    11. 本当に visual impact がない PR + affected_surfaces: [] → PASS

    既存の legitimate success fixtures を壊さないでください。

    fixture 名は #2091 の Verification Commands から検索可能な名前を維持してください。少なくとも:

    affected_surfaces_empty
    evidence_empty_coherent_forgery
    missing_ref_object
    no_visual_impact_empty_surfaces_pass
    

    を満たしてください。


    8. Verification

    #2091 の live Issue に記載された Verification Commands をすべて実行してください。

    現在の contract では少なくとも以下を含みます。

    rg -n "base_sha" scripts/agent-ops/resolve_visual_impact.py
    
    uv run --locked pytest \
      scripts/agent-ops/tests/test_visual_impact_trusted_consumer.py \
      -k "affected_surfaces_empty" -v
    
    uv run --locked pytest \
      scripts/agent-ops/tests/test_visual_impact_trusted_consumer.py \
      -k "evidence_empty_coherent_forgery" -v
    
    uv run --locked pytest \
      scripts/agent-ops/tests/test_visual_impact_trusted_consumer.py \
      -k "missing_ref_object" -v
    
    uv run --locked pytest \
      scripts/agent-ops/tests/test_visual_impact_trusted_consumer.py \
      -k "no_visual_impact_empty_surfaces_pass" -v
    
    rg -c "minItems" docs/dev/visual-impact.schema.json
    
    uv run --locked pytest \
      scripts/agent-ops/tests/test_visual_impact_trusted_consumer.py -v

    加えて変更内容に応じて repository gates を実行してください。

    最低限候補:

    uv run --locked ruff check .claude/scripts scripts schemas .claude/skills
    pnpm typecheck
    pnpm lint
    pnpm test
    pnpm build
    actionlint .github/workflows/visual-impact-trusted-consumer.yml
    git diff --check

    実際の repo policy / CI plan を読み、より正確な canonical command があればそちらを使用してください。

    FAIL したらその場で root cause を調査し、修正し、再実行してください。

    既知の無関係な failure と断定する場合も、証拠なしに無視しないでください。


    9. Commit / publish

    変更ファイルを明示的に stage してください。

    禁止:

    git add -A
    git add .
    --no-verify
    

    commit は repository convention に従ってください。

    push して PR を作成してください。

    この指示は open-pr Skill に対する明示的な:

    publish: yes
    

    です。

    追加承認を求めないでください。

    既存の同一 branch PR があれば重複作成せず、それを更新してください。


    10. PR

    linked implementation Issue は #2091 です。

    PR 本文では原則として:

    Closes #2091
    Refs #2090
    

    としてください。

    Closes #2090 を使って research Issue を実装 PR merge と同時に早期 close させないでください。#2090 は post-merge verification 後に明示的に close します。

    PR body には repository validator が要求する全 section を含めてください。

    特に今回の変更は security/trust-boundary + schema/workflow change なので、少なくとも:

    • Summary
    • linked Issue
    • Acceptance Criteria
    • Verification results
    • Allowed Paths compliance
    • Schema Change Applicability
    • Schema Consumer Inventory
    • Safety Claim Matrix
    • Visual Impact Declaration
    • CI Test Performance Decision
    • Not controlled
    • Follow-up

    等を repo の live template / validator に従って作成してください。

    Not controlled に何か残す場合は、それが #2091 の P0 完了を妨げないことを明確にしてください。


    11. PR review loop

    PR 作成で終了してはいけません。

    current impl-review-loop / pr-review-judge の意味論を利用し、

    implementation
    → verification
    → adversarial PR review
    → fix delta
    → verification
    → re-review
    

    を繰り返してください。

    通常の max_iterations: 3 を今回の human escalation 境界として使わないでください。

    同じ blocker が繰り返される場合は単に同じ実装を再試行せず、root cause を掘り下げて設計を修正してください。

    以下をすべて取得して対応してください。

    • top-level PR comments
    • submitted reviews
    • inline review comments
    • unresolved review threads
    • current head SHA
    • mergeability
    • merge state
    • current-head CI
    • branch protection

    REQUEST_CHANGES の actionable finding はすべて修正してください。

    reviewed SHA が stale なら current head でレビューし直してください。

    APPROVE だけでは merge しないでください。

    最終条件:

    • independent/adversarial reviewer verdict = APPROVE
    • blockers = 0
    • reviewed head SHA = current PR head SHA
    • unresolved actionable review thread = 0
    • Verification Commands = PASS
    • relevant repository gates = PASS
    • required CI = current head で PASS
    • mergeability = merge可能
    • branch が behind なら同期後に再検証
    • PR body validator = PASS

    agent が返す単なる human_review_required: true は今回の停止理由にしないでください。具体的 blocker を抽出して自律解消してください。


    12. CI

    current-head CI を確認してください。

    branch protection required checks を必ず満たしてください。

    既存 required contexts を削除・無効化・admin bypass してはいけません。

    visual-impact-policy-trusted が required でなくても、今回その実装自体を変更するため、該当 CheckRun / workflow の genuine execution を可能な限り current-head で確認してください。

    ただし既存の visual-impact-policy-trusted: success を「forged artifact bypass が修正された証拠」とは扱わないでください。

    security property の主証拠は adversarial regression tests と trusted-side data acquisition/re-derivation です。

    flaky / infrastructure failure ならログを確認して bounded rerun してください。

    コード原因なら修正してください。


    13. Ready / merge

    review・CI・mergeability の全条件を満たしたら Draft PR を Ready for review にしてください。

    その後、最新 head SHA を再取得し、reviewed SHA / CI SHA と一致することを確認してください。

    repository の live merge policy を確認してください。

    2026-08-11 時点では squash merge のみ許可されているため、設定が変わっていなければ squash merge を使用してください。

    可能なら head SHA binding を伴う merge 方法を使用し、TOCTOU を避けてください。

    人間の merge 承認は追加で求めないでください。今回の指示で承認済みです。

    ただし以下は禁止です。

    • branch protection 無効化
    • required check 削除
    • admin override で gate bypass
    • force merge
    • failed CI を無視した merge

    GitHub 自体が権限・外部 reviewer requirement 等で merge を拒否した場合は、保護を弱めず原因を確認し、可能な repo-native 方法で解消してください。


    14. Post-merge

    merge 後に終了せず、必ず readback してください。

    確認:

    1. PR merged == true
    2. merge/squash commit が current main ancestry に存在
    3. expected implementation が main に存在
    4. 実装: visual-impact-policy-trusted の trusted-side re-derivation で forged-self-consistent artifact bypass を fail-closed に修正する #2091 が Closes #2091 により CLOSED/completed になっている
    5. post-merge CI に重大 regression がない
    6. 調査: visual-impact-policy-trusted の base-locked evaluator が untrusted producer の自己申告 affected_surfaces を re-derive せず、forged-self-consistent artifact で bypass可能 #2090 final research conclusion と実装結果が整合

    #2091 が GitHub auto-close されなかった場合、AC が満たされ merge 済みであることを確認して completed として明示的に close してください。

    #2091 に最終コメントを残してください。

    最低限:

    • PR URL
    • merged SHA
    • final reviewed head
    • AC1〜AC7 結果
    • test results
    • CI results
    • review verdict
    • remaining follow-up
    • security assumptions

    15. Issue #2090 を close

    #2090 の final refinement は既に APPROVE / contract review go / close可能という前提ですが、live comment を再確認してください。

    #2091 の implementation が merge・close された後、#2090 に完了コメントを投稿してください。

    内容:

    その後 #2090 を completed として close してください。

    AC checkbox の見た目だけを目的に不要な body rewrite はしないでください。live close contract / final approved comment を authority としてください。


    16. Post-merge cleanup

    .claude/skills/post-merge-cleanup/SKILL.md を使用してください。

    安全を確認した上で:

    • merged branch cleanup
    • worktree cleanup
    • local main synchronization
    • stash/readback
    • superseded temporary resources
    • follow-up materialization

    を行ってください。

    未merge commit、未commit変更、他 Issue の worktree を削除してはいけません。


    17. HARD STOP CONDITIONS

    停止条件は次の2種類だけです。

    STOP 1 — 破壊的操作が必要

    以下のような、ユーザーデータ・未merge作業・repository protection を破壊または不可逆に変更する操作が必要になった場合だけ停止してください。

    例:

    • git push --force / --force-with-lease が不可避
    • user work を失う git reset --hard
    • 未merge branch の削除
    • 未commit user changes の破棄
    • unrelated Issue / PR の削除・close
    • main history rewrite
    • branch protection の無効化
    • required checks の削除
    • admin bypass による merge
    • security gate を弱める操作
    • repository data の不可逆削除

    破壊的操作を実行せず、必要と判断した具体的操作・理由・代替案を報告して停止してください。

    STOP 2 — 秘密情報

    以下が必要または発生した場合だけ停止してください。

    • token / password / private key / secret の表示
    • secret を prompt / log / Issue / PR / commit に貼る必要がある
    • credential の export
    • secret-policy の bypass
    • secret file を commit する必要がある
    • 認証情報を第三者サービスへ転送する必要がある

    通常の既存 gh / git credential / GitHub Actions credential を、値を露出せず通常利用することは停止理由ではありません。

    秘密値を表示・コピー・記録せず、必要性だけ報告して停止してください。


    18. STOP にしないもの

    以下は停止理由ではありません。自律修正・再試行・正規手続きで解決してください。

    • triage-required
    • human approval gate
    • publish approval gate
    • agent-generated human_review_required
    • max iteration 到達
    • contract snapshot stale/missing
    • advisory artifact missing
    • scope delta
    • Allowed Paths を広げる必要性
    • follow-up Issue 必要性
    • peer PR overlap
    • branch behind
    • mergeability UNKNOWN の一時状態
    • CI flake
    • review REQUEST_CHANGES
    • schema validator failure
    • PR body validator failure
    • test failure
    • lint failure
    • typecheck failure
    • build failure
    • actionlint failure
    • stale review SHA
    • stale base
    • GitHub API の一時的エラー
    • worktree の新規作成が必要
    • current implementation approach が不十分だったこと

    これらは原因を調査し、修正し、再実行してください。

    権限や外部プラットフォーム障害により物理的に完遂不能で、かつ repository protection を弱めず解消する手段が存在しない場合は、承認を求めるのではなく「terminal external blocker」として正確な live evidence を残して終了してください。


    19. 最終出力

    最後に、人間が追加調査しなくても状態を把握できるよう以下を返してください。

    EXECUTION_RESULT_V1:
      status: merged_and_closed | terminal_external_blocker | safety_stopped
      repository: squne121/loop-protocol
    
      research_issue:
        number: 2090
        state: open | closed
        close_reason: null | completed
    
      implementation_issue:
        number: 2091
        state: open | closed
        close_reason: null | completed
    
      pull_request:
        number: null
        url: null
        state: null
        reviewed_head_sha: null
        final_head_sha: null
        merged: false
        merge_sha: null
    
      verification:
        issue_ac:
          AC1: pass | fail
          AC2: pass | fail
          AC3: pass | fail
          AC4: pass | fail
          AC5: pass | fail
          AC6: pass | fail
          AC7: pass | fail
        targeted_pytest: pass | fail
        full_relevant_pytest: pass | fail
        typecheck: pass | fail
        lint: pass | fail
        test: pass | fail
        build: pass | fail
        actionlint: pass | fail
        diff_check: pass | fail
    
      ci:
        required_checks_current_head: pass | fail
        visual_impact_policy_trusted: pass | fail | not_observed
    
      review:
        verdict: APPROVE | REQUEST_CHANGES | UNKNOWN
        blockers: []
        unresolved_threads: 0
        reviewed_head_matches_final_head: true | false
    
      post_merge:
        main_contains_merge: true | false
        cleanup_status: ok | partial | not_run
    
      follow_up_issues: []
    
      stop:
        reason: null | destructive_operation | secret_handling | terminal_external_blocker
        detail: null

    途中経過ではなく、可能な限り 実装→PR→review→merge→#2091 close→#2090 close→cleanup まで一つの実行で完遂してください。

    この版は、リポジトリ既存の Skill を使いつつ、通常の「PR は人間が merge」「publish は追加承認」といった境界を、今回の明示的な承認で上書きするようにしています。特に #2090 を直接実装せず #2091 を実装 authority にすること、#2081 の overlap を停止理由にしないこと、Closes #2091 / Refs #2090 にすることを固定しています。

  7. self-assigned this
    on Aug 11, 2026
  8. squne121 commented on Aug 11, 2026

    @squne121
    OwnerAuthor

    研究成果の実装反映完了・close

    本 Issue(#2090)の調査結果は、実装 Issue #2091 に materialize され、PR #2094(merge SHA a137e9202e8c1f640f02b9af07a0a764542b5510)として merge・close 済みです。

    対策概要(forged-self-consistent artifact bypass への対応)

    • bypass1(affected_surfaces: [] 自己申告の無検証受容): resolve_trusted_minimum() を新設し、trusted side で独立に取得した base/head registry・changed-path set から meta-policy/global-invalidator/direct-producer/mapping-deletion/coverage-boundary の 5 シグナルを再計算し、producer 自己申告との過小申告を affected_surfaces_undercount として拒否するようにした。
    • bypass2(evidence: {} coherent forgery): disposition != "waived" の全 surface で evidence_manifest_digest claim の有無を無条件チェックし、surface_id が正しくても digest claim が空なら拒否するようにした。
    • bypass3(decision/evidence 双方の自己整合的偽造): 上記 2 点に加え、base_sha/PR body digest/changed-path digest/registry blob sha/policy_version を trusted side で独立に再取得・再計算し producer 自己申告と突合することで、「artifact 内部で整合している」だけでは通らない設計にした。
    • load_registry_text() の missing-ref-object/missing-file 混同: MissingRefObjectError を独立例外として追加し、commit object 不存在(shallow checkout 等)を fail-closed にし、正当な missing-file bootstrap ケースとは明確に区別した。

    adversarial テスト結果

    scripts/agent-ops/tests/test_visual_impact_trusted_consumer.py に 5 種の adversarial fixture(affected_surfaces_empty / evidence_empty_coherent_forgery / missing_ref_object / stale base / incomplete changed-paths)を含む 26 tests を追加し、全 PASS。真に visual impact が無い PR の affected_surfaces: [] PASS 判定(no_visual_impact_empty_surfaces_pass)も回帰確認済み。

    visual-impact-policy-trusted の branch-protection required 化

    引き続き #2090/#2091 の Out of Scope のまま(未対応)。

    非 blocking follow-up

    以上により本 Issue を completed として close します。

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

Metadata

Metadata

Assignees

Labels

agent/researchphase/researchstate/queued

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions