Integrations and safe changes
This page lists the services that the workflow uses, the configuration names, the invariants, and the tests for each type of change.
| Term | Meaning |
|---|---|
| Integration | An external service or library that the workflow calls. |
| Boundary | The limit that the workflow puts on one integration. |
| M2M route | A machine-to-machine route. A service key authorizes it, not a user session. |
| Invariant | A rule that every change must keep true. |
| Read-back | A check that reads the registry after the write. |
Integrations
Section titled “Integrations”| Integration | Use | Boundary |
|---|---|---|
| Privy | Session and optional attribution | The service key authorizes the M2M routes. |
| PostgreSQL/Drizzle | Metadata, drafts, audit, queues | It holds protected clinical data. |
| R2 | Encrypted originals | Decrypt only after the scope check. |
| pg-boss | Extraction, dead letter, submission | Workers run only when the queue is enabled. |
| Nebius | Structured extraction | De-identification is not a guarantee. |
| RheumAI audit proxy | Grade, or send for review | It cannot approve or register. |
| Clinician agent | Inventory and extraction for one clinician | It cannot approve or submit. |
| Tenki | Playwright microVM | It requires explicit configuration and outbound access. |
| BIOBADAMEX | crdA–crdE form | The map does not cover every control. |
Configuration names
Section titled “Configuration names”This list gives names only, never values:
BIOBADAMEX_QUEUE_ENABLEDBIOBADAMEX_REGISTRY_SUBMIT_ENABLEDNEBIUS_API_KEY,NEBIUS_BASE_URL- the M2M intake key and the optional
BIOBADAMEX_INGEST_MEDIC_ID BIOBADAMEX_AUDIT_API_KEY- the clinician-agent key and the configured
onBehalfOfclinician - the R2 variables and the encryption master key
- the Tenki token, image and workspace
- the registry base URL and credentials
Invariants
Section titled “Invariants”- Check the owner before R2 decryption.
- Keep
agentRecordimmutable. - Calculate DAS-28 and the missing fields again after a correction.
- Do not convert
unknownto zero orfalsein general. - Keep approval separate from submission.
- At submission, check ownership, state, missing fields, confirmation and flag again.
- Use the map version of the payload.
- Do not treat
idpacand summary as field-level read-back. - Keep study data separate from the clinical workflow.
- Documentation never authorizes a deploy, a migration or an external write.
Change and test map
Section titled “Change and test map”| Change | Files | Minimum verification |
|---|---|---|
| Intake | intake/uploads | intake, batch, upload tests |
| Extraction | extract/config | extractor, failure, schema tests |
| Tri-state/completeness | registry package | full registry suite |
| Review/correction | drafts + UI | draft and preview tests, web typecheck |
| Queue | queue/jobs | jobs, dead letter, lifecycle |
| Map/worker | map/resolver/filler/driver | registry and worker suites; bundle |
| Submission | submit + Tenki | mocks only; never a live submission |
| Audit/agents | audit/agent | fail-closed keys, scope, no external write |
Observed validation
Section titled “Observed validation”pnpm --filter @poktahealth/biobadamex-registry testpnpm --filter @poktahealth/biobadamex-registry-worker testpnpm --filter @poktahealth/api test -- <focused files>pnpm exec turbo run typecheck --forceAt the documented commit, all of these passed:
- registry: 190 tests
- worker: 41 tests
- focused API: 156 tests
- forced typecheck: 12 tasks
No migrations, deployments, clinical queries or registry writes ran.
Risks that must stay visible
Section titled “Risks that must stay visible”- The extraction queue payload holds plaintext clinical text.
- De-identification is best effort.
- The approval checklist is mainly client-side.
- Filling of nonfatal fields is best effort.
- The external map is incomplete and has ambiguities.
- There is no field-by-field read-back.
- Registry submission has no specific retry policy.
- Clinician-facing descriptions in the pipeline config are pending.