From b6291b7aba68f4d10f3088abfed766e5b73d7c9f Mon Sep 17 00:00:00 2001 From: che cheng Date: Fri, 13 Nov 2026 10:31:53 +0800 Subject: [PATCH 1/4] fix: conversation context is not a spectra bridge signal (#525) The detection table of rules/spectra-bridge.md listed "Conversation context" as a fourth signal, but idd-comment Step 0.7 reads three and the skill does not ask the model to judge. The row is removed and the rule says that a call made in the middle of a spectra-discuss session passes --resume-spectra; the maintainer chose not to add an automatic path. The line count of the rule is unchanged, so Hard rule 6 stays on line 116. The spectra-bridge-detect suite gains checks for three gaps left by the verify of #502: both bridge files present (only the one at the new path counts), the sentences that list the signals read clause by clause (open changes listed again in Chinese are caught, the remark that they do not count is not), and the heading of Step 7. The detection block is unchanged. The change idd-525-conversation-context-not-a-signal modifies the requirement of spectra-bridge-detection and adds one. --- .../.idd/attachments/issue-525/_manifest.json | 6 ++ .../.openspec.yaml | 4 + .../proposal.md | 54 +++++++++++++ .../specs/spectra-bridge-detection/spec.md | 77 +++++++++++++++++++ .../tasks.md | 15 ++++ plugins/issue-driven-dev/CHANGELOG.md | 9 +++ .../issue-driven-dev/rules/spectra-bridge.md | 2 +- .../tests/spectra-bridge-detect/test.sh | 67 +++++++++++++--- 8 files changed, 224 insertions(+), 10 deletions(-) create mode 100644 .claude/.idd/attachments/issue-525/_manifest.json create mode 100644 openspec/changes/idd-525-conversation-context-not-a-signal/.openspec.yaml create mode 100644 openspec/changes/idd-525-conversation-context-not-a-signal/proposal.md create mode 100644 openspec/changes/idd-525-conversation-context-not-a-signal/specs/spectra-bridge-detection/spec.md create mode 100644 openspec/changes/idd-525-conversation-context-not-a-signal/tasks.md diff --git a/.claude/.idd/attachments/issue-525/_manifest.json b/.claude/.idd/attachments/issue-525/_manifest.json new file mode 100644 index 00000000..52a7a99c --- /dev/null +++ b/.claude/.idd/attachments/issue-525/_manifest.json @@ -0,0 +1,6 @@ +{ + "issue": 525, + "fetched_at": "2026-11-13T02:04:00Z", + "fetched_by": "idd-diagnose", + "files": [] +} diff --git a/openspec/changes/idd-525-conversation-context-not-a-signal/.openspec.yaml b/openspec/changes/idd-525-conversation-context-not-a-signal/.openspec.yaml new file mode 100644 index 00000000..4fe31b09 --- /dev/null +++ b/openspec/changes/idd-525-conversation-context-not-a-signal/.openspec.yaml @@ -0,0 +1,4 @@ +schema: spec-driven +created: 2026-11-13 +created_by: che cheng +created_with: claude diff --git a/openspec/changes/idd-525-conversation-context-not-a-signal/proposal.md b/openspec/changes/idd-525-conversation-context-not-a-signal/proposal.md new file mode 100644 index 00000000..ae9455cb --- /dev/null +++ b/openspec/changes/idd-525-conversation-context-not-a-signal/proposal.md @@ -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 diff --git a/openspec/changes/idd-525-conversation-context-not-a-signal/specs/spectra-bridge-detection/spec.md b/openspec/changes/idd-525-conversation-context-not-a-signal/specs/spectra-bridge-detection/spec.md new file mode 100644 index 00000000..e83f7ec2 --- /dev/null +++ b/openspec/changes/idd-525-conversation-context-not-a-signal/specs/spectra-bridge-detection/spec.md @@ -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=""` 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` | diff --git a/openspec/changes/idd-525-conversation-context-not-a-signal/tasks.md b/openspec/changes/idd-525-conversation-context-not-a-signal/tasks.md new file mode 100644 index 00000000..d4efd83f --- /dev/null +++ b/openspec/changes/idd-525-conversation-context-not-a-signal/tasks.md @@ -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。 diff --git a/plugins/issue-driven-dev/CHANGELOG.md b/plugins/issue-driven-dev/CHANGELOG.md index e8f201bd..96cb36de 100644 --- a/plugins/issue-driven-dev/CHANGELOG.md +++ b/plugins/issue-driven-dev/CHANGELOG.md @@ -41,6 +41,15 @@ Version number left to the release. detection no longer runs `spectra`. `rules/spectra-bridge.md` and the summaries in the plugin's CLAUDE.md and README list the same three signals; the two summaries used to say the bridge file only had to exist. A new capability, `spectra-bridge-detection`, states this, and a new suite, spectra-bridge-detect, runs the block one signal at a time. +- **Conversation context is not a spectra bridge signal (#525).** The detection table of `rules/spectra-bridge.md` + had a fourth row, "Conversation context", although nothing in `/idd-comment` reads the conversation: Step 0.7 + checks three signals, and the skill does not ask the model to judge. The row is removed, and the rule now says + that a call made in the middle of a spectra-discuss session passes `--resume-spectra=""`; the maintainer + chose not to add an automatic path. The `spectra-bridge-detection` capability says the same and no longer has a + line without an executable check. The spectra-bridge-detect suite gains three kinds of check: when both bridge + files exist only the one at the new path counts; the sentences that list the signals are read clause by clause, + so open changes listed again in Chinese are caught while the remark that they do not count is not; and Step 7 + is headed as applying only when the bridge is on. The detection block itself is unchanged. ## [4.0.1] - 2026-11-11 diff --git a/plugins/issue-driven-dev/rules/spectra-bridge.md b/plugins/issue-driven-dev/rules/spectra-bridge.md index ef943b83..22e656b8 100644 --- a/plugins/issue-driven-dev/rules/spectra-bridge.md +++ b/plugins/issue-driven-dev/rules/spectra-bridge.md @@ -35,10 +35,10 @@ An IDD skill is "in a spectra context" if **any** of these signals are true: | `--resume-spectra=""` flag | explicit | 100% | | `--source` argument contains `spectra-discuss` | explicit-ish | 95% | | `.claude/.idd/state/bridge.json` exists with `active_spectra_session: true` | written by spectra (future contract) | 100% | -| Conversation context (skill caller knows it was launched from spectra) | implicit | varies | If at least one signal fires → set `SPECTRA_BRIDGE_ACTIVE=1`. Otherwise, no bridge action. Open Spectra changes in the repository are **not** a signal (#502): they describe the repository, not where this call came from, so detection never runs `spectra`. +Conversation context is not a signal either (#525): what the model running the skill knows about the session does not turn the bridge on, so a call made in the middle of a spectra-discuss session passes `--resume-spectra=""`. ## Bookmark file (Step N before exit) diff --git a/plugins/issue-driven-dev/scripts/tests/spectra-bridge-detect/test.sh b/plugins/issue-driven-dev/scripts/tests/spectra-bridge-detect/test.sh index 8cb54379..aca99625 100755 --- a/plugins/issue-driven-dev/scripts/tests/spectra-bridge-detect/test.sh +++ b/plugins/issue-driven-dev/scripts/tests/spectra-bridge-detect/test.sh @@ -1,12 +1,16 @@ #!/usr/bin/env bash -# test.sh — which signals turn the spectra bridge on (#502) +# test.sh — which signals turn the spectra bridge on (#502, #525) # spec-example: spectra-bridge-detection / what turns the spectra bridge on # spec-example: spectra-bridge-detection / where the bridge signals are listed +# spec-example: spectra-bridge-detection / which wordings list open changes as a signal +# spec-example: spectra-bridge-detection / Step 7 applies only when the bridge is on +# spec-example: spectra-bridge-detection / what the rule says about conversation context # # idd-comment Step 0.7 decides whether the call came from a spectra-discuss session. It used to say yes # whenever the repository had any open Spectra change (#126, #502). This suite takes the bash block out of # SKILL.md and runs it, one signal at a time, in an empty directory with a stand-in `spectra` on PATH that -# reports open changes and writes down every call. It then reads the four places that list the signals. +# reports open changes and writes down every call. It then reads the four places that list the signals, the +# heading of Step 7, and what the rule says about conversation context (#525). set -u HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" . "$HERE/../../lib/assert-helpers.sh" @@ -62,26 +66,71 @@ world "$NONE"; bridge_file .claude/state/idd-bridge.json true assert_eq "只有舊路徑的 bridge 檔(active_spectra_session: true)→ 啟動" "1" "$(detect "" "")" world "$EIGHT"; bridge_file .claude/.idd/state/bridge.json false assert_eq "bridge 檔的 active_spectra_session 是 false,另有 8 個開著的 change → 不啟動" "0" "$(detect "" "")" -assert_eq "七列都沒有呼叫 spectra" "" "$(cat "$W/calls.log")" +world "$NONE"; bridge_file .claude/.idd/state/bridge.json false; bridge_file .claude/state/idd-bridge.json true +assert_eq "新路徑的檔是 false、舊路徑的檔是 true → 不啟動(兩個檔都在時只讀新路徑的)" "0" "$(detect "" "")" +assert_eq "八列都沒有呼叫 spectra" "" "$(cat "$W/calls.log")" -# ── Example: where the bridge signals are listed ── -OPEN_CHANGES='spectra list|[Ii]n-flight|[Oo]pen [A-Za-z ]*changes?' # for table rows: no row may be about open changes -LISTED='spectra list|[Ii]n-flight' # for a sentence that may say they are NOT a signal +# ── Example: which wordings list open changes as a signal (one check per row) ── +# lists_open_changes → succeeds when some clause of it mentions open or in-flight Spectra changes and +# that clause does not say they do not count. Clauses end at a bracket, a full stop or a semicolon, in either +# script. The sentence is cut with the shell's own substitution and the patterns are plain alternations: a bracket +# expression holding CJK punctuation would match single bytes under LC_ALL=C. +MENTION='spectra list|[Ii]n-flight|[Oo]pen [A-Za-z ]*changes?|開著的.*change|進行中的.*change|未封存的.*change' +REMARK='不算|不是訊號|not a signal|not signals' +lists_open_changes() { + local s="$1" sep nl=' +' + for sep in '(' ')' '(' ')' ';' '。' '; ' '. '; do s=${s//$sep/$nl}; done + printf '%s\n' "$s" | grep -E -- "$MENTION" | grep -Ev -- "$REMARK" | grep -q . +} +require "中文,列在訊號之中 → 算列入" \ + lists_open_changes '--source 含 spectra-discuss、repo 裡有開著的 Spectra change — 任一觸發' +require "英文,列在訊號之中 → 算列入" \ + lists_open_changes '--source contains spectra-discuss, or the repository has open Spectra changes → on' +require "寫成 spectra list 的結果 → 算列入" \ + lists_open_changes '--source contains spectra-discuss, or spectra list shows a change → on' +require "寫成 in-flight 的 change → 算列入" \ + lists_open_changes '--source contains spectra-discuss, or an in-flight Spectra change → on' +refute "只有括號裡「不算」的說明(中文)→ 不算列入" \ + lists_open_changes '--source 含 spectra-discuss — 任一觸發(repo 裡有開著的 Spectra change 不算,#502)' +refute "只有另一句 not a signal 的說明(英文)→ 不算列入" \ + lists_open_changes '--source contains spectra-discuss → on. Open Spectra changes in the repository are not a signal (#502)' +require "列在訊號之中,同一句另有「不算」的說明 → 仍然算列入" \ + lists_open_changes '--source 含 spectra-discuss、repo 裡有開著的 change — 任一觸發(repo 裡有開著的 Spectra change 不算,#502)' +# ── Example: where the bridge signals are listed ── +# A table row may not mention open changes at all; a sentence may, as long as it only says they do not count. RULE_ROWS=$(awk '/^## Detection/{f=1; next} f && /^## /{exit} f && /^\|/' "$RULE") assert_true "規則的偵測表抽得出來" '[ "$(printf "%s\n" "$RULE_ROWS" | grep -c .)" -ge 4 ]' -refute_grep_re "規則的偵測表沒有把開著的 change 列為訊號" "$OPEN_CHANGES" "$RULE_ROWS" +refute_grep_re "規則的偵測表沒有把開著的 change 列為訊號" "$MENTION" "$RULE_ROWS" assert_grep "規則的偵測表寫的是 bridge 檔的 active_spectra_session" 'active_spectra_session' "$RULE_ROWS" TASK_LINE=$(grep -F 'name="detect_spectra_context"' "$SKILL") assert_eq "idd-comment 只有一個 detect_spectra_context 的 task 描述" "1" "$(printf '%s\n' "$TASK_LINE" | grep -c .)" -refute_grep_re "task 描述沒有把開著的 change 列為訊號" "$LISTED" "$TASK_LINE" +refute "task 描述沒有把開著的 change 列為訊號" lists_open_changes "$TASK_LINE" for doc in CLAUDE.md README.md; do LINE=$(grep -F 'Step 0.7 Detect' "$PLUGIN/$doc") assert_eq "$doc 只有一句列出訊號" "1" "$(printf '%s\n' "$LINE" | grep -c .)" - refute_grep_re "$doc 那一句沒有把開著的 change 列為訊號" "$LISTED" "$LINE" + refute "$doc 那一句沒有把開著的 change 列為訊號" lists_open_changes "$LINE" assert_grep "$doc 那一句寫的是 bridge 檔的 active_spectra_session" 'active_spectra_session' "$LINE" done +# ── Example: Step 7 applies only when the bridge is on ── +STEP7=$(grep -E '^### Step 7' "$SKILL") +assert_eq "idd-comment 只有一個 Step 7 的標題" "1" "$(printf '%s\n' "$STEP7" | grep -c .)" +assert_grep "Step 7 的標題寫明只在 SPECTRA_BRIDGE_ACTIVE=1 時執行" 'SPECTRA_BRIDGE_ACTIVE=1' "$STEP7" + +# ── Example: what the rule says about conversation context (four checks for the first row, one for the second, three for the third) ── +SIGNAL_ROWS=$(printf '%s\n' "$RULE_ROWS" | sed '1,2d') # without the header row and the |---| row +assert_eq "規則的偵測表剛好三列訊號" "3" "$(printf '%s\n' "$SIGNAL_ROWS" | grep -c .)" +assert_grep "三列訊號之一是 --resume-spectra 旗標" '--resume-spectra' "$SIGNAL_ROWS" +assert_grep "三列訊號之一是 --source 引數" '--source' "$SIGNAL_ROWS" +assert_grep "三列訊號之一是 bridge 檔" 'bridge.json' "$SIGNAL_ROWS" +refute_grep_re "偵測表沒有任何一列提到對話脈絡" '[Cc]onversation context|[Ii]mplicit' "$RULE_ROWS" +RULE_NOTE=$(awk '/^## Detection/{f=1; next} f && /^## /{exit} f && !/^\|/' "$RULE" | grep -E -- '[Cc]onversation context is not a signal') +assert_eq "表的下方有一行寫明對話脈絡不是訊號" "1" "$(printf '%s\n' "$RULE_NOTE" | grep -c .)" +assert_grep "同一行寫明從 spectra-discuss 中途呼叫要帶 --resume-spectra" '--resume-spectra' "$RULE_NOTE" +assert_grep "同一行說的是 spectra-discuss 的討論中途" 'spectra-discuss' "$RULE_NOTE" + print_summary "spectra-bridge-detect" From 6cdae05d0327251fe9e67cbc0f605234b39ac733 Mon Sep 17 00:00:00 2001 From: che cheng Date: Fri, 13 Nov 2026 10:32:18 +0800 Subject: [PATCH 2/4] chore: archive idd-525-conversation-context-not-a-signal (#525) --- .../.openspec.yaml | 2 + .../proposal.md | 0 .../specs/spectra-bridge-detection/spec.md | 0 .../tasks.md | 0 .../specs/spectra-bridge-detection/spec.md | 47 +++++++++++++++++-- 5 files changed, 45 insertions(+), 4 deletions(-) rename openspec/changes/{idd-525-conversation-context-not-a-signal => archive/2026-11-13-idd-525-conversation-context-not-a-signal}/.openspec.yaml (60%) rename openspec/changes/{idd-525-conversation-context-not-a-signal => archive/2026-11-13-idd-525-conversation-context-not-a-signal}/proposal.md (100%) rename openspec/changes/{idd-525-conversation-context-not-a-signal => archive/2026-11-13-idd-525-conversation-context-not-a-signal}/specs/spectra-bridge-detection/spec.md (100%) rename openspec/changes/{idd-525-conversation-context-not-a-signal => archive/2026-11-13-idd-525-conversation-context-not-a-signal}/tasks.md (100%) diff --git a/openspec/changes/idd-525-conversation-context-not-a-signal/.openspec.yaml b/openspec/changes/archive/2026-11-13-idd-525-conversation-context-not-a-signal/.openspec.yaml similarity index 60% rename from openspec/changes/idd-525-conversation-context-not-a-signal/.openspec.yaml rename to openspec/changes/archive/2026-11-13-idd-525-conversation-context-not-a-signal/.openspec.yaml index 4fe31b09..2237f425 100644 --- a/openspec/changes/idd-525-conversation-context-not-a-signal/.openspec.yaml +++ b/openspec/changes/archive/2026-11-13-idd-525-conversation-context-not-a-signal/.openspec.yaml @@ -2,3 +2,5 @@ schema: spec-driven created: 2026-11-13 created_by: che cheng created_with: claude +archived_by: che cheng +archived_at: 2026-11-13 diff --git a/openspec/changes/idd-525-conversation-context-not-a-signal/proposal.md b/openspec/changes/archive/2026-11-13-idd-525-conversation-context-not-a-signal/proposal.md similarity index 100% rename from openspec/changes/idd-525-conversation-context-not-a-signal/proposal.md rename to openspec/changes/archive/2026-11-13-idd-525-conversation-context-not-a-signal/proposal.md diff --git a/openspec/changes/idd-525-conversation-context-not-a-signal/specs/spectra-bridge-detection/spec.md b/openspec/changes/archive/2026-11-13-idd-525-conversation-context-not-a-signal/specs/spectra-bridge-detection/spec.md similarity index 100% rename from openspec/changes/idd-525-conversation-context-not-a-signal/specs/spectra-bridge-detection/spec.md rename to openspec/changes/archive/2026-11-13-idd-525-conversation-context-not-a-signal/specs/spectra-bridge-detection/spec.md diff --git a/openspec/changes/idd-525-conversation-context-not-a-signal/tasks.md b/openspec/changes/archive/2026-11-13-idd-525-conversation-context-not-a-signal/tasks.md similarity index 100% rename from openspec/changes/idd-525-conversation-context-not-a-signal/tasks.md rename to openspec/changes/archive/2026-11-13-idd-525-conversation-context-not-a-signal/tasks.md diff --git a/openspec/specs/spectra-bridge-detection/spec.md b/openspec/specs/spectra-bridge-detection/spec.md index 3054ce98..68f1ec15 100644 --- a/openspec/specs/spectra-bridge-detection/spec.md +++ b/openspec/specs/spectra-bridge-detection/spec.md @@ -8,16 +8,14 @@ Defines which signals tell an IDD skill that it was called in the middle of a sp ### 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. 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: 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. Those two sentences SHALL name `active_spectra_session` for the bridge file. - -No executable check: the row "Conversation context" of the rule's table is judged by the model that runs the skill and is not part of the block; what the skill does once the bridge is on (Step 7) is carried out by that model too. +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`, no bookmark is written and no resume prompt is printed +- **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 @@ -32,6 +30,7 @@ In every row the block does not run `spectra`. | 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 @@ -41,3 +40,43 @@ In every row the block does not run `spectra`. | 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` | + +--- +### 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=""` 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` | From a8b3bad4de114808d5be21a024a29b42588194a9 Mon Sep 17 00:00:00 2001 From: che cheng Date: Fri, 13 Nov 2026 11:06:10 +0800 Subject: [PATCH 3/4] fix: spell out the wording rule for bridge signals and state the conversation rule in idd-comment (#525) Round 1 of the verify found that the check for "does this sentence list open changes as a signal" and the spec described two different rules: the spec said clauses end at a semicolon and that a remark says they "do not count", the function cut only at a semicolon followed by a space and did not know that wording; an unrelated remark after a comma hid a listing; Chinese wordings were only caught when the English word change followed. The spec now gives the rule in four steps and says that wordings outside it are not recognised. Its Example table has 29 rows, and the suite reads the rows from the spec and runs the rule on each, so the table and the checks cannot differ. idd-comment did not say what the rule file says. Step 0.7 now has a line under its block (conversation context is not a signal; pass --resume-spectra from a spectra-discuss session), and the rule that a spectra context must not be ignored silently refers to the result of Step 0.7 and says it is not inferred from the conversation. The detection block is unchanged. The check for the rule's note looks only below the table, the table check also matches the Chinese term, and the Step 7 check matches the words "only when". --- openspec/changes/idd-525-fix1/.openspec.yaml | 4 + openspec/changes/idd-525-fix1/proposal.md | 53 +++++++++ .../specs/spectra-bridge-detection/spec.md | 108 ++++++++++++++++++ openspec/changes/idd-525-fix1/tasks.md | 14 +++ plugins/issue-driven-dev/CHANGELOG.md | 13 ++- .../tests/spectra-bridge-detect/test.sh | 83 ++++++++------ .../skills/idd-comment/SKILL.md | 4 +- 7 files changed, 240 insertions(+), 39 deletions(-) create mode 100644 openspec/changes/idd-525-fix1/.openspec.yaml create mode 100644 openspec/changes/idd-525-fix1/proposal.md create mode 100644 openspec/changes/idd-525-fix1/specs/spectra-bridge-detection/spec.md create mode 100644 openspec/changes/idd-525-fix1/tasks.md diff --git a/openspec/changes/idd-525-fix1/.openspec.yaml b/openspec/changes/idd-525-fix1/.openspec.yaml new file mode 100644 index 00000000..4fe31b09 --- /dev/null +++ b/openspec/changes/idd-525-fix1/.openspec.yaml @@ -0,0 +1,4 @@ +schema: spec-driven +created: 2026-11-13 +created_by: che cheng +created_with: claude diff --git a/openspec/changes/idd-525-fix1/proposal.md b/openspec/changes/idd-525-fix1/proposal.md new file mode 100644 index 00000000..b044a811 --- /dev/null +++ b/openspec/changes/idd-525-fix1/proposal.md @@ -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 diff --git a/openspec/changes/idd-525-fix1/specs/spectra-bridge-detection/spec.md b/openspec/changes/idd-525-fix1/specs/spectra-bridge-detection/spec.md new file mode 100644 index 00000000..a27cdb2d --- /dev/null +++ b/openspec/changes/idd-525-fix1/specs/spectra-bridge-detection/spec.md @@ -0,0 +1,108 @@ +## 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, whether the sentence is in English or in Chinese: 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. A row of the detection table SHALL NOT mention Spectra changes at all; for the three sentences, the wording rule of the Example "which wordings list open changes as a signal" tells a listing from a remark, and a wording outside that rule is not recognised. 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 + +The wording rule, in four steps: + +1. The sentence is cut into clauses at every bracket (`(`, `)`, `(`, `)`), comma (`,`, `,`, `、`), semicolon (`;`, `;`), ideographic full stop (`。`) and full stop followed by a space. +2. A clause mentions Spectra changes when it holds a word that starts with `change` or `Change`, or one of `變更`, `提案`, `spectra list`, `in-flight`, `In-flight`. +3. A clause that mentions them is a remark when one of these comes after the mention in the same clause: `不算`, `不是訊號`, `not a signal`, `not signals`, `do not count`, `does not count`, `don't count`, `not counted`. +4. The sentence lists open changes as a signal when at least one clause mentions them and is not a remark. + +The suite reads the rows of this table and runs the rule on each sentence. + +| 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 one → on | yes | +| --source contains spectra-discuss, or an in-flight proposal → on | yes | +| In-flight proposals turn it on | yes | +| Changes left open turn it on | yes | +| --source 含 spectra-discuss、repo 裡有進行中的變更 — 任一觸發 | yes | +| --source 含 spectra-discuss、repo 裡有尚未封存的提案 — 任一觸發 | 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 contains spectra-discuss → on. Open Spectra changes do not count (#502) | no | +| 開著的 change 不是訊號 | no | +| Open changes are not signals | no | +| An open change does not count | no | +| Open changes don't count | no | +| Open changes are not counted | no | +| --source contains spectra-discuss and the default is unchanged → on | no | +| --source 含 spectra-discuss、repo 裡有開著的 change — 任一觸發(repo 裡有開著的 Spectra change 不算,#502) | yes | +| --source contains spectra-discuss, or open Spectra changes → on;Open Spectra changes are not a signal | yes | +| --source 含 spectra-discuss、repo 裡有開著的 change — 任一觸發,對話脈絡不算 | yes | +| --source 含 spectra-discuss、repo 裡有開著的 change 也算、舊路徑不算 | yes | +| --source 含 spectra-discuss。repo 裡有開著的 change 算。其他不算 | yes | +| --source 含 spectra-discuss — 任一觸發;repo 裡有開著的 change 算;其他不算 | yes | +| --source contains spectra-discuss, or open Spectra changes → on, and a false bridge file is not a signal | yes | +| Open Spectra changes turn it on. The legacy path does not count | yes | +| --source contains spectra-discuss, or open Spectra changes (a false bridge file is not a signal) → on | yes | +| --source 含 spectra-discuss、repo 裡有開著的 change 算(舊路徑不算) | yes | +| --source 含 spectra-discuss — 任一觸發;其他不算但 repo 裡有開著的 change 算 | yes | +| --source 含 spectra-discuss — 任一觸發;repo 裡有開著的 Spectra change(#502)不算 | yes | + +Rows 18 to 27 each hold a listing next to a remark that sits in another clause. In row 28 the remark comes before the mention. In row 29 a bracket ends the clause before the remark, so the sentence counts as a listing: a remark has to follow the mention inside one clause. + +##### Example: Step 7 applies only when the bridge is on + +| Place | Says | +| --- | --- | +| the heading of Step 7 in `skills/idd-comment/SKILL.md` | `僅當 SPECTRA_BRIDGE_ACTIVE=1` (only when it is 1) | + +### 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`. Below its block, Step 0.7 of `skills/idd-comment/SKILL.md` SHALL say the same in one line that names `--resume-spectra`. The skill's rule that a spectra context must not be ignored silently SHALL tie the resume prompt to `SPECTRA_BRIDGE_ACTIVE=1` and SHALL say that this is not inferred from the conversation. + +#### 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=""` turns the bridge on + +##### Example: what the rule and the skill say about conversation context + +| Place | What it holds | +| --- | --- | +| the signal rows of the detection table in `rules/spectra-bridge.md` | three: the `--resume-spectra` flag, the `--source` argument, the bridge file | +| every row of that table | no mention of conversation context, in English or as `對話脈絡` | +| the text below that table, inside the Detection section | one line that says conversation context is not a signal and that a call from a spectra-discuss session passes `--resume-spectra` | +| the text below the block of Step 0.7 in `skills/idd-comment/SKILL.md` | one line that says `對話脈絡` is not a signal (`不是訊號`) and names `--resume-spectra` | +| the rule `Spectra context 不可靜默忽略` in the same file | names `SPECTRA_BRIDGE_ACTIVE=1` and says `不從對話推斷` (not inferred from the conversation) | diff --git a/openspec/changes/idd-525-fix1/tasks.md b/openspec/changes/idd-525-fix1/tasks.md new file mode 100644 index 00000000..9963e6c3 --- /dev/null +++ b/openspec/changes/idd-525-fix1/tasks.md @@ -0,0 +1,14 @@ +## 1. 測試先行 + +- [x] 1.1 判斷規則照規格的四個步驟實作,資料取自規格:依 requirement「Open Spectra changes do not turn the spectra bridge on」的 Example「which wordings list open changes as a signal」,suite spectra-bridge-detect 從主規格讀這張表(29 列),逐列執行規則;函式在括號、逗號、頓號、分號(有沒有空白都算)、句號切子句,「不算」的說明要寫在提到之後;測試檔帶標記 spec-example: spectra-bridge-detection / which wordings list open changes as a signal。驗證:把函式換回第 1 輪的版本,有列失敗;每一個切點、每一個字、每一個步驟各改壞一次,至少有一列失敗。 +- [x] 1.2 規則與 skill 怎麼寫對話脈絡有檢查:依 requirement「Conversation context does not turn the spectra bridge on」的 Example「what the rule and the skill say about conversation context」,規則那一行只在偵測表的下方找;偵測表每一列不提對話脈絡,中英文都比對;idd-comment Step 0.7 區塊下方有一行寫明對話脈絡不是訊號並點名 --resume-spectra;鐵律「Spectra context 不可靜默忽略」點名 SPECTRA_BRIDGE_ACTIVE=1 並寫明不從對話推斷;測試檔帶標記 spec-example: spectra-bridge-detection / what the rule and the skill say about conversation context。驗證:改 skill 之前,skill 的五個檢查失敗;把規則那一行搬到表的上方時檢查失敗。 +- [x] 1.3 Step 7 的檢查比對「僅當 SPECTRA_BRIDGE_ACTIVE=1」:依 Example「Step 7 applies only when the bridge is on」;測試檔帶標記 spec-example: spectra-bridge-detection / Step 7 applies only when the bridge is on。驗證:把標題的「僅當」改成「當」時檢查失敗。 + +## 2. skill + +- [x] 2.1 skills/idd-comment/SKILL.md:Step 0.7 區塊下方加一行(對話脈絡不是訊號,從 spectra-discuss 的討論中途呼叫要帶 --resume-spectra);鐵律「Spectra context 不可靜默忽略」改成 Step 0.7 判定 SPECTRA_BRIDGE_ACTIVE=1 時必須印 resume prompt,並寫明這個判定不從對話推斷。偵測的區塊不改。驗證:1.2 全部通過;Example「what turns the spectra bridge on」的八列照舊通過。 + +## 3. 收尾 + +- [x] 3.1 CHANGELOG 的 Unreleased 條目(#525)照修正後的內容改寫。驗證:相對於 main,git diff 只有新增行。 +- [x] 3.2 跑 spectra-bridge-detect(bash 5、macOS 內建的 bash 3.2、兩者加 LC_ALL=C)、bridge-path 與整套測試(run-all-tests.sh 與 spectra-archive-post-ic)。驗證:結束碼都是 0。 diff --git a/plugins/issue-driven-dev/CHANGELOG.md b/plugins/issue-driven-dev/CHANGELOG.md index 96cb36de..1d0a4347 100644 --- a/plugins/issue-driven-dev/CHANGELOG.md +++ b/plugins/issue-driven-dev/CHANGELOG.md @@ -45,11 +45,14 @@ Version number left to the release. had a fourth row, "Conversation context", although nothing in `/idd-comment` reads the conversation: Step 0.7 checks three signals, and the skill does not ask the model to judge. The row is removed, and the rule now says that a call made in the middle of a spectra-discuss session passes `--resume-spectra=""`; the maintainer - chose not to add an automatic path. The `spectra-bridge-detection` capability says the same and no longer has a - line without an executable check. The spectra-bridge-detect suite gains three kinds of check: when both bridge - files exist only the one at the new path counts; the sentences that list the signals are read clause by clause, - so open changes listed again in Chinese are caught while the remark that they do not count is not; and Step 7 - is headed as applying only when the bridge is on. The detection block itself is unchanged. + chose not to add an automatic path. `idd-comment` says the same below the Step 0.7 block, and its rule that a + spectra context must not be ignored silently now refers to the result of Step 0.7 and says that it is not + inferred from the conversation. The `spectra-bridge-detection` capability states all of this and no longer has + a line without an executable check. The spectra-bridge-detect suite gains three kinds of check: when both + bridge files exist only the one at the new path counts; the sentences that list the signals are read clause by + clause, by a wording rule written out in the spec whose Example table the suite reads, so open changes listed + again in Chinese are caught while a remark that they do not count is not; and Step 7 is headed as applying only + when the bridge is on. The detection block itself is unchanged. ## [4.0.1] - 2026-11-11 diff --git a/plugins/issue-driven-dev/scripts/tests/spectra-bridge-detect/test.sh b/plugins/issue-driven-dev/scripts/tests/spectra-bridge-detect/test.sh index aca99625..f14d2f8e 100755 --- a/plugins/issue-driven-dev/scripts/tests/spectra-bridge-detect/test.sh +++ b/plugins/issue-driven-dev/scripts/tests/spectra-bridge-detect/test.sh @@ -4,19 +4,21 @@ # spec-example: spectra-bridge-detection / where the bridge signals are listed # spec-example: spectra-bridge-detection / which wordings list open changes as a signal # spec-example: spectra-bridge-detection / Step 7 applies only when the bridge is on -# spec-example: spectra-bridge-detection / what the rule says about conversation context +# spec-example: spectra-bridge-detection / what the rule and the skill say about conversation context # # idd-comment Step 0.7 decides whether the call came from a spectra-discuss session. It used to say yes # whenever the repository had any open Spectra change (#126, #502). This suite takes the bash block out of # SKILL.md and runs it, one signal at a time, in an empty directory with a stand-in `spectra` on PATH that # reports open changes and writes down every call. It then reads the four places that list the signals, the -# heading of Step 7, and what the rule says about conversation context (#525). +# heading of Step 7, and what the rule and the skill say about conversation context (#525). The sentences for the +# wording rule come from the Example table in the capability's spec, so the table and the checks cannot differ. set -u HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" . "$HERE/../../lib/assert-helpers.sh" PLUGIN="$HERE/../../.." SKILL="$PLUGIN/skills/idd-comment/SKILL.md" RULE="$PLUGIN/rules/spectra-bridge.md" +SPEC="$PLUGIN/../../openspec/specs/spectra-bridge-detection/spec.md" W="$(mktemp -d)"; trap 'rm -rf "$W"' EXIT # ── The block: the first bash fence under the "### Step 0.7" heading ── @@ -70,39 +72,39 @@ world "$NONE"; bridge_file .claude/.idd/state/bridge.json false; bridge_file .cl assert_eq "新路徑的檔是 false、舊路徑的檔是 true → 不啟動(兩個檔都在時只讀新路徑的)" "0" "$(detect "" "")" assert_eq "八列都沒有呼叫 spectra" "" "$(cat "$W/calls.log")" -# ── Example: which wordings list open changes as a signal (one check per row) ── -# lists_open_changes → succeeds when some clause of it mentions open or in-flight Spectra changes and -# that clause does not say they do not count. Clauses end at a bracket, a full stop or a semicolon, in either -# script. The sentence is cut with the shell's own substitution and the patterns are plain alternations: a bracket -# expression holding CJK punctuation would match single bytes under LC_ALL=C. -MENTION='spectra list|[Ii]n-flight|[Oo]pen [A-Za-z ]*changes?|開著的.*change|進行中的.*change|未封存的.*change' -REMARK='不算|不是訊號|not a signal|not signals' +# ── Example: which wordings list open changes as a signal (one check per row of the table in the spec) ── +# lists_open_changes → succeeds when the sentence lists open changes as a signal, by the four steps of +# the Example. The sentence is cut with the shell's own substitution and the patterns are plain alternations: a +# bracket expression holding CJK punctuation would match single bytes under LC_ALL=C. +MENTION='(^|[^A-Za-z])[Cc]hange|變更|提案|spectra list|[Ii]n-flight' +REMARK="不算|不是訊號|not a signal|not signals|do not count|does not count|don't count|not counted" lists_open_changes() { local s="$1" sep nl=' ' - for sep in '(' ')' '(' ')' ';' '。' '; ' '. '; do s=${s//$sep/$nl}; done - printf '%s\n' "$s" | grep -E -- "$MENTION" | grep -Ev -- "$REMARK" | grep -q . + for sep in '(' ')' '(' ')' ',' ',' '、' ';' ';' '。' '. '; do s=${s//$sep/$nl}; done # step 1: clauses + printf '%s\n' "$s" | grep -E -- "$MENTION" | grep -Ev -- "($MENTION).*($REMARK)" | grep -q . # steps 2 to 4 } -require "中文,列在訊號之中 → 算列入" \ - lists_open_changes '--source 含 spectra-discuss、repo 裡有開著的 Spectra change — 任一觸發' -require "英文,列在訊號之中 → 算列入" \ - lists_open_changes '--source contains spectra-discuss, or the repository has open Spectra changes → on' -require "寫成 spectra list 的結果 → 算列入" \ - lists_open_changes '--source contains spectra-discuss, or spectra list shows a change → on' -require "寫成 in-flight 的 change → 算列入" \ - lists_open_changes '--source contains spectra-discuss, or an in-flight Spectra change → on' -refute "只有括號裡「不算」的說明(中文)→ 不算列入" \ - lists_open_changes '--source 含 spectra-discuss — 任一觸發(repo 裡有開著的 Spectra change 不算,#502)' -refute "只有另一句 not a signal 的說明(英文)→ 不算列入" \ - lists_open_changes '--source contains spectra-discuss → on. Open Spectra changes in the repository are not a signal (#502)' -require "列在訊號之中,同一句另有「不算」的說明 → 仍然算列入" \ - lists_open_changes '--source 含 spectra-discuss、repo 裡有開著的 change — 任一觸發(repo 裡有開著的 Spectra change 不算,#502)' +assert_file_exists "讀得到 capability 的規格" "$SPEC" +WORDING_ROWS=$(awk '/^##### Example: which wordings list open changes as a signal$/{f=1; next} f && /^#/{exit} f && /^\| /' "$SPEC" 2>/dev/null | sed '1,2d') +assert_eq "規格裡這個 Example 的表有 29 列" "29" "$(printf '%s\n' "$WORDING_ROWS" | grep -c .)" +ROW_NO=0 +while IFS= read -r row; do + [ -n "$row" ] || continue + ROW_NO=$((ROW_NO + 1)) + row=${row#| }; row=${row% |} + want=${row##* | }; sentence=${row% | *} + if [ "$want" = yes ]; then require "第 $ROW_NO 列算列入:$sentence" lists_open_changes "$sentence" + elif [ "$want" = no ]; then refute "第 $ROW_NO 列不算列入:$sentence" lists_open_changes "$sentence" + else fail "第 $ROW_NO 列的第二欄是 yes 或 no" "got [$want]"; fi +done < Date: Fri, 13 Nov 2026 11:06:10 +0800 Subject: [PATCH 4/4] chore: archive idd-525-fix1 (#525) --- .../2026-11-13-idd-525-fix1}/.openspec.yaml | 2 + .../2026-11-13-idd-525-fix1}/proposal.md | 0 .../specs/spectra-bridge-detection/spec.md | 0 .../2026-11-13-idd-525-fix1}/tasks.md | 0 .../specs/spectra-bridge-detection/spec.md | 55 +++++++++++++++---- 5 files changed, 46 insertions(+), 11 deletions(-) rename openspec/changes/{idd-525-fix1 => archive/2026-11-13-idd-525-fix1}/.openspec.yaml (60%) rename openspec/changes/{idd-525-fix1 => archive/2026-11-13-idd-525-fix1}/proposal.md (100%) rename openspec/changes/{idd-525-fix1 => archive/2026-11-13-idd-525-fix1}/specs/spectra-bridge-detection/spec.md (100%) rename openspec/changes/{idd-525-fix1 => archive/2026-11-13-idd-525-fix1}/tasks.md (100%) diff --git a/openspec/changes/idd-525-fix1/.openspec.yaml b/openspec/changes/archive/2026-11-13-idd-525-fix1/.openspec.yaml similarity index 60% rename from openspec/changes/idd-525-fix1/.openspec.yaml rename to openspec/changes/archive/2026-11-13-idd-525-fix1/.openspec.yaml index 4fe31b09..2237f425 100644 --- a/openspec/changes/idd-525-fix1/.openspec.yaml +++ b/openspec/changes/archive/2026-11-13-idd-525-fix1/.openspec.yaml @@ -2,3 +2,5 @@ schema: spec-driven created: 2026-11-13 created_by: che cheng created_with: claude +archived_by: che cheng +archived_at: 2026-11-13 diff --git a/openspec/changes/idd-525-fix1/proposal.md b/openspec/changes/archive/2026-11-13-idd-525-fix1/proposal.md similarity index 100% rename from openspec/changes/idd-525-fix1/proposal.md rename to openspec/changes/archive/2026-11-13-idd-525-fix1/proposal.md diff --git a/openspec/changes/idd-525-fix1/specs/spectra-bridge-detection/spec.md b/openspec/changes/archive/2026-11-13-idd-525-fix1/specs/spectra-bridge-detection/spec.md similarity index 100% rename from openspec/changes/idd-525-fix1/specs/spectra-bridge-detection/spec.md rename to openspec/changes/archive/2026-11-13-idd-525-fix1/specs/spectra-bridge-detection/spec.md diff --git a/openspec/changes/idd-525-fix1/tasks.md b/openspec/changes/archive/2026-11-13-idd-525-fix1/tasks.md similarity index 100% rename from openspec/changes/idd-525-fix1/tasks.md rename to openspec/changes/archive/2026-11-13-idd-525-fix1/tasks.md diff --git a/openspec/specs/spectra-bridge-detection/spec.md b/openspec/specs/spectra-bridge-detection/spec.md index 68f1ec15..d101c78a 100644 --- a/openspec/specs/spectra-bridge-detection/spec.md +++ b/openspec/specs/spectra-bridge-detection/spec.md @@ -8,7 +8,7 @@ Defines which signals tell an IDD skill that it was called in the middle of a sp ### 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`. +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, whether the sentence is in English or in Chinese: 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. A row of the detection table SHALL NOT mention Spectra changes at all; for the three sentences, the wording rule of the Example "which wordings list open changes as a signal" tells a listing from a remark, and a wording outside that rule is not recognised. 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 @@ -43,28 +43,59 @@ In every row the block does not run `spectra`. ##### 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. +The wording rule, in four steps: + +1. The sentence is cut into clauses at every bracket (`(`, `)`, `(`, `)`), comma (`,`, `,`, `、`), semicolon (`;`, `;`), ideographic full stop (`。`) and full stop followed by a space. +2. A clause mentions Spectra changes when it holds a word that starts with `change` or `Change`, or one of `變更`, `提案`, `spectra list`, `in-flight`, `In-flight`. +3. A clause that mentions them is a remark when one of these comes after the mention in the same clause: `不算`, `不是訊號`, `not a signal`, `not signals`, `do not count`, `does not count`, `don't count`, `not counted`. +4. The sentence lists open changes as a signal when at least one clause mentions them and is not a remark. + +The suite reads the rows of this table and runs the rule on each sentence. | 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 contains spectra-discuss, or spectra list shows one → on | yes | +| --source contains spectra-discuss, or an in-flight proposal → on | yes | +| In-flight proposals turn it on | yes | +| Changes left open turn it on | yes | +| --source 含 spectra-discuss、repo 裡有進行中的變更 — 任一觸發 | yes | +| --source 含 spectra-discuss、repo 裡有尚未封存的提案 — 任一觸發 | 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 contains spectra-discuss → on. Open Spectra changes do not count (#502) | no | +| 開著的 change 不是訊號 | no | +| Open changes are not signals | no | +| An open change does not count | no | +| Open changes don't count | no | +| Open changes are not counted | no | +| --source contains spectra-discuss and the default is unchanged → on | no | | --source 含 spectra-discuss、repo 裡有開著的 change — 任一觸發(repo 裡有開著的 Spectra change 不算,#502) | yes | +| --source contains spectra-discuss, or open Spectra changes → on;Open Spectra changes are not a signal | yes | +| --source 含 spectra-discuss、repo 裡有開著的 change — 任一觸發,對話脈絡不算 | yes | +| --source 含 spectra-discuss、repo 裡有開著的 change 也算、舊路徑不算 | yes | +| --source 含 spectra-discuss。repo 裡有開著的 change 算。其他不算 | yes | +| --source 含 spectra-discuss — 任一觸發;repo 裡有開著的 change 算;其他不算 | yes | +| --source contains spectra-discuss, or open Spectra changes → on, and a false bridge file is not a signal | yes | +| Open Spectra changes turn it on. The legacy path does not count | yes | +| --source contains spectra-discuss, or open Spectra changes (a false bridge file is not a signal) → on | yes | +| --source 含 spectra-discuss、repo 裡有開著的 change 算(舊路徑不算) | yes | +| --source 含 spectra-discuss — 任一觸發;其他不算但 repo 裡有開著的 change 算 | yes | +| --source 含 spectra-discuss — 任一觸發;repo 裡有開著的 Spectra change(#502)不算 | yes | + +Rows 18 to 27 each hold a listing next to a remark that sits in another clause. In row 28 the remark comes before the mention. In row 29 a bracket ends the clause before the remark, so the sentence counts as a listing: a remark has to follow the mention inside one clause. ##### 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` | +| the heading of Step 7 in `skills/idd-comment/SKILL.md` | `僅當 SPECTRA_BRIDGE_ACTIVE=1` (only when it is 1) | --- ### 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`. +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`. Below its block, Step 0.7 of `skills/idd-comment/SKILL.md` SHALL say the same in one line that names `--resume-spectra`. The skill's rule that a spectra context must not be ignored silently SHALL tie the resume prompt to `SPECTRA_BRIDGE_ACTIVE=1` and SHALL say that this is not inferred from the conversation. #### Scenario: A comment posted in the middle of a spectra-discuss session @@ -73,10 +104,12 @@ What the model that runs a skill knows from the conversation SHALL NOT be a sign - **THEN** `SPECTRA_BRIDGE_ACTIVE` stays `0` - **AND** the same call with `--resume-spectra=""` turns the bridge on -##### Example: what the rule says about conversation context +##### Example: what the rule and the skill say about conversation context -| Part of the Detection section of `rules/spectra-bridge.md` | What it holds | +| Place | 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` | +| the signal rows of the detection table in `rules/spectra-bridge.md` | three: the `--resume-spectra` flag, the `--source` argument, the bridge file | +| every row of that table | no mention of conversation context, in English or as `對話脈絡` | +| the text below that table, inside the Detection section | one line that says conversation context is not a signal and that a call from a spectra-discuss session passes `--resume-spectra` | +| the text below the block of Step 0.7 in `skills/idd-comment/SKILL.md` | one line that says `對話脈絡` is not a signal (`不是訊號`) and names `--resume-spectra` | +| the rule `Spectra context 不可靜默忽略` in the same file | names `SPECTRA_BRIDGE_ACTIVE=1` and says `不從對話推斷` (not inferred from the conversation) |