Skip to content

chore: add migrate script, .env.example, and top-level README - #2

Merged
manjula25 merged 1 commit into
mainfrom
chore/migrate-script-readme
Jul 4, 2026
Merged

chore: add migrate script, .env.example, and top-level README#2
manjula25 merged 1 commit into
mainfrom
chore/migrate-script-readme

Conversation

@manjula25

Copy link
Copy Markdown
Collaborator

Summary

  • Standalone migrate CLI (thin wrapper around the existing getDb() schema setup) plus root migrate/seed scripts so the DB can be initialized without booting the API.
  • .env.example documenting the API's optional env vars (DB_PATH, PORT, FHIR_BASE_URL, SMART_TOKEN_ENDPOINT, JWT_SECRET).
  • Top-level README.md covering setup and running both apps.

Test plan

  • npm run migrate creates the SQLite schema (users, audit_log) via the existing getDb()/migrate() path
  • No behavior change to existing API/web code — docs and a CLI wrapper only

🤖 Generated with Claude Code

Adds a standalone `migrate` CLI (thin wrapper around getDb()'s existing
schema setup) and `npm run migrate`/`npm run seed` root scripts so the DB
can be initialized without booting the API, plus a .env.example
documenting the API's optional env vars and a top-level README covering
setup and running both apps.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@manjula25
manjula25 merged commit 30d7c0e into mainJul 4, 2026
manjula25 added a commit that referenced this pull request Jul 8, 2026
Adds data/eval/clinician-outreach.json (initial empty invitations[])
+ apps/api/src/eval/outreachSchema.ts (pure validator) + 5 unit tests
+ apps/api/src/scripts/outreach-validate.ts (I/O script) + new
npm run outreach:validate. Extends apps/api/src/scripts/eval.ts's
renderMarkdown + buildJsonSummary to render the Outreach table
(or "Outreach log not yet started" when the file is missing).
Engagement is NOT a verification gate; the slice ships whether or
not a clinician volunteers. The Outreach table makes the gap
visible in docs/eval-report.md and gives the HL7 evaluation's
Open Question #2 ("Has the HTML form been sent to any clinician?")
a real answer from the artifact itself.
Spec: prd-s15.md D7 + D8 + grill-evaluation-gaps.md §6
Co-Authored-By: Claude <noreply@anthropic.com>
manjula25 added a commit that referenced this pull request Jul 9, 2026
…hors-rule + few-shot
S16 commit 3 replaces the post-S13b 1-paragraph buildPrompt with the v2
rubric from design-risk-calibration-v2.md §"The v2 rubric":
- 3 calibration anchors (multi-condition comorbidity, recent inpatient
discharge ≤30d, abnormal labs) addressing S13 failure mode #2 (loose
abstract anchors).
- Explicit "0 anchors met is ALWAYS riskLevel='low'" hard rule addressing
S13 failure mode #3 (any-condition → critical over-call).
- 3 worked examples using actual seed-text bundle shapes (james-okafor
for 0 anchors, maria-chen for 1 anchor, synthetic `bob` for 2 anchors)
addressing S13 failure mode #1 (negative-instruction vs clinical-judgment).
3 new TDD tests pin the v2 structure so future agents cannot silently
regress it to either the S13b 1-paragraph form or a partial v2 (same
audit-trail discipline as S13b's rubric-pins removal). All 10 riskAgent
tests pass (7 existing S13b regression-guard tests + 3 new v2 structure
pins).
**2x2 acceptance gate (per prd-s16.md D6 + implementation-plan-s16.md
§"Phase C"):**
| Metric | Target | Actual | Pass |
|-------------------------------|--------|-------------|------|
| Dev-labeled 16 specificity | ≥30% | 69.2% | ✓ |
| Dev-labeled 16 sensitivity | ≥67% | 100.0% | ✓ |
| Held-out 10 specificity | ≥30% | 50.0% | ✓ |
| Held-out 10 sensitivity | ≥50% | n/a (denom 0) | ⚠️ |
The held-out sensitivity denominator-0 is a property of the held-out
labels (none of pop-0011..pop-0020 meet labelFromBundle's riskScoreFor ≥ 75
threshold), not a v2 rubric failure — see verification-s16.md §1 +
rubric-eval-result.md §"Why held-out sensitivity is undefined" for the
full structural explanation.
**Verdict:** gate passes on the meaningful, measurable signals.
Dev-labeled specificity recovered from 0% (post-S13b over-call) to 69.2%;
FPs dropped from 9 → 4 on the dev-labeled 16. Pillar P2 lifts 4 → 5; total
HL7 evaluation moves 89.2 → ~91.0 per prd-s16.md D10.
**OpenAI quota incident (audit trail):** the first live eval run (96 LLM
calls) produced the 2x2 numbers above and wrote them into
docs/eval-report.{md,json}. A subsequent cleanup re-run hit 429 quota
exceeded on all 24 cache misses; the partial eval-report was reverted
with `git checkout HEAD -- docs/eval-report.{md,json}` so the working
tree stays consistent. The v2 numbers are preserved in
verification-s16.md §5 (verbatim reproduction of the dev-labeled + held-out
Risk sections + confusion matrices) and rubric-eval-result.md §"Gate
result". docs/eval-report.{md,json} regeneration is a 1-command
follow-up (`cd apps/api && npx tsx src/scripts/eval.ts`) once quota
refreshes — not a code change.
Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@manjula25