Commit graph

87 commits

Author SHA1 Message Date
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
Kisa
c07d054ca5 Add readiness-model dedup + coverage-line grouping foundation
Group normalized shipment rows into deduped shipments and gradeable
coverage lines (patient -> device -> shipment), the structural fix for the
row-keyed worklist bug (six months of orders no longer = six worklist lines).

- Locked dedup key (patient_id, device_type, date_of_service); order_number
  is display-only. Monthly resupplies stay separate, not duplicates.
- Client-mapped plan_type carried through, never guessed from payer name;
  conflicting plan types in a group route to "plan type needed".
- Quantity merge: sum across distinct component configs, max within a config
  (duplicate guard) with a warning breadcrumb on disagreement.
- CGM gradeable this phase; pumps preserved/displayed but not graded.

Additive only: not yet wired into the live pipeline, grading unchanged.
30 tests green (full suite 46), code-auditor reviewed (M1/M2/L1/L2/L3 fixed).

Design: docs/dedup-design-2026-06-24.md, docs/readiness-model-brief-2026-06-23.md

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-27 00:22:01 -04:00
Kisa
e3de616023 context: 2026-06-25 session wrap
labABLE CRUSH brief + cross-checked research staged to send; Perplexity MCP fixed (BASE_URL); OpenRouter ask CLI wired; Pi briefed for STTIL AIOS map; display corruption = macOS 26.0.1 (fix 26.5.1).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-25 18:03:16 -04:00
Kisa
6f3ce16960 verify+fix: Pi's dedup + Convex-spike designs build-ready [CC]
- dedup: separate client-mapped plan_type (not payer) so CoverageLine never guesses plan type; fix merge_quantities to sum across distinct component configs (blanket-max dropped qty in mixed dup+split groups)
- convex-spike: shipments orderNumber/hcpcs -> arrays (post-dedup multi-value); de-stale dedup note to LOCKED
- ledger: Design Verification section added

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-24 15:53:10 -04:00
Kisa
0e5c2f13b7 design+state: dedup decision locked (patient_id+device_type+DOS). Readiness model UNBLOCKED [Pi] 2026-06-24 15:23:05 -04:00
Kisa
04d204e965 design+state: Convex-Signal spike full design (40h/3-phase plan, 6 modular seams, Repository interface, auth seam decision) [Pi] 2026-06-24 13:47:57 -04:00
Kisa
bd0009ea10 docs+state: Convex-Signal spike brief + ship-status ledger + session wrap [CC]
- docs/convex-signal-instance-brief-2026-06-24.md: modular, backend-swappable Convex spike brief (separate repo signal-convex)
- docs/ship-status-ledger.md: committed shipped/not-shipped/why ledger, shared with Pi
- context/current-state.md: session wrap (delegation trigger shipped, NocoDB diagnosed, Convex eval)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-24 13:38:46 -04:00
Kisa
d9e7fb71ca review+fix: end-to-end audit found 9 gaps, fixed 3 in scope, filed rest for Claude [Pi] 2026-06-24 10:22:05 -04:00
Kisa
f5a6a5bfcc docs+state: Pi Option B research versioning design delivered, content dir created [Pi] 2026-06-24 10:13:33 -04:00
Kisa
19fa702eeb docs: Pi delegation router design — trigger, thresholds, Pi mirror, 2 skills [Pi] 2026-06-24 01:06:48 -04:00
Kisa
dcc3e67920 state: Pi delegation router design delivered (doc + extension + 2 skills) [Pi] 2026-06-24 01:06:31 -04:00
Kisa
c913a5d994 state: session wrap 2026-06-24 — current-state ACTIVE/Updated for session-brain
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-24 00:57:00 -04:00
Kisa
9215239867 state: auto-push current-state.md on session stop [hook] 2026-06-24 00:45:12 -04:00
Kisa
bbc01d307f docs(aios): recover Pi's Signal AIOS + Automated Blog plans from session log
Pi made zero file-writes; these plans lived only in its jsonl. Recovered to a
durable doc and logged the audit. Shield persisted (file + TriLane research).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-24 00:22:41 -04:00
Kisa
9d34b22dab docs(delegation): brief Pi on the delegation router + hybrid skill model
Router brain = existing dispatch skill (no new skill). Trigger = cheap keyword
UserPromptSubmit hook. chief-of-staff conditional, not permanent. Hybrid 3-tier
skill model locked. Pi designs the trigger + thresholds + pi-subagents mirror +
design-review/persist skill.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-24 00:16:22 -04:00
Kisa
d285af51fb state: auto-push current-state.md on session stop [hook] 2026-06-23 23:45:57 -04:00
Kisa
0d556d3cdd state: auto-push current-state.md on session stop [hook] 2026-06-23 23:41:40 -04:00
Kisa
00cff7a5f8 feat(workflow): build consolidation foundation from Pi's recovered design
- current-state.md -> v:1 schema (repairs Pi's destructive edit, restores decisions log)
- recover Pi's workflow-consolidation design from session log into a durable doc
- add drift-to-skill governance table
- demote CLAUDE.md embedded state block to a pointer (stops harness re-injecting stale state)
- new shared state-sync skill lives at ~/.claude/skills/state-sync (separate path)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-23 23:30:56 -04:00
Kisa
93842438fa state(next): hand workflow-consolidation brief to Pi as priority design task
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-23 22:11:18 -04:00
Kisa
4bfe5d25cf chore(state): clean-start current-state.md, ignore context recovery artifacts, add workflow-consolidation brief for Pi
Commit the previously-uncommitted current-state.md (left dirty by an interrupted
wrap-up), gitignore the heavy context recovery files (screenshot/jsonl/snapshot),
and add the consolidated Pi design brief for the shared-state + workflow cleanup.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-23 21:22:31 -04:00
Kisa
e3fb7b7594 add readiness-model design brief for pi and update shared context
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-23 19:53:57 -04:00
Kisa
20e6556afc docs(shield): v2 — HIPAA+GDPR global scope, user's pricing model (free print, $49 PMS integration), Signal Tier 3 bundle, Shield MVP first 2026-06-22 10:14:57 -04:00
Kisa
41388ed0e7 docs(shield): update target customer to small healthcare ops + AI SaaS, add Consent Engine delivery options (GitHub template, hosted, hybrid) 2026-06-22 09:55:52 -04:00
Kisa
9b3e32f3bd feat(shield): add product architecture design draft — positioning, features, pricing, tech stack 2026-06-22 09:04:44 -04:00
Kisa
e2a59ae7a0 docs: sync current-state — trust fixes done, Phase 4 spec'd, Shield recon done, Phase 2 built (Claude) 2026-06-22 09:01:34 -04:00
Kisa
96cbedbf77 docs: correct Shield positioning — standalone compliance, not DMEPOS-specific 2026-06-22 08:36:01 -04:00
Kisa
e0590a0397 docs: sync state — trust fixes done, Phase 4 spec'd, Shield competitor insight planted 2026-06-22 08:17:11 -04:00
Kisa
9a274f6fee feat(build-spec): Phase 4 — support bot foundation spec + trust fixes applied 2026-06-22 08:13:36 -04:00
Kisa
25746de7b3 fix(compliance): trust fixes — audit retention 7yr→6yr (45 CFR §164.530(j)), false BAA claim corrected to live posture 2026-06-22 08:06:01 -04:00
Kisa
5d020dea5c feat(startup): embed Current State in CLAUDE.md + sync AGENTS.md — state auto-loaded without separate read 2026-06-22 00:18:54 -04:00
Kisa
1183d83f1a feat(build-spec): Phase 2 — session-brain auto-write + insight extraction spec 2026-06-21 23:53:14 -04:00
Kisa
4625585146 docs(context): Clerk prod migration complete, firecrawl persisted, update open threads 2026-06-21 23:46:07 -04:00
Kisa
d9ec0b7717 docs(context): mark NotebookLM push, finalize session 3 wrap 2026-06-21 16:20:26 -04:00
Kisa
2277869a65 docs(context): update current-state for session 3 wrap — subagent guardrails, audit log fix, next steps 2026-06-21 16:18:15 -04:00
Kisa
ae650e2597 fix(audit): add Supabase client support to audit logger, format cleanup, update cascade test 2026-06-21 16:16:34 -04:00
Kisa
b9939b1ba0 docs(context): mark Build Spec Phase 1 complete in shared state
research_insight category live, CGM-to-pharmacy insight planted,
8 session summaries moved Signal -> Sessions workspace.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21 14:39:51 -04:00
Kisa
a566722bb8 chore: wire shared-context startup pointer (build-spec Phase 3)
Adds the Startup Ritual to signal/CLAUDE.md and records today's key
rotation + Clerk-in-flux note in context/current-state.md, so Pi and
Claude Code both read and write the same shared state file.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21 14:30:44 -04:00
Kisa
25f65326d4 security: rotate leaked Signal API key, remove it from frontend + source
The backend master SIGNAL_API_KEY had leaked via two paths:
- baked into the public Vite bundle via VITE_SIGNAL_API_KEY (Vercel)
- hardcoded as a fallback in scripts/signal_e2e_test.py

The key has been rotated on Railway (old value now returns 401) and the
VITE_SIGNAL_API_KEY var removed from Vercel. This commit removes the two
code paths so the master key can never be re-baked or re-committed:

- signal-ui/src/lib/api.js: drop the X-API-Key fallback entirely; the
  frontend now authenticates only with the signed-in user's Clerk token
- scripts/signal_e2e_test.py: read SIGNAL_API_KEY from env only; exit if unset

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21 14:00:54 -04:00
Kisa
70c1f28230 add pilot end-to-end validation + production readiness docs
Live validation of the deployed Signal stack: engine verified (5k-patient
upload, PHI-clean, export, confirm-visit), live app outage diagnosed and
restored (Clerk dev-instance revert), 3 product blockers + master-key
exposure + compliance gaps documented for Pi to design remediation.
Includes Pi's current-state.md design updates.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21 12:46:36 -04:00
Kisa
7053e4e061 docs: add build spec, support manual, and shared current-state context
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-20 17:38:31 -04:00
Kisa
42a79c6682 add pitch assets, fix UI and backend bugs, add test utilities
- add 3 signal pitch assets (workflow flowchart, market opportunity, win-win-win) as HTML + PNG
- fix doc_state_machine cascade and supplied sentinel flags
- fix CSVImport mapping review, WorklistTable colored bullets and expand row
- fix App.jsx auth gate, api.js CORS handling
- add signal E2E test script and stress test generator

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-19 12:52:29 -04:00
Kisa
228ca98423 feat(signal-ui): migrate agent-readiness files to Vercel, add graphify to gitignore
Moves llms.txt, robots.txt, auth.md, .well-known/api-catalog, agent-skills,
webmcp.js from VPS /var/www/signal-demo to signal-ui/public/ so they are
served from the Vercel deployment at signal.sttilsolutions.com.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
2026-06-16 15:19:18 -04:00
Kisa
ca65185ba2 feat(signal-ui): Clerk redirect fix, stoplight colors, Clear to Ship checkmark, tab counts
- ClerkProvider now sets signInUrl/afterSignInUrl to signal-ui-xi.vercel.app so
  invitation emails and sign-in links land on the webapp not Clerk's hosted page
- Stoplight colors on status badges (red/amber/teal/green)
- Clear to Ship shows checkmark instead of dot
- Filter tabs include count + percentage
- EmptyState V2: "Drop your file here" heading
- Legend bar removed from worklist header (redundant with tabs)
- Pilot readiness at 13/13 (100%) as of 2026-06-16
- Signal Intelligence spec added to docs

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
2026-06-16 15:01:39 -04:00
Kisa
320b365fde add graphify-out to gitignore, fix badge for resupply_ready cascade state
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
2026-06-14 12:25:52 -04:00
Kisa
1d95bb2ab2 feat: doc status persistence, empty state, status legend, and Clear to Ship guard
- Doc status click-to-update: SWO and PA cycle through states and persist to Supabase
- Status legend added to worklist header
- Empty state with file-open prompt for first-time users
- Device normalizer expanded for broader CGM variant coverage
- Warm cream text applied globally for secondary/muted UI elements
- Drag-drop CSV import support
- CORS root cause fixed via Railway ALLOWED_ORIGINS env var
- DOCS_REQUIRED badge: RESUPPLY_READY patients with open cascade items now show
  amber Docs Required instead of green Clear to Ship, preventing premature shipment

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
2026-06-14 05:09:06 -04:00
Kisa
1733d83bba add fully executed labABLE discovery LOI (signed 2026-06-12)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-12 19:36:35 -04:00
Kisa
cc2a5f4b47 coverage calculator and UI refinements; add demo MVP gap analysis and quality review docs
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-12 13:04:23 -04:00
Kisa
3b0de375d9 Update pilot readiness to 12/13 (92%) — Supabase Pro confirmed
Marks Real PHI Blocked as PASS after founder confirmed Supabase Pro
upgrade on 2026-06-11.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-11 10:21:13 -04:00
Kisa
ff657f4765 cascade: show all doc gaps; export: add order_number, hcpcs, recommended_next_step_code, diagnosis/pecos; supabase: confirm pro plan
- doc_state_machine: remove early returns from _build_cascade, surface all 5 doc checks, pecos gated to medicare/MA, pa denied routes to appeal alert
- main.py: add _recommended_next_step_code(), extend RecordOut and export CSV with new columns
- normalizer: accept order_number and hcpcs as pass-through fields
- coverage_calculator: add order_number/hcpcs to ShipmentRecord
- CLAUDE.md: supabase pro plan confirmed 2026-06-10

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-10 22:53:22 -04:00
Kisa
63093990d2 Add empty state, mapping review, confirmation step, copy rewrites, active patient indicator
- Empty state UI: first-time prompt with file selector
- Mapping review step in CSVImport with confidence scores and override dropdowns
- Confirmation step in ConfirmVisitModal (one last look before save)
- Next-priority toast after visit confirmation
- Active patient banner with autosave and one-click return for interruptions
- Simplified cascade to 2-step (what is missing, device shipment at risk)
- Copy rewrites: status labels, doc checklist text, action messages, cascade language
- Pilot readiness updated to 85% (11/13)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-10 17:13:16 -04:00