Repository navigation
Open
Labels
agent/implementerAI implementer agentenhancementNew feature or requestphase/implementationImplementation phasetriage-requiredNeeds owner triage for priority decision
Description
Parent Issue
なし(単独改善)
Machine-Readable Contract
contract_schema_version: v1
issue_kind: implementation
parent_issue: "none"
goal_ref: "PR #1897 OWNER 敵対的レビュー(https://github.com/squne121/loop-protocol/pull/1897#issuecomment-5149868634)P1-4: native relationship pagination reader の二重実装を単一 canonical reader に統合し totalCount 整合を保証する"
change_kind: code
Parent Goal Ref
- Goal: PR 実装: edit-issue transaction に GitHub native 親子・依存関係の同期と readback を追加する #1897(Closes 実装: edit-issue transaction に GitHub native 親子・依存関係の同期と readback を追加する #1883)で導入した GitHub native parent/blockedBy/blocking 同期の pagination readback を、caller 側の簡易実装と controlled executor 側の cursor traversal実装に分裂させたまま残さない
- Desired Destination: なし(本 Issue が最終destination)
Current Validated Scope
.claude/skills/edit-issue/scripts/edit_issue_txn.pyの_fetch_native_relationships()(first:100の単発 pre-readback でhasNextPage == trueの場合 fail-closed のみ)を、cursor traversal を行う canonical reader に置き換えるscripts/agent-guards/controlled_skill_mutation_exec.py側のissue_relationship.updatecursor traversal helper にtotalCount検証を追加する- 上記 canonical reader を
edit_issue_txn.pyの caller から呼び出す形へ統合する .claude/skills/edit-issue/tests/test_edit_issue_txn.py/scripts/agent-guards/tests/test_controlled_skill_mutation_exec.pyに回帰テストを追加する
Remaining Parent Gaps
- なし(本 Issue の完了で PR 実装: edit-issue transaction に GitHub native 親子・依存関係の同期と readback を追加する #1897 レビュー P1-4 は解消する)
Outcome
.claude/skills/edit-issue/scripts/edit_issue_txn.py と scripts/agent-guards/controlled_skill_mutation_exec.py にまたがる native relationship pagination readback の二重実装が単一の canonical reader(controlled executor 側)へ統合され、各ページで totalCount が integer であること・pagination 中に totalCount が変化しないこと・cursor が前進すること・subject node identity が変化しないこと・number/node ID が重複しないこと・最終 unique node 数が totalCount と完全一致すること・node 数が safety cap 以下であることを検証したうえで exact-set 判定を行うファイルへ変わり、edit_issue_txn.py 側の「100件だけ読む簡易 snapshot」実装が削除され、pytest の回帰テストが追加された状態で全て PASS している状態。
In Scope
edit_issue_txn.pyの_fetch_native_relationships()を canonical reader(controlled executor 側の cursor traversal helper)呼び出しへ置き換える- controlled executor 側の該当 GraphQL query に
totalCountフィールドを追加し、ページ検証ロジック(totalCount 型・不変性、cursor 前進、subject node identity 不変、number/node ID 重複なし、最終 unique node 数 == totalCount、safety cap 以下)を実装する edit_issue_txn.pyから重複した「100件だけ読む簡易 snapshot」ロジックを削除する- 上記変更に対応する回帰テスト(
test_total_count_mismatch_rejects_exact_set等)を両方の test ファイルに追加・拡充する
Out of Scope
.claude/skills/edit-issue/tests/live_canary_full_relationship_cycle.shの書き換え(別 Issue で扱う。PR 実装: edit-issue transaction に GitHub native 親子・依存関係の同期と readback を追加する #1897 レビュー P1-6 follow-up)- native relationship 以外(body/title mutation 等)の readback ロジック変更
- GitHub GraphQL API 自体の仕様変更・新規 mutation 追加
Acceptance Criteria
- AC1:
edit_issue_txn.pyの_fetch_native_relationships()がscripts/agent-guards/controlled_skill_mutation_exec.py側の cursor traversal helper を呼び出す実装に置き換わっており、first: 100の単発簡易 pre-readback ロジックがedit_issue_txn.pyから削除されている - AC2: controlled executor 側の
issue_relationship.update用 GraphQL query(blockedBy/blockingの pagination query)にtotalCountフィールドが追加されている - AC3: controlled executor のページ検証ロジックが、各ページで totalCount が integer であること・pagination 中に totalCount が変化しないこと・cursor(
endCursor)が前進すること・subject issue node identity(id/number)が変化しないこと・collected node の number/node ID が重複しないこと・最終 unique node 数が totalCount と完全一致すること・node 数が safety cap(_ISSUE_DEPENDENCY_REMOVE_MAX_PAGES相当の既存 cap)以下であることを検証し、いずれかに違反した場合は exact-set 判定をせず fail-closed で拒否する - AC4:
test_controlled_skill_mutation_exec.pyに totalCount 不一致・totalCount 型不正・重複 node ID を検出する回帰テストが追加されている - AC5:
test_edit_issue_txn.pyの既存テストが_fetch_native_relationships()の新実装(canonical reader 呼び出し)に対応する形へ更新され、全て PASS している
Verification Commands
# AC1
$ git grep -n "first:100" .claude/skills/edit-issue/scripts/edit_issue_txn.py
# AC2
$ git grep -n "totalCount" scripts/agent-guards/controlled_skill_mutation_exec.py
# AC3
$ uv run --locked python3 -m pytest scripts/agent-guards/tests/test_controlled_skill_mutation_exec.py -k total_count -v
# AC4
$ uv run --locked python3 -m pytest scripts/agent-guards/tests/test_controlled_skill_mutation_exec.py -v
# AC5
$ uv run --locked python3 -m pytest .claude/skills/edit-issue/tests/test_edit_issue_txn.py -v
Allowed Paths
.claude/skills/edit-issue/scripts/edit_issue_txn.py.claude/skills/edit-issue/tests/test_edit_issue_txn.pyscripts/agent-guards/controlled_skill_mutation_exec.pyscripts/agent-guards/tests/test_controlled_skill_mutation_exec.py
Stop Conditions
- Allowed Paths 外の変更が必要と判明した場合
- In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
- 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
- 後続 Phase / 別スコープへの波及が判明した場合
- nested SubAgent delegation が必要になった場合
- 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
Required Skills
なし
Required Design References
- docs/dev/agent-skill-boundaries.md(issue_relationship.update controlled executor の契約)
Scope Delta(該当時のみ記載)
N/A
Runtime Verification Applicability
- decision: not_applicable
- reason: 本 Issue の検証対象は GraphQL query 構造とページ検証ロジックであり、fake-gh(既存 test 群が使う subprocess stub)による pytest unit test で完全に検証可能。実 GitHub API との通信・実 Issue への副作用を伴う runtime 検証は不要。実 GitHub API に対する end-to-end 検証は別 Issue(live canary 書き換え、PR 実装: edit-issue transaction に GitHub native 親子・依存関係の同期と readback を追加する #1897 レビュー P1-6 follow-up)が担う
Delivery Rule
1 Issue = 1 PRで完結する- worktree での作業を前提とし、Draft PR を既定とする
Notes for Reviewer
- overlap preflight(
check_issue_overlap.py)で 実装: guard-issue-body.py の AC/VC alignment を共有パーサーへ統合し VC grammar parity/LP010/authoring reference を同期する #1719 / 実装: playtest-log の JSON Schema / validator の追加 #420 / 実装: .claude/skills 配下スクリプトの executable bit を監査し CI guard を追加する #205 がpolicy_class: C1として検出されたが、いずれも false positive と判断する:- 実装: guard-issue-body.py の AC/VC alignment を共有パーサーへ統合し VC grammar parity/LP010/authoring reference を同期する #1719 は
.claude/skills/edit-issue/testsを broad path として宣言しているのみで、対象はguard-issue-body.pyの AC/VC パーサー統合であり本 Issue の pagination reader 統合とは無関係 - 実装: playtest-log の JSON Schema / validator の追加 #420 / 実装: .claude/skills 配下スクリプトの executable bit を監査し CI guard を追加する #205 は
scriptsを broad path として宣言しているのみで、対象はそれぞれ playtest-log schema と executable bit 監査であり本 Issue のcontrolled_skill_mutation_exec.py変更とは無関係
- 実装: guard-issue-body.py の AC/VC alignment を共有パーサーへ統合し VC grammar parity/LP010/authoring reference を同期する #1719 は
- 本 Issue は PR 実装: edit-issue transaction に GitHub native 親子・依存関係の同期と readback を追加する #1897(マージ済み、Closes 実装: edit-issue transaction に GitHub native 親子・依存関係の同期と readback を追加する #1883)に対する squne121 の敵対的レビュー(https://github.com/squne121/loop-protocol/pull/1897#issuecomment-5149868634)で P1-4 として指摘され、follow-up Issue 化が明示的に合意された項目
Metadata
Metadata
Assignees
Labels
agent/implementerAI implementer agentenhancementNew feature or requestphase/implementationImplementation phasetriage-requiredNeeds owner triage for priority decision
Activity