Skip to content

[enhancement] Phase 0.4 leading-whitespace tolerance for CommonMark indent (verify follow-up from #53) #64

@kiki830621

Description

@kiki830621

Problem

From verification of #53 (PR #58):
「Leading whitespace narrowing — ## Diagnosis (CommonMark legitimate 1-3 space indent) 從 substring true → 新 anchored regex false。Canonical IDD diagnosis comments 為 col-0,實務上不會踩到;但若 user 手動 paste 帶 indent 會 false-negative」
— Source: team:devils-advocate (HIGH self-rated) + codex (ACCEPTED RISK)

新 regex test("(?m)^## Diagnosis") 在嚴格 line-start anchor 下,完全排除 CommonMark spec 允許的 1-3 space leading indent ATX heading。

Type

enhancement (regex precision)

Priority

P3 (canonical IDD never hits; risk only on user manual paste)

Trigger scenario

GitHub comment body contains:
   ## Diagnosis     ← 3-space indent, CommonMark legitimate H2
   ...content...

Phase 0.4 detection:
- old contains("## Diagnosis") → true
- new test("(?m)^## Diagnosis") → false
- result: chain-shell falsely concludes "no diagnosis", prompts user re-run

Acceptance

  • Decide: tolerate 1-3 space indent (CommonMark spec) OR keep strict col-0 (IDD canonical)
  • If tolerate: regex → test("(?m)^[ \\t]{0,3}## Diagnosis"),smoke test 加 case 5 ( ## Diagnosis\n → true)
  • If strict: doc add SKILL.md Step 0.4 footnote 「detection requires col-0 heading per IDD canonical convention」

Related

Source: surfaced during /idd-verify --pr 58 (cluster #49 #53), Step 5b triage. Master report: #58 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions