Platform Architecture

Single source of truth for the Stratum platform โ€” the precedent-based denial intelligence infrastructure that backs the registry API, the customer dashboard, and the regulated-data substrate behind it. Phase 1 scope is precedent object storage and versioning; this page documents the live deployment surface, the read-only registry endpoints exposed to the web, the AWS posture that holds PHI extracts and audit logs, and the compliance controls that underpin both.

ActiveLast reviewed 2026-04-28 ยท Repo stratum-platform/

The customer-facing platform runs on Cloudflare Workers (frontend) and Fly.io (API + DB). It serves de-identified data only โ€” no PHI flows through this stack.

Frontend โ€” Cloudflare Workers
LIVE ยท OPENNEXT
Next.js app deployed to Cloudflare Workers via OpenNext. Worker name sc-platform-pages. Custom domain platform.stratumcollective.co. Not a Pages project โ€” do not reconnect.
push to main โ†’ .github/workflows/deploy-web.yml โ†’ npx wrangler deploy
API โ€” Fly.io
LIVE ยท SJC
Express + TypeScript service at stratum-platform-api.fly.dev, sjc region. Serves registry endpoints and Phase 1 precedent storage. Authentication: Auth0 JWT bearer (Phase 2A โ€” live); X-User-Id header is dev/test-only fallback.
Database โ€” Postgres on Fly
LIVE ยท POSTGRES 16
Managed Postgres 16 on Fly.io as sc-platform-db. Multi-tenancy via tenant_id filter on every query. Soft-delete only โ€” 7-year HIPAA retention.
Repo โ€” stratum-platform
REPO ยท PHASE 1
Express/TypeScript API + Postgres. Phase 1 = Precedent Object Storage & Versioning Infrastructure. CloudFormation template for AWS re-activation lives at stratum-platform/infra/cloudformation.yml.

Read-only registries loaded at startup by stratum-platform/src/registries/index.ts and exposed publicly (no authentication). Source of truth for endpoints lives in stratum-platform/docs/03-API-REFERENCE/ENDPOINTS-REGISTRIES.md; the table below mirrors that spec.

Domain Endpoint Purpose
Payer IntelligenceGET /registries/payersPayer roster with family roll-up, state coverage, plan tiers.
Payer IntelligenceGET /registries/payers/:family/profilePer-family payer profile โ€” denial signals, appeal posture.
Payer IntelligenceGET /registries/ma-payersMedicare Advantage payer registry.
Denial & Appeal PatternsGET /registries/denial-reasonsDenial reason codes, clustering, clinical severity, overturn rates.
Denial & Appeal PatternsGET /registries/appealsAppeal outcomes corpus โ€” precedent records and rationale.
Denial & Appeal PatternsGET /registries/inappropriate-denial-patternsPatterns flagged as systemically inappropriate (parity, NQTL).
State & RegulatoryGET /registries/statesState-level BH regulatory index.
State & RegulatoryGET /registries/states/:statePer-state detail โ€” parity laws, PA requirements, mandated LOC.
State & RegulatoryGET /registries/parity-trackerMental health parity enforcement actions and findings.
State & RegulatoryGET /registries/nqtl-violationsNQTL violations registry โ€” non-quantitative treatment limits.
Clinical & Medical NecessityGET /registries/criteriaMedical necessity criteria โ€” ASAM, LOCUS, MCG, InterQual references.
Clinical & Medical NecessityGET /registries/cms-coverageCMS coverage determinations โ€” NCDs, LCDs.
Clinical & Medical NecessityGET /registries/x12-denial-codesX12 835/277 denial code reference.
Research & PrecedentsGET /registries/researchPeer-reviewed evidence registry for appeal support.
Research & PrecedentsGET /registries/precedentsPrecedent records โ€” cross-payer, cross-state appeal outcomes.
Pipeline. Ingest โ†’ Validate (PHI/SUD) โ†’ Aggregate โ†’ Mint Credits โ†’ Publish. Marketplace gate: 2+ distinct tenants required per cluster before exposure.

Decision recorded 2026-04-16. AWS account 947073314047, region us-west-2, BAA active since 2025-12-23 (customer-agreement-S951Sgj1601wcNeR). The platform app does not run on AWS โ€” Fly.io serves all real traffic. AWS is the regulated-data substrate and a cold-but-ready compute target for any enterprise customer whose procurement requires AWS hosting. Re-activation from the CloudFormation template takes ~2 hours.

Always-On (Substrate)

  • S3 ยท phi-uploads-dev-stratumcollective, phi-sanitized-dev-stratumcollective โ€” KMS-encrypted, versioned, public-access blocked, TLS-only + SSE-required policies.
  • S3 audit ยท stratum-cloudtrail-947073314047 โ€” AES-256, TLS-only, 7-year retention (Glacier at 90d).
  • CloudTrail ยท stratum-multiregion-trail โ€” multi-region, log-file validation enabled, S3 data events on PHI/audit buckets.
  • GuardDuty ยท detector 8ececbd592d7615d75c985ec6e7dd586 โ€” S3 log monitoring, 15-min finding frequency.
  • KMS ยท alias/aws/rds, alias/aws/s3 (AWS-managed). CMK migration available if compliance escalates.
  • IAM ยท Stratum-Admin with U2F MFA. No service accounts.
  • ECR ยท stratum-api repository โ€” Docker images preserved for re-activation.
  • CloudFormation ยท stratum-platform/infra/cloudformation.yml โ€” single-source re-activation template.

Cold (Re-creatable in ~2h)

  • App Runner ยท stratum-api-production โ€” deleted 2026-04-16 via CloudFormation stack delete. ~$60โ€“80/mo saved.
  • RDS ยท stratum-production โ€” deleted with snapshot retained as stratum-production-final-20260416-1219.
  • Re-activation runbook ยท compliance/aws-app-runner-reactivation.md โ€” when to re-activate, CloudFormation re-deploy, custom domain attachment, data-sync options, cost expectations.
  • Trigger ยท enterprise customer procurement requirement, or PHI-bearing analysis workload that benefits from in-AWS compute.
Why B3 over a dual-stack. The dual-API-stack we ran through 2026-04-16 (Fly.io serving real traffic, AWS App Runner frozen at a March image with a stale DB) paid the cost of AWS compute without delivering optionality โ€” re-activation is equally easy from the CloudFormation template either way. B3 keeps the optionality, drops the cost, and removes the misleading idle endpoint.

The current platform handles only de-identified data on Fly.io. PHI is confined to AWS S3 buckets covered by the BAA, encrypted with KMS, and audited via CloudTrail. PHI export from the API uses HIPAA Safe Harbor de-identification (45 CFR 164.514(b)(2)) โ€” all 18 identifiers stripped on export; inbound 422-rejection guard currently covers 10/18 (full coverage tracked as Phase 2B work).