mirror of
https://github.com/bitbaum/causius.git
synced 2026-12-04 06:08:11 +01:00
* feat(intake): PDF on the quick check, and a deadline eval set - /api/extract-pdf reads a PDF's text layer on the server (unpdf, %PDF magic check, 10 MB, 10 pages, text capped at MAX_TEXT). Nothing stored or logged. Scans answer scanned_pdf; the page then offers the photo picker. - One file input takes a PDF or photos; the text flows into the letter box and the existing redaction and analyze path. Messages in en, de, fr, it. - eval/letters: 17 synthetic Swiss letters (de, fr, en) with expected deadlines; eval/pdf: text and image-only PDFs; `pnpm eval:deadlines` scores stored replies offline, or live with --url on the free chain. - Docs: README quick-check/matter line, ROADMAP ticks, CHANGELOG 2026-12-02, .env.example host path. Co-Authored-By: Claude <noreply@anthropic.com> * feat(eval): optional private letter set, scored separately --private <dir> / CAUSIUS_EVAL_PRIVATE_DIR (default /opt/causius/shared/eval-private). Absent: "private set: not present, skipped". Present: "private: N/M (x%)" and pass/fail by position only; no ids, names, quotes or dates are printed. eval-private/ and eval/private/ ignored. Co-Authored-By: Claude <noreply@anthropic.com> * feat(eval): precision, recall and false-invention rate; answer key for the private set Most letters correctly have no deadline, so each is scored true negative, false invention, true positive, miss or wrong date. Ranges accept any date in them. Private set reads answers.json and letters/*.txt and prints only counts, metrics and pass/fail by position. Four more synthetic traps: open-ended suspension risk, amount with no date, spend-cap reset, 2-3 working days. Co-Authored-By: Claude <noreply@anthropic.com> --------- Co-authored-by: Claude <noreply@anthropic.com>
19 lines
852 B
TypeScript
19 lines
852 B
TypeScript
/**
|
|
* The limits the intake page and the analysis route must agree on, in a file
|
|
* with no imports so the browser bundle can read them without pulling in the
|
|
* model client.
|
|
*/
|
|
export const MAX_TEXT = 30_000;
|
|
/** A letter is rarely longer; more pages than this is a file, not a letter. */
|
|
export const MAX_PAGES = 4;
|
|
/** Base64 length of roughly 3 MB. The browser shrinks a photo well below this. */
|
|
export const MAX_IMAGE_B64 = 4_200_000;
|
|
/** A PDF letter, uploaded to be read for its text. Same ceiling as a matter document. */
|
|
export const MAX_PDF_BYTES = 10 * 1024 * 1024;
|
|
/**
|
|
* A letter is rarely more than a few pages, but a PDF often carries its
|
|
* enclosures (a payment slip, a form, a notice of rights). Ten pages covers
|
|
* that; beyond it the file is a case bundle, and MAX_TEXT would cut it anyway.
|
|
*/
|
|
export const MAX_PDF_PAGES = 10;
|