From 51373fc03240d2b35c95ac551ad1584d1d95b1cd Mon Sep 17 00:00:00 2001 From: che cheng Date: Wed, 20 May 2026 10:12:28 +0800 Subject: [PATCH 1/7] docs(idd-issue): add Step 5 echo expansion CI/loop warning (Refs #107) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #103 PR #104 expanded idd-issue Step 5 from metadata-only to also echo the AI-rendered ## Type / ## Expected / ## Actual + plain-language interpretation. For human readers this is strictly better — misparse becomes catchable from terminal. For CI / /loop scripts that hard-parse Step 5 stdout, this is a silent surface change. Adds one ⚠ paragraph mirroring the v2.55.0 --no-multi-finding CI warning precedent at line 994. Verbatim wording from #107 issue body, scoped to Step 5 (same anchor as the v2.64.0 echo paragraph this warning is about). No behavior change — purely documentation. --- plugins/issue-driven-dev/skills/idd-issue/SKILL.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/issue-driven-dev/skills/idd-issue/SKILL.md b/plugins/issue-driven-dev/skills/idd-issue/SKILL.md index 57b1cd4..a4acef2 100644 --- a/plugins/issue-driven-dev/skills/idd-issue/SKILL.md +++ b/plugins/issue-driven-dev/skills/idd-issue/SKILL.md @@ -877,6 +877,8 @@ options: > **為什麼**:建 issue 是一個 NSQL `run → report` 操作(見 repo `CLAUDE.md`「Reference Projects: NSQL」)。建 issue 可逆,不需要 confirm gate;但 report 必須陳述「我做了什麼」,不只「它在哪」。回顯 AI render 的詮釋,讓 misparse(AI 把意圖讀錯)一眼可抓,不用點進 URL 才發現。 +> **⚠ CI / `/loop` callers (v2.64.0+, #107)**: Step 5 terminal output expanded from metadata-only (`number / URL / labels / type`) to also echoing the rendered `## Type` / `## Expected` / `## Actual` + plain-language interpretation. If your script hard-parses Step 5 output for the metadata fields only, add a `-m 1` / first-N-lines guard or grep specifically for the `issue.*#NNN.*created` line — the new echo paragraphs follow it. (Parallel precedent: `--no-multi-finding` CI warning below at line 994.) + 提示下一步:`/issue-driven-dev:idd-diagnose #NNN` > **CRITICAL: 建立 issue 後必須停止。不要自動開始 diagnose 或 implement。** From 7f94c96c267c823912bfafca6609e0d6746bcd14 Mon Sep 17 00:00:00 2001 From: che cheng Date: Wed, 20 May 2026 10:13:42 +0800 Subject: [PATCH 2/7] feat(consistency): sync 4 PR-body templates to NSQL verify-gated wording (Refs #108) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 5-template + 3-satellite consistency family — this commit covers the 4 PR-body wording sites that #102 left out of scope: - skills/idd-implement/SKILL.md:503 (PR template Pending review line) - skills/idd-all/SKILL.md:755 (Phase 5 PR-body Pending review line) - references/pr-flow.md:135 (canonical Pending review line) - references/chain-flow.md:254 (cluster variant) All swap legacy 'Pending: human review of this PR + /idd-close after merge' to verify-gated default: 'Verify-gated: verify PASS — ready to merge → /idd-close ... after merge'. Per Option A from #108 diagnosis: idd-implement does NOT accept --review flag (--review remains idd-all + idd-all-chain only); direct idd-implement invocations get the default wording without conditional. Remaining #108 work in subsequent commits: F3 (idd-all-chain Phase 4 stdout --review-aware), Trace 1 example refresh (idd-all 893-901), DA3 wording precision (orchestrator-scope messaging-only). --- plugins/issue-driven-dev/references/chain-flow.md | 2 +- plugins/issue-driven-dev/references/pr-flow.md | 2 +- plugins/issue-driven-dev/skills/idd-all/SKILL.md | 2 +- plugins/issue-driven-dev/skills/idd-implement/SKILL.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/issue-driven-dev/references/chain-flow.md b/plugins/issue-driven-dev/references/chain-flow.md index 7eee4fa..9deb8e2 100644 --- a/plugins/issue-driven-dev/references/chain-flow.md +++ b/plugins/issue-driven-dev/references/chain-flow.md @@ -251,7 +251,7 @@ Refs # # ... # # ... (roots first, then - [x] Diagnose ✓ for all issues - [x] Implement ✓ - [x] Verify ✓ (per-issue 6-AI ensemble) -- [ ] **Pending: human review of cluster PR + /idd-close # # ... after merge** +- [x] **Verify-gated**: per-issue verify PASS — cluster ready to merge → /idd-close # # ... per issue after merge ``` PR title MUST begin with `chain:` (distinguishes from `cluster:` prefix used by pre-known cluster-PR mode in `idd-implement`/`idd-verify`/`idd-close`). diff --git a/plugins/issue-driven-dev/references/pr-flow.md b/plugins/issue-driven-dev/references/pr-flow.md index 0080b37..c93f9d0 100644 --- a/plugins/issue-driven-dev/references/pr-flow.md +++ b/plugins/issue-driven-dev/references/pr-flow.md @@ -132,7 +132,7 @@ Refs #${N} - [x] Diagnose - [x] Implement (${COMMIT_COUNT} commits) - [x] Verify -- [ ] **Pending: human review of this PR + /idd-close after merge** +- [x] **Verify-gated**: verify PASS — ready to merge → /idd-close #${NUMBER} after merge ## Related {follow-up issues, if any} diff --git a/plugins/issue-driven-dev/skills/idd-all/SKILL.md b/plugins/issue-driven-dev/skills/idd-all/SKILL.md index c1e5d08..06433ee 100644 --- a/plugins/issue-driven-dev/skills/idd-all/SKILL.md +++ b/plugins/issue-driven-dev/skills/idd-all/SKILL.md @@ -752,7 +752,7 @@ Refs #${N} - [x] Diagnose ✓ - [x] Implement(${COMMIT_COUNT} commits) - [x] Verify ✓ -- [ ] **Pending: human review of this PR + /idd-close after merge** +- [x] **Verify-gated**: verify PASS — ready to merge → /idd-close #${NUMBER} after merge ## Related {若有 follow-up issues,列出 #N #M ...} diff --git a/plugins/issue-driven-dev/skills/idd-implement/SKILL.md b/plugins/issue-driven-dev/skills/idd-implement/SKILL.md index e97882c..c9f9496 100644 --- a/plugins/issue-driven-dev/skills/idd-implement/SKILL.md +++ b/plugins/issue-driven-dev/skills/idd-implement/SKILL.md @@ -500,7 +500,7 @@ Refs #${NUMBER} - [x] Diagnose - [x] Implement (${COMMIT_COUNT} commits) - [ ] Verify (run /idd-verify #${NUMBER}) -- [ ] **Pending: human review of this PR + /idd-close after merge** +- [x] **Verify-gated**: post-verify PASS = ready to merge → /idd-close #${NUMBER} after merge --- Generated by /idd-implement on PR path. **Do NOT add a GitHub close trailer** (Closes/Fixes/Resolves) — IDD discipline requires manual /idd-close after merge to enforce checklist gate + closing summary. From 7a816172ed36b0e4a9ef7bd80f0f3e552e52df72 Mon Sep 17 00:00:00 2001 From: che cheng Date: Wed, 20 May 2026 10:14:20 +0800 Subject: [PATCH 3/7] feat(idd-all-chain): Phase 4 final stdout dispatch on $REVIEW_FLAG (Refs #108 F3) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Per PR #109 verify regression finding F3: Phase 4 final report stdout text (the verify-gated terminal disposition line + Next steps block) was NOT --review-aware, while the PR-body checklist already was. Build VERIFY_LINE + NEXT_STEPS as separate vars via explicit if/else BEFORE the heredoc (NOT inline ${VAR:-word} — that mutex pitfall already caught in PR #109 F1, hardcoded into the doctrine). Default: 'Verify: verify-gated PASS across cluster — cluster ready to merge' + 'Next: 1. Merge ... 2. /idd-close ...' --review: 'Verify: verify-gated PASS across cluster — awaiting human acceptance (re-opened confirmation loop per --review)' + 'Next: 1. Review PR ... 2. Merge after acceptance 3. /idd-close ...' This closes the F3 satellite of #108's 5-template + 3-satellite scope. --- .../skills/idd-all-chain/SKILL.md | 28 ++++++++++++++++--- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/plugins/issue-driven-dev/skills/idd-all-chain/SKILL.md b/plugins/issue-driven-dev/skills/idd-all-chain/SKILL.md index 152a7a4..98af746 100644 --- a/plugins/issue-driven-dev/skills/idd-all-chain/SKILL.md +++ b/plugins/issue-driven-dev/skills/idd-all-chain/SKILL.md @@ -704,15 +704,35 @@ $FILED_ONLY EOF fi +# Verify-gated terminal disposition (v2.65.0+ #102) — dispatch on $REVIEW_FLAG +# Build "Next" steps before the heredoc to avoid the ${VAR:-word} mutex pitfall +# that PR #109 verify (F1) caught and that #108 doctrine now governs. +if [ -n "$REVIEW_FLAG" ]; then + VERIFY_LINE="Verify: verify-gated PASS across cluster — awaiting human acceptance (re-opened confirmation loop per --review)" + NEXT_STEPS=$(cat < Date: Wed, 20 May 2026 10:15:44 +0800 Subject: [PATCH 4/7] feat(consistency): Trace 1 example refresh + DA3 wording precision (Refs #108) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two remaining satellites from #108's 5-template + 3-satellite scope: **Trace 1 example refresh** (idd-all/SKILL.md 893-901, idd-all 鐵律 line 843): - Default example now shows 'Verify: verify-gated PASS' + 'Next: merge' - Adds parallel --review variant block showing 'awaiting human acceptance (re-opened confirmation loop per --review)' + 'merge after acceptance' - 鐵律 line: 'messaging-only' → 'orchestrator-scope messaging-only' with explicit #108 DA3 citation **DA3 wording precision** (3 sites + MANIFESTO): - idd-all/SKILL.md:117 args parsing comment → 'orchestrator-scope messaging-only effect' - idd-all-chain/SKILL.md:118 args parsing comment → same swap - MANIFESTO.md Human-in-the-loop --review paragraph → 'orchestrator-scope' Rationale: '--review is messaging-only' is true AT THE ORCHESTRATOR (does NOT change skill behavior, does NOT make orchestrator wait), but humans + CI parsers downstream can react to the changed text differently — so it isn't messaging-only in the strict end-to-end sense. The qualifier prevents that misreading. Closes the F3 + Trace 1 + DA3 satellites of #108's scope. Remaining for #108: CHANGELOG + plugin.json bump (next commit). --- plugins/issue-driven-dev/MANIFESTO.md | 2 +- .../skills/idd-all-chain/SKILL.md | 2 +- .../issue-driven-dev/skills/idd-all/SKILL.md | 24 +++++++++++++++---- 3 files changed, 21 insertions(+), 7 deletions(-) diff --git a/plugins/issue-driven-dev/MANIFESTO.md b/plugins/issue-driven-dev/MANIFESTO.md index 94a4c6e..7ddc927 100644 --- a/plugins/issue-driven-dev/MANIFESTO.md +++ b/plugins/issue-driven-dev/MANIFESTO.md @@ -116,7 +116,7 @@ IDD 的 human-in-the-loop 不是隨意散落在 pipeline 各處的 ad-hoc 確認 罕見情境裡,user 想對自己 issue 起疑("我可能 issue 寫錯了"),可以用 `--review` flag 重開 confirmation loop。Phase 6 報告會從 `verify-gated PASS, ready to merge` 切成 `verify-gated PASS — awaiting human acceptance (re-opened confirmation loop per --review)`。 -`--review` **不是 quality gate** —— 它是 opt-in 重開 confirmation loop。Verify 的 falsifiability 不受影響;改變的只是「user 還想自己再過一次」的 explicit 表態。`--review` 是 per-invocation flag,**不是** standing config field —— 一個 exception 不該升格成 standing policy。 +`--review` **不是 quality gate** —— 它是 **orchestrator-scope** opt-in 重開 confirmation loop (per #108 DA3)。Verify 的 falsifiability 不受影響;改變的只是「user 還想自己再過一次」的 explicit 表態。`--review` 是 per-invocation flag,**不是** standing config field —— 一個 exception 不該升格成 standing policy。 ### auto-merge 的合法性與限制 diff --git a/plugins/issue-driven-dev/skills/idd-all-chain/SKILL.md b/plugins/issue-driven-dev/skills/idd-all-chain/SKILL.md index 98af746..7a94ac1 100644 --- a/plugins/issue-driven-dev/skills/idd-all-chain/SKILL.md +++ b/plugins/issue-driven-dev/skills/idd-all-chain/SKILL.md @@ -115,7 +115,7 @@ for ((i=0; i<${#ARGS[@]}; i++)); do # v2.65+ #102 — opt-in re-open NSQL confirmation loop. # Propagated to each chained /idd-all #M --in-chain in Phase 2 so per-issue # Phase 6 reports also reflect; Phase 4 chain final report also dispatches. - # Messaging-only effect — does NOT make chain wait. Per MANIFESTO + # Orchestrator-scope messaging-only effect (per #108 DA3) — does NOT make chain wait. Per MANIFESTO # "Human-in-the-loop: IDD 即 NSQL Confirmation Protocol" doctrine. REVIEW_FLAG="--review" ;; --cwd=*) CWD_FLAG="${arg#--cwd=}" ;; diff --git a/plugins/issue-driven-dev/skills/idd-all/SKILL.md b/plugins/issue-driven-dev/skills/idd-all/SKILL.md index 06433ee..a70eaa8 100644 --- a/plugins/issue-driven-dev/skills/idd-all/SKILL.md +++ b/plugins/issue-driven-dev/skills/idd-all/SKILL.md @@ -114,7 +114,7 @@ for ((i=0; i<${#ARGS[@]}; i++)); do IN_CHAIN="1" ;; --review) # v2.65+ #102 — opt-in re-open NSQL confirmation loop at terminal report. - # Orthogonal to --pr/--no-pr/--in-chain (no mutex). Messaging-only effect: + # Orthogonal to --pr/--no-pr/--in-chain (no mutex). Orchestrator-scope messaging-only effect (per #108 DA3 — humans/CI downstream may react to the changed text, so the flag is messaging-only at orchestrator scope, not necessarily end-to-end): # Phase 6 report swaps to "awaiting human acceptance" wording. Does NOT # change idd-all behavior, does NOT make idd-all wait. Per MANIFESTO # "Human-in-the-loop: IDD 即 NSQL Confirmation Protocol" doctrine. @@ -840,7 +840,7 @@ With `--review` (`REVIEW_FLAG="--review"`): Next: review last ${COMMIT_COUNT} commits (git log -${COMMIT_COUNT}), then run /idd-close #${N} ``` -**STOP**。不 auto-merge(PR mode)、不 auto-close(both modes)。Per MANIFESTO doctrine,verify-gated PASS 是 terminal default disposition;auto-merge mechanic 屬 **#37** bulk-solve autopilot 範疇,**不**是 idd-all default。`--review` 是 messaging-only opt-in,不會讓 idd-all 等候 — 它只表態 "user 還想自己再過一次" 並切換 Phase 6 wording。 +**STOP**。不 auto-merge(PR mode)、不 auto-close(both modes)。Per MANIFESTO doctrine,verify-gated PASS 是 terminal default disposition;auto-merge mechanic 屬 **#37** bulk-solve autopilot 範疇,**不**是 idd-all default。`--review` 是 **orchestrator-scope messaging-only** opt-in,不會讓 idd-all 等候 — 它只表態 "user 還想自己再過一次" 並切換 Phase 6 wording。(per #108 DA3: orchestrator-scope qualifier matters — humans/CI downstream may react to the changed text differently, so the flag is messaging-only **at orchestrator scope**, not necessarily end-to-end.) --- @@ -895,13 +895,27 @@ Phase 0.5 印 `→ Path: PR (unattended) — flag=--pr`,sub-skill args 全帶 `U Branch: idd/42-bug-login-button-stops-after-3-faile Commits: 3 (implementation + 0 verify-fix rounds) PR: https://github.com/owner/repo/pull/87 - Verify: PASS + Verify: verify-gated PASS + Follow-ups: (none) + +Next: merge https://github.com/owner/repo/pull/87, then run /idd-close #42 +``` + +With `--review` opt-in: + +``` +✓ idd-all complete (PR mode, --review) + Issue: #42 — bug: login button stops after 3 failed attempts + Branch: idd/42-bug-login-button-stops-after-3-faile + Commits: 3 (implementation + 0 verify-fix rounds) + PR: https://github.com/owner/repo/pull/87 + Verify: verify-gated PASS — awaiting human acceptance (re-opened confirmation loop per --review) Follow-ups: (none) -Next: review PR https://github.com/owner/repo/pull/87, merge, then run /idd-close #42 +Next: review PR https://github.com/owner/repo/pull/87, merge after acceptance, then run /idd-close #42 ``` -`/loop` 自動化 caller 觀察行為與 v2.40.0 完全一致 — feature branch、push、PR 帶 `Refs #42`、無 `Closes`、停在 verified。 +`/loop` 自動化 caller 觀察行為與 v2.40.0 完全一致 — feature branch、push、PR 帶 `Refs #42`、無 `Closes`、停在 verified。Per MANIFESTO `Human-in-the-loop` doctrine: `verify-gated PASS, ready to merge` is a state declaration, NOT a `gh pr merge` authorization — autopilot remains #37 territory. ### Trace 2: `(direct-commit, attended)` — HITL 場景 From c9cfa59a411c6ed2231e432f1172c1d7719f6cb7 Mon Sep 17 00:00:00 2001 From: che cheng Date: Wed, 20 May 2026 10:20:10 +0800 Subject: [PATCH 5/7] =?UTF-8?q?feat(idd-close):=20Step=203.6=20Residue=20A?= =?UTF-8?q?cknowledgement=20=E2=80=94=20close=20F3=20write-only=20loop=20(?= =?UTF-8?q?Refs=20#105)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Per #103 PR #104 verify Devil's Advocate D2 finding: `### Residue` shipped in #103 as a producer-only field — idd-implement / idd-verify / idd-close / idd-list / idd-update / idd-all all read OTHER Diagnosis sections but none read Residue. Result: latent ritual-drift risk — without a downstream consumer pressuring the field to stay honest, it becomes ignored boilerplate over time. #105 closes the loop by giving Residue its first downstream consumer at close time: - NEW Step 3.6 between Step 3.5 (closing follow-up keyword scan) and Step 4 (publish + close), mirroring Step 3.5's drafted-summary-scan pattern. - Reads the **latest** `## Diagnosis` comment's `### Residue` section (mirrors Step 0 supersession — older drafts are deliberation history, not current contract). - Trigger logic: silent skip when no Diagnosis exists (legacy), no `### Residue` section (pre-v2.64.0 format), or content is exactly `(none)` (the explicit empty-state marker the template requires). - When triggered: AskUserQuestion 3-option per IC_R011 canonical pattern — `still residue`, `file as follow-up issue(s)`, `skip`. - Audit trail PATCH per canonical heading-conventions table — every branch records something to the closing summary (5 outcomes covered: acknowledge, file, skip, silent, env-var rollback). - Manifest helper integration: filed follow-ups get spawn manifest entries when chain context active (additive, silent skip otherwise). - Step 0.5 Bootstrap Task List adds `residue_acknowledgement` entry alongside `closing_followup_keyword_scan` for visible per-step accountability. Non-blocking (SHOULD-tier) per closure-tier IC_R011 eligibility: closure is mostly mechanical action with text artifact; hard-blocking on every residue declaration would multiply close-time friction. The value is making 'residue is real, what happened to it?' a visible deliberation moment. Placement rationale: Step 3.5 already established the 'scan drafted closing summary + AskUserQuestion before publish' pattern. Step 3.6 mirrors it — same draft/scan/PATCH flow, different source (Residue vs orphan keyword mentions). Both must run BEFORE Step 4 so the audit PATCH happens to the same in-memory draft. --- .../skills/idd-close/SKILL.md | 95 +++++++++++++++++++ 1 file changed, 95 insertions(+) diff --git a/plugins/issue-driven-dev/skills/idd-close/SKILL.md b/plugins/issue-driven-dev/skills/idd-close/SKILL.md index 3669557..c93a4fa 100644 --- a/plugins/issue-driven-dev/skills/idd-close/SKILL.md +++ b/plugins/issue-driven-dev/skills/idd-close/SKILL.md @@ -163,6 +163,7 @@ TaskCreate(name="semantic_gate_check", description="Step 1.6: 對每個 - [x] bu TaskCreate(name="draft_closing_comment", description="起草 Problem / Root Cause / Solution / Verification / Changes 五段式") TaskCreate(name="review_with_user", description="顯示 closing comment 給使用者確認(若已明確 /idd-close 可省略此步)") TaskCreate(name="closing_followup_keyword_scan", description="Step 3.5: scan drafted closing summary for trigger phrases (follow-up / deferred / future / 之後 / 順便 etc); orphan mentions without #NNN cross-link → AskUserQuestion 3-option per canonical references/ic-r011-checkpoint.md; PATCH closing summary inline + add `### Closing Follow-ups Filed` audit trail (advisory, non-blocking, per IC_R011 #527)") +TaskCreate(name="residue_acknowledgement", description="Step 3.6 (v2.66.0+, #105): read latest ## Diagnosis ### Residue section; if non-empty (not `(none)`), AskUserQuestion 3-option (still residue / file follow-up / skip); silent skip when residue is `(none)` or section missing. Audit trail PATCH to closing summary. Non-blocking, IC_R011 rollback respected. Closes the F3 write-only loop from #103.") TaskCreate(name="publish_and_close", description="gh issue comment + gh issue close") TaskCreate(name="auto_update_body", description="跑 /idd-update #NNN 把 issue body 的 Current Status phase 改 closed(Step 6,常被漏)") TaskCreate(name="distribution_sync_chain_detection", description="Step 6.5 (v2.56.0+, #45): infer_distribution_type detection per references/distribution-detection.md; if hit → AskUserQuestion 3-option (chain to plugin-update/mcp-deploy/cli-deploy / skip — manual later / not applicable); patch closing comment with ### Distribution Sync section. Silent skip for non-distribution repos. IDD_DISTRIBUTION_SYNC_PROMPT=false env var bypasses prompt entirely (still 1-line audit).") @@ -401,6 +402,100 @@ For each trigger-phrase match: > **Disambiguation from #515 supersession**: Step 0 supersession (#515 v2.41.0) is **gate logic** preventing false-positive checklist refusals — it operates on pre-implementation Strategy/Plan checkboxes. Step 3.5 (this step, #527) is the **IC_R011 checkpoint** for orphan keyword mentions in the drafted closing summary. The two are orthogonal: Step 0 runs at gate time, Step 3.5 runs after summary draft + before final close. +### Step 3.6: Residue Acknowledgement (v2.66.0+, #105) + +**Compliance**: this step closes the F3 `### Residue` write-only loop introduced in #103 v2.64.0. Producer was `idd-diagnose` Step 3 template + `>` explanatory paragraph; consumer was never implemented. Per Devil's Advocate D2 in PR #104 verify: "latent capacity for the section to drift into ritual filler with no consumer pressure to keep it honest". Step 3.6 gives Residue its first downstream consumer — the user is asked at close time "what happened to the residue declared at diagnose time?". + +**Rule (SHOULD, advisory)**: 在 `gh issue close` 前 (Step 4),read the **latest** `## Diagnosis` comment's `### Residue` section. If non-empty (not `(none)` and not missing), AskUserQuestion 3-option per IC_R011 canonical pattern. **Non-blocking** — user can pick skip with audit trail. Silent skip when residue is `(none)` (the common case for clear-scope issues). + +#### Detection (bash) + +```bash +# Pull the latest ## Diagnosis comment body (newest by createdAt desc, mirrors Step 0 supersession discipline) +DIAG_BODY=$(gh issue view "$NUMBER" --repo "$GITHUB_REPO" --json comments \ + --jq '[.comments[] | select(.body | startswith("## Diagnosis"))] | sort_by(.createdAt) | reverse | .[0].body // ""') + +# Extract the ### Residue section content — between the heading and either the next ###/## or EOF +RESIDUE_CONTENT=$(printf '%s\n' "$DIAG_BODY" \ + | awk '/^### Residue/{flag=1; next} flag && /^###? /{flag=0} flag' \ + | sed -E 's/^[[:space:]]+//; s/[[:space:]]+$//' \ + | awk 'NF' \ + | head -c 4000) + +# Trigger logic — silent skip when: +# - No Diagnosis comment exists at all (legacy issue pattern, pre-v2.64.0) +# - ### Residue section missing (pre-v2.64.0 Diagnosis template) +# - Content is exactly `(none)` (the explicit empty-state marker required by template) +RESIDUE_TRIGGER="false" +if [ -z "$DIAG_BODY" ]; then + AUDIT_REASON="no Diagnosis comment (legacy issue or pre-v2.64.0 — no Residue section to acknowledge)" +elif ! printf '%s' "$DIAG_BODY" | grep -q '^### Residue'; then + AUDIT_REASON="Diagnosis has no \`### Residue\` section (pre-v2.64.0 format)" +elif [ "$RESIDUE_CONTENT" = "(none)" ] || [ -z "$RESIDUE_CONTENT" ]; then + AUDIT_REASON="residue declared as \`(none)\` at diagnose time — no acknowledgement needed" +else + RESIDUE_TRIGGER="true" +fi +``` + +#### AskUserQuestion 3-option (prose — NOT a bash function call) + +When `RESIDUE_TRIGGER == "true"`, AskUserQuestion per IC_R011 canonical pattern. Surface the captured `$RESIDUE_CONTENT` so the user sees the exact text being acknowledged: + +> "Residue declared at diagnose time: +> > +> +> 該 residue 在 #${NUMBER} 完成期間有變動嗎?" +> +> Options (default = first): +> - **`still residue — acknowledge as-is`** — record acknowledgement in closing summary that residue stayed as residue. No new issue. Audit trail: `Acknowledged as still residue (text quoted in audit block).` +> - **`file as follow-up issue(s)`** — surface candidate decompositions if residue has multiple distinct items; user picks which to file. Each filed issue gets `**Source**: residue from #${NUMBER} at /idd-close time` for traceability. +> - **`skip — record in audit trail only`** — no new issue, no acknowledgement; just log the user's choice. Audit trail: `Skipped per user choice (residue not addressed).` + +#### File issues (if user picks `file`) + +```bash +# Loop per-item: if residue has multiple distinct items (decided via inline AskUserQuestion for picker) +for item in $selected_items; do + NEW_ISSUE_URL=$(gh issue create --repo "$GITHUB_REPO" \ + --title "[] (residue from #${NUMBER})" \ + --body "$BODY_WITH_RESIDUE_QUOTE_AND_SOURCE_LINK" \ + --label ",confidence:confirmed,priority:P3") + + # Chain context manifest write (per spawn-manifest contract, v2.55+ #44; v2.60+ #46 schema v2) + ROOT_ID_FOR_MANIFEST="${IDD_CHAIN_CURRENT_ROOT_ID:-${NUMBER:-}}" + if [ -n "$ROOT_ID_FOR_MANIFEST" ]; then + NEW_ISSUE=$(basename "$NEW_ISSUE_URL") + bash "$CLAUDE_PLUGIN_ROOT/scripts/manifest-append.sh" \ + "$REPO_ROOT" "$NEW_ISSUE" "idd-close" "Step 3.6 residue acknowledgement" \ + "residue-followup" "$item_same_file" "$item_same_skill" "$item_title" "$ROOT_ID_FOR_MANIFEST" \ + 2>/dev/null || true # silent skip when chain context inactive + fi +done +``` + +Body MUST contain `**Source**: residue from #${NUMBER} at /idd-close time (Step 3.6)` for traceability. Manifest write is **additive** — when chain context inactive, helper exits 0 silently. See `references/spawn-manifest.md`. + +#### Audit trail PATCH + +The closing summary (Step 2 已 drafted but not yet posted, same pattern as Step 3.5) gets a `### Residue Acknowledgement` section appended per canonical heading conventions: + +| User choice | Audit block content | +|---|---| +| `still residue — acknowledge as-is` | `**Acknowledged as still residue**: ` | +| `file as follow-up issue(s)` (1+ filed) | `**Filed**: #X, #Y, #Z` | +| `skip — record in audit trail only` | `**Skipped per user choice** (residue text quoted for posterity): ` | +| silent skip (triggered=false) | `**$AUDIT_REASON**` (one line, no separate block) | +| `AI_LOW_BAR_ISSUE_FILING=false` env var | `**Skipped** (AI_LOW_BAR_ISSUE_FILING=false, per IC_R011 rollback)` | + +**Rollback escape hatch**: per canonical reference doc §5 — `AI_LOW_BAR_ISSUE_FILING=false` env var silently skips Step 3.6 while preserving the audit trail line. + +**Why advisory not blocking**: same reasoning as Step 3.5 — closure is mostly mechanical action; hard-blocking on every residue declaration would multiply close-time friction. The value is making "residue is real, what happened to it?" a visible deliberation moment, not enforcing a particular answer. Silent skip when `(none)` keeps clear-scope issues frictionless. + +**Why placed here (between Step 3.5 keyword scan and Step 4 publish+close)**: Step 3.5 already established the "scan drafted closing summary + AskUserQuestion before publish" pattern. Step 3.6 mirrors it — same drafting/scan/PATCH flow, different source (Residue section vs orphan keyword mentions). Both must run **before** Step 4 so the audit trail PATCH happens to the same in-memory draft, not a post-hoc edit. + +**Why use only the latest Diagnosis comment** (mirrors Step 0 supersession): re-diagnoses after clarification produce multiple `## Diagnosis` comments — only the latest reflects the issue's current state. Earlier drafts' residue is part of the issue's deliberation history, not its current acceptance contract. If user wants to surface older residue, they can manually file follow-up from comment history. + ### Step 4: 發佈並關閉 ```bash From 0370516ef063081c47dad151e761f0b26e0b316b Mon Sep 17 00:00:00 2001 From: che cheng Date: Wed, 20 May 2026 10:21:37 +0800 Subject: [PATCH 6/7] chore: bump issue-driven-dev to v2.66.0 (Refs #105 #107 #108) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cluster release covering 3 chain-solved issues on branch idd/chain-multi-5439e76b-idd-close-residue-acknowledgement-prompt: - #105 (Plan-tier): idd-close Step 3.6 Residue Acknowledgement — closes the F3 write-only loop from #103. - #107 (Simple): idd-issue Step 5 ⚠ paragraph for CI/loop hard-parse warning. - #108 (Plan-tier): 5-template + 3-satellite consistency family — 4 PR-body wording syncs + idd-all-chain Phase 4 stdout --review dispatch + idd-all Trace 1 example refresh + DA3 wording precision. Minor bump justification: new idd-close step (additive behavior at close time) + 4 default PR-body wording strings change (user-visible diff in every PR opened by IDD orchestrators) + new conditional in idd-all-chain Phase 4 stdout. Patch would have under-claimed. Marketplace.json sync deferred to /idd-close Step 6.5 chain per repo precedent. CHANGELOG entry covers all 3 issues. --- .../.claude-plugin/plugin.json | 2 +- plugins/issue-driven-dev/CHANGELOG.md | 21 +++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/plugins/issue-driven-dev/.claude-plugin/plugin.json b/plugins/issue-driven-dev/.claude-plugin/plugin.json index 8ec8be9..c970574 100644 --- a/plugins/issue-driven-dev/.claude-plugin/plugin.json +++ b/plugins/issue-driven-dev/.claude-plugin/plugin.json @@ -1,7 +1,7 @@ { "name": "issue-driven-dev", "description": "v2.63.0: #96-backlog Simple cluster — 6 docs/reference follow-ups shipped via cluster-PR #101 (PsychQuant/issue-driven-development #60 #62 #63 #78 #90 #91). These are the Simple-tier subset of an 18-issue `/idd-diagnose` batch (6 Simple / 12 Plan) run over the #96-backlog cleanup; the 12 Plan-tier issues are driven separately. #60: NEW `## Cluster-PR eligibility (when to bundle vs split)` section in `references/batch-and-cluster.md` — a criteria table (same-file ✓ / same-skill ✓ / same-root-issue chain-only ✓ / same-label ✗ / same-review-timing ✗) plus a borderline >50-line review-surface heuristic, with a cross-reference from `idd-implement/SKILL.md`'s Cluster-PR mode paragraph; motivated by PR #58 having bundled unrelated issues #49+#53 under only a shared parent label. #62: `references/usecase-routing.md` decision-tree section gains a bulk-solve note pointing to row 27 — there is no built-in zero-arg backlog bulk-solve; use per-issue `/idd-all` or `/idd-all-chain`. #63: `usecase-routing.md` row 27 `#44 chain-solve` plain text upgraded to an explicit `[#44 chain-solve](url)` link for raw-markdown-viewer cross-link consistency with the already-linked `#37`/`#46`. #78: `idd-issue/SKILL.md` multi-finding override-flags section gains a ⚠ CI-caller note — automated / CI / `/loop` callers expecting the pre-v2.55.0 always-single-issue behavior of `idd-issue source.docx` MUST pass `--no-multi-finding` explicitly (v2.55.0 changed the default to auto-enter multi-finding mode on ≥2 findings); a retroactive behavioral-change notice was added to `CHANGELOG.md` (placed under `[Unreleased]` then rolled into this entry — no standalone `## [2.55.0]` entry exists). #90: NEW `openspec/CONVENTIONS.md` documenting the `**GitHub-side tracker**: #NN` canonical Spectra-proposal → GitHub-issue linking convention (collapses `idd-close`'s 3-fallback detection chain to a one-line lookup). R1 placed this at `openspec/LANGUAGE.md`; the 6-AI cluster verify's Devil's Advocate caught (coordinator-confirmed) that `openspec/LANGUAGE.md` is a reserved filename — `spectra-discuss` reads it as the project's canonical vocabulary file with a vocabulary-drift capture mechanism — so R2 relocated the convention to `openspec/CONVENTIONS.md` (purpose-built, verified not reserved by any skill). #91: `.claude/skills/spectra-archive/SKILL.md` gains a `Step 0: Bootstrap Stage Task List` section before its `**Steps**` block, with 8 `TaskCreate` entries mapping 1:1 to the skill's existing Steps 1-8, matching the idd-* Bootstrap discipline; the parallel tool-managed command-file surface (`.claude/commands/spectra/archive.md`, wrapped in `` regenerated markers) was intentionally NOT hand-edited — its Step-0 gap is folded into #93's 4-copy divergence scope. Cluster-PR #101 verified by 6-AI cluster verify: R1 CONDITIONAL PASS — 4/5 Claude reviewers PASS, Devil's Advocate surfaced 2 HIGH blocking findings (#90 reserved-name collision, #91 invocation-surface scope), both coordinator-confirmed via file-existence checks; R2 PASS after #90 relocation + #91 re-scoping. Codex (6th reviewer) hung and never returned — recorded as an explicit process gap rather than hidden in the aggregate. Squash-merged to main as `0eb419c`. v2.62.0: cluster mode override — pr-flow.md canonical documentation + idd-implement Step 0.5 bash implementation (PsychQuant/issue-driven-development#96). Resolves a 3-file contradiction in IDD's PR-vs-direct-commit path resolution: `pr-flow.md` canonical resolution-algorithm table had no cluster carve-out while `idd-implement/SKILL.md:49` + `batch-and-cluster.md:133` independently asserted cluster-PR mode forces PR (\"不接受 --no-pr\"); the three files contradicted and the behavior on `--no-pr` + cluster collision (abort / warn / silent ignore) was never specified. Surfaced during PR #94's cluster work. Option A (user-selected in `/idd-all` session from 3 diagnosis candidates A/B/C): maintain forced PR for cluster mode, but make it explicit + consistent. NEW `pr-flow.md` `### Cluster mode override` subsection — cluster mode (any IDD skill invoked with ≥2 `#N` args) is a multi-issue mode where all cluster issues share one feature branch + one PR; path resolution is `idd-implement`'s job (the only skill that resolves PR-vs-direct-commit) and for it cluster mode is a precondition that pre-empts the resolution-algorithm table and forces PR path; `idd-verify` / `idd-close` are cluster-aware but operate on the cluster's already-existing PR — they consume the path decision, they don't make it. Explicit override notice mirrors fork detection (`→ cluster mode (N issues) → PR path enforced (overriding --no-pr / pr_policy=never)`); fork+cluster co-occurrence prints both notices (the two pre-emptions independently force PR path, no precedence question). `idd-implement` Step 0.5 bash wired with cluster detection: parse `#N` token count in `$@` → derive `CLUSTER_MODE` → pre-empt block before the existing flag/fork/policy resolution → `OVERRIDE_SRC` accumulation composes the actual triggering condition(s) into the notice; Step 0.5 local algorithm summary gains a row 0 noting cluster pre-emption. `batch-and-cluster.md:133` rule statement demoted to a pointer at the new canonical section with the rationale phrase (\"stacked half-isolated changes on default branch\") inlined verbatim in `pr-flow.md` for downstream-grep stability. Verified 6-AI × 2 rounds: R1 (doc-only `cbe6f5d`) CONDITIONAL PASS — 5/6 reviewers converged on a HIGH doc/code gap (spec described a Phase 0.5 override notice the bash had no capability to emit); R2 (`5351116`) extended PR scope per user opt-in to add the ~24-line bash impl (8-case behavioral dry-run + `bash -n` clean), 6/6 PASS with Devil's Advocate explicitly recommending MERGE; R3 (`04c51cb`) closed DA's one new actionable finding (the subsection originally over-claimed cluster mode \"pre-empts the Resolution algorithm\" for verify/close — those skills never run path resolution). Step 0.8 auto-close-trap scan clean. Backward compat: single-issue invocation (`idd-implement #19`) byte-equivalent — the cluster carve-out only fires on ≥2 `#N`. Follow-up #100 tracks 2 non-blocking deferred items (Option A still forces PR on a non-default feature branch where cluster direct-commit is a legitimate workflow — Option B revisit candidate; cluster-detection glob `\\#[0-9]*` over-counts malformed/duplicate tokens vs the stricter documented `^#\\d+$`). PR #99 squashed as `b7f72ff`. v2.61.0: idd-verify Step 0.8 — squash-commit-body auto-close trap fix (PsychQuant/issue-driven-development#97). Step 0.8 (added in v2.60.1 by PR #94) extended from a 1-source scan (PR body via `closingIssuesReferences`) to a 2-source scan covering: (1) PR body authoritative parse via `closingIssuesReferences` (kept), and (2) per-commit `messageHeadline` + `messageBody` via `gh pr view --json commits` + trap regex `(^|[^-/[:alnum:]])(close[sd]?|fix(e[sd])?|resolve[sd]?)[[:space:]]*:?[[:space:]]+#[0-9]+` (case-insensitive via `tolower($0)`). R1/R2/R3 lessons baked into the regex from PR #94's verify history: `(^|[^-/[:alnum:]])` prefix excludes `/idd-close #N` IDD skill invocations and hyphenated tokens; `:?` covers the colon form; `[[:space:]]+` mirrors GitHub's space requirement. Same-repo `#N` form only; cross-repo `owner/repo#N` deferred per Plan D7. The fix addresses the ironic v2.60.1 dogfood failure where PR #94 itself was squash-merged and GitHub auto-closed `#87` two seconds later because one of PR #94's commits had a body that *quoted* the trap pattern as a verify-finding example. R2 (in-PR fix after R1 verify) extended the jq filter from body-only to headline+body after Devil's Advocate + Codex independently confirmed the missed-subject channel with empirical evidence: commit `8ac8206` headline `resolves #N` form auto-closed `#70` (2026-05-11); commit `a82867d` headline `fix #N` form auto-closed `#26` (2026-05-07). R1's body-only filter would have missed both. PR #98 6-AI verified in 2 rounds: R1 CONDITIONAL PASS (5/6, 1 HIGH blocking DA-H1 + Codex Finding 2); R2 6/6 PASS with Devil's Advocate explicitly recommending MERGE. Also adds `### 引用 trap pattern 作反例的寫作紀律` subsection under `## Commit Conventions` in `plugins/issue-driven-dev/CLAUDE.md` codifying the writing discipline: code fence is **visual only** (parser is context-blind), literal letter N (capital, no digit) is the **actual suppression** mechanism mirroring the safe pattern in `references/pr-flow.md:127`, cite-via-link is strongest. Single/double quotes do NOT suppress the parser. This is the write-time root fix; Source 2 is defence-in-depth at verify time. Step 0 bootstrap TaskCreate entry renamed `scan_pr_body_trailers` → `scan_pr_body_and_commits_trailers` reflecting Source 2. Backward compat: Source 2 is additive — clean PRs see no change in output; PRs with trap pattern in commits (subject or body) now get a warn block with fix-options (rebase + amend with letter N, override squash message via `gh pr merge --body`, or post-hoc `/idd-close`). Dogfood: PR #98's own squash commit (`e0d61e7`) is clean under the new 2-source Step 0.8 — the discipline added to CLAUDE.md held for both commit message body AND headline. Master verify reports at PR #98 #issuecomment-4483847549 (R2) and #issuecomment-4483788120 (R1). v2.60.1: cluster fix — PR-body auto-close trap (PsychQuant/issue-driven-development#87 + #74). All 4 IDD skill PR-body templates (idd-implement Step 5.5, idd-all Phase 5, idd-all-chain Step 5.5, pr-flow.md canonical) reworded to drop literal `Closes #${N}` from anti-trailer warnings — heredoc `${N}` substitution previously turned the cautionary warning string into a real `Closes #` that GitHub auto-close parser matched context-blind (ignoring negation, markdown, quotes), bypassing /idd-close's checklist gate + closing summary. New unified wording: `**Do NOT add a GitHub close trailer** (Closes/Fixes/Resolves) — IDD discipline requires manual /idd-close after merge to enforce checklist gate + closing summary.` Keywords named but never followed by `#` so GitHub's regex cannot match. NEW idd-verify Step 0.8 preventive gate (PR mode, warn-only): queries `gh pr view --json closingIssuesReferences` — GitHub's authoritative parse of which issues the PR auto-closes on merge — covering all trailer forms (Closes #N / Closes: #N colon form / cross-repo / issue-URL) without self-written regex. Warn-only since a PR body may legitimately quote the keywords in prose; gate value is making the risk visible at verify time before merge. Eventual-consistency caveat disclosed (closingIssuesReferences is settled state, settles well within typical verify-after-implement gap). PR #94 6-AI verified in 3 rounds: R1 (initial regex form) caught colon-form gap → R2 redesigned to closingIssuesReferences eliminating self-parser fragility → R3 cleanup (deleted orphan regex doc, surfaced gh failures with explicit skip note replacing silent fail-open, scoped overclaim, query `.url` not `.number`). Confirmed prior incidents resolved: #559, che-apple-mail-mcp#99, #73, #56. Two follow-up issues filed: #96 (cluster-PR mode silently forces PR path while direct-commit honours `--no-pr` — doc contradiction in pr-flow.md canonical algorithm table, design decision pending), #97 (new failure mode discovered at squash-merge of PR #94 itself — squash commit body inherited commit-message body quoting `Closes: #87` as a verify-finding reference, triggered auto-close of #87 2s after merge; Step 0.8 only scans PR body and doesn't predict squash commit message). Master verify report at PR #94 #issuecomment-4482808720. v2.60.0: idd-all-chain multi-root + DFS/BFS traversal + per-root halt + spawn-manifest schema v2 hard-break (PsychQuant/issue-driven-development#46, multi-root-traversal-idd-all-chain Spectra change). NEW multi-root invocation `/idd-all-chain #A #B #C [--bfs] [--cwd ]` accepts ≥1 root issue (N=1 byte-equivalent backward compat with v2.55.0+). NEW `--bfs` flag selects BFS traversal mode (push-back queue semantics for fairness across roots); default DFS pushes spawns to queue front (rich subtree first per root). NEW spawn manifest schema v2 hard-break: top-level `root_issue: int` → `root_issues: [int]`, top-level adds `traversal: \"dfs\"|\"bfs\"`, every spawn entry adds `root_id: int` (must match one of root_issues elements). Helper `scripts/manifest-append.sh` bumps `EXPECTED_SCHEMA_VERSION` 1→2, accepts 9th positional arg `root_id`, validates root_id ∈ root_issues array, fail-fast on v1 manifest detection. Cap redesign for multi-root accommodation: per-root `chain_max_depth` 2→3 (each root subtree counts depth from 0 independently), global `chain_max_issues` 5→10 (union across all root subtrees, applies independently of depth cap). Verify FAIL = per-root halt (D4 Option C): failing issue's `root_id` added to FAIL_ROOTS, all same-root pending issues purged from QUEUE, other root subtrees continue processing, commits preserved; Phase 4 emits per-root PASS/FAIL/SKIPPED summary block. Branch naming dispatches on N: N=1 keeps backward-compat `idd/chain--`, N>1 uses `idd/chain-multi--` where hash8 is first 8 hex of sha256 over sorted-asc root numbers joined by `-` (deterministic per root set); hash8 collision fallback hash16, double collision aborts with manual cleanup hint. PR title dispatches: N=1 `chain: `, N>1 `chain (multi-root): N issues — `. PR body cluster overview table adds `root_id` column; Refs lists all roots first then chained spawns. NEW Phase 4 forest tree printout: per-root subtree with status icons (✓ PASS, ✗ FAIL, ⊘ filed-but-not-chained), depth labels, spawn-source attribution; per-root PASS/FAIL summary block; filed-only-not-chained list. 4 sub-skills (idd-implement Step 5.7 / idd-verify Phase 4 / idd-plan Step 2.5 / idd-diagnose Step 3.6) propagate root_id via `IDD_CHAIN_CURRENT_ROOT_ID` env var (exported by Phase 2 chain loop before each `/idd-all #M --in-chain` invocation), with defensive `[ -n \"$ROOT_ID_FOR_MANIFEST\" ]` guard preventing silent skip when both env and local fallback variables are unset. NEW `allowed-tools` frontmatter expanded with 11 additional Bash tools (shasum/sed/tr/cut/sort/seq/grep/awk/printf/date/head/tail/wc/basename/comm) for Phase 0.5 branch naming + Phase 4 forest tree rendering. Modified `idd-all-chain` + `idd-spawn-manifest` specs (3 MODIFIED + 1 ADDED requirement each); spec deltas in openspec/changes/multi-root-traversal-idd-all-chain/. Updated `references/spawn-manifest.md` v2 schema doc + `references/chain-flow.md` DFS/BFS algorithm + per-root halt + cap interaction + branch naming hash rule sections + PR title/body dispatch. Backward compat: single-root chain invocation byte-equivalent to v2.55.0 except for the schema bump (v1 manifests on disk become unreadable — per design, manifest is transient per-chain-session state, hard-break safe). Smoke tests 7.1+7.2 marked `[~]` first-real-use validation track per `## Checklist Conventions` IDD discipline (orchestration tests cannot mock GitHub API + git operations without significant fixture infrastructure, mirroring #52 idd-verify validation pattern). v2.59.0: idd-verify orchestration playbook — Step 2 spawn restructure + NEW Step 2.5 Recovery Protocol (PsychQuant/issue-driven-development#52, resolves #70 structurally). Step 2 switches from TeamCreate (5 teammates with Read/Grep/Glob/Bash tools, NO Write) to 5 parallel Agent(subagent_type=general-purpose) calls (含 Write tool) + 1 Bash codex background, single-message dispatch preserves parallelism. Each reviewer prompt mandatorily contains 3 elements: (1) explicit findings file output path `Write findings to /tmp/verify__findings_.md`, (2) explicit 'DO NOT idle without producing output' rule, (3) retry-context-re-paste hint ('treat later SendMessage with re-pasted prompt as retry signal'). Pre-spawn prompt persistence: coordinator MUST save each role's prompt to /tmp/verify__prompt_.md before invoking Agent — Step 2.5b retry reads this file for FULL context re-paste (never assumes context survived idle/wake cycle, per #47 incident root cause). Devil's Advocate sequencing: bash polling loop on sibling findings files (max 30 iter × 5s = 2.5min timeout) replaces TeamCreate wait_for_idle primitive; timeout fallback writes SENTINEL marker `[STAGE 2.5 RECOVERY: DEVILS_ADVOCATE_TIMEOUT_/4]` on first line + body explanation. NEW Step 2.5 Recovery Protocol section between Step 2 spawn and Step 3 merge: (2.5a) file existence check scans 5 findings files; detects DA timeout sentinel via head -1 | grep then rm -f the file + add to MISSING_ROLES so downstream -s checks see role as missing; (2.5b) retry with FULL context re-paste using saved prompt file + 90s polling; (2.5c) second-idle coordinator self-review fallback; (2.5d) explicit 'Process Gaps' section in master report — no silent engine degradation. Step 3 merge prose source tag swept `[team:...]` → `[agents:...]`; ASCII architecture tree + 鐵律 rule updated; CLI alias `team` preserved backward-compat with documented backend as 5 standalone Agent calls. Frontmatter: TeamCreate removed from allowed-tools (no longer used). Side effect: #70 (TeamDelete cleanup gap on idle teammates from #47 verify-pr58 cycle) structurally dissolved — no team to delete = no cleanup gap. Plan tier D1-D5 + D6 first-real-use validation track: 3 codex verify rounds (R1 3 P1 → R2 2 P1 → R3 PASS) under codex-only degraded mode (Anthropic API rate-limit blocked Claude reviewer ensemble throughout session — dogfooded as Process Gap on first-real-use). Empirical bash smoke validated DA sentinel writer + Step 2.5a head -1 | grep detection + rm -f sequence. v2.58.0: idd-issue Stage 4.5 — jsonl gitignore pre-flight gate (PsychQuant/issue-driven-development#55). NEW pre-flight gate at idd-issue/SKILL.md between Stage 4 Dispatch and JSONL write: detects `.gitignore` shadowing of `.claude/.idd/issue-runs/.jsonl` via `git check-ignore -v` (D2 spec contract preservation). Source-aware classification via `IS_NESTED_GITIGNORE` flag — case statement orders absolute path / `.git/info/exclude` / bare `.gitignore` BEFORE `*/.gitignore` so global `core.excludesfile` named `.gitignore` does NOT mis-classify as nested. AskUserQuestion branches: Case A (fixable: root `.gitignore` / `.git/info/exclude` / global) → 3-option Add carve-out / Skip / Abort; Case B (nested `.gitignore`) → 2-option Skip / Abort with complete manual-fix chain hint (root rewrite cannot override per-directory ignore; nested file requires its own 4-line chain with trailing slashes on dir patterns + explicit `!.idd/issue-runs/*` glob, empirically validated). Universal 5-line carve-out block with `!.claude` parent re-include leverages git's last-matching rule to neutralize ANY outer ignore source — survives multi-source stacked ignores (root + `.git/info/exclude` / root + global / `.git/info/exclude` + global). Idempotent + upgrade-safe via two-part check (marker AND `!.claude` content presence): stale 4-line block (same marker, missing `!.claude`) triggers awk two-state-machine upgrade — STATE 1 consumes # rationale comments adjacent to marker; STATE 2 consumes only known carve-out literal lines, ENDS skip immediately after final pattern `!.claude/.idd/issue-runs` — adjacent user content (blank lines, user `# Section` comments, sibling patterns) preserved across all variants. Empty body's grep idiom uses `grep | wc -l | tr -d ' '` (clean integer) instead of `grep -c || echo 0` (which doubled output to `0\\n0` on no-match). Dispatch summary surfaces ignore source + user choice + continuity status (committed / pending exception / ⚠ local-only with manual export hint / aborted). Ordering invariant: dispatch → gate → materialize — Stage 4 loop accumulates in-memory RUN_LOG_ENTRIES, Stage 4.5 gate fires after loop completes, materialize phase decides jsonl write fate per `JSONL_GITIGNORE_DECISION`. Abort discards in-memory entries BEFORE materialization; already-dispatched GitHub actions NOT rolled back (user-confirmed intent per Stage 3). Env var bypass `IDD_JSONL_GITIGNORE_GATE=false` for CI/unattended with 1-line audit cite. Plan tier D3 evolved through 3 revisions (single-line → 4-line → universal 5-line) across 7 codex verify rounds (R1: 4 P1 → R2: 3 new P1 → R3: 2 new P1 → R4: 2 new P1 + 1 residual → R5: 3 new P1 → R6: 2 new P1 → R7: PASS), cumulative 16 P1 caught + fixed under codex-only degraded mode (Anthropic API limit blocked Claude reviewer team). Empirical 15/15 smoke validation across all source-classification scenarios (single source / stacked sources / nested / stale upgrade / idempotency / fresh / env bypass / skip-commit / abort). PR #71 squashed as `c342aa2`. Master verify report at PR #71 #issuecomment-4421108494. v2.57.0: idd-close Step 6.5 — Distribution Sync chain (PsychQuant/issue-driven-development#45). NEW Step 6.5 inserted between Step 6 (auto-update phase=closed) and Step 7 (batch close special rules), surfacing user-facing distribution channel sync (plugin marketplace / MCP binary / CLI binary) at issue close moment. Detection-driven AskUserQuestion 3-option pattern (per IC_R011 canonical): (a) `chain to now` invokes `/plugin-tools:plugin-update ` / `/mcp-tools:mcp-deploy` / `/cli-tools:cli-deploy`; (b) `skip — manual later` records `### Distribution Sync Pending` audit + manual command; (c) `not applicable` records reason. Detection helpers (inlined in Step 6.5 + canonical contract in references/distribution-detection.md): `is_plugin_marketplace_member` walk-up scan ancestor `.claude-plugin/marketplace.json` parse `plugins[].source` (string `\"./plugins/\"` form) + `has_binary_wrapper` line-agnostic scan `bin/*.sh` for GitHub release URL patterns + `resolve_plugin_name` extract matched plugin name for chain command composition + `infer_distribution_type` orchestrator returning plugin/mcp/cli/plugin+mcp/plugin+cli/n/a. Detection-based silent skip for non-distribution repos (always-on). `IDD_DISTRIBUTION_SYNC_PROMPT=false` env var bypasses prompt for distribution-detected repos (1-line audit). D3 mixed-type v1: explicit ordering binary-deploy first → plugin-update second (idempotent regardless of plugin-update Phase 1.5 cascade availability per #66 audit). Step 0.5 Bootstrap Task List adds `distribution_sync_chain_detection` entry. Step 4 closing comment ID capture hardened (stdout-only + sed -n + explicit empty-check). NEW reference doc references/distribution-detection.md. Complements `common-release-flow.md` (release-tier trigger) at close-tier window. Verify discipline survived 3 rounds + degraded engine (Anthropic API limit) — Codex CLI carried + Round 1 had regression + devil's advocate (3 sources convergent), 5 P1 → 0 P1 at Round 3. 2 follow-ups filed: #66 D3 audit (mid-plan tangential), #68 monorepo host disambiguation (round-3 advisory). Backward compat: non-distribution repos see zero behavior change. v2.56.0: idd-issue multi-finding source mode (PsychQuant/issue-driven-development#48, add-multi-finding-source-mode-to-idd-issue Spectra change). Auto-trigger on Step 1 source extracting ≥2 paragraph-level findings from docx/pdf/Telegram/Apple Mail/Apple Notes/pasted-text/md adapters. 4-stage pipeline: Stage 1 Extract verbatim quotes + AI summary; Stage 2 Per-finding picker with AI surface top-3 candidates via gh issue list --search keyword overlap (title×2 + body[:300]×1) + 4-option AskUserQuestion + intent disambiguation [comment/edit body/update status/skip] for picked existing #N + [Other] expands to [New issue/Skip/Merge/Pick free-text]; Stage 3 Batch preview single AskUserQuestion [Execute all/Edit row N/Cancel]; Stage 4 Dispatch with warn-continue (failures log to jsonl actions[i].error + retry_hint, no abort, no rollback). Audit trail dual-track: per-action body footer `> Surfaced via /idd-issue multi-finding mode from ` + structured JSONL at `.claude/.idd/issue-runs/.jsonl` committed to git for cross-machine continuity. Two-way merge via inline sub-prompt (partner picker + combined target picker), JSONL records merged_from / merged_into bidirectionally; three-way+ refused. NEW override flags `--multi-finding` (force mode) / `--no-multi-finding` (force fall-through); mutually exclusive with each other and with `--bundle-mode` (different mental models: bundle = explicit ordered/unordered creation; multi-finding = source-driven mixed routing). NEW capability `idd-issue-multi-finding-source` parallel to existing `idd-issue-bundle` (both extend idd-issue with non-overlapping modes). Cross-reference updates to idd-comment/idd-edit/idd-update SKILL.md adding \"When to use idd-issue multi-finding mode instead\" sections redirecting batch source workflows. Backward compat: single-issue invocations unchanged byte-equivalent; --bundle-mode invocations unchanged; auto-trigger threshold is ≥2 detected findings else fall through. 5 architectural decisions D1-D5 from spectra-discuss session 2026-05-10 + 2 derived D6 trigger detection / D7 mutual exclusion in design.md. v2.55.0: NEW /idd-all-chain skill — chain-solve mode (PsychQuant/issue-driven-development#44, add-idd-all-chain-skill Spectra change). Drives root issue + auto-emergent spawned issues (sub-skill sister sweeps / verify follow-ups / mid-plan tangentials / sister concerns) through ONE cluster branch + ONE review PR. NEW skill /idd-all-chain #N: thin shell over /idd-all, internally recursive-invokes /idd-all #M --in-chain. Phase 0 creates cluster branch idd/chain-- from default branch + initializes spawn manifest at .claude/.idd/state/chain-spawned-issues.json (schema_version=1, atomic temp-file rename writes). Phase 2 main loop pops queue, invokes sub-/idd-all, reads manifest delta, enqueues chain-eligible spawns (rule: same_file_as_root OR same_skill_as_root OR spawn_kind='sister-bug'). Phase 3 opens cluster PR (title prefix 'chain:', collapsed
per issue, Refs all chained, Pending review checklist forbidding Closes/Fixes/Resolves trailers per IDD discipline). Phase 4 STOPs at verified — no auto-close, no auto-merge (per-issue /idd-close required). NEW --in-chain flag on /idd-all: single source for chain context, derives 4th mode tuple (direct-commit, unattended). Sub-/idd-all skips Phase 0.5 PR-mode branch creation + skips Phase 5.5 PR open + sub-skills receive UNATTENDED MODE directive. --in-chain mutex with --pr/--no-pr. NEW spawn manifest cross-skill contract: 4 sub-skills (idd-implement Step 5.7 sister bug sweep / idd-verify Phase 4 follow-up findings / idd-plan Step 2.5 tangentials / idd-diagnose Step 3.6 sister concerns) all conformantly write entries with classify spawn_kind + same_file_as_root + same_skill_as_root flags. Helper script scripts/manifest-append.sh implements atomic write + schema_version mismatch abort. Hard caps: chain_max_depth=2, chain_max_issues=5 (incl. root) — over-cap spawns still file as follow-up issues but not enqueued. Failure mode: any chained verify FAIL halts queue + preserves partial commits on cluster branch (no rebase/revert) + abort report cites 4 recovery paths. MODIFIED capability idd-orchestrator-modes: 4th mode tuple (direct-commit, unattended) added for chain context; existing 3 tuples behavior unchanged. NEW reference docs: references/spawn-manifest.md (schema canonical contract) + references/chain-flow.md (chain shell algorithm canonical contract incl. eligibility rule + caps + failure mode + PR body schema). Backward compat: /idd-all #N without --in-chain flag is byte-equivalent to v2.53.0 baseline. v2.52.0: idd-issue ordered/unordered bundle flags (PsychQuant/issue-driven-development#21). NEW `--parent ` flag PATCHes parent issue's body task list with new child entry, idempotent via `#N` reference scan + fallback `## Children` anchor when no list exists. NEW `--blocked-by [,...]` flag applies three-layer fallback chain: Layer 1 GraphQL `addBlockedByDependency` mutation attempt (graceful failure → warning + continue, no abort) + Layer 2 unconditional body blockquote `> Blocked by #M` (always readable in any markdown viewer) + Layer 3 parent task list annotation `(blocked by #M)` when `--parent` co-used. NEW `--bundle-mode ` flag orchestrates bundle creation in single invocation: builds 1 epic parent + N children with auto-applied `--parent `, ordered mode adds strict `child[i] blocked by child[i-1]` chain, unordered keeps task list only. Pre-flight gates: cross-repo refuse (parent in different repo than resolved target → abort + redirect to `groups` mechanism), bundle-mode and group-mode mutual exclusion (different mental models, refuse if both set). Step 3.B inserted between 3.A (single repo) and 3.G (group cross-link), reusing 3.A flow as primitive. Orthogonal with Step 4.5 milestone (bundle children get milestone assignment), Step 4.7 sister sweep (parent epic still subject to sweep, sibling issues NOT added to bundle task list). NEW canonical reference doc references/bundle-flags.md (flag spec + edit algorithm + fallback chain + partial failure + idempotency contract). NEW `## Ordered Bundle Pattern` section after Step 5 in idd-issue SKILL.md (3-mode comparison table + 3 usage scenarios + design rationale for not creating separate /idd-bundle skill). Step 0 Bootstrap Task List adds `resolve_parent_link`, `apply_blocked_by`, `orchestrate_bundle_mode` TaskCreate entries. NEW capability `idd-issue-bundle` in openspec/specs/. No breaking changes — all flags additive, omitted invocation behavior unchanged. Spectra change `add-bundle-flags-to-idd-issue` in this repo's openspec/changes/. v2.51.0: idd-list shows open PR info per issue + cluster detection (PsychQuant/issue-driven-development#13). NEW Step 2.5 batch fetches all open PRs once via 'gh pr list --state open --limit 100'; NEW Step 3.5 client-side regex-scans PR bodies for '#N' refs and builds reverse issue→PR index plus cluster map (PRs ref'ing 2+ issues). Step 4 Format Output extended: each issue with a PR ref gets a sub-line '└─ PR #N (status, mergeable)'; cluster leaders (lowest issue number in refs) show 'cluster: #X #Y #Z' listing all members; cluster members show '→ see PR #N (cluster member)' redirect. Direct-commit issues (no PR refs) display unchanged from v2.50 — fully backward compatible. Footer adds second line summarizing 'N issues bundled in M cluster(s); P solo PR(s); Q direct-commit'. Step 5 Suggest Next extended to phase × PR state matrix (10+ rows): implemented + draft → 'gh pr ready N → /idd-verify --pr N'; implemented + ready MERGEABLE → '/idd-verify --pr N'; verified + ready MERGEABLE → 'gh pr review N → gh pr merge N → /idd-close #N'; verified + merged catch-up → '/idd-close #N'; CONFLICTING → 'gh pr checkout N → resolve'; cluster member → 'see leader's next action'. Sister concerns filed as future P3 follow-ups: #14 (markdown-aware PR body parser to ignore '#N' inside fenced code blocks; v1 accepts false positive) + #15 (cluster_leader config 'lowest|primary' instead of hardcoded lowest). v2.50.0: Layer V Vagueness Pre-check (PsychQuant/issue-driven-development#12). NEW Step 3.4 in idd-diagnose between Layer 1 disqualifier and Layer 2 Spectra evaluation: AI scores V1 (vague WHAT) + V4 (vague ACCEPTANCE) on Likert 6-point scale (no neutral midpoint), trigger threshold per-axis ≥ 4. Triggered cases fire Hybrid 3-option AskUserQuestion (clarify now / proceed anyway / escalate to Plan) with default option score-driven (V=4 → proceed, V=5 → clarify, V=6 → escalate). 'clarify now' appends Q/A pairs to issue body via gh issue edit then re-runs Layer V; 'proceed anyway' continues to Layer 2/3/P with audit trail recording trigger fact; 'escalate to Plan' force-sets verdict = 'Plan via Layer V' and skips Layer 2/3/P. Layer evaluation order: Layer 1 → V → 2+3 → P → Simple. Routing parsers in idd-implement Step 2.5 + idd-all Phase 3 strip ' via X' suffix to extract canonical tier — bare 'Plan' / 'Simple' / 'Spectra' verdicts unchanged (backward compat). NEW project rule .claude/rules/attribute-assessment.md codifies meta-principle 'attribute scoring SHALL use Likert scale, not keyword matching' — applies session-wide via root CLAUDE.md @import, scope beyond Layer V (any future attribute scoring need). MANIFESTO 5-axis bug-fix model expanded to 6-axis adding 'Alignment quality' (TDD ❌ / SDD ❌ / IDD ✅), evidence = Layer V. idd-all unattended mode auto-applies 'proceed anyway' + audit trail '[Layer V: V1=N V4=M, clarify-default skipped under unattended mode, defaulting to proceed]' (same pattern as Plan tier under unattended). Backward compat: pre-v2.50 diagnoses NOT retroactively re-evaluated; existing Simple / Plan / Spectra / SDD-warranted verdicts remain valid. No --ignore-vagueness flag (option B 'proceed anyway' covers that need). Spectra change add-vagueness-layer-routing in this repo's openspec/changes/. Step 0 Bootstrap Task List adds 'vagueness_precheck' TaskCreate. v2.49.0: references/ic-r011-checkpoint.md v1.1.0 — Third-Party Skill Alignment section for /spectra-discuss + /spectra-propose (kiki830621/ai_martech_global_scripts#530, sub-issue E of #523 systematic plugin alignment, last sub-issue closing the parent epic). spectra-* skills are published by third-party kaochenlong/spectra-app — direct SKILL.md modification not in this plugin's commit cycle. Documentation-side alignment: agents/users invoking /spectra-discuss + /spectra-propose with IC_R011 in mind apply the canonical 3-option AskUserQuestion + audit trail manually at deliberation-moment equivalents (discussion convergence / proposal drafting). Per canonical eligibility criteria §6, only the 2 deliberation-moment spectra-* skills (discuss / propose) need alignment; the other 6 (apply / archive / ask / ingest / commit / debug) are mechanical execution and N/A. If spectra-app upstream adopts native IC_R011 checkpoint, this section becomes redundant + can be removed. Strength: SHALL — discussion / proposal drafting are deliberation moments per canonical eligibility criteria. v2.48.0: idd-issue Step 4.7 — Linked-Context Sister Sweep (kiki830621/ai_martech_global_scripts#529, sub-issue D of #523 systematic plugin alignment). NEW advisory step between Step 4.5 (auto-milestone) and Step 5 (報告), scanning issue body draft + linked attachments + recent session conversation for sibling-concern markers (also / additionally / related / 另外 / 順便 / BTW). If hits, AskUserQuestion 3-option per canonical references/ic-r011-checkpoint.md (#525). 'file as sibling issues now' / 'file selected' files via 'gh issue create' as parallel issues (NOT cross-linked into the just-created issue body, since user's primary concern stays focused), each with confidence:confirmed + priority:P3 + source link 'surfaced during /idd-issue #NEW linked-context sister sweep (Step 4.7)'. PATCHes the just-created issue body to add '### Linked-Context Siblings Filed (v2.48.0+ #529)' audit trail per canonical heading conventions. Strength: SHOULD (advisory, non-blocking) per canonical eligibility criteria §6 — issue creation is light-touch (user is already in filing-active mode, double-prompt risks friction). Empty list = silent no-op default. AI_LOW_BAR_ISSUE_FILING=false env var skips silently per IC_R011 rollback hatch. Step 0 Bootstrap Task List adds 'linked_context_sister_sweep' TaskCreate. v2.47.0: idd-diagnose Step 3.6 — Sister Concern Surfacing (kiki830621/ai_martech_global_scripts#528, sub-issue C of #523 systematic plugin alignment). NEW mandatory step between Step 3.5 (Complexity Assessment) and Step 3.7 (Agent Routing), surfacing sister-concern markers in just-posted Diagnosis content (也有 / sister / 同樣的 / 另外 / likewise affects) + scout session log. AskUserQuestion 3-option per canonical references/ic-r011-checkpoint.md (#525). 'file all/selected' files via 'gh issue create' with confidence:confirmed + priority:P3 + source link, then PATCHes Diagnosis comment with '### Sister Concerns Filed (mid-diagnose, v2.47.0+ #528)' audit trail per canonical heading conventions. Strength: SHALL (mandatory step) per canonical eligibility criteria — diagnosis is a deliberation moment where sister concerns naturally surface during Strategy authoring. Empty list legitimate. AI_LOW_BAR_ISSUE_FILING=false env var skips silently per IC_R011 rollback hatch. Step 0 Bootstrap Task List adds 'sister_concern_surfacing' TaskCreate. v2.46.0: idd-all HITL mode (PsychQuant/issue-driven-development#1). Phase 0.5 mode resolution from existing pr_policy + new --pr/--no-pr flags into (path, interaction) tuple — PR + unattended (v2.40.0 regression — /loop friendly) or direct-commit + attended (HITL — solo/personal repos where PR is ceremony, user is in keyboard, sub-skill AskUserQuestion / EnterPlanMode / Park-Apply prompts fire natively). Two axes from one source (no duplicate config surface). v2.45.0: idd-close Step 3.5 — Closing Summary Follow-up Keyword Scan (kiki830621/ai_martech_global_scripts#527, sub-issue B of #523 systematic plugin alignment). NEW step between Step 3 (review with user) and Step 4 (gh issue close), scanning drafted closing summary for trigger phrases (follow-up / deferred / future / TODO / later / 之後 / 未來 / 順便 / 我之前觀察到 / 之後再 / 改天). Each match is checked against existing #NNN cross-links via 'gh issue view' — orphan mentions (no link or stale link) trigger AskUserQuestion 3-option per canonical references/ic-r011-checkpoint.md (#525). 'file all/selected' files via 'gh issue create' with confidence:confirmed + priority:P3, then PATCHes closing summary inline (mention → '...(see #NEW)') and adds '### Closing Follow-ups Filed (v2.45.0+ #527)' audit trail. Strength: SHOULD (advisory, non-blocking) per canonical eligibility criteria — closure is mostly mechanical action; surfacing orphan-mention pattern at decision moment without forcing filing. AI_LOW_BAR_ISSUE_FILING=false env var skips silently per IC_R011 rollback hatch. Disambiguation note added: this Step 3.5 is the IC_R011 checkpoint; Step 0 supersession (#515 v2.41.0) is gate logic — orthogonal concerns. Step 0.5 Bootstrap Task List adds 'closing_followup_keyword_scan' TaskCreate. v2.44.0: idd-implement Step 5.7 — Sister Bug Sweep (kiki830621/ai_martech_global_scripts#526, sub-issue A of #523 systematic plugin alignment). New mandatory step between Step 5.5 (Open PR if PR path) and chain to /idd-verify, surfacing sister bugs discovered during TDD reproduction (Step 3) — adjacent same-root-cause sibling files like the proven 2026-05-03 #510 → #518 → #520 cluster (gen_*.R / fix_wiser_poisson_tables.R / _build.R) where each manual reminder was needed despite same pattern. Cites canonical references/ic-r011-checkpoint.md (#525) for 3-option AskUserQuestion (file all / file selected / skip) + heuristic triggers + audit trail format + AI_LOW_BAR_ISSUE_FILING=false rollback hatch. PATCHes Implementation Complete comment to add `### Sister Bugs Filed (mid-impl, v2.44.0+ #526)` audit trail per canonical heading conventions table. Strength: SHALL (mandatory step) but empty list legitimate. Step 0 Bootstrap Task List adds `sister_bug_sweep` TaskCreate entry. v2.43.0: NEW canonical reference doc references/ic-r011-checkpoint.md (kiki830621/ai_martech_global_scripts#525, sub-issue F of #523 systematic plugin alignment). Standardizes the 3-option AskUserQuestion pattern (file all / file selected / skip), heuristic triggers (verifiable behavior gap / sister bug from reproduction / observed friction / deferred work / out-of-scope user mentions / drift / TODO encounters), default-off exemptions (pure exploration / existing issue / hallucinated / CONSTRAINT / mechanical execution stages), audit trail per-skill heading conventions, rollback escape hatch (env var + repo CLAUDE.md flag), and eligibility criteria (which skills SHALL vs SHOULD vs N/A). Cited from idd-plan Step 2.5 (#524) + idd-close Step 0 supersession (#515) — both back-link the canonical doc. Sister sub-issues #526-#530 (idd-implement / idd-close closing summary scan / idd-diagnose / idd-issue / spectra-discuss + spectra-propose) will all cite this canonical doc when their Plan tier ships;cross-skill consistency mechanically anchored. v2.42.0: idd-plan Step 2.5 — mid-plan tangential observations sweep (kiki830621/ai_martech_global_scripts#524 fix). Plan-tier deliberation surfaces tangential discoveries (Phase 1 Explore agents pass-by sister bugs, Phase 2 grep-discovered drift, Phase 3 user-mentioned sub-concerns) that previously fell into the gap between In-scope and Out-of-scope categorization, vanishing into conversation. New mandatory step between Step 2 (Draft Plan) and Step 3 (Confirm post): agent reviews session log, surfaces candidates with IC_R011 default-on heuristic (verifiable behavior gap / sister bug / out-of-scope user-mentioned), AskUserQuestion three-option (file all / file selected / skip), files via 'gh issue create' with confidence:confirmed + priority:P3 + source link to plan issue, then PATCHes plan body to add '### Tangential Observations' audit trail. Empty list = no-op (legitimate). AI_LOW_BAR_ISSUE_FILING=false env var skips per IC_R011 rollback hatch. Codifies IC_R011 spirit at the mid-plan window — finer gap than #523 broader systematic alignment. v2.41.0: idd-close Step 0 supersession of pre-implementation Strategy / Implementation Plan checkboxes (kiki830621/ai_martech_global_scripts#515 fix). When `## Implementation Complete > ### Checklist` exists and all its items are `- [x]`, that subsection is treated as the canonical state of truth — `Strategy` / `Implementation Plan` `- [ ]` items are auto-superseded (skipped from gate). Resolves the recurring friction where work was complete but `idd-implement` Step 5 only synced its own Implementation Complete comment (never PATCHed Strategy / Plan comments), leaving 8+ pre-impl `- [ ]` items blocking gate and forcing manual `gh api PATCH` workaround on every full-lifecycle close (#455 / #510 close, 2026-05-03). Defensive properties preserved: incomplete Implementation Complete (any `- [ ]` remaining) falls back to legacy full spec scan; legacy issues without Implementation Complete unchanged. Strategy A from #515 diagnosis (chosen over B sync-at-write and C narrow-gate). v2.40.0: --cwd flag propagated to all sub-skills (idd-diagnose / idd-implement / idd-verify) so cross-repo orchestration via idd-all actually works end-to-end. v2.39.0 added --cwd to idd-all only — but sub-skills still inherited Claude Code session cwd, so idd-implement would commit to the wrong repo. NEW: shared `references/cross-repo-cwd.md` documents the substitution rule (`git X` → `git -C $CWD X`, `gh issue/pr/repo X` → `gh ... X -R $GITHUB_REPO`) once; each sub-skill cites it at the top of Execution. NEW: idd-all Phase 1/2/3a/4 forward `--cwd $CWD` to sub-skill args; Phase 1 (idd-issue) and follow-up-issue creation use `--target $GITHUB_REPO` instead (read-only, no local git needed). Backward compat: omitting --cwd reads session pwd (existing behavior). v2.39.0: idd-all --cwd flag + cross-repo invocation. NEW Step 0.2 Resolve Working Tree resolves target repo from --cwd /path/to/clone (per-invocation override) instead of hardcoded session cwd. All git ops use 'git -C $CWD'; all gh ops use 'gh -R $GITHUB_REPO' (repo derived from origin remote). Solves 'Skill tool inherits Claude Code session-level cwd, can't follow mid-session cd' friction when running idd-all on a repo other than the one your session started in (e.g. thesis work in repo A, want pipeline on dependency repo B). Phase 0.2/0.3 abort messages now include explicit 'pass --cwd /path/to/clone' alternative. Backward compat: omitting --cwd uses session cwd (existing behavior). v2.38.0: idd-route integration — data-driven agent routing recommendation from observed track record. NEW idd-diagnose Step 3.7: if ~/bin/idd-route is available, calls it with current issue's complexity + estimated scope LOC + extracted signals to get an agent recommendation (codex-gpt-5.5-xhigh / claude-opus-4.7 / sonnet-4.6 / haiku-4.5), injects 'Recommended Agent' section into diagnosis comment. NEW idd-verify Step 5d: records each verify outcome (issue, agent, complexity, scope, round trips, blocking findings, follow-ups) to /.claude/.idd/routing-stats.jsonl + global mirror. NEW idd-close Step 4.5: appends final outcome (merged/abandoned) — append-only so original in_review record stays for audit. All three are gracefully no-op when idd-route binary missing (command -v check). Companion plugin idd-route ships in same marketplace; binary source at PsychQuant/idd-route-swift. NEW references/agent-routing.md is canonical contract for the IDD ⇄ idd-route boundary. Built on top of v2.37.0's external-agent / PR mode foundation — the routing recommendation closes the loop: idd-diagnose suggests agent → user delegates → idd-verify records outcome → next idd-diagnose recommendation gets smarter. Plus marketplace migration: this is the first issue-driven-dev release in the new PsychQuant/issue-driven-development marketplace (formerly lived in psychquant-claude-plugins; full git history preserved via filter-repo). v2.37.0: External-agent / PR mode for idd-verify + use-case routing reference. NEW idd-verify --pr input mode for verifying PRs opened by external agents (Codex via codex exec, Copilot Workspace, remote claw on PsychQuantClaw) — gh pr diff + gh pr checkout so reviewer agents see file context, auto-restore original branch after verify. Plus --commits N / --since / --branch flags for other input sources. Auto-detect mode (no flag): counts unpushed Refs #N commits since origin/ first; if 0, queries open PRs ref'ing #N and AskUserQuestion to pick between local diff vs PR — catches the common 'forgot --commits N' case without silently switching modes. Issue↔PR correspondence is a hard iron rule: PR mode aborts before invoking 6-AI ensemble if PR body has zero Refs #N (untrackable change violates IDD discipline) or if user-passed issue isn't in PR's Refs set (correspondence broken); discovers superset triggers AskUserQuestion to confirm scope. PR mode flips master comment location: full verify report posts to PR (external agent owners work in PR view, never see issue comments), each ref'd issue gets a 1-line pointer comment back with PASS/FAIL + master comment URL. Capture-master-URL-then-write-pointer SOP enforced (prevents the recurring bug class where pointer URLs accidentally reference earlier diagnosis/implementation comments). NEW references/external-agent-delegation.md is canonical contract: 4-phase delegation impact matrix (diagnose stays, implement may delegate, verify+close return to IDD), hands-off principle (no babysitting external agents; strict verify, opt-in fix takeover), 3 input modes + auto-detect algorithm, issue↔PR gate, PR-as-master cross-post, working tree handling, deferred items (--takeover, idd-handoff, force-push detection). NEW references/usecase-routing.md closes discoverability gap: 24-row table mapping common scenarios → exact skill chain + flags + contract doc (single / batch / cluster-PR / external-agent PR/commits/branch/auto / Plan tier / Spectra-warranted / bundle close / Spectra-bridge / multi-repo monorepo) plus top-of-doc decision tree for users unsure which entry point to start from. Linked from CLAUDE.md (Claude-facing) and README.md (human-facing). Backward compat: single-issue invocation idd-verify #42 without flags still works as v2.36 in common case (no Refs commits, no open PRs → falls back HEAD~1); cluster-PR mode #34 #36 #38 unchanged; no flag deprecations. v2.36.0: 3-tier Complexity routing (Simple / Plan / Spectra) + new idd-plan skill. SDD-warranted renamed to Spectra (backward-compat alias preserved). Plan tier inserts EnterPlanMode approval gate between diagnosis and TDD execution — covers 'think before leap, no spec contract needed' (most common case where Simple was too thin and Spectra was overkill). Issue-driven development methodology: issue → diagnose → (idd-plan if Plan tier) → implement → verify → close.", - "version": "2.65.0", + "version": "2.66.0", "author": { "name": "Che Cheng" }, diff --git a/plugins/issue-driven-dev/CHANGELOG.md b/plugins/issue-driven-dev/CHANGELOG.md index 71c115d..8c8865b 100644 --- a/plugins/issue-driven-dev/CHANGELOG.md +++ b/plugins/issue-driven-dev/CHANGELOG.md @@ -7,6 +7,27 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [2.66.0] - 2026-05-20 + +### Added + +- **`idd-close` Step 3.6 — Residue Acknowledgement** ([#105](https://github.com/PsychQuant/issue-driven-development/issues/105)): closes the `### Residue` write-only loop from #103. v2.64.0 added `### Residue` to the Diagnosis template (NSQL §4.6 — non-operationalizable intent) but no downstream skill consumed it. Per #103 PR #104 Devil's Advocate finding D2: "latent capacity for the section to drift into ritual filler with no consumer pressure to keep it honest." Step 3.6 gives Residue its first consumer at close time. Reads latest `## Diagnosis` comment's `### Residue` section (mirrors Step 0 supersession). Silent skip when section missing, content is `(none)`, or pre-v2.64.0 format. When non-empty, AskUserQuestion 3-option (`still residue — acknowledge` / `file as follow-up issue(s)` / `skip — audit trail only`). Audit trail PATCH appends `### Residue Acknowledgement` to the in-memory closing summary draft before publish. Filed follow-ups get spawn manifest entries when chain context active. SHOULD-tier (non-blocking) per closure-tier IC_R011 eligibility. Step 0.5 Bootstrap adds `residue_acknowledgement` task. Placement mirrors Step 3.5's drafted-summary-scan pattern; must run before Step 4 publish so audit PATCH operates on same draft. + +- **`idd-issue` Step 5 — CI/loop hard-parse warning** ([#107](https://github.com/PsychQuant/issue-driven-development/issues/107)): #103 PR #104 expanded `idd-issue` Step 5 from metadata-only to also echo AI-rendered `## Type` / `## Expected` / `## Actual` + plain-language interpretation. Strictly better for human readers (misparse catchable from terminal) but a silent surface change for CI / `/loop` scripts that hard-parse Step 5 stdout. Adds one ⚠ paragraph mirroring the v2.55.0 `--no-multi-finding` CI warning precedent at line 994. Verbatim wording from the issue body. No behavior change — purely defensive documentation. + +### Changed + +- **PR-body checklist wording aligned across the IDD documentation family** ([#108](https://github.com/PsychQuant/issue-driven-development/issues/108)): #102 shipped the NSQL doctrine that `verify-gated PASS` is the terminal default disposition but only updated `idd-all-chain` Phase 5; the parallel templates were intentionally deferred. #108 closes the 5-template + 3-satellite consistency family. + - **4 PR-body templates** (`skills/idd-implement/SKILL.md:503` + `skills/idd-all/SKILL.md:755` + `references/pr-flow.md:135` + `references/chain-flow.md:254`) drop legacy `Pending: human review of this PR + /idd-close after merge` framing; default wording becomes `- [x] **Verify-gated**: PR verify PASS — ready to merge → /idd-close #${NUMBER} after merge` (or cluster variant for `chain-flow.md`). Per Option A from #108 diagnosis: `idd-implement` does NOT accept `--review` flag (remains `idd-all` + `idd-all-chain` only); direct `idd-implement` invocations get the default wording without conditional. + - **F3 satellite** — `idd-all-chain` Phase 4 final stdout report dispatches on `$REVIEW_FLAG`: default emits `Verify: verify-gated PASS across cluster — cluster ready to merge` + `Next: Merge → /idd-close`; with `--review` emits `awaiting human acceptance (re-opened confirmation loop per --review)` + `Next: Review PR → Merge after acceptance → /idd-close`. Built via explicit `if/else` before the heredoc to avoid the `${VAR:-word}` mutex pitfall hardcoded into the doctrine after PR #109 F1. + - **Trace 1 example refresh** — `idd-all/SKILL.md` Trace 1 example block (lines 893-901) shows the v2.65.0+ wording: default `Verify: verify-gated PASS` + `Next: merge`, with a parallel `--review` variant block showing `awaiting human acceptance` + `merge after acceptance`. Aligns documentation with actual Phase 6 output. + - **DA3 wording precision** — `--review` flag is now described as **orchestrator-scope messaging-only** (was just `messaging-only`) in 3 sites (`idd-all` Phase 0 args parsing comment, `idd-all-chain` Phase 0 args parsing comment, `MANIFESTO.md` Human-in-the-loop `--review` paragraph). The qualifier prevents the misreading: the flag is messaging-only AT THE ORCHESTRATOR (doesn't change skill behavior, doesn't make orchestrator wait), but humans + CI parsers downstream can react to the changed text differently — so the flag is not messaging-only end-to-end. + +### Notes + +- Plugin v2.66.0 is a **minor** bump (over v2.65.0): new `idd-close` step (additive behavior at close time) + 4 default PR-body wording strings change (user-visible diff in every PR opened by IDD orchestrators) + new conditional in `idd-all-chain` Phase 4 stdout. Patch would have under-claimed. +- Marketplace.json sync deferred to `/idd-close` Step 6.5 chain (per repo precedent, same path used by #103 / #102). + ## [2.65.0] - 2026-05-20 ### Added From 6bae8e6bb966bbae1b0737e5a5f4eb419486f455 Mon Sep 17 00:00:00 2001 From: che cheng Date: Wed, 20 May 2026 10:42:52 +0800 Subject: [PATCH 7/7] =?UTF-8?q?fix:=20address=20PR=20#110=20verify=20findi?= =?UTF-8?q?ngs=20=E2=80=94=20spec=20drift=20+=20heading=20+=20wording?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Verify findings dispatched in same PR per feedback_verify_fix_same_pr: - H1 (regression): openspec/specs/idd-all-chain/spec.md:161 contract drift — updated section heading + bullet wording to match shipped chain-flow.md (## Review status + Verify-gated default + --review opt-in branch). Otherwise live spec contracts pre-v2.66.0 wording that v2.66.0 removes from emission. - L3 (regression): chain-flow.md:249 section heading swap '## Pending review' → '## Review status'. Was missed when idd-all-chain SKILL.md got the cosmetic heading swap; chain-flow.md is the documentation contract and should match. - L1 (regression): idd-issue/SKILL.md:880 parenthetical pointed at 'line 994' but actual reference moved to line 996 after paragraph insertion (off-by-2 from the inserted paragraph itself). Drop the line-number reference entirely — paths rot, the descriptive '--no-multi-finding CI warning below' is enough. - Codex finding (nit): CHANGELOG.md #107 entry claimed 'Verbatim wording from the issue body' but shipped wording adds two skill- internal items (#107 self-reference + precedent parenthetical). Softened to 'near-verbatim ... with two skill-internal additions' to keep CHANGELOG accuracy honest. Refs #105 #107 #108 --- openspec/specs/idd-all-chain/spec.md | 2 +- plugins/issue-driven-dev/CHANGELOG.md | 2 +- plugins/issue-driven-dev/references/chain-flow.md | 2 +- plugins/issue-driven-dev/skills/idd-issue/SKILL.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/openspec/specs/idd-all-chain/spec.md b/openspec/specs/idd-all-chain/spec.md index a85777b..117bc72 100644 --- a/openspec/specs/idd-all-chain/spec.md +++ b/openspec/specs/idd-all-chain/spec.md @@ -158,7 +158,7 @@ After the chain queue is processed (full success, per-root partial failure, or a 2. `Refs # # ... # # ...` listing all chained issue numbers (all roots first, then their spawns) 3. A `## Cluster overview` section with a table summarizing each issue (issue number, `root_id` it belongs to, spawn source, phase, head commit) 4. A `## Per-issue details` section using collapsed `
` HTML elements per issue -5. A `## Pending review` checklist where the final box reads `Pending: human review of cluster PR + /idd-close after merge` +5. A `## Review status` checklist where the final box reads `- [x] **Verify-gated**: per-issue verify PASS — cluster ready to merge → /idd-close # # ... per issue after merge` (default), or with `--review` opt-in `awaiting human acceptance (re-opened confirmation loop per --review)` (per #108 NSQL doctrine; section heading swapped from `## Pending review` in v2.66.0) The PR body SHALL NOT contain `Closes #N` / `Fixes #N` / `Resolves #N` trailers (per existing IDD discipline against auto-close). diff --git a/plugins/issue-driven-dev/CHANGELOG.md b/plugins/issue-driven-dev/CHANGELOG.md index 8c8865b..b6a609d 100644 --- a/plugins/issue-driven-dev/CHANGELOG.md +++ b/plugins/issue-driven-dev/CHANGELOG.md @@ -13,7 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - **`idd-close` Step 3.6 — Residue Acknowledgement** ([#105](https://github.com/PsychQuant/issue-driven-development/issues/105)): closes the `### Residue` write-only loop from #103. v2.64.0 added `### Residue` to the Diagnosis template (NSQL §4.6 — non-operationalizable intent) but no downstream skill consumed it. Per #103 PR #104 Devil's Advocate finding D2: "latent capacity for the section to drift into ritual filler with no consumer pressure to keep it honest." Step 3.6 gives Residue its first consumer at close time. Reads latest `## Diagnosis` comment's `### Residue` section (mirrors Step 0 supersession). Silent skip when section missing, content is `(none)`, or pre-v2.64.0 format. When non-empty, AskUserQuestion 3-option (`still residue — acknowledge` / `file as follow-up issue(s)` / `skip — audit trail only`). Audit trail PATCH appends `### Residue Acknowledgement` to the in-memory closing summary draft before publish. Filed follow-ups get spawn manifest entries when chain context active. SHOULD-tier (non-blocking) per closure-tier IC_R011 eligibility. Step 0.5 Bootstrap adds `residue_acknowledgement` task. Placement mirrors Step 3.5's drafted-summary-scan pattern; must run before Step 4 publish so audit PATCH operates on same draft. -- **`idd-issue` Step 5 — CI/loop hard-parse warning** ([#107](https://github.com/PsychQuant/issue-driven-development/issues/107)): #103 PR #104 expanded `idd-issue` Step 5 from metadata-only to also echo AI-rendered `## Type` / `## Expected` / `## Actual` + plain-language interpretation. Strictly better for human readers (misparse catchable from terminal) but a silent surface change for CI / `/loop` scripts that hard-parse Step 5 stdout. Adds one ⚠ paragraph mirroring the v2.55.0 `--no-multi-finding` CI warning precedent at line 994. Verbatim wording from the issue body. No behavior change — purely defensive documentation. +- **`idd-issue` Step 5 — CI/loop hard-parse warning** ([#107](https://github.com/PsychQuant/issue-driven-development/issues/107)): #103 PR #104 expanded `idd-issue` Step 5 from metadata-only to also echo AI-rendered `## Type` / `## Expected` / `## Actual` + plain-language interpretation. Strictly better for human readers (misparse catchable from terminal) but a silent surface change for CI / `/loop` scripts that hard-parse Step 5 stdout. Adds one ⚠ paragraph mirroring the v2.55.0 `--no-multi-finding` CI warning precedent. Wording is near-verbatim from the issue body's `## Expected`, with two skill-internal additions: the `#107` self-reference suffix on the `v2.64.0+` marker, and a parenthetical pointer to the parallel precedent (no line number — paths rot). No behavior change — purely defensive documentation. ### Changed diff --git a/plugins/issue-driven-dev/references/chain-flow.md b/plugins/issue-driven-dev/references/chain-flow.md index 9deb8e2..c41c027 100644 --- a/plugins/issue-driven-dev/references/chain-flow.md +++ b/plugins/issue-driven-dev/references/chain-flow.md @@ -246,7 +246,7 @@ Refs # # ... # # ... (roots first, then ... -## Pending review +## Review status - [x] Diagnose ✓ for all issues - [x] Implement ✓ diff --git a/plugins/issue-driven-dev/skills/idd-issue/SKILL.md b/plugins/issue-driven-dev/skills/idd-issue/SKILL.md index a4acef2..30a41dc 100644 --- a/plugins/issue-driven-dev/skills/idd-issue/SKILL.md +++ b/plugins/issue-driven-dev/skills/idd-issue/SKILL.md @@ -877,7 +877,7 @@ options: > **為什麼**:建 issue 是一個 NSQL `run → report` 操作(見 repo `CLAUDE.md`「Reference Projects: NSQL」)。建 issue 可逆,不需要 confirm gate;但 report 必須陳述「我做了什麼」,不只「它在哪」。回顯 AI render 的詮釋,讓 misparse(AI 把意圖讀錯)一眼可抓,不用點進 URL 才發現。 -> **⚠ CI / `/loop` callers (v2.64.0+, #107)**: Step 5 terminal output expanded from metadata-only (`number / URL / labels / type`) to also echoing the rendered `## Type` / `## Expected` / `## Actual` + plain-language interpretation. If your script hard-parses Step 5 output for the metadata fields only, add a `-m 1` / first-N-lines guard or grep specifically for the `issue.*#NNN.*created` line — the new echo paragraphs follow it. (Parallel precedent: `--no-multi-finding` CI warning below at line 994.) +> **⚠ CI / `/loop` callers (v2.64.0+, #107)**: Step 5 terminal output expanded from metadata-only (`number / URL / labels / type`) to also echoing the rendered `## Type` / `## Expected` / `## Actual` + plain-language interpretation. If your script hard-parses Step 5 output for the metadata fields only, add a `-m 1` / first-N-lines guard or grep specifically for the `issue.*#NNN.*created` line — the new echo paragraphs follow it. (Parallel precedent: `--no-multi-finding` CI warning below.) 提示下一步:`/issue-driven-dev:idd-diagnose #NNN`