Go to file
Yashas 921ff993c4 show the AI's work on the invoice page: timeline, decisions, match evidence, PDF
The detail page rendered a flat grid of every field the view returned — 29 for
  Invoice Detail, 21 for Finance Review Detail — so a reviewer's actual decision
  inputs sat among twenty peers of equal weight, and the most valuable data in the
  app wasn't shown at all. InvoiceDetail now orders the page by the decision being
  made: identity+status, AI recommendation, 3-way match, clarification exchange,
  source document, AI reasoning trail, history, then the original grid collapsed.

  AIActivityPanel ports the studio builder's AI Employee -> Logs tab into the app,
  narrowed to one instance: decisions with status/confidence/model/reasoning/
  reflexion, escalations, and a per-run trace waterfall with durations, tokens and
  cost. Same event vocabulary and confidence thresholds as the builder, so a client
  never has to be shown the builder to see what the AI did. The endpoints
  (/monitor/instances/{id}/log and /trace) are publicly routed and accept the app's
  own JWT.

  AuditTimeline finally uses getAuditLog, which had been written and never called
  from anywhere. It renders the trail as a story — who acted, AI or human, what
  state resulted, and how long each hop waited — deduping the extra rows the
  trigger's performActivity commit produces (9 raw entries collapse to 4 on
  instance 128).

  ThreeWayMatchCard surfaces match_summary and analysis_so_far. Both were
  effectively invisible: one buried in the field grid, the other explicitly dropped
  by DetailViewPanel's SKIP_KEYS for looking like raw JSON. analysis_so_far is
  actually the AI's gathered evidence — PO, goods receipt, contract, payment
  history and the specific discrepancy — so the recommendation becomes auditable
  instead of a wall of prose.

  InvoiceDocumentCard makes the uploaded PDF viewable. invoice_pdf appeared in zero
  record views and zero detail views, so the department answering a clarification
  and the reviewer approving payment could not open the document they were
  reasoning about. The /download endpoint forces an attachment, so the bytes are
  fetched as a Blob and shown inline via an object URL.

  Display metadata keys off state and activity UUIDs rather than the names the API
  returns, so nothing depends on matching "Financial Review" as a string.

  Verified against live app 169: instance 128 (3 decisions, 3 traces correctly
  linked, full match evidence, clarification Q&A) and 161 (OCR submission, PDF
  resolves and downloads, AI panels show empty states rather than errors).

  Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-29 16:45:26 +05:30
public initial commit: p2p-studio — custom frontend wired to studio env (app 169) 2026-06-04 15:39:22 +05:30
src show the AI's work on the invoice page: timeline, decisions, match evidence, PDF 2026-07-29 16:45:26 +05:30
.gitignore initial commit: p2p-studio — custom frontend wired to studio env (app 169) 2026-06-04 15:39:22 +05:30
frontgen_projects_dev_to_studio.sql initial commit: p2p-studio — custom frontend wired to studio env (app 169) 2026-06-04 15:39:22 +05:30
index.html initial commit: p2p-studio — custom frontend wired to studio env (app 169) 2026-06-04 15:39:22 +05:30
migration_dev_to_studio.sql initial commit: p2p-studio — custom frontend wired to studio env (app 169) 2026-06-04 15:39:22 +05:30
p2p_demo_schema.sql initial commit: p2p-studio — custom frontend wired to studio env (app 169) 2026-06-04 15:39:22 +05:30
package-lock.json initial commit: p2p-studio — custom frontend wired to studio env (app 169) 2026-06-04 15:39:22 +05:30
package.json initial commit: p2p-studio — custom frontend wired to studio env (app 169) 2026-06-04 15:39:22 +05:30
postcss.config.js initial commit: p2p-studio — custom frontend wired to studio env (app 169) 2026-06-04 15:39:22 +05:30
seed.sql initial commit: p2p-studio — custom frontend wired to studio env (app 169) 2026-06-04 15:39:22 +05:30
tailwind.config.js initial commit: p2p-studio — custom frontend wired to studio env (app 169) 2026-06-04 15:39:22 +05:30
tsconfig.app.json initial commit: p2p-studio — custom frontend wired to studio env (app 169) 2026-06-04 15:39:22 +05:30
tsconfig.json initial commit: p2p-studio — custom frontend wired to studio env (app 169) 2026-06-04 15:39:22 +05:30
tsconfig.node.json initial commit: p2p-studio — custom frontend wired to studio env (app 169) 2026-06-04 15:39:22 +05:30
vite.config.ts initial commit: p2p-studio — custom frontend wired to studio env (app 169) 2026-06-04 15:39:22 +05:30