Thanks to visit codestin.com
Credit goes to github.com

Skip to content

chain (multi-root): 3 issues — spectra-archive sync + cluster glob + pasted-image cache - #115

Merged
kiki830621 merged 6 commits into
mainfrom
idd/chain-multi-4afc6a91-refactor-spectra-archive-skill-md-exists
May 20, 2026
Merged

kiki830621 merged 6 commits into
mainfrom
idd/chain-multi-4afc6a91-refactor-spectra-archive-skill-md-exists

Conversation

@kiki830621

Copy link
Copy Markdown
Member

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-minimal default disposition per diagnosis Residue section. Different files but all touching IDD plugin internals — strong cluster cohesion (cluster-PR eligibility heuristic: same-plugin).

Cluster overview

# root_id Spawn source Phase PR commit
#93 93 root implemented c3b9045
#100 100 root implemented 3517c12
#112 112 root implemented 0351d57

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:

Out of scope for this PR (documented in audit comment on #93):

#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 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. Feature-branch direct-commit workflow remains viable for single-issue --no-pr invocations.

Finding 2 (refactor)skills/idd-implement/SKILL.md Step 0.5 cluster detection bash hardened:

-        \#[0-9]*) ISSUE_COUNT=$((ISSUE_COUNT + 1)) ;;
+        \#*)
+            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
+            ;;

Strict integer check + associative-array dedup matching the documented ^#\d+$ form in batch-and-cluster.md. 0 behavior change for well-formed distinct invocations. #42abc rejected (no longer counted); #34 #34 collapses 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) spans AskUserQuestion + Step 2.5/2.6 + Step 3 gh 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.md Step 1 Source Type Adapter:

  1. NEW "Pasted image" row in adapter table — immediate-persistence rule (cp in same tool turn as annotation read)
  2. Updated "Mixed (text + 圖片貼上)" row to reference the immediate-persistence rule
  3. NEW ### Pasted-image immediate-persistence (v2.70.0+, #112) subsection between Source Type Adapter and MCP pre-flight — bash snippet showing cp loop + staged-path tracking + Step 4 reference contract + staging path naming convention rationale + fallback for already-evicted source

Staging path: /tmp/idd-issue-attachments/issue_pending_<timestamp>_<rand>.png (anonymous, POSIX-safe, system-cleanup-friendly, no repo pollution).

Review status

  • Diagnose ✓ for all 3 issues (per-issue Diagnosis comments)
  • Implement ✓ (3 commits + CHANGELOG + plugin.json bump)
  • Verify ⏳ (per-issue ensemble — running)
  • Verify-gated: per-issue verify PASS — cluster ready to merge → /idd-close #N per 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.

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
@kiki830621

Copy link
Copy Markdown
Member Author

/idd-verify --pr 115 — cluster verify report

Phase: verified (verify-gated PASS post-fix)
Mode: PR mode, cluster (3 issues: #93 #100 #112)
Diff: 314 lines initial + 2 verify-fix commits (8b15784 logic findings + d63575a DA findings)
Reviewers: 3 general-purpose Agents (requirements / logic / devil's advocate) + Codex gpt-5.5 xhigh (background completed)

Aggregate verdict: PASS (post-fix)

Reviewer Initial verdict Post-fix
Logic PASS + 3 non-blocking observations (collision risk / contract / Step 4 hand-off) PASS (all 3 fixed in 8b15784)
Devil's Advocate PASS + 1 MEDIUM (CHANGELOG honesty) + 3 LOW PASS (DA-1 MEDIUM + DA-2 LOW + DA-4 LOW + Codex nit fixed in d63575a; DA-3 staged-base.png stale-overwrite documented as out-of-scope per IDD threat model)
Requirements Process gap — API socket error twice; findings file cross-contaminated from another verify session (RFC 2231 MIME parsing in che-apple-mail-mcp), not this PR n/a — 2 retry attempts both failed; requirements coverage carried by Logic + DA + Codex independent verification of deliverables
Codex (gpt-5.5 xhigh) PR head FULLY addressed: explicitly noted that the post-fix 8b15784 resolved the 2 #112 blocking points it identified in the initial diff (mktemp + PASTED_IMAGE_PATHS source contract). Sister-skill drift + Codex nit on stale CHANGELOG <rand> wording surfaced. (Codex completed mid-review; nit fixed in d63575a)

Findings dispatched in-PR

Commit 8b15784 — logic reviewer's 3 MEDIUM:

# Finding Fix
112-COLLISION $(date +%s)_$RANDOM had 0.4% collision rate at 1000 tight-loop trials Replaced with mktemp /tmp/idd-issue-attachments/issue_pending_XXXXXX (atomic create-or-fail per POSIX) + mv adds .png extension
112-CONTRACT PASTED_IMAGE_PATHS array population responsibility implicit NEW prose paragraph above staging bash block explicitly stating agent's annotation-enumeration responsibility
112-STEP4 Step 4 hand-off implicit NEW prose paragraph + bash snippet showing ATTACHMENT_PATHS+=("${PASTED_IMAGES_STAGED[@]}") concatenation

Commit d63575a — DA findings + Codex nit:

# Finding Fix
DA-1 (MEDIUM) CHANGELOG #93 said "filed for separate follow-up" but no sister-skill issues actually filed; misleading audit trail per IC_R011 Softened to "Sister issues NOT auto-filed in this PR per feedback_lead_minimal — drift documented as observation". Cites DA-1 for traceability
DA-2 (LOW) #100 cluster glob hardening had quiet backward-compat change for #42abc-style malformed tokens CHANGELOG #100 entry extended with explicit backward-compat note
DA-4 (LOW) "ONLY authoritative source" claim absolute Softened to "currently the only authoritative source per the v2.70.0+ Claude Code prompt format" + extension hook for future formats
Codex nit Table row + subsection wording stale (<rand> from pre-mktemp impl) Updated to issue_pending_XXXXXX.png (via mktemp)

DA-3 (LOW) staged_base.png stale-overwrite — documented as out-of-scope in commit message per IDD threat model (mktemp guarantees fresh uniqueness; stale-overwrite only possible under hostile pre-creation by attacker, no user-controlled write path to staging directory).

Per-issue verdict

#93 — spectra-archive sync: PASS

#100 — cluster glob + Option A-final: PASS

  • Logic empirical: 14/14 PASS across single/multi/dup/malformed/flag-interleaved scenarios
  • #42abc rejected, #34 #34 collapses to 1, --pr #34 #35 correctly parses as cluster
  • Option A vs B comparison table honest per DA — reflects real implementation costs (git symbolic-ref dep, detached HEAD edge cases, two-wording override notice)
  • Backward-compat note added (DA-2 fix)

#112 — pasted-image immediate-persistence: PASS

  • mktemp-based staging replaces $RANDOM-based naming (collision-safe)
  • Explicit PASTED_IMAGE_PATHS contract paragraph (logic-CONTRACT fix)
  • Explicit Step 4 hand-off contract paragraph + concrete bash snippet (logic-STEP4 fix)
  • Codex empirically verified mktemp portability across macOS BSD + GNU; 100-parallel-invocation stress test produced 100 unique files
  • DA empirically verified declare -a works on macOS bash 3.2.57 (default shell)
  • v2.70.0+ qualifier added to "ONLY authoritative source" claim (DA-4 fix)

Shared

  • plugin.json 2.69.0 → 2.70.0 (minor — justified by 3 same-plugin precision/bug fixes)
  • CHANGELOG.md [2.70.0] entry covers all 3 + DA findings + backward-compat notes
  • Cluster cohesion DA-flagged as "weak but acceptable" (same-plugin predicate at lower-boundary of cluster-PR eligibility; 290 LOC aggregate)

Process gap

Requirements reviewer file /tmp/verify_115_findings_requirements.md contains content for a different PR (RFC 2231 MIME parsing in che-apple-mail-mcp repo). Cross-contamination from another verify session — file NOT for this cluster. Two retry attempts (initial spawn + explicit retry-after-API-error) both failed with API socket errors. Recorded transparently per v2.59.0+ Process Gap convention. Per-issue requirements coverage carried by Logic + DA + Codex independent verification of each deliverable.

Next: merge ready

Cluster ready to merge:

  1. Merge PR chain (multi-root): 3 issues — spectra-archive sync + cluster glob + pasted-image cache #115 (squash recommended)
  2. /idd-close #93 #100 #112 per issue
  3. Distribution sync v2.69.0 → v2.70.0

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).

@kiki830621
kiki830621 merged commit f5afb93 into main May 20, 2026
kiki830621 added a commit that referenced this pull request May 20, 2026
…n-dev v2.70.0

Distribution sync after PR #115 merge (f5afb93) closing #93 #100 #112
(spectra-archive sync + cluster glob + pasted-image cache).

Refs #93 #100 #112
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.

1 participant