Skip to content

実装: retro_live_verification trusted_actorのcaller-controlled trust rootを廃止する - #1795

Merged
squne121 merged 1 commit into
mainfrom
worktree-issue-1415-p0gh-fix
Jul 26, 2026
Merged

squne121 merged 1 commit into
mainfrom
worktree-issue-1415-p0gh-fix

Conversation

@squne121

Copy link
Copy Markdown
Owner

retro_live_verification: trusted_actorのcaller-controlled trust rootを廃止する

Summary

Issue #1415の追加敵対的レビューで指摘されたP0-G(trusted actorの自己登録)を修復する。PR #1789のP0-C修正はcurrent_actor(github.triggering_actor)とtrusted_actorを分離したが、trusted_actor自体がworkflow_dispatchの自由入力(デフォルト値付き)のままであり、workflowをdispatchできるactorが任意の値(自分自身のlogin等)を指定できる構造だった。これはtrust rootとして機能しない。

Current repo reality / contract drift(現状と契約との乖離)

  • .github/workflows/retro-live-verification.ymlのtrusted_actorはtype: string, required: false, default: 'squne121'のworkflow_dispatch inputであり、dispatch時にcaller(write権限を持つ任意のactor)が上書き可能だった。
  • TRUSTED_ACTOR環境変数は${{ inputs.trusted_actor }}から値を取得しており、caller-suppliedな値をtrust rootとして使用していた。

Scope Delta

Allowed Pathsの追加なし(既存Allowed Paths内で完結)。

Acceptance Criteria matrix(受け入れ基準対応表)

指摘 修復内容 commit
P0-G trusted_actor workflow_dispatch inputを削除し、TRUSTED_ACTORをworkflow file内の固定literal('squne121')へ変更。変更にはreviewed merged PRを要する 19b7e99a

Verification Commands results(検証コマンド実行結果)

$ pnpm typecheck   → pass
$ pnpm lint        → pass
$ pnpm test        → pass (1826/1826、既存1823+新規3)
$ pnpm build       → pass

workflow yaml変更後、uv run --locked python3 -c "import yaml; yaml.safe_load(open('.github/workflows/retro-live-verification.yml'))"でYAML構文パース確認済み(YAML OK)。

CI Test Performance Decision(CIテスト性能判断)

schema: CI_TEST_PERFORMANCE_DECISION_V1
lane_classification: no_new_lane
reason: >-
  既存workflowからworkflow_dispatch inputを1件削除し、環境変数の値をinput参照から固定literalへ
  変更したのみ。新規CI lane・新規job・新規trigger条件は追加していない。
new_ci_jobs: []
lane_migration_required: false

Runtime Verification Applicability

decision: immediate
github_api_required: false
applicable_acs: [P0-G]
execution_environment: static_analysis
skip_conditions:
  allowed: false
fallback_policy:
  allowed: false
reason: >-
  本修正はworkflow yaml静的構造の変更であり、追加したunit test(yaml parse + フィールド検証)で
  検証可能。live workflow_dispatch実行によるライブ検証はマージ後に別途行う。

Schema Change Applicability

- decision: not_schema_change
reason: workflow yamlのinput定義削除とenv値変更のみ。スキーマファイルの変更はなし。

Schema Consumer Inventory

本PRはschemaファイルを変更していないため、consumer一覧の更新はない。trusted_actor inputの削除により、.github/workflows/retro-live-verification.ymlのみが変更対象。

Safety Claim Matrix

Claim Implemented? Not controlled Evidence Follow-up
trusted_actorがcaller-controllableでなくなった Yes - workflow yaml diff、新規test 3件 -
v2既存契約は非破壊 Yes - pnpm test(1826/1826 pass) -

Backward compatibility / migration decision(後方互換性・移行方針)

trusted_actor workflow_dispatch inputの削除は破壊的変更だが、これはIssue #1415内の未リリースの脆弱な設計を修正するものであり、外部からのworkflow呼び出し契約として確立されたものではない(環境protectionはIssue #1153側で別途要設定)。既存v2 workflow経路・PRイベント時read-only testsは無変更。

Checks

  • pnpm typecheck pass
  • pnpm lint pass
  • pnpm test pass(1826/1826)
  • pnpm build pass
  • workflow YAML構文パース確認
  • Allowed Paths内ファイルのみ変更(2ファイル)
  • v2既存fixture/argument-freeデフォルトの回帰なし

Notes

  • 本PRはRefs #1415を使用しCloses #1415は使用しない。#1415はpost-merge live artifact chain完了までopenのままとする。
  • P0-H(github.triggering_actorと認可主体の混同)について: workflow_dispatch自体はGitHubのwrite権限モデルにより起動時点で認可されるため、triggering_actorを認可の一次情報源として使うこと自体は妥当。本PRでは「triggering_actorをtrust rootとして流用しない」という観点に絞って修正した。

Refs #1415(本PRはIssueをcloseしない)

…flow file内の固定literalへ変更する

P0-C fix_delta(PR #1789)はcurrent_actor(github.triggering_actor)とtrusted_actorを
分離したが、trusted_actor自体がworkflow_dispatch inputのまま残っており、
dispatchするactorが任意の値(自分自身のlogin等)を指定できてしまう構造だった。
これはtrust rootとして機能しない。TRUSTED_ACTORをworkflow file内の固定literal
('squne121')へ変更し、変更にはreviewed merged PRを要するようにした。
@github-actions

Copy link
Copy Markdown
Contributor

Preview URL

✅ verified live assets: https://squne121.github.io/loop-protocol/pr-1795/

The preview will be removed when this PR is closed.

@squne121 squne121 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Review 判定

Issue #1415 のcontract snapshotを再materialize(issue comment 5083421476, fresh go)した上でAllowed Paths gateを再計算した結果、status: ok(stale_snapshotは解消)。CI 15/15 green。P0-G修正(trusted_actor workflow_dispatch input削除、TRUSTED_ACTORをworkflow file内固定literalへ変更、新規test 3件)を実コードで確認した。

LOOP_VERDICT_V2:
  verdict: APPROVE
  reviewed_head_sha: "19b7e99a3b352d808b48f8acce8b17766487fab4"
  merge_ready: true
  mergeability:
    mergeable: "MERGEABLE"
    merge_state_status: "CLEAN"
  blockers: []
  required_auto_actions: []
  allowed_paths_gate:
    status: "ok"
    violations: []
    contract_fingerprint:
      issue_number: 1415
      contract_source_id: "5083421476"
      base_sha_at_snapshot: "92f8ced76266cf016e6515bcedf09b6d3d470dfe"

@squne121
squne121 marked this pull request as ready for review July 26, 2026 12:20
@squne121
squne121 merged commit d1671a8 into main Jul 26, 2026
25 checks passed
@squne121
squne121 deleted the worktree-issue-1415-p0gh-fix branch July 26, 2026 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant