Skip to content

Commit 3b7e049

Browse files
committed
fix(verify): promote on a live Tier-1 OR Tier-2 source (not T1 only)
Requiring a live manufacturer/encyclopaedia (T1) source never promoted the many green records sourced from reputable spec/benchmark DBs (gsmarena, cpubenchmark), so verified stayed at its ~1.2% floor. green already requires a T1/T2 source + completeness + consistency; accept a live T2 source too. Refs #1
1 parent 90c0efb commit 3b7e049

1 file changed

Lines changed: 17 additions & 5 deletions

File tree

app/verify/promote.py

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,23 +33,35 @@ class PromotionDecision(NamedTuple):
3333
reason: str
3434

3535

36-
def has_live_t1(source_urls: list[str], url_cache: dict[str, dict[str, Any]]) -> bool:
37-
"""True if some cited URL is a Tier-1 host AND confirmed alive in the cache."""
36+
def has_live_authoritative_source(
37+
source_urls: list[str], url_cache: dict[str, dict[str, Any]]
38+
) -> bool:
39+
"""True if some cited URL is an authoritative host (Tier 1 *or* Tier 2) AND
40+
confirmed alive. The green band already requires a T1/T2 source + completeness
41+
+ consistency; this just adds "and that source actually resolves". Requiring a
42+
*manufacturer/encyclopaedia* (T1 only) was too strict — it never promoted the
43+
many green records sourced from reputable spec/benchmark DBs (gsmarena,
44+
cpubenchmark, ...), so verified never moved off its floor.
45+
"""
3846
for u in source_urls:
3947
entry = url_cache.get(u)
40-
if entry and entry.get("alive") and hosts.tier_of_host(hosts.host_of(u)) == 1:
48+
if entry and entry.get("alive") and hosts.tier_of_host(hosts.host_of(u)) in (1, 2):
4149
return True
4250
return False
4351

4452

53+
# Backwards-compatible alias (older callers/tests).
54+
has_live_t1 = has_live_authoritative_source
55+
56+
4557
def decide(
4658
*, band: str, source_urls: list[str], url_cache: dict[str, dict[str, Any]],
4759
crossref_decision: str | None,
4860
) -> PromotionDecision:
4961
if crossref_decision == "confirm":
5062
return PromotionDecision(True, "crossref-confirm")
51-
if band == "green" and has_live_t1(source_urls, url_cache):
52-
return PromotionDecision(True, "green+live-t1")
63+
if band == "green" and has_live_authoritative_source(source_urls, url_cache):
64+
return PromotionDecision(True, "green+live-source")
5365
return PromotionDecision(False, "needs-confirmation")
5466

5567

0 commit comments

Comments
 (0)