Repository navigation
Description
Machine-Readable Contract
contract_schema_version: v1
issue_kind: implementation
parent_issue: "none"
goal_ref: "implementation_landed_evidence.py::collect_candidate_inputs() の GitHub timeline 取得が gh api --paginate の複数ページ出力を単一 json.loads() に渡しており、100件超の timeline で multi-document JSON parse に失敗する不具合を修正する"
change_kind: codeParent Issue
なし(#2713 レビューコメントからの scope 分離 follow-up)
Parent Goal Ref
- Goal: PR feat: add evidence-based landing intake #2700 / 実装: impl-review-loop の pre-Step-1 data-plane 判定を resolve_pre_step1_data_plane_action() に統合する #2713 の Remaining Parent Gaps に記録された timeline pagination 不具合を解消する
- Desired Destination: 単独の小規模 implementation Issue として起票(実装: impl-review-loop の pre-Step-1 data-plane 判定を resolve_pre_step1_data_plane_action() に統合する #2713 の子ではない)
Current Validated Scope
.claude/skills/impl-review-loop/scripts/implementation_landed_evidence.py::collect_candidate_inputs()のgh api --paginate呼び出し(timeline 取得部分)を--slurp付きに変更し、複数ページ配列を1段 flatten してから既存の消費ロジックへ渡す
Remaining Parent Gaps
- 本 Issue 完了後も、
derive_landing_disposition()/apply_already_satisfied_precedence()等の disposition 判定ロジック自体の改善は 実装: impl-review-loop の pre-Step-1 data-plane 判定を resolve_pre_step1_data_plane_action() に統合する #2713 側の Remaining Parent Gaps として残る(本 Issue の Out of Scope) - live GitHub API 上で実際に 100 件超の timeline を持つ Issue での実機検証は、本 Issue では行わない(fixture ベースの決定論的 regression test で代替する)
Outcome
gh api --paginate で取得した Issue timeline が、0 件・単一ページ・101 件以上(複数ページ)のいずれの shape でも、collect_candidate_inputs() が正しく単一のフラットな配列として解釈し、multi-document JSON parse 失敗を起こさない状態になっている。
Runtime Verification Applicability
- decision: not_applicable
- reason:
ghコマンド呼び出しを fake transport に差し替えた決定論的テストで検証可能であり、live GitHub API 呼び出しを必須要件にしない。
In Scope
implementation_landed_evidence.pyの timeline 取得コマンドに--slurpを追加する--slurp付き出力(外側配列でページ配列をラップした構造)を1段 flatten し、既存の_json()ないし後続処理が期待する「flat なイベントリストの配列」形状に正規化する処理を追加する- 0 件(空 timeline)、単一ページ(100 件以下)、101 件以上(複数ページ)の 3 shape を検証する fixture ベースの regression test を追加する
Out of Scope
collect_candidate_inputs()の他のロジック(timeline 以外のデータソース取得、evidence 判定ロジック自体)の変更derive_landing_disposition()/apply_already_satisfied_precedence()等の disposition 判定ロジックの変更(実装: impl-review-loop の pre-Step-1 data-plane 判定を resolve_pre_step1_data_plane_action() に統合する #2713 で別途扱う)- live GitHub API に対する実際の 100 件超 timeline を持つ Issue での実機検証
Acceptance Criteria
- timeline 取得コマンドが
gh api --paginate --slurp ...の形になっている -
--slurpによりページごとの配列がネストされた出力を、既存消費ロジックが期待するフラットな配列へ1段 flatten する処理が実装されている - 0 件 / 単一ページ / 101 件以上(複数ページ)の 3 fixture shape それぞれで、
collect_candidate_inputs()が JSON parse エラーを起こさず正しいイベント件数を返すことを検証する regression test が追加されている -
.claude/skills/impl-review-loop/tests/配下の pytest が全件 PASS している
Verification Commands
# timeline 取得コマンドに --slurp が追加されている
$ rg -n -- "--paginate" .claude/skills/impl-review-loop/scripts/implementation_landed_evidence.py
# 0/単一/複数ページの pagination regression test が存在する
$ rg -n "def test.*timeline.*pag" .claude/skills/impl-review-loop/tests/test_implementation_landed_evidence.py
# slurp flatten regression test が存在する
$ rg -n "def test.*slurp" .claude/skills/impl-review-loop/tests/test_implementation_landed_evidence.py
# 複数ページ regression test が存在する
$ rg -n "def test.*multi.*page" .claude/skills/impl-review-loop/tests/test_implementation_landed_evidence.py
# impl-review-loop tests 全件 PASS
$ uv run --locked pytest .claude/skills/impl-review-loop/tests/ -qAllowed Paths
- .claude/skills/impl-review-loop/scripts/implementation_landed_evidence.py
- .claude/skills/impl-review-loop/tests/test_implementation_landed_evidence.py
Stop Conditions
- Allowed Paths 外の変更が必要と判明した場合
- In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
- 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
- 後続 Phase / 別スコープへの波及が判明した場合
- nested SubAgent delegation が必要になった場合
- 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
Required Skills
なし
Required Design References
- .claude/skills/impl-review-loop/scripts/implementation_landed_evidence.py
Notes for Reviewer
由来: Issue #2713 の operator-selected human-context anchor(issuecomment-5808708572)レビュー P2 の分離 follow-up。レビュー原文: 「gh api --paginate の出力を単一の json.loads() へ渡している。GitHub CLI 公式仕様では pagination の各ページは別々の JSON 配列/オブジェクトであり、複数ページを外側配列にまとめるのが --slurp。--paginate --slurp とページ配列の1段 flatten をセットで実施し、0件・単一ページ・101件以上の fixture で検証する。」
Dedupe 確認結果: paginate slurp / timeline pagination / gh api pagination JSON 等での open Issue 検索により重複は確認されなかった。Issue #1610(実装: overlap pagination の read-only runtime smoke を controlled VC として追加する)は GraphQL cursor pagination を扱う別サブシステム(#1493 系列)であり、本件(gh api --paginate REST timeline JSON)とは無関係。
優先度: #2713 の Remaining Parent Gaps に「低優先度」と記録されている通り、緊急ではないが、個人開発運用でも実害があるため独立した小規模修正として起票する。
Source
- refinement follow-up
- origin_issue: 実装: impl-review-loop の pre-Step-1 data-plane 判定を resolve_pre_step1_data_plane_action() に統合する #2713
- origin_anchor: 実装: impl-review-loop の pre-Step-1 data-plane 判定を resolve_pre_step1_data_plane_action() に統合する #2713 (comment)
- dedupe_key: follow-up:squne121/loop-protocol:issue/2713:timeline-pagination-slurp
Activity