fix: completeness beats budget — no claim cap, dedup by code, budget 200
Owner ruling (26/10): 'the budget has never been a priority and must never harm us here.' The cap=6 from #28 (my call, never agreed) cut the Socialist International claim — it was #7 of 46 in the lead chunk of live run 20261026-170521 — so the KG never held the third presidency reading and the judge could not offer it. - claims_from: NO cap, NO semantic filter. Code-only honesty: exact repeats dropped (live finding: glm listed its 46-claim list with ~26 exact repeats + thinking leakage as items). Case/whitespace-insensitive dedup keeps the FIRST occurrence. Every unique claim gets its TYPE call. - max_claims_per_chunk: deprecated in config (kept only for the table-frags legacy path). - budget.max_llm_calls: 80 -> 200 (bounds runaway runs only). TDD: two_pass_extract 6/6 (new: dedup keeps unique claims verbatim). Suite: 30 test files green.
This commit is contained in:
@@ -15,16 +15,26 @@ from __future__ import annotations
|
||||
|
||||
def claims_from(expert, entities: str, heading: str, text: str,
|
||||
charge_llm=None) -> list[str]:
|
||||
"""Pass 1: the chunk's claims as plain strings, coreferences resolved."""
|
||||
"""Pass 1: the chunk's claims as plain strings, coreferences resolved.
|
||||
|
||||
The list is made honest by CODE only: exact repeats are dropped
|
||||
(live finding 26/10: glm sometimes lists its whole list twice, and
|
||||
thinking leakage leaks in as list items). Dedup is case- and
|
||||
whitespace-insensitive; the FIRST occurrence's exact text is kept.
|
||||
NO cap, NO semantic filter: completeness beats budget (owner ruling
|
||||
26/10) — every unique claim gets its TYPE call.
|
||||
"""
|
||||
if charge_llm:
|
||||
charge_llm()
|
||||
pred = expert.claims(entities=entities, heading=heading, text=text)
|
||||
out = []
|
||||
seen: dict[str, str] = {}
|
||||
for c in (pred.claims or []):
|
||||
c = (c or "").strip()
|
||||
if c:
|
||||
out.append(c)
|
||||
return out
|
||||
key = " ".join(c.lower().split())
|
||||
if key not in seen:
|
||||
seen[key] = c
|
||||
return list(seen.values())
|
||||
|
||||
|
||||
def fact_from_claim(expert, claim: str, text: str, charge_llm=None):
|
||||
|
||||
Reference in New Issue
Block a user