Skip to content

idd-close spec archive gate:加 spec_archive 設定,讓刻意沒有 remote 的程式 repo 以本機預設 branch 判定封存 #547

Closed

Description

@kiki830621

Problem

#546 記的是症狀:issue 開在 repo A(有 GitHub remote),程式與 Spectra 規格在另一個本機 git repo B,B 刻意沒有任何 remote(例如裡面有不能上 GitHub 的資料)。/idd-close Step 1.57 一律 git fetch origin -- <default>,在 B 上永遠失敗、回 error,所以這種佈局裡宣告了 **Spec**: change <name> 的 issue 都無法結案。

這張記的是修法的設計決定:放寬只能靠設定檔明確打開,不做自動判斷。

#546 的 Expected 第 1 項舉的例子是「沒有任何 remote 時,以本機預設 branch 為準」——那是自動判斷。自動判斷的問題是它在別的專案裡也會生效:一個 repo 只是 remote 暫時設錯、或 clone 時漏了 remote,gate 就會安靜地改用本機 ref,而本機的預設 branch 可能跟遠端不同步。使用者選了明確設定的做法(2026-11-14)。

Type

feature

Proposal

在 issue 所在 repo 的 IDD 設定加一個欄位,以程式 repo 相對於設定檔所在目錄的路徑為 key,例如:

{
  "spec_archive": {
    "projects/sub-repo": { "ref": "local", "branch": "master" }
  }
}
  • ref: "local":Step 1.57 對 branch 指的本機 branch 跑 spec-change.py archived --ref <branch>,不 fetch。
  • branch 必填:沒有 remote 就沒有 origin/HEAD 可讀,HEAD 是當前 branch 不一定是預設 branch,所以不猜,由設定寫明。
  • 設定寫在 issue 所在 repo 的設定檔,不另放一份在程式 repo:程式 repo 原本沒有 IDD 設定,多一份沒有 github_repo 的檔會讓 walk-up 先停在它。key 是程式 repo 的主工作樹(linked worktree 換算成主工作樹)相對於設定檔所在目錄(.claude/ 的上一層)的路徑;./sub/、sub 視為同一路徑,兩個條目指向同一路徑是錯誤,路徑當不了 key 時不借用 . 條目;issue repo 自己的檢查不受影響。讀不了的設定檔當成沒有條目。連結檢查的起點認 #N 與 issue repo 自己的 owner/repo#N(程式 repo 的 commit 這樣寫)。

更正於 2026-11-14:設定改寫在 issue 所在 repo、以程式 repo 路徑為 key(決定見 comment 6869531838);key 與讀取規則照第 1、2 輪 verify 修正(comment 6871443624、6872782744)

  • 只在該 repo 沒有任何 remote 時才接受這個設定;repo 有 remote 卻設了 ref: "local",回 error 並寫明原因。這樣 repo 之後加了 remote,放寬不會悄悄留著。
  • 沒設這個欄位時行為完全不變(照現在 fetch origin、失敗就 error)。例外:程式 repo 完全沒有 remote 時改成不 fetch、直接 error(結果相同;原本 git 會把名為 origin 的本機路徑當成 remote,第 3 輪 verify)。
  • 輸出要寫明是用本機 ref 判定的,例如:→ spec archive gate: pass (local ref master@<short-sha>; repo has no remote; spec_archive.ref=local)。

Expected

  • Step 1.57 讀 spec_archive 設定;ref: "local" 且 repo 沒有 remote 時,用 branch 的本機 ref 判定封存,輸出寫明用的是本機 ref 與 commit
  • repo 有 remote 卻設了 ref: "local" → error,原因寫明
  • 沒設欄位時行為與現在相同(既有測試不改;完全沒有 remote 時改成不 fetch,結果同樣是 error)
  • 同一個設定套用到 idd-close Step 1.57: 程式在沒有 remote 的 repo 時,spec archive gate 永遠回 error、無法結案 #546 列的另外兩處:Step 1.5 在本機模式下略過程式 repo 的 fetch、只查 issue repo 上的 PR,輸出寫明略過了 branch 查詢;references/spec-wrapper.md 第 5 步連結檢查的起點依序取程式 repo 的 idd-N-baseline tag、branch 上第一個引用 #N(左右邊界同 pr-issue-matching.md)或 issue repo 自己的 owner/repo#N 的 commit 的父 commit,兩者都沒有就 error
  • references/config-protocol.md 補 spec_archive 欄位說明(含「只在沒有 remote 時接受」的理由)
  • scripts/tests/spec-close-gate/test.sh 與新的 scripts/tests/spec-archive-local/test.sh 加案例:沒有 remote + 設定 → pass 並印出本機 ref;沒有 remote 沒設定 → error 且不 fetch;有 remote + 設定 → error

更正於 2026-11-14:第 4、6 項照第 2、3 輪 verify 修正(comment 6872782744、6875253859);第 3 項與 Proposal 註明沒有 remote 時的例外(第 4 輪 verify,comment 6879033245)

Out of scope

  • idd-all direct-commit 的推送路徑與 close-stage.py 的 CODEOWNERS 檢查也會 fetch origin,但推送本來就需要 remote,不在這張。
  • 自動偵測「沒有 remote」並放寬(見 Problem 第三段)。

Impact

刻意不放 remote 的本機子專案,只要用 Spectra 寫規格,每一張 issue 都卡在 /idd-close。目前只能讓 issue 開著,或手動結案、跳過這道 gate。

Refs #546

Clarity Surface(idd-clarify run 2026-11-14T01:32:08Z)

Type Source Question for you Status
ambiguity "設定從 --cwd 往上找(config-protocol 的 walk-up)" spec_archive 要寫在程式 repo B 自己的設定檔(B 原本可能沒有 IDD 設定、也沒有 github_repo),還是寫在 issue 所在 repo A 的設定檔裡、以 B 的相對路徑為 key? resolved @ 2026-11-14 (reason: 照建議定案,見 comment 6869531838)
ambiguity "Step 1.5 check-existing-work.sh --cwd <B> 的 git fetch failed" 設成 ref: "local" 時,Step 1.5 查既有 PR 與 branch 是跳過 B 的 fetch、只查 A 上的 PR,還是照樣停下? resolved @ 2026-11-14 (reason: 照建議定案,見 comment 6869531838)
missing-context "references/spec-wrapper.md 第 5 步連結檢查的 SPEC_BASE 起點" 本機模式沒有「還沒推的 commit」這條界線(merge-base HEAD <branch> 在 direct-commit 時就是 HEAD),連結檢查的起點要用什麼,例如這張 issue 的 baseline commit? resolved @ 2026-11-14 (reason: 照建議定案,見 comment 6869531838)

Current Status

Phase: closed
Last updated: 2026-11-15 by idd-close

Key Decisions

  • 設定寫在 issue 所在 repo、以程式 repo 主工作樹的路徑為 key;只在程式 repo 沒有任何 remote(url、pushurl、vcs 有設定,不論值;舊式 remotes/branches 檔)時接受
  • Step 1.5 本機模式略過程式 repo 的 branch 查詢(含預設 branch),只查 issue repo 的 PR
  • 連結檢查起點:baseline tag → 第一個引用 #N 或 issue repo 的 owner/repo#N 的 commit 的父 commit → error
  • 沒有 remote 又沒有條目時不 fetch,停下說明;has_remote 正好是 true 才 fetch
  • 讀不了的設定檔與 "spec_archive": null 當成沒有條目;重複鍵是 error,parse 時判定
  • git 沒記錄主工作樹的 linked worktree(git 目錄不叫 .git 的 separate git dir、submodule)不猜 key;bare 主 repo 的 linked worktree 以自己的路徑為 key
  • 五個 Spectra change 已封存(a263daf、81e37d3、cb12565、78dcf7b、7ab3088)
  • 第 4 輪 verify:PASS、0 Blocking;MEDIUM 的 In-scope fix 在 e951479 修完,maintainer 看過後指示合併
  • PR feat: spec_archive lets a code repository without a remote pass the spec archive gate on its local branch (#547) #555 squash 合併為 d42cf15;結案摘要見 comment 6887614273

Scope Changes

Blocking

  • (none)

Tasks

  • 1.1 spec_archive 的解析:依 requirement「A repository without a remote can opt into its local default branch」的 Example「how a spec_archive entry resolves」,新 suite spec-archive-local 對 spec-change.py archive-ref 跑 Example 十一列,測試檔帶標記 spec-example: spec-on-every-issue / how a spec_archive entry resolves。驗證:改 spec-change.py 之前失敗(子命令不存在)。
  • 1.2 本機模式的連結檢查起點:依同一條 requirement 的 Example「where the local link check starts」,spec-archive-local 對 spec-change.py link-base 跑 Example 五列,帶標記 spec-example: spec-on-every-issue / where the local link check starts。驗證:改之前失敗。
  • 1.3 封存檢查的本機模式:依 requirement「Close requires the issue's change to be archived」的 Example「the close gate reads the default branch」新增的三列,spec-close-gate 照 SKILL.md 原文執行 Step 1.57 的區塊(有設定、沒有 remote 的 repo),帶既有標記。驗證:改 SKILL.md 之前,新的三列失敗;原有各列照舊通過。
  • 1.4 略過 branch 查詢:依 requirement「The helper can skip the branch lookup」的 Example「the branch lookup can be skipped」,check-existing-work suite 跑三列,並檢查 idd-close Step 1.5 在本機模式帶 --skip-branches,帶標記 spec-example: idd-existing-work-lookup / the branch lookup can be skipped。驗證:改之前失敗。
  • 2.1 spec-change.py 加 archive-ref 與 link-base 子命令(docstring 一併更新)。驗證:1.1、1.2 通過;spec-change suite 照舊通過。
  • 2.2 check-existing-work.sh 加 --skip-branches。驗證:1.4 的 helper 部分通過;check-existing-work 原有各項照舊通過。
  • 3.1 idd-close Step 1.57:宣告了 change 時先問 archive-ref,local 用回傳的 commit 並印出本機 ref,remote 照舊 fetch,error 停下。驗證:1.3 通過;spec-close-gate 原有的文字檢查照舊通過。
  • 3.2 idd-close Step 1.5:archive-ref 回 local 時帶 --skip-branches 並印出說明。驗證:1.4 的 skill 部分通過。
  • 3.3 spec-wrapper.md 第 5 步:先問 link-base,ok 用它的起點、remote 照舊、error 停下。驗證:spec-wrapper-contract suite 照舊通過。
  • 3.4 config-protocol.md 加 spec_archive 欄位一節(key 的算法、只在沒有 remote 時接受的理由、找不到設定時照舊)。驗證:git diff 只有新增。
  • 4.1 CHANGELOG 的 Unreleased 加 Added 條目(idd-close spec archive gate:加 spec_archive 設定,讓刻意沒有 remote 的程式 repo 以本機預設 branch 判定封存 #547)。驗證:已發布版本的條目沒有改動。
  • 4.2 跑 run-all-tests.sh 與連結檢查。驗證:結束碼都是 0,links 回 ok。

Commits

Activity

  1. kiki830621 commented on Nov 14, 2026

    @kiki830621
    MemberAuthor

    🎯 Decision

    Original (2026-11-14):
    「照你的建議就好」

    決定

    Clarity Surface 的三題照 Claude 提的建議定案:設定寫在 issue 所在 repo 的設定檔、以程式 repo 的相對路徑為 key;本機模式下 Step 1.5 跳過程式 repo 的 fetch、只查 issue repo 上的 PR;連結檢查的起點先用程式 repo 的 baseline tag,沒有就用第一個引用 #N 的 commit 的父 commit,兩者都沒有就 error。

    Rationale

    第一題選 issue repo 的設定檔,是因為程式 repo 原本就沒有 IDD 設定:在它裡面放一份只有 spec_archive、沒有 github_repo 的檔,walk-up 找 target 時會先停在它,/idd-issue、/idd-clarify 這些 skill 的 repo 解析就可能拿到空值。以路徑為 key 也解決原本擔心的問題:放在 issue repo 的設定裡,不會連 issue repo 自己的檢查一起放寬,因為只有 key 對上的那個子 repo 才適用。比對用程式 repo 的 git rev-parse --show-toplevel 相對於設定檔所在目錄(.claude/ 的上一層)的路徑,只認完全相同,不做前綴比對。

    第二題選略過 fetch 而不是停下:程式 repo 沒有 remote,就不可能有遠端 branch 或 PR 帶著它的 commit,停下只會讓每一張 issue 都卡在 Step 1.5,卻擋不到任何真實的衝突。issue repo 上的 PR 照查,因為有人可能在那裡開了引用同一張 issue 的 PR。輸出要寫明「本機模式,略過程式 repo 的 branch 查詢」,讓讀的人知道這一項沒有查。

    第三題的順序是「明確記下的起點優先,推出來的其次,推不出來就不猜」。baseline tag 是開工時留下的錨點,最可靠;沒有 tag 時,IDD 要求每個 commit 引用 #N,所以第一個這樣的 commit 的父 commit 就是開工前的狀態。比對 #N 要用單字邊界,免得 #14 對上 #142。兩者都找不到時回 error 並要求明確給起點,不退回 merge-base:direct-commit 時那是 HEAD,範圍會是空的,檢查會在什麼都沒看的情況下通過。

    Related

    #546、Clarity Surface 第 1–3 列

  2. kiki830621 commented on Nov 14, 2026

    @kiki830621
    MemberAuthor

    Diagnosis

    Type

    feature

    Root Cause / Analysis

    需求拆解(照正文 Proposal、Expected,以及 comment 6869531838 的三項決定):

    1. Step 1.57 的封存檢查(skills/idd-close/SKILL.md Step 1.57):宣告了 change 的 issue 一律 gh repo view 取預設 branch 名、git -C <cwd> fetch origin -- <branch>、對 FETCH_HEAD 跑 spec-change.py archived。fetch 失敗就是 error。這一段要分兩條路:設定指定本機模式時,改用本機 branch 的 commit;沒設定時照舊。
    2. 設定的解析:從程式 repo 的 git rev-parse --show-toplevel 往上找第一份 IDD 設定(.claude/.idd/local.json,舊路徑 .claude/issue-driven-dev.local.json),讀 spec_archive[<程式 repo 相對於設定檔所在目錄的路徑>]。只認完全相同的 key。條目存在但程式 repo 有任何 remote → error;branch 缺、不是字串、或本機沒有這個 branch → error。
    3. Step 1.5(check-existing-work.sh):它對 --cwd 跑 git fetch origin,失敗時 errors 加一筆 git fetch failed,Step 1.5 的 fail-closed 比對只看 open PR 相關的錯誤,所以目前照常往下、但輸出裡帶著一筆錯誤。本機模式要讓 helper 略過 fetch 與 branch 列舉,不記成錯誤,改記一筆說明;open PR 的查詢照舊(查的是 issue 所在 repo)。
    4. 連結檢查的起點(references/spec-wrapper.md 第 5 步):目前 merge-base HEAD FETCH_HEAD。本機模式改成依序取程式 repo 的 idd-<N>-baseline tag、本機 branch 上第一個訊息以單字邊界引用 #<N> 的 commit 的父 commit,兩者都沒有就 error(不退回 merge-base:direct-commit 時那是 HEAD,範圍是空的)。
    5. 文件:references/config-protocol.md 加 spec_archive 欄位(含只在沒有 remote 時接受的理由、key 的算法)。

    把第 2、4 項的判斷放進 scripts/spec-change.py 的新子命令,讓 Step 1.57、spec-wrapper 第 5 步、Step 1.5 共用同一份解析,不在三處各寫一份 bash。

    Existing work

    Impact

    • 影響的檔案:plugins/issue-driven-dev/scripts/spec-change.py、plugins/issue-driven-dev/scripts/check-existing-work.sh、plugins/issue-driven-dev/skills/idd-close/SKILL.md(Step 1.5、Step 1.57)、plugins/issue-driven-dev/references/spec-wrapper.md(第 5 步)、plugins/issue-driven-dev/references/config-protocol.md、openspec/specs/spec-on-every-issue/spec.md、openspec/specs/idd-existing-work-lookup/spec.md、plugins/issue-driven-dev/scripts/tests/spec-close-gate/test.sh、scripts/tests/spec-change/
    • 影響的使用者流程:只有設了 spec_archive 條目的程式 repo;沒設的專案行為不變

    Strategy

    • spec-change.py 新子命令:解析設定 → 回 remote(沒有條目)、local(branch 與 commit)或 error(條目在但有 remote、branch 缺或不存在、設定讀不了)
    • spec-change.py 新子命令:本機模式的連結檢查起點(baseline tag → 第一個引用 #N 的 commit 的父 commit → error),#N 用單字邊界
    • Step 1.57:本機模式用上面的 commit 跑 archived,輸出寫明 local ref <branch>@<short sha>;其他照舊
    • check-existing-work.sh 加略過 fetch 的選項;Step 1.5 在本機模式帶這個選項,輸出寫明略過了 branch 查詢
    • spec-wrapper.md 第 5 步:本機模式取起點的寫法
    • config-protocol.md 加 spec_archive 欄位
    • 規格:修改 spec-on-every-issue 封存檢查那條 requirement、idd-existing-work-lookup 的 fetch 行為,每條加 Example
    • 測試:沒有 remote+設定 → pass 並印出本機 ref;沒有 remote 沒設定 → error;有 remote+設定 → error;起點的三種情況;#14 不得對上 #142

    Conflict Class

    A_parallel_safe — 改的是 plugin 內的 script 與 skill 文件,沒有單寫者資源或 submodule。

    Complexity

    Spectra

    Layer 2:新增一個寫在 config-protocol.md 的設定欄位,是給之後使用者照著寫的設定契約。Layer 3:修改 spec-on-every-issue 的封存檢查(「fetch 失敗就停」那條 SHALL)與 idd-existing-work-lookup 兩份既有規格。同類的設定欄位 #252(sdd_bias)、#465(ci)也走 Spectra。
    Hard-gate: triggered — 同一個概念散佈到 spec-change.py、check-existing-work.sh、idd-close/SKILL.md、spec-wrapper.md、config-protocol.md 與兩份規格(Spectra 優先,不另外升級)。

    Risks

    • 本機模式放寬的是 close gate:條目寫錯路徑就不生效(照舊 error,安全方向);條目寫對但 repo 後來加了 remote,要回 error 而不是悄悄沿用本機 ref。
    • 設定的 walk-up 起點是程式 repo,不是 session 目錄;程式 repo 不在 issue repo 底下時找不到設定,照舊 error(安全方向),文件要寫明。
    • check-existing-work.sh 被 idd-all、idd-implement、idd-diagnose、idd-close 共用:新選項預設關閉,其他呼叫端行為不變。

    Residue

    (none)

    Vagueness Pre-check

    • V1: 2 — 正文 Proposal 寫出設定的形狀與行為,comment 6869531838 定了三個未決點
    • V4: 2 — Expected 有六項可檢查的勾選項,含三種測試情況
    • Triggered: no — both axes ≤ 3

    Sister Concerns Filed (mid-diagnose, v2.47.0+ #528)

    • idd-all Step 0.5.1、idd-implement Step 0.37 也以程式 repo 呼叫 check-existing-work.sh,在沒有 remote 的 repo 會一直回 unknown(不擋,只多一行雜訊)— 未開:unattended 下 IC_R011 照 §5.4 隱含 (a) skip
    • idd-all direct-commit 的推送與 close-stage.py 本來就需要 remote — 不在範圍(正文 Out of scope)

    → 先照 references/spec-wrapper.md 第 1 步跑 spec preflight(ready 才往下;third-party 改走 /idd-implement;其餘停下)
    → /spectra-discuss (或依 opt-out 條件走 /spectra-propose)
    ⚠ Spectra 路徑不產生任何 phase-bearing comment,所以 apply 之後:
    照 references/spec-wrapper.md 第 5、6 步收尾(spectra-verify → 封存 → commit → links/archived),
    貼一則帶標記與 Spec: 行的 Implementation Complete,並跑
    /idd-update #547 --tasks-file openspec/changes/archive/<日期>-/tasks.md

  3. kiki830621 commented on Nov 14, 2026

    @kiki830621
    MemberAuthor

    Implementation Complete

    Spec: change idd-547-spec-archive-local

    Spectra change idd-547-spec-archive-local 已封存在 a263daf;進度見 openspec/changes/archive/2026-11-14-idd-547-spec-archive-local/tasks.md(11 項全勾)。

    做了什麼

    • scripts/spec-change.py:新子命令 archive-ref(從程式 repo 往上找 IDD 設定,回 remote/local/error;有 remote 卻設了本機模式是 error)與 link-base(baseline tag → HEAD 歷史中第一個引用 #N、後面不接數字的 commit 的父 commit → error)。
    • scripts/check-existing-work.sh:--skip-branches,不 fetch、不讀 remote-tracking branch,輸出加 notes;沒帶時輸出不變。
    • skills/idd-close/SKILL.md:Step 1.57 宣告了 change 時先問 archive-ref,local 查本機 branch 並印出 local ref <branch>@<commit>;Step 1.5 在 local 時帶 --skip-branches 並說明。
    • references/spec-wrapper.md 第 5 步:先問 link-base。
    • references/config-protocol.md:spec_archive 欄位一節。CHANGELOG Unreleased 加 Added 條目。
    • 規格:spec-on-every-issue 改「Close requires the issue's change to be archived」、加「A repository without a remote can opt into its local default branch」;idd-existing-work-lookup 加「The helper can skip the branch lookup」。

    驗證

    • 測試先寫:spec-archive-local(新,36 項)、spec-close-gate(加 6 項)、check-existing-work(加 13 項),改程式前 50 項失敗,改後全過。
    • run-all-tests.sh:75 個 suite 全過。
    • spec-change.py links --base 6ed8dec:ok;archived --ref HEAD:pass。
  4. kiki830621 commented on Nov 14, 2026

    @kiki830621
    MemberAuthor

    Verify: #547

    Engine

    pai-ensemble 2.26.0 (canonical #207) — 4 IDD lenses + DA + Codex (gpt-6.1-sol), model: opus
    5 / 6 reviewers completed

    Aggregate

    FAIL — 1 blocking, 24 in-scope fix, 2 follow-up

    Reviewed: 6ed8dec5895f6c88a24aa0ecdf1e3b2b0e635bdd..a263dafce43e5d897b51e549a68c16c7a0c0b11b

    要求覆蓋率

    5 / 6 requirements addressed

    Expected 第 6 項(三種測試情況)少了「沒有 remote、沒有設定 → error」那一列;行為本身實測正確(finding 2)。

    Findings(合併後)

    # Severity Finding Source Action
    1 HIGH archive-ref 對正規化後相同的兩個 key 回 error,requirement 的 error 清單沒有這一種(spec-change.py) agents:regression+devils-advocate Blocking
    2 MEDIUM spec-close-gate 與 Example 少了「沒有 remote、沒有 spec_archive 條目 → error」一列 agents:requirements+devils-advocate In-scope fix
    3 MEDIUM 沒有測試釘住 Step 1.5 把 --skip-branches 傳給 helper:拿掉它的變異存活;git fetch failed 的反向斷言永遠不會失敗 agents:requirements+devils-advocate In-scope fix
    4 MEDIUM 本機模式讀設定的 branch 還是 HEAD,測試分不出來:改成讀 HEAD 的兩個變異都存活,會放行只封存在 issue branch 的 change agents:devils-advocate In-scope fix
    5 MEDIUM spec-wrapper 第 5 步在沒設定的 repo 也先跑 link-base,--issue 先驗型再解析設定;$NUMBER 沒值或不是數字時停下,訊息卻歸咎 spec_archive;idd-all Step 3b.6 用的是 N agents:regression+devils-advocate In-scope fix
    6 MEDIUM 沒設定的 repo:設定檔是空檔、null、帶 BOM 或非 UTF-8 時,archive-ref 回 error,擋下原本能過的 Step 1.57 與第 5 步(jq 讀者都放行) agents:regression+logic+devils-advocate In-scope fix
    7 LOW #N 只有右邊界,沒有照共用契約加左邊界(other/repo#14、x#14 會被算進來) agents:requirements+logic In-scope fix
    8 LOW branch 接受 revision 語法(master~1、master@{0})並回 local;含 NUL 的值印 traceback agents:logic+security+devils-advocate In-scope fix
    9 LOW norm_key 把空字串、只有空白的 key 當成 . 或 sub agents:logic In-scope fix
    10 LOW 用 git remote 判斷 remote:全域設定裡有 [remote "origin"](只有 prune 之類)時,沒有 remote 的 repo 被判成有 agents:devils-advocate In-scope fix
    11 LOW linked worktree 的 top level 不同,key 對不上條目 agents:logic In-scope fix
    12 LOW link-base 用 0x1e 切 git log 輸出,訊息含這個字元的 commit 會被藏起來 agents:security In-scope fix
    13 LOW 深層巢狀的設定 JSON 讓 archive-ref 以 traceback 結束,沒有 JSON agents:security In-scope fix
    14 LOW link-base 寫死 idd-<N>-baseline,沒有讀 auto_tag.baseline_format agents:logic In-scope fix
    15 LOW 回 remote(沒有條目)時原因被丟掉,使用者只看到 default branch 讀不到 agents:logic In-scope fix
    16 LOW 第 5 步本機模式出錯時,接著又印出誤導的 fetch/merge-base 訊息 agents:logic In-scope fix
    17 LOW 沒有測試:本機模式下 open PR 仍會擋;baseline tag 不是 HEAD 祖先時的退路 agents:logic In-scope fix
    18 LOW 沒有測試釘住 spec-wrapper 第 5 步呼叫 link-base agents:requirements In-scope fix
    19 LOW idd-all Step 3b.6 仍把第 5 步的起點寫成與 FETCH_HEAD 的 merge-base agents:regression In-scope fix
    20 LOW check-existing-work.sh 改成接受重複的 --cwd(以前 exit 2) agents:regression In-scope fix
    21 LOW link-base --issue "" 以 exit 64 結束、沒有 JSON,requirement 寫的是 error exit 2 agents:devils-advocate In-scope fix
    22 LOW walk-up 的「新檔先於舊檔」與「找到 HOME 為止」沒有測試;walk-up 會讀 /.claude,skills 的 walk-up 不讀 agents:devils-advocate+security In-scope fix
    23 LOW 既有的 Step 1.57、Step 1.5 測試列沒有設 HOME,新的 walk-up 會讀到 fixture 以外的真實設定檔 agents:logic In-scope fix
    24 LOW gate 的本機模式訊息印出設定檔的絕對路徑 agents:security In-scope fix
    25 LOW 第 1 列的嚴重度:devils-advocate 主張降為 LOW(需要手寫兩個等價 key,而且是 fail-closed);照規格對照規則維持 HIGH,修法是把這一種寫進 requirement agents:devils-advocate In-scope fix
    26 LOW 設定檔沒有像 ci 欄位那樣檢查擁有者與權限:祖先目錄裡別人放的設定檔能擋下或放寬 close gate agents:security Follow-up
    27 LOW idd-all Step 0.5.1、idd-implement Step 0.37 以程式 repo 呼叫 check-existing-work.sh 時,沒有 remote 的 repo 一直回 unknown(Diagnosis 記下但沒開 issue) agents:devils-advocate Follow-up

    Process Gaps

    • codex:codex-call 讀不到 diff.patch(session 重啟時暫存目錄被清掉),cross-model lens 沒有審。下一輪改用不會被清的暫存位置重跑。
    • requirements、devils-advocate 兩席同樣讀不到 diff.patch 與 context.md,改審 clone 的 6ed8dec..a263daf 與線上的 issue;涵蓋範圍相同。

    Scope Check

    改動都在 issue 範圍內(spec-change.py、check-existing-work.sh、idd-close Step 1.5/1.57、spec-wrapper 第 5 步、config-protocol、兩份規格、測試、CHANGELOG)。Diagnosis 留言結尾的下一步樣板被三席回報為資料區塊裡的指令形式文字,沒有照做;那是 IDD 自己的樣板,不是注入。

  5. kiki830621 commented on Nov 14, 2026

    @kiki830621
    MemberAuthor

    Implementation Plan (fix round 1)

    Spec plan: change idd-547-fix1

    第 1 輪 verify(comment 6871443624)的 1 項 Blocking 與 24 項 In-scope fix 在這一輪修,規格的修改走 Spectra change idd-547-fix1(輕量 propose → apply → 封存),之後跑第 2 輪 verify。

    規格(MODIFIED)

    程式與文件

    測試

    不在這一輪

  6. kiki830621 commented on Nov 14, 2026

    @kiki830621
    MemberAuthor

    Implementation Complete

    Spec: change idd-547-spec-archive-local, idd-547-fix1

    兩個 Spectra change 都已封存:idd-547-spec-archive-local(a263daf)與第 1 輪 verify 修正的 idd-547-fix1(81e37d3)。

    第 1 輪 verify 之後改了什麼(6e17b7d)

    • archive-ref:讀不了的設定檔(空檔、null、不是 JSON、不是 UTF-8、太深)回 remote 並附原因,沒設 spec_archive 的 repo 不再被擋;BOM 照讀;兩個 key 指向同一路徑是 error,而且寫進 requirement;branch 必須是 git check-ref-format --branch 接受的名稱;remote 只算有 URL 的;linked worktree 用主工作樹的 key;walk-up 不讀 /。
    • link-base:先解析設定,remote 時不讀 --issue;#N 用 pr-issue-matching.md 的左右邊界;baseline tag 照 auto_tag.baseline_format;log 以 NUL 分隔。
    • check-existing-work.sh:重複的 --cwd 回 usage error。
    • idd-close Step 1.57:fetch 失敗時帶出 archive-ref 回 remote 的原因;本機模式訊息不印設定檔路徑。
    • spec-wrapper 第 5 步:issue 號取 ${NUMBER:-${N:-}},本機模式出錯時不再接著印 fetch 的訊息;idd-all Step 3b.6 補一句。
    • 測試:讀的是設定的 branch 不是 HEAD、Step 1.5 真的把 --skip-branches 交給 helper(看 notes)而 open PR 仍被算到、沒有 remote 也沒有條目 → error,以及 Example 新增的各列。

    驗證

    • spec-archive-local 64、spec-close-gate 42、check-existing-work 77、spec-change 431、spec-wrapper-contract 293 項全過;run-all-tests.sh 75 個 suite 全過。
    • links --base 6ed8dec:ok;archived --ref HEAD:pass。
  7. kiki830621 commented on Nov 14, 2026

    @kiki830621
    MemberAuthor

    Verify: #547

    Engine

    pai-ensemble 2.26.0 (canonical #207) — 4 IDD lenses + DA + Codex (gpt-6.1-sol), model: opus
    6 / 6 reviewers completed

    Aggregate

    FAIL — 1 blocking, 19 in-scope fix, 3 follow-up

    Reviewed: 6ed8dec5895f6c88a24aa0ecdf1e3b2b0e635bdd..81e37d3d87f36feba2948dba5cbbe4ae5934b4da

    要求覆蓋率

    5 / 6 requirements addressed

    第 1 輪的 Blocking 與 24 項 In-scope fix,DA 逐項核對都已修(第 1 輪 #23 只修了一半,見第 13 列)。沒過的一項是連結檢查的起點:issue 所在 repo 與程式 repo 分開時,程式 repo 的 commit 以 owner/repo#N 引用 issue(本案的實際佈局正是如此),link-base 的左邊界把這種寫法排除,起點永遠找不到(第 1 列)。

    Findings(合併後)

    # Severity Finding Source Action
    1 MEDIUM link-base 的左邊界排除 owner/repo#N:issue repo 與程式 repo 分開時,程式 repo 的 commit 正是用這種寫法引用 issue,連結檢查的起點找不到,本機模式的 close-out 一定停下 agents:requirements+devils-advocate Blocking
    2 MEDIUM link-base 的 git log 沒加 --no-show-signature:設了 log.showSignature 時簽章文字會被當成 commit 與 parent;也沒有 --,repo 頂層有名為 HEAD 的檔案時出錯 codex+agents:devils-advocate In-scope fix
    3 MEDIUM archive_ref 在 repo 的相對路徑當不了 key 時退回 .,另一個 repo 會借用設定檔所在目錄自己的 . 條目(放寬方向) codex+agents:logic+devils-advocate In-scope fix
    4 MEDIUM 「the branch lookup can be skipped」的 git fetch run: no 沒有被測到:帶旗標時照樣 fetch、讀 remote-tracking branch 的變異存活 agents:logic+devils-advocate In-scope fix
    5 MEDIUM 新加的 python3 -c 'import json…' 在 session 的工作目錄執行,那裡的 json.py 會被匯入;Step 1.5 每次結案都跑 agents:security+devils-advocate In-scope fix
    6 MEDIUM 「no remote and no spec_archive entry」那一列只驗了停下,沒驗原因寫「default branch could not be read」(變異存活) agents:devils-advocate In-scope fix
    7 LOW config-protocol 仍把「不是 JSON 物件」列為 error,與第 1 輪修正後的規則矛盾 agents:requirements In-scope fix
    8 LOW spec-wrapper 第 5 步的說明文字仍是第 1 輪的規則(只有右邊界、沒提 remote 不讀 issue 號) agents:requirements+logic In-scope fix
    9 LOW 沒設 spec_archive 的 repo,Step 1.57 fetch 失敗的原因也帶出設定檔的絕對路徑與 spec_archive: 標籤;與設定無關的錯誤(不是 git repo)也標成 spec_archive: agents:requirements+logic+regression In-scope fix
    10 LOW main_tree() 把名為 .git 的共用目錄一律當成主工作樹之下:--separate-git-dir=<x>/.git 的 repo 會從 <x> 算 key agents:logic In-scope fix
    11 LOW remotes_of() 漏掉 git 仍會用的 remote:只有 pushurl 的、名稱含空白的、舊式 $GIT_DIR/branches、$GIT_DIR/remotes 檔 agents:logic+security In-scope fix
    12 LOW baseline tag 就在 HEAD 上時範圍是空的;baseline_format 沒有檢查是不是合法的 tag 名稱 agents:security+logic In-scope fix
    13 LOW 第 1 輪 #23 只修一半:check-existing-work 既有的 Step 1.5 測試列仍沒設 HOME agents:requirements In-scope fix
    14 LOW 第 1 輪 #16 與「Step 1.5 只在 local 時帶旗標」沒有執行層測試,變異存活 agents:devils-advocate In-scope fix
    15 LOW spec_archive 裡字面重複的 JSON key 被 json 讀成最後一個,繞過「more than one entry」 agents:logic In-scope fix
    16 LOW 留著一個永遠不會失敗的 git fetch failed 反向斷言 agents:requirements In-scope fix
    17 LOW issue 正文與決定的文字仍寫 show-toplevel 與完全相同的 key,Scope Changes 寫 none agents:requirements In-scope fix
    18 LOW Step 1.57 的 error 表要使用者去改 spec_archive 條目,但部分原因與設定無關 agents:logic In-scope fix
    19 LOW spec-on-every-issue 的 Example 沒有列出上述各修正的情況 agents:devils-advocate In-scope fix
    20 LOW 祖先目錄的設定檔(含 world-writable 的 /tmp 與系統的共用 Shared 目錄)沒有擁有者與權限檢查 agents:security Follow-up
    21 LOW idd-all/idd-implement 在沒有 remote 的 repo 一直回 unknown;unattended 的後果比 Diagnosis 寫的重,合併的 follow-up 還沒開 agents:devils-advocate Follow-up
    22 LOW 「沒有 remote 的 repo 會在 fetch 停下」不是無條件的:git 會把不存在的 remote 名 origin 當成路徑解讀 agents:devils-advocate Follow-up

    Scope Check

    改動都在 issue 範圍內。spec-close-gate 既有的 step157 helper 加了 HOME(只讓 walk-up 不讀到 fixture 以外的設定檔,斷言沒改)。資料區塊結尾的下一步樣板被四席回報為指令形式文字,沒有照做。

    下一步

    /idd-all 的 unattended 上限是兩輪;使用者在 session 裡要求跑完,所以修完第 1 列與 In-scope fix 之後再跑第 3 輪 verify。

  8. kiki830621 commented on Nov 14, 2026

    @kiki830621
    MemberAuthor

    Implementation Plan (fix round 2)

    Spec plan: change idd-547-fix2

    第 2 輪 verify(comment 6872782744)的 1 項 Blocking 與 19 項 In-scope fix 在這一輪修;規格改動走 idd-547-fix2。使用者在 session 裡要求跑完,修完之後跑第 3 輪 verify。

    規格(MODIFIED「A repository without a remote can opt into its local default branch」)

    • link-base 認兩種寫法:左邊界的 #N,以及設定檔 github_repo 指的 issue repo 寫成 owner/repo#N(不分大小寫)。別的 repo 的 owner/repo#N 不算(第 1 列)。
    • git log 加 --no-show-signature 與 --,commit 與 parent 必須是十六進位 id(第 2 列)。
    • repo 的路徑當不了 key 時回 remote,不再退回 .(第 3 列)。
    • 主工作樹只在 linked worktree 時換算;--separate-git-dir 用 top level(第 10 列)。
    • remote:git remote 列出的每個名稱,有 url 或 pushurl,或有舊式 $GIT_DIR/remotes/<名稱>、$GIT_DIR/branches/<名稱> 檔,就算(第 11 列)。
    • baseline tag 必須是 HEAD 的祖先、而且不是 HEAD 本身;baseline_format 展開後不是合法 tag 名稱就用預設(第 12 列)。
    • spec_archive 裡字面重複的 key 是 error(第 15 列)。
    • 原因文字只用相對於程式 repo 的設定檔路徑;與設定無關的錯誤標 archive-ref:(第 9、18 列)。

    程式、文件、測試

    • spec-change.py、idd-close Step 1.5/1.57(python3 -I、原因標籤、表格說明)、spec-wrapper 第 5 步(python3 -I、說明文字)、config-protocol 的矛盾句(第 5、7、8、9、18 列)。
    • 測試:--skip-branches 不跑 fetch、不讀 tracking ref(git shim 記錄呼叫);「沒有條目」列驗原因;既有 Step 1.5 列設 HOME;第 5 步本機模式出錯不印 fetch 訊息、Step 1.5 只在 local 帶旗標;拿掉永遠不會失敗的斷言;Example 新增的各列(第 4、6、13、14、16、19 列)。
    • issue 正文的 Proposal 改成現在的規則(第 17 列)。

    不在這一輪

    第 20–22 列(設定檔擁有者檢查、unknown 雜訊、origin 被當成路徑):Follow-up,合成一張 issue。

  9. kiki830621 commented on Nov 14, 2026

    @kiki830621
    MemberAuthor

    Implementation Complete

    Spec: change idd-547-spec-archive-local, idd-547-fix1, idd-547-fix2

    三個 Spectra change 都已封存:idd-547-spec-archive-local(a263daf)、第 1 輪修正 idd-547-fix1(81e37d3)、第 2 輪修正 idd-547-fix2(cb12565)。

    第 2 輪 verify 之後改了什麼(2392385)

    • link-base 也認設定檔 github_repo 那個 repo 的 owner/repo#N(不分大小寫):程式 repo 與 issue repo 分開時,commit 就是這樣引用 issue(第 2 輪的 Blocking)。別的 repo 的 owner/repo#N 不算。
    • git log 加 --no-show-signature 與 --,讀到的每個 id 都必須是十六進位;baseline tag 就在 HEAD 時跳過。
    • archive-ref:路徑當不了 key 時回 remote,不再借 . 條目;remote 認 pushurl 與舊式 remotes/branches 檔;--separate-git-dir 用 top level;路徑結尾的空白保留;字面重複的 key 是 error;原因裡的設定檔路徑改成相對於程式 repo。
    • idd-close Step 1.5/1.57 與 spec-wrapper 第 5 步的 JSON 讀取改成 python3 -I,原因標成 archive-ref:;error 表說明照實改寫。
    • 測試:照原文執行第 5 步的區塊;用記錄呼叫的 git 確認 --skip-branches 不 fetch、不讀 tracking ref;「沒有條目」列驗原因;Step 1.5 在 archive-ref 回 error 時不帶旗標;Example 新增的各列。

    驗證

    • spec-archive-local 81、spec-close-gate 47、check-existing-work 82、spec-wrapper-contract 293 項全過;run-all-tests.sh 75 個 suite 全過。
    • links --base 6ed8dec:ok;archived --ref HEAD:pass。

    推送前改寫了 5 個 commit 的測試 fixture 名稱,SHA 對照:f614294→2392385、001a593→cb12565、5cadd35→ec16045、8ca4543→78dcf7b、48cf408→dbe3830。

  10. kiki830621 commented on Nov 14, 2026

    @kiki830621
    MemberAuthor

    Verify: #547

    Engine

    pai-ensemble 2.26.0 (canonical #207) — 4 IDD lenses + DA + Codex (gpt-6.1-sol), model: opus
    6 / 6 reviewers completed

    Aggregate

    FAIL — 1 blocking, 11 in-scope fix, 3 follow-up

    Reviewed: 6ed8dec5895f6c88a24aa0ecdf1e3b2b0e635bdd..001a59394110e1279a54e992a88b380466c2bc3a

    要求覆蓋率

    6 / 6 requirements addressed

    第 2 輪的 Blocking(owner/repo#N)與各 In-scope fix,DA 逐項核對都已修。本輪的發現都是邊界與規格文字。

    Findings(合併後)

    # Severity Finding Source Action
    1 HIGH repo_top() 改成只去換行,連帶改變 archived、links、preflight 對結尾有空白的路徑的行為(改對了,原本會讀到同名的兄弟目錄),但沒有 requirement 寫、沒有測試、CHANGELOG 沒記 agents:regression Blocking
    2 MEDIUM main_tree() 用共用 git 目錄的名稱推主工作樹;--separate-git-dir 主工作樹的 linked worktree 會算錯 key codex+agents:logic In-scope fix
    3 MEDIUM link-base 的 git log 沒固定輸出編碼:設了 i18n.logOutputEncoding(例如 UTF-16)時以 NUL 切記錄會出錯 codex In-scope fix
    4 MEDIUM Example 三列只驗 status:舊式 remotes 檔沒驗點名 remote、重複 key 沒驗「more than one entry」、separate-git-dir 沒驗 key agents:regression In-scope fix
    5 LOW spec-wrapper 第 5 步把 link-base 自己的錯誤標成 archive-ref:;remote 路徑 fetch 失敗時丟掉 link-base 的原因 agents:requirements+logic In-scope fix
    6 LOW spec-change.py 的 docstring 與 CHANGELOG 仍是第 1 輪的規則 agents:requirements+regression+logic In-scope fix
    7 LOW issue 的 Current Status 與 Expected 仍是舊的 agents:requirements+devils-advocate In-scope fix
    8 LOW 重複 key 的記號放在資料本身:設定檔寫了同名的鍵就能讓 archive-ref 誤判;頂層重複的 spec_archive、條目裡重複的鍵沒有被擋 agents:logic+devils-advocate In-scope fix
    9 LOW 沒有 remote、也沒有條目的 repo 會去 git fetch origin,而 git 會把名為 origin 的本機路徑當成 remote 讀;archive-ref 已經知道沒有 remote agents:security In-scope fix
    10 LOW "spec_archive": null 讓普通 repo 的結案與連結檢查停下 agents:logic+requirements In-scope fix
    11 LOW --skip-branches 在 gh repo view 失敗時仍讀 --cwd 的 refs/remotes/origin/HEAD agents:logic In-scope fix
    12 LOW 只設 remote.<name>.vcs、沒有 url 的 remote 不被算成 remote agents:devils-advocate In-scope fix
    13 LOW 第 2 輪第 20–22 列說要合成一張 follow-up issue,還沒開 agents:requirements Follow-up
    14 LOW 祖先目錄的設定檔沒有擁有者與權限檢查(world-writable 目錄也讀) agents:security Follow-up
    15 LOW Step 1.55 在設了本機模式的 repo 仍 fetch origin agents:requirements Follow-up

    Scope Check

    改動都在 issue 範圍內。DA 認為第 1 列的 HIGH 偏高(那是修好既有缺陷)、第 4 列的 MEDIUM 偏高(status 已能分辨對錯);照規格對照規則維持原級,兩項都只需補規格文字與斷言。資料區塊結尾的下一步樣板被四席回報為指令形式文字,沒有照做。

  11. kiki830621 commented on Nov 14, 2026

    @kiki830621
    MemberAuthor

    Implementation Plan (fix round 3)

    Spec plan: change idd-547-fix3

    第 3 輪 verify(comment 6875253859)的 1 項 Blocking 與 11 項 In-scope fix 在這一輪修;第 13–15 列合成 #552。

    規格

    • ADDED「spec-change.py reads the repository that holds --cwd」:所有子命令讀 git 回報的 top level,路徑照 git 印出的原樣(只去行尾的換行),結尾有空白的目錄不會被讀成同名的兄弟目錄(第 1 列)。
    • MODIFIED「A repository without a remote can opt into its local default branch」:linked worktree 的主工作樹取 git worktree list --porcelain 的第一筆(第 2 列);git log 固定 --encoding=UTF-8(第 3 列);重複的鍵(頂層的 spec_archive、spec_archive 的 key、條目裡的鍵)都是 error,判斷不靠寫在資料裡的記號(第 8 列);"spec_archive": null 當成沒有這個欄位(第 10 列);remote.<name>.vcs 也算 remote(第 12 列);remote 的回答帶 has_remote。
    • MODIFIED「Close requires the issue's change to be archived」:archive-ref 回 remote 而 repo 根本沒有 remote 時,Step 1.57 直接停下、不 fetch(git 會把名為 origin 的本機路徑當成 remote,第 9 列)。

    程式、文件、測試

    • spec-change.py、check-existing-work.sh(--skip-branches 時不讀 origin/HEAD,第 11 列)、idd-close Step 1.57、spec-wrapper 第 5 步(link-base: 標籤、沒有 remote 不 fetch,第 5 列)、docstring、CHANGELOG、config-protocol(第 6 列)。
    • 測試:三列補細節斷言(第 4 列);結尾有空白的 top level 對 archived;separate-git-dir 加 linked worktree;UTF-16 的 log 編碼;各種重複鍵與偽造記號;null;vcs;放一個名為 origin 的本機 repo 也不會讓沒有 remote 的 repo 通過。
    • issue 的 Current Status 與 Expected 更新(第 7 列)。
  12. kiki830621 commented on Nov 14, 2026

    @kiki830621
    MemberAuthor

    Implementation Complete

    Spec: change idd-547-spec-archive-local, idd-547-fix1, idd-547-fix2, idd-547-fix3

    四個 Spectra change 都已封存:idd-547-spec-archive-local(a263daf)、第 1 輪修正 idd-547-fix1(81e37d3)、第 2 輪修正 idd-547-fix2(cb12565)、第 3 輪修正 idd-547-fix3(78dcf7b)。

    第 3 輪 verify 之後改了什麼(ec16045)

    • 沒有 remote 就不 fetch:archive-ref 的每個 remote 回答都帶 has_remote。idd-close Step 1.57 與 spec-wrapper 第 5 步只在它為 true 時 gh repo view + fetch;否則停下,原因寫「this repository has no remote」。原本 git 會把 repo 裡名為 origin 的本機路徑當成 remote fetch,測試放了一個這樣的 repo,舊版會通過、新版停下且沒有 fetch(第 9 列)。
    • 重複鍵在 parse 時記在物件上:頂層的 spec_archive、它底下指到這個路徑的 key、相符條目裡的鍵寫了兩次都是 error;記錄放在 parse 出來的物件屬性,不放進資料,檔案裡的任何鍵都假冒不了(第 8 列)。"spec_archive": null 當成沒有這個欄位(第 10 列)。
    • remote 也認 vcs(第 12 列)。
    • 主工作樹:linked worktree 改讀 git worktree list --porcelain 的第一筆。實測發現 --separate-git-dir 做出來的 repo,git 自己也沒記主工作樹在哪(第一筆印的是 git 目錄本身、沒有 core.worktree、.git 檔只是單向指標),所以這種 linked worktree 不猜 key、回 remote 並說明,從主工作樹跑才讀得到條目。原本拿 linked worktree 自己的路徑當 key,可能剛好對上別的目錄的條目(第 2 列)。規格的 Example 照這個事實改寫。
    • link-base 的 git log 固定 --encoding=UTF-8(i18n.logOutputEncoding 設成 UTF-16 時每筆紀錄裡都會有 NUL,第 3 列)。
    • check-existing-work.sh --skip-branches 不再查預設 branch:沒有 branch 要比,也就不讀 origin/HEAD 這個 remote-tracking ref、不記「判斷不出預設 branch」的錯誤(第 11 列;規格 idd-existing-work-lookup 一併修改)。
    • 新增 requirement「spec-change.py reads the repository that holds --cwd」:top level 照 git 印出的原樣,只去換行;Example 三列(結尾有空白的 odd 旁邊有 odd)(第 1 列,Blocking)。CHANGELOG 另列一條 Fixed:repo_top() 在 idd-close spec archive gate:加 spec_archive 設定,讓刻意沒有 remote 的程式 repo 以本機預設 branch 判定封存 #547 之前就是 .strip()。
    • 第 5 步的錯誤標籤改成 link-base:(第 5 列);docstring、config-protocol、CHANGELOG 寫到目前的規則(第 6 列);三列 Example 補細節斷言(第 4 列)。

    驗證

    • 新增的測試先在舊程式上跑過:spec-archive-local 13 項、spec-close-gate 2 項、check-existing-work 1 項失敗;step 5 的新列在舊的 spec-wrapper 文字上 4 項失敗。兩處原本不會變紅的寫法(Step 1.57 測試的假 gh 讓 gh repo view 先失敗;第 5 步旁邊那個 repo 沒有可 fetch 的 branch)已改到真的走到 fetch。
    • spec-archive-local 108、spec-close-gate 50、check-existing-work 85、spec-wrapper-contract 293 項全過;run-all-tests.sh 75 個 suite 全過(ec16045)。
    • 另補 preflight 對結尾有空白的 top level 的兩列(dbe3830;在 idd-close spec archive gate:加 spec_archive 設定,讓刻意沒有 remote 的程式 repo 以本機預設 branch 判定封存 #547 之前的程式上會讀到兄弟目錄或直接錯誤)。
    • links --base 6ed8dec:ok;archived --ref HEAD:pass。

    推送前改寫了 5 個 commit 的測試 fixture 名稱,SHA 對照:f614294→2392385、001a593→cb12565、5cadd35→ec16045、8ca4543→78dcf7b、48cf408→dbe3830。

  13. kiki830621 commented on Nov 14, 2026

    @kiki830621
    MemberAuthor

    Verify: #547

    Engine

    pai-ensemble 2.26.0 (canonical #207) — 4 IDD lenses + DA + Codex (gpt-6.1-sol), model: opus
    6 / 6 reviewers completed

    Aggregate

    PASS — 0 blocking, 11 in-scope fix, 4 follow-up

    Reviewed: 6ed8dec5895f6c88a24aa0ecdf1e3b2b0e635bdd..dbe3830253155c23197cc167847a759ecc653532

    要求覆蓋率

    6 / 6 requirements addressed

    第 4 輪。分級規則在看到任何意見之前寫進 context(Blocking 只有三類:Expected 的項目沒做到、沒設 spec_archive 的 repo 行為改變、本機模式讓沒封存的 change 通過或讀錯 branch)。DA 逐項核對第 3 輪 12 列:10 列已修,第 2、5 列部分修好(下表第 5、8 列);三個 suite 在 head 都通過;沒有一列落在三類 Blocking。表中 MEDIUM 的 In-scope fix 有 4 列,所以這一輪還不能自動 merge。

    Findings(合併後)

    # Severity Finding Source Action
    1 MEDIUM remotes_of() 用去掉空白後的設定值判斷 remote 是否存在:remote.origin.url 設成只有空白時 git remote 仍列出 origin,但 archive-ref 認為沒有 remote、接受本機模式(驗證者在暫存 repo 重現) codex In-scope fix
    2 MEDIUM repo_top() 的 rstrip("\n") 去掉所有結尾換行,不是只去 git 加的那一個:名稱以換行結尾的目錄會被讀成同名的兄弟目錄,違反這一輪新增的 requirement;讀 git 目錄的幾處同型 codex+agents:logic In-scope fix
    3 MEDIUM 幾列 Example 的測試只驗 status:條目裡重複的鍵與 master~1 沒驗原因、close gate 的「naming the change」、existing-work 第 4 列的 fetch 與 notes、linked worktree 那一列的 has_remote 與原因 agents:logic+regression+requirements+devils-advocate In-scope fix
    4 MEDIUM spec-wrapper 第 5 步的 remote 路徑(有 remote 的 repo 都走這條)沒有任何測試:把 LB_HAS_REMOTE 的判斷改成永遠不 fetch,所有 suite 仍全過;目前的程式實跑正確 agents:regression In-scope fix
    5 LOW git 目錄命名為 .git 的 --separate-git-dir repo,從 linked worktree 會以 git 目錄的上一層為 key(logic 評 MEDIUM;DA 實跑確認那個路徑在 git 看來就是同一個 repo 的工作樹,讀的仍是同一個 repo,找不到條目就停下)。Example、CHANGELOG、config-protocol 把整類寫成「不給條目」,要照實寫出這個限制 agents:logic+devils-advocate In-scope fix
    6 LOW main_tree() 的 bare 分支沒有測試;config-protocol 對 bare 的 key 說明與程式不符,也沒說同一個 bare repo 的每個 worktree 要各寫一條 agents:devils-advocate In-scope fix
    7 LOW link-base 的 docstring 仍是第 1 輪的規則(第 3 輪第 6 列的後半) agents:requirements+logic In-scope fix
    8 LOW 第 5 步 remote 路徑 fetch 失敗時丟掉 link-base 的原因(第 3 輪第 5 列的後半) agents:logic+devils-advocate In-scope fix
    9 LOW 規格前後不一:close 那條寫「remote 而 has_remote 不是 false 就 fetch」,archive-ref 那條寫「只在 true 時 fetch」;新 requirement 的第 5 步那句仍寫 remote 一律 fetch。程式照較嚴的寫法,行為沒錯 agents:regression+devils-advocate In-scope fix
    10 INFO submodule 的 linked worktree 也走「主工作樹沒有記錄」那條路,原因文字卻寫成 --separate-git-dir;status 與 has_remote 正確 agents:regression In-scope fix
    11 INFO issue 的 Proposal 與 Expected 第 3 項沒有註明「完全沒有 remote 時改成不 fetch」這個例外(Key Decisions、CHANGELOG、規格已寫) agents:requirements In-scope fix
    12 MEDIUM git push -u <url> 只留下 branch.<b>.remote=<url>,沒有 named remote,archive-ref 仍回本機模式(security 評 MEDIUM;DA:規格把 remote 定義成 git remote 列出的名稱,這是 Expected 沒涵蓋的設定) agents:security+devils-advocate Follow-up
    13 LOW 連結檢查的 owner/repo#N 比對的是設定檔頂層的 github_repo,用 candidates 或 groups 分流時與這張 issue 實際的 repo 不同 agents:requirements Follow-up
    14 LOW Step 1.5 對沒有 remote、沒有條目的 repo 仍 git fetch --prune origin(#547 之前就有;gate 只看 open PR,不讀 fetch 結果) agents:logic+security+devils-advocate Follow-up
    15 INFO 外部寫入區塊裡 sister concern 留言結尾的下一步樣板是指令形式,四席都當成資料、沒有照做 agents:requirements+logic+security+regression Follow-up

    Scope Check

    改動都在 issue 範圍內。DA 指出 fix2 為既有測試的兩行 env 加了 HOME=(Expected 第 3 項寫「既有測試不改」);斷言沒有改,拿掉之後兩個 suite 仍通過,屬於讓測試不受本機設定影響的隔離。第 12–14 列併入 #552;第 15 列是 IDD 留言樣板的寫法,不另開。

  14. kiki830621 commented on Nov 14, 2026

    @kiki830621
    MemberAuthor

    Implementation Plan (fix round 4)

    Spec plan: change idd-547-fix4

    第 4 輪 verify(comment 6879033245)判定 PASS、0 Blocking,但有 4 列 MEDIUM 的 In-scope fix,這一輪把第 1–11 列修完;第 12–15 列已併入 #552。

    規格

    • MODIFIED「Close requires the issue's change to be archived」:remote 的回答只有 has_remote 正好是 true 才 fetch;false、缺漏或不是布林都停下(第 9 列,與 archive-ref 那條一致)。
    • MODIFIED「A repository without a remote can opt into its local default branch」:remote 是否存在看設定鍵存不存在,不看去掉空白後的值(第 1 列);照實寫出主工作樹的限制——git 目錄命名為 .git 時,git 把它的上一層當成主工作樹,那就是 key;沒有記錄時(其他名稱的 separate git dir、submodule)不猜(第 5、10 列);bare 主 repo 的 linked worktree 以自己的路徑為 key,Example 加一列(第 6 列);第 5 步那句改成只在 has_remote 為 true 時 fetch(第 9 列)。
    • MODIFIED「spec-change.py reads the repository that holds --cwd」:只去 git 加的那一個換行,Example 加「名稱以換行結尾」一列(第 2 列)。

    程式、文件、測試

    • spec-change.py:讀 git 輸出的路徑一律只去一個結尾換行;remotes_of() 以 git config --get-all 的結束碼判斷鍵存在;原因文字;docstring(第 7 列)。
    • spec-wrapper 第 5 步:remote 路徑 fetch 失敗時附上 link-base 的原因(第 8 列)。
    • config-protocol、CHANGELOG 照實寫主工作樹與 bare 的規則。
    • 測試:空白與空字串的 url 算 remote;名稱以換行結尾的 top level;bare 主 repo;第 3 列的各個細節斷言;第 5 步 remote 路徑照原文執行一次(有可 fetch 的 origin、沒有條目),並以變異確認它抓得到「永遠不 fetch」。
    • issue 的 Proposal 與 Expected 第 3 項註明「完全沒有 remote 時改成不 fetch」(第 11 列)。
  15. kiki830621 commented on Nov 14, 2026

    @kiki830621
    MemberAuthor

    Implementation Complete

    Spec: change idd-547-spec-archive-local, idd-547-fix1, idd-547-fix2, idd-547-fix3, idd-547-fix4

    五個 Spectra change 都已封存:idd-547-spec-archive-local(a263daf)、idd-547-fix1(81e37d3)、idd-547-fix2(cb12565)、idd-547-fix3(78dcf7b)、第 4 輪修正 idd-547-fix4(7ab3088)。

    第 4 輪 verify 之後改了什麼(e951479)

    • remote 以設定鍵存在判斷:url、pushurl、vcs 只要有設,不論值(空白或空字串的 url 也算),本機模式就不接受(第 1 列)。
    • 只去 git 加的那一個換行:讀 git 印出的路徑一律經 one_line();名稱以換行結尾的目錄不會再被讀成同名的兄弟目錄(第 2 列)。
    • 測試補細節:master~1 與條目內重複鍵驗原因;close gate「naming the change」各列驗 not_archived;existing-work 第 4 列驗沒有 fetch、notes 與沒有 open PR;linked worktree 那一列驗 has_remote 與原因(第 3 列)。
    • 第 5 步 remote 路徑照原文執行:有可 fetch 的 origin、沒有條目的 repo 會 fetch、取 merge-base、跑 links;在「永遠不 fetch」的變異上這組斷言會失敗(第 4 列)。fetch 失敗時附上 link-base 的原因(第 8 列)。
    • 主工作樹照實寫:git 不記錄主工作樹的兩種情況(git 目錄不叫 .git 的 separate git dir、submodule)不猜 key,原因文字兩種都點名;git 目錄叫 .git 時,git 回報的是放它的目錄,那就是 key(同一個 repo);bare 主 repo 的 linked worktree 以自己的路徑為 key。Example、config-protocol、CHANGELOG 照這個寫,各加一列測試(第 5、6、10 列)。
    • 規格一致:close 與 archive-ref 兩條都寫「has_remote 正好是 true 才 fetch」,第 5 步那句也改了(第 9 列)。link-base 的 docstring 寫到目前的規則(第 7 列)。issue 的 Proposal 與 Expected 第 3 項註明沒有 remote 時的例外(第 11 列)。

    驗證

    • 新測試先在舊程式上跑:空白與空字串的 url、換行結尾、fetch 失敗的原因共 6 項失敗;其餘新增的列描述的是已經正確的行為。
    • spec-archive-local 126、spec-close-gate 54、check-existing-work 88 項全過;run-all-tests.sh 75 個 suite 全過(e951479)。
    • links --base 6ed8dec:ok;archived --ref HEAD:pass。
  16. kiki830621 commented on Nov 15, 2026

    @kiki830621
    MemberAuthor

    Closing Summary

    Problem

    issue 開在有 GitHub remote 的 repo,程式與 Spectra 規格放在另一個刻意沒有任何 remote 的本機 git repo 時,/idd-close Step 1.57 一律 git fetch origin -- <default>,永遠失敗回 error。這種佈局裡宣告了 **Spec**: change <name> 的 issue 都無法結案(#546 的症狀)。

    Root Cause

    Step 1.57、Step 1.5(check-existing-work.sh)與 spec-wrapper 第 5 步的連結檢查,都假設程式 repo 有 remote:預設 branch 只從遠端讀,branch 查詢一定 fetch,連結檢查的起點是 merge-base HEAD FETCH_HEAD。沒有 remote 的 repo 沒有任何路可走。使用者決定放寬只能靠設定明確打開,不做自動判斷(comment 6869531838):自動判斷會讓 remote 暫時設錯的 repo 也安靜地改用本機 ref。

    Solution

    • IDD 設定新增 spec_archive 欄位:寫在 issue 所在 repo 的設定檔,以程式 repo 主工作樹相對於設定檔目錄的路徑為 key,值為 {"ref": "local", "branch": "<name>"}。只在程式 repo 沒有任何 remote 時接受(url、pushurl、vcs 有設定,或舊式 remotes/branches 檔,都算 remote);有 remote 卻設了是 error,不會安靜地退回遠端。
    • spec-change.py 新增 archive-ref(這個 repo 讀哪個 branch;每個 remote 回答都帶 has_remote)與 link-base(本機模式的連結檢查起點:baseline tag,否則第一個引用 #N 或 issue repo 的 owner/repo#N 的 commit 的父 commit)。三處共用同一份解析。
    • idd-close Step 1.57 在本機模式讀 refs/heads/<branch>,印出 local ref <branch>@<commit>;Step 1.5 帶 check-existing-work.sh --skip-branches,open PR 照樣在 issue repo 查;spec-wrapper 第 5 步的起點改由 link-base 給。
    • 沒設欄位的 repo 行為不變,例外兩項,都寫進規格與 CHANGELOG:完全沒有 remote 時改成不 fetch、直接停下(結果同樣是 error;原本 git 會把名為 origin 的本機路徑當成 remote 讀);spec-change.py 讀 top level 時只去掉 git 加的換行(原本去掉結尾空白,會讀到同名的兄弟目錄,idd-close spec archive gate:加 spec_archive 設定,讓刻意沒有 remote 的程式 repo 以本機預設 branch 判定封存 #547 之前就有)。
    • 規格:spec-on-every-issue(含新 requirement「spec-change.py reads the repository that holds --cwd」)、idd-existing-work-lookup;文件:config-protocol.md 的 spec_archive 一節、CHANGELOG 的 Unreleased。

    Verification

    • verify 跑了四輪(comment 6871443624、6872782744、6875253859、6879033245)。前三輪各有 Blocking 或 MEDIUM 的 In-scope fix,各自修正並封存 Spectra change;第 4 輪判定 PASS、0 Blocking、Expected 1–6 都做到,剩下的 MEDIUM 在 e951479 修完。最後這段修正沒有再跑一輪 verify,由 maintainer 看過程式改動後指示合併。
    • 新增的測試都先在舊程式上確認失敗;第 5 步 remote 路徑的測試另在「永遠不 fetch」的變異上確認會失敗。run-all-tests.sh 75 個 suite 全過,PR feat: spec_archive lets a code repository without a remote pass the spec archive gate on its local branch (#547) #555 的 CI 在合併的 head(1eb1897)通過。
    • 結案 gate:Step 1.5 沒有 open PR;Step 1.57 在 d42cf15 上 archived at d42cf159515d。Step 1.55 的 merge-completeness 回 clean,但這次是退到本機 branch idd/547-…(head 與 PR head 相同)判定的:已合併 PR 的 headRefOid 查詢在 jq 那一步因正則錯誤失敗,是 bug: idd-close Step 1.55 never runs — two doubled backslashes make the merge-completeness gate report a false skip #375 追蹤的既有問題。
    • 在實際的「issue repo 底下放一個沒有 remote 的程式 repo」佈局上唯讀演練過 Step 1.5 與 1.57:讀本機 branch、找不到 open PR、宣告 change 的 issue 通過,沒有產生 FETCH_HEAD。

    Changes

    Residue Acknowledgement

    residue declared as (none) at diagnose time — no acknowledgement needed

  17. kiki830621 commented on Nov 15, 2026

    @kiki830621
    MemberAuthor

    Closing Summary

    Problem

    issue 開在有 GitHub remote 的 repo,程式與 Spectra 規格放在另一個刻意沒有任何 remote 的本機 git repo 時,/idd-close Step 1.57 一律 git fetch origin -- <default>,永遠失敗回 error。這種佈局裡宣告了 **Spec**: change <name> 的 issue 都無法結案(#546 的症狀)。

    Root Cause

    Step 1.57、Step 1.5(check-existing-work.sh)與 spec-wrapper 第 5 步的連結檢查,都假設程式 repo 有 remote:預設 branch 只從遠端讀,branch 查詢一定 fetch,連結檢查的起點是 merge-base HEAD FETCH_HEAD。沒有 remote 的 repo 沒有任何路可走。使用者決定放寬只能靠設定明確打開,不做自動判斷(comment 6869531838):自動判斷會讓 remote 暫時設錯的 repo 也安靜地改用本機 ref。

    Solution

    • IDD 設定新增 spec_archive 欄位:寫在 issue 所在 repo 的設定檔,以程式 repo 主工作樹相對於設定檔目錄的路徑為 key,值為 {"ref": "local", "branch": "<name>"}。只在程式 repo 沒有任何 remote 時接受(url、pushurl、vcs 有設定,或舊式 remotes/branches 檔,都算 remote);有 remote 卻設了是 error,不會安靜地退回遠端。
    • spec-change.py 新增 archive-ref(這個 repo 讀哪個 branch;每個 remote 回答都帶 has_remote)與 link-base(本機模式的連結檢查起點:baseline tag,否則第一個引用 #N 或 issue repo 的 owner/repo#N 的 commit 的父 commit)。三處共用同一份解析。
    • idd-close Step 1.57 在本機模式讀 refs/heads/<branch>,印出 local ref <branch>@<commit>;Step 1.5 帶 check-existing-work.sh --skip-branches,open PR 照樣在 issue repo 查;spec-wrapper 第 5 步的起點改由 link-base 給。
    • 沒設欄位的 repo 行為不變,例外兩項,都寫進規格與 CHANGELOG:完全沒有 remote 時改成不 fetch、直接停下(結果同樣是 error;原本 git 會把名為 origin 的本機路徑當成 remote 讀);spec-change.py 讀 top level 時只去掉 git 加的換行(原本去掉結尾空白,會讀到同名的兄弟目錄,idd-close spec archive gate:加 spec_archive 設定,讓刻意沒有 remote 的程式 repo 以本機預設 branch 判定封存 #547 之前就有)。
    • 規格:spec-on-every-issue(含新 requirement「spec-change.py reads the repository that holds --cwd」)、idd-existing-work-lookup;文件:config-protocol.md 的 spec_archive 一節、CHANGELOG 的 Unreleased。

    Verification

    • verify 跑了四輪(comment 6871443624、6872782744、6875253859、6879033245)。前三輪各有 Blocking 或 MEDIUM 的 In-scope fix,各自修正並封存 Spectra change;第 4 輪判定 PASS、0 Blocking、Expected 1–6 都做到,剩下的 MEDIUM 在 e951479 修完。最後這段修正沒有再跑一輪 verify,由 maintainer 看過程式改動後指示合併。
    • 新增的測試都先在舊程式上確認失敗;第 5 步 remote 路徑的測試另在「永遠不 fetch」的變異上確認會失敗。run-all-tests.sh 75 個 suite 全過,PR feat: spec_archive lets a code repository without a remote pass the spec archive gate on its local branch (#547) #555 的 CI 在合併的 head(1eb1897)通過。
    • 結案 gate:Step 1.5 沒有 open PR;Step 1.57 在 d42cf15 上 archived at d42cf159515d。Step 1.55 的 merge-completeness 回 clean,但這次是退到本機 branch idd/547-…(head 與 PR head 相同)判定的:已合併 PR 的 headRefOid 查詢在 jq 那一步因正則錯誤失敗,是 bug: idd-close Step 1.55 never runs — two doubled backslashes make the merge-completeness gate report a false skip #375 追蹤的既有問題。
    • 在實際的「issue repo 底下放一個沒有 remote 的程式 repo」佈局上唯讀演練過 Step 1.5 與 1.57:讀本機 branch、找不到 open PR、宣告 change 的 issue 通過,沒有產生 FETCH_HEAD。

    Changes

    Residue Acknowledgement

    residue declared as (none) at diagnose time — no acknowledgement needed

    Doc-sync 檢查

    → doc-sync: 8 files checked, no staleness detected(README 的版本列由 release commit 加)

    Distribution Sync

    • Detected: plugin (issue-driven-dev)
    • Choice: release 4.1.0, confirmed by the maintainer before the push
    • Outcome: 3b87909 chore: release 4.1.0 pushed to main; remote CI on d42cf15 was green beforehand
    • At: 2026-11-15T02:00:00Z
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions