✨ feat(pr-signals): a folded signal keeps every review thread folded into it (#586)
Slice: #586
Part of https://github.com/veda-hq/niyam/issues/394 (spec v1). The lesson is dedupe-keeps-thread-ids: athya-rules docs/lessons/review-and-merge.md#deduplicated-threads-still-hold-the-merge (read 2026-11-24 at 1d3ffa1).
What it does
- When
niyam pr-signalsfolds near-duplicate concerns into one signal, the signal now keeps every review thread folded into it. Before this,dedupekept one id (winner.thread ?? loser.thread), so the other thread stayed unresolved and held the merge. - Each signal with a thread carries a new
threads: every{ thread, comment }folded into it, the winner's first. threadandcommentstay the first thread's, the idsreview-threadtakes.threads[0]is always that pair.duplicatescounts as before.- A signal with no thread, such as a CI failure or a local finding alone, has no
threads. - The README's
pr-signalssection namesthreadsand says to answer every one.
Evidence
- New tests in
src/pr-signals.test.ts:- two bots' threads at one line, with the local finding, make one signal whose
threadsholds both{ thread, comment }, the first one's ids as its own; - a thread and a local finding make one signal with one thread;
- a lone thread has a single entry, and a local finding alone has none;
- two same-body threads keep both ids;
prSignals' output carriesthreads.
- two bots' threads at one line, with the local finding, make one signal whose
- Full gate on this branch, rebased on
9782b38(which has #596):pnpm provenance && pnpm typecheck && pnpm lint && pnpm test && pnpm test:scripts && pnpm pins && pnpm pariksha && pnpm hooks:check && pnpm build && pnpm smokeexited 0.pnpm test: 2199 of 2199 pass.pr-signals.tscoverage is 100% lines, 97.08% branches and 100% functions.pnpm test:scripts: 138 of 138 pass.
🤖 Generated with Claude Code
Summary by cubic
Fixes niyam pr-signals deduplication so a folded signal keeps every review thread folded into it. Previously, dedupe kept only one thread id (winner.thread ?? loser.thread), leaving other threads unresolved and holding the merge. Now each signal with a thread carries a threads array with every {thread, comment} folded into it, winner's first; thread and comment still identify the first thread, duplicates counting is unchanged, and signals with no thread have no threads. The README now says each thread in threads holds the merge until it is resolved.