Skip to content

実装: retro_live_verification v3のpost後検証欠落・trusted actor自己参照・fixture/live区別を修復する - #1789

Merged
squne121 merged 2 commits into
mainfrom
worktree-issue-1415-p0-fix
Jul 26, 2026
Merged

squne121 merged 2 commits into
mainfrom
worktree-issue-1415-p0-fix

Conversation

@squne121

Copy link
Copy Markdown
Owner

retro_live_verification: v3 workflowのpost後検証欠落・trusted actor自己参照・fixture/live区別欠如を修復する

Summary

Issue #1415のpost-merge live closure実行中に発見した4件の追加実装バグ(P0-A/B/C/D)を修復する。PR #1781(マージ済み)でproducer/resolverのdigest契約バグを修復した後も、v3 workflow・readback・trusted actor authority・fixture/live区別に残っていた問題を解消する。

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

コード照合により以下を確認した。

  • P0-A: .github/workflows/retro-live-verification.ymlのv2ブランチには投稿後にVerify canonical comment landed correctly (v2)stepがあるが、v3ブランチには対応する投稿後検証stepが存在しなかった。
  • P0-B: v3 dual-target manifest生成時のreadback.status: 'pending'(PR #1781で導入)をverified/failedへ遷移させる後続ロジックが実装されていなかった。
  • P0-C: v3投稿stepが--current-actor "$CURRENT_ACTOR" --trusted-actor "$CURRENT_ACTOR"と同一のシェル変数を両方のCLIフラグに渡しており、workflow実行者が自分自身を信頼済みactorとして自己登録できる構造だった。
  • P0-D: retro-live-verification:verifyが引数なし実行でfixtureフォールバックする設計と、fixture fallbackを絶対に許さない「live専用closure検証」が、同一script名・フラグ有無のみで区別されていた。

(P0-E「legacy source_set_digestとresolved_comment_set_digestの混同」は再現しなかった。両者は別関数・別canonicalization profileで実装されており、コード上の混同は確認できなかった。)

Scope Delta

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

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

指摘 修復内容 commit
P0-A v3投稿stepの直後にVerify canonical comment landed correctly (v3 dual-target)stepを追加 ebf87009
P0-C trusted_actor workflow inputを新設し、github.triggering_actor(現在の実行者)とは独立した入力源にした ebf87009
P0-D --require-liveフラグを追加。--execution-profileがliveでない、または--live未指定の場合はfail-closedで非0終了する ebf87009
P0-B verifyDualTargetCanonicalReadback()を新規実装。--liveモード実行時に親issueの全コメントをlive listし、v3 ownership marker一致件数を実測してcanonical_comment_count/duplicate_count/status: verified|failedを算出 896e61ab

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

$ pnpm typecheck   → pass
$ pnpm lint        → pass
$ pnpm test        → pass (1823/1823、既存1817+新規6)
$ 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(.github/workflows/retro-live-verification.yml)へのstep追加のみで、新規CI lane・
  新規job・新規trigger条件は追加していない。追加stepはworkflow_dispatch専用の既存v3投稿経路の
  拡張であり、PRイベント時の実行時間には影響しない。既存テストファイルへの追加テスト6件も
  既存のpnpm testレーン内で実行され、実行時間への影響は軽微。
new_ci_jobs: []
lane_migration_required: false

Runtime Verification Applicability

decision: immediate
github_api_required: true
applicable_acs: [P0-A, P0-B, P0-C, P0-D]
execution_environment: github_cli_authenticated_live_session
skip_conditions:
  allowed: false
fallback_policy:
  allowed: false
reason: >-
  live GitHub API実行を要する検証はunit test(モックしたGitHub API応答含む)でロジックを検証済み。
  実際のworkflow_dispatch実行によるライブ検証はマージ後に別途行う。

Schema Change Applicability

- decision: not_schema_change
reason: >-
  スキーマファイル自体の変更はなし。workflow yamlのinput追加とscript内部ロジックの追加のみ。

Schema Consumer Inventory

本PRはschemaファイル自体を変更していないため、consumer一覧の更新はない。retro_live_verification/v3のconsumer(check-retro-live-verification.mjs, generate-retro-live-verification.mjs, post-retro-live-verification.mjs, .github/workflows/retro-live-verification.yml)は変更対象だが、schemaフィールド自体(readback)の型・必須項目はPR #1781で既に確定済みで、本PRはその値を埋めるロジックの追加のみ。

Safety Claim Matrix

Claim Implemented? Not controlled Evidence Follow-up
v2既存契約は非破壊 Yes - pnpm test(1823/1823 pass) -
trusted actorが実行者自身と分離される Yes - workflow yaml diff、trusted_actor input追加確認 P0-Cの対応はworkflow input分離のみで、bundleスキーマへのexecution_boundary embedded trust化は未実施(follow-up候補)
--require-liveはfixture fallbackをfail-closedにする Yes - negative test(fixtureフォールバック時に非0終了することを確認) -
readbackが実際のGitHub live stateから遷移する Yes - 統合テスト(0件・複数件・pagination未完了のnegative test含む) digest_revalidation(bundle digest再計算との突合)は本PRのスコープ外

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

既存v2/v3の挙動・fixture・argument-freeデフォルトは無変更。--require-liveは新規optionalフラグで、未指定時は既存挙動を維持する。trusted_actor workflow inputはデフォルト値を設定し、既存workflow_dispatch呼び出しの後方互換を維持する。

Checks

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

Notes

  • 本PRはRefs #1415を使用しCloses #1415は使用しない。#1415はpost-merge live artifact chain完了までopenのままとする。
  • P0-Cの対応はworkflow input分離という最小限の修正であり、v3 bundle schema自体にexecution_boundaryフィールドを追加する、というより根本的な設計変更は将来のfollow-upとする。
  • readback.digest_revalidation(bundle digest再計算との突合)は本PRのスコープ外(P0-Bで明示された「count/duplicate遷移」のみ実装)。

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

squne121 added 2 commits July 26, 2026 16:06
…自己参照・fixture/live区別欠如を修復する

P0-A: v3投稿stepの直後にlive verify stepを追加(v2と同様の投稿後検証)。
P0-C: trusted_actor workflow inputを新設し、current_actor(triggering_actor)とは
別ソースにする(自己登録ループを解消)。v2の既存トラスト境界は無変更。
P0-D: check-retro-live-verification.mjsに--require-liveを追加し、
fixture fallbackやliveフラグ欠落を明示的にfail-closedにする。
既存のfixtureデフォルト挙動自体は無変更(--require-live未指定時は従来通り)。
…ailedへ実際に遷移させる

verifyDualTargetCanonicalReadback()を追加。生成時のreadback.pendingを
自己申告のまま放置せず、--liveモード実行時に親issueの全コメントを
live listしてv3 ownership markerに一致する件数を実測し、
canonical_comment_count/duplicate_countをその場で算出してfail-closedに検証する。
client引数をinjectableにしテストで検証(pagination未完了・0件・重複件のnegative test含む)。
@github-actions

github-actions Bot commented Jul 26, 2026 •

Copy link
Copy Markdown
Contributor

Preview URL

Preview removed (PR #1789 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 判定

独立再検証の結果、PR #1789(head 896e61ab6cb55df4e8013d08264b93e7c38e6d2e)を APPROVE とする。

  • 前回レビューでCI python-test失敗を指摘したが、これは本PRのAllowed Paths外・diff無関係の既存flaky test(test_issue_393_snapshot_fixture_processed、90秒timeout、同時刻のmain CIでも同一失敗を確認済み)であり、複数回の再実行の末、全14チェックがgreenになったことを確認した。
  • P0-A(v3投稿後verify step追加)、P0-C(trusted actor自己参照解消)、P0-D(--require-live fail-closed実装)、P0-B(readback状態遷移実装)いずれも実コードで確認済み。
  • Allowed Paths: 3ファイルすべて適合。
LOOP_VERDICT_V2:
  verdict: APPROVE
  reviewed_head_sha: "896e61ab6cb55df4e8013d08264b93e7c38e6d2e"
  merge_ready: true
  mergeability:
    mergeable: "MERGEABLE"
    merge_state_status: "CLEAN"
  blockers: []
  required_auto_actions: []
  allowed_paths_gate:
    status: "ok"
    violations: []

@squne121
squne121 marked this pull request as ready for review July 26, 2026 07:44
@squne121
squne121 merged commit 7336492 into main Jul 26, 2026
56 of 60 checks passed
@squne121
squne121 deleted the worktree-issue-1415-p0-fix branch July 26, 2026 07:45
squne121 added a commit that referenced this pull request Jul 26, 2026
…flow file内の固定literalへ変更する (#1795)

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を要するようにした。
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