Stu Mason
Stu Mason

Activity

Pull Request Merged

PR #108 merged: feat(reports): predict tomorrow's HN front page

Summary

New report at `/reports/predicting-hn` that uses our hourly HN score re-fetches to compute per-story velocity and project a 4-hour-ahead peak. The "we can see the future" play.

What's in it

  1. Methodology narrative — explains the naive linear extrapolation
  2. Rockets on the launchpad — leaderboard ranked by current points-per-hour velocity, showing current → predicted-4h with color-coded magnitude
  3. Validation S-curves — line chart of the past 24h's top 4 stories, plotted by age vs. score (the textbook climb pattern)
  4. Live stat grid — pipeline size, refresh cadence, cache TTL
  5. Caveats narrative — honest about overshoot/undershoot rates

Implementation

  • `app/Reports/HnPredictor.php` — concrete report, 10-min cache TTL (overrides default 6h)
  • `Leaderboard` panel gains `velocity` format (coloured up-arrows + magnitude) and `predicted` format (intensity-based bold emphasis)
  • Right-aligns numeric columns with tabular-nums for clean line-up

Dry run on prod data

``` title | now | velocity | predicted Classic 7 (Windows 10 LTSC mod to look like Win 7) | 23 | ▲ 86/h | 366 What the Hell Was Going on with Cigarette Ads in the 70s| 13 | ▲ 86/h | 356 A Claude Code and Codex Skill for Deliberate Skill Dev | 35 | ▲ 6/h | 59 ```

Top 2 are predicted to land hard on the front page.

Test plan

  • `npm run build` passes
  • `vendor/bin/pint --dirty` passes
  • Post-merge: verify `/reports/predicting-hn` renders on prod with live data
  • Verify 10-min cache TTL (second hit < 100ms)
+205
additions
-8
deletions
3
files changed