Repository navigation
Closed
Labels
agent/implementerAI implementer agentenhancementNew feature or requestphase/implementationImplementation phase
Description
Machine-Readable Contract
contract_schema_version: v1
issue_kind: implementation
parent_issue: "1645"
child_id: protected-execution-artifact-producer
dedupe_key: "1645:protected-execution-artifact-producer:v1"
goal_ref: "protected default-branch workflow が閉じた command manifest を実行し、subject PR とは独立した二段 execution record / producer receipt artifact を生成する"
change_kind: workflow
preflight_scope: implementation
runtime_verification:
required: true
mode: post_merge_canary
evidence_type: protected-workflow-receiptParent Issue
Depends On
- なし
Parent Goal Ref
- Goal: current-head TEST_VERDICT trust chain の protected execution producer layer を提供する。
- Desired Destination: default branch から起動する workflow が subject PR と producer workflow の identity を分離し、二段 artifact receipt を Child C へ渡す。
Current Validated Scope
- 現行 CI artifact は Issue 固有 VC の per-AC record を protected producer として生成していない。
- GitHub Actions upload artifact の archive digest は upload 後にのみ得られるため、同一 archive 内の execution payload と同一視できない。
- 現行
TEST_VERDICT_MACHINE/v2consumer のproducer_kind: test-runnerは変更せず、本 Issue は独立した execution record/receipt schema を producer する。
Remaining Parent Gaps
- receipt を検証して HEAD-bound に投稿する dedicated publisher は Child B の責務。
- materializer/adjudicator/Step 2 consumer は Child C の責務。
Required Design References
docs/dev/agent-skill-boundaries.mddocs/dev/workflow.mddocs/dev/schema-governance.md
Outcome
protected workflow、closed command manifest、execution record/receipt schema と contract test が追加され、post-merge canary が subject PR binding・per-AC coverage・upload receipt digest を readback して確認できる。
In Scope
.github/workflows/test-verdict-execution-record.ymlを追加し、default branch に merge 後だけworkflow_dispatchできる protected producer とする。- workflow は producer identity(workflow source ref/SHA/path、run/job/check ID)と subject identity(target PR、head repository ID、expected/current HEAD、linked Issue body SHA)を独立に readback する。
- versioned command manifest の command_id/canonical argv/cwd/timeout allowlist だけを実行し、Issue Markdown の raw command、shell、eval、展開を実行しない。
- execution-record artifact には canonical payload SHA と per-AC coverage を保存し、upload 後 producer-receipt artifact には artifact ID/URL/archive digest を保存する。互いの digest を自己参照させない。
- schema/catalog と producer contract test を追加し、pre/post execution、post-upload、final readback の identity drift、skip、fallback、nonzero exit、timeout、missing coverage を PASS eligible receipt にしない。
Out of Scope
- TEST_VERDICT コメントの投稿、marker/idempotency、pre/post publish HEAD barrier。
controlled_skill_mutation_exec.pyの publisher policy 変更。- materializer/adjudicator/Step 2 documentation の変更。
- fix: contract snapshot の base SHA freshness を強制する (#1635) #1640 の evidence 再生成。
TEST_VERDICT_MACHINE/v2consumer の producer_kind 変更。
Acceptance Criteria
- AC1: default-branch producer は producer identity と subject PR/Issue identity を pre/post execution、post-upload、final readback で一致確認する。
- AC2: execution-record の canonical payload SHA と producer-receipt の upload archive digest/id/url は別 schema artifact として保存され、自己参照しない。
- AC3: versioned manifest の allowlisted command_id/canonical argv/cwd/timeout 以外、raw Issue VC、shell/eval/展開、skip/fallback/nonzero/timeout/missing coverage は PASS eligible receipt を生成しない。
- AC4: schema catalog と producer contract test は AC1〜AC3 の positive、identity drift、artifact ID/digest mismatch、receipt欠落の fail-closed cases を検証する。
- AC5: post-merge bootstrap canary は workflow run/job/check と二段 artifact REST readback を成功させるまで本 Issue を close 可能にしない。
Verification Commands
# AC1
# preflight-scope: pr_review_only
$ uv run --locked pytest scripts/agent-guards/tests/test_test_verdict_execution_record_workflow.py -q
# AC2
# preflight-scope: pr_review_only
$ uv run --locked pytest scripts/agent-guards/tests/test_test_verdict_execution_record_workflow.py -q
# AC3
# preflight-scope: pr_review_only
$ uv run --locked pytest scripts/agent-guards/tests/test_test_verdict_execution_record_workflow.py -q
# AC4
# preflight-scope: pr_review_only
$ uv run --locked pytest scripts/agent-guards/tests/test_test_verdict_execution_record_workflow.py -q
# AC5
# preflight-scope: pr_review_only
$ uv run --locked pytest scripts/agent-guards/tests/test_test_verdict_execution_record_workflow.py -qAllowed Paths
- .github/workflows/test-verdict-execution-record.yml
- .github/ci/python-test-plan.json
- schemas/test-verdict-execution-record.schema.json
- schemas/test-verdict-producer-receipt.schema.json
- schemas/catalog.yaml
- schemas/tests/test_catalog.py
- scripts/agent-ops/test_verdict_execution_record_producer.py
- scripts/agent-guards/tests/test_test_verdict_execution_record_workflow.py
Scope Delta
- 追加日時: 2026-07-23T00:27:57Z
- 追加パス:
.github/ci/python-test-plan.json - 理由: PR 実装: protected TEST_VERDICT execution artifact producer #1683 が追加した
scripts/agent-guards/tests/test_test_verdict_execution_record_workflow.pyを CI の python-test / node-backed-hook-tests lane(uncovered_changed_test_files gate)で実行対象として登録するために必要な、CI-gate 適合目的の機械的追記。意味論的な仕様変更ではない。 - 参照: PR 実装: protected TEST_VERDICT execution artifact producer #1683 pr-review-judge REQUEST_CHANGES(allowed_paths_gate: fail_closed)
Runtime Verification Applicability
decision: immediate
mode: post_merge_canary
applicable_acs: [AC1, AC2, AC3, AC4, AC5]
execution_environment: "protected default-branch workflow_dispatch と GitHub Actions REST readback"
skip_conditions: "workflow source SHA、subject PR/Issue identity、run/job/check、二段artifactのいずれかを readback できない場合"
fallback_policy: "skip/fallback を PASS に変換せず、receipt を diagnostic-only として issue close を停止する"
artifact_requirements: "execution-record payload SHA と upload後 producer-receipt archive digest/id/url の別artifact、post-merge canary REST readback"
reason: "新規 workflow は PR 自身を protected producer として自己実証できないため、default branch merge 後の canary を必須にする"CI Test Performance Decision
CI_TEST_PERFORMANCE_DECISION_V1:
schema: CI_TEST_PERFORMANCE_DECISION_V1
issue_number: null
pr_number: null
decision_scope: ci_change
changed_paths:
- .github/workflows/test-verdict-execution-record.yml
- schemas/test-verdict-execution-record.schema.json
- schemas/test-verdict-producer-receipt.schema.json
- schemas/catalog.yaml
- schemas/tests/test_catalog.py
- scripts/agent-ops/test_verdict_execution_record_producer.py
- scripts/agent-guards/tests/test_test_verdict_execution_record_workflow.py
lane_classification:
fast_static: {applicable: true, evidence: [workflow-contract], required_commands: ["uv run --locked pytest scripts/agent-guards/tests/test_test_verdict_execution_record_workflow.py -q"]}
python_unit: {applicable: true, evidence: [pytest], required_commands: ["uv run --locked pytest scripts/agent-guards/tests/test_test_verdict_execution_record_workflow.py -q"]}
contract_artifact: {applicable: true, evidence: [artifact-schema], required_commands: ["uv run --locked pytest scripts/agent-guards/tests/test_test_verdict_execution_record_workflow.py -q"]}
integration: {applicable: false, evidence: [post-merge-canary], required_commands: []}
baseline_inputs: {ci_runtime_baseline_v1_available: false, run_count: 0, p50_p95_ready: false}
artifact_consistency: {ci_test_selection_v1_checked: false, missing_pytest_args: []}
risk_flags: [new-protected-workflow, artifact-provenance, post-merge-bootstrap]
reviewer_gate: {approve_allowed: true, required_evidence: [TEST_VERDICT_MACHINE, CI_CHECK_RUN_SCOPED]}
follow_up_required: []Stop Conditions
- Allowed Paths 外の変更が必要と判明した場合
- In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
- 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
- 後続 Phase / 別スコープへの波及が判明した場合
- nested SubAgent delegation が必要になった場合
- 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
- protected workflow definition を default branch 以外から trust する必要が生じた場合
- PASS artifact を skip、fallback、self-attested result から生成する必要が生じた場合
- execution-record payload SHA と upload receipt archive digest を同一 artifact 内で自己参照する必要が生じた場合
- consumer の
TEST_VERDICT_MACHINE/v2producer identity を本 Issue で変更する必要が生じた場合
Required Skills
なし
Scope Collision (C1)
- related_issue: 実装: isolation worktree agent の Issue comment request を issue_comment.publish controlled mutation lane へ parent delegation で接続する #1633, 実装: required CI を snapshot read-only に固定し baseline canonicalization を reviewed PR 境界に限定する #1388, 実装: playtest-log の JSON Schema / validator の追加 #420, 改善: implement-issue SKILL に Allowed Paths 外 consistency 更新の明示ルールと Schema Consumer Inventory iteration 更新ガイドラインを追加 #239, 改善: executable bit audit CI guard の適用範囲を .claude/skills 外のスクリプトへ拡張する #213, 実装: .claude/skills 配下スクリプトの executable bit を監査し CI guard を追加する #205
- overlapping_paths:
.github/workflows/test-verdict-execution-record.yml,scripts/agent-guards/tests/test_test_verdict_execution_record_workflow.py - non_conflict_reason: 各候補は broad directory pattern の一致であり、Issue 固有 VC の execution record artifact、current HEAD/body SHA binding、per-AC coverage を所有しない。
- edit_intent: protected workflow、closed command producer、二段 artifact schema/catalog、専用 contract test を追加する。
- dependency_ordering: 同一 workflow path の open PR が発生した場合は、その merged current main を readback してから着手する。
Delivery Rule
- 1 Issue = 1 PR。
- 実装着手前、および base SHA または Issue コメント集合が更新された後に、fresh
CONTRACT_REVIEW_RESULT_V1 status: goを取得する。 - Scope Collision (C1) 判断を再発行した場合は、そのコメント集合を含む fresh snapshot を取得してから実装を継続する。
- normal commit / push のみを使用し、force push、hook disable、guard bypass を行わない。
Metadata
Metadata
Assignees
Labels
agent/implementerAI implementer agentenhancementNew feature or requestphase/implementationImplementation phase
Activity
squne121 commentedon Jul 19, 2026
結論
STOP / NEEDS_FIX。方向性は正しいものの、現契約には「実装不能な digest 要求」「protected workflow の自己検証不能」「Issue 本文由来コマンドのコード実行境界欠落」があります。重大な指摘
P0-1 — artifact が自分自身の archive digest を含む要求は成立しない
AC2 は execution record artifact 内に artifact digest を含めることを要求しています。
しかし
actions/upload-artifactのartifact-id、artifact-url、artifact-digestは、artifact をアップロードした後に初めて出力されます。したがって、同じ ZIP artifact 内へその ZIP 自身の digest を格納するのは自己参照になり、通常の一回の upload では実現できません。これは仕様上の推論です。([GitHub]1)以下を明確に分離する必要があります。
推奨構成は二段 artifact です。
execution-record.jsonを uploadproducer-receipt.jsonを生成親レビューでも payload hash と archive digest の混同は既に問題化されています。
P0-2 — 新規 workflow は自分自身を「default-branch protected producer」として検証できない
#1646 は、新規 workflow を trusted default branch definition として扱いながら、対象 PR の runtime verification を immediate に行う契約です。
ところが、次の二択になります。
pull_requestで実行する→ PR に含まれる workflow 定義が使われるため、その PR 自身が producer ロジックを改変可能
workflow_dispatchで default branch 版を実行する→ workflow ファイルは先に default branch へ存在していなければならず、新規 workflow を追加する PR 自身では実行不能
GitHub は workflow run ごとに、イベントに関連付けられた commit/ref 上の workflow 定義を使用します。
workflow_dispatchは workflow が default branch に存在する場合だけ起動でき、実行には write access も必要です。([GitHub Docs]2)さらに
workflow_dispatchのGITHUB_SHAは dispatch 先 branch の tip です。default branch から起動した run のhead_shaは main 側であり、検証対象 PR HEAD ではありません。([GitHub Docs]3)したがって、次を別 identity として保持しなければなりません。
#1646 自身の検証は、通常の既存 CI と人間・既存 reviewer 経路でマージした後、post-merge bootstrap canary を実行して完了させる必要があります。
P0-3 — Issue 本文の Verification Commands は untrusted code である
Issue の設計は、Issue 本文から取得した Verification Commands を workflow が実行する前提です。
GitHub は Issue/PR の body、title、branch 名などの context を untrusted input として扱い、shell 等でコードとして解釈させないよう警告しています。([GitHub Docs]4)
本文から次のような command を抽出して
bash -c、eval、一時 shell script で実行する設計は不可です。必要なのは「Markdown 中の任意 shell」ではなく、閉じた command contract です。
最低条件は以下です。
bash -c、evalを使用しないtimeout-minutesとプロセス終了条件を固定また、現行 test-runner の許可コマンド一覧には
uv run --locked pytestが含まれていません。Issue の VC と既存 test-runner 契約が不一致です。P0-4 — 新規 machine-readable schema なのに Allowed Paths が不足している
リポジトリの schema governance は、producer/consumer 境界を越える JSON/YAML、log artifact、PR comment contract を schema と定義しています。
execution record と producer receipt は明確に新規 schema ですが、#1646 の Allowed Paths は次の二つだけです。
少なくとも以下が必要です。
現行 catalog はいまだ
TEST_VERDICT_MACHINE v1を test-runner producer として登録している一方、実装と文書は既に v2 を使用しています。Child C は「Child A/B の receipt contract を変更する必要が生じた場合」を停止条件にしています。A で schema を固定しなければ、C が実装段階で契約を発明することになり、この停止条件に直撃します。
P0-5 —
producer_kindの意味が既存 consumer と衝突している現行 adjudicator は以下を必須にしています。
一方 #1646 の実 producer は protected GitHub Actions workflow です。
次のどちらにするかを Child A で固定する必要があります。
または互換性を維持するなら、
後者は名称が実態を誤認させるため、前者を推奨します。
P1-1 — 実行後の HEAD/body barrier が足りない
AC1 は「HEAD と body SHA の一致を確認してから execution record を生成」としていますが、検証コマンド実行中に PR HEAD や Issue body が変わる競合を扱っていません。
必要な順序は以下です。
Child B のコメント投稿前後 barrier は、producer artifact が既に stale である問題を修復しません。Child A 自身に final barrier が必要です。#1640 のレビューでも、最終 success 直前の authority barrier 欠落が実際に blocker になっています。
P1-2 — workflow/check/artifact identity の定義が曖昧
artifact の authority は名前ではなく ID にすべきです。GitHub artifact API は以下を返します。
([GitHub Docs]5)
workflow job API からは job ID、run ID、head SHA、status、conclusion、job name、
check_run_urlを取得できます。([GitHub Docs]6)execution record / receipt には最低限、次を固定してください。
artifact_nameやcheck nameだけで選択してはいけません。P1-3 —
per-AC recordの正規化ルールが未定義#1646 は四つの AC 全てに同一 pytest command を指定しています。
この場合、以下が未定義です。
推奨 schema は「実行」と「AC coverage」を分離します。
これなら同一コマンドを無意味に四回実行せず、全 AC coverage も検証できます。
P1-4 — 現在の contract test は実 runtime provenance を証明しない
全 AC の VC は同じ Python test 一本です。これで検証できるのは YAML 構造や mock の挙動までであり、以下は証明できません。
また Runtime Verification は
read_only_github_integrationとされていますが、artifact producer の実証には実際の Actions artifact upload が必要です。検証を二段階に分けるべきです。
Child A の close 条件は post-merge canary 成功まで保留する必要があります。
なお CI performance decision では
pnpm buildを integration required としていますが、Verification Commands には存在しません。これも契約内不整合です。P1-5 — protected producer としての Actions hardening が不足している
GitHub は third-party action を full-length commit SHA で pin することを、action を immutable に参照する唯一の方法としています。([GitHub Docs]7)
現行 CI は
actions/checkout@v6、actions/upload-artifact@v7の tag 参照を使用しています。一方、hook integrity workflow のsetup-uvは full SHA pin 済みです。この producer では全 action を full SHA pin してください。
さらに権限は明示的に限定します。GitHub Actions は
permissionsに一部を指定すると、未指定 permission はnoneになります。([GitHub Docs]8)PR code を実行する job へ secrets、
id-token: write、write token を付与してはいけません。特権イベントから untrusted PR code を checkout・実行する構成は避ける必要があります。([GitHub Docs]9)Artifact attestation は補助策として利用できますが、
id-token: writeとattestations: writeが必要になるため、MVP の必須要件にはせず、別 threat model で導入する方が安全です。([GitHub Docs]10)推奨する producer contract
upload 後に別 artifact として生成します。
Issue 本文へ必要な修正
producer_source_shaとsubject_pr_head_shaを別フィールドにする。producer_kindを protected workflow に変更し、既存 test-runner との compatibility decision を固定する。PR static validation + post-merge bootstrap canaryに変更する。pnpm buildを実 VC に追加するか、CI performance decision から削除する。Artifact retention は親 Issue でも未決定です。現在の CI は 30 日ですが、public repository では 1〜90 日の範囲で設定できます。consumer chain の最大処理期間を基準に固定してください。 ([GitHub Docs]11)
関連 Issue / PR の評価
.github/workflows/**を持つため機械的 path collision は実在しますが、VRT snapshot update guard であり意味的競合は低いです。対して 実装: playtest-log の JSON Schema / validator の追加 #420 は broadscripts//tests/一致による明確な false positive です。実装着手条件は、上記 P0 を反映した Issue 改訂後に fresh
CONTRACT_REVIEW_RESULT_V1 status: goを取得することです。現契約のまま workflow を書き始めるべきではありません。squne121 commentedon Jul 19, 2026
Contract Review Result
squne121 commentedon Jul 19, 2026
Contract Review Result
squne121 commentedon Jul 19, 2026
overlap preflight: C1 非衝突の再確認
Allowed Paths の scope extension 後も、Issue #1646 と #1388 は非重複です。#1646 は protected TEST_VERDICT execution record/receipt producer、#1388 は VRT snapshot update guard を扱います。
squne121 commentedon Jul 19, 2026
Contract Review Result
squne121 commentedon Jul 19, 2026
Contract Review Result
squne121 commentedon Jul 19, 2026
overlap preflight: C1 非衝突の再確認
Allowed Paths の表示正規化後も、Issue #1646 と #1388 は非重複です。#1646 は protected TEST_VERDICT execution record/receipt producer、#1388 は VRT snapshot update guard を扱います。
squne121 commentedon Jul 19, 2026
overlap preflight: C1 非衝突の再確認
Issue #1646 と #1388 は非重複です。#1646 は protected TEST_VERDICT execution record/receipt producer、#1388 は VRT snapshot update guard を扱います。
squne121 commentedon Jul 19, 2026
Contract Review Result
squne121 commentedon Jul 22, 2026
Contract Review Result
squne121 commentedon Jul 22, 2026
impl-review-loop: 人間判断要請(2026-07-22T12:25:00Z)
Issue #1646 の準備ゲートで scope-rollup の capture 証跡が不足したため、実装・PR 起票には進みませんでした。
squne121 commentedon Jul 22, 2026
Contract Review Result
fix: 二段 artifact producer に post-upload final readback と AC4 負例を追加する (#…
squne121 commentedon Jul 22, 2026
implement-issue: 実装完了
fix: resolve CI Ruff E501 and register new test file in python-test-p…
fix: resolve CI gate blockers for test-verdict schema catalog entries…
squne121 commentedon Jul 23, 2026
Contract Review Result
fix: actionlint expression quoting in test-verdict-execution-record w…
実装: protected TEST_VERDICT execution artifact producer (#1683)
実装: TEST_VERDICT consumer integration(materializer + receipt-aware ad…