Skip to content

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.
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.

This list gives names only, never values:

  • BIOBADAMEX_QUEUE_ENABLED
  • BIOBADAMEX_REGISTRY_SUBMIT_ENABLED
  • NEBIUS_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 onBehalfOf clinician
  • the R2 variables and the encryption master key
  • the Tenki token, image and workspace
  • the registry base URL and credentials
  1. Check the owner before R2 decryption.
  2. Keep agentRecord immutable.
  3. Calculate DAS-28 and the missing fields again after a correction.
  4. Do not convert unknown to zero or false in general.
  5. Keep approval separate from submission.
  6. At submission, check ownership, state, missing fields, confirmation and flag again.
  7. Use the map version of the payload.
  8. Do not treat idpac and summary as field-level read-back.
  9. Keep study data separate from the clinical workflow.
  10. Documentation never authorizes a deploy, a migration or an external write.
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
Ventana de terminal
pnpm --filter @poktahealth/biobadamex-registry test
pnpm --filter @poktahealth/biobadamex-registry-worker test
pnpm --filter @poktahealth/api test -- <focused files>
pnpm exec turbo run typecheck --force

At 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.

  • 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.