Reconciliation Display Improvements — Design Spec

Issue: #332 (P1-P7) Date: 2026-03-30

Problem

The reconciliation issue display is hard to interpret: the Expected/Actual details table has no document attribution (P1-P2), aggregations are opaque (P3), the useful summary gets equal weight to the noisy table (P4), field names are LLM free text (P5), document ordering is inconsistent (P6), and list views lack reconciliation status indicators (P7).

Solution

P1-P5: Summary-only reconciliation display

Drop the details field entirely. The summary becomes the sole vehicle for communicating reconciliation findings.

Prompt changes (reconciliation.clj system prompt):

Schema changes (schema/matching.clj):

UI changes (shared.clj):

P6: Document type ordering

Match cards: sorted by type priority (Contract → PO → Invoice → GRN), then by date within type.

Prompt: add instruction for the LLM to reference documents in procurement-flow order in summaries.

P7: Traffic-light match status badge on list views

New column: document.reconciliation_status (text, nullable). Values: null (no reconciliation), reconciled, incomplete, error.

Writer: reconciliation worker, after set-reconciliation!, iterates cluster documents, filters issues per document, computes status:

Reader: list view query reads the column, renders badge color (green/yellow/red).

Files involved