Skip to content

idd-close 的 checklist gate 對 Spectra path 永遠 fallback 掃 Strategy——那些 checkbox 沒有任何一步會勾 #290

Description

@kiki830621

Type

bug

Problem

idd-close Step 0 的 checklist gate 用 authoritative-source 優先序決定掃哪些 checkbox:

authoritative_source = first_exists([
  "## Implementation Complete > ### Checklist",   # idd-implement Step 5 寫回
  "

---

### Clarity Surface(idd-clarify run 2026-08-05T02:30:00Z)

| Type | Source | Suggested canonical | Status |
|---|---|---|---|
| missing-context | 「`authoritative_source = first_exists([...])`」 | **`exists` 的判準未定義**。canonical rule(`rules/append-vs-modify.md`)零次提及 `len` / non-empty;四個消費端只有 `idd-close` Step 0 寫出 `len(impl_complete.items) > 0`,且**只對 priority 1**。`idd-verify` / `idd-update` 只引 `first_exists([...])` 無條件。實作前必須先定義:`exists` =「heading 在」還是「heading 在且 ≥1 個可解析項目」 | **resolved @ 2026-08-05T02:32:00Z**(裁決:採「heading 在且 ≥1 個可解析項目」,並寫進 canonical rule 使三個 consumer 一致。依據:`idd-close` 既有實作已如此、且是唯一既有實作——這是讓文件追上程式碼,不是新決定)|
| ambiguity | 「無來源時 `### Tasks` 該省略還是寫**空節**」(診斷的未決點 2) | 「空節」有兩種且對 `first_exists` 意義不同:(a) 只有 heading 無任何 row;(b) heading + `(none)` marker row。**且若沿用 `idd-close` 的 `len > 0`,兩者都不會 resolve** → 診斷裡寫的「gate 什麼都不掃」風險**不存在**。該未決點很可能是我沒查判準就下的判斷,而非真的分岔 | **dismissed @ 2026-08-05T02:32:00Z**(已由 `idd-close` 的 `len(items) > 0` 與其 edge-case 表「存在但 0 items → 視同不存在 → Legacy fallback」回答。原診斷寫的放寬風險不存在——那是我未查判準的誤判)|
| terminology | 「四個 gate site(`idd-close` / `idd-verify` / `idd-update` / `idd-implement`)」 | `idd-implement` 實際是 **producer 不是 consumer**——它 Step 5a 只**寫** priority 1,不執行 resolution(該檔內 `authoritative_source` 僅出現在說明散文)。用詞不精確會讓人以為修 producer 需同步改四處 gate 邏輯;實際是「1 producer + 3 consumer」 | **resolved @ 2026-08-05T02:32:00Z**(裁決:canonical rule 改稱「1 producer(`idd-implement` Step 5a)+ 3 consumer(`idd-close` / `idd-verify` / `idd-update`)」。依據:`idd-implement` 檔內 `authoritative_source` 僅出現於說明散文,不執行 resolution)|

---

## Current Status

**Phase**: closed
**Last updated**: 2026-08-05 by /idd-close

### Key Decisions
- **結案**:PR #291 已 merge(merge commit `dc2601f`)。全套件 43 suite / 0 失敗。
- 根因比 issue 描述更根本:priority 2 **沒有任何 producer**,chain 實務上塌縮成「只有 priority 1」,而它只有 `idd-implement` 產生。
- 裁決 A/B/C′/D 由使用者授權判斷;C 經 discuss 修正為「向 CLI **查**路徑而非組路徑」,並加 **toplevel 圍籬**(實測 registry 會回傳 sibling worktree 路徑)。
- cross-model verify 抓到兩個嚴重缺陷:修法**在自己的 pipeline 裡活不過一步**(整段替換會抹掉剛寫入的 `### Tasks`)、圍籬 **fail-open**(`TOP=""` → pattern `/*`)。

### Scope Changes
- 從「修 idd-close 的 gate」擴成「補上契約 priority 2 的 producer」——修法位置移到 `idd-update`,影響面從一個 gate 變成整個 resolution。

### Blocking
- (none) — 已結案。

### Tasks

*本小節由 `idd-update --tasks-file openspec/changes/add-authoritative-source-producer/tasks.md` 產生——**這是本次新增機制的第一次實際使用**。圍籬已套用(路徑在當前 toplevel 內),14 個可解析項目 > 0 故 resolve,Strategy 依 canonical 規則視為 superseded snapshot。*

- [x] 1.1 寫出**會失敗**的 fixture 測試(`plugins/issue-driven-dev/scripts/tests/authoritative-source-pr
- [x] 1.2 同檔加 drift-lock:斷言 `rules/append-vs-modify.md` 含 `exists` 的判準文字與「1 producer + 3 consum
- [x] 1.3 同檔加**圍籬測試**:用 `git worktree add` 建**真的**第二個工作樹(不是只換字串的假 fixture——實際遇到的情形正是同 repo 跨 wo
- [x] 2.1 `idd-update/SKILL.md` 新增 `--tasks-file <path>` 的參數說明與 Step 4 模板的 `### Tasks` 小節:內容為來源
- [x] 2.2 同檔寫入圍籬規範:路徑解析為絕對路徑後必須以 `git -C "$CWD" rev-parse --show-toplevel` 為前綴,否則**拒絕**、印出兩個路徑、
- [x] 2.3 同檔寫明三種不 emit 的情形:flag 缺席、檔案不存在(警告不中止)、檔案零個 checkbox 行。並說明「不 emit」而非「emit 空節」的理由(不製造需要
- [x] 2.4 `idd-all/SKILL.md` 的 Spectra 分支在收尾呼叫 `idd-update` 時附上 `--tasks-file`,路徑取自對外部工具 CLI 的*
- [x] 3.1 `rules/append-vs-modify.md` 的 resolution 段落定義 `exists` = heading 在**且**至少一個可解析項目,並註明此
- [x] 3.2 同檔把「4 個 gate site」改為具名的「1 producer(`idd-implement` Step 5a)+ 3 consumer(`idd-close` S
- [x] 3.3 同檔新增不變式:**優先序的每一層都必須指名 producer**;沒有 producer 的層無法 resolve,會讓優先序靜默塌縮。註明本不變式無法被測試強制(它約
- [x] 3.4 `idd-close/SKILL.md` Step 0 的 `exists` 敘述與新的 canonical 定義對齊(它原本只對第一層寫 `len(items) > 0
- [x] 4.1 確認第一層行為**逐字未變**:以 `git diff` 確認 `idd-implement/SKILL.md` 的 Step 5a 敘述未被修改,且 `rules/ap
- [x] 4.2 確認**未硬編外部佈局**:`grep -rn 'openspec/changes' plugins/issue-driven-dev/skills/ plugins/i
- [x] 4.3 跑既有測試 runner,全數通過;記錄變更前後的測試數量。驗證目標:runner 全綠,新測試出現在清單中。

### Commits
- PR **#291**(merge commit `dc2601f`):`b692d9d` producer + exists 判準 · `58a51b9` cross-model verify round 1
- 另含兩個與本 issue 無關的清理 commit(`7e3c87a` / `d1041f3`),成因與更正見 PR pointer comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions