Detail bug report: View on Detail
Closes #174
The per-rule sparkline series in getRulesStats (packages/db/src/services/insights.ts) bucketed by clock hour-of-day (extract(hour FROM s.started_at)) and wrote to stat.series[clockHour], while the top-level matchesSeries/actionedSeries in the same function were converted to rolling hours-ago ordering (series[23 - h]) in cb4771ee. The per-rule block was missed.
The Sparkline component contract is "oldest first, index 23 = now". Because the per-rule series flows unchanged to the UI (RuleStat.series → rule.trend → <Sparkline data={rule.trend}>), every rule card sparkline on /rules rendered a wrong timeline that disagreed with the header sparkline on the same page — a moderator reading "matches per hour, last 24 hours" saw activity attributed to the wrong hours (up to a full-day skew), and the screen-reader narration (trendWords) reported a direction computed from the wrong window edges.
Bucket the per-rule query by hours-ago (floor(extract(epoch FROM (now() - s.started_at)) / 3600)::int AS h) and write stat.series[23 - h] = n, mirroring the rollingSeries helper already used by matchesSeries and actionedSeries in the same function. This makes the per-rule series and the top-level series place the same event at the same index, so the header and card sparklines agree.
insights.integration.test.ts) that seeds two rule-node fails at 5h and 10h ago and asserts both the top-level matches24h.series and the per-rule series place them at the same rolling indices (18 and 13). The test fails without the fix (Expected: 18, Received: 1 — the clock-hour bucket) and passes with it.packages/db suite (350 tests across 38 files) passes — no regressions in repo scoping, actioned counts, or getHomeStats.bun run dev:demo (PGlite, seeded demo), installed Playwright Chromium, and drove the /dev-owner/active-webapp/rules page in a headless browser. Extracted the SVG path data and <caption> text from all 6 rendered sparklines — each per-rule sparkline's events land at the same indices as the header sparkline, and the trendWords captions report directions consistent with the rolling ordering.Automatic Fixes PRs can be configured here.
The latest updates on your projects. Learn more about Unkey Deploy
| Name | Status | Preview | Inspect | Updated (UTC) |
|---|---|---|---|---|
| tripwire / web (preview) | Ready | Visit Preview | Inspect | Nov 7, 2026 6:57am |
@detail-app[bot], Tripwire blocked this change request.
Rate limit: You opened 61 change requests in a short time. Wait before you open another.
A new commit will not fix this.
If you think it should merge anyway, say so in a comment. A maintainer will decide.
Re: github.com/Boring-Software-Inc/…/187
The only failing check is tripwire, which is blocked on a rate limit ("You opened 61 change requests in a short time"), not on anything in this PR. The PR's own CI check is green (gh pr checks 187 → check pass), and the PR is a focused 2-file bug fix — it switches the per-rule sparkline bucket from a clock-hour bucket to the same rolling hours-ago index (23 - h) the top-level matches24h.series uses, plus an integration test asserting the two series agree.
A new commit will not fix the rate-limit block (as the verdict notes), so I'm not pushing one. This should merge once the rate limit clears; flagging for a maintainer to decide.
Sign in to comment.