✨ feat(pr-signals): a failed local review's findings leave signals for findings.unconfirmed (#587)
Slice: #587
Part of https://github.com/veda-hq/niyam/issues/394 (spec v1). The lesson is cubic-local-failed-drops-signals: athya-rules docs/lessons/review-and-merge.md#a-failed-local-run-replays-an-old-finding (read 2026-11-24 at 1d3ffa1).
What it does
niyam pr-signalsnow leaves out ofsignalsthe findings of a local review whose record says it failed or timed out (metadata.status: "failed").- Before this, the code disagreed with itself.
readFindingskept a failed record's findings, andprSignalsturned them into signals, while its warning said "its findings are missing". A failed run's file can hold the previous push's findings, which a later commit may have fixed.
- Before this, the code disagreed with itself.
- A failed record's findings go under
findings.unconfirmed, each as{ file, line, title }, through the newunconfirmedFindings. The pull request's files are not read for them. - The warning says how many were left out and to check whether each file and line changed since:
⚠ the local review failed (<reason>): its N finding(s) are left out of signals, under findings.unconfirmed; check whether each file and line changed since, and lean on the bots' threads - A failed record with no findings warns as before. A record whose review finished (
ok) is read as before. - The README's findings paragraph says so.
Cost: a real finding from a failed run is not a signal until the review runs again. It is still printed, under unconfirmed.
Evidence
- Tests in
src/pr-signals.test.ts:- a failed record with findings, one of them at the bot thread's line, which would have folded into it before:
signalsholds the thread alone,duplicatesis 0,findings.unconfirmedholds both findings withpath/descriptionfallbacks, the warning gives the count, and no/filesread is made; - a failed record without findings: the existing test, unchanged wording;
- an
okrecord: the existing firstprSignalstest, still folding its finding into the thread; unconfirmedFindingson its own.
- a failed record with findings, one of them at the bot thread's line, which would have folded into it before:
- Full gate on this branch, rebased on
a6e53e6(which has #596 and #600):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: 2242 of 2242 pass.pr-signals.tscoverage is 100% lines, 97.20% branches and 100% functions.pnpm test:scripts: 138 of 138 pass.
🤖 Generated with Claude Code
Summary by cubic
Fixes pr-signals treating the findings of a failed local review as signals. They now land under findings.unconfirmed as {file, line, title} instead, without reading the pull request's files, since a failed run's file can hold the previous push's findings that a later commit may have fixed.
The warning now counts how many findings were left out and asks to check each file and line. An unconfirmed finding with an empty title takes its description as the title. Failed records with no findings, and records that finished (ok), behave as before.