Spaces:
Sleeping
Sleeping
Commit History
-
Fix live gaps: auditor copy, direct Ask answers, Ask metadata UI, audit tax detection
Aissugur Kurganbekov +1: Claude Opus 4.8- Landing/Auth/Overview copy -> evidence-backed finance auditor positioning (index.html title+meta, AuthScreen, Overview hero eyebrow/body/footer). - New extractors.py: deterministic regex extraction of common finance fields (total, due date, terms, tax, invoice no, late fee, overdue, uptime). Ask now returns a crisp grounded answer ("The total amount due is $2,413.98.") and falls back to focused-span extraction; values are verbatim, citations unchanged. - Ask metadata panel (question type, evidence, confidence, retrieved/cited, latency) rendered below each answer. - Audit: detect structured fields via the same extractors and fuzzy clauses via keyword scan instead of the retrieval gate -- fixes "No tax / VAT found" on "Tax (8.25%) $183.98" and a parallel false-negative on the contract liability clause. Audit is now fully deterministic. Backwards compatible (Ask, audit, evaluate, auth, scoping unchanged in shape). Verified: 59 backend tests pass, frontend builds, evalua…40c5ba0 -
Add Audit Mode: evidence-backed checklist audit for finance documents
Aissugur Kurganbekov +1: Claude Opus 4.8New POST /audit runs a per-type checklist (invoice / contract / payment_note / general) over a document, reusing the /ask retrieval + abstention gate so it never invents a value. A check is SUPPORTED only when retrieval does not abstain AND the cited excerpt contains the field's discriminator keyword; otherwise the field is flagged unsupported (a missing field drives the risk level). Returns a summary, risk_level, per-field findings (claim + evidence + citation), and metrics (counts + citation coverage). Reuses _owned_document for per-user scoping + 404; /ask is unchanged. Frontend: new Audit tab — a B2B audit dashboard (document + type selectors, risk badge, metric cards, per-finding evidence with highlighted citations). Backend: app/audit.py, audit schemas, POST /audit, and tests/test_audit.py (7 tests: field detection, unsupported detection, citation coverage, false-positive guard, 404, cross-user scoping, default type). Hardened after an adversarial review: field discriminators …f22b512 -
Add hybrid retrieval (TF-IDF + embeddings), OCR, A/B eval, and answer trust/UX
Aissugur Kurganbekov +1: Claude Opus 4.8Smarter retrieval: - Hybrid dense+lexical retrieval: fuse TF-IDF with fastembed vectors via Reciprocal Rank Fusion (retrieval.hybrid_rank), wired into answering. The abstention gate still runs on TF-IDF so grounding stays conservative. Graceful fallback to pure TF-IDF when fastembed/the model is unavailable. - Store chunk vectors on Chunk.embedding (new column); idempotent ensure_schema() migration adds it to existing SQLite DBs on startup. - OCR fallback for scanned/image PDFs (PyMuPDF + pytesseract), graceful when the Tesseract binary is absent; tesseract-ocr added to the Docker image. - A/B eval harness (app.ab_eval / eval_cli --ab) comparing TF-IDF vs hybrid. Answer trust / UX: - answer_question now returns answer metadata (confidence, question_type, top_score, term coverage, chunk counts, latency); AskResponse.metadata and Citation.match_text added. - Frontend: confidence meter, exact source-span highlighting, and a printable one-page evidence report. Verified: 4…f65a6b3
-
Audit-driven hardening + Google sign-in
Aissugur Kurganbekov +1: Claude Opus 4.8Security (from a multi-agent audit): - CRITICAL: never sign JWTs with a shared constant. AUTH_SECRET_KEY is required in production and a random EPHEMERAL key in dev, so a default deploy can't run on a public, forgeable secret. - Fix cross-user history leak: QA rows now carry user_id and /history is scoped to the asker, so questions over shared demo docs no longer leak across users. - Require auth on /evaluate and /demo/seed (resource-amplification guard). - Guest accounts use CSPRNG creds (crypto.getRandomValues) independent of the email; add a token-type claim; guard citations against a deleted parent doc. Feature: "Continue with Google" (Google Identity Services ID-token flow): - POST /auth/google verifies the ID token (google-auth: aud + iss + email_verified) and get-or-creates the user; password_hash is now nullable for OAuth-only accounts. Gated on GOOGLE_CLIENT_ID (button hidden when unset); /health exposes google_client_id. UX/a11y: honest "session expired" messa…90adb95 -
Add user accounts: registration, login (JWT + bcrypt), per-user documents
Aissugur Kurganbekov +1: Claude Opus 4.8Backend: - User model + nullable owner_id on Document (NULL = shared demo/eval docs). - security.py (bcrypt via passlib, PyJWT HS256) and auth.py (/auth/register, /auth/login, /auth/me + get_current_user). Generic 401 with a dummy-hash compare on miss (no user enumeration), 409 on duplicate, EmailStr validation. - /documents*, /ask, /history now require a Bearer token and are scoped to the user's own docs + shared demo docs; cross-user access returns 404 (never leaking ids). /health, /evaluate, /demo/seed stay public. AUTH_SECRET_KEY is env-driven (prod hard-fail, dev default + warning). - conftest authed-by-default so the 12 existing API tests are unchanged; new test_auth.py (register/login/me/protected/per-user isolation). 38 tests pass, live end-to-end verified. Frontend: - Split-layout AuthScreen (sign in / sign up toggle, validation, show/hide password, "Continue with the demo" guest path) in the light theme. - api.js routes every request through a Bearer wrapper …165a274
-
Replace placeholder testimonials with an honest proof band
Aissugur Kurganbekov +1: Claude Opus 4.8Drop the fictional reviews and star rating from the dark band (no fake social proof on a CV-linked repo). Reframe it as "Proof, not promises" with only the real, verifiable metrics: 100% citation coverage, 0 unsupported answers, 25/25 tests. Remove the now-dead testimonial CSS. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>939ceb8 -
Re-theme the frontend light (cointracker-style) and make Thinking mode honest
Aissugur Kurganbekov +1: Claude Opus 4.8- Drop the dark-purple theme for a light canvas: navy ink (#0d1b2a) + fintech blue (#2563eb) on near-white (#fbfbfd). Rework the :root tokens and convert every dark-assuming value (white-alpha surfaces and borders, the cinematic gradient-mesh, glows, clipped-text gradients, scrollbar, topbar glass) for a light background. All WCAG AA-verified. - Add a "works with" strip and a dark navy proof/testimonials band (placeholder reviews; the 100% / 0 / 25-tests stats are real). - Remove the floating connector line from the hero preview mock. - Make Thinking mode honest: disable the toggle when no API key is configured, show a note when a Thinking request falls back to Fast, and surface the real status in the sidebar. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>a38a802
-
Add Fast / Thinking answer modes (per-request LLM toggle)
Aissugur Kurganbekov +1: Claude Opus 4.8 (1M context)- Fast: extractive engine — instant, offline, free (no API key). - Thinking: LLM reasons on the fly with Claude adaptive thinking (thinking={"type":"adaptive"}, no temperature — correct for current models), grounded in the same retrieved context with citations + abstention. Transparently falls back to Fast when no API key is set, so it never breaks. - AskRequest.mode ("fast"|"thinking", validated -> 422 on bad value); /ask returns the engine that actually answered. - Frontend: segmented Fast/Thinking toggle in the Ask view; mode passed to API. - Thinking model default = claude-sonnet-4-6 (supports adaptive thinking). - 21 tests pass incl. new thinking->fast fallback test. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>f2f300a -
Redesign landing into a cinematic "Proof Engine" experience
Aissugur Kurganbekov +1: Claude Opus 4.8 (1M context)Bold visual overhaul (concept chosen via a 3-agent design judge-panel using the ui-ux-pro-max skill): - Animated gradient-mesh + hairline-grid background (fixed, GPU-cheap) - Cinematic hero stage with a self-running "Verified Answer" product mock: typewriter answer, highlight sweep on the cited figure, SVG citation connector, and an abstain card peeking behind (new HeroPreview.jsx) - Sticky blurred top bar on scroll; rotating conic accent ring on the brand mark - New sections: how-it-works flow, count-up stats band, bento feature grid, "we grade ourselves" evaluation teaser, big final CTA, real footer - IntersectionObserver scroll-reveal (new useScrollReveal hook), Space Grotesk display headlines, gradient-clip hero text - All plain CSS + React, zero new deps; full prefers-reduced-motion fallbacks; Try Demo / upload / ask / evaluation chart untouched Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>2695640 -
UI/UX pass: accessibility, motion, design tokens, and an eval results chart
Aissugur Kurganbekov +1: Claude Opus 4.8 (1M context)Applied a 6-dimension audit (ui-ux-pro-max skill, run via parallel AI agents): - a11y: visible :focus-visible rings, prefers-reduced-motion guard, lifted text contrast (--text-dim/--text-faint), nav aria-labels + aria-current, evidence aria-expanded, role=alert/status live regions, heading hierarchy - design tokens: type / spacing / z-index / motion scales, --shadow-accent, Space Grotesk display font, tabular-nums for figures - interaction: 40/44px touch targets, press states, cursor:not-allowed disabled - layout: 100dvh, max-width on main, mobile sidebar overflow fix, line-length caps - components: SVG IconCheck (no emoji), Field error slot, Evaluation empty state - NEW: dependency-free SVG donut + progress-bar chart on the Evaluation page Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>c412fbd
-
Redesign frontend into a premium dark-first AI workspace
Aissugur Kurganbekov +1: Claude Opus 4.8 (1M context)- New design system: dark theme tokens, Inter type, soft accent gradient, glass panels, thin borders, smooth hover/press, shimmer + answer-reveal - App shell: left sidebar nav + main area + right evidence panel - Landing/Overview: hero pitch, trust badges, drag-and-drop upload, doc grid - Ask workspace: demo question chips, loading shimmer, animated answer card, collapsible evidence panel, history - Evaluation: metric cards + pass/fail table + "why it matters" - Reusable components: Button, Card, Badge, Field, Sidebar, DocumentCard, MetricCard, EvidencePanel, Upload, LoadingState/EmptyState/ErrorState - Responsive: desktop / laptop / mobile (sidebar collapses to a top bar) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>375d687 -
Recruiter-demo polish: curated demo questions, reset-db, PDF test, CORS
Aissugur Kurganbekov +1: Claude Opus 4.8 (1M context)- AskPanel: 3 curated demo questions (strong cite / multi-evidence / abstain), auto-selects the sample invoice for a deterministic 2-click demo - Add `python -m app.reset_db` + `make reset-db` for a clean slate - Add dependency-free PDF upload test (real pypdf parse path) -> 20 tests - CORS: allow any localhost/127.0.0.1 port (and Docker) via regex - README: reset-db command + no-make fallback Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>49eecdc -
FinanceFlow AI: source-grounded RAG Q&A over finance documents
Aissugur Kurganbekov +1: Claude Opus 4.8 (1M context)Full-stack MVP: FastAPI + SQLite backend, React/Vite frontend. - Upload PDF/TXT -> chunk -> TF-IDF retrieval -> focused extractive answer - Two abstention gates + citations for anti-hallucination - Golden-dataset evaluation (UI + CLI) with coverage/abstention/evidence metrics - One-click demo mode, sample-question chips, clean B2B dashboard - Logging, global exception handler, validated/typed API with Swagger docs - 19 pytest tests + GitHub Actions CI - Dockerfiles, docker-compose, Makefile Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>fc5156b