Repository navigation
Open
Labels
agent/implementerAI implementer agentenhancementNew feature or requestphase/implementationImplementation phase
Description
Machine-Readable Contract
contract_schema_version: v1
issue_kind: implementation
parent_issue: "none"
goal_ref: "markerless open/draft PR の変更ファイル一覧を完全に取得・検証し、Allowed Paths 各 entry の ownership 判定を先頭100件で誤停止させない"
change_kind: code
dedupe_key: "impl-review-loop-v1:markerless-pr-files-completeness"Parent Issue
なし(#2972 / PR #2985 の別スコープ follow-up。親子登録はしない)
Parent Goal Ref
- Goal: 実装: markerless 既存 PR の Allowed Paths 被覆判定が glob entry(/**)を解釈できるようにする #2972 の markerless open/draft PR の Allowed Paths 各 entry 被覆を正しく判断する目標を補完する。
- Desired Destination: impl-review-loop landing evidence candidate-input producer の PR files collection と同 skill の既存テスト。実装: markerless 既存 PR の Allowed Paths 被覆判定が glob entry(/**)を解釈できるようにする #2972 の matcher 変更とは別の入力取得・完全性照合だけを write-capable とする。
Current Validated Scope
.claude/skills/impl-review-loop/scripts/implementation_landed_evidence.pyのcollect_candidate_inputs()がgh pr view --json ...filesの配列を_allowed_paths_covered()に渡す箇所と、その既存 unit / fake-gh intake integration test に限定する。- markerless な open/draft PR の変更ファイルの完全取得・件数照合・PR HEAD の前後同一性確認を追加する。実装: markerless 既存 PR の Allowed Paths 被覆判定が glob entry(/**)を解釈できるようにする #2972 が担当する matcher grammar は再実装しない。
Remaining Parent Gaps
- 実装: markerless 既存 PR の Allowed Paths 被覆判定が glob entry(/**)を解釈できるようにする #2972 の glob matcher 修正は PR fix: markerless PR の Allowed Paths glob 被覆を共有 matcher で判定する #2985 側の責務。本 Issue の files 完全性修正では代替しない。
Background
#2972 / PR #2985 のレビューで、gh pr view --json files が最大100件しか返さないと、101番目だけが tests/** を被覆する markerless PR が reconciliation_required / open_draft_scope_ownership_not_exact になることが判明した(元 finding、承認レビュー)。根本原因は matcher ではなく producer の変更ファイル取得範囲と完全性の未検証。運用回避(scope marker の手入力や再試行)は PR ごとに人間介入し、漏れを検知できないため採用しない。REST PR files の決定論的な pagination と件数・HEAD 照合を採用する。
Outcome
implementation_landed_evidence.py と既存テストが更新され、markerless open/draft PR のファイル一覧が REST API の取得可能範囲(最大3000件)で全件検証されたときだけ Allowed Paths 各 entry の ownership 判定へ進み、101件目だけが被覆する PR は正しく resume し、不完全な入力や取得上限超過は fail-closed となる。
Runtime Verification Applicability
- decision: not_applicable
- reason: fake
ghtransport による production-shaped file pagination、HEAD 再確認と失敗経路の決定論的テストで検証でき、live GitHub mutation を必要としない。
In Scope
- markerless open/draft candidate で REST
repos/{owner}/{repo}/pulls/{pr}/filesをページ単位(per_page=100)で最後まで取得し、PR の changedFiles 件数など独立の総数と件数・重複を照合する。GitHub の最大3000件制約を超えた場合や総数が確認できない場合は完全とはみなさない。API 失敗・rate limit・未完走・異常な JSON / file path は fail-closed。 gh pr viewから得た PR HEAD と pagination 後に確認した HEAD の一致を ownership の前提とする。移動・確認不能時は不完全な snapshot を使って resume しない(既存の freshness rebind 契約とも整合)。- 完全と確証できた files だけを既存
_allowed_paths_covered()に渡し、Allowed Paths 各 entry が最低1件の file に被覆される all-of のままにする。unrelated file が追加されても all-of coverage の真偽を変えない。 - 既存 unit test と fake
ghtransport の intake integration test へ100/101件の正負、部分取得・API 失敗・3000件境界・HEAD drift の回帰を追加する。
Out of Scope
- PR files 全件が Allowed Paths 内にあるかの許可 gate、実装: markerless 既存 PR の Allowed Paths 被覆判定が glob entry(/**)を解釈できるようにする #2972 の
_allowed_paths_covered()matcher 再実装、共有 matcher 本体の変更。 - 実装: allowed_paths_review_gate.py に GitHub PR files API pagination adapter を追加する #1308(pr-review-judge の別 adapter)、実装: implementation_landed_evidence.py の gh api --paginate に --slurp を追加し timeline JSON parse 失敗を防ぐ #2739(同 producer の Issue timeline 複数ページ parse)の修正・統合。marker 付き candidate や merged PR の disposition 変更。
- 実 GitHub 認証・外部 API への live smoke を受け入れ必須にはしない。
Acceptance Criteria
- AC1: fake transport の markerless open/draft で101番目の file のみが
tests/**を被覆し、他の Allowed Paths entry も被覆される場合、全件取得・完全性照合後にcurrent_scope_ownership=True/existing_pr_resume/markerless_allowed_paths_coverage/resume_existing_prとなる。unrelated file は排除しない。 - AC2: 同じ101件で101番目の被覆 file のみが欠落する場合、
current_scope_ownership=False/reconciliation_required/open_draft_scope_ownership_not_exactとなり resume しない。先頭100件だけで all-of を結論しない。 - AC3: 途中ページ欠落・失敗・rate limit・parse 異常・件数不一致・重複または3000件超で完全性を証明できないとき、先頭100件が全 entry を被覆していても
existing_pr_resumeに進まない。 - AC4: file pagination 前後で PR HEAD が移動するか HEAD の検証に失敗したとき、旧 HEAD の files から ownership True を確定しない。
- AC5: markerless PR の all-of / unrelated file と、marker 付き・merged candidate の既存 disposition 挙動が退行せず、impl-review-loop の既存テスト全体が成功する。
Verification Commands
# AC1
# baseline-expect: fail
$ uv run --locked pytest .claude/skills/impl-review-loop/tests/test_implementation_landed_intake_integration.py::test_markerless_pr_files_page_101_coverage_resume
# AC2
# baseline-expect: fail
$ uv run --locked pytest .claude/skills/impl-review-loop/tests/test_implementation_landed_intake_integration.py::test_markerless_pr_files_page_101_missing_coverage
# AC3
# baseline-expect: fail
$ uv run --locked pytest .claude/skills/impl-review-loop/tests/test_implementation_landed_evidence.py::test_markerless_pr_files_incomplete_fail_closed
# AC4
# baseline-expect: fail
$ uv run --locked pytest .claude/skills/impl-review-loop/tests/test_implementation_landed_evidence.py::test_markerless_pr_files_head_drift_fail_closed
# AC5
$ uv run --locked pytest .claude/skills/impl-review-loop/tests/Allowed Paths
.claude/skills/impl-review-loop/scripts/implementation_landed_evidence.py.claude/skills/impl-review-loop/tests/test_implementation_landed_evidence.py.claude/skills/impl-review-loop/tests/test_implementation_landed_intake_integration.py
Stop Conditions
- Allowed Paths 外の変更が必要と判明した場合
- In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
- 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
- 後続 Phase / 別スコープへの波及が判明した場合
- nested SubAgent delegation が必要になった場合
- 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
- REST PR files の3000件上限または
changedFilesの信頼できる件数を照合できず、完全性を証明できない場合
Required Skills
なし
Required Design References
- docs/dev/workflow.md
- docs/dev/runtime-verification-policy.md
Scope Delta(任意)
N/A(#2972 の matcher から独立した producer の一覧取得・完全性検査)
Source
- source_issue: 実装: markerless 既存 PR の Allowed Paths 被覆判定が glob entry(/**)を解釈できるようにする #2972
- source_pr: fix: markerless PR の Allowed Paths glob 被覆を共有 matcher で判定する #2985
- finding: fix: markerless PR の Allowed Paths glob 被覆を共有 matcher で判定する #2985 (comment)
- approved_review: fix: markerless PR の Allowed Paths glob 被覆を共有 matcher で判定する #2985 (comment)
- dedupe_key: impl-review-loop-v1:markerless-pr-files-completeness
- dedupe: 全状態の keyword / outcome 照合で同一 Outcome なし。実装: allowed_paths_review_gate.py に GitHub PR files API pagination adapter を追加する #1308 は別 skill の PR gate adapter、実装: implementation_landed_evidence.py の gh api --paginate に --slurp を追加し timeline JSON parse 失敗を防ぐ #2739 は timeline JSON parse で別 Outcome。
- overlap_preflight: ISSUE_OVERLAP_PREFLIGHT_RESULT_V1 decision=ambiguous_requires_human; reason_code=dependency_ambiguous; source_status=ok。実装: markerless 既存 PR の Allowed Paths 被覆判定が glob entry(/**)を解釈できるようにする #2972 と Allowed Paths 3件が重複するが、matcher と input producer の別意図。実装: markerless 既存 PR の Allowed Paths 被覆判定が glob entry(/**)を解釈できるようにする #2972 merge 後に着手し並行編集しない(dependency ordering)。
Delivery Rule
- 1 Issue = 1 PR。専用 worktree、Draft PR 既定。
- Depends on 実装: markerless 既存 PR の Allowed Paths 被覆判定が glob entry(/**)を解釈できるようにする #2972 merge。PR fix: markerless PR の Allowed Paths glob 被覆を共有 matcher で判定する #2985 の matcher 差分を取り込んでから files 取得のみ変更し、同じファイルの並行編集を避ける。
Metadata
Metadata
Assignees
Labels
agent/implementerAI implementer agentenhancementNew feature or requestphase/implementationImplementation phase
Activity