fix: spectra-archive-post-ic linked-issue escape hatch + prose detection (#170)#171
Conversation
…ion (#170) The --linked-issue override validated membership against the detected candidate set even when that set was EMPTY, so when detection found nothing the explicit override was rejected too — both failure modes fired together exactly when the fallback was needed (#167's IC had to be posted manually). Now the membership check applies only when candidates were actually detected; an empty set treats --linked-issue as the authoritative escape hatch. Integer validation reordered first (emit_outcome exits). Also widen detection fallback 2 to match the IDD-prose form "issue #N" (what /spectra-propose writes in tasks.md), not just Refs/Closes/Fixes. Tests: +2 fixtures (12 prose-issue detection, 13 empty-candidate override); 11 existing still pass (fixture 09 stays rejected on its non-empty set). Refs #170
Verify Report — PR #171 (#170)Engine5 general-purpose Agents (Requirements / Logic / Security / Regression / Devil's Advocate) + Codex (gpt-5.5, xhigh). Test suite re-run independently by 3 reviewers + Codex: 13/13 PASS. AggregatePASS — 0 hard-blocking. The core #170 fix (empty-set escape hatch + integer-first reorder) is confirmed correct by all 6: Findings (merged across 6 sources)
Scope CheckClean — diff touches only PlanPer same-PR-fix discipline: fixing #1 (word-boundary), #2 (reject 0), #4 (doc), #6 (count) in this PR + re-running the suite. #3 (the deeper membership-semantics conflation + wrong-existing mis-post) → follow-up issue. #5 accepted as by-design. |
- Word-boundary anchor the fallback-2 regex `(^|[^[:alnum:]_])` so `[Ii]ssue` no longer substring-matches `reissue`/`tissue` (verify P2, 6/6 consensus). Codex's escalation: a spurious candidate flips the path off the escape hatch. - Reject 0 in the --linked-issue integer check (`^[1-9][0-9]*$`) — matches the "positive integer" message; `0` would otherwise post to /issues/0 (codex P3). - Document fixture 13's /tmp-cwd coupling: escape-hatch reachability is detection-emptiness-dependent; production posts the IC pre-commit so F3 git-log sees an untracked archive path → empty (DA-3 / codex). - SKILL.md fixture count 11 -> 14 in both mirrors (this PR added 3 fixtures). Tests 13 -> 14 (word-boundary fixture). All GREEN. The deeper membership- semantics design (spurious candidate defeats override; wrong-but-existing silent mis-post) is tracked in #172. Refs #170
Verify findings resolved (commit
|
| # | Sev | Fix |
|---|---|---|
| 1 | P2 | Word-boundary anchor (^|[^[:alnum:]_]) on the fallback-2 regex — reissue #5/tissue #9 no longer false-match. + fixture 14 asserting it. |
| 2 | P3 | --linked-issue integer check tightened to ^[1-9][0-9]*$ — rejects 0 (was posting to /issues/0 despite the "positive integer" message). |
| 4 | LOW | fixture 13 README.md documents the /tmp-cwd coupling (escape-hatch reachability is detection-emptiness-dependent; production posts IC pre-commit → F3 sees an untracked archive → empty). |
| 6 | trivial | SKILL.md fixture count 11 → 14 (both mirrors). |
| 3 | MEDIUM | Follow-up #172 — the deeper membership-semantics design (spurious candidate defeats override; wrong-but-existing silent mis-post). Beyond #170's reported scope. |
| 5 | P3 | emit_outcome exit-0-on-failure — accepted as by-design (best-effort IC post per #56; archive itself already succeeded). |
Tests: 13 → 14, all GREEN. bash -n clean. The core #170 double-failure (empty-set escape hatch + integer-first reorder) was confirmed correct by all 6 reviewers and is unchanged.
Phase: verified (no remaining blocking or in-PR findings; #172 tracks the design follow-up).
Refs #170
Summary
Fixes the
spectra-archive-post-ic.shdouble-failure surfaced when archiving #167: detection missed the prose-onlyissue #Nreference AND--linked-issuerejected on an empty candidate set — so both the auto-detector and its manual override failed together exactly when the fallback was needed (#167's Implementation Complete had to be posted by hand).--linked-issuemembership validation now only runs when detection found candidates (the disambiguation case); an empty set treats the explicit override as authoritative.issue #Nform that/spectra-proposewrites, not justRefs/Closes/Fixestrailers.Checklist
Test plan
bash .claude/scripts/tests/spectra-archive-post-ic/test.sh→ 13/13 PASS (2 new fixtures + 11 existing).