Skip to content

実装: producer receipt に command_manifest_sha256 を伝播する回帰修正 #1711

Closed

Description

@squne121

Machine-Readable Contract

contract_schema_version: v1
issue_kind: implementation
parent_issue: "#1645"
goal_ref: "trusted producer と対象 PR exact-source execution を分離し、current-head provenance と command_manifest_sha256 を pre-contract/record/final-contract/receipt 全段へ独立束縛して fail-closed にする"
change_kind: code

Parent Issue

#1645

Parent Goal Ref

Current Validated Scope

  • 既存 producer chain では receipt への command_manifest_sha256 伝播欠落が upload の missing-file error に隠れるため、直接の build failure と reason category を保持する必要がある。
  • 現行 workflow は default branch producer contract test を実行するだけで対象 PR head の exact source execution を証明しないため、B の controlled reframe で provenance/trust boundary を追加する。

Remaining Parent Gaps

Scope Decision (B)

  • Reviewer feedback anchor comment に対する B: controlled reframe を採用した。
  • 明示承認済みの scope expansion として、target PR exact-source/current-head provenance、trusted producer harness と untrusted PR source execution の境界、runtime verification を本 Issue の契約へ取り込む。
  • command_manifest_sha256 の独立再計算・final contract 伝播・direct failure diagnostics は従来どおり維持する。

Outcome

.github/workflows/test-verdict-execution-record.yml と producer 回帰テストが、trusted checkout の COMMAND_MANIFEST を独立再計算し、pre-contract・execution record・final contract・producer receipt の全段を同一 SHA に束縛する。trusted producer harness は別 checkout/worktree/job で untrusted 対象 PR source execution から分離され、対象 PR の exact head SHA を実行する。untrusted execution には secrets、OIDC、write token を渡さず、実行した source repository ID・commit SHA・tree を execution record/receipt に bind する。対象 PR head を実行していない record は current-head PASS として受理しない。欠落・malformed・不一致・tampered provenance/manifest/record は fail-closed で拒否され、直接の receipt-build failure と reason category が観測できる。protected default-branch canary の REST artifact readback(ID/name/digest/run/head/expired/schema/pass eligibility/digest binding)を確認し、証跡コメント後にのみ close 可能とする。

In Scope

  • .github/workflows/test-verdict-execution-record.yml の trusted producer harness と untrusted PR source execution の別 checkout/worktree/job 境界、権限分離、exact-head checkout、current-head provenance、protected-default-branch bootstrap/post-merge canary。
  • scripts/agent-ops/test_verdict_execution_record_producer.py で trusted checkout COMMAND_MANIFEST を再計算し、missing/malformed/mismatch/tampered/self-attested manifest、source repo/commit/tree 欠落または不一致、未実行 PR head を拒否する。command_manifest_sha256 を pre-contract→record→final contract→receipt へ独立に伝播し、final contract が record の自己コピーだけにならないことを検証する。
  • untrusted PR source job の checkout source を対象 PR exact SHA に固定し、secrets/OIDC/write token を環境へ渡さないことを workflow と guard test で確認する。
  • scripts/agent-guards/tests/test_test_verdict_execution_record_workflow.py と関連 fixture で、実 workflow composition、provenance binding、権限境界、legacy failure shape、machine-readable reason category、non-regression を検証する。
  • docs/agent-ops producer、workflow、TEST_VERDICT_MACHINE/v2 reader、guard tests の consumer inventory と contract mapping を更新する。
  • test-verdict execution-record/producer-receipt schema に source repository ID・commit SHA・tree と producer→receipt→consumer binding を検証可能にする additive versioned extension を追加し、既存 schema を壊さない consumer transition を実装する。

Out of Scope

Acceptance Criteria

  • AC1 (ac1_independent_manifest_recompute): dedicated test/command が trusted checkout COMMAND_MANIFEST から SHA を独立再計算し、missing/malformed/mismatch/tampered/self-attested manifest と final-contract self-copy を fail-closed で拒否する。
  • AC2 (ac2_chain_binding): assemble-contract -> build-record -> final assemble-contract -> build-receipt --schema が一つの独立再計算 SHA を全段へ束縛し、schema は not_schema_change のまま pass_eligible を判定する。
  • AC3 (ac3_exact_source_provenance): trusted harness が untrusted 対象 PR source を別 checkout/worktree/job で exact head SHA として実行し、source repository ID・commit SHA・tree を schema validation 済みの execution record と producer receipt に bind する。対象 PR head を実行していない、欠落・不一致・改ざんされた provenance は PASS 不可。
  • AC4 (ac4_trust_boundary): trusted producer harness と untrusted PR code execution が checkout/worktree/job と権限境界で分離され、untrusted job に secrets・OIDC・write token が存在しないことを workflow static guard、fixture、runtime evidence が証明する。
  • AC5 (ac5_failure_diagnostics): direct receipt-build failure が machine-readable reason category と legacy run/artifact failure shape を保持し、upload missing-file masking を成功証拠として受理しない。
  • AC6 (ac6_non_regression): subject identity、artifact digest、per-AC coverage、default-branch protection、fail-closed consumer checks が green で、producer→receipt→consumer contract が同一 provenance/manifest digest に束縛される。schema は既存 major を維持し、必要な source fields は additive versioned extension として schema validation と consumer transition で検証する。
  • AC7 (ac7_protected_canary_readback): protected default-branch bootstrap/post-merge canary を実行し、REST readback で artifact IDs/names/digests、run/head、source repo/commit/tree、expiry、schema、PASS eligibility、digest/manifest binding を確認してから evidence comment を残す。Issue は自動 close せず、証跡後の explicit close とする。

Verification Commands

# AC1
$ uv run --locked pytest scripts/agent-guards/tests/test_test_verdict_execution_record_workflow.py -q -k 'independent_manifest_recompute or final_contract_self_copy or malformed or mismatch or tampered or self_attested'

# AC2
$ uv run --locked pytest scripts/agent-guards/tests/test_test_verdict_execution_record_workflow.py -q -k 'matching_readbacks'

# AC3
# exact PR source execution、source repo/commit/tree schema validation、未実行 target の fail-closed を検証
# 静的/fixture検証のテスト名は trust-boundary 再設計(human REQUEST_CHANGES 対応)で変更された。
# runtime canary(実 workflow dispatch + REST readback)は下記 preflight-scope: runtime_only のまま。
# preflight-scope: runtime_only
$ uv run --locked pytest scripts/agent-guards/tests/test_test_verdict_execution_record_workflow.py -q -k 'source'

# AC4
# trusted harness/untrusted code separation と no secrets/OIDC/write token を検証
# 静的/fixture検証のテスト名は trust-boundary 再設計(human REQUEST_CHANGES 対応)で変更された。
# runtime canary(実 workflow dispatch + REST readback)は下記 preflight-scope: runtime_only のまま。
# preflight-scope: runtime_only
$ uv run --locked pytest scripts/agent-guards/tests/test_test_verdict_execution_record_workflow.py -q -k 'untrusted or trusted_preflight or workflow_yaml'

# AC5
$ uv run --locked pytest scripts/agent-guards/tests/test_test_verdict_execution_record_workflow.py -q -k 'failure_reason or legacy or upload'

# AC6
# producer→receipt→consumer contract、additive schema validation、consumer transition と regression tests
$ uv run --locked pytest scripts/agent-guards/tests/test_test_verdict_execution_record_workflow.py -q

# AC7
# preflight-scope: runtime_only
$ uv run --locked pytest scripts/agent-guards/tests/test_test_verdict_execution_record_workflow.py -q -k 'test_protected_default_branch_canary_readback'

Runtime Verification Applicability

decision: immediate
mode: protected_default_branch_post_merge_canary
required: true
applicable_acs: [AC1, AC2, AC3, AC4, AC5, AC6, AC7]
execution_environment: protected_default_branch_workflow_dispatch; GitHub Actions REST readback; exact PR head SHA; no secrets/OIDC/write token in untrusted job
skip_conditions: [workflow_not_on_default_branch, exact_pr_head_unavailable, source_provenance_missing_or_mismatch, receipt_artifact_missing, command_manifest_sha256_missing_or_mismatch]
fallback_policy: fail_closed_no_pass; local fixture or trusted-main-only execution cannot substitute for exact PR source/current-head runtime evidence
artifact_requirements: [execution_record_artifact, producer_receipt_artifact, command_manifest_sha256, source_repository_id, source_commit_sha, source_tree, artifact_digest, rest_readback]
procedure:
  - static/fixture verification を完了する
  - merge 後に protected default-branch bootstrap/post-merge canary を exact PR head SHA で dispatch する
  - REST API で artifact IDs/name/digest、run/head、source repo/commit/tree、expired、schema、PASS eligibility、digest/manifest binding を readback する
  - untrusted job の token/secrets/OIDC absence を workflow evidence で確認する
  - evidence comment を投稿し、その後にのみ explicit close を行う

Allowed Paths

  • .github/workflows/test-verdict-execution-record.yml
  • scripts/agent-ops/test_verdict_execution_record_producer.py
  • scripts/agent-guards/tests/test_test_verdict_execution_record_workflow.py
  • docs/dev/agent-skill-boundaries.md
  • docs/dev/workflow.md
  • docs/dev/runtime-verification-policy.md
  • schemas/test-verdict-execution-record.schema.json
  • schemas/test-verdict-producer-receipt.schema.json
  • scripts/agent-guards/controlled_skill_mutation_exec.py
  • scripts/agent-guards/tests/test_test_verdict_publish_exec.py
  • .claude/skills/impl-review-loop/tests/test_materialize_test_verdict_artifact.py

Stop Conditions

  • Allowed Paths 外の変更が必要と判明した場合
  • In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合(not_schema_change 違反)。ただし additive versioned extension と限定的な consumer wiring は許可する。
  • 既存 schema の major breaking change、新 major への置換、または広範な consumer migration が必要になった場合
  • trusted/untrusted checkout・worktree・job 分離、exact head、source repo/commit/tree binding、または token/secrets/OIDC 境界を runtime で証明できない場合
  • command_manifest_sha256 の独立再計算・final contract 伝播・direct failure diagnostics が成立しない場合
  • 後続 Phase / 別スコープへの波及が判明した場合
  • nested SubAgent delegation が必要になった場合
  • 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
  • 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合

Required Skills

なし

Required Design References

  • docs/dev/agent-skill-boundaries.md
  • docs/dev/workflow.md
  • docs/dev/runtime-verification-policy.md

Scope Delta

  • B の明示承認により、target PR exact-source/current-head provenance と protected workflow trust boundary(trusted producer/untrusted execution 分離、exact SHA、無権限実行、source repo/commit/tree binding)を Out of Scope から In Scope へ拡張した。
  • command_manifest_sha256 の独立再計算、pre-contract→record→final-contract→receipt 伝播、direct failure diagnostics、protected canary/readback は維持した。
  • artifact schema major breaking change、広範な consumer migration、実装: HEAD-bound TEST_VERDICT publisher transaction を追加する #1647/実装: TEST_VERDICT consumer integration を追加する #1648 dependency 更新は Out of Scope として固定し、source provenance fields と producer→receipt→consumer wiring は additive versioned extension の範囲で許可した。
  • Allowed Paths に docs/dev/runtime-verification-policy.md を追加し、runtime evidence 要件を明示した。
  • 人間レビュアー(squne121)の PR fix: producer receipt に command_manifest_sha256 を独立再計算で伝播する #1843 REQUEST_CHANGES(trust-boundary blocker、コメント)に対応するため、producer receipt/execution-record schema へ source(repository_id/repository_full_name/commit_sha/tree_sha/execution_run_id/execution_job_id)を additive 必須フィールドとして追加した結果、Allowed Paths 外の .claude/skills/impl-review-loop/tests/test_materialize_test_verdict_artifact.py の既存 fixture が新 schema と不整合になることが判明した。人間の明示承認(2026-07-29)により、Allowed Paths に同ファイル(fixture-only 更新、本体コードの変更は不要)を追加した。
  • 同 trust-boundary 再設計に伴い workflow を trusted-preflight → untrusted-execution → trusted-receipt の3 job分離へ再構成し、静的/fixture テストの一部関数名が変更された(AC意図自体は変わらない)。これにより AC3/AC4 の Verification Commands の -k フィルタ文字列が旧テスト名を参照したまま失効していたため、現行テスト名に一致する -k へ機械的に更新した(AC の意味論・runtime canary 要件は変更していない)。

Delivery Rule

  • 1 Issue = 1 PR
  • worktree で作業し、Draft PR を既定とする。
  • PR body relation は Relates to #1711 とし、Closes #1711 は使用しない。protected default-branch canary の evidence comment と readback 完了後にのみ explicit close を行う。

Activity

  1. added
    phase/implementation
    agent/implementer
    enhancement
    triage-required
    on Jul 24, 2026
  2. squne121 commented on Jul 24, 2026

    @squne121
    OwnerAuthor

    Contract Review Result

    CONTRACT_REVIEW_RESULT_V1:
      status: go
      generated_at: "2026-07-24T19:20:44Z"
      generated_by: issue-contract-review
      issue_url: https://github.com/squne121/loop-protocol/issues/1711
      body_sha256: "sha256:fe1f2bb32f3fdb8dd7f4b45d7e5987008faa6b4b5e210cabfa528e3507bd22d9"
      checks:
        readiness: go
        blockers: pass
        product_spec: pass
        product_spec_check: {"schema":"product_spec_check/v1","applicability":"applicable","decision":"pass","triggers":{"docs_product_allowed_paths":false,"tasks_md_mentioned":false,"specify_artifact_mentioned":false,"generated_task_mentioned":false,"product_spec_context_present":false,"machine_readable_contract_present":true},"conditions":{"docs_product_requires_spec_evidence":{"status":"pass","evidence":[]},"tasks_md_not_direct_source":{"status":"pass","evidence":[]},"specify_not_canonical":{"status":"pass","evidence":[]},"diff_first_rationale_present":{"status":"pass","evidence":[]},"generated_task_trace_present":{"status":"pass","evidence":[]},"task_dependencies_materialized":{"status":"pass","evidence":[]}},"blocked_reasons":[],"body_sha256":"sha256:fe1f2bb32f3fdb8dd7f4b45d7e5987008faa6b4b5e210cabfa528e3507bd22d9","source_provenance":{"source_type":"github_api","body_file":null}}
        vc_preflight:
          decision: pass
          classifications: [{"ac":"AC1","line":2,"raw_command":"uv run --locked pytest scripts/agent-guards/tests/test_test_verdict_execution_record_workflow.py -q","command_hash":"sha256:d966b57edaa6e8dcd133876ba3841b357cb835091bb602be43306cc1ff24f351","execution_key_hash":"sha256:0a69a7632c580744f9f40d3ac02a932171ea6be72475d592c87d42727a2afd05","runner":"exec","exit_code":0,"classification":"expected_pass","category":"regression_gate","decision":"go","scope_class":"regression_gate","confidence":"low","stdout_head":[".....................                                                    [100%]","21 passed in 0.14s"],"stdout_truncated":false,"stdout_original_line_count":3,"stderr_head":[],"stderr_truncated":false,"stderr_original_line_count":1,"runner_env_delta":{},"duration_ms":333,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":null,"vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":null,"raw":null},"strict":null,"repair":null},{"ac":"AC2","line":5,"raw_command":"uv run --locked pytest scripts/agent-guards/tests/test_test_verdict_execution_record_workflow.py -q","command_hash":"sha256:d966b57edaa6e8dcd133876ba3841b357cb835091bb602be43306cc1ff24f351","execution_key_hash":"sha256:d3ea126ef3c145cb15718dbb96ef73d51c25bda07fba9a9dd647c05f9ea0b512","runner":"exec","exit_code":0,"classification":"expected_pass","category":"regression_gate","decision":"go","scope_class":"regression_gate","confidence":"low","stdout_head":[".....................                                                    [100%]","21 passed in 0.13s"],"stdout_truncated":false,"stdout_original_line_count":3,"stderr_head":[],"stderr_truncated":false,"stderr_original_line_count":1,"runner_env_delta":{},"duration_ms":313,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":null,"vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":null,"raw":null},"strict":null,"repair":null},{"ac":"AC3","line":8,"raw_command":"rg -n \"30120049703\" scripts/agent-guards/tests/test_test_verdict_execution_record_workflow.py","command_hash":"sha256:376656a02332fb302e28cf7eb867af0425e6951837eb70aa02903fd0d3d11a27","execution_key_hash":"sha256:c8c4c45c8df239fb37c96f1a2675b8720c77b03a76dd0bed23e01df9621c5622","runner":"exec","exit_code":1,"classification":"expected_fail","category":"expected_baseline_fail","decision":"go","scope_class":"baseline_fail_expected","confidence":"high","stdout_head":[],"stdout_truncated":false,"stdout_original_line_count":1,"stderr_head":[],"stderr_truncated":false,"stderr_original_line_count":1,"runner_env_delta":{},"duration_ms":2,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":null,"vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":null,"raw":null},"strict":null,"repair":null},{"ac":"AC3","line":9,"raw_command":"rg -n \"8606984998\" scripts/agent-guards/tests/test_test_verdict_execution_record_workflow.py","command_hash":"sha256:52346ab34e456d29a8682b9c314b25197f5717f940e61fdc97cdeeb0009b4530","execution_key_hash":"sha256:57aeb6a7233219d8a704c8dc9bd2d114d1d1f8ce9161ccb5fed7541437f014a6","runner":"exec","exit_code":1,"classification":"expected_fail","category":"expected_baseline_fail","decision":"go","scope_class":"baseline_fail_expected","confidence":"high","stdout_head":[],"stdout_truncated":false,"stdout_original_line_count":1,"stderr_head":[],"stderr_truncated":false,"stderr_original_line_count":1,"runner_env_delta":{},"duration_ms":1,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":null,"vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":null,"raw":null},"strict":null,"repair":null},{"ac":"AC4","line":12,"raw_command":"uv run --locked pytest scripts/agent-guards/tests/test_test_verdict_execution_record_workflow.py -q","command_hash":"sha256:d966b57edaa6e8dcd133876ba3841b357cb835091bb602be43306cc1ff24f351","execution_key_hash":"sha256:6979bee4fbd6466c0d9aa8e8a9358b5707af67d6eafa10ef2206d35978a777ed","runner":"exec","exit_code":0,"classification":"expected_pass","category":"regression_gate","decision":"go","scope_class":"regression_gate","confidence":"low","stdout_head":[".....................                                                    [100%]","21 passed in 0.12s"],"stdout_truncated":false,"stdout_original_line_count":3,"stderr_head":[],"stderr_truncated":false,"stderr_original_line_count":1,"runner_env_delta":{},"duration_ms":314,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":null,"vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":null,"raw":null},"strict":null,"repair":null}]
      source: ensure_contract_snapshot_auto
      expected_contract_fingerprint: {"issue_number":1711,"contract_source_kind":"issue_comment","contract_source_id":"5073614840","contract_body_sha256":"sha256:fe1f2bb32f3fdb8dd7f4b45d7e5987008faa6b4b5e210cabfa528e3507bd22d9","allowed_paths_normalized_sha256":"24c872835eb5da57c60709ac688bcd4baf823f1556462ec6c800762ad1ee3f5a","base_ref":"main","base_sha_at_snapshot":"332cc0d74752bf428a3d063ed0fafb53f79ce9fe"}
  3. squne121 commented on Jul 24, 2026

    @squne121
    OwnerAuthor

    Contract Review Result

    CONTRACT_REVIEW_RESULT_V1:
      status: go
      generated_at: "2026-07-24T19:22:58Z"
      generated_by: issue-contract-review
      issue_url: https://github.com/squne121/loop-protocol/issues/1711
      body_sha256: "sha256:2134149ac1033a485b098f9f64476f0870adaaa2040aa5fcac24f65dd3ba158b"
      checks:
        readiness: go
        blockers: pass
        product_spec: pass
        product_spec_check: {"schema":"product_spec_check/v1","applicability":"applicable","decision":"pass","triggers":{"docs_product_allowed_paths":false,"tasks_md_mentioned":false,"specify_artifact_mentioned":false,"generated_task_mentioned":false,"product_spec_context_present":false,"machine_readable_contract_present":true},"conditions":{"docs_product_requires_spec_evidence":{"status":"pass","evidence":[]},"tasks_md_not_direct_source":{"status":"pass","evidence":[]},"specify_not_canonical":{"status":"pass","evidence":[]},"diff_first_rationale_present":{"status":"pass","evidence":[]},"generated_task_trace_present":{"status":"pass","evidence":[]},"task_dependencies_materialized":{"status":"pass","evidence":[]}},"blocked_reasons":[],"body_sha256":"sha256:2134149ac1033a485b098f9f64476f0870adaaa2040aa5fcac24f65dd3ba158b","source_provenance":{"source_type":"github_api","body_file":null}}
        vc_preflight:
          decision: pass
          classifications: [{"ac":"AC1","line":2,"raw_command":"uv run --locked pytest scripts/agent-guards/tests/test_test_verdict_execution_record_workflow.py -q","command_hash":"sha256:d966b57edaa6e8dcd133876ba3841b357cb835091bb602be43306cc1ff24f351","execution_key_hash":"sha256:0a69a7632c580744f9f40d3ac02a932171ea6be72475d592c87d42727a2afd05","runner":"exec","exit_code":0,"classification":"expected_pass","category":"regression_gate","decision":"go","scope_class":"regression_gate","confidence":"low","stdout_head":[".....................                                                    [100%]","21 passed in 0.14s"],"stdout_truncated":false,"stdout_original_line_count":3,"stderr_head":[],"stderr_truncated":false,"stderr_original_line_count":1,"runner_env_delta":{},"duration_ms":322,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":null,"vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":null,"raw":null},"strict":null,"repair":null},{"ac":"AC2","line":5,"raw_command":"uv run --locked pytest scripts/agent-guards/tests/test_test_verdict_execution_record_workflow.py -q","command_hash":"sha256:d966b57edaa6e8dcd133876ba3841b357cb835091bb602be43306cc1ff24f351","execution_key_hash":"sha256:d3ea126ef3c145cb15718dbb96ef73d51c25bda07fba9a9dd647c05f9ea0b512","runner":"exec","exit_code":0,"classification":"expected_pass","category":"regression_gate","decision":"go","scope_class":"regression_gate","confidence":"low","stdout_head":[".....................                                                    [100%]","21 passed in 0.12s"],"stdout_truncated":false,"stdout_original_line_count":3,"stderr_head":[],"stderr_truncated":false,"stderr_original_line_count":1,"runner_env_delta":{},"duration_ms":296,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":null,"vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":null,"raw":null},"strict":null,"repair":null},{"ac":"AC3","line":8,"raw_command":"rg -n \"30120049703\" scripts/agent-guards/tests/test_test_verdict_execution_record_workflow.py","command_hash":"sha256:376656a02332fb302e28cf7eb867af0425e6951837eb70aa02903fd0d3d11a27","execution_key_hash":"sha256:c8c4c45c8df239fb37c96f1a2675b8720c77b03a76dd0bed23e01df9621c5622","runner":"exec","exit_code":1,"classification":"expected_fail","category":"expected_baseline_fail","decision":"go","scope_class":"baseline_fail_expected","confidence":"high","stdout_head":[],"stdout_truncated":false,"stdout_original_line_count":1,"stderr_head":[],"stderr_truncated":false,"stderr_original_line_count":1,"runner_env_delta":{},"duration_ms":2,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":null,"vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":null,"raw":null},"strict":null,"repair":null},{"ac":"AC3","line":9,"raw_command":"rg -n \"8606984998\" scripts/agent-guards/tests/test_test_verdict_execution_record_workflow.py","command_hash":"sha256:52346ab34e456d29a8682b9c314b25197f5717f940e61fdc97cdeeb0009b4530","execution_key_hash":"sha256:57aeb6a7233219d8a704c8dc9bd2d114d1d1f8ce9161ccb5fed7541437f014a6","runner":"exec","exit_code":1,"classification":"expected_fail","category":"expected_baseline_fail","decision":"go","scope_class":"baseline_fail_expected","confidence":"high","stdout_head":[],"stdout_truncated":false,"stdout_original_line_count":1,"stderr_head":[],"stderr_truncated":false,"stderr_original_line_count":1,"runner_env_delta":{},"duration_ms":2,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":null,"vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":null,"raw":null},"strict":null,"repair":null},{"ac":"AC4","line":12,"raw_command":"uv run --locked pytest scripts/agent-guards/tests/test_test_verdict_execution_record_workflow.py -q","command_hash":"sha256:d966b57edaa6e8dcd133876ba3841b357cb835091bb602be43306cc1ff24f351","execution_key_hash":"sha256:6979bee4fbd6466c0d9aa8e8a9358b5707af67d6eafa10ef2206d35978a777ed","runner":"exec","exit_code":0,"classification":"expected_pass","category":"regression_gate","decision":"go","scope_class":"regression_gate","confidence":"low","stdout_head":[".....................                                                    [100%]","21 passed in 0.12s"],"stdout_truncated":false,"stdout_original_line_count":3,"stderr_head":[],"stderr_truncated":false,"stderr_original_line_count":1,"runner_env_delta":{},"duration_ms":300,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":null,"vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":null,"raw":null},"strict":null,"repair":null}]
      source: ensure_contract_snapshot_auto
      expected_contract_fingerprint: {"issue_number":1711,"contract_source_kind":"issue_comment","contract_source_id":"5073625306","contract_body_sha256":"sha256:2134149ac1033a485b098f9f64476f0870adaaa2040aa5fcac24f65dd3ba158b","allowed_paths_normalized_sha256":"24c872835eb5da57c60709ac688bcd4baf823f1556462ec6c800762ad1ee3f5a","base_ref":"main","base_sha_at_snapshot":"332cc0d74752bf428a3d063ed0fafb53f79ce9fe"}
  4. squne121 commented on Jul 27, 2026

    @squne121
    OwnerAuthor

    #1766 からの current-head routing evidence

    #1766 の Allowed Paths を producer/workflow へ拡張する案は、正式 overlap preflight で本 Issue と同一の3パスに対する decision: duplicate(goal_ref_duplicate)となったため採用しない。#1766 は本 Issue(および親 #1645 の trust-chain)で protected producer が Issue 固有 VC を正当に扱える状態になった後、fresh head/body binding で verification を再開する。

    このコメントは current-head の routing evidence であり、#1711 の既存契約・Allowed Paths をこの場で変更するものではない。

  5. squne121 commented on Jul 27, 2026

    @squne121
    OwnerAuthor

    判定

    STOP / NEEDS_REFRAME

    Issue #1711 が対象としている欠落伝播バグ自体は実在します。しかし、現在の契約のまま command_manifest_sha256 を単純に receipt へコピーすると、fail-closed で止まっていた trust chain を、意味的に不正な PASS が通る状態へ変える危険があります。

    特に、「対象 主
    EAD のコードを実行していない

    親 Issue #1645 は、current PR HEAD、Issue contract、per-AC execution record、artifact digest、publisher receipt を一つの trust chain に束縛することを目標にしています。

    ところが現在の workflow は、default branch の ${{ github.sha }} を checkout し、その作業ツリー上で固定された uv.pytest.execution-record を実行しています。対象 PR の SHA は subject.pr_head_sha として記録されるだけで、checkout も実行対象への使用もされていません。

    さらに producer 自身が、このコマンドを「Issue #1646 専用の bootstrap contract test」であり、一般的な per-AC producer ではないと明記しています。実行されるのも producer workflow の contract test 一本です。

    したがって現在の証跡が証明できるのは、概ね次だけです。

    trusted main 上の producer contract test が成功し、その結果に任意の対象 PR HEAD SHA をメタデータとして付けた。

    これは「対象 PR HEAD の Verification Commands が成功した」という証明ではありません。SLSA の provenance モデルでも、実際に使用した source commit は resolved dependency として記録・束縛される必要があります。 ([SLSA]1)

    必要な処置

    #1711 の狭い propagation 修正とは分けて、少なくとも以下を設計し直す必要があります。

    • trusted main 由来の producer harness と、対象 PR HEAD の実行作業ツリーを分離する。
    • expected_head_sha の exact commit を別ディレクトリまたは別 job で checkout する。
    • untrusted PR code を実行する境界には secret、OIDC、write token を渡さない。
    • execution record に「実際に実行した source repository ID / commit SHA / tree」を記録する。
    • PR HEAD を使用しなかった execution record を current-head PASS として扱わない。

    これは #1711 の Stop Conditions に抵触する親設計上の欠陥です。単純な回帰修正として処理すべきではありません。


    P0-2 — AC1 は tautological self-copy でも達成できる

    現在のデータフローは次のようになっています。

    1. assemble-contract は linked_issue_number と issue_body_sha256 だけを生成する。
    2. build_record_for_command が内部で command_manifest_sha256 を追加する。
    3. final readback 後も assemble-contract を使うため、final contract には manifest SHA がない。
    4. build_receipt は final_contract == record["contract"] を要求し、receipt には final_contract をそのまま格納する。
    5. receipt schema は command_manifest_sha256 を必須としている。

    つまり、実 run の失敗は偶発的な workflow mapping 漏れではなく、contract assembly の責務が二つの経路で非対称になっていることが原因です。

    ここで final_contract = record["contract"] のようにコピーすれば一見直りますが、それは record 自身が主張する manifest SHA を record 自身で承認する自己証明です。PR #1683 でも、record からの自己コピーは tautological であるとして、subject/contract の独立した final readback に修正したと説明されています。

    最低限必要な実装

    • assemble-contract に --command-id を渡し、trusted checkout 上の COMMAND_MANIFEST から SHA を独立計算する。
    • pre-execution contract と final contract の両方に、独立計算した同じ SHA を含める。
    • build_record_for_command は SHA を黙って上書きせず、入力 contract の SHA が resolved manifest と一致することを検証する。
    • build_receipt も、record と final contract の文字列比較だけでなく、trusted manifest から再計算した値との一致を検証する。
    • SHA の source を execution record またはダウンロードした artifact にしてはならない。

    既存 schema は既に正しいため、schema change は不要です。


    P1-1 — 現在の regression test は実際の故障経路を通っていない

    既存の positive test は、final contract として record["contract"] を直接渡しています。つまり、実 workflow が行う「final Issue readback → assemble-contract」を省略し、最初から manifest SHA 入りの contract を自己コピーしています。

    schema test も同じ経路を使用しているため、実 workflow で receipt schema validation が失敗する問題を検出できませんでした。

    さらに Issue #1711 の AC3 は、テストファイルに run ID 30120049703 と artifact ID 8606984998 が文字列として存在することしか確認していません。これは regression fixture の存在確認にも、故障の再現確認にもなりません。

    必要なテストは次です。

    • 実 workflow と同じ assemble-contract → build-record → final assemble-contract → build-receipt --schema を通す。
    • 旧実装では receipt build が非ゼロ終了することを再現する。
    • 修正後は schema-valid、pass_eligible=true の receipt が生成される。
    • final contract の SHA 欠落、形式不正、不一致を個別に拒否する。
    • record 側の SHA 改ざんも拒否する。
    • run/artifact ID は fixture の provenance metadata として保存するだけでなく、期待する failure reason を assertion する。

    ACごとに同じテストファイル全体を実行するのではなく、要件に対応する名前付き test node を Verification Command に指定すべきです。


    P1-2 — post-merge canary と自動クローズが両立していない

    GitHub の workflow_dispatch は workflow ファイルが default branch に存在する必要があり、実行時の GITHUB_SHA は dispatch 対象 ref の最新 commit です。したがって trusted default-branch producer の修正は、基本的にマージ後でなければ runtime 証明できません。 ([GitHub Docs]2)

    Issue #1711 は immediate_and_post_merge_canary を要求していますが、Delivery Rule は通常の「1 Issue = 1 PR」です。PR に Closes #1711 を付けると、canary 成功前に Issue が closed され、#1646 と同じ失敗を繰り返します。

    実際の run 30120049703 は、execution record の upload までは成功しましたが、producer receipt の upload で failure となり、以後の REST identity verification と pass gate は skipped されました。

    クローズ条件を変更すべきです。

    • 修正 PR は Relates to #1711 とし、merge 時には自動クローズしない。
    • default branch 上で canary を実行する。
    • execution-record と producer-receipt の両 artifact を REST readback する。
    • artifact ID、name、digest、run ID、head SHA、expired=false を検証する。
    • receipt schema、pass_eligible=true、manifest SHA 一致を確認する。
    • 証跡コメント投稿後に 実装: producer receipt に command_manifest_sha256 を伝播する回帰修正 #1711 を明示的に close する。

    GitHub artifact API が返す ID、digest、workflow run identity は、この readback の authority として利用できます。 ([GitHub Docs]3)


    P1-3 — #1647 と #1648 の dependency graph が古い

    Publisher の #1647 は「Child A の valid receipt」を前提としており、consumer integration の #1648 は Child A/B の完了を前提としています。しかし両 Issue とも #1711 を明示的な blocker にしていません。

    #1646 が closed 扱いのままなので、計画上は #1647 が着手可能に見えます。現在の producer は正常な receipt を作れず、さらに current-head provenance も成立していません。

    必要な変更は以下です。


    P2 — 本当の失敗理由が upload error に隠されている

    Build producer receipt は continue-on-error: true になっています。そのため schema validation で receipt が生成されなくても workflow は続行し、次の Upload producer receipt が「ファイルなし」で失敗します。

    actions/upload-artifact の if-no-files-found: error は、対象ファイルが存在しない場合に upload step を失敗させる仕様です。 ([GitHub]4)

    fail-closed 自体は正しいものの、診断点がずれています。

    • receipt build の continue-on-error を外す。
    • または成功 receipt と別に、常に出力される diagnostic result を用意する。
    • schema validation failure の JSON pointer と mismatch category を stderr または step summary に出す。
    • test では単なる非ゼロ終了ではなく、missing_command_manifest_sha256 または manifest_digest_mismatch を確認する。

    推奨する Issue #1711 の再定義

    #1711 は次の二段階に分けるのが妥当です。

    1. 局所的回帰修正

      • manifest SHA の独立再計算
      • record/final contract/receipt の三者一致
      • 実故障経路を通る regression test
      • post-merge canary
    2. 親 trust-chain の設計修正

    前者だけを実装する場合でも、成果を「current-head TEST_VERDICT の修復」と表現してはいけません。現時点で修復できるのは、bootstrap producer contract test の receipt integrityまでです。

    最終判断

    現 Issue 本文のまま実装開始不可です。

    最低でも次の三点を本文へ反映してから、fresh contract review を取り直す必要があります。

    1. record からの SHA self-copy を明示的に禁止する。
    2. AC3 を実 workflow composition の再現テストへ置き換える。
    3. post-merge canary 成功前の自動クローズと 実装: HEAD-bound TEST_VERDICT publisher transaction を追加する #1647/実装: TEST_VERDICT consumer integration を追加する #1648 着手を禁止する。

    加えて、current-head provenance の欠陥は別の P0 blocker として親 #1645 に戻すべきです。

    [確認に使用した artifact 8606984998](sandbox:/mnt/data/execution-record-8606984998.zip)

  6. squne121 commented on Jul 28, 2026

    @squne121
    OwnerAuthor

    Contract Review Result

    CONTRACT_REVIEW_RESULT_V1:
      status: go
      generated_at: "2026-07-28T22:59:29Z"
      generated_by: issue-contract-review
      issue_url: https://github.com/squne121/loop-protocol/issues/1711
      body_sha256: "sha256:22cc9d9c203a5d8b58b7a77b03add9e92255ec6373d58294f05b9521e0f9a7d7"
      checks:
        readiness: go
        blockers: pass
        product_spec: pass
        product_spec_check: {"schema":"product_spec_check/v1","applicability":"applicable","decision":"pass","triggers":{"docs_product_allowed_paths":false,"tasks_md_mentioned":false,"specify_artifact_mentioned":false,"generated_task_mentioned":false,"product_spec_context_present":false,"machine_readable_contract_present":true},"conditions":{"docs_product_requires_spec_evidence":{"status":"pass","evidence":[]},"tasks_md_not_direct_source":{"status":"pass","evidence":[]},"specify_not_canonical":{"status":"pass","evidence":[]},"diff_first_rationale_present":{"status":"pass","evidence":[]},"generated_task_trace_present":{"status":"pass","evidence":[]},"task_dependencies_materialized":{"status":"pass","evidence":[]}},"blocked_reasons":[],"body_sha256":"sha256:22cc9d9c203a5d8b58b7a77b03add9e92255ec6373d58294f05b9521e0f9a7d7","source_provenance":{"source_type":"github_api","body_file":null}}
        vc_preflight:
          decision: pass
          classifications: [{"ac":"AC1","line":2,"raw_command":"uv run --locked pytest scripts/agent-guards/tests/test_test_verdict_execution_record_workflow.py -q -k 'independent_manifest_recompute or final_contract_self_copy or malformed or mismatch or tampered or self_attested'","command_hash":"sha256:41e207dce2dbac90ae2aa17802ec551459c43832bf5f4b633651534238696895","execution_key_hash":"sha256:8451424a225af7a78df605c9cc6836c1fde41c339e24a17e042509b33c9d05cf","runner":"exec","exit_code":0,"classification":"expected_pass","category":"regression_gate","decision":"go","scope_class":"regression_gate","confidence":"low","stdout_head":["....                                                                     [100%]","4 passed, 17 deselected in 0.02s"],"stdout_truncated":false,"stdout_original_line_count":3,"stderr_head":[],"stderr_truncated":false,"stderr_original_line_count":1,"runner_env_delta":{},"duration_ms":207,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":null,"vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":null,"raw":null},"strict":null,"repair":null},{"ac":"AC2","line":5,"raw_command":"uv run --locked pytest scripts/agent-guards/tests/test_test_verdict_execution_record_workflow.py -q -k 'matching_readbacks'","command_hash":"sha256:73dbe21fda23d8117a1d8acb38228026896d33c5477c5359cd5b2064bf5add67","execution_key_hash":"sha256:e317ad994aad70caa7f55ca82c88dbb77f2bde5b0b7a45c44c6f4246b4372b1f","runner":"exec","exit_code":0,"classification":"expected_pass","category":"regression_gate","decision":"go","scope_class":"regression_gate","confidence":"low","stdout_head":[".                                                                        [100%]","1 passed, 20 deselected in 0.02s"],"stdout_truncated":false,"stdout_original_line_count":3,"stderr_head":[],"stderr_truncated":false,"stderr_original_line_count":1,"runner_env_delta":{},"duration_ms":177,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":null,"vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":null,"raw":null},"strict":null,"repair":null},{"ac":"AC3","line":9,"raw_command":"uv run --locked pytest scripts/agent-guards/tests/test_test_verdict_execution_record_workflow.py -q -k 'test_exact_source_provenance_binding'","command_hash":"sha256:5aec659123cc7f1042d33d301a956811d968b12273427117c7ea3d3db4ca9e65","execution_key_hash":null,"runner":"skipped","exit_code":null,"classification":"skipped","category":"preflight_scope_runtime_only","decision":"go","scope_class":"runtime_only","confidence":"low","stdout_head":[],"stdout_truncated":false,"stdout_original_line_count":1,"stderr_head":[],"stderr_truncated":false,"stderr_original_line_count":1,"runner_env_delta":{},"duration_ms":0,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":null,"vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":null,"raw":null},"strict":null,"repair":null,"verification_owner":"impl-review-loop","deferred_reason":"VC marked runtime_only; verification deferred to post-implementation runtime","runtime_verification_required":true},{"ac":"AC4","line":13,"raw_command":"uv run --locked pytest scripts/agent-guards/tests/test_test_verdict_execution_record_workflow.py -q -k 'test_trusted_untrusted_execution_boundary'","command_hash":"sha256:8545c6d473a9599e5116e35497bda4a68cf6feb28ef06252e5575c3437edfbb5","execution_key_hash":null,"runner":"skipped","exit_code":null,"classification":"skipped","category":"preflight_scope_runtime_only","decision":"go","scope_class":"runtime_only","confidence":"low","stdout_head":[],"stdout_truncated":false,"stdout_original_line_count":1,"stderr_head":[],"stderr_truncated":false,"stderr_original_line_count":1,"runner_env_delta":{},"duration_ms":0,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":null,"vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":null,"raw":null},"strict":null,"repair":null,"verification_owner":"impl-review-loop","deferred_reason":"VC marked runtime_only; verification deferred to post-implementation runtime","runtime_verification_required":true},{"ac":"AC5","line":16,"raw_command":"uv run --locked pytest scripts/agent-guards/tests/test_test_verdict_execution_record_workflow.py -q -k 'failure_reason or legacy or upload'","command_hash":"sha256:04d9fe72c3f55f7b6895d85632f16f360f43c73954cf3e45c0d897ae28fcbda5","execution_key_hash":"sha256:9d43c7ae7090b73855b218ae4873cc811d31706130e53d1f932b6d5aef9b44b4","runner":"exec","exit_code":0,"classification":"expected_pass","category":"regression_gate","decision":"go","scope_class":"regression_gate","confidence":"low","stdout_head":["..                                                                       [100%]","2 passed, 19 deselected in 0.02s"],"stdout_truncated":false,"stdout_original_line_count":3,"stderr_head":[],"stderr_truncated":false,"stderr_original_line_count":1,"runner_env_delta":{},"duration_ms":191,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":null,"vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":null,"raw":null},"strict":null,"repair":null},{"ac":"AC6","line":19,"raw_command":"uv run --locked pytest scripts/agent-guards/tests/test_test_verdict_execution_record_workflow.py -q","command_hash":"sha256:d966b57edaa6e8dcd133876ba3841b357cb835091bb602be43306cc1ff24f351","execution_key_hash":"sha256:e077761d34c0aaad77367b6ce56df337ba28c9d13b703ee901e961acf5befc4b","runner":"exec","exit_code":0,"classification":"expected_pass","category":"regression_gate","decision":"go","scope_class":"regression_gate","confidence":"low","stdout_head":[".....................                                                    [100%]","21 passed in 0.12s"],"stdout_truncated":false,"stdout_original_line_count":3,"stderr_head":[],"stderr_truncated":false,"stderr_original_line_count":1,"runner_env_delta":{},"duration_ms":303,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":null,"vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":null,"raw":null},"strict":null,"repair":null},{"ac":"AC7","line":23,"raw_command":"uv run --locked pytest scripts/agent-guards/tests/test_test_verdict_execution_record_workflow.py -q -k 'test_protected_default_branch_canary_readback'","command_hash":"sha256:3423d2b0c0544c036edcd81c04d0a568a40592d0b0edbdb9015d35c327d96938","execution_key_hash":null,"runner":"skipped","exit_code":null,"classification":"skipped","category":"preflight_scope_runtime_only","decision":"go","scope_class":"runtime_only","confidence":"low","stdout_head":[],"stdout_truncated":false,"stdout_original_line_count":1,"stderr_head":[],"stderr_truncated":false,"stderr_original_line_count":1,"runner_env_delta":{},"duration_ms":0,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":null,"vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":null,"raw":null},"strict":null,"repair":null,"verification_owner":"impl-review-loop","deferred_reason":"VC marked runtime_only; verification deferred to post-implementation runtime","runtime_verification_required":true}]
        declared_path_overlap: {"schema":"declared_path_overlap/v1","advisory":true,"blocking":false,"decision":"advisory_only","disjoint":true,"overlapping_prs":[],"inventory":{"schema":"OPEN_PR_INVENTORY_V1","repo":"squne121/loop-protocol","state":"open","base_ref":"main","base_sha":"63fb1a92257e712b02a78241351637087f66ee26","draft_policy":"include_drafts","prs":[{"number":1528,"title":"feat(cleanup): 同一実行内の branch-only fallback を追加","base_ref_name":"main","head_ref_name":"worktree-issue-1403-post-merge-cleanup-dedicated-branch-forc","head_ref_oid":"b29007580ae225eb9676c7f32c878ee2bb9ccaa9","is_draft":false,"is_cross_repository":false,"head_repository_owner":"squne121","head_repository_name":"loop-protocol","url":"https://github.com/squne121/loop-protocol/pull/1528","changed_files_count_graphql":4},{"number":1817,"title":"test: CLOSED predecessor の候補外 readback を固定 (#1766)","base_ref_name":"main","head_ref_name":"worktree-issue-1766-closed-native-predecessor-regression-v2","head_ref_oid":"5e39ca27825d76873b285de39a195a8d8f2311fd","is_draft":true,"is_cross_repository":false,"head_repository_owner":"squne121","head_repository_name":"loop-protocol","url":"https://github.com/squne121/loop-protocol/pull/1817","changed_files_count_graphql":1},{"number":1819,"title":"実装:#1797_C2a-successor-structural-collisionのhuman-review-route修正","base_ref_name":"main","head_ref_name":"worktree-issue-1797-c2a-successor-collision","head_ref_oid":"7d2af5b5033e0c6a84924d72177fadbfc0f4026f","is_draft":true,"is_cross_repository":false,"head_repository_owner":"squne121","head_repository_name":"loop-protocol","url":"https://github.com/squne121/loop-protocol/pull/1819","changed_files_count_graphql":5},{"number":1832,"title":"fix(refinement): 全終端理由で follow-up materialization 結果を出力 (#1321)","base_ref_name":"main","head_ref_name":"worktree-issue-1321-follow-up-materialization-all-reasons","head_ref_oid":"31ac20913386ef2b0a91057fbf1de491a9286af2","is_draft":true,"is_cross_repository":false,"head_repository_owner":"squne121","head_repository_name":"loop-protocol","url":"https://github.com/squne121/loop-protocol/pull/1832","changed_files_count_graphql":2}],"fetched_count":4,"totalCount":4,"has_next_page":false,"complete":true,"saturated":false,"limit":200,"page_count":1,"inventory_digest":"sha256:132a426a2615e77752e78d9eeed74bce0ab29faa28b6320ffd8b087f8a384700","errors":[]},"inventory_digest_extended":"sha256:63589d2ae0c62970c765e5139d79c87de02ea348a25febaceeccd751138ab7fe","errors":[],"note":"changed-file 名の単純な重なりのみを証明する advisory check。3-way merge・hunk 競合・rename/delete 競合は評価しない(実 Git merge 競合の判定は Issue #1792 の PAIRWISE_MERGE_OBSERVATION_V1 producer の責務)。単独では blocking にしない。disjoint は tri-state(true/false/null)— 観測が不完全な場合は null。"}
      source: ensure_contract_snapshot_auto
      expected_contract_fingerprint: {"issue_number":1711,"contract_source_kind":"issue_comment","contract_source_id":"5110581380","contract_body_sha256":"sha256:22cc9d9c203a5d8b58b7a77b03add9e92255ec6373d58294f05b9521e0f9a7d7","allowed_paths_normalized_sha256":"7760c6afd1fc17716c4a0e56156efc20fd031460c62aa5c1ed16eddb42cfd07c","base_ref":"main","base_sha_at_snapshot":"63fb1a92257e712b02a78241351637087f66ee26"}
  7. squne121 commented on Jul 28, 2026

    @squne121
    OwnerAuthor

    Contract Review Result

    CONTRACT_REVIEW_RESULT_V1:
      status: go
      generated_at: "2026-07-28T23:18:30Z"
      generated_by: issue-contract-review
      issue_url: https://github.com/squne121/loop-protocol/issues/1711
      body_sha256: "sha256:92634e157055d3e91799ce3b1162eced9f762c6dba30a6389ac536f0320f32fa"
      checks:
        readiness: go
        blockers: pass
        product_spec: pass
        product_spec_check: {"schema":"product_spec_check/v1","applicability":"applicable","decision":"pass","triggers":{"docs_product_allowed_paths":false,"tasks_md_mentioned":false,"specify_artifact_mentioned":false,"generated_task_mentioned":false,"product_spec_context_present":false,"machine_readable_contract_present":true},"conditions":{"docs_product_requires_spec_evidence":{"status":"pass","evidence":[]},"tasks_md_not_direct_source":{"status":"pass","evidence":[]},"specify_not_canonical":{"status":"pass","evidence":[]},"diff_first_rationale_present":{"status":"pass","evidence":[]},"generated_task_trace_present":{"status":"pass","evidence":[]},"task_dependencies_materialized":{"status":"pass","evidence":[]}},"blocked_reasons":[],"body_sha256":"sha256:92634e157055d3e91799ce3b1162eced9f762c6dba30a6389ac536f0320f32fa","source_provenance":{"source_type":"github_api","body_file":null}}
        vc_preflight:
          decision: pass
          classifications: [{"ac":"AC1","line":2,"raw_command":"uv run --locked pytest scripts/agent-guards/tests/test_test_verdict_execution_record_workflow.py -q -k 'independent_manifest_recompute or final_contract_self_copy or malformed or mismatch or tampered or self_attested'","command_hash":"sha256:41e207dce2dbac90ae2aa17802ec551459c43832bf5f4b633651534238696895","execution_key_hash":"sha256:8451424a225af7a78df605c9cc6836c1fde41c339e24a17e042509b33c9d05cf","runner":"exec","exit_code":0,"classification":"expected_pass","category":"regression_gate","decision":"go","scope_class":"regression_gate","confidence":"low","stdout_head":["....                                                                     [100%]","4 passed, 17 deselected in 0.02s"],"stdout_truncated":false,"stdout_original_line_count":3,"stderr_head":[],"stderr_truncated":false,"stderr_original_line_count":1,"runner_env_delta":{},"duration_ms":172,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":null,"vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":null,"raw":null},"strict":null,"repair":null},{"ac":"AC2","line":5,"raw_command":"uv run --locked pytest scripts/agent-guards/tests/test_test_verdict_execution_record_workflow.py -q -k 'matching_readbacks'","command_hash":"sha256:73dbe21fda23d8117a1d8acb38228026896d33c5477c5359cd5b2064bf5add67","execution_key_hash":"sha256:e317ad994aad70caa7f55ca82c88dbb77f2bde5b0b7a45c44c6f4246b4372b1f","runner":"exec","exit_code":0,"classification":"expected_pass","category":"regression_gate","decision":"go","scope_class":"regression_gate","confidence":"low","stdout_head":[".                                                                        [100%]","1 passed, 20 deselected in 0.02s"],"stdout_truncated":false,"stdout_original_line_count":3,"stderr_head":[],"stderr_truncated":false,"stderr_original_line_count":1,"runner_env_delta":{},"duration_ms":174,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":null,"vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":null,"raw":null},"strict":null,"repair":null},{"ac":"AC3","line":10,"raw_command":"uv run --locked pytest scripts/agent-guards/tests/test_test_verdict_execution_record_workflow.py -q -k 'test_exact_source_provenance_binding'","command_hash":"sha256:5aec659123cc7f1042d33d301a956811d968b12273427117c7ea3d3db4ca9e65","execution_key_hash":null,"runner":"skipped","exit_code":null,"classification":"skipped","category":"preflight_scope_runtime_only","decision":"go","scope_class":"runtime_only","confidence":"low","stdout_head":[],"stdout_truncated":false,"stdout_original_line_count":1,"stderr_head":[],"stderr_truncated":false,"stderr_original_line_count":1,"runner_env_delta":{},"duration_ms":0,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":null,"vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":null,"raw":null},"strict":null,"repair":null,"verification_owner":"impl-review-loop","deferred_reason":"VC marked runtime_only; verification deferred to post-implementation runtime","runtime_verification_required":true},{"ac":"AC4","line":15,"raw_command":"uv run --locked pytest scripts/agent-guards/tests/test_test_verdict_execution_record_workflow.py -q -k 'test_trusted_untrusted_execution_boundary'","command_hash":"sha256:8545c6d473a9599e5116e35497bda4a68cf6feb28ef06252e5575c3437edfbb5","execution_key_hash":null,"runner":"skipped","exit_code":null,"classification":"skipped","category":"preflight_scope_runtime_only","decision":"go","scope_class":"runtime_only","confidence":"low","stdout_head":[],"stdout_truncated":false,"stdout_original_line_count":1,"stderr_head":[],"stderr_truncated":false,"stderr_original_line_count":1,"runner_env_delta":{},"duration_ms":0,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":null,"vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":null,"raw":null},"strict":null,"repair":null,"verification_owner":"impl-review-loop","deferred_reason":"VC marked runtime_only; verification deferred to post-implementation runtime","runtime_verification_required":true},{"ac":"AC5","line":18,"raw_command":"uv run --locked pytest scripts/agent-guards/tests/test_test_verdict_execution_record_workflow.py -q -k 'failure_reason or legacy or upload'","command_hash":"sha256:04d9fe72c3f55f7b6895d85632f16f360f43c73954cf3e45c0d897ae28fcbda5","execution_key_hash":"sha256:9d43c7ae7090b73855b218ae4873cc811d31706130e53d1f932b6d5aef9b44b4","runner":"exec","exit_code":0,"classification":"expected_pass","category":"regression_gate","decision":"go","scope_class":"regression_gate","confidence":"low","stdout_head":["..                                                                       [100%]","2 passed, 19 deselected in 0.02s"],"stdout_truncated":false,"stdout_original_line_count":3,"stderr_head":[],"stderr_truncated":false,"stderr_original_line_count":1,"runner_env_delta":{},"duration_ms":167,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":null,"vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":null,"raw":null},"strict":null,"repair":null},{"ac":"AC6","line":22,"raw_command":"uv run --locked pytest scripts/agent-guards/tests/test_test_verdict_execution_record_workflow.py -q","command_hash":"sha256:d966b57edaa6e8dcd133876ba3841b357cb835091bb602be43306cc1ff24f351","execution_key_hash":"sha256:e077761d34c0aaad77367b6ce56df337ba28c9d13b703ee901e961acf5befc4b","runner":"exec","exit_code":0,"classification":"expected_pass","category":"regression_gate","decision":"go","scope_class":"regression_gate","confidence":"low","stdout_head":[".....................                                                    [100%]","21 passed in 0.11s"],"stdout_truncated":false,"stdout_original_line_count":3,"stderr_head":[],"stderr_truncated":false,"stderr_original_line_count":1,"runner_env_delta":{},"duration_ms":271,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":null,"vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":null,"raw":null},"strict":null,"repair":null},{"ac":"AC7","line":26,"raw_command":"uv run --locked pytest scripts/agent-guards/tests/test_test_verdict_execution_record_workflow.py -q -k 'test_protected_default_branch_canary_readback'","command_hash":"sha256:3423d2b0c0544c036edcd81c04d0a568a40592d0b0edbdb9015d35c327d96938","execution_key_hash":null,"runner":"skipped","exit_code":null,"classification":"skipped","category":"preflight_scope_runtime_only","decision":"go","scope_class":"runtime_only","confidence":"low","stdout_head":[],"stdout_truncated":false,"stdout_original_line_count":1,"stderr_head":[],"stderr_truncated":false,"stderr_original_line_count":1,"runner_env_delta":{},"duration_ms":0,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":null,"vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":null,"raw":null},"strict":null,"repair":null,"verification_owner":"impl-review-loop","deferred_reason":"VC marked runtime_only; verification deferred to post-implementation runtime","runtime_verification_required":true}]
        declared_path_overlap: {"schema":"declared_path_overlap/v1","advisory":true,"blocking":false,"decision":"advisory_only","disjoint":true,"overlapping_prs":[],"inventory":{"schema":"OPEN_PR_INVENTORY_V1","repo":"squne121/loop-protocol","state":"open","base_ref":"main","base_sha":"63fb1a92257e712b02a78241351637087f66ee26","draft_policy":"include_drafts","prs":[{"number":1528,"title":"feat(cleanup): 同一実行内の branch-only fallback を追加","base_ref_name":"main","head_ref_name":"worktree-issue-1403-post-merge-cleanup-dedicated-branch-forc","head_ref_oid":"b29007580ae225eb9676c7f32c878ee2bb9ccaa9","is_draft":false,"is_cross_repository":false,"head_repository_owner":"squne121","head_repository_name":"loop-protocol","url":"https://github.com/squne121/loop-protocol/pull/1528","changed_files_count_graphql":4},{"number":1817,"title":"test: CLOSED predecessor の候補外 readback を固定 (#1766)","base_ref_name":"main","head_ref_name":"worktree-issue-1766-closed-native-predecessor-regression-v2","head_ref_oid":"5e39ca27825d76873b285de39a195a8d8f2311fd","is_draft":true,"is_cross_repository":false,"head_repository_owner":"squne121","head_repository_name":"loop-protocol","url":"https://github.com/squne121/loop-protocol/pull/1817","changed_files_count_graphql":1},{"number":1819,"title":"実装:#1797_C2a-successor-structural-collisionのhuman-review-route修正","base_ref_name":"main","head_ref_name":"worktree-issue-1797-c2a-successor-collision","head_ref_oid":"7d2af5b5033e0c6a84924d72177fadbfc0f4026f","is_draft":true,"is_cross_repository":false,"head_repository_owner":"squne121","head_repository_name":"loop-protocol","url":"https://github.com/squne121/loop-protocol/pull/1819","changed_files_count_graphql":5},{"number":1832,"title":"fix(refinement): 全終端理由で follow-up materialization 結果を出力 (#1321)","base_ref_name":"main","head_ref_name":"worktree-issue-1321-follow-up-materialization-all-reasons","head_ref_oid":"31ac20913386ef2b0a91057fbf1de491a9286af2","is_draft":true,"is_cross_repository":false,"head_repository_owner":"squne121","head_repository_name":"loop-protocol","url":"https://github.com/squne121/loop-protocol/pull/1832","changed_files_count_graphql":2},{"number":1843,"title":"fix: producer receipt に command_manifest_sha256 を独立再計算で伝播する","base_ref_name":"main","head_ref_name":"worktree-issue-1711-producer-receipt-command-manifest-sha256","head_ref_oid":"564408a735eb50e0299cbd40c9fc274580e2dcfb","is_draft":true,"is_cross_repository":false,"head_repository_owner":"squne121","head_repository_name":"loop-protocol","url":"https://github.com/squne121/loop-protocol/pull/1843","changed_files_count_graphql":3}],"fetched_count":5,"totalCount":5,"has_next_page":false,"complete":true,"saturated":false,"limit":200,"page_count":1,"inventory_digest":"sha256:259cb3999b976ddadd58dd0cdb4df7deef61a7d63fe12dc4896dd1c683270f14","errors":[]},"inventory_digest_extended":"sha256:7c824924259e50fd29d9e64b01da9d540d64e24d59460487a2617ede7f8dca44","errors":[],"note":"changed-file 名の単純な重なりのみを証明する advisory check。3-way merge・hunk 競合・rename/delete 競合は評価しない(実 Git merge 競合の判定は Issue #1792 の PAIRWISE_MERGE_OBSERVATION_V1 producer の責務)。単独では blocking にしない。disjoint は tri-state(true/false/null)— 観測が不完全な場合は null。"}
      source: ensure_contract_snapshot_auto
      expected_contract_fingerprint: {"issue_number":1711,"contract_source_kind":"issue_comment","contract_source_id":"5110748528","contract_body_sha256":"sha256:92634e157055d3e91799ce3b1162eced9f762c6dba30a6389ac536f0320f32fa","allowed_paths_normalized_sha256":"d2cfefea28ce600dd5e0063a8e38bfd07d35a7b1d90c319dc1899e30a1215f7f","base_ref":"main","base_sha_at_snapshot":"63fb1a92257e712b02a78241351637087f66ee26"}
  8. squne121 commented on Jul 28, 2026

    @squne121
    OwnerAuthor

    implement-issue: 実装完了 (2026-07-28T23:26:26Z)

    • PR: fix: producer receipt に command_manifest_sha256 を独立再計算で伝播する #1843
    • Worktree: .claude/worktrees/issue-1711-producer-receipt-command-manifest-sha256
    • Branch: worktree-issue-1711-producer-receipt-command-manifest-sha256
    • Verification: AC1〜AC7 の pytest -k フィルタすべて PASS(31/31 全体 PASS)、ruff PASS、CI 16/16 PASS
    • Overlap Preflight: route proceed_with_collision_evidence(evidence_sha256: sha256:39770749423496925232aee5d72ea6211520fd8c7093e846070bd3dfedcd4778)
    • 注意: Delivery Rule のとおり Closes は使用せず Relates to #1711 とした。PR body に自動クローズ抑制の経緯を明記している。AC3/AC4/AC7 は静的・fixture 駆動の検証であり、protected default-branch post-merge canary の実 runtime readback は merge 後に別途実行し、証跡コメント後に人間が explicit close する。
    • 後続: PR レビュー(pr-review-judge)→ マージ → post-merge canary dispatch → 証跡コメント → explicit close
  9. squne121 commented on Jul 28, 2026

    @squne121
    OwnerAuthor

    impl-review-loop: 完了 (2026-07-28T23:43:35Z)

    IMPL_REVIEW_LOOP_RESULT_V1:
      schema_version: 1
      status: draft_pr_ready
      merge_ready: true
      pr_url: "https://github.com/squne121/loop-protocol/pull/1843"
      head_sha: "db855a1432154c442302e4a4bccb0004a43ca403"
      issue_number: 1711
      termination_reason: approved
      iteration: 1
      required_auto_actions: []
    
    FOLLOW_UP_MATERIALIZATION_RESULT_V1:
      schema_version: 1
      materialized_by: impl-review-loop
      follow_up_issues: []
      note_only_observations: []
    
    ISSUE_SCOPE_ROLLUP_DECISION_V2:
      schema_version: 2
      recorded_at: "2026-07-28T23:43:35Z"
      rollup_plan_ref:
        body_sha256: "sha256:22cc9d9c203a5d8b58b7a77b03add9e92255ec6373d58294f05b9521e0f9a7d7"
        generated_at: "2026-07-28T22:59:29Z"
      decision: skipped
      executed_actions: []
      skipped_reason: "declared_path_overlap advisory check disjoint=true, no high-confidence overlapping OPEN PRs"
      candidates_reviewed: []
  10. squne121 commented on Jul 29, 2026

    @squne121
    OwnerAuthor

    impl-review-loop: 人間判断要請 (2026-07-29T10:04:43Z)

    経緯

    人間レビュアー(squne121)が PR #1843 に対し詳細な REQUEST_CHANGES を投稿し(https://github.com/squne121/loop-protocol/pull/1843#issuecomment-5115949000)、以前の pr-reviewer APPROVE 判定を覆しました。指摘は trust-boundary の本質的欠陥(対象PRコードを実際には実行せずにPASS receiptを発行できる問題)で、4件の Blocker + High + Medium×2 でした。

    implementation-worker が全 Blocker/High/Medium を解消する trust-boundary 再設計(3-job separation: trusted-preflight → untrusted-execution → trusted-receipt、REST-onlyでのsource解決、schemaへの source フィールド additive追加等)を実装し、対象範囲内の既存テスト(test_test_verdict_execution_record_workflow.py 52件、test_test_verdict_publish_exec.py 24件)は全てpassすることを確認しました。

    ブロック理由(control-plane が独立検証済み)

    Blocker 3 の要求(source フィールドをschema必須にする)を満たすと、Allowed Paths 外のファイル .claude/skills/impl-review-loop/tests/test_materialize_test_verdict_artifact.py の既存テストが 25件 fail します(uv run --locked pytest .claude/skills/impl-review-loop/tests/test_materialize_test_verdict_artifact.py -q で実際に確認、25 failed, 8 passed)。これは Issue #1711 自身の Stop Condition「Allowed Paths 外の変更が必要と判明した場合」に該当します。

    source を任意(optional)にすれば regressionは避けられますが、それは人間の High blocker(command_manifest_sha256のoptional fail-open)と同種の fail-open パターンを再導入することになり、レビュー意図と矛盾します。

    選択肢

    1. Scope Delta: Issue 実装: producer receipt に command_manifest_sha256 を伝播する回帰修正 #1711 の Allowed Paths に .claude/skills/impl-review-loop/tests/test_materialize_test_verdict_artifact.py(fixture更新のみ、本体コード変更は不要)を追加し、そのfixtureを新schemaに合わせて更新する。
    2. 別 Issue として .claude/skills/impl-review-loop 側の consumer 更新を切り出し、本 Issue では source を一時的に optional のまま進める(ただし上記の fail-open 再導入リスクあり)。
    3. その他の方針。

    人間の明示判断をお願いします。判断後、iteration 2 を継続します(実装は worktree 内に未commit・未push で保持済み: .claude/worktrees/issue-1711-producer-receipt-command-manifest-sha256)。

    LOOP_STATE:
      issue_number: 1711
      iteration: 2
      last_step: implementation
      last_loop_verdict: REQUEST_CHANGES
      termination_reason: human_escalation
      blockers_history:
        - iteration: 2
          source: human_pr_review
          blockers:
            - target_pr_head_not_executed
            - untrusted_pr_controlled_action_and_python_executed
            - source_provenance_self_attested
            - source_provenance_not_bound_to_record_receipt_schema_consumer
            - trusted_head_preflight_occurs_after_untrusted_execution
            - command_manifest_binding_optional_fail_open (High)
      worktree: .claude/worktrees/issue-1711-producer-receipt-command-manifest-sha256
      branch: worktree-issue-1711-producer-receipt-command-manifest-sha256
  11. squne121 commented on Jul 29, 2026

    @squne121
    OwnerAuthor

    Contract Review Result

    CONTRACT_REVIEW_RESULT_V1:
      status: go
      generated_at: "2026-07-29T10:20:38Z"
      generated_by: issue-contract-review
      issue_url: https://github.com/squne121/loop-protocol/issues/1711
      body_sha256: "sha256:81bbb09532045422615f2ab86ba7d07e5d3b4ba4230fee55357dbf1cacf31593"
      checks:
        readiness: go
        blockers: pass
        product_spec: pass
        product_spec_check: {"schema":"product_spec_check/v1","applicability":"applicable","decision":"pass","triggers":{"docs_product_allowed_paths":false,"tasks_md_mentioned":false,"specify_artifact_mentioned":false,"generated_task_mentioned":false,"product_spec_context_present":false,"machine_readable_contract_present":true},"conditions":{"docs_product_requires_spec_evidence":{"status":"pass","evidence":[]},"tasks_md_not_direct_source":{"status":"pass","evidence":[]},"specify_not_canonical":{"status":"pass","evidence":[]},"diff_first_rationale_present":{"status":"pass","evidence":[]},"generated_task_trace_present":{"status":"pass","evidence":[]},"task_dependencies_materialized":{"status":"pass","evidence":[]}},"blocked_reasons":[],"body_sha256":"sha256:81bbb09532045422615f2ab86ba7d07e5d3b4ba4230fee55357dbf1cacf31593","source_provenance":{"source_type":"github_api","body_file":null}}
        vc_preflight:
          decision: pass
          classifications: [{"ac":"AC1","line":2,"raw_command":"uv run --locked pytest scripts/agent-guards/tests/test_test_verdict_execution_record_workflow.py -q -k 'independent_manifest_recompute or final_contract_self_copy or malformed or mismatch or tampered or self_attested'","command_hash":"sha256:41e207dce2dbac90ae2aa17802ec551459c43832bf5f4b633651534238696895","execution_key_hash":"sha256:ea511728a6bc989311bbf5cf76e3c65922910c9e3a2018515fd44c3f1fb90dd5","runner":"exec","exit_code":0,"classification":"expected_pass","category":"regression_gate","decision":"go","scope_class":"regression_gate","confidence":"low","stdout_head":["..........                                                               [100%]","10 passed, 42 deselected in 0.07s"],"stdout_truncated":false,"stdout_original_line_count":3,"stderr_head":["warning: `VIRTUAL_ENV=/home/squne/projects/LOOP_PROTOCOL/.venv` does not match the project environment path `.venv` and will be ignored; use `--active` to target the active environment instead"],"stderr_truncated":false,"stderr_original_line_count":2,"runner_env_delta":{},"duration_ms":224,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":null,"vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":null,"raw":null},"strict":null,"repair":null},{"ac":"AC2","line":5,"raw_command":"uv run --locked pytest scripts/agent-guards/tests/test_test_verdict_execution_record_workflow.py -q -k 'matching_readbacks'","command_hash":"sha256:73dbe21fda23d8117a1d8acb38228026896d33c5477c5359cd5b2064bf5add67","execution_key_hash":"sha256:87b9a798ceeef9abe2006ad5e8a6ef63221f70ec6d5dfb6cbcf6b9e099c653c9","runner":"exec","exit_code":0,"classification":"expected_pass","category":"regression_gate","decision":"go","scope_class":"regression_gate","confidence":"low","stdout_head":[".                                                                        [100%]","1 passed, 51 deselected in 0.02s"],"stdout_truncated":false,"stdout_original_line_count":3,"stderr_head":["warning: `VIRTUAL_ENV=/home/squne/projects/LOOP_PROTOCOL/.venv` does not match the project environment path `.venv` and will be ignored; use `--active` to target the active environment instead"],"stderr_truncated":false,"stderr_original_line_count":2,"runner_env_delta":{},"duration_ms":183,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":null,"vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":null,"raw":null},"strict":null,"repair":null},{"ac":"AC3","line":12,"raw_command":"uv run --locked pytest scripts/agent-guards/tests/test_test_verdict_execution_record_workflow.py -q -k 'source'","command_hash":"sha256:51e52ed04a5559e5b14a9d73d40df29964bc8c211537c5eb17ebdda3fa841e11","execution_key_hash":null,"runner":"skipped","exit_code":null,"classification":"skipped","category":"preflight_scope_runtime_only","decision":"go","scope_class":"runtime_only","confidence":"low","stdout_head":[],"stdout_truncated":false,"stdout_original_line_count":1,"stderr_head":[],"stderr_truncated":false,"stderr_original_line_count":1,"runner_env_delta":{},"duration_ms":0,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":null,"vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":null,"raw":null},"strict":null,"repair":null,"verification_owner":"impl-review-loop","deferred_reason":"VC marked runtime_only; verification deferred to post-implementation runtime","runtime_verification_required":true},{"ac":"AC4","line":19,"raw_command":"uv run --locked pytest scripts/agent-guards/tests/test_test_verdict_execution_record_workflow.py -q -k 'untrusted or trusted_preflight or workflow_yaml'","command_hash":"sha256:f6999f8521e5c1cae5b9539dddf3ef25b8ca3d5516f7cb5c0be0be51fba7a377","execution_key_hash":null,"runner":"skipped","exit_code":null,"classification":"skipped","category":"preflight_scope_runtime_only","decision":"go","scope_class":"runtime_only","confidence":"low","stdout_head":[],"stdout_truncated":false,"stdout_original_line_count":1,"stderr_head":[],"stderr_truncated":false,"stderr_original_line_count":1,"runner_env_delta":{},"duration_ms":0,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":null,"vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":null,"raw":null},"strict":null,"repair":null,"verification_owner":"impl-review-loop","deferred_reason":"VC marked runtime_only; verification deferred to post-implementation runtime","runtime_verification_required":true},{"ac":"AC5","line":22,"raw_command":"uv run --locked pytest scripts/agent-guards/tests/test_test_verdict_execution_record_workflow.py -q -k 'failure_reason or legacy or upload'","command_hash":"sha256:04d9fe72c3f55f7b6895d85632f16f360f43c73954cf3e45c0d897ae28fcbda5","execution_key_hash":"sha256:b5d16658f9e007ff3d07bdac2b1f612974a17291a0bac7646f0eacea14a5c97d","runner":"exec","exit_code":0,"classification":"expected_pass","category":"regression_gate","decision":"go","scope_class":"regression_gate","confidence":"low","stdout_head":["....                                                                     [100%]","4 passed, 48 deselected in 0.10s"],"stdout_truncated":false,"stdout_original_line_count":3,"stderr_head":["warning: `VIRTUAL_ENV=/home/squne/projects/LOOP_PROTOCOL/.venv` does not match the project environment path `.venv` and will be ignored; use `--active` to target the active environment instead"],"stderr_truncated":false,"stderr_original_line_count":2,"runner_env_delta":{},"duration_ms":276,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":null,"vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":null,"raw":null},"strict":null,"repair":null},{"ac":"AC6","line":26,"raw_command":"uv run --locked pytest scripts/agent-guards/tests/test_test_verdict_execution_record_workflow.py -q","command_hash":"sha256:d966b57edaa6e8dcd133876ba3841b357cb835091bb602be43306cc1ff24f351","execution_key_hash":"sha256:c5d83c231a0135ebf8beb95b9ba0be0d46020371aad34f36f63c0378f64b93bf","runner":"exec","exit_code":0,"classification":"expected_pass","category":"regression_gate","decision":"go","scope_class":"regression_gate","confidence":"low","stdout_head":["....................................................                     [100%]","52 passed in 0.52s"],"stdout_truncated":false,"stdout_original_line_count":3,"stderr_head":["warning: `VIRTUAL_ENV=/home/squne/projects/LOOP_PROTOCOL/.venv` does not match the project environment path `.venv` and will be ignored; use `--active` to target the active environment instead"],"stderr_truncated":false,"stderr_original_line_count":2,"runner_env_delta":{},"duration_ms":688,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":null,"vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":null,"raw":null},"strict":null,"repair":null},{"ac":"AC7","line":30,"raw_command":"uv run --locked pytest scripts/agent-guards/tests/test_test_verdict_execution_record_workflow.py -q -k 'test_protected_default_branch_canary_readback'","command_hash":"sha256:3423d2b0c0544c036edcd81c04d0a568a40592d0b0edbdb9015d35c327d96938","execution_key_hash":null,"runner":"skipped","exit_code":null,"classification":"skipped","category":"preflight_scope_runtime_only","decision":"go","scope_class":"runtime_only","confidence":"low","stdout_head":[],"stdout_truncated":false,"stdout_original_line_count":1,"stderr_head":[],"stderr_truncated":false,"stderr_original_line_count":1,"runner_env_delta":{},"duration_ms":0,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":null,"vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":null,"raw":null},"strict":null,"repair":null,"verification_owner":"impl-review-loop","deferred_reason":"VC marked runtime_only; verification deferred to post-implementation runtime","runtime_verification_required":true}]
        declared_path_overlap: {"schema":"declared_path_overlap/v1","advisory":true,"blocking":false,"decision":"advisory_only","disjoint":true,"overlapping_prs":[],"inventory":{"schema":"OPEN_PR_INVENTORY_V1","repo":"squne121/loop-protocol","state":"open","base_ref":"main","base_sha":"63fb1a92257e712b02a78241351637087f66ee26","draft_policy":"include_drafts","prs":[{"number":1528,"title":"feat(cleanup): 同一実行内の branch-only fallback を追加","base_ref_name":"main","head_ref_name":"worktree-issue-1403-post-merge-cleanup-dedicated-branch-forc","head_ref_oid":"b29007580ae225eb9676c7f32c878ee2bb9ccaa9","is_draft":false,"is_cross_repository":false,"head_repository_owner":"squne121","head_repository_name":"loop-protocol","url":"https://github.com/squne121/loop-protocol/pull/1528","changed_files_count_graphql":4},{"number":1817,"title":"test: CLOSED predecessor の候補外 readback を固定 (#1766)","base_ref_name":"main","head_ref_name":"worktree-issue-1766-closed-native-predecessor-regression-v2","head_ref_oid":"8af505f888b5512fe0ad7878188ad9d45efe12a1","is_draft":true,"is_cross_repository":false,"head_repository_owner":"squne121","head_repository_name":"loop-protocol","url":"https://github.com/squne121/loop-protocol/pull/1817","changed_files_count_graphql":1},{"number":1819,"title":"実装:#1797_C2a-successor-structural-collisionのhuman-review-route修正","base_ref_name":"main","head_ref_name":"worktree-issue-1797-c2a-successor-collision","head_ref_oid":"02856e9c7f5ee0c9d07dcafbc67106bc1c063bc6","is_draft":true,"is_cross_repository":false,"head_repository_owner":"squne121","head_repository_name":"loop-protocol","url":"https://github.com/squne121/loop-protocol/pull/1819","changed_files_count_graphql":5},{"number":1832,"title":"fix(refinement): 全終端理由で follow-up materialization 結果を出力 (#1321)","base_ref_name":"main","head_ref_name":"worktree-issue-1321-follow-up-materialization-all-reasons","head_ref_oid":"31ac20913386ef2b0a91057fbf1de491a9286af2","is_draft":true,"is_cross_repository":false,"head_repository_owner":"squne121","head_repository_name":"loop-protocol","url":"https://github.com/squne121/loop-protocol/pull/1832","changed_files_count_graphql":2},{"number":1843,"title":"fix: producer receipt に command_manifest_sha256 を独立再計算で伝播する","base_ref_name":"main","head_ref_name":"worktree-issue-1711-producer-receipt-command-manifest-sha256","head_ref_oid":"022e8a98356bdaba2df5b47e9b5186e2884b369d","is_draft":true,"is_cross_repository":false,"head_repository_owner":"squne121","head_repository_name":"loop-protocol","url":"https://github.com/squne121/loop-protocol/pull/1843","changed_files_count_graphql":8}],"fetched_count":5,"totalCount":5,"has_next_page":false,"complete":true,"saturated":false,"limit":200,"page_count":1,"inventory_digest":"sha256:6c481e7341bd5d3209822682ff78babb5ba94068cccaf913c840c7e22102fcf7","errors":[]},"inventory_digest_extended":"sha256:e3285b8076819da4541534ba6115836f32d9f7732e469535144541899bbc2646","errors":[],"note":"changed-file 名の単純な重なりのみを証明する advisory check。3-way merge・hunk 競合・rename/delete 競合は評価しない(実 Git merge 競合の判定は Issue #1792 の PAIRWISE_MERGE_OBSERVATION_V1 producer の責務)。単独では blocking にしない。disjoint は tri-state(true/false/null)— 観測が不完全な場合は null。"}
      source: ensure_contract_snapshot_auto
      expected_contract_fingerprint: {"issue_number":1711,"contract_source_kind":"issue_comment","contract_source_id":"5116410843","contract_body_sha256":"sha256:81bbb09532045422615f2ab86ba7d07e5d3b4ba4230fee55357dbf1cacf31593","allowed_paths_normalized_sha256":"50b1f4d5fc4f7b10f1753f0f02b6cecbd0cd72414e90ec2129731d75cd5e69cf","base_ref":"main","base_sha_at_snapshot":"63fb1a92257e712b02a78241351637087f66ee26"}
  12. squne121 commented on Jul 29, 2026

    @squne121
    OwnerAuthor

    impl-review-loop: 完了 (2026-07-29T10:54:29Z)

    この iteration での主な経緯

    1. 人間レビュアー(squne121)が trust-boundary の本質的欠陥6件(対象PRコードを実際には実行せずPASS receiptを発行できる問題等)を指摘しREQUEST_CHANGESに。
    2. workflowを3-job separation(trusted-preflight → untrusted-execution → trusted-receipt)へ全面再設計し6件全て解消。
    3. schemaへの source 必須フィールド追加でAllowed Paths外の既存テストが破壊される問題が発覚 → 人間の明示承認によりAllowed PathsへScope Delta追加(fixture更新のみ)。
    4. AC3/AC4のVerification Commandsがテスト名変更で失効していたためIssue本文を機械的に修正(AC意味論は不変)。
    5. 修正後のCIでgoverned Python invocation policy違反を検出・修正。
    6. pr-reviewerの独立再検証で新たなruntimeバグ(uv run が setup-python-uv より先に実行される順序バグ)を発見・修正、job-scoped順序検証テストを追加。
    7. 全て解消後、pr-reviewerが最終APPROVE。
    IMPL_REVIEW_LOOP_RESULT_V1:
      schema_version: 1
      status: draft_pr_ready
      merge_ready: true
      pr_url: "https://github.com/squne121/loop-protocol/pull/1843"
      head_sha: "32f277e50f7932b2786a9ade9eeadb368e5bd509"
      issue_number: 1711
      termination_reason: approved
      iteration: 3
      required_auto_actions: []
    
    FOLLOW_UP_MATERIALIZATION_RESULT_V1:
      schema_version: 1
      materialized_by: impl-review-loop
      follow_up_issues: []
      note_only_observations: []
    
    ISSUE_SCOPE_ROLLUP_DECISION_V2:
      schema_version: 2
      recorded_at: "2026-07-29T10:54:29Z"
      rollup_plan_ref:
        body_sha256: "sha256:81bbb09532045422615f2ab86ba7d07e5d3b4ba4230fee55357dbf1cacf31593"
        generated_at: "2026-07-29T10:19:52Z"
      decision: skipped
      executed_actions: []
      skipped_reason: "declared_path_overlap advisory check disjoint=true, no high-confidence overlapping OPEN PRs (前回iterationと同一判断を踏襲)"
      candidates_reviewed: []
  13. squne121 commented on Jul 29, 2026

    @squne121
    OwnerAuthor

    Runtime Verification Evidence: protected default-branch post-merge canary (2026-07-29T13:05Z)

    Issue #1711 の Runtime Verification Applicability(decision: immediate, mode: protected_default_branch_post_merge_canary)に基づき、PR #1843 マージ後に protected default-branch canary を dispatch し、REST API で readback しました。

    Dispatch

    Source binding(trusted REST readback のみで解決、PR-controlled codeは未参照)

    {
      "commit_sha": "32f277e50f7932b2786a9ade9eeadb368e5bd509",
      "repository_full_name": "squne121/loop-protocol",
      "repository_id": 1240734733,
      "tree_sha": "59ddeb45cf286c5555de1d138a9f6d903e81cd84"
    }

    producer receipt / execution record 双方の source フィールドが上記と完全一致することを確認しました(subject.pr_head_sha = 32f277e50f7932b2786a9ade9eeadb368e5bd509 とも一致)。

    Artifact readback(REST API、自前で再ダウンロードして digest 再計算)

    Artifact ID 宣言 digest 独立再計算 digest 一致
    test-verdict-execution-record 8724876420 sha256:3f786c30573cc562d35097f3f1e197fa2b9e85e739c0e57f307928420a007ac2 sha256:3f786c30573cc562d35097f3f1e197fa2b9e85e739c0e57f307928420a007ac2 ✅
    • expired: false(全 artifact)
    • schema: TEST_VERDICT_EXECUTION_RECORD_V1 / TEST_VERDICT_PRODUCER_RECEIPT_V1(schema_version: 1、not_schema_change 維持、source は additive extension として存在)
    • pass_eligible: true(producer receipt / execution record 双方)
    • command_manifest_sha256: sha256:17517d6909cd3dd85551812a197288c0ca4430be9677c4730a8f383f1527ef89(producer receipt の contract.command_manifest_sha256 と execution record の contract.command_manifest_sha256 が一致、独立再計算による pre-contract→record→receipt 束縛を確認)
    • 実行結果: exec-uv-pytest-execution-record は exit_code: 0, status: pass, fallback_detected: false, skipped: false, timed_out: false
    • per_ac coverage: AC1〜AC5 が exec-uv-pytest-execution-record に紐づく

    Trust boundary(untrusted job の secrets/OIDC/write token 不在)

    untrusted-execution job のログを直接確認し、GH_TOKEN / secrets / OIDC / write 権限に関する記述が一切ないことを確認しました(permissions: {contents: read} のみで、ジョブログにも token 露出なし)。

    結論

    AC1, AC2, AC3, AC4, AC5, AC6 の runtime canary evidence が揃いました(実行内容は全 AC 共通の単一 pytest コマンドで、per_ac coverage が AC1〜AC5 をカバー。AC6 は non-regression として全体 pass で担保)。

    AC7(protected canary readback 自体)はこの canary run そのものが該当し、上記 artifact readback(ID/name/digest/run/head/expired/schema/pass eligibility/digest binding)を実施・確認しました。

    すべての readback を control-plane が独立に再計算・突合した上で本コメントを投稿しています(producer/receiptの自己申告をそのまま転記していません)。

    次のアクション: 本 Issue の Delivery Rule に従い、この evidence 確認後に人間が explicit close を判断してください。

  14. squne121 commented on Jul 29, 2026

    @squne121
    OwnerAuthor

    protected default-branch post-merge canary の runtime evidence 確認完了(https://github.com/squne121/loop-protocol/issues/1711#issuecomment-5118167039)。人間承認により Delivery Rule に従い explicit close します。

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent/implementerenhancementphase/implementationtriage-required

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions