Commit graph

111 commits

Author SHA1 Message Date
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
Kisa
d197c529ce fix: demo readiness — filter flags, auth, active display, sidebar org, visit validation
- coverage.js: correct 7-tier flag names matching backend (was OUT_OF_COVERAGE etc.)
- Sidebar: dynamic org name from Clerk useOrganization (was hardcoded "Demo Supplier")
- App.jsx: fix undefined escalateCount/outreachCount crash
- Privacy.jsx: replace personal email with privacy@sttilsolutions.com
- api.js + ConfirmVisitModal: Confirm Visit uses Clerk Bearer token (was 401 on Vercel)
- WorklistTable: ACTIVE rows show next visit due date
- main.py: server-side 6-month qualifying visit validation
- CLAUDE.md: pilot readiness checklist updated to 65%
- pitch/legal/gaboro-nda.md: STTIL city + Robert Robinson email filled

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-10 00:27:17 -04:00
Kisa
34e6c08c14 Mark Paste MCP Phase 1 complete
Content Outbox + Call Prep pinboards live. linkedin-post, linkedin-carousel,
and pilot-prep skills updated to push to Paste automatically. All 3 skills
passed spec compliance and code quality review.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-09 10:31:57 -04:00
Kisa
aba7237de8 Add Paste MCP Phase 1 implementation plan
6 tasks: create 2 pinboards, update 3 skills (linkedin-post, linkedin-carousel,
pilot-prep), end-to-end verification. Skills dir is not a git repo — file edits only.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-09 07:16:33 -04:00
Kisa
ee2d6b0308 Add pharmacy vs DME adherence stats and regulatory handicap framing to Brand Vault spec
DME wins on patient outcomes despite heavier Part B documentation burden vs pharmacy Part D.
Signal removes the handicap — the pitch framing belongs in the Brand Vault.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-09 07:12:00 -04:00
Kisa
43dcab2f68 Add Paste MCP ambient layer design spec
Four-phase architecture: Content Outbox + Call Prep (Phase 1, immediate),
Brand Vault (Phase 2), Session Handoff (Phase 3), Agent Trays (Phase 4).
Phase 1 starts now; Phase 3 gated on auth stability across 5+ sessions.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-08 22:06:56 -04:00
Kisa
755d43d5c9 chore: commit original test-data CSVs and labABLE legal docs
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-07 22:20:01 -04:00
Kisa
93bd33d622 chore: update pilot readiness — CSV test suite PASS (50 files, 100%) 2026-06-07 22:13:12 -04:00
Kisa
175dcf5081 feat: PA and NJ CSV test sets — 50 files for pilot readiness validation
Generates 25 PA (Gaboro DME, high challenge) and 25 NJ (Gaboro DME, high
challenge) synthetic CSV files. All 50 files pass normalizer ingestion
(50/50). Adds test-data/.gitignore override so CSV test sets are tracked
despite root-level *.csv exclusion.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-07 22:11:13 -04:00
Kisa
b52b258b8f compliance: audit_log WORM RLS migration + .gitignore supabase/
- Add supabase/ to .gitignore (local CLI config should not be committed)
- Create and apply migration 20260607000001_audit_log_worm.sql via CLI:
  creates audit_log table with RLS enabled + INSERT/SELECT policies +
  WORM policies that block UPDATE and DELETE on all rows
- Update CLAUDE.md compliance checklist: audit_log WORM marked PASS

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-07 22:09:11 -04:00
Kisa
e8b15233ec feat: stoplight label system — At Risk / Action Needed / Clear to Ship / On Track
RED At Risk: SUPPLY_LAPSED, VISIT_REQUIRED, RENEWAL_CRITICAL
AMBER Action Needed: RENEWAL_ELEVATED, RENEWAL_SOON, TRANSFER_PENDING
GREEN: Clear to Ship (RESUPPLY_READY), On Track (ACTIVE)
Filter tabs updated to match 3-tier model.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-07 22:04:03 -04:00
Kisa
77a1cdb2c0 fix: update UI to 7-state display framework
- WorklistTable: consolidate 9 filter tabs to 8 matching 7-state labels
  (Docs Required, Escalate, Confirm Appt., Begin Outreach, Clear to Ship,
  New Patient, On Track) + add combined "escalate" filter key for
  RENEWAL_CRITICAL + VISIT_REQUIRED
- Sidebar: fix broken filter keys (REFILL_WINDOW/VISIT_DUE/OUT_OF_COVERAGE
  never matched any r.flag value) - replace with SUPPLY_LAPSED, escalate,
  RESUPPLY_READY; update labels to 7-state names
- App: rename Sidebar props to match new framework; update stat cards to
  Needs Attention / Outreach in Progress / Clear to Ship

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-07 16:27:25 -04:00
Kisa
e57f803f26 fix: action text uses exact clinical question for CGM dosing visit verification
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-07 16:12:06 -04:00
Kisa
76386bf175 feat: 7-state worklist framework — DMEPOS billing language
Labels: On Track, Clear to Ship, Begin Outreach, Confirm Appointment,
Escalate, Docs Required, New Patient

- SUPPLY_LAPSED → Docs Required
- VISIT_REQUIRED + RENEWAL_CRITICAL → Escalate
- RENEWAL_ELEVATED → Confirm Appointment
- RENEWAL_SOON → Begin Outreach
- RESUPPLY_READY → Clear to Ship (teal, checkmark, positive)
- ACTIVE → On Track
- TRANSFER_PENDING → New Patient (covers transfers + new CGM starts)
- Action text updated to DMEPOS billing staff language throughout

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-07 16:07:26 -04:00
Kisa
bcb1a10fe6 feat: demo MVP — 90/60/45 priority tiers, doc state machine, confirm visit workflow
- New CoverageFlag enum: SUPPLY_LAPSED, VISIT_REQUIRED, TRANSFER_PENDING,
  RENEWAL_CRITICAL/ELEVATED/SOON, RESUPPLY_READY, ACTIVE
- Doc state machine: 5-item payer-dependent status per patient (SWO, Visit,
  PECOS, PA, Diagnosis) with cascade chain
- Confirm Visit endpoint: staff enters prescriber-confirmed date, persisted in
  Supabase confirmed_visits table, survives all future CSV imports
- Supabase migration: 001_add_confirmed_visits.sql (run manually in SQL editor)
- Frontend: Badge rebuilt for 8 flags, DocStatusBar 5-dot display,
  ConfirmVisitModal, expandable WorklistTable rows
- Legal: LOI, NDA, BAA drafts at pitch/legal/ for Nixon Law Group review
- Compliance docs: privacy policy, incident response, data handling
- CSV generator: market_data.json + PA/NJ generator scripts
- 15/15 tests passing

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-07 11:29:33 -04:00
Kisa
cea22c58db extend .gitignore to cover .env.* variants and remove stale Vite scaffold
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-06 22:42:31 -04:00
Kisa
3c368dc9ac update pilot readiness checklist and compliance tracking
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-06 22:22:07 -04:00
Kisa
07120ec062 update CLAUDE.md and coverage calculator; add n8n content radar workflow, vercel SPA rewrite, and ui workspace config
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-02 00:41:49 -04:00
Kisa
d4e5187350 Add OrganizationSwitcher to header
Lets users switch between orgs (e.g. STTIL Solutions, Gaboro DME)
directly from the top bar without going into account settings.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-29 13:15:37 -04:00
Kisa
ec2cd24bd7 Add Phase 3: Clerk auth with org-scoped data isolation
Backend: JWT middleware validates Clerk tokens on every request,
extracts org ID from claims, enforces org-scoped queries via
Supabase RLS. Frontend: ClerkProvider wraps the app, auth gate
blocks unauthenticated access, UserButton in header, token
injected into every API call. Supabase production wired to trust
Clerk JWTs via Third-Party Auth integration.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-29 12:12:17 -04:00
Kisa
35a61e11d5 add /health/db endpoint for supabase connection diagnostics
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-29 09:04:31 -04:00
Kisa
4a0e043a6d add phase 2 supabase persistence layer
- supabase_client.py: lazy singleton client (no-ops when env vars absent)
- persistence.py: persist_upload writes batch, source_files, normalized_records,
  mapping_decisions, report_runs; persist_export records export_files
- schema.sql: 11-table schema with RLS + WORM rules for audit/raw tables
- main.py: wire persist_upload/persist_export; add ExportRequest body model
  so export accepts {records, batch_id}; batch_id returned on upload response
- api.js: add exportFromBackend helper passing batch_id through
- requirements.txt: add supabase>=2.0.0
- smoke_test.py: update export call to new body format

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-29 06:50:34 -04:00
Kisa
cf171a3f87 add Phase 1 security hardening, mapping confidence, audit logging, pilot docs
- lock CORS to Vercel domain via ALLOWED_ORIGINS env var (removes allow_origins=*)
- add X-API-Key header auth on /api/upload and /api/export
- normalizer: add mapping confidence (high/inferred), new aliases for Acct #,
  Member ID, External Patient Ref, DME Description, dispensedate; 63/63 CSV files pass
- coverage_calculator: add RULE_VERSION = "v0.1", rule_version on every CoverageResult
- main.py: audit logging wired on upload + export, rule_version + mapping_summary in response
- generate_samples.py: 25 CSV files now use 25 different real-world header formats
- add generate_10k.py for 10,000-patient synthetic dataset
- add tests/smoke_test.py (passes against local backend)
- add docs/pilot-guide-v1.md for Robert Robinson pilot onboarding
- add docs/daniel-pilot-readiness-whitepaper.md and .pdf

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-29 05:41:25 -04:00
Kisa
c2141a127a Update Signal brand language and add pitch/build artifacts
- Remove 'coverage' from worklist description across all docs
- Add whitepaper v2, documentation gap whitepaper, gate demo, sample
- Add TERAX.md, Claude Code settings, test-data generator
- Add settings.local.json to .gitignore

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-28 10:14:16 -04:00
Kisa
a424ac9d13 feat: add reason strings per patient, fix export headers, add signal-ui source
- Add _build_reason() to backend — per-patient reason strings with specific
  day counts (e.g. "Supply lapsed 70 days ago. Prescriber contact required.")
- Add reason field to RecordOut model and backend /api/export CSV
- Fix export column headers: Coverage End Date → Resupply End Date,
  Days Until Coverage End → Days Until Resupply End
- Pass reason through apiRecordToLocal in frontend api.js
- Display reason as muted sub-line under status badge in WorklistTable
- Add reason column to client-side CSVExport
- Add signal-ui React source to repo (was untracked)
- CLAUDE.md: add Billing and CMS integrations to Phase 2 deferred table
- research: restore Section 14 stat verification (May 23 recovery)

Deployed to Railway production — health check confirmed live.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-26 09:45:02 -04:00
Kisa
0af32ec983 chore: add .vercel to gitignore; clarify export button label
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-19 12:50:25 -04:00
Kisa
e3afd9038c feat: FastAPI backend + full deployment stack (Railway + Vercel)
- FastAPI backend: /health, /api/upload (CSV parse + score), /api/export (work queue CSV)
- CSV normalizer: tolerates 10+ header aliases per field, 8 date formats, all 5 devices, all major payers
- Python coverage_calculator wired as the authoritative scoring engine
- Frontend: backend-first upload with local fallback, export CSV wired, J. Sullivan placeholder removed
- Dockerfile + railway.toml for Railway deploy
- vercel.json for static frontend deploy
- Railway MCP installed for future sessions

Backend live: https://signal-api-production-91c2.up.railway.app
Frontend live: https://signal-ui-xi.vercel.app

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-18 19:01:35 -04:00