Sources: accepted-duplicate % (curation-quality signal)

Per Codex's optional note: alongside the ingest-wide duplicate_rate, expose
accepted_dup_rate — of what a source got ACCEPTED, how much was a duplicate of
already-served content (accepted_total − served). Nearly free (derived from
existing counts); surfaced as a tooltip on the Dup column so the table stays
uncluttered.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
jay
2026-06-08 15:47:51 -04:00
parent 0f8d5b555a
commit 9deca522b4
3 changed files with 8 additions and 2 deletions
+5 -1
View File
@@ -320,8 +320,12 @@ def source_health(conn: sqlite3.Connection) -> list[dict]:
for r in rows:
d = dict(r)
total = d["total_articles"] or 0
d["acceptance_rate"] = round(100 * d["accepted_total"] / total) if total else None
accepted = d["accepted_total"] or 0
d["acceptance_rate"] = round(100 * accepted / total) if total else None
d["duplicate_rate"] = round(100 * d["duplicates"] / total) if total else None
# Curation quality: of what this source got ACCEPTED, how much was a
# duplicate of content already served (accepted_total served = accepted dupes).
d["accepted_dup_rate"] = round(100 * (accepted - d["served"]) / accepted) if accepted else None
out.append(d)
return out