Repository navigation
Closed
Labels
agent/implementerAI implementer agentenhancementNew feature or requestphase/implementationImplementation phase
Description
Machine-Readable Contract
contract_schema_version: v1
issue_kind: implementation
parent_issue: "#1491"
goal_ref: "open-pr の overlap preflight hard gate が、live Issue body と trusted go snapshot に束縛された期限付き waiver を exact candidate としてのみ安全に consumer する"
change_kind: code
depends_on:
- "#1470"Parent Issue
Parent Goal Ref
- Goal: waiver の外部 GitHub 依存・TOCTOU 境界を、実装要求と混同せず fail-closed で扱う
- Desired Destination: 実装: SubAgent 起動 ledger writer を cross-process safe にする #1503 の ledger writer PR が、実装: schema-governance.md の Initial Known Schemas を catalog から生成するスクリプト(#131 FU-5) #521 の legacy readback 不完全だけを根拠に安全な bounded freshness gate を通過できる
Current Validated Scope
open_pr.pyは 実装: Scope Collision Preflight で Allowed Paths 未記載 Issue を候補から除外する #1477 / 実装: LP050 拡張 — PR body Schema Consumer Inventory vs catalog 照合(#131 FU-3) #519・実装: catalog consumer contract tests — positive/negative fixture と pytest(#131 FU-4) #520・実装: update_branch.py を canonical branch-update executor に統一し、入力・race・postcondition を自己検証する #1429 に完全固定された waiver だけを consumer し、live Issue body と trustedCONTRACT_REVIEW_RESULT_V1 status: gosnapshot の body SHA 一致を要求する- 実装: SubAgent 起動 ledger writer を cross-process safe にする #1503 の 実装: schema-governance.md の Initial Known Schemas を catalog から生成するスクリプト(#131 FU-5) #521 に対する owner waiver は Issue comment にのみあり、現行 consumer の live-body contract ではない
- live preflight では 実装: schema-governance.md の Initial Known Schemas を catalog から生成するスクリプト(#131 FU-5) #521 の
readback_incomplete_missing_outcome_or_in_scopeだけがhuman_review_requiredの根拠で、他 candidate は C1 である
Remaining Parent Gaps
- 実装: open-pr の overlap_preflight evidence consumer に repository 一致検証を追加する #1470 が repository binding を consumer 側で検証するまで、本 Issue の実装を開始しない
- 実装: SubAgent 起動 ledger writer を cross-process safe にする #1503 本文へ実際の waiver を記録し、fresh
status: gosnapshot を発行するのは、本 Issue が merge された後の別手順とする
Outcome
.claude/skills/open-pr/scripts/open_pr.py が、linked Issue の live body と trusted go snapshot に同一 SHA で束縛された期限付き waiver を、fresh evidence の完全一致する readback-incomplete candidate だけに適用し、それ以外を fail-closed にする実装と pytest 証跡が揃う。
Background
#1503 は cross-process ledger writer の修正を commit 済みだが、legacy #521 の ## Outcome / ## In Scope 欠落だけで overlap preflight が停止する。#521 は catalog から schema-governance 文書を生成する未実装の独立作業であり、クローズして preflight を回避してはならない。現行の #1477 固定 exception を複製せず、contract / snapshot / candidate 更新時刻に束縛された最小の consumer を実装する。
In Scope
open_pr.pyの 実装: Scope Collision Preflight で Allowed Paths 未記載 Issue を候補から除外する #1477 固定 waiver binding を、linked Issue の live body にあるoverlap_readback_waiverを検証する generic consumer に置換する- waiver に repository、linked issue、candidate 番号と
updated_at、readback-incomplete reason、expiry、承認者を必須化し、live body と最新 trusted go snapshot の SHA 一致を検証する - fresh evidence の incomplete candidate 集合・reason・updated_at が waiver と完全一致し、complete candidate が C1/C2a だけである場合に限り
proceed_with_collision_evidenceとして扱う - candidate 集合差分、reason / updated_at drift、期限切れ、body / snapshot / repository / linked issue 不一致、source・validation・dependency の既存 unsafe predicate を fail-closed とする pytest と skill 手順を追加する
Out of Scope
.claude/skills/implement-issue/scripts/check_implementation_overlap.pyの producer、route、candidate 収集の変更- 実装: schema-governance.md の Initial Known Schemas を catalog から生成するスクリプト(#131 FU-5) #521 の本文・状態・実装の変更またはクローズ
- source.complete / saturated、validation、dependency、repository binding の既存 hard gate の緩和
- GitHub readback と PR 作成の間に原子的保証があると主張すること
Acceptance Criteria
- AC1: live body と trusted go snapshot の SHA に束縛された waiver が、exact candidate 実装: schema-governance.md の Initial Known Schemas を catalog から生成するスクリプト(#131 FU-5) #521・同一
updated_at・readback-incomplete reason だけの fresh evidence をproceed_with_collision_evidenceとして扱う - AC2: candidate 集合差分、reason 差分、実装: schema-governance.md の Initial Known Schemas を catalog から生成するスクリプト(#131 FU-5) #521 の
updated_atdrift、追加 C2b/C3 candidate、validation / dependency / source blocker をすべて fail-closed にする - AC3: repository / linked issue 不一致、期限切れ、live body 欠落、trusted でないまたは SHA 不一致の snapshot を fail-closed にする
- AC4: 実装: Scope Collision Preflight で Allowed Paths 未記載 Issue を候補から除外する #1477 の固定定数を generic contract validation に置換し、open-pr の手順が bounded freshness gate として同じ fail-closed 条件を記載する
Runtime Verification Applicability
decision: not_applicable
applicable_acs: []
reason: "contract / snapshot / fresh evidence の組合せは fixture ベース pytest で決定論的に検証でき、GitHub API の可用性や原子性を本 Issue の成功根拠にしない"Verification Commands
# AC1
$ uv run --locked pytest .claude/skills/open-pr/scripts/tests/test_open_pr_contract_bound_waiver.py::test_contract_bound_waiver_allows_exact_stale_candidate_only -q
# AC2
$ uv run --locked pytest .claude/skills/open-pr/scripts/tests/test_open_pr_contract_bound_waiver.py::test_contract_bound_waiver_rejects_candidate_timestamp_or_reason_drift -q
# AC3
$ uv run --locked pytest .claude/skills/open-pr/scripts/tests/test_open_pr_contract_bound_waiver.py::test_contract_bound_waiver_rejects_invalid_live_contract_or_snapshot -q
# AC4
$ uv run --locked pytest .claude/skills/open-pr/scripts/tests/test_open_pr_overlap_gate.py -qAllowed Paths
- .claude/skills/open-pr/scripts/open_pr.py
- .claude/skills/open-pr/scripts/tests/test_open_pr_contract_bound_waiver.py
- .claude/skills/open-pr/SKILL.md
Stop Conditions
- Allowed Paths 外の変更が必要と判明した場合
- In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
- 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
- 後続 Phase / 別スコープへの波及が判明した場合
- nested SubAgent delegation が必要になった場合
- 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
Required Skills
- Python 3
- pytest
- GitHub CLI
Required Design References
- docs/dev/workflow.md#決定論的 overlap preflight helper
- docs/dev/agent-skill-boundaries.md#Parallel Agent Runtime Safety
- 調査: overlap readback waiver の外部依存と TOCTOU 境界を追跡する #1491
- 実装: SubAgent 起動 ledger writer を cross-process safe にする #1503 (comment)
Scope Delta(任意)
N/A
Delivery Rule(配信ルール)
- 1 Issue = 1 PR で完結する
- worktree:
.claude/worktrees/issue-NNN-open-pr-contract-bound-waiver - Draft PR を既定とする
- 実装: open-pr の overlap_preflight evidence consumer に repository 一致検証を追加する #1470 の repository binding PR が merge されるまで blocked とする
Notes for Reviewer(レビュアー向け補足)
- waiver は comment 単独では有効化しない。linked Issue 本文の machine-readable contract と fresh trusted go snapshot を両方要求する
updated_atと candidate / reason の完全一致を要求し、subset・superset・不明 candidate を許容しない- 実装: schema-governance.md の Initial Known Schemas を catalog から生成するスクリプト(#131 FU-5) #521 を close して 実装: SubAgent 起動 ledger writer を cross-process safe にする #1503 の preflight を通す回避策は採用しない
Metadata
Metadata
Assignees
Labels
agent/implementerAI implementer agentenhancementNew feature or requestphase/implementationImplementation phase
Activity
fix: overlap_readback_waiver 期限切れの決定を明文化する (#1518) (#1522)
squne121 commentedon Jul 19, 2026
Contract Review Result
fix: overlap waiver の body SHA 束縛漏れ・reason 完全一致・YAML/timezone 厳格化を修正する (
squne121 commentedon Jul 20, 2026
impl-review-loop: 完了 (2026-07-20T10:30:00Z)
人間 owner の REQUEST_CHANGES(#issuecomment-5014987898)で指摘された P1×2 / P2×3 / P3×1 の全6件を修正し、pr-reviewer による再レビューで APPROVE を確認した。検証内容の詳細は PR レビューコメント を参照。
実装: open-pr の契約束縛 overlap readback waiver を一般化する (#1627)