Skip to content

feat(90): fail-closed source-evidence table judge — stop silent scanned-page hallucination#91

Merged
r-uben merged 1 commit into
mainfrom
feat/90-source-evidence-table-judge
Jun 30, 2026
Merged

feat(90): fail-closed source-evidence table judge — stop silent scanned-page hallucination#91
r-uben merged 1 commit into
mainfrom
feat/90-source-evidence-table-judge

Conversation

@r-uben

@r-uben r-uben commented Jun 22, 2026

Copy link
Copy Markdown
Owner

Closes #90.

Stops the fail-open defect where the VLM fabricates a fluent markdown table on a scanned page (no native words), self-reports status:success/engine:qwen, and the heuristic judge accepts it (JCS-18-81 p6: a SaaS product table injected into a 1981 tax-policy doc). For a citation corpus, invented content was indistinguishable from a clean extraction downstream.

Fix

New SourceEvidenceTableJudge (src/socr/tables/source_evidence.py) wraps the agentic judge chain before heuristic acceptance, on any output with markdown tables regardless of ps.has_tables:

  • Born-digital (native words present) → defer to the existing NativeTableVerifierJudge (no regression to the CE OCR is not solved: prioritize reliable tables and figures #56 path).
  • Scanned (no native words) → verify emitted cell tokens against local, non-generative evidence only (page/crop raster, locate_tables regions, optional pytesseract). Numbers require exact normalized-multiset support; alpha-only tables require label-token support; no evidence or unsupported tokens → UNVERIFIABLE → fail closed (not success).
  • On reject: failed-table marker + page PNG, audit_passed=False, status=ERROR, new FailureMode.HALLUCINATION, audit event; plus a scanned-table floor in manifest assembly so a rejected scanned table can't reach the final .md.

No magic thresholds (named/documented constants). Selected via cross-vendor /fanout (grok).

Tests

17 new hermetic tests (no GPU/ollama): scanned hallucination hard-rejected; alpha/numeric support pass/fail; unverifiable-no-evidence; manifest floor; born-digital defer. 538-test regression (agentic/table/manifest/figure/cascade/p1) green; ruff clean.

Impact

Unblocks treating socr output as an authoritative citation corpus for scanned-heavy collections — the held CBO 23k-doc scale-up can proceed once this lands. Related #64, #35, #56.

…d-page hallucination)

On scanned pages (no native words) the VLM can emit a fluent fabricated markdown
table that the heuristic judge accepts as success (JCS-18-81 p6 SaaS table in a tax
doc). New SourceEvidenceTableJudge wraps the judge chain BEFORE heuristic acceptance,
on any output with markdown tables regardless of ps.has_tables:
- born-digital (native words) -> defer to NativeTableVerifierJudge (no regression)
- scanned -> verify emitted cell tokens against LOCAL non-generative evidence only
  (page/crop raster, locate_tables regions, optional pytesseract). Numbers need exact
  normalized-multiset support; alpha-only tables need label-token support; no evidence
  or unsupported tokens -> UNVERIFIABLE, fail closed (NOT success).
- on reject: failed-table marker + page PNG, audit_passed=False, status=ERROR,
  FailureMode.HALLUCINATION, audit event; scanned-table floor in manifest assembly so a
  rejected scanned table can't slip into the final .md.
No magic thresholds (named/documented constants). Selected via /fanout (grok).

17 new hermetic tests (hallucination reject, alpha/numeric support, unverifiable,
manifest floor, born-digital defer); 538-test regression green; ruff clean.

Closes #90.
@r-uben
r-uben force-pushed the feat/90-source-evidence-table-judge branch from 3ef92ac to d9e8614 Compare June 30, 2026 16:11
@r-uben
r-uben merged commit 0d42bfd into main Jun 30, 2026
2 checks passed
@r-uben
r-uben deleted the feat/90-source-evidence-table-judge branch June 30, 2026 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Silent VLM table hallucination on scanned pages passes heuristic judge (need fail-closed source-evidence gate)

1 participant