Signal/python-backend
Kisa 206bf718bd Add readiness verdict engine (kills the false green)
Grade one coverage line's five documentation items on two separated axes the
old code conflated: required_state (from plan_type + payer_rules.json) and
input_state (SUPPLIED | ABSENT). A line is "Clear to Ship" only when EVERY
required item is satisfied by positive evidence — a required item with no data
is NOT_EVALUATED and blocks green, never granted by absence of contradiction.

- plan_type never guessed: None / unmapped / casing-variant -> "Plan Type Needed",
  structurally cannot be green; PECOS/PA sit NOT_EVALUATED while universal items
  (SWO/visit/diagnosis per LCD L33822) still grade.
- Required-ness reads from payer_rules.json (single source of truth), removing
  the latent Python-set-vs-JSON divergence.
- Config-surface fail-safe: a known plan missing/partial in config cannot grade
  green (NOT_EVALUATED), and the green gate checks every item.
- Diagnosis accepts a real ICD-10 code as on-file; only explicit negatives gap.

Additive only: not wired into the live pipeline. 27 tests green (full suite 73),
code-auditor reviewed (H1/H2/M1/M2/M3/M4/L1 fixed).

PROVISIONAL, flagged for Pi/Kisa: gap->label mapping (At Risk/Action Needed/
On Track) and the visit-recency scope boundary (timing layer, not readiness).

Spec: docs/readiness-model-brief-2026-06-23.md section 4

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-27 00:33:42 -04:00
..
api fix(audit): add Supabase client support to audit logger, format cleanup, update cascade test 2026-06-21 16:16:34 -04:00
config feat: demo MVP — 90/60/45 priority tiers, doc state machine, confirm visit workflow 2026-06-07 11:29:33 -04:00
core Add readiness verdict engine (kills the false green) 2026-06-27 00:33:42 -04:00
db feat: demo MVP — 90/60/45 priority tiers, doc state machine, confirm visit workflow 2026-06-07 11:29:33 -04:00
__init__.py feat: FastAPI backend + full deployment stack (Railway + Vercel) 2026-05-18 19:01:35 -04:00