From 5d020dea5c9aaf5e8a90c37602855b1d20b8bbb1 Mon Sep 17 00:00:00 2001 From: Kisa Date: Mon, 22 Jun 2026 00:18:54 -0400 Subject: [PATCH] =?UTF-8?q?feat(startup):=20embed=20Current=20State=20in?= =?UTF-8?q?=20CLAUDE.md=20+=20sync=20AGENTS.md=20=E2=80=94=20state=20auto-?= =?UTF-8?q?loaded=20without=20separate=20read?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CLAUDE.md | 43 +++++++++++++++++++++++++++++----------- context/current-state.md | 7 ++++--- 2 files changed, 35 insertions(+), 15 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 41c85e5..6594991 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -1,6 +1,7 @@ # STTIL Solutions — Signal | Active Build Context ## What This Tool Does + Signal is a B2B DMEPOS documentation readiness tracker for CGM suppliers. It ingests order data from any DME order management CSV export (e.g., Brightree), evaluates each patient against documentation requirements (6-month qualifying @@ -9,14 +10,24 @@ worklist for supplier staff to prioritize outreach and capture revenue before it NOTE: Signal identifies gaps. It does not conduct outreach. Never write copy implying Signal contacts prescribers or patients directly. -## Startup Ritual (shared context with Pi) -At session start, before other work: -1. Read `context/current-state.md` in this repo. It is the shared state file that Pi and Claude Code both read at start and update at wrap-up; it holds the ACTIVE priority, the last 5 decisions, and open threads. -2. (Once Build Spec Phase 1 lands, also check TriLane Memory for new research_insights.) +## Current State (embedded — always in context) -At wrap-up: update `context/current-state.md` with what you did and the next priority. +**ACTIVE:** Build Spec Phase 2 DESIGNED — session-brain auto-write + insight extraction spec ready for Claude Code. +**NEXT:** Claude Code builds Phase 2 (modify navaigate-session-brain SKILL.md). Pi stands by for verification. + +**Open threads (at wrap-up):** + +- LabABLE Meeting Fri 2026-06-26 1:30 PM — /pilot-prep. +- Build Spec Phase 2: Claude Code building now. Pi verifies after. +- TRUST FIXES STAGED: docs/compliance/privacy-policy.md (7yr→6yr, false BAA claim). Waiting Kisa go-ahead. +- 3 validation product blockers: MA misclassification, duplicate patient_id, doc-status override. +- Primary domain sttilsolutions.com still "Pending" in Clerk (non-blocking for auth). + +**At session START:** use this section for state. Then read `context/current-state.md` for the full shared state (decisions, stack details). +**At WRAP-UP:** update this section AND `context/current-state.md` (keep both in sync). ## Core Value Proposition + Shifts supplier staff time from reactive (appeals after denial) to proactive (preventing denial conditions). The workload curve: appeals volume drops over time as proactive @@ -24,6 +35,7 @@ coverage management replaces it. Outreach volume starts manageable and stays predictable. ## PHI Architecture — Non-Negotiable + - STTIL never stores patient names, SSNs, DOBs, or contact info - Sole crosswalk key: patient_id (DME's internal MRN or account #) - DME staff maintain the patient_id ↔ real identity mapping locally @@ -31,19 +43,22 @@ and stays predictable. quantity, payer — NOTHING else - All logs use hashed patient_id, never raw -## Current Stack (Updated 2026-05-29) -- Backend: Railway (Python/FastAPI) — live at https://signal-api-production-91c2.up.railway.app +## Current Stack (Updated 2026-06-22) + +- Backend: Railway (Python/FastAPI) — live at - Database: Supabase (PostgreSQL + RLS policies + Third Party Auth with Clerk) -- Auth: Clerk — app name: eternal-goblin-1, domain: eternal-goblin-1.clerk.accounts.dev -- Frontend: Vite/React (signal-ui) — local dev only at localhost:5173, NOT YET deployed publicly +- Auth: Clerk — production key deployed. Frontend: `pk_live` on Vercel. JWKS: `clerk.sttilsolutions.com/.well-known/jwks.json` on Railway. +- Frontend: Vite/React (signal-ui) — deployed at - Orgs in Clerk: STTIL Solutions (default), Gaboro DME (org_3EPAEcAw06V2yGMSkxE3UjqIA3c) ## Run Commands + - Frontend (local): `cd signal-ui && pnpm dev` → localhost:5173 - Backend deploy (code change): `railway up --detach` from project root — forces fresh build - Backend redeploy (no code change): `railway redeploy` — reuses existing image ## Active Files + - signal-ui/src/App.jsx — Clerk auth gate, OrganizationSwitcher - signal-ui/src/components/WorklistTable.jsx — main worklist display - signal-ui/src/components/CSVImport.jsx — CSV upload @@ -57,16 +72,19 @@ and stays predictable. - python-backend/config/payer_rules.json ## Known Bugs — Fix Before Pilot + 1. ~~**Payer matching**~~ — FIXED 2026-05-29. `_normalize_payer()` added to `coverage_calculator.py`. Handles: "Medicare Part B" → medicare, "Tricare for Life" / "TFL" → medicare, "Medicaid - GA" → medicaid, commercial insurer names → commercial. 2. **Visit date**: coverage_calculator.py uses shipment_date as proxy for qualifying visit, not an actual visit date. Fix: use stored confirmed visit date when available; fall back to shipment_date - 30 days labeled as estimated. ## Features Not Yet Built — Pilot Priority + - **Confirm Visit workflow**: staff button on each worklist row to record a confirmed visit date. Signal stores it against patient_id in Supabase. This is Signal's core persistent value — without it, visit dates never improve beyond estimates. -- **Frontend public URL**: DEPLOYED 2026-05-29 — https://signal-ui-xi.vercel.app +- **Frontend public URL**: DEPLOYED 2026-05-29 — - **25 CSV variant test suite**: whitepaper requirement. Generate and test 25 mock CSVs with different column orders, headers, date formats, and payer name variants. - **Mapping review interface**: confidence score display, user override dropdown per column (per whitepaper spec). ## Pilot Readiness — Authoritative Gauge + **Progress is measured against the whitepaper checklist only. Do not estimate % from feel.** Whitepaper: `/Users/sttil-solutions/Documents/Obsidian_Vault/STTIL-Vault/Projects/2026-05-18-pilot-readiness-whitepaper.md` @@ -75,7 +93,7 @@ Whitepaper: `/Users/sttil-solutions/Documents/Obsidian_Vault/STTIL-Vault/Project | Checklist Item | Status | |---|---| -| App hosted behind stable URL | PASS — https://signal-ui-xi.vercel.app (deployed 2026-05-29) | +| App hosted behind stable URL | PASS — (deployed 2026-05-29) | | Demo login / controlled access working | PASS | | Synthetic sample data loads end to end | PASS — verified as Gaboro DME org 2026-06-10 | | 25 CSV variants pass ingestion tests | PASS — 50 new files generated (PA + NJ sets), 100% normalizer pass rate 2026-06-07 | @@ -123,7 +141,7 @@ This checklist tracks compliance gates separately from build readiness. Update i | Compliance Item | Status | |---|---| -| Privacy Policy published at stable public URL | PASS — privacy-policy.md written 2026-06-07; Privacy.jsx deployed to https://signal-ui-xi.vercel.app/privacy | +| Privacy Policy published at stable public URL | PASS — privacy-policy.md written 2026-06-07; Privacy.jsx deployed to | | FDA CDS exemption memo written and attorney-reviewed | NOT DONE | | Supabase plan tier confirmed (Pro vs Team) and PHI posture documented | PASS — Pro plan confirmed 2026-06-10 ($25/mo). HIPAA available as paid add-on on Team ($599/mo) — deferred to post-funding per Real PHI gate. Pro is correct posture for pilot. | | Pilot LOI reviewed by attorney | PARTIAL — template ready; Bittinger/Nixon review pending | @@ -170,6 +188,7 @@ This checklist tracks compliance gates separately from build readiness. Update i | Consortium strategy | 18-24 months | Need 15+ paying Level 1 suppliers first | ## Instructions for Claude Code Sessions + - Work only on pilot-scope items from the checklist above - Never suggest adding PHI fields beyond patient_id - Flag any vendor integration that would require a new BAA diff --git a/context/current-state.md b/context/current-state.md index e92c998..bd01eee 100644 --- a/context/current-state.md +++ b/context/current-state.md @@ -5,16 +5,17 @@ NEXT: Claude Code builds Phase 2 (modify navaigate-session-brain SKILL.md). Pi ## Decisions (last 5) +- 2026-06-22: Trust-fix scope clarified. The LIVE privacy page (Privacy.jsx at /privacy) is ALREADY correct: 6-year retention plus the soft "a BAA may not be required" language. The false "executed BAA" claim and the 7-year retention number survive ONLY in the internal shareable doc docs/compliance/privacy-policy.md (lines 88, 76). Doc-only fix, no redeploy. Exact edits staged in Open Threads. - 2026-06-22: Clerk prod migration COMPLETE — frontend (pk_live on Vercel) + backend (CLERK_JWKS_URL → clerk.sttilsolutions.com on Railway) both deployed. DNS verified, JWKS serving. - 2026-06-21: Subagent cost guardrails installed — all 8 builtin subagents default to deepseek/deepseek-v4-flash with 2-5 min hard timeouts. - 2026-06-21: Audit logger trust fix committed + pushed (Supabase client detection, error wrapping). Cascade test assertion corrected. -- 2026-06-21: SIGNAL_API_KEY rotated by Claude Code. Leaked key removed from Vercel + source. Exposure closed. - 2026-06-21: Build Spec Phase 1 done (Claude Code). research_insight category live. CGM-to-pharmacy insight planted. ## Open Threads (max 5) - LabABLE Meeting Fri 2026-06-26 1:30 PM — run /pilot-prep. -- Build Spec Phase 2: spec written at signal/docs/superpowers/specs/2026-06-22-build-spec-phase2.md. Ready for Claude Code to build. +- Build Spec Phase 2: spec at signal/docs/superpowers/specs/2026-06-22-build-spec-phase2.md. Claude Code building now (modify navaigate-session-brain SKILL.md). Pi stands by for verification. +- TRUST FIXES STAGED (ready, awaiting Kisa go-ahead): docs/compliance/privacy-policy.md line 76 "7 years" becomes "a minimum of 6 years, consistent with 45 CFR §164.530(j)"; HIPAA section (lines 86-90) replace the "has executed a BAA" paragraph with the live-page posture ("designed so the data is not PHI"; "a BAA may not be required, consult your own compliance advisors"). Doc-only, no redeploy. Live Privacy.jsx already correct. - 3 validation product blockers: MA misclassification, duplicate patient_id, doc-status override (Claude Code is on these). - Primary domain sttilsolutions.com still "Pending" in Clerk (separate from Frontend API — non-blocking for auth). @@ -32,4 +33,4 @@ NEXT: Claude Code builds Phase 2 (modify navaigate-session-brain SKILL.md). Pi TriLane Memory now has the `research_insight` category live + 1 planted insight (CGM-to-pharmacy, salience 1.0) in the Signal workspace. Session summaries no longer leak into the Signal workspace; they live in the Sessions workspace. -## Updated: 2026-06-22 (Pi: Clerk migration done, Phase 2 spec written, ready for Claude Code build) +## Updated: 2026-06-22 (Pi: Clerk migration done, Phase 2 spec written. Claude Code: trust-fix nugget captured pre-cache-clear; building Phase 2 next.)