Skip to content

feat(idd-all-chain): Phase 0 diagnosis-readiness gate (Step 0.4)#50

Merged
kiki830621 merged 5 commits intomainfrom
idd/47-feature-idd-all-chain-phase-0-pre-flight
May 10, 2026
Merged

feat(idd-all-chain): Phase 0 diagnosis-readiness gate (Step 0.4)#50
kiki830621 merged 5 commits intomainfrom
idd/47-feature-idd-all-chain-phase-0-pre-flight

Conversation

@kiki830621
Copy link
Copy Markdown
Contributor

Refs #47

Summary

/idd-all-chain Phase 0 加新 gate (Step 0.4) 偵測 root issue 是否有 diagnosis comment。沒 diagnosis 跑 chain 風險:unattended idd-diagnose Layer V 自動 proceed → 基於 vague spec 做 design 猜測 → 6-AI verify 抓不到根本問題。

3 個 commits:

  • 0fd9dbd Step 0 Bootstrap TaskList 加 check_diagnosis_readiness entry
  • e36e658 Phase 0 插入 NEW Step 0.4 (Diagnosis-readiness check) + renumber existing 0.4→0.5, 0.5→0.6
  • 3092f68 references/chain-flow.md 同步更新 Phase 0 章節 + 新增 "Diagnosis-readiness gate" 段落

Step placement decision

Diagnosis 推 between cluster branch setup 和 manifest init,Plan refined 到 between universal gates 和 cluster branch setup。Rationale:cancel-path side-effect minimization — 若 user 選 cancel,no branch/manifest yet,cleanup 是 zero-action。

AskUserQuestion 3-option (per IC_R011 canonical)

  • run /idd-diagnose first (default,safest) — halt clean
  • proceed anyway — 繼續 chain + PATCH issue body audit trail
  • cancel — clean exit + 「無 cleanup needed」訊息

Trigger context

Sister concern surfaced from #45 first-real-use chain run (halted at Phase 2 entry because user observed #45 had no diagnosis comment + body had pseudocode-shell spec)。本 PR 把那次失敗 reproduction 的 lesson learned 直接固化進 chain pre-flight。

Future #46 multi-root extension hook

Helper function check_diagnosis_readiness(issue_numbers...) signature 設計保留 N-arg shape,#46 multi-root 落地時可直接 reuse 做 per-root readiness aggregation。

Verification

6-AI cross-model verification PENDING (run /idd-verify #47)。

Checklist

  • Diagnose ✓ (Plan tier per Layer V untriggered V1=2 V4=2)
  • Plan ✓ (EnterPlanMode/ExitPlanMode approval gate, plan saved at ~/.claude/plans/snug-tumbling-bentley.md)
  • Implement (3 commits)
  • Verify (run /idd-verify #47)
  • Pending: human review of this PR + /idd-close #47 after merge

Related


🤖 Generated by /idd-implement on PR path. Do NOT add 'Closes #47' — IDD discipline requires manual /idd-close after merge to enforce checklist gate + closing summary。

P1 blockings:
- F1: Remove IN_CHAIN_CONTEXT dead code (no producer in repo;
  /idd-all-chain is user-invoked deliberation moment, no unattended path)
- F2: Move AskUserQuestion(...) out of bash block as prose
  (per idd-all/SKILL.md Phase 0.5 ask-policy pattern;
   AskUserQuestion is Claude tool not bash binary)
- F3: Inline AUDIT_BLOCK build (no forward-ref function);
  audit logic now self-contained at proceed-anyway branch

P2 in-scope:
- P2.1: Add 'set -e' + numeric regex check on HAS_DIAGNOSIS
  (gh/jq failure no longer silently passes the gate)
- P2.2: Renumber 3 Phase 0.4 entries in Failure modes table → Phase 0.5
  (cluster branch checks moved with the renumbering); add 2 new
  Phase 0.4 entries for diagnosis-readiness halts
- P2.3: Audit insertion now detects existing '---' separator and
  inserts before it (no more separator stacking when proceed-anyway
  fires on already-PATCHed body)

Refs #47 (verify findings)

Follow-ups filed separately: #51 helper extraction, #52 verify
orchestration playbook, #53 regex anchor for ## Diagnosis match,
#54 archived spec sync mechanism.
…h sed split, sync prose

Re-verify findings:
- macOS awk doesn't accept multi-line -v values → switch to
  line-split with grep -n + sed -n. POSIX-portable, no quirks.
- Stale 'bypass_audit_trail block' label in routing prose →
  rename to 'proceed-anyway audit trail PATCH bash' to match
  the actual section heading.
- chain-flow.md still described unattended fallback even though
  IN_CHAIN_CONTEXT was removed from SKILL.md → align: explicit
  'No unattended fallback by design' paragraph documenting why
  (deliberation moment, no automated caller path).

Refs #47 (verify re-verify cleanup)
@kiki830621 kiki830621 merged commit a244ee9 into main May 10, 2026
@kiki830621 kiki830621 deleted the idd/47-feature-idd-all-chain-phase-0-pre-flight branch May 10, 2026 03:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feature: /idd-all-chain Phase 0 pre-flight check for root issue diagnosis-readiness

1 participant