Problem
idd-diagnose Step 0.5 Clarity Surface gate 用裸 grep + awk 偵測 ### Clarity Surface annotation block,未先剝除 fenced code blocks:
if echo "$BODY" | grep -q '^### Clarity Surface'; then
BLOCK=$(echo "$BODY" | awk '/^### Clarity Surface/{flag=1; print; next} flag && /^### /{flag=0} flag')
SURFACED_COUNT=$(echo "$BLOCK" | grep -cE '\| surfaced \|')
...
當 issue body 在 ``` code fence 內示意一個 Clarity Surface block(例如一個討論 clarity 機制、或記錄 audit-block 結構的 issue),裸 grep 把示意 code 當成真的 annotation block → gate 誤判 → false-positive REFUSE,擋下一個本該 PROCEED 的 diagnose。
Type
bug(spec gap / footgun in published skill — idd-diagnose SKILL.md Step 0.5)
Repro(實證 — dogfood catch)
- Issue body 在 code fence 內含
### Clarity Surface(示意,非真 annotation;body 內無真 surfaced/deferred 表格列)。
- 跑
/idd-diagnose #N。
- Step 0.5 gate 的
grep '^### Clarity Surface' 命中 fence 內那行 → 進 refuse 分支。
實證:診斷 #178 時親自撞到——#178(本 issue 的 parent)body line 10 的 ### Clarity Surface 在 code fence(line 7–14)內,是用來示意 idd-update 吃掉 audit block 的 bug,不是真 annotation。手動數 fence 數量(奇偶)才確認是 false positive、PROCEED;但 SKILL.md 的 gate prose 不做這個剝除,較不謹慎的執行者會被誤導 refuse。
Root cause(初判)
Step 0.5 的 grep/awk 是無語意感知的結構匹配——^### Clarity Surface 在 markdown 語境下,fence 內與 fence 外意義完全不同,但裸 grep 一視同仁。這跟 #178 同屬一個 class(idd-update 用 --- 當錨、本 gate 用 ### Clarity Surface 當錨,都缺 markdown-aware 前處理)。
Suggested fix(方向,待 diagnose 確認)
在 Step 0.5 grep/awk 之前先剝除 fenced code blocks,沿用 idd-list Step 3.5(#14)已驗證的 strip_fenced_code():
FENCE_RE = ```[\s\S]*?``` # 同 idd-list references impl
BODY_STRIPPED = strip_fenced_code(BODY)
# 之後所有 grep '^### Clarity Surface' / surfaced-row count 改用 BODY_STRIPPED
idd-list Step 3.5 早就為完全相同的 false-positive class 加了 strip_fenced_code()(PR-ref scan 把 ```bash Refs #99 ``` 誤當真 ref)——本 gate 應 reuse 同一前處理。Inline code(`### Clarity Surface`)是否也剝可比照 idd-list 決策(idd-list 選擇不剝 inline,false-positive 較罕見)。
Impact
Source: surfaced during /idd-diagnose #178 sister concern surfacing (Step 3.6)
Current Status
Phase: closed
Last updated: 2026-06-01 by idd-close
Key Decisions
Scope Changes
Blocking
Commits
Verification
Problem
idd-diagnoseStep 0.5 Clarity Surface gate 用裸 grep + awk 偵測### Clarity Surfaceannotation block,未先剝除 fenced code blocks:當 issue body 在
```code fence 內示意一個 Clarity Surface block(例如一個討論 clarity 機制、或記錄 audit-block 結構的 issue),裸 grep 把示意 code 當成真的 annotation block → gate 誤判 → false-positive REFUSE,擋下一個本該 PROCEED 的 diagnose。Type
bug(spec gap / footgun in published skill —
idd-diagnoseSKILL.md Step 0.5)Repro(實證 — dogfood catch)
### Clarity Surface(示意,非真 annotation;body 內無真 surfaced/deferred 表格列)。/idd-diagnose #N。grep '^### Clarity Surface'命中 fence 內那行 → 進 refuse 分支。實證:診斷 #178 時親自撞到——#178(本 issue 的 parent)body line 10 的
### Clarity Surface在 code fence(line 7–14)內,是用來示意 idd-update 吃掉 audit block 的 bug,不是真 annotation。手動數 fence 數量(奇偶)才確認是 false positive、PROCEED;但 SKILL.md 的 gate prose 不做這個剝除,較不謹慎的執行者會被誤導 refuse。Root cause(初判)
Step 0.5 的 grep/awk 是無語意感知的結構匹配——
^### Clarity Surface在 markdown 語境下,fence 內與 fence 外意義完全不同,但裸 grep 一視同仁。這跟 #178 同屬一個 class(idd-update 用---當錨、本 gate 用### Clarity Surface當錨,都缺 markdown-aware 前處理)。Suggested fix(方向,待 diagnose 確認)
在 Step 0.5 grep/awk 之前先剝除 fenced code blocks,沿用
idd-listStep 3.5(#14)已驗證的strip_fenced_code():idd-listStep 3.5 早就為完全相同的 false-positive class 加了strip_fenced_code()(PR-ref scan 把```bash Refs #99 ```誤當真 ref)——本 gate 應 reuse 同一前處理。Inline code(`### Clarity Surface`)是否也剝可比照 idd-list 決策(idd-list 選擇不剝 inline,false-positive 較罕見)。Impact
plugins/issue-driven-dev/skills/idd-diagnose/SKILL.md(Step 0.5 gate bash block)。### Clarity Surface的 issue(討論 clarity 機制本身、記錄 IDD body 結構、或像 [bug] idd-update Step 5 'replace below ---' 會誤刪 /idd-issue body 的 audit blocks (Clarity Surface / Linked-Context Siblings) #178 這種 meta issue)會被 gate 誤擋,使用者被迫先 dismiss 一個不存在的 surfaced row 才能 diagnose。Source: surfaced during /idd-diagnose #178 sister concern surfacing (Step 3.6)
Current Status
Phase: closed
Last updated: 2026-06-01 by idd-close
Key Decisions
d2a2607, v2.78.1.Scope Changes
Blocking
Commits
d2a2607fix: strip fenced code in idd-diagnose Step 0.5 Clarity gate before scanning ([bug] idd-diagnose Step 0.5 Clarity gate greps '### Clarity Surface' without stripping code fences → false-positive REFUSE (sister concern from #178) #181)Verification