result = llm.extract(invoice_pdf_text)
checks = [
# Did we get anything?
{"check_id": "output_not_empty", "severity": "HIGH", "passed": bool(result)},
# Do the line items add up?
{"check_id": "subtotal_arithmetic", "severity": "HIGH", "passed": line_sum_ok,
"expected": str(stated_subtotal), "actual": str(computed_sum)},
# Does subtotal + tax = grand total?
{"check_id": "grand_total_arithmetic", "severity": "HIGH", "passed": grand_total_ok},
# Is the date format valid?
{"check_id": "invoice_date_valid", "severity": "MEDIUM", "passed": date_ok},
]