✨ feat(pr-signals): a failed local review's findings leave signals for findings.unconfirmed (#587)

Merged
AT
3d ago
+81-10

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-signals now leaves out of signals the findings of a local review whose record says it failed or timed out (metadata.status: "failed").
    • Before this, the code disagreed with itself. readFindings kept a failed record's findings, and prSignals turned 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.
  • A failed record's findings go under findings.unconfirmed, each as { file, line, title }, through the new unconfirmedFindings. 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: signals holds the thread alone, duplicates is 0, findings.unconfirmed holds both findings with path/description fallbacks, the warning gives the count, and no /files read is made;
    • a failed record without findings: the existing test, unchanged wording;
    • an ok record: the existing first prSignals test, still folding its finding into the thread;
    • unconfirmedFindings on its own.
  • 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 smoke exited 0.
    • pnpm test: 2242 of 2242 pass. pr-signals.ts coverage 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.