Skip to content

Phase 4: Verdict web app (routing slip & inspection stamp) - #4

Merged
OnePieceMonkey merged 8 commits into
mainfrom
phase-4-ui
Oct 2, 2026
Merged

OnePieceMonkey merged 8 commits into
mainfrom
phase-4-ui

Conversation

@OnePieceMonkey

Copy link
Copy Markdown
Owner

Builds on #3 (phase 2 into main). Once #3 is merged, this diff shows only phase 4.

What

  • Next.js 16 app: POST /api/run streams a run as server-sent events (5 MB / 5 pages / PDF magic check, per-IP rate limit, daily budget, nothing stored), GET /api/budget.
  • UI world "routing slip & inspection stamp", designed with impeccable (code-led), reviewed by an independent finish reviewer: fix → fix → ship.
    • PDF page with quote highlights; hover a fact to see its quote.
    • Facts with BT codes and provenance (page / computed / you).
    • Refused values stay on record, struck through and stamped void; the first word that departs from the page is marked.
    • Routing slip as a ruled form with sign-off initials and real durations; a resumed run continues on the same slip.
    • Verdict pressed as a stamp with validator version, date and report hash; one large computed total; a printed total that disagrees is cancelled in place.
    • Needs-input form asks only for missing facts (including those behind KoSIT rejections like BR-DE-1) and re-validates without a second model call.
    • XRechnung and audit-log downloads.
  • Gallery: 7 recorded real runs on synthetic invoices, replayed with their timing; works without budget or API key.
  • Core fixes found by the review: quotes with literal \n were falsely refused; bundled-server path for pdf.js fonts.
  • DESIGN.md + .impeccable/design.json, PRODUCT.md.

Production build and next start checked with a real PDF.

Requirements

UI-01–UI-07, CORE-04, REP-04

🤖 Generated with Claude Code

OnePieceMonkey and others added 8 commits October 2, 2026 23:15
… into core

runInvoice reports every audit event as it is appended (drives the live routing slip), can resume a NEEDS_INPUT run with the previous extraction and user input instead of a second model call, and returns refused facts, document totals and the raw extraction. extractPageTexts moves to core so the app and the eval share it.

Refs: REP-04, UI-02

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…pection stamp

Next.js app: POST /api/run streams a run as server-sent events (upload limits, PDF magic check, per-IP rate limit, daily budget, nothing persisted); GET /api/budget. UI direction 'routing slip & inspection stamp': PDF with quote highlights, facts with BT codes and provenance, refused values struck through and stamped void, a ruled routing slip with real durations, the verdict pressed as a stamp with validator version, date and report hash, a needs-input form that resumes without another model call, XRechnung and audit downloads.

Refs: UI-01, UI-02, UI-03, UI-04, UI-05, UI-07, CORE-04

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Real runs on synthetic corpus invoices (fictional names, derived from the Apache-2.0 KoSIT test suite), replayed with their original timing so the gallery works without budget or API key.

Refs: UI-06

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…dator rejections

The extraction prompt asks for line breaks as the two characters \\n; the evidence check now treats them as whitespace, which removes false refusals of multi-line values. An unresolved KoSIT rejection that only means a fact is not printed (e.g. BR-DE-1, BR-DE-15, BR-62/63) becomes a precise NEEDS_INPUT question; a user-entered IBAN implies credit transfer.

Refs: EXT-03, REP-04

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Truthful gallery copy; stamp date, configuration and report hash taken from the run; refused values shown under the stamp with field label, plain reason and the first word that departs from the page; printed total cancelled in place; routing slip as a ruled form that keeps the first pass after an answer, with real durations; cumulative cost and repair rounds; larger credits and readouts; mobile intake above the fold. Re-recorded seven-lines and missing-iban (now with an answer).

Refs: UI-02, UI-03, UI-04, UI-06

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s server and browser

pdf.js standard fonts are resolved lazily with a node_modules fallback (require.resolve returns a module id when bundled). RULE_FIELDS moves to a browser-safe subpath export @verdict/core/rule-fields.

Refs: OPS-05

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
DESIGN.md and .impeccable/design.json describe the routing-slip & stamp world from the built code. Validator rule rows read in English with the validator's wording as evidence; ink-3 and struck words pass AA contrast; reduced motion also stops pulses and smooth scrolling.

Refs: UI-03

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@OnePieceMonkey
OnePieceMonkey merged commit 38f1191 into main Oct 2, 2026
3 checks passed
@OnePieceMonkey
OnePieceMonkey deleted the phase-4-ui branch October 7, 2026 20:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant