Dumb OMO commit

This commit is contained in:
2026-09-01 18:44:42 -04:00
parent 676a0b77fc
commit 4242373576
5 changed files with 171 additions and 2 deletions
+21
View File
@@ -664,3 +664,24 @@ Key gotchas that would otherwise silently corrupt the index:
- **Do not auto-apply snippets**. The README is operator-facing; the QA used
scratch copies in `/tmp/opencode`. No real estate file was touched.
## F2/F3 final-wave fixes
- **Trailing-window percentile ranks must live in one place**: the original
batch-local `percentile_rank` helper was duplicated across `cycle.rs`,
`api/stories.rs`, and `news-cli/src/replay.rs`. Centralizing it in
`news-store::PercentileTracker::percentile_rank` removes the duplication and
guarantees the scheduler, API, and replay harness all rank against the same
trailing-7-day distribution.
- **Use a stable empirical-CDF formula**: `(below * 100 + equal * 50) / count`
(implemented via `f64::mul_add`) avoids the small floating-point drift that
`(below + equal / 2.0) / count * 100.0` introduces for values like 5.5/10.
- **Model non-finite f64 honestly at the JSON boundary**: the backend keeps
`f64::NEG_INFINITY` as the blocklist-veto sentinel, but the API serializes it
as `null` by making `StoryRow.relevance` an `Option<f64>` mapped with
`is_finite().then_some(...)`. The frontend mirrors the option and renders
`—` so the entire story list no longer fails when a blocklisted item is
present.
- **Host-target tests for the frontend DTO are viable**: `news-web` can host-run
small `serde_json::from_str` regression tests because they only exercise the
`serde`-derived DTOs and do not depend on `gloo-net` or Leptos runtime APIs.