Spaces:
Sleeping
Sleeping
Commit History
-
Fix live gaps: auditor copy, direct Ask answers, Ask metadata UI, audit tax detection
Aissugur Kurganbekov +1: Claude Opus 4.8- Landing/Auth/Overview copy -> evidence-backed finance auditor positioning (index.html title+meta, AuthScreen, Overview hero eyebrow/body/footer). - New extractors.py: deterministic regex extraction of common finance fields (total, due date, terms, tax, invoice no, late fee, overdue, uptime). Ask now returns a crisp grounded answer ("The total amount due is $2,413.98.") and falls back to focused-span extraction; values are verbatim, citations unchanged. - Ask metadata panel (question type, evidence, confidence, retrieved/cited, latency) rendered below each answer. - Audit: detect structured fields via the same extractors and fuzzy clauses via keyword scan instead of the retrieval gate -- fixes "No tax / VAT found" on "Tax (8.25%) $183.98" and a parallel false-negative on the contract liability clause. Audit is now fully deterministic. Backwards compatible (Ask, audit, evaluate, auth, scoping unchanged in shape). Verified: 59 backend tests pass, frontend builds, evalua…40c5ba0 -
Add Audit Mode: evidence-backed checklist audit for finance documents
Aissugur Kurganbekov +1: Claude Opus 4.8New POST /audit runs a per-type checklist (invoice / contract / payment_note / general) over a document, reusing the /ask retrieval + abstention gate so it never invents a value. A check is SUPPORTED only when retrieval does not abstain AND the cited excerpt contains the field's discriminator keyword; otherwise the field is flagged unsupported (a missing field drives the risk level). Returns a summary, risk_level, per-field findings (claim + evidence + citation), and metrics (counts + citation coverage). Reuses _owned_document for per-user scoping + 404; /ask is unchanged. Frontend: new Audit tab — a B2B audit dashboard (document + type selectors, risk badge, metric cards, per-finding evidence with highlighted citations). Backend: app/audit.py, audit schemas, POST /audit, and tests/test_audit.py (7 tests: field detection, unsupported detection, citation coverage, false-positive guard, 404, cross-user scoping, default type). Hardened after an adversarial review: field discriminators …f22b512