import { useState } from 'react'; import { useNavigate } from 'react-router-dom'; import { Brain, Database, Moon, Radar } from 'lucide-react'; import { useZino } from '../api/provider'; import { ACT, LAKEHOUSE, QUIET_MORNING_AS_OF, WORKFLOW } from '../api/config'; import { Button, Card, ErrorNote } from '../components/core'; /** * Run the daily review, now. * * There is no form. This is the same activity a scheduler performs at 6am; * the button exists so a room does not have to wait until 6am. Nothing is * asked of Ava — she decides what, if anything, is worth a person's time. * * The second button anchors the sweep on a date before the August spike. The * demo data is static, so without it every run flags the same thing; with it, * one run can genuinely come back "nothing to report" — which is what most * mornings look like, and the contrast is the point. */ export function RunReviewScreen() { const navigate = useNavigate(); const { client } = useZino(); const [busy, setBusy] = useState<'now' | 'quiet' | null>(null); const [err, setErr] = useState(null); async function run(asOf?: string) { setBusy(asOf ? 'quiet' : 'now'); setErr(null); try { // The activity's one field is optional; omit it entirely for a live run // so the workflow sees a genuinely empty submission. const res = await client.startInstance( WORKFLOW, ACT.REVIEW, asOf ? { review_as_of__review: asOf } : {}, ); if (res.instance_id) navigate(`/c/${res.instance_id}`); else navigate('/q/investigating'); } catch (e) { setErr((e as { message?: string })?.message ?? 'Could not start the review'); setBusy(null); } } return (

Daily review

Ava looks at every payer, department and front desk, and only opens a case if something clears the bar. Most mornings she reports nothing.

{err && {err}}

What she checks

  • That the claims data reconciles with the finance report
  • Denial rate vs baseline — by payer, reason code, department, front desk, week
  • Money about to fall out of an appeal window unfiled

The bar: a denied count up more than 40% on meaningful volume, or more than $100K expiring. Below it, she watches and says nothing.

Read-only against {LAKEHOUSE.platform} · {LAKEHOUSE.catalog}.{LAKEHOUSE.schema}

Normally fires at 6am on its own. This is the same activity.

Anchored on {QUIET_MORNING_AS_OF}, before anything went wrong — to see what “nothing to report” looks like.

); }