fix(autopilot): sync GitHub issue close state with Project Close (#843)#844
Merged
Conversation
merge 済みでも GitHub issue の close 状態と Project の Close ステータスが乖離する 2 方向の不整合を 整合させる(非デフォルト base 宛て PR / EPIC で顕在化)。 Fix A: applyMergeProgression が leaf を Close へ前進させたら project.closeIssue で GitHub issue も 明示 close(gh issue close・冪等)。非デフォルト base 宛て PR で Closes #N 自動 close が効かない件に対応。 Fix B: tick に applyClosedReconcile を追加。listClosedIssueNumbers で closed issue 集合を取り、 純粋関数 selectClosedToReconcile で closed かつ非終端(Close/Done 以外)の item を Status=Close + AI Status クリアへ整合(EPIC・人手 close も対象)。running 中は触らず冪等。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Author
🤖 autopilot status
Linked issue #843. Maintained by autopilot (single writer); do not edit. |
Fix A/B の挙動を README の merge-progression 節に追記(DoD)。
Author
🤖 autopilot 敵対的レビュー(#843)実装を別視点で批判的にレビューしました。重大な問題なし。 自分で 1 件対応済み、人間レビューへ渡します。 確認した点(良好)
自分で対応(1 件)
非ブロッキングな指摘(人間の判断に委ねます)
|
takaokouji
approved these changes
Jun 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
merge 済みでも GitHub issue の close 状態と Project の Close ステータスが乖離する 2 方向の不整合を整合させる(非デフォルト base 宛て PR / EPIC で顕在化。#738 / #839 / #840 で実際に発生し手動整合した)。
Changes Made
Fix A — merge-progression が GitHub issue も close する
project.closeIssue(repo, issue, token)を新設(gh issue close。既に closed なら no-op で冪等)。applyMergeProgressionが leaf を Close へ前進させたら GitHub issue も明示 close。非デフォルト base 宛て PR(EPIC サブ)でCloses #N自動 close が効かない件に対応。Fix B — 「closed issue → Project Status=Close」整合パス
project.listClosedIssueNumbers(repo, token)を新設(gh issue list --state closed --json number→Set。gh project item-listの content には state が無いため別経路)。selectClosedToReconcile(items, closedSet): issue が closed かつ Project Status が Close/Done(終端) でない item を返す(EPIC も対象)。applyClosedReconcileを tick に追加: 対象に Status=Close + AI Status クリアを適用。running 中は触らない。list 取得失敗・個別失敗は他を止めない。両 Fix で「GitHub issue 状態 ⇄ Project Close」が双方向に整合する。
Test Coverage
selectClosedToReconcile/TERMINAL_STATUSESの node:test(EPIC 包含・終端 skip・配列/Set 受理・空入力)。listClosedIssueNumbers/closeIssueの I/O テスト(gh 引数注入)。applyMergeProgressionが GitHub issue も close すること / gh close 失敗がループを止めないこと。applyClosedReconcile(EPIC 含む整合・running skip・list 失敗の no-op・個別失敗の隔離)。cd tools/autopilot && node --test→ 139 tests, 0 fail。Related Issues
Closes #843