Skip to content

idd-implement PR body template: anti-trailer warning text triggers auto-close (recursion trap) #74

@kiki830621

Description

@kiki830621

Problem

IDD idd-implement skill 的 PR body template 含 anti-trailer warning text:

**Do NOT add 'Closes #${NUMBER}'** — IDD discipline requires manual /idd-close
after merge to enforce checklist gate + closing summary.

GitHub auto-close regex(\b(closes|fixes|resolves) #(\d+)\b)不識別 context — markdown bold、quotes、「Do NOT」前綴都 ignore,literal substring match → 警告文字本身觸發它警告的行為。

→ 結果:warning 自我打臉,PR merge 時 GitHub literal-match Closes #${NUMBER} 並 auto-close issue,/idd-close 的 checklist gate + closing summary 被 bypass

Reproduction

實測:

  1. /idd-implement 生成 PR body 含 **Do NOT add 'Closes #73'**(literal substring)
  2. PR idd-implement PR body template: anti-trailer warning text triggers auto-close (recursion trap) #74 merged 時間 2026-05-11T23:03:27Z
  3. Issue feat: idd-verify orchestration playbook (5 Agents + Recovery Protocol) #73 auto-closed 時間 2026-05-11T23:03:28Z(1 秒後)
  4. gh api /repos/.../issues/73/timeline 顯示 event: closed by kiki830621(actor 是 GitHub bot 走 user identity)
  5. /idd-close 才被 invoke 時,checklist gate 已 bypass,只能 post retroactive closing summary

也曾在 PsychQuant/che-apple-mail-mcp#76 PR #61 出現同 text,但因為 cross-repo(PR 在 plugin shell repo,issue 在 binary repo)GitHub auto-close 不 trigger cross-repo,該次沒踩到。Same-repo 情境必踩。

Expected

idd-implement skill 的 PR body template 改用 indirect phrasing 避免 literal Closes #N substring:

- **Do NOT add 'Closes #${NUMBER}'** — IDD discipline requires manual /idd-close
+ **Do NOT add auto-close trailers** (`Closes-trailer` / `Fixes-trailer` / `Resolves-trailer`) — IDD discipline requires manual /idd-close

或 break up the substring:

**Do NOT add 'Cl''oses #${NUMBER}'** ...

(literal 'Closes 拆掉,不過讀起來醜)

或 indirect by reference:

**Do NOT add the GitHub auto-close keywords with this issue number** — see
references/pr-flow.md § Auto-close trap recursion (#${NUMBER}).

Actual

idd-implement/SKILL.md 目前的 template 直接含 **Do NOT add 'Closes #${NUMBER}'**,literal substring 一直在 anti-pattern。

Type

bug(discipline self-defeating;skill template recursion trap)

Impact

中 — same-repo PR merge auto-close 必踩;每次 bypass 都讓 /idd-close 的 checklist gate + closing summary 失效,降到 retroactive mode(audit trail 有 gap)。Cross-repo PR(submodule fix-on-shell pattern)倖免,但 same-repo 是大宗。

Strategy

  1. idd-implement/SKILL.md Step 5.5 PR body template 的 anti-trailer warning text
  2. references/pr-flow.md 同一段 reference(若有)
  3. 加 idd-verify Step 1.7 或類似的 gate:gh pr view --json body | grep -E 'closes|fixes|resolves' #N literal substring → warn user
  4. 補 test:用 mock template 驗證 generated PR body 不含 literal Closes #N

Source

Surfaced retroactively during /idd-close #73 after PR #74 auto-closed the issue 1 second post-merge via the trap pattern. See #73 closing summary's Trap meta-note section for full forensic.

Related

  • #73 — incident that surfaced this
  • idd-implement skill PR body template(IDD plugin source)
  • IDD Refs #N vs Closes #N discipline doc:plugins/issue-driven-dev/skills/idd-implement/SKILL.md "禁止用 Closes / Fixes / Resolves trailer" section

Current Status

Phase: closed
Last updated: 2026-05-19 by idd-close

Complexity

Plan — re-routed from Simple after the idd-verify preventive PR-body scan gate was bundled into the cluster (user decision 2026-05-19).

Cluster

Part of the #87 / #74 auto-close-trap cluster (IDD PR-body templates embed literal Closes #<n> that GitHub auto-close matches context-blind). #89 closed as duplicate of #74.

Next

Closed via PR #94 (squash d2125fe).
Closing summary: #74 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions