Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .claude/.idd/attachments/issue-525/_manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"issue": 525,
"fetched_at": "2026-11-13T02:04:00Z",
"fetched_by": "idd-diagnose",
"files": []
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
schema: spec-driven
created: 2026-11-13
created_by: che cheng <kiki830621@gmail.com>
created_with: claude
archived_by: che cheng <kiki830621@gmail.com>
archived_at: 2026-11-13
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
**GitHub-side tracker**: #525

## Problem

#502 的 verify 留下三個小項,都在 spectra bridge 的偵測(`/idd-comment` 判斷這次呼叫是不是從 spectra-discuss 的討論中途進來的):

- `rules/spectra-bridge.md` 的偵測表有一列「Conversation context」(呼叫的 skill 知道自己是從 spectra 進來的),表上方寫任一訊號成立就啟動。`idd-comment` Step 0.7 的區塊沒有這個訊號,skill 的文字也沒有叫執行的模型依對話判斷。規格在「No executable check」那一行說這一列由執行 skill 的模型判斷,等於替一個沒有人執行的訊號背書。
- 規格說舊路徑的 bridge 檔只在新路徑沒有檔案時才算,但 Example 與測試都沒有「兩個檔同時存在」的列。把區塊改成先讀舊路徑,現在的測試不會發現。
- 檢查三處說明文字(`idd-comment` 的 task 描述、plugin 的 `CLAUDE.md` 與 `README.md`)有沒有把開著的 change 列成訊號時,只比對兩個英文說法。用中文把那個訊號寫回去,suite 仍然全過。

## Root Cause

#502 只處理「開著的 change」那個訊號,表裡的「Conversation context」當時列為不動的範圍;測試照當時改到的寫法寫,沒有涵蓋相鄰的情況。

## Proposed Solution

- 維護者已決定(2026-11-13):不補自動的路。從 spectra-discuss 中途留言要自己帶 `--resume-spectra="<主題>"`。
- `rules/spectra-bridge.md` 的偵測表拿掉「Conversation context」那一列,表的下方加一行:對話脈絡不是訊號,從 spectra-discuss 中途呼叫要帶 `--resume-spectra`。行數不變。
- 修改 requirement「Open Spectra changes do not turn the spectra bridge on」:寫明兩個 bridge 檔同時存在時只讀新路徑的;寫明說明文字不得用任何語言把開著的 change 列成訊號,而「不算」的說明不是列入;Step 7 的標題要寫明只在 bridge 啟動時執行,取代原本「No executable check」的那一行。
- 新增 requirement「Conversation context does not turn the spectra bridge on」。
- `spectra-bridge-detect` 補上對應的檢查。`idd-comment` Step 0.7 的區塊不改。

## Non-Goals

- 另外兩個做法(讓 spectra-discuss 那一側寫 bridge 檔;在 `idd-comment` 寫明由執行的模型依對話判斷):維護者沒有選。
- bridge 由 `--source` 或 bridge 檔啟動時主題是空的;規則的「Skill responsibilities」表把 `idd-issue` 寫成已實作:#524。
- 列 4(更正 #502 兩則留言裡的同一句):已在 2026-11-13 完成。
- ASSUMPTION: 不升版號,CHANGELOG 加在既有的 Unreleased 區塊。
- ASSUMPTION: 「開著的 change」的中文比對涵蓋「開著的」「進行中的」「未封存的」三種說法;其他說法不在這次的範圍。

## Success Criteria

- 新的檢查各有失敗的紀錄:規則的三個檢查在改規則之前失敗;把區塊改成先讀舊路徑時,「兩個檔同時存在」的檢查失敗;在三處用中文把訊號寫回去的副本上,改之前的 suite 全過、改之後失敗。
- `bridge-path` 照舊通過;`rules/spectra-bridge.md` 的 Hard rule 6 仍在第 116 行。
- `spectra-bridge-detect` 在 bash 5 與 macOS 內建的 bash 3.2 都通過,`LC_ALL=C` 之下也通過。
- run-all-tests 的全部 suite 與 spectra-archive-post-ic 通過;連結檢查對改到與新增的 requirement 回 ok。

## Capabilities

### New Capabilities

(none)

### Modified Capabilities

- `spectra-bridge-detection`: 對話脈絡不是訊號;兩個 bridge 檔同時存在時只讀新路徑的;說明文字的檢查不分語言;Step 7 只在 bridge 啟動時執行。

## Impact

- Affected specs: spectra-bridge-detection(MODIFIED requirement「Open Spectra changes do not turn the spectra bridge on」;ADDED requirement「Conversation context does not turn the spectra bridge on」)
- Affected code:
- Modified: plugins/issue-driven-dev/rules/spectra-bridge.md
- Modified: plugins/issue-driven-dev/scripts/tests/spectra-bridge-detect/test.sh
- Modified: plugins/issue-driven-dev/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
## MODIFIED Requirements

### Requirement: Open Spectra changes do not turn the spectra bridge on

The detection block of `skills/idd-comment/SKILL.md` Step 0.7 SHALL set `SPECTRA_BRIDGE_ACTIVE=1` when at least one of these holds, and SHALL leave it `0` otherwise: the `--resume-spectra` value is not empty; the `--source` value contains `spectra-discuss`, in any letter case; a bridge file whose `active_spectra_session` is `true` exists at `.claude/.idd/state/bridge.json`, or at the legacy path `.claude/state/idd-bridge.json` when the new path has no file. When both files exist, the block SHALL read only the one at the new path. Open Spectra changes in the repository SHALL NOT be a signal, and the block SHALL NOT run the `spectra` command. The places that list the signals for a reader SHALL NOT list open or in-flight Spectra changes, in whatever language they are written: the detection table of `rules/spectra-bridge.md`, the Step 0 task description of `idd-comment`, and the sentence of the plugin's `CLAUDE.md` and of its `README.md` that lists them. A remark in one of those places that open changes do not count is not a listing. Those two sentences SHALL name `active_spectra_session` for the bridge file. Step 7 of the skill, which writes the bookmark and prints the resume prompt, SHALL be headed as applying only when `SPECTRA_BRIDGE_ACTIVE=1`.

#### Scenario: A comment in a repository that has open changes

- **GIVEN** a repository with eight open Spectra changes, none of them about the comment being posted
- **AND** `/idd-comment` is called without `--resume-spectra`, with a `--source` that does not mention spectra-discuss, and no bridge file exists
- **WHEN** Step 0.7 runs
- **THEN** `SPECTRA_BRIDGE_ACTIVE` stays `0`, so Step 7 does not apply: no bookmark is written and no resume prompt is printed

##### Example: what turns the spectra bridge on

In every row the block does not run `spectra`.

| `--resume-spectra` | `--source` | Bridge file | Open Spectra changes | `SPECTRA_BRIDGE_ACTIVE` |
| --- | --- | --- | --- | --- |
| empty | empty | none | 8 | `0` |
| empty | empty | none | none | `0` |
| `my topic` | empty | none | none | `1` |
| empty | `Spectra-Discuss session` | none | none | `1` |
| empty | empty | new path, `active_spectra_session: true` | none | `1` |
| empty | empty | legacy path only, `active_spectra_session: true` | none | `1` |
| empty | empty | new path, `active_spectra_session: false` | 8 | `0` |
| empty | empty | new path, `active_spectra_session: false`, and legacy path, `active_spectra_session: true` | none | `0` |

##### Example: where the bridge signals are listed

| Place | Lists open or in-flight Spectra changes | Names `active_spectra_session` for the bridge file |
| --- | --- | --- |
| the rows of the detection table in `rules/spectra-bridge.md` | no | yes |
| the `detect_spectra_context` task description in `skills/idd-comment/SKILL.md` | no | not checked |
| the "Step 0.7 Detect" sentence of the plugin's `CLAUDE.md` | no | yes |
| the "Step 0.7 Detect" sentence of the plugin's `README.md` | no | yes |

##### Example: which wordings list open changes as a signal

A sentence is cut into clauses at brackets, full stops and semicolons, in either script. It lists open changes when a clause mentions them and that clause does not say they do not count.

| Sentence | Lists open changes as a signal |
| --- | --- |
| --source 含 spectra-discuss、repo 裡有開著的 Spectra change — 任一觸發 | yes |
| --source contains spectra-discuss, or the repository has open Spectra changes → on | yes |
| --source contains spectra-discuss, or spectra list shows a change → on | yes |
| --source contains spectra-discuss, or an in-flight Spectra change → on | yes |
| --source 含 spectra-discuss — 任一觸發(repo 裡有開著的 Spectra change 不算,#502) | no |
| --source contains spectra-discuss → on. Open Spectra changes in the repository are not a signal (#502) | no |
| --source 含 spectra-discuss、repo 裡有開著的 change — 任一觸發(repo 裡有開著的 Spectra change 不算,#502) | yes |

##### Example: Step 7 applies only when the bridge is on

| Place | Says |
| --- | --- |
| the heading of Step 7 in `skills/idd-comment/SKILL.md` | the step applies only when `SPECTRA_BRIDGE_ACTIVE=1` |

## ADDED Requirements

### Requirement: Conversation context does not turn the spectra bridge on

What the model that runs a skill knows from the conversation SHALL NOT be a signal: the three signals read by the detection block are the only ones. The detection table of `rules/spectra-bridge.md` SHALL have exactly three signal rows, for the `--resume-spectra` flag, the `--source` argument and the bridge file, and SHALL NOT have a row for conversation context. Below the table, the Detection section of the rule SHALL say that conversation context is not a signal and that a call made in the middle of a spectra-discuss session passes `--resume-spectra`.

#### Scenario: A comment posted in the middle of a spectra-discuss session

- **GIVEN** a spectra-discuss session in which `/idd-comment` is called without `--resume-spectra`, with a `--source` that does not mention spectra-discuss, and no bridge file exists
- **WHEN** Step 0.7 runs
- **THEN** `SPECTRA_BRIDGE_ACTIVE` stays `0`
- **AND** the same call with `--resume-spectra="<topic>"` turns the bridge on

##### Example: what the rule says about conversation context

| Part of the Detection section of `rules/spectra-bridge.md` | What it holds |
| --- | --- |
| the signal rows of the table | three: the `--resume-spectra` flag, the `--source` argument, the bridge file |
| every row of the table | no mention of conversation context |
| the text below the table | one line that says conversation context is not a signal and that a call from a spectra-discuss session passes `--resume-spectra` |
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
## 1. 測試先行

- [x] 1.1 兩個 bridge 檔同時存在的情況有檢查:依 requirement「Open Spectra changes do not turn the spectra bridge on」的 Example「what turns the spectra bridge on」新增的第八列,suite spectra-bridge-detect 加一個檢查(新路徑的檔是 false、舊路徑的檔是 true,結果 0),「沒有呼叫 spectra」的檢查改成涵蓋八列;測試檔帶標記 spec-example: spectra-bridge-detection / what turns the spectra bridge on。驗證:區塊現在是對的,這個檢查一加上就通過;把區塊抽出來改成先讀舊路徑之後,這個檢查失敗。
- [x] 1.2 說明文字的檢查不分語言:依 Example「which wordings list open changes as a signal」,同一個 suite 把「這一句有沒有把開著的 change 列成訊號」寫成函式,Example 的七列各一個檢查,再把函式套用到 Example「where the bridge signals are listed」的三處(task 描述、plugin 的 CLAUDE.md 與 README);測試檔帶標記 spec-example: spectra-bridge-detection / which wordings list open changes as a signal。驗證:在三處都用中文把那個訊號寫回去的副本上,改之前的 suite 全過,改之後這三個檢查失敗。
- [x] 1.3 規則怎麼寫對話脈絡有檢查:依 requirement「Conversation context does not turn the spectra bridge on」的 Example「what the rule says about conversation context」,同一個 suite 檢查偵測表剛好三列訊號、每一列都沒有提到對話脈絡、表的下方有一行寫明它不是訊號而且要帶 --resume-spectra;測試檔帶標記 spec-example: spectra-bridge-detection / what the rule says about conversation context。驗證:改規則之前這些檢查失敗。
- [x] 1.4 Step 7 的適用條件有檢查:依 Example「Step 7 applies only when the bridge is on」,同一個 suite 檢查 idd-comment 的 SKILL.md 只有一個 Step 7 的標題,而且標題寫明 SPECTRA_BRIDGE_ACTIVE=1;測試檔帶標記 spec-example: spectra-bridge-detection / Step 7 applies only when the bridge is on。驗證:標題現在就這樣寫,檢查一加上就通過;在副本裡把標題的條件拿掉之後,這個檢查失敗。

## 2. 規則

- [x] 2.1 rules/spectra-bridge.md 的偵測表拿掉「Conversation context」那一列,在「Open Spectra changes…」那一行後面加一行,寫明對話脈絡不是訊號、從 spectra-discuss 中途呼叫要帶 --resume-spectra。驗證:1.3 全部通過;檔案的行數不變,Hard rule 6 仍在第 116 行(idd-comment 與 bridge-path 用行號引用它);bridge-path 照舊通過。

## 3. 收尾

- [x] 3.1 CHANGELOG 的 Unreleased 加條目(#525)。驗證:git diff 只有新增行,已發布版本的條目沒有改動。
- [x] 3.2 跑 spectra-bridge-detect、bridge-path 與整套測試(run-all-tests.sh 與 spectra-archive-post-ic);spectra-bridge-detect 另外用 macOS 內建的 bash 3.2 與 LC_ALL=C 各跑一次。驗證:結束碼都是 0。
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
schema: spec-driven
created: 2026-11-13
created_by: che cheng <kiki830621@gmail.com>
created_with: claude
archived_by: che cheng <kiki830621@gmail.com>
archived_at: 2026-11-13
53 changes: 53 additions & 0 deletions openspec/changes/archive/2026-11-13-idd-525-fix1/proposal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
**GitHub-side tracker**: #525

## Problem

#525 的 verify 第 1 輪(2026-11-13,審查 `6ed8dec..6cdae05`)有三項 MEDIUM 與四項 LOW 要在這條 branch 上修:

- 判斷「這一句有沒有把開著的 change 列成訊號」的函式與規格的描述對不上。規格寫在分號切子句,函式只在「分號加空白」切;規格用 do not count 描述允許的說明,函式不認得這個說法。
- 同一個子句裡另有一句講別件事的「不算」,就把列入蓋掉;中文只認三種說法,而且後面要接英文的 change;規格卻寫「不論用什麼語言」。
- `idd-comment` 自己的文字沒有跟上:鐵律「偵測到從 spectra-discuss 進來必須印 resume prompt」沒有綁在 Step 0.7 的三個訊號上,Step 0.7 的說明也沒有寫對話脈絡不算。
- 「規則那一行在表的下方」沒有檢查位置;偵測表不提對話脈絡只比對英文;Step 7 的檢查只確認標題裡有一個字串。

## Root Cause

第一個 change 把判斷規則寫成一句話加七個例子,函式照例子寫,兩邊在例子沒有涵蓋的地方各說各話。改規則時只改了規則檔,沒有回頭讀執行的模型實際照著做的 skill 文字。

## Proposed Solution

- 規格把判斷規則寫成四個步驟(在哪裡切子句、哪些字算提到、哪些字算「不算」的說明而且要寫在提到之後、怎樣算列入),並寫明規則以外的說法不會被認出來。Example 的表擴成 29 列,每一個切點、每一個字、每一個步驟至少有一列會因為它而改變答案。
- suite 直接從主規格讀這張表,逐列執行規則。表與檢查不會對不上。
- `skills/idd-comment/SKILL.md`:Step 0.7 區塊下方加一行(對話脈絡不是訊號,要帶 `--resume-spectra`);鐵律改成以 Step 0.7 的判定為準,並寫明不從對話推斷。偵測的區塊不改。
- requirement「Conversation context does not turn the spectra bridge on」加上這兩處,Example 改名為「what the rule and the skill say about conversation context」並加兩列;規則那一行的檢查改成只看表的下方,偵測表的檢查也比對「對話脈絡」。
- Step 7 的檢查改成比對「僅當 `SPECTRA_BRIDGE_ACTIVE=1`」。

## Non-Goals

- Step 7.1 把主題直接寫進 bridge 檔的 JSON、沒有跳脫(第 1 輪第 8 列):既有的行為,補記在 #524。
- 用規則以外的說法(例如別的語言、別的同義詞)把那個訊號寫回去:規則認不出來,規格已寫明這個限制。
- ASSUMPTION: 不升版號,CHANGELOG 改寫既有的 Unreleased 條目。

## Success Criteria

- 第 1 輪的函式配上新的表,有列會失敗;新的函式 29 列全過。
- 每一個切點、每一個字、每一個步驟各改壞一次,至少有一列失敗。
- `idd-comment` 的兩個檢查在改 skill 之前失敗;把規則那一行搬到表的上方時,檢查失敗。
- `spectra-bridge-detect` 在 bash 5 與 macOS 內建的 bash 3.2 都通過,`LC_ALL=C` 之下也通過;run-all-tests 的全部 suite 與 spectra-archive-post-ic 通過;連結檢查回 ok。

## Capabilities

### New Capabilities

(none)

### Modified Capabilities

- `spectra-bridge-detection`: 判斷規則寫成明確的步驟;對話脈絡不是訊號這件事也寫進 `idd-comment`。

## Impact

- Affected specs: spectra-bridge-detection(MODIFIED requirement「Open Spectra changes do not turn the spectra bridge on」與「Conversation context does not turn the spectra bridge on」)
- Affected code:
- Modified: plugins/issue-driven-dev/skills/idd-comment/SKILL.md
- Modified: plugins/issue-driven-dev/scripts/tests/spectra-bridge-detect/test.sh
- Modified: plugins/issue-driven-dev/CHANGELOG.md
Loading
Loading