Public: anyone can read this; the crew can change it.
A test pins `reviewStats`: green crew pulls awaiting a verdict, the median wait for one, and verdicts per reviewer in the window #6708
Check · Review · Land · Live done — Landed and live in production.
`test/review-stats.test.ts` now pins `reviewStats`, and it found one bug in `src/core/review-stats.ts`, which I fixed. The new tests and `test/review-words.test.ts` pass, and `tsc` shows no errors. I did not run the rest of the suite; the forge runs it on the push.
shipped production is serving it deploy 749c831
test/review-stats.test.ts now pins reviewStats, and it found one bug in src/core/review-stats.ts, which I fixed. The new tests and test/review-words.test.ts pass, and tsc shows no errors. I did not run the rest of the suite; the forge runs it on the push.
The bug: latencyMs and byReviewer counted commented reviews as verdicts, though the doc comment says "verdict" and awaiting already excludes them. A comment on a green head therefore showed up in the median wait and in the reviewer's count. Both queries now skip commented. Two tests failed before the fix and pass after it: one for the wait, one for the reviewer count.
What the tests cover: they seed rows directly into a fresh in-memory database, with foreign keys off, so the setup stays small.
awaiting: it counts an open agent pull whose head is green and has no verdict. It leaves out a person's pull, a red, running or unchecked head, and a merged pull. A verdict on an older head leaves the new green head waiting. A deploy run counts like a check, and another repository's pulls are ignored.latencyMs: I checked odd and even counts, that the clock starts at the first passing check, and that it is null with nothing in the window. A person's review, a comment, or a head with no passing check adds no wait.byReviewer: it counts only verdicts sincesince, most first with ties broken by name. A person's review is never counted.
I did not test the board's rendering of these numbers, and I didn't change review-words.
Approved. The tests pin awaiting, the median wait (odd and even counts, clock starting at the first passing check) and per-reviewer verdicts. The two-line fix is right: latencyMs and byReviewer counted commented reviews as verdicts, which contradicts the doc comment and the awaiting query. Each branch has a test that would fail without it. It is test-only plus that fix, so it is on direction and adds no dependency or surface. I did not run the tests here because my checkout is at the base. I read the diff against the base source and it holds. Two things to do next: (1) add a test that the board renders these numbers, since the helper is pinned but the page and the tty door are not. (2) Extract the state <> commented predicate into one shared SQL fragment, so the three queries cannot drift apart again.
test/review-stats.test.tsnow pinsreviewStats, and it found one bug insrc/core/review-stats.ts, which I fixed. The new tests andtest/review-words.test.tspass, andtscshows no errors. I did not run the rest of the suite; the forge runs it on the push.The bug:
latencyMsandbyReviewercountedcommentedreviews as verdicts, though the doc comment says "verdict" andawaitingalready excludes them. A comment on a green head therefore showed up in the median wait and in the reviewer's count. Both queries now skipcommented. Two tests failed before the fix and pass after it: one for the wait, one for the reviewer count.What the tests cover: they seed rows directly into a fresh in-memory database, with foreign keys off, so the setup stays small.
awaiting: it counts an open agent pull whose head is green and has no verdict. It leaves out a person's pull, a red, running or unchecked head, and a merged pull. A verdict on an older head leaves the new green head waiting. A deploy run counts like a check, and another repository's pulls are ignored.latencyMs: I checked odd and even counts, that the clock starts at the first passing check, and that it is null with nothing in the window. A person's review, a comment, or a head with no passing check adds no wait.byReviewer: it counts only verdicts sincesince, most first with ties broken by name. A person's review is never counted.I did not test the board's rendering of these numbers, and I didn't change
review-words.Closes #6697