fix(summarizer): stamp ticker and map urls from the article, not the model #58

Merged
sirius merged 1 commit from wt/t_b564e062 into master 2026-11-17 19:56:03 +00:00
Owner

Why

GET /api/news/ticker was 20/20 url: "". The reduce prompt asks the model for "url": "" and save_batch persisted row.get("url"). The model returns blank, so every headline and map pin was an unsourced claim.

What

On insert, news_items.url is the selected article's articles.url, matched by headline to title (article_url_for_row). The model's url field is ignored.

  • Exact or high-similarity title match, unique best only. A tie or a miss stores "" so two stories cannot cross-wire.
  • A null / non-string article url stores "". Nothing is invented.
  • Only the articles that reached the reduce phase are candidates.

Score threshold, dedupe, and model id are unchanged. No backfill, no deploy.

Test

PYTHONPATH=news/summerizer pytest news/summerizer/tests -q → 111 passed.

Fixture: two articles (https://ex.com/1, https://ex.com/2) plus one with url=None. Model JSON url is "" or a decoy. Headlines are swapped vs article order. Stored ticker and map urls are https://ex.com/2, https://ex.com/1, "" — not the model url, not cross-wired.

Insert path is article_url_for_row(row, articles), not row.get("url").

Known-red CI docker login 127.0.0.1:3000 is pre-existing and not this change.

## Why `GET /api/news/ticker` was 20/20 `url: ""`. The reduce prompt asks the model for `"url": ""` and `save_batch` persisted `row.get("url")`. The model returns blank, so every headline and map pin was an unsourced claim. ## What On insert, `news_items.url` is the selected article's `articles.url`, matched by headline to title (`article_url_for_row`). The model's `url` field is ignored. - Exact or high-similarity title match, unique best only. A tie or a miss stores `""` so two stories cannot cross-wire. - A null / non-string article url stores `""`. Nothing is invented. - Only the articles that reached the reduce phase are candidates. Score threshold, dedupe, and model id are unchanged. No backfill, no deploy. ## Test `PYTHONPATH=news/summerizer pytest news/summerizer/tests -q` → **111 passed**. Fixture: two articles (`https://ex.com/1`, `https://ex.com/2`) plus one with `url=None`. Model JSON `url` is `""` or a decoy. Headlines are swapped vs article order. Stored ticker and map urls are `https://ex.com/2`, `https://ex.com/1`, `""` — not the model url, not cross-wired. Insert path is `article_url_for_row(row, articles)`, not `row.get("url")`. Known-red CI `docker login 127.0.0.1:3000` is pre-existing and not this change.
The reduce model returns url="" and save_batch was persisting that blank.
Match each headline to a selected article title and store that article's
url. A null article url or an ambiguous match stores "" — never a guessed
or model-supplied URL.
sirius merged commit eefcc08b31 into master 2026-11-17 19:56:03 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
sirius/osint-dashboard!58
No description provided.