chain (multi-root): 3 issues — spectra-archive sync + cluster glob + pasted-image cache - #115
Conversation
Investigation during #93 implementation found that `.agents/skills/` is LIVE (referenced by 4 openspec specs as Spectra-tier dependencies — not legacy as the diagnosis recommended). Original diagnosis recommended deletion; revised disposition (audit comment on #93) is SYNC. This commit syncs only the `spectra-archive` skill — the original #93 scope. `.claude/skills/spectra-archive/SKILL.md` (14865 bytes) was the canonical post-#56 version with Implementation Complete auto-post feature + Step 0 Bootstrap discipline. `.agents/skills/spectra-archive/SKILL.md` (5694 bytes) was pre-#56 — missing both features. Copied .claude/ over .agents/ so the Spectra CLI / agents.md-format callers also get the #56 feature. OUT OF SCOPE for this commit: - `plugins/issue-driven-dev/references/spectra-skills/spectra-archive/` — no markdown cross-refs found; left as historical snapshot per feedback_lead_minimal (low cleanup ROI, no observable callers). - Sister divergences for 7 other spectra-* skills (spectra-audit spectra-discuss spectra-propose spectra-apply spectra-ingest spectra-debug spectra-commit) — beyond #93 stated scope. Audit comment on #93 documents the sister-skill drift matrix; each candidate filed for separate follow-up as needed. - Drift-prevention CI check — deferred until drift recurs naturally. Refs #93
…n A-final doc (#100) #100 Finding 1 (design) — Option A confirmed final: NEW `### Feature-branch + cluster + direct-commit — rejected case` subsection in `references/pr-flow.md` § Cluster mode override. Documents the rejected Option B (branch-context-gated cluster direct-commit) with comparison table + rationale. Contract simplicity wins; users who want feature-branch direct-commit workflow can use single-issue `--no-pr` invocations or cherry-pick post-merge. #100 Finding 2 (refactor) — glob hardening: `skills/idd-implement/SKILL.md` Step 0.5 cluster detection bash. Previous glob `\#[0-9]*` over-matched: - `#42abc` → matched (`*` absorbed trailing letters) — counted malformed - `#34 #34` → counted as 2 (duplicate) — tripped CLUSTER_MODE on 1 distinct Replaced with strict integer check + associative-array dedup: case "$arg" in \#*) arg_num="${arg#\#}" if [[ "$arg_num" =~ ^[0-9]+$ ]] && [ -z "${SEEN_ISSUES[$arg_num]:-}" ]; then SEEN_ISSUES[$arg_num]=1 ISSUE_COUNT=$((ISSUE_COUNT + 1)) fi ;; esac Matches batch-and-cluster.md documented `^#\d+$` form. 0 behavior change for well-formed distinct invocations. Malformed tokens (`#42abc`) silently skipped — counter doesn't trip on garbage. Duplicates collapse to 1. Refs #100
#112 surfaced that Claude Code's ~/.claude/image-cache/<session-id>/ is per-session + cleared by context compaction / session lifecycle / session-id rollover. Step 1 → Step 4 separation (read annotation in Step 1, upload in Step 4) spans AskUserQuestion + Step 2.5/2.6 + Step 3 `gh issue create` + Step 4 upload — easily long enough for cache eviction. Step 4's `gh release upload <image-cache-path>` fails when `ls` returns nothing. 2026-05-20 downstream incident (kiki830621/ai_martech_global_scripts#788) hit exactly this failure mode. Two changes to skills/idd-issue/SKILL.md Step 1 Source Type Adapter: 1. NEW "Pasted image" row in Source Type Adapter table — explicit immediate-persistence rule (cp in the same tool turn that reads the annotation, not deferred). 2. Updated "Mixed (text + 圖片貼上)" row — explicitly references the pasted-image immediate-persistence rule for every pasted image; the pre-existing "使用者另外提供 path 清單" is preserved as the non-pasted-image case (paths that already point at stable files outside the per-session image cache). 3. NEW `### Pasted-image immediate-persistence (v2.70.0+, #112)` subsection between Source Type Adapter and MCP pre-flight. Documents: - The cache-eviction failure mode + why immediate persist closes it - Bash snippet showing the cp loop + staged-path tracking - Step 4 reference contract (iterate PASTED_IMAGES_STAGED, not original cache paths) - Staging path naming convention (/tmp/idd-issue-attachments/issue_pending_<ts>_<rand>.png) + rationale (POSIX-safe, anonymous, system-cleanup-friendly, no repo pollution) - Compaction-resumed session edge case (fallback to warn + continue when source already evicted before Step 1) 0 backward compat impact for non-pasted-image sources (docx via export_image, file paths in stable locations) — change is purely additive for the [Image: source: ...] annotation path. Refs #112
…_PATHS contract (#112) 2 MEDIUM findings from logic reviewer dispatched in-PR per feedback_verify_fix_same_pr: #112-COLLISION (MEDIUM) — $(date +%s)_$RANDOM had ~0.4% collision rate at 1000 tight-loop trials. Replaced with mktemp which guarantees uniqueness atomically (POSIX create-or-fail). Both macOS BSD mktemp and GNU mktemp accept the 6-X template. mv after mktemp adds the .png extension while preserving the unique pathname. #112-CONTRACT (MEDIUM) — PASTED_IMAGE_PATHS array population responsibility was implicit. NEW prose paragraph above the staging bash block explicitly states: 'when the agent sees [Image: source: <path>] annotation(s), populate bash array PASTED_IMAGE_PATHS=(...) with one entry per annotation before invoking the staging loop. The annotation is the only authoritative source.' #112-STEP4 (LOW) — Step 4 hand-off contract made explicit with NEW prose paragraph + concrete bash snippet showing ATTACHMENT_PATHS+=("${PASTED_IMAGES_STAGED[@]}") concatenation. Eliminates ambiguity about how Step 1's staged paths flow to Step 4's upload loop. Also added `declare -a PASTED_IMAGES_STAGED=()` explicit declaration (prior version assumed bash default behavior; explicit is safer). Refs #112
… qualifier (#93 #100 #112) 3 non-blocking findings from Devil's Advocate dispatched in-PR per feedback_verify_fix_same_pr: DA-1 (MEDIUM) — CHANGELOG #93 entry said "filed for separate follow-up as needed" but no sister-skill issues were actually filed. Misleading audit trail per IC_R011 canonical 'file / file selected / skip' semantics. Softened to "Sister issues NOT auto-filed in this PR per feedback_lead_minimal — drift documented as observation, separate issues will be filed if specific divergence causes user-visible friction". Cites DA finding DA-1 for traceability. DA-2 (LOW) — #100 cluster glob hardening had a quiet behavior change for malformed tokens (#42abc previously counted as cluster member; post-v2.70.0 silently skipped). CHANGELOG #100 entry extended with explicit backward-compat note: failure modes shifted from 'fail mid-loop on bad number' to 'treat as if token not present'. DA-4 (LOW) — softened the "ONLY authoritative source" claim in the PASTED_IMAGE_PATHS source contract from absolute to qualified-by-version: 'currently the only authoritative source per the v2.70.0+ Claude Code prompt format'. Adds explicit note that future Claude Code versions (drag-drop / other annotation forms) may require contract extension. Codex nit — table row + subsection wording updated from 'issue_pending_<ts>_<rand>.png' to 'issue_pending_XXXXXX.png (via mktemp)' to match the post-fix mktemp-based impl (commit 8b15784). DA-3 (LOW) staged_base.png stale leftover — not fixed in this commit; mktemp guarantees fresh uniqueness so stale-overwrite is only possible under hostile pre-creation by attacker (out of scope for IDD threat model — no user-controlled write path to /tmp/idd-issue-attachments/). Refs #93 #100 #112
/idd-verify --pr 115 — cluster verify reportPhase: verified (verify-gated PASS post-fix) Aggregate verdict: PASS (post-fix)
Findings dispatched in-PRCommit
Commit
DA-3 (LOW) Per-issue verdict#93 — spectra-archive sync: PASS
#100 — cluster glob + Option A-final: PASS
#112 — pasted-image immediate-persistence: PASS
Shared
Process gapRequirements reviewer file Next: merge readyCluster ready to merge:
Verify: 3-AI ensemble PASS (requirements file cross-contaminated; coverage substituted via Codex + DA). 0 blocking findings post-fix; 1 documented out-of-scope edge case (DA-3). |
Refs #93 #100 #112
Summary
Multi-root chain (N=3 roots: #93 #100 #112) — design/refactor/bug cluster from previous verify follow-ups. Each issue ships its
lead-minimaldefault disposition per diagnosis Residue section. Different files but all touching IDD plugin internals — strong cluster cohesion (cluster-PR eligibility heuristic: same-plugin).Cluster overview
Per-issue details
#93 — spectra-archive 3-copy divergence (refactor)
Investigation during implementation refuted diagnose-time recommendation.
.agents/skills/is LIVE (referenced by 4 openspec specs:routing-vagueness-layer,idd-all-chain,idd-spawn-manifest,idd-orchestrator-modes). Revised disposition: sync (not delete).Commit
c3b9045:.agents/skills/spectra-archive/SKILL.mdfrom.claude/skills/spectra-archive/SKILL.md(14865 bytes — has v1.3+ Implementation Complete auto-post feature from feature: spectra-apply auto-post Implementation Complete to GitHub issue (resolve /idd-close supersession friction) #56)Out of scope for this PR (documented in audit comment on #93):
plugins/.../references/spectra-skills/spectra-archive/SKILL.md— historical snapshot, no markdown cross-refs found, low cleanup ROI perlead-minimal.claude/and.agents/— drift matrix posted to [refactor] spectra-archive SKILL.md exists in 3 copies (.claude/, .agents/, plugins/) — divergence risk (follow-up from #56) #93; each candidate filed for separate follow-up as needed#100 — cluster detection glob hardening + Option A-final doc
Commit
3517c12:Finding 1 (design) — Option A confirmed final. NEW
### Feature-branch + cluster + direct-commit — rejected casesubsection inreferences/pr-flow.md§ Cluster mode override. Documents the rejected Option B (branch-context-gated cluster direct-commit) with comparison table + rationale. Feature-branch direct-commit workflow remains viable for single-issue--no-prinvocations.Finding 2 (refactor) —
skills/idd-implement/SKILL.mdStep 0.5 cluster detection bash hardened:Strict integer check + associative-array dedup matching the documented
^#\d+$form inbatch-and-cluster.md. 0 behavior change for well-formed distinct invocations.#42abcrejected (no longer counted);#34 #34collapses to 1.#112 — pasted-image immediate-persistence (bug)
Commit
0351d57:~/.claude/image-cache/<session-id>/is per-session + cleared by context compaction / session lifecycle / session-id rollover. Step 1 → Step 4 separation (read annotation in Step 1, upload in Step 4) spansAskUserQuestion+ Step 2.5/2.6 + Step 3gh issue create+ Step 4 upload — easily long enough for cache eviction. 2026-05-20 downstream incident (kiki830621/ai_martech_global_scripts#788) hit this exact failure mode.Two changes in
skills/idd-issue/SKILL.mdStep 1 Source Type Adapter:### Pasted-image immediate-persistence (v2.70.0+, #112)subsection between Source Type Adapter and MCP pre-flight — bash snippet showingcploop + staged-path tracking + Step 4 reference contract + staging path naming convention rationale + fallback for already-evicted sourceStaging path:
/tmp/idd-issue-attachments/issue_pending_<timestamp>_<rand>.png(anonymous, POSIX-safe, system-cleanup-friendly, no repo pollution).Review status
/idd-close #Nper issue after merge🤖 Generated by /idd-all-chain. Do NOT add GitHub close trailers (Closes/Fixes/Resolves) — IDD discipline requires manual /idd-close per issue after merge to enforce checklist gate + per-issue closing summary.