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:
2026-10-26 20:29:27 +01:00
parent 2ee3b54661
commit 964189387d
4 changed files with 51 additions and 12 deletions
+7 -6
View File
@@ -164,10 +164,10 @@ class KnowledgeConfig:
semantic_tau: float = 0.45 # calibration: rivers 0.49-0.52 in, Pedro
# cross-question 0.35-0.38 out, spouse-noise ~0.67
max_facts_per_chunk: int = 12 # question-blind extraction needs a cap
max_claims_per_chunk: int = 6 # two-pass: each claim costs a TYPE call —
# the budget is finite (80/run); without a
# cap one big article starves the run
# (live finding 26/10: 70 claims -> 80/80)
max_claims_per_chunk: int = 6 # DEPRECATED (owner ruling 26/10:
# completeness beats budget) — no longer
# read by the two-pass loop; kept only for
# the table-frags legacy path
extract_mode: str = "two_pass" # "two_pass" (claims -> typed Facts, short
# outputs) | "single" (legacy one-call typed
# array — table frags keep using it)
@@ -1183,8 +1183,9 @@ class KnowledgeExpert:
claims = claims_from(self, entities=ent_str,
heading=chunk.heading_path,
text=chunk.text, charge_llm=charge_llm)
# budget law: each claim costs a TYPE call — cap per chunk
for claim in claims[: self.cfg.max_claims_per_chunk]:
# owner ruling 26/10: completeness beats budget — every
# unique claim gets its TYPE call (no cap, dedup only)
for claim in claims:
fact = fact_from_claim(self, claim, text=chunk.text,
charge_llm=charge_llm)
if fact is None: