Skip to content

feat(#556): predict file-collision between PROCEED issues from body content - #577

Merged
admarble merged 2 commits into
mainfrom
feature/556-feat-assess-predict-file-collision-between-proceed-issues
May 4, 2026
Merged

admarble merged 2 commits into
mainfrom
feature/556-feat-assess-predict-file-collision-between-proceed-issues

Conversation

@admarble

@admarble admarble commented May 4, 2026

Copy link
Copy Markdown
Contributor

Summary

/assess Step 5 now reads issue bodies of PROCEED candidates and predicts which pairs will modify the same file once both run in parallel worktrees, complementing the existing active-worktree overlap pass. Closes #556.

Heuristics

  • Backtick-quoted source paths under .claude//templates//skills//src//bin//docs/ ending in .md/.ts/.tsx/.json/.sh.
  • When the body signals "3-dir sync"/"across all three skill directories", bare <name>/SKILL.md references AND /<skill> slash-command mentions are expanded to all three skill-root mirrors.
  • Globally excluded paths (CHANGELOG.md, package-lock.json, yarn.lock, pnpm-lock.yaml) are stripped so they never trigger collisions on every batch.
  • Fenced code blocks and HTML comments are stripped before extraction (AC-5 false-positive guard).

Output

  • Order: A → B (path) per collision (3+: Order: A → B → C (path)).
  • ⚠ #N Modifies <path> (overlaps #M); land sequentially per affected issue per collision.
  • Chain: npx sequant run A B C --chain --qa-gate -q # alternative — N issues modify <path> only when ≥3 issues collide on the same file (suggest-only — never auto-applied).

Test plan

…ontent

`/assess` Step 5 now reads issue bodies of PROCEED candidates and
predicts which pairs will modify the same file once both run in
parallel worktrees, complementing the existing active-worktree overlap
pass.

Path extraction (`extractPathsFromIssueBody`):
- Strips fenced code blocks and HTML comments before regex matching.
- Captures backtick-quoted paths under .claude/, templates/, skills/,
  src/, bin/, docs/ ending in .md/.ts/.tsx/.json/.sh.
- When the body signals "3-dir sync"/"across all three skill
  directories", expands bare `<name>/SKILL.md` references AND
  `/<skill>` slash-command mentions to all three skill-root mirrors.
- Strips globally-shared paths (CHANGELOG.md, package-lock.json,
  yarn.lock, pnpm-lock.yaml) so they never trigger collisions on every
  batch.

Collision detection (`detectFileCollisions`):
- Pairwise file-path intersection across the PROCEED set.
- Returns one CollisionResult per shared file, grouping all involved
  issues under that file.

Output annotations (`formatCollisionAnnotations`):
- Order: A → B (path) per collision.
- ⚠ #N Modifies <path> (overlaps #M); land sequentially per issue.
- Chain: suggestion when ≥3 issues collide on the same file
  (suggest-only — never auto-applied; same precedent as existing
  Chain: detection).

Tunables — exclusion list, path regex, slash-command-skill
derivation rule — live in `references/predicted-collision-detection.md`
so they can change without skill-prose edits. Reference doc is
3-dir-mirrored alongside SKILL.md.

Tests use the verbatim bodies of #551 and #552 (the issues that
motivated this feature) plus synthetic fixtures for the false-positive
guards (code-block-only, HTML-comment-only, CHANGELOG-only).

Closes #556
The prior implementation expanded `qa/SKILL.md` references to all three
skill-root mirrors at extraction time, then ran pairwise intersection
on the qualified paths. When both #551 and #552 yielded the three
mirrored paths via 3-dir-sync expansion, `detectFileCollisions`
emitted three CollisionResult entries (one per mirror), which the
formatter rendered as 3 Order: lines + 6 ⚠ warnings for a single
logical conflict.

Adversarial review against issue #556 AC-3's expected output —
`Order: 551 → 552 (qa/SKILL.md)` (singular, bare path) — surfaced
the gap.

Fix: normalize skill-mirror prefixes (`.claude/skills/`,
`templates/skills/`, `skills/`) to the canonical bare subpath at
extraction time. Mirrored references collapse to one canonical entry,
yielding one collision result per logical conflict and matching the
issue's example output.

Also:
- Add AC-6's literal "one issue mentions qa/SKILL.md, the other only
  inside a code block → no overlap" test using #552 verbatim plus a
  synthetic code-block-only fixture (the previous test used
  src/lib/foo.ts, weakening the AC-6 fixture link).
- Add Step 1 (Context Gathering) cross-reference to Step 5's
  predicted-collision detection so AC-1's "during Step 1" timing is
  explicit in the skill prose.
- Update reference doc to document canonical-form normalization as
  the de-duplication mechanism.
- Update CHANGELOG to reflect canonical-form output.

All 2762 tests pass (was 2761; +1 new code-block-fixture test).
@admarble
admarble merged commit d028d0e into main May 4, 2026
8 checks passed
@admarble
admarble deleted the feature/556-feat-assess-predict-file-collision-between-proceed-issues branch May 4, 2026 03:52
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.

feat(assess): predict file-collision between PROCEED issues from body content

1 participant