Work order · Internal
Conflict Lens — document extraction prototype
A small public web app that extracts fields from fictional insurance PDFs, shows where every value came from, and flags pages that disagree instead of guessing. Needed for a sales demo on Tuesday.
Assigned to
Developer — TBC
Codeaza Technologies, Islamabad
Reports to Muhammad Asim
Re: sales demo prep
Issued by
Muhammad Asim — Founder & CEO
Codeaza Technologies, Islamabad, Pakistan
muhammadasim@codeaza.org · codeaza.com
Demo: Tue 17 Nov, 7:00am PKT
01The objective
Build a working, public example of how Codeaza tests document extraction when two pages give different answers for the same field. It must be live on a URL by Monday evening.
Prospects who build AI systems keep asking the same thing: how do you test document extraction when the pages of one document disagree, and can we see a public example? They care about evidence over demos, human correction time and cost, and turning corrections into reviewed rules. This prototype answers that in a form they can click through themselves.
Success = Asim can show it in 3 minutes on the call and share the link with the prospect afterwards.
02Scope & plan
Synthetic dataset + golden answers
Script-generate about 8 fictional NZ home/motor policy PDFs, 3–5 pages each: schedule, terms, and an endorsement dated later.
- Sum insured: schedule $650,000 vs later endorsement $720,000 → endorsement wins
- Excess: $500 on schedule vs $750 in terms → genuinely ambiguous, must be flagged
- “Jane M. Smith” vs “Jane Smith” → same person, not a conflict
- 03/04/2026 is 3 April (NZ format), never 4 March
- 2 clean documents with no conflicts as a control group
golden.json: expected value or "FLAG" per document and field
Fields (8): policy number, insured name, start date, end date, sum insured, excess, premium, address.
Extraction with provenance
Claude (claude-sonnet-5-5) extracts every candidate value for each field across all pages, each with its page number and exact quoted text. Use Claude's PDF citations, or a verbatim quote matched against the PDF text layer.
- Precedence rules live in
rules.yaml and are applied in code, not hidden in the prompt
- Default rule: sources disagree and no rule applies → FLAG for human review
- Cache results so the live demo never waits on the API
Conflict view, rule loop, scoreboard, deploy
- Conflict view: PDF on the left, fields on the right. Clicking a field jumps to the page and highlights the source text. Conflicts get a red badge and show both sources side by side with how they were resolved
- Correction → rule loop: on a flagged field, pick the right value and type a one-line rule. It saves to
rules.yaml, all docs re-run, and the scoreboard updates
- Scoreboard: correct / wrong / flagged against
golden.json, conflict cases vs clean cases, cost and time per document, before/after when a rule is added
- Deploy to a public URL, write the README, freeze at 6pm PKT
Nice-to-have, only if P1–P3 are done by Monday noon: a “change one criterion” button that edits one document (e.g. makes the endorsement date earlier than the schedule) and re-runs it. The answer should flip to the schedule value. Then a Sonnet vs Haiku (claude-haiku-5-5) cost/accuracy comparison, and a JSON export of each run.
03Guardrails & stack
Hard rules
Fictional data only. No client documents and no code from client projects
Public GitHub repo plus a live URL. No login
API key in a server environment variable, never in the browser
Viewing cached results must work without calling the API
Suggested stack
Next.js + TypeScript, Tailwind + shadcn
react-pdf / pdf.js for viewing and highlights
Anthropic TypeScript SDK; JSON files, no database
Hosted on Vercel or Cloudflare Pages
Out of scope: auth, a database, real customer documents, OCR of scanned images, multi-tenancy, design polish beyond clean shadcn defaults.
04Definition of done
Check (Asim reviews Monday evening)
Phase
Must / nice
Public URL loads with the 8 sample documents from cached results
P3
Must
Clicking a conflicting field highlights both sources in the PDF
P3
Must
Scoreboard shows correct / wrong / flagged against golden.json, with zero wrong values on the planted ambiguous cases
P2–P3
Must
Adding a rule from the UI re-runs the set and visibly moves the numbers
P3
Must
README: what it is, how the evaluation works, how to add a document or rule, one screenshot
P3
Must
“Change one criterion” button flips the resolved value
Extra
Nice
05How it will be demoed (3 min)
1. Open the sum insured conflict → both pages highlighted → the endorsement wins by rule
2. Open the excess conflict → flagged, not guessed. “A wrong value passes validation; a flag gets a human.”
3. Add a rule from the flag → re-run → the scoreboard moves
4. Share the repo link: “here's the public example you asked for”
06The essentials
Deadline. Code freeze Monday 16 November, 6pm PKT. Anything unfinished by then is cut, not rushed in overnight.
Check-ins. A short update to Asim at the end of each day: what works, what's at risk, any cut you'd suggest.
Ownership. The repo sits under the Codeaza GitHub org. It is public, so treat every commit as client-facing.
Confidentiality. Nothing from client work goes in: no client names, documents, prompts or code. All data is fictional.
Cost. Keep API spend small. Cache every extraction and re-run the full set only when rules change.
Blockers. Raise them the same day. If the deadline is at risk, drop the nice-to-haves first, then polish, never the must-have checks.
Accepted for delivery
By signing, the developer confirms they have read the scope, the guardrails and the definition of done, and can deliver by the code freeze.
© 2026 Codeaza Technologies — internal work order. Not for external distribution. · Muhammad Asim, muhammadasim@codeaza.org