Canonical source:
docs/architecture/feature-master-summary.md. This page is the published mirror.
Feature Master Summary — Data Activation, Hospital Twin & HDAP
One-page catalogue of the data-activation / decision-intelligence feature arc. For the deep design + gaps + rollout, read
data-activation-twin-go-live-master.md(this is the index over it). Status as of 2026-06-04.
Where it sits (platform map)
| Thing | Home | Reach |
|---|---|---|
| HORUS command center (lenses) | @ever-medos/intelligence-kit → src/horus/ | /horus (route) |
| Hospital Decision Twin (one HORUS lens) | …/horus/twin/ | /horus?lens=twin · sandbox ?target=Twin |
| Twin decision-flow (ReactFlow) | …/horus/twin/flow/ | inside the twin lens |
| HDAP — Health Data Activation Platform (admin) | web/src/pages/admin/hdap/ + AdminRoutes.tsx | /admin/hdap |
| Sync-health contract / upload | @medos/integration-kit | HDAP › Data Activation |
| Migration mapping review / crosswalks | @migration-kit | HDAP › Migration Review |
| Read-model + RPCs + edge fns | infrastructure/medbase/ | (backend) |
Feature catalogue
| Feature | What it does | Status | Key files |
|---|---|---|---|
| Live twin calibration (A/B) | Twin reads real read-model data (LOS, arrivals, occupancy, revenue, readmit, post-op) via a metric→RPC registry; fail-soft to seed | Shipped · deploy-gated for live data | twin/readers/index.ts; migs 20260604d, 20260604e |
| Agent fidelity labels (E) | TwinAgent.dynamics (des/projection); UI badges "2 modeled (DES) · 5 projection" | Shipped | twin/agents/*, TwinWorkspace.tsx |
| Sync-health emitter (C) | Per-connector HMAC secret; in-cloud self-populate of readiness; air-gapped upload screen | Shipped · deploy-gated | ingest-sync-health, mig 20260604f, integration-kit SyncHealthUpload |
| Migration onboarding (D) | Crosswalk gap-report + mapping-review HITL gate (reds must be confirmed) | Shipped | @migration-kit/crosswalk/* |
| HDAP admin section | Hub (Bento) + Data Activation + Migration Review + Decision Protocols; nav category | Shipped | src/pages/admin/hdap/*, AdminRoutes.tsx, SuperAdminDashboard.tsx |
| Management decision protocols | 7 governance protocols (readiness gate, live-vs-estimated, HITL chain, recommender-only AI, residency, mapping-confirm, escalation) + notes pad | Shipped | hdap/decision-protocols.tsx |
| HDAP ↔ HORUS wiring | Bidirectional: HDAP → /horus?lens=twin; HORUS header → /admin/hdap | Shipped | hdap/index.tsx, HorusShell.tsx |
| Twin decision-flow | ReactFlow decision DAG: lifecycle spine (history/step-back) + sign-off gates (paint-next → approve); commit locked until the gate passes | Shipped | twin/flow/decision-graph.ts, DecisionFlow.tsx |
| Decision-flow persistence | Durable audit trail: status + sign-offs + append-only event log via a service-role edge fn; fail-soft to in-memory | Shipped · deploy-gated | twin/flow/persistence.ts, twin-decision, mig 20260604g |
| CN/AU market packs + adapters (F/G/I) | medos-australia pack; CN/AU source-HIS adapter packs; AU Medicare/ECLIPSE connector — scaffolds, placeholders flagged | Shipped (scaffold) | market-packs/medos-australia/*, adapters/{neusoft,winning,bsoft,trakcare}/*, connector-packs/au-medicare-eclipse.json |
| Residency / compliance posture (H) | CN (PIPL/CSL/DSL) + AU (Privacy Act/APP/NDB) posture; "verify with counsel" | Shipped (doc) | multi-country-residency-compliance.md |
Migrations (all manual-deploy — medbase is not auto-applied)
| Migration | Adds |
|---|---|
20260604a | sync model: sync_run · sync_event (hash-chain) · sync_health_aggregate · twin_readiness_v |
20260604b | bed_occupancy_spans view (twin capacity calibration) |
20260604c | twin_* persistence (twin_initiatives, twin_signoffs, …) |
20260604d | twin_metric_los_days() RPC |
20260604e | calibration RPC suite (arrivals / occupancy / revenue / readmit / post-op) |
20260604f | twin_rollup_sync_health() (in-cloud readiness self-populate) |
20260604g | twin_decision_events (append-only decision audit) |
Edge functions
| Function | Role | Deploy |
|---|---|---|
ingest-sync-health | receive de-identified SyncHealthSummary (HMAC, PHI guard) → sync_health_aggregate | supabase functions deploy ingest-sync-health |
twin-decision | persist a decision transition (status + sign-offs + audit event), service role | supabase functions deploy twin-decision |
Test inventory (45 jest/RTL, all green)
twin-engine.test.ts (16) · decision-graph.test.ts (7) · persistence.test.ts (3) · SyncHealthUpload.test.tsx (3) · gap-report.test.ts (3) · MappingReviewPanel.test.tsx (2) · market-pack-manifests.test.ts (7) · HdapHub.test.tsx (2) · DecisionProtocols.test.tsx (2). Plus esbuild parse + sandbox render checks (?target=Twin).
Deploy checklist (to activate live)
- Apply migrations
20260604a → 20260604g(psql / SQL editor). - Deploy edge fns:
ingest-sync-health,twin-decision. - Seed per-connector sync-health secrets (
coding_connectorsmodule='sync-health'). - Seed a
twin_initiativesrow titled'Cardiac step-down'to activate decision persistence. - Ship frontend: push
main → release(Vercel builds thereleasebranch only). - (CN/AU) stand up in-region stacks + load licensed terminology before any real-data use.
Still deferred (not auto-doable)
- Per-role guard on
/admin/hdap— needs the confirmeduseAuth().userrole-field shape (today: authenticated-only viaProtectedLayout). - Real licensed data for CN/AU (SNOMED-CT-AU, MBS/PBS, ICD-10-CN, YBM) + real connector endpoints + vendor schema verification.
- In-region stacks (CN: China region + ICP + domestic LLM; AU:
ap-southeast-2) + legal sign-off. - Live E2E per market once a region's stack + data are deployed.
Commit trail (origin/main, this arc)
feat(twin): live calibration RPCs (A/B) + agent fidelity (E) → feat(sync-health): per-connector secret + in-cloud rollup + upload (C) → feat(migration): crosswalk gap-report + mapping gate (D) → feat(market-pack): AU pack + CN/AU adapters + connector + residency (F–J) → feat(hdap): admin section + decision protocols → feat(hdap): bidirectional HDAP↔HORUS → feat(twin): decision-flow (ReactFlow) → feat(twin): persist the decision journey.