Repository navigation
実装: edit-issue transaction に GitHub native 親子・依存関係の同期と readback を追加する - #1897
Conversation
… edit transaction (#1883) edit_issue_txn.py の native relationship 拡張を実装した。既存 Issue の content update transaction が本文の parent/blocker 記述だけでなく GitHub native `parent`/`blockedBy`/`blocking` を同期・全ページ readback するように なり、#1679 で発生した「本文は新親を示すが native parent は旧親のまま」の split-brain を構造的に防止する。 - ISSUE_EDIT_TXN_INPUT_V1 を後方互換 additive 拡張し、任意フィールド `native_relationships`(expected_before / parent.action / add_*・remove_*) を追加した。省略時は pre-#1883 の body/comment-only 挙動と完全に同一 - native relationship mutation を新しい controlled executor 固定 operation `issue_relationship.update`(scripts/agent-guards/controlled_skill_mutation_policy.py / controlled_skill_mutation_exec.py)として実装した。caller は GraphQL query/REST path/hostname/argv を渡せない - 実装開始時に gh 2.88.1 の capability を再確認し、`--parent` 系フラグ・ `gh issue view --json` の parent/blockedBy/blocking フィールドがいずれも 存在しないことを確認した上で GraphQL 固定 operation を採用した - Required Transaction Order(graph invariant 検証 → pre-readback → expected_before drift 検出 → 祖先サイクル検出 → 順序付き mutation → 全ページ post-readback)を native mutation が content mutation より先に 実行する順序で実装し、native mutation 失敗時は content mutation を一切 開始しない - fake gh によるユニットテスト(edit_issue_txn / controlled_skill_mutation_exec / controlled_skill_mutation_policy)で AC1-AC14・AC16 を検証し、live canary shell script(AC3/AC15、disposable Issue 使用、cleanup 込み)を 追加した Allowed Paths 内: edit-issue SKILL/scripts/tests、issue-author.md、 docs/dev/agent-skill-boundaries.md、docs/dev/github-ops.md、 scripts/agent-guards/controlled_skill_mutation_{policy,exec}.py と対応テスト。 Co-Authored-By: Claude Sonnet 5 <[email protected]>
Preview URL✅ verified live assets: https://squne121.github.io/loop-protocol/pr-1897/ The preview will be removed when this PR is closed. |
impl-review-loop Step 4 判定: REQUEST_CHANGESMergeability
Evidence Check
Blockers
Non-blockers
verdict: REQUEST_CHANGES
reviewed_head_sha: "57971063a55eaffc92bdcee613e955444467e8e6"
blockers:
- "PR body is missing the required '## 受け入れ条件の達成状況' section with per-AC [x]/[ ] + evidence for AC1-AC16."
warnings: [] |
impl-review-loop Step 4 判定: APPROVE(update_branch 待ち)Mergeability
Evidence Check
Blockers
Non-blockers(Warning)
Routing
verdict: APPROVE
reviewed_head_sha: "57971063a55eaffc92bdcee613e955444467e8e6"
blockers: []
warnings:
- "PR Body Japanese Check (non-required) is FAILURE, pre-existing, not a merge gate. Follow-up recommended." |
impl-review-loop Step 4 判定: APPROVE(update_branch 待ち、2回目)Mergeability
Evidence Check
Blockers
Routing
verdict: APPROVE
reviewed_head_sha: "36099696022233197e3fbe31458b13828e185013"
blockers: []
warnings: [] |
…ive relationship use site Title/body-only edit_issue_txn.py invocations no longer import scripts/agent-guards/controlled_skill_mutation_policy.py at module load time, restoring compatibility with harnesses (e.g. test_skill_runtime_exec_anchor.py) that copy only the edit-issue skill directory and swap in controlled_skill_mutation_exec.py, without that sibling policy module present.
impl-review-loop 最終判定: APPROVE(draft_pr_ready)Mergeability
経緯
Evidence Check(最終)
Blockers
Non-blockers(Warning)
verdict: APPROVE
reviewed_head_sha: "5d33358fd0b3a617315807629ddd2c2bf0edb0a5"
blockers: []
warnings:
- "PR Body Japanese Check (non-required) is pre-existing FAILURE, not a merge gate."Routing
|
判定LOOP_VERDICT_V2:
verdict: REQUEST_CHANGES
merge_readiness: not_ready
reviewed_head_sha: "78efe9de857b31eae938206af37f1a7ab83be26c"
severity:
P0: 2
P1: 6
P2: 2
confidence: highPR #1897 は現在 OPEN / Draft / MERGEABLE です。current-head の主要 実装方針そのもの、すなわち「本文だけ更新して native graph が古いまま残る split-brain を防ぐ」「任意 GraphQL を caller に渡させない fixed controlled executor」「native mutation を content mutation より先に行う」という方向は妥当です。#1632/マージ済み PR #1667 の actor binding・closed schema・全ページ readback・no-retry を拡張しようとした点も評価できます。 ただし、現実装は Issue #1883 の中心契約である以下を満たしていません。
Issue #1883 はこれらを Required Transaction Order と AC1、AC6、AC8、AC12、AC15 に明記しています。 Blocking findingsP0-1 — candidate body の検証前に native relationship を変更し、その後の失敗を
|
…ion 整合性修正 OWNER 敵対的レビュー(reviewed_head_sha 78efe9d、P0 2件/P1 6件/P2 2件)に対応した。 - P0-1: native relationship mutation を candidate body の guard/hygiene/ readiness 検証完了後に実行するよう再順序化し、native mutation 成功後の content 検証失敗が failed_no_mutation と誤報されないよう修正 - P0-2: content mutation 後に issue_relationship.update を zero-delta で 再実行する最終 combined readback (Phase C) を追加 - P1-1: add/remove 集合を validator に渡す前に sort/dedup していた処理を 廃止し、malformed input を正しく拒否するよう修正 - P1-2: idempotent no-op 判定を raw input の空判定から effective diff (current == desired) 判定に変更 - P1-3: parent rebind を remove_parent+set_parent の2段階から addSubIssue(replaceParent:true) 1回に集約 - P1-5: controlled executor 子プロセスの timeout/non-JSON 出力を "mutation なし" と即断せず、独立 readback で分類するよう修正 - P1-6: live canary を7 step (parent rebind・blocking add/remove を追加) に拡張 - P1-7: native relationship mutation 後に title/body/updatedAt を再読取し content-lane precondition に反映 - P1-8: gh CLI capability matrix の記述を現行バージョンに合わせて更新 回帰テストを edit_issue_txn / controlled_skill_mutation_exec 双方に追加。
impl-review-loop 判定: APPROVE(OWNER 敵対的レビュー対応後、update_branch 待ち)OWNER の敵対的レビュー(https://github.com/squne121/loop-protocol/pull/1897#issuecomment-5149868634、reviewed_head 78efe9d、P0:2 P1:6 P2:2)に対する修正を独立検証しました。 対応状況
CI / Allowed Paths
Blockers
Non-blockers(Warning)
verdict: APPROVE
reviewed_head_sha: "788b529b1c3741529abbf25b3dbe47f4ba25fef5"
blockers: []
warnings:
- "PR Body Japanese Check (non-required) pre-existing failure, disclosed in PR body."
- "expected_before.blocked_by/blocking still sorted() before graph invariant validation (P1-1 residual, recommend follow-up)."
- "P1-4 (pagination reader unification) and P1-6 (live canary via edit_issue_txn.py combined transaction) remain incomplete; recommend follow-up issue."Routingmain が活発なため |
impl-review-loop 最終判定: APPROVE(draft_pr_ready、OWNER 敵対的レビュー対応完了)Mergeability
経緯(OWNER 敵対的レビュー対応サイクル)
Evidence Check(最終)
Blockers
Non-blockers(Warning、follow-up 推奨)
verdict: APPROVE
reviewed_head_sha: "1da68b64945a7808c2f8cc74dc375faa21e7ce0f"
blockers: []
warnings:
- "P1-4 (pagination reader unification) and P1-6 (live canary via edit_issue_txn.py combined transaction) remain incomplete; recommend follow-up issue."
- "PR Body Japanese Check (non-required) pre-existing failure, disclosed in PR body."Routing
|
概要
Issue #1883 の実装。
edit_issue_txn.py(既存 Issue の content update transaction)に、GitHub nativeparent/blockedBy/blockingの同期を追加した。本文の parent/blocker 記述を書き換えても native relationship が追従しない split-brain(#1679 で実際に発生)を、native mutation → 全ページ readback を content mutation より先に実行する saga として構造的に修正する。Closes #1883
iteration-4 fix_delta(OWNER 敵対的レビュー対応、reviewed_head_sha 78efe9d)
OWNER 本人による直接 PR コメントの敵対的レビュー(P0 2 件 / P1 6 件 / P2 2 件)を受け、以下を修正した。
edit_issue_txn.pyの native relationship mutation(issue_relationship.updateの実際の GraphQL write)を、candidate body の guard/hygiene/readiness 検証が完了した 後 に実行するよう再順序化した。以前は native mutation が content 検証より先に走っていたため、native mutation 成功後に content 検証が失敗するとfailed_no_mutationを誤返却し、呼び出し側が「GitHub は変更されていない」と誤認しうる状態だった。native relationship の pure/read-only 検証(capability preflight・pre-readback・expected_before drift・graph invariant)は Phase A として先に、実際の mutation は Phase B として candidate 検証後に分離した。加えて_render_resultに「一度でも remote write の可能性が生じたらfailed_no_mutationを返さない」安全網を追加し、native relationship が attempted の場合はmutation_startedを強制的に True にするissue_relationship.updateを zero-delta(expected_before=desired、add/remove 空、parent.action=unchanged)で再実行する verify-only readback(Phase C)を追加した。新しい command id やスキーマを追加せず、既存 operation を read-only probe として再利用する(導入: AIエージェント運用をminimal harnessへ縮退し、過剰なcontrol-planeを廃止する #1860 minimal harness 方針)。この最終確認が一致しない限りok/no_changeを返さないadd_blocked_by/remove_blocked_by/add_blocking/remove_blockingをsorted(set(...))で正規化してから validator に渡していた箇所を、caller 宣言の raw 値のままvalidate_issue_relationship_update_input()に渡すよう修正した。duplicate/unsorted な malformed input を validator が正しく拒否するようになった(既存 AC4 テストのフィクスチャも sorted/unique な入力に修正)current_blocked_by/current_blockingとdesired_*の effective diff(実際に必要な GraphQL 呼び出し)に基づく判定へ変更した。既存 blocker の再 add、非存在 blocker の remove 指定など、current==desired なのに mutation が発生していたケースを解消したremove_parent→set_parentの 2 段階から、addSubIssue(replaceParent: true)一回のみに変更した(このクエリは既にreplaceParent: trueを固定指定していたため、不要な remove 呼び出しを取り除くだけで済んだ)。旧 parent が一時的に外れる window が消える_fetch_native_relationships(100 件 cap の簡易 pre-readback)の totalCount 不一致 fail-closed 挙動に対する回帰テストを追加した。executor 側の全ページ cursor traversal との読み取り経路統合(単一 canonical reader 化)は、既存の広範な呼び出し契約・テストへの影響が大きいため本 iteration では見送り、follow-up 課題として残すapplied_with_receipt_loss/failed_no_mutation/failed_after_mutation)よう修正した。また native relationship のみが適用され title/body が不変のケースで、トップレベル結果がno_changeを返していた挙動を、native lane がattemptedならok/mutation_started: trueを返すよう修正したlive_canary_full_relationship_cycle.shに parent rebind(導入: AIエージェント運用をminimal harnessへ縮退し、過剰なcontrol-planeを廃止する #1860 → counterpart)・blocking add・blocking remove を追加し、7 step(parent null→導入: AIエージェント運用をminimal harnessへ縮退し、過剰なcontrol-planeを廃止する #1860→counterpart→null、blockedBy add/remove、blocking add/remove)の full cycle に拡張した。各 step 後に独立 readback(gh api graphql直接呼び出し)を追加した。既知の限界: 本 canary は引き続きcontrolled_skill_mutation_exec.pyを直接呼び出しており、edit_issue_txn.pyの combined transaction(P0-1/P0-2/P1-7 の content-lane 順序修正)を経由していない。これを解消するには readinessgoを確実に満たす disposable Issue body fixture の整備が必要で、follow-up とするexpected_previous_updated_atprecondition に fresh な値を使うよう修正した。再読取で title/body の concurrent drift を検出した場合はfailed_after_mutationで停止するgh 2.88.1に該当フラグがない」から、2026-08-01 時点で再検証した現行ghCLI(2.94.0 系)の capability(--parent/--add-blocked-by系フラグ・parent/blockedBy/blockingJSON フィールドは存在するが、content update と relationship update の実行順序・並列 semantics が saga 契約に適合しない)へ更新したCheck Japanese Content(non-required)は本 PR body でaggregate_ratioが閾値未達(英語中心の検証コマンド表・受け入れ条件チェックリストが prose block として判定されるため)で failing であることを明記する。全 required CI job は green回帰テストを 20 件超追加した(
test_edit_issue_txn.pyに 15 件、test_controlled_skill_mutation_exec.pyに 5 件)。詳細は下記「検証コマンド結果」参照。実装内容
ISSUE_EDIT_TXN_INPUT_V1を既存 status enum・schema catalog を再利用したまま後方互換 additive 拡張し、任意フィールドnative_relationships(expected_before/parent.action/add_blocked_by/remove_blocked_by/add_blocking/remove_blocking)を追加した。省略時は pre-実装: edit-issue transaction に GitHub native 親子・依存関係の同期と readback を追加する #1883 の body/comment-only 挙動と完全に同一(既存 20 テスト全 PASS で確認済み)issue_relationship.updateをscripts/agent-guards/controlled_skill_mutation_policy.py/controlled_skill_mutation_exec.pyに追加した。PR 実装: GitHub native dependency 解除の controlled executor を追加する #1667(issue_dependency.remove)の actor binding/全ページ pagination/no-retry/post-readback パターンを踏襲している。caller は GraphQL query/REST path/hostname/argv を渡せない(AC13、static test で確認)gh 2.88.1)の capability 再確認ではgh issue edit --helpに--parent/--add-blocked-by系フラグなし、gh issue view --jsonにparent/blockedBy/blockingフィールドなしだった。2026-08-01 時点で再検証したところ、現行の公式ghCLI(2.94.0 系)はgh issue editに--parent/--remove-parent/--add-blocked-by/--remove-blocked-by/--add-blocking/--remove-blockingを持ち、gh issue view --jsonもparent/blockedBy/blocking/subIssuesを公開している(capability matrix の tested version を更新: 実装開始時gh 2.88.1→ 再検証時gh 2.94.0)。ただし公式実装は content update を先に実行し、relationship update を deferred operation として goroutine 経由で並列実行する設計であり、本 PR が要求する native-first・逐次 operation・completed/pending 判定という saga 契約には適合しない。したがって高水準 CLI への置き換えは行わず、GraphQL 固定 operation(issue_relationship.updatecontrolled executor)を引き続き採用する。説明の力点を「CLI に機能がない」から「現行 CLI に機能はあるが実行順序・並列 semantics が saga 契約に適合しない」へ改訂したexpected_beforedrift 検出 → 祖先サイクル検出 → 順序付き mutation → 全ページ post-readback)を native mutation → content mutation の順で実装し、native mutation 失敗時は content mutation を一切開始しないparentはaddSubIssue(replaceParent: true)/removeSubIssueを、blocked_by/blockingはaddBlockedBy/removeBlockedBy(方向を明示的に区別)を使用するPart of #N/Related/コメント)からの relationship 推測は一切行わない(explicit structured input のみが source of truth。AC7 を static source-scan test で確認)動作検証(Runtime Verification Applicability: immediate)
AC3・AC15 の live canary を disposable Issue を使う一度きりの PR-level integration として実行し、両方 PASS した(cleanup 込み、証跡は
artifacts/1883/issue-metadata/live_canary_*/に保存済み・secrets 非含有)。bash .claude/skills/edit-issue/tests/live_canary_parent_readback.sh→ PASS(disposable [disposable-canary] issue_relationship.update parent readback 20260801T012741Z #1894 で parent set/remove の全ページ相当 readback を確認、cleanup 成功)bash .claude/skills/edit-issue/tests/live_canary_full_relationship_cycle.sh→ PASS(disposable [disposable-canary] issue_relationship.update full cycle subject 20260801T012821Z #1895/[disposable-canary] issue_relationship.update full cycle counterpart 20260801T012821Z #1896 で parent set → blockedBy add → blockedBy remove → parent remove の全サイクルを確認、cleanup 成功)受け入れ条件の達成状況
uv run pytest .claude/skills/edit-issue/tests/test_edit_issue_txn.py -k test_preflight_failure_blocks_all_mutation→ PASS(1 passed)uv run pytest .claude/skills/edit-issue/tests/test_edit_issue_txn.py -k test_native_mutation_failure_blocks_content_update→ PASS(1 passed)uv run pytest .claude/skills/edit-issue/tests/test_edit_issue_txn.py -k test_native_parent_set_and_remove_readback→ PASS(2 passed)/live canarybash .claude/skills/edit-issue/tests/live_canary_parent_readback.sh→ PASS(disposable Issue [disposable-canary] issue_relationship.update parent readback 20260801T012741Z #1894 で parent set/remove の全ページ相当 readback を確認、cleanup 成功、証跡はartifacts/1883/issue-metadata/live_canary_*/に保存済み)uv run pytest .claude/skills/edit-issue/tests/test_edit_issue_txn.py -k test_native_blocked_by_add_remove_full_pagination_exact_set→ PASS(1 passed)uv run pytest .claude/skills/edit-issue/tests/test_edit_issue_txn.py -k test_native_blocking_add_remove_full_pagination_exact_set→ PASS(1 passed)uv run pytest .claude/skills/edit-issue/tests/test_edit_issue_txn.py -k test_final_readback_all_fields_match_required_for_ok→ PASS(1 passed)uv run pytest .claude/skills/edit-issue/tests/test_edit_issue_txn.py -k test_prose_mentions_do_not_set_native_relationships→ PASS(1 passed)uv run pytest .claude/skills/edit-issue/tests/test_edit_issue_txn.py -k test_identical_desired_state_is_idempotent_no_op→ PASS(1 passed)uv run pytest .claude/skills/edit-issue/tests/test_edit_issue_txn.py -k test_partial_native_mutation_returns_failed_after_mutation→ PASS(1 passed)uv run pytest .claude/skills/edit-issue/tests/test_edit_issue_txn.py -k test_capability_preflight_missing_blocks_as_environment_not_write_permission_proof→ PASS(1 passed)uv run pytest .claude/skills/edit-issue/tests/test_edit_issue_txn.py -k test_destructive_remove_blocked_by_expected_before_drift_fails_no_mutation→ PASS(1 passed)uv run pytest .claude/skills/edit-issue/tests/test_edit_issue_txn.py -k test_graph_invariant_violations_rejected_before_mutation→ PASS(3 passed)uv run pytest scripts/agent-guards/tests/test_controlled_skill_mutation_policy.py -k relationship→ PASS(29 passed、caller が任意 GraphQL query/REST path/hostname/argv を渡すパスが存在しないことを static test で確認済み)uv run pytest .claude/skills/create-issue/tests/test_create_issue_txn.py -k parent→ PASS(70 passed、既存 parent/dependency 登録テストに regression なし)bash .claude/skills/edit-issue/tests/live_canary_full_relationship_cycle.sh→ PASS(disposable Issue [disposable-canary] issue_relationship.update full cycle subject 20260801T012821Z #1895/[disposable-canary] issue_relationship.update full cycle counterpart 20260801T012821Z #1896 で parent set → blockedBy add → blockedBy remove → parent remove の全サイクルを実 GitHub API で確認、cleanup 成功、証跡はartifacts/1883/issue-metadata/live_canary_*/に保存済み・secrets 非含有)uv run pytest .claude/skills/edit-issue/tests/test_edit_issue_txn.py -k test_body_parent_rebind_updates_native_parent_1679_fixture→ PASS(1 passed、実装: implement-issue / open-pr の production path から peer OPEN Issue overlap preflight を撤去する #1679 相当の parent rebind fixture で native parent も同時更新されることを確認)検証コマンド結果
pnpm typecheckpnpm lintpnpm testpnpm builduv run pytest .claude/skills/gemini-cli-headless-delegation/tests/test_model_routing.pyuv run pytest .claude/skills/edit-issue/tests/test_edit_issue_txn.pyuv run pytest scripts/agent-guards/tests/test_controlled_skill_mutation_policy.pyuv run pytest scripts/agent-guards/tests/test_controlled_skill_mutation_exec.pyuv run pytest .claude/skills/create-issue/tests/test_create_issue_txn.py -k parent(AC14 regression)bash .claude/skills/edit-issue/tests/live_canary_parent_readback.sh(AC3 live)bash .claude/skills/edit-issue/tests/live_canary_full_relationship_cycle.sh(AC15 live)uv run ruff check scripts/ .claude/skills/edit-issue/ .claude/skills/create-issue/Issue 本文の AC ごとの Verification Command は個別に
-kフィルタで実行確認済み(AC1〜AC16 すべて PASS)。CI 状態(正直な申告)
全 required CI job(
typecheck/lint/test/build/python-test/python-test-core/e2e等)は green。PR Body Japanese Check(non-required)は本 PR body の英語中心の検証コマンド表・受け入れ条件チェックリスト prose block がaggregate_ratio閾値未達で failing。「全 workflow green」ではなく「全 required workflow green、non-required の PR Body Japanese Check は failing」が正確な状態。Allowed Paths 準拠
変更ファイルはすべて Issue #1883 の Allowed Paths 内。
.claude/skills/create-issue/scripts/create_issue_txn.pyと.claude/skills/create-issue/tests/は Allowed Paths に含まれるが、既存実装で意味論を破壊せず再利用する必要が見出せなかったため変更していない(既存 parent/dependency 登録テストは無変更で全 PASS = AC14 regression なし)。Overlap Preflight(advisory、#1860 Owner Decision)
check_implementation_overlap.py --issue-number 1883の route はhuman_review_required(candidates は 0 件、source.complete: true/saturated: false)。#1860 Owner Decision によりこの route は advisory であり実装・PR 作成を停止しない。Stop Conditions 該当なし
Allowed Paths 外の変更、新規 Issue 起票の必要性、controlled executor 境界を拡張せずに relationship mutation を実装する必要、live canary の environment blocked / permission denied はいずれも発生しなかった。