VERA™ Analysis Implementation and Laboratory Handover
Version 1.1 | 5 September 2026 | PREPAIRE and GenetiQ
1 Purpose and decision
This handbook gives the IRENA laboratory and Gauss engineering team the implementation boundary, software choices, operating sequence and evidence needed to connect AXIOM instrument data to the personalized twin. It accompanies the revised AXIOM VERA application. Its purpose is to make laboratory evidence replayable, normalized and independently reviewable before the knowledge graph uses it.
The immediate build order is short-read whole-genome sequencing and shotgun metagenomics, followed by the exact methylation, pharmacogenomics and quantitative assay contracts. Preserve native evidence, retain vendor-supported acquisition and decoding where necessary, and replace downstream interpretation only within a validated scope. There is no scientific basis here for an automatic switch to an in-house engine at 11,000 participants. That number is a planning hypothesis, not an analytical acceptance criterion.
This is an implemented software integration baseline, not a certified diagnostic system or a completed physical installation. The code can validate real evidence packages and submit governed workloads when its operational infrastructure is configured. No clinical result, live instrument connection, software license, model accuracy or laboratory qualification is implied by a successful web build.
2 Source reconciliation
The supplied prepaire-kg-schema bundle is the semantic reference. Its L0 schema, fact schema and namespace catalog are retained unchanged in contracts/prepaire-kg-v1. VERA adds a stricter admission profile around those schemas. L0 records retain identity, assay, software, references, parameters, QC and custody. Typed facts retain their biological meaning rather than forcing genomic calls, microbial abundance and clock estimates into a blood-result shape.
The AXIOM document supports longitudinal personalization and cross-system analysis. It does not supply a complete, signed, machine-readable manifest of every claimed marker. The stated 1,200-plus coverage must therefore be reconciled against an assay catalog containing analyte, specimen, method, unit, measurement type, reportable range, intended use, validation and instrument scope. The application does not invent that catalog.
The equipment workbook contains seven rows: Roche cobas i601, Roche e402/c303, ONT PromethION 48, Illumina iScan, MGI DNBSEQ T20, Sysmex UN5000 and Element AVITI24. Earlier owner additions include PacBio Revio and Sysmex XR1000. The registry consequently supports nine instrument families. The laboratory must identify the exact seven installed serial-number/assay combinations intended for first activation. A family count is not a physical connection count.
The supplied KG bible separates a shared reference graph from private patient evidence. This revision preserves that boundary: patient facts go to a patient evidence graph, not the public biological reference graph. The supplied intelligence-layer architecture also separates patient knowledge, cohort aggregates and model-weight updates. A new specimen creates a new evidence event; it never silently retrains a production model.
The older AutoPilot ZIP was treated as a prototype reference, not a source of production patient data or clinical logic. Existing VERA custody, software governance, instrument activation and release controls were retained. A packaging defect was found: an unanchored artifacts ignore rule excluded four critical upload APIs from Git. The rule is now root-anchored and a CI guard checks that those routes are tracked.
3 Architecture and ownership
The data path is:
LIMS work order -> pseudonymous specimen and aliquot identity -> completed instrument export -> immutable native vault -> approved decoder when required -> QC and analytical tools -> typed normalization -> independent release -> private KG evidence -> governed twin interpretation.
The instrument remains responsible for acquisition, calibration, safety interlocks and supported native export. VERA Edge captures completed data read-only. The control plane stores identities, workflows and approvals in PostgreSQL. Object storage holds versioned, checksummed evidence under the configured retention policy. A separate verifier recomputes hashes. Kubernetes or TES runs approved workloads. The release service reconciles the output to its run before a KG service can retrieve it.
The Spark attached to an instrument is an edge compute and capture node, not replacement firmware. It may run compatible analytical stages; incompatible or oversized stages must run on a qualified server. NVIDIA documents DGX Spark as an ARM-based system with shared memory. Memory shared with the GPU is not an additional independent RAM pool. Container compatibility, GPU support, storage bandwidth and throughput must be benchmarked on the installed system. Do not advertise seven Sparks as a proven capacity plan for 50,000 participants. See NVIDIA hardware documentation.
Each pipeline stage now declares architecture, CPU, memoryGiB, scratchGiB and gpuCount. Kubernetes uses these values as resource requests and limits plus an architecture selector. The current TES adapter supports explicit amd64 CPU jobs only; it rejects ARM or GPU requests until a backend-specific resource mapping is qualified. Large workflow systems such as Nextflow and WDL require their own managed orchestration adapter or individually registered stages. The included wrapper does not run a nested Docker daemon.
4 Analytical software selection
No program is universally best across instruments, specimen types and intended uses. The choices below are candidates for local qualification. Freeze the exact release, OCI digest, CPU architecture, model weights, reference database, parameter set and license before benchmarking. Mutable latest tags are not release identities.
Whole genome sequencing
For MGI and AVITI short reads, retain their supported raw-data decoder and FASTQ. Use the established BWA-MEM2/DeepVariant route as an open comparison baseline, with GATK as a separately labelled caller where justified. nf-core/sarek is the recommended reusable workflow framework for the compatible QC, alignment, variant calling, normalization and annotation stages. Select its modules explicitly: its optional consensus mode is not permission to average or collapse callers. The existing accelerated Parabricks candidate remains conditional on local equivalence, license and hardware qualification. See nf-core/sarek.
For Revio HiFi, use the supported PacBio HiFi-human-WGS-WDL release with its complete dependency lock. The upstream project currently documents release v4.0.0, distinct workflow entrypoints and substantial resource requirements; budget per stage rather than assuming everything fits on an edge node. It is a reusable implementation, not an independent clinical certification. See PacBio workflow.
For ONT, preserve POD5 and use a chemistry-matched, explicitly pinned Dorado model plus a qualified downstream human-variation workflow. Do not pool its validation with short-read or HiFi data. Retain methylation tags, phasing, read-level evidence and platform-specific limitations when they are in scope.
Small variants, structural variants, copy-number changes, repeat expansions, mitochondrial variants, HLA and complex pharmacogenes require different evidence and callers. A VCF is already a derived product; it is not raw reads. A missing VCF site is not a negative result. A normalized small-variant table does not prove complete WGS coverage. Full callsets, alignments and callability masks remain in object storage; the graph receives qualified features and references to that evidence.
Shotgun metagenomics
Use a pinned host-depletion/QC workflow, MetaPhlAn for the candidate canonical relative taxonomic profile, Kraken2 with matching Bracken as an independent comparison, and HUMAnN for functional profiling. nf-core/taxprofiler is the recommended reusable orchestration framework for compatible short- and long-read profiling stages; HUMAnN is a separate functional lane. See taxprofiler and HUMAnN.
Bind extraction blanks, no-template controls, positive mock communities, replicates and any quantitative spike-in to the batch. Record read depth, host fraction, contamination, database snapshot and the complete profiling command. Validate short- and long-read workflows independently. Retain discordance; never average different profilers into apparent certainty.
The implemented MetaPhlAn normalizer reads its labelled table, requires a resolved NCBI taxon identity and converts percent to a UCUM dimensionless fraction. It retains taxonomic rank and original values. Parent and child taxon rows must not be summed. Unresolved species-genome-bin identities need a versioned crosswalk before admission. Relative abundance is not organisms per millilitre, disease probability or a personalized percentile. Shotgun sequencing is not the same assay as targeted qPCR, and the claim that every vendor pipeline is based on qPCR has not been established.
Methylation and pharmacogenomics
For iScan methylation arrays, SeSAMe is the initial preprocessing/QC candidate with minfi as an independent comparison. The exact BeadChip, manifest, probe exclusions, tissue and normalization process must be fixed. IDAT is not interchangeable with a genotyping table. Sequencing-based methylation requires a chemistry-specific workflow. A clock requires separately licensed weights and validated applicability; an organ-age claim cannot be generated from a generic blood clock. See SeSAMe.
Retain PharmCAT as the PGx interpretation layer. Add validated gene-aware calling upstream rather than asking PharmCAT to recover absent read evidence. Select Aldy, PyPGx, StellarPGx or another specialist by locus and platform after comparison with characterized truth material. Outside calls can override PharmCAT's own allele matching, so that precedence and any disagreement must be reviewed and retained. No medication change is automatically authorized by ingestion. See PharmCAT outside-call specification.
Proteomics and organic acids
For eligible LC-MS proteomics, consider DIA-NN for DIA analysis only after commercial-use rights are approved, or OpenMS for supported transparent processing tasks. These are method-dependent choices. DIA-NN availability to academic researchers must not be mistaken for unrestricted commercial deployment. Protein identification, peptide/protein false-discovery control and quantitative calibration remain separate validation tasks. See DIA-NN and OpenMS.
For targeted organic acids, retain native chromatograms, calibrators, internal standards, integration parameters and concentration calculations. Qualify an OpenMS, Skyline or MZmine method only where the source format and quantitation scope support it. Untargeted peak intensity is not a clinical concentration. Roche i601 proprietary acquisition cannot be assumed to expose open native signals: until that export and the Ionify method are confirmed, preserve supported result/QC exports without claiming independent re-quantitation.
For Roche blood chemistry and Sysmex blood/urine workflows, preserve the source HL7 or supported host message, units, flags, calibration and reagent provenance. HL7 normalization does not recover proprietary optical or mass-spectrometry signals. The new quantity adapter handles approved numerical tables, not arbitrary vendor messages. Existing HL7 handling remains a separate validated lane.
5 What is implemented
The /analysis console provides two authenticated workflows: validate a typed evidence JSON package, and record a paired engine evaluation. It loads actual configured instrument families and software selections. When operational services are absent, controls remain disabled. There are no fabricated patient runs, trained models or success counters.
Three deterministic normalizers are implemented in src/lib/analysis-normalizers.ts. metaphlan-tsv handles resolved MetaPhlAn taxonomy output. normalized-genomic-tsv accepts already reference-normalized GRCh38 small variants with specimen identity, SPDI, genotype, depth, genotype quality and FILTER. quantities-tsv accepts measured quantities through an exact versioned mapping including source unit, destination unit, multiplier and offset. These are real parsers of analytical output, not replacements for basecalling, variant calling, proteomics quantitation or clinical interpretation.
The CLI requires the analysis table checksum in its L0 context. It rejects a missing or unexpected identity, duplicate analytical identity, unknown unit or mapping and malformed numerical data. Missing genotype evidence remains quarantined. A failed QC row cannot become an active released fact. Original quantity values and transformation parameters are preserved. Table input is bounded at 64 MiB; partition large analytical tables deterministically and retain their parent manifest. The JSON validation API is bounded at 16 MiB. Large sequencing datasets belong in the edge upload path, not browser forms.
The runtime/vera_stage.py entrypoint downloads verified inputs, checks their size and SHA-256, verifies installed reference checksums, invokes an installed executable without a shell, then publishes each required output through the existing multipart custody API. It never mounts a Docker socket. The verifier, not the analytical executable, decides whether the output bytes match custody. Successful execution still requires separate scientific QC and release review.
Stage-specific architecture and resources are included in the immutable pipeline definition. Replacement of an active definition requires a passing paired evaluation of those exact baseline and candidate definition hashes and a different approver. The lab-director rollback endpoint restores only the exact approved predecessor recorded at activation, provided its builds remain approved. Rollback changes new submissions; it does not silently rewrite historical evidence or cancel in-flight runs.
6 The KG contract
The outer contract remains PREPAIRE-KG-EVIDENCE-BUNDLE@3.0.0 for compatibility. An additive typedEvidence field carries PREPAIRE-TYPED-EVIDENCE@1.0.0 records. Old observations and crossAxisSignals may be empty for a typed-only package; do not fabricate flat observations to satisfy an old consumer. Update the receiver to understand typedEvidence before enabling that lane.
Every released typed record contains one L0 provenance record, its facts and a reviewed biological-context sidecar. Parsing an older package without context is supported for inspection, but release and twin retrieval reject it. Supported fact kinds are observation, genomic_call, diplotype_call, taxon_abundance, function_abundance, clock_age, polygenic_score and index_value. A supported kind is not an implemented assay adapter. This release includes parsers for only the three table formats above. It deliberately excludes action_offer generation and does not claim implemented PGx, clock or risk-score extraction.
The L0 identity carries subject_token, specimen_id, encounter_id, run_id, instrument_serial and product. Store subjectToken, specimenId and encounterId in the governed run metadata. For typed bundles, subjectRef is the stable subjectToken; the specimen identity stays separate. Legacy untyped bundles preserve the old sampleRef reconciliation. The assay ID/version, adapter digest, canonical software digest and source/output hashes must reconcile to the executed run. Every fact cites its originating analytical table checksum. Semantic IDs are exact, never fuzzy matches.
The source schemas alone are insufficient: cross-record identity, semantic binding and provenance rules also run in TypeScript. Generated JSON Schemas describe structure; passing them does not imply clinical validity. The static namespace catalog does not prove that a particular ID exists in the deployed graph. Gauss must provide a versioned ontology-membership/crosswalk check and idempotent patient-graph receiver before activation. Unknown IDs must be quarantined, not guessed.
GET /api/v1/releases/{releaseId}/facts requires kg_service, QA or a laboratory director, matching signed node claims and a current subject-recipient access directive. It authorizes the requested purpose before private object access, verifies the immutable contextual bundle and rechecks consent and release state before responding. It returns typed evidence with destination patient_evidence_graph and referenceGraphWrite false. This is a pull contract, not a deployed Gauss database writer. The receiver must independently enforce subject scope, purpose, idempotency, retention, supersession and revocation. Training and external-model export are not authorized. The companion Digital Twin Backend Architecture describes these new boundaries in detail.
Shared reference assertions, patient measurements, model predictions and cohort aggregates must remain distinguishable. No upload in this implementation generates a causal graph, a clinical diagnosis, a personalized reference range or a frontier-model weight update.
7 Install an analytical stage
First obtain one complete deidentified export package and the assay contract. Define exact input roles and output artifacts before building software. Record the program release, commercial license, reference/database files, architecture, resource budget, executable path and scientific acceptance criteria. Test with permitted reference material and local controls.
Use runtime/Dockerfile as the publisher layer over an approved, digest-pinned image that already contains Python 3 and the analytical executable. The build context must contain vera_stage.py, recipe.json and a references directory. The recipe is checked against contracts/analysis-recipe.schema.json during the controlled image build. It supplies a fixed command and output contract, not arbitrary user shell text. References may be installed in that image only when size and license permit; larger deployments need a qualified read-only reference-volume adapter rather than an unverified remote download.
Recipe inputs are named roles. Initial roles resolve through run metadata inputBindings, mapping each role to a verified artifact ID. A downstream role can instead use predecessorBindings with outputKey and format; it must resolve to exactly one verified output from the immediate predecessor. Ambiguous or missing matches fail. Command arguments support whole-argument placeholders {input:role}, {parameters} and {work}. The parameters file contains the stage's approved JSON parameters. Installed tool wrappers must actually consume and validate those parameters; arbitrary CLI translation is not inferred.
Each recipe output declares key, path, artifactClass, mediaType and format. All required classes must match the pipeline definition, and every required file must exist and be nonempty. The workload obtains credentials from the platform-projected token file; do not put access tokens in a recipe, source ZIP or image. The analytical child process does not inherit PREPAIRE environment variables. It is still trusted code inside the approved workload; filesystem permissions and Kubernetes isolation remain necessary.
Submit the source bundle through the existing software registry, complete legal/security/validation approvals, register the image digest and command template, and create a pipeline definition with explicit resources for each stage. Independent QA approves the definition. The wrapper and Dockerfile are implemented, but no third-party software image was built or benchmarked on IRENA hardware during this revision. Do not mark a candidate image approved just because it compiles.
8 Operate the first run
The laboratory operator checks the work order, specimen and aliquot identifiers, consent/purpose record, expected assay and instrument serial. Resolve inventory blockers and confirm current instrument activation attestations. Scan-based custody can support this process; the present code does not claim a hardware interlock prevents every tube swap.
Capture the completed native export using the existing ingest:capture command and controlled manifest. Preserve the original files. The platform issues multipart upload instructions, and the worker independently verifies the stored bytes. An interrupted transfer resumes through its custody journal. Wrong sizes or hashes are investigated; never edit the expected hash to make a failed upload pass.
The operator submits the run to its approved definition. The worker resolves verified inputs, schedules each stage on compatible resources and waits for all expected output classes to pass independent verification. Failed submission, missing outputs, QC rejection or mismatched identity must remain visible as a failed or quarantined run, not be represented as a biological negative.
The normalizer runs as a controlled analysis stage or through the CLI in a secured validation workspace:
pnpm analysis:normalize --adapter metaphlan-tsv --source profile.tsv
--context l0.json --biological-context biology.json --output evidence.json
pnpm analysis:normalize --adapter normalized-genomic-tsv --source variants.tsv
--context l0.json --biological-context biology.json --output evidence.json
pnpm analysis:normalize --adapter quantities-tsv --source quantities.tsv
--context l0.json --biological-context biology.json
--mapping mapping.json --output evidence.json
Each command above is wrapped for readability; enter its arguments on one shell line. These filenames are arguments, not bundled patient data. Prepare l0.json from the actual run and analytical provenance, and biology.json from reviewed specimen, source, method, preanalytics and intended-use policy. Source, policy and relevant context hashes must reconcile to L0. Start with an unsigned hold. The quantity mapping digest is SHA-256 of the canonical sorted JSON representation exposed by stableHash, not an arbitrary file-format hash; bind its version and hash as semantic-mapping in L0 reference_releases. Clinical terminology review remains mandatory.
Use /analysis to validate the typed package structure and inspect blockers. The page does not itself ingest raw reads or approve a patient result. The final bundle must be produced and uploaded by the final governed pipeline stage. QA or a laboratory director other than the run submitter reviews provenance, controls, discrepancies and intended use, then invokes the run release endpoint. No normalization command self-signs a release.
After approval, the KG service fetches the current released facts, confirms permitted use and records the receipt. A quality issue triggers the existing release revocation process plus downstream invalidation. Do not delete original evidence or silently overwrite an old patient statement.
9 Replace third party software responsibly
In-house development proceeds per module: for example a taxonomic profiler, a signal decoder or a quantitative model. Keep the existing validated engine as the production baseline while the candidate runs in shadow mode. The sample count needed depends on variant/taxon prevalence, assay complexity, intended use, independent subjects, sites, batches and difficult subgroups. A large cohort cannot compensate for missing truth or a rare failure class.
Freeze the validation protocol before examining the holdout. Specify clinically meaningful endpoints, required strata, independent-subject counts, acceptance bounds, discordance limits and severe-failure rules. The endpoint-specific pass label must be established against independent truth, not agreement with the vendor alone. Vendor and third-party comparators can share systematic errors.
The implemented engine evaluator rejects train/holdout overlap, repeated participants within an endpoint, missing strata, failed evidence attestations and severe failures. It reports 95 percent Wilson intervals for the candidate pass rate, baseline pass rate and disagreement rate. These are marginal screening intervals, not a formal noninferiority analysis, continuous-measure agreement study or correction for multiple comparisons. For concentrations add bias, precision, total error and method-comparison studies; for classifiers add class-specific sensitivity, specificity and calibration; for age models assess error and subgroup calibration. Attach the formal analysis to the locked protocol.
Submitted booleans and hashes are attestations, not proof the service can independently verify the underlying study. The independent reviewer must inspect the evidence manifests, consent rights, code, datasets and statistical plan. Hashes prevent accidental substitution, not fabrication. A successful evaluation returns ELIGIBLE_FOR_INDEPENDENT_REVIEW, never an automatic production switch.
POST /api/v1/engine-evaluations records the paired report. To activate the candidate, an independent QA officer or director calls POST /api/v1/pipelines/{candidateId}/approve with x-engine-evaluation-id. The pipeline creator cannot approve its own definition. Existing and candidate definition hashes must match the recorded comparison. A database scope lock prevents concurrent activation for the same assay scope.
If the new engine fails, a laboratory director calls POST /api/v1/pipelines/{activeId}/rollback with previousPipelineId, reason and incidentReference. The target must be the exact approved predecessor recorded in that activation. All target builds must still be approved and explicit resource profiles must exist. Quarantine affected in-flight runs and revoke affected releases separately. Reprocessing creates new lineage and a new review; it never edits the old evidence.
Commercializing an in-house engine also requires rights to source data, reference databases, training use, derivative works and redistribution. Do not assume that a subscriber dataset or research-only program can be embedded in software sold to an instrument manufacturer. No licenses or patent conclusions are supplied by this code.
10 Personalization and population design
Cohort50's 12 main communities and their subgroups are recruitment and analysis dimensions, not 12 biological constants. Participants may belong to several clinical or lifestyle groups. Preserve a single subject identity and record overlap rather than counting one participant as independent evidence repeatedly. Self-described ethnicity, genetic ancestry, nationality and collection site are distinct fields with distinct consent and analytical purposes.
A personal baseline requires repeated comparable measurements, appropriate clinical context and measurement uncertainty. It is not automatically a healthy target or a clinical decision limit. A consistently abnormal value can remain clinically important. Sparse longitudinal data may support a qualified estimate with wider uncertainty; it must not produce an invented precise range. Selection into a 50,000-person convenience cohort does not establish global representativeness.
For cross-axis analysis, join released evidence by subject, time, specimen and context. Retain medication, diet, antibiotics, infection, specimen handling and batch effects. Distinguish measured quantities from inferred features and model outputs. Compare raw trends only across compatible assays and database versions, or through a validated bridge. Correlation across gut, immune, metabolic and neural features is not sufficient evidence of causality.
The twin should show a plain-language evidence receipt: what was measured; which specimen and date; which software and database interpreted it; what other evidence influenced the model; uncertainty and missing information; reviewer; and the source of any proposed action. Patient-level model inference belongs downstream of the release boundary. Training new frontier models, establishing personalized clinical ranges and proving improved outcomes are separate scientific deliverables, not promises made by an ingestor.
11 Deployment and acceptance
Apply both new migrations with the deployment migration credential. They add executionProfile and parameters to pipeline stages and an immutable TwinAccessDecision ledger without rewriting historical evidence. Old definitions with empty resource profiles cannot be submitted as newly qualified stages; register a new version, validate it and record a reviewed replacement. Legacy typed records missing biological context must be reissued through custody and review, not patched in object storage. Do not invent defaults for an old production definition.
Configure OIDC, PostgreSQL, immutable versioned object storage, encryption, the independent worker, workload identity and the Kubernetes/TES backend. Configure VERA_NODE_ID and VERA_JURISDICTION with matching signed OIDC claims vera_node_id and vera_jurisdiction for typed release and retrieval. A separate privacy_officer records reviewed access directives. The gateway must strip caller-supplied forwarded-token headers before injecting a verified identity. Map kg_service only to the authorized KG integration identity. Use read_only mode until the infrastructure and validation evidence are approved; never use development authentication with patient data.
Run the repository checks: install from the lockfile, generate Prisma, validate inventory, export/check contracts, verify source packaging, run TypeScript tests, run Python runtime tests, lint, typecheck and build. Run migrations, database-control tests and a full instrument replay on the deployment environment before activation. A local web build does not test object lock, GPU execution, sustained sequencing throughput or tenant isolation under production traffic.
Before connecting patient data, the team must supply: exact seven asset serials and interfaces; complete deidentified export packages with controls; signed assay manifests; permitted truth/reference materials; software and database licenses; approved images and references; operational credentials through the secret manager; the consent-aware KG receiver; and clinical sign-off for the intended use. None of those missing physical or governance dependencies is replaced by a diagram.
Acceptance is one complete traceable run: native input -> independently verified custody -> approved analytical execution -> normalized facts -> independent release -> receiver acknowledgment -> revocation test -> repeatable replay. Include deliberate wrong-identity, corrupt-byte, missing-control, expired-token, missing-output, revoked-build, caller-disagreement and rollback tests. Record pass/fail evidence and responsible owners for each lane.
The laboratory lead owns specimen/export and wet-control acceptance. Bioinformatics owns assay-specific tools, references, fixtures and scientific QC. Gauss owns deployment, APIs, receiver reconciliation and observability. Security owns identity, retention, key management and access isolation. QA and the laboratory director own independent validation, scope and release approval. Agree named individuals and dates before activation.
12 Code and API index
src/lib/typed-evidence.ts: stricter L0/fact admission, stable hashes and release blockers.
src/lib/analysis-normalizers.ts and scripts/normalize-analysis.ts: deterministic table adapters and secured local CLI.
runtime/vera_stage.py and runtime/Dockerfile: approved-image execution wrapper and custody publisher.
src/lib/execution-profile.ts, src/lib/execution.ts and worker/index.ts: resource validation, backend submission and verified stage-to-stage inputs.
src/lib/engine-transition.ts: paired holdout screening. /api/v1/engine-evaluations: report intake and audit record. /api/v1/pipelines/{id}/approve and /rollback: independent activation and incident restoration.
/api/v1/normalization/validate: bounded authenticated structure check. /api/v1/ingestion-runs/{runId}/release: full governed reconciliation. /api/v1/releases/{releaseId}/facts: current approved typed evidence for the KG consumer.
contracts/typed-evidence.schema.json, engine-evaluation.schema.json and semantic-mapping.schema.json: generated structural contracts. scripts/export-analysis-contracts.ts regenerates downloadable copies. public/docs/analysis-api.openapi.yaml describes these new endpoints and extends the earlier public/docs/openapi.yaml surface.
src/lib/biological-context.ts, twin-access-policy.ts, released-twin-evidence.ts and twin-evidence.ts: source and intended-use context, subject-recipient directives, private retrieval and longitudinal receipts. /api/v1/twin-access-decisions and /api/v1/twin-evidence/assemble are documented in the updated OpenAPI supplement. src/lib/prisma-client.ts supplies the required Prisma 7 PostgreSQL driver adapter for the app, worker and database scripts.
docs/VERA_ANALYSIS_VERIFICATION.md records the checks actually completed for this revision and the tests still required on deployment infrastructure. Existing operations, machine-extraction, incident-response and software-assurance manuals remain applicable except where this integration explicitly tightens an API or identity requirement.
VERA™ Digital Twin Backend Architecture
Version 1.1 | 5 September 2026 | Engineering requirements and implementation record
1 The operating model
PREPAIRE structures human biological evidence so that the Digital Twin can use it responsibly over time. VERA acquires and normalizes evidence; the private knowledge graph connects released facts; qualified analytical models may interpret those facts; the patient interface explains the evidence and its limitations. These are separate services with explicit contracts, not a single neural network that turns every upload into a clinical conclusion.
The supplied mission and product documents establish the intended direction. They are not evidence that a particular diagnostic model, commercial relationship, instrument export or clinical outcome has been validated. The current implementation strengthens the evidence and access boundaries. It does not claim a working model federation, a clinical inference engine or a connected laboratory installation.
2 What the documents change
NEWGenetiq, pages 7 and 16 to 17, requires evidence to retain its origin, date, specimen, method, context and allowed use. The implemented biological-context sidecar records these details alongside the original L0 and fact schemas. A source checksum and page or record anchor connect a receipt to the original artifact. Method and policy versions are explicit; preanalytical metadata is preserved. The sidecar's policy and source hashes must reconcile to L0 provenance before release. It does not replace the native vault or the original report's reference intervals.
NEWGenetiq distinguishes Passport, Check and AXIOM under one identity. The existing product field is retained rather than creating separate patient identities. Historical Passport evidence cannot become a current-state or personal-baseline measurement merely because it was recently uploaded. The currently implemented operational release path is AXIOM. Passport report extraction and the Check intake workflow still need dedicated qualified adapters; a schema enum is not a shipped workflow.
Our Mission and The Prepaire Bible describe observation, interpretation, experimental validation and learning as a continuing cycle. Code now explicitly separates measured and derived measurements from self-reports and model inferences. Clock ages and polygenic scores require inference provenance. A model inference carries its model digest, weights hash, input fact references, validation evidence hash, uncertainty and limitations. These are admission requirements and reviewer attestations, not automatic proof of model validity.
Letter to team requires method bridging and privacy-preserving learning. The longitudinal API groups numerical measurements only when their assay, specimen type, source type, platform, analytical versions, parameters, references, units, evidence class and fasting context match. It does not pool different methods or average discordant callers. Medication and other confounders remain visible for downstream review; matching fingerprints alone does not establish complete biological comparability. A real bridge still requires a paired-specimen study and a separately approved transform.
The PLAN and Dubai network documents require accountable local operations and patient control. The twin API now requires matching signed node and jurisdiction claims, a current subject-recipient access directive, and an allowed product and purpose. The latest directive controls access. Expired or revoked access does not fall back to an older grant. Care-related purposes and optional research can be granted separately; refusing research does not disable history access.
The Biology Intelligence API pack separates local raw evidence from reference intelligence and model learning. This revision provides a private evidence pull interface and explicitly does not authorize model training or external-model export. It does not implement a corporate intelligence API, cross-border transport, model-delta aggregation or token minting. Network egress policy, receiving-service access controls and contractual rights remain necessary; a JSON permission flag cannot constrain a malicious recipient by itself.
3 Evidence use is not clinical authority
Each record declares permitted uses: history, trend, current_state, personal_baseline and research. Current-state use requires an explicit policy expiry; there is no universal freshness period. A dated result may remain useful as history after it is no longer eligible to describe the present. The policy comes from an approved assay-specific rule set, not an arbitrary application default.
The service intersects evidence eligibility with the current recipient directive and release conditions. An eligible personal_baseline input is not a computed personal reference interval. At least two distinct eligible specimens collected at distinct times can produce COMPARABLE_MEASUREMENTS in the receipt API. That status means a candidate measurement series, not a healthy range, statistical sufficiency or a clinical treatment target. Both personalizedReferenceRange and homeostaticTarget remain null.
Model estimates and self-reports never enter the numerical measurement series. Experimental results must retain their source and specimen type and cannot be represented as measurements made on a patient. The current schemas support such distinctions, but laboratory and clinical reviewers must validate classification and model applicability. No generated organ illustration constitutes imaging evidence. No cross-axis association is labelled causal merely because several omics layers support it.
The four AXIOM research axes in the Bible, immune senescence, organ age, epigenetic velocity and mitochondrial or metabolic flux, organize scientific development. The backend does not manufacture four scores or a percentage of the body understood. Any future score requires a defined endpoint, model contract, uncertainty, validation population and prospective intended-use review.
4 New backend interfaces
POST /api/v1/twin-access-decisions appends a privacy officer's reviewed directive. The request binds a pseudonymous subject to an OIDC recipient subject, product scopes, purposes, expiry, evidence URI and checksum. The officer cannot alter their own recipient access. A node-scoped database lock and previousDecisionId prevent concurrent updates from silently replacing one another. Every decision is append-only and audited. The source consent ceremony is not performed by this endpoint; the officer must inspect and retain the underlying evidence. Keep the returned decisionId in the authorized consent service for future updates.
GET /api/v1/releases/{releaseId}/facts checks recipient authorization before reading private object bytes, verifies immutable custody and the typed package, and checks release and directive state again before returning. It requires kg_service, qa_officer or lab_director plus matching signed vera_node_id and vera_jurisdiction. Authorization roles alone do not grant patient access. The receiver must enforce the same purpose and invalidate superseded or revoked evidence it has already consumed. The producer's recheck cannot recall bytes already transmitted.
POST /api/v1/twin-evidence/assemble accepts one to twenty release identities for history use. It returns selected evidence, not the participant's complete record. It rejects mixed participants, mixed node scopes, duplicate facts and ineligible releases. Requests are limited to 64 KiB, combined artifact payloads to 64 MiB and facts to 20,000. Every receipt includes specimen and collection time, result and unit, evidence class, source anchor, method, preanalytics, policy, inference lineage when present, reviewer, consent decision and eligibility blockers.
The response deliberately contains no automated diagnosis, action offer, prescription, organ-health image or model-weight update. Downstream qualified services can consume the evidence under separate authorization. Research access is not a training license. The purpose vocabulary intentionally has no model_training permission.
5 Developer connection sequence
Deploy the two new migrations using the controlled migration credential. They add immutable pipeline resource definitions and an append-only TwinAccessDecision ledger. Existing release artifacts are never edited in place. A legacy typed artifact lacking reviewed biological context must be reissued through the normal lineage and review process. This is an intentional fail-closed compatibility boundary.
Configure VERA_NODE_ID and VERA_JURISDICTION and issue matching signed OIDC claims to explicitly authorized principals. Add privacy_officer to the identity provider's permitted roles. Do not accept node identity from unsigned request headers. Use distinct identities for scientific submission, release review, privacy approval and KG consumption. The new node and consent policy applies to typed release and twin retrieval routes; it is not a retrofit of row-level tenant isolation across every legacy operator API. Use separate node deployments until that wider audit is complete.
Prepare a reviewed biological-context.json sidecar and pass it to analysis:normalize with --biological-context. Include its source, policy and preanalytics hashes in the appropriate L0 provenance fields. Upload the final package through the existing custody flow, complete independent release review, then record the permitted recipient directive. Fetch released facts or assemble history using the authorized service identity. Retain release, artifact and directive identifiers in the receiver's ledger.
The application, worker, registry seeder and database-control script now share a Prisma PostgreSQL driver adapter. The installed Prisma 7 client requires this adapter; construction without it failed before a database connection could be made. The adapter uses a bounded pool, a five-second connection timeout and an explicitly selected schema without disabling TLS verification. Configure production connection and certificate settings through the deployment secret manager.
Run an isolated non-patient integration test covering grant, successful retrieval, consent revocation, expired grant, release revocation during retrieval, cross-node access, wrong recipient and exact replay. Unit tests exercise these policy boundaries with controlled fixtures; they do not establish live identity-provider or database behavior. Apply and test append-only database triggers before accepting patient evidence.
6 Scientific and product boundaries
The latest Cohort50 direction is One World with twelve main communities and overlapping subgroups, not the older 25,000 Emirati and 25,000 expatriate split in earlier launch material. Ethnicity, ancestry, nationality, clinical phenotype and collection site remain distinct analytical dimensions. Recruitment membership cannot become a biological reference range or a claim of global representativeness. No recruitment quotas or ancestry-derived clinical cutoffs were hardcoded in this revision.
Replacing third-party software is a per-assay qualification decision. Neither 11,000 nor 50,000 participants automatically triggers decoupling. Independent truth, controlled holdouts, local controls, subgroup performance, licensing and a reviewed rollback plan remain required. Fresh patient evidence does not automatically become training data. The baseline engine remains available while an in-house candidate is validated in shadow mode.
Future work is explicit: qualified Passport and Check adapters; ontology membership and crosswalk validation; a consent-aware Gauss receiver with acknowledgment and invalidation; validated method bridges; clinically qualified longitudinal models; prospective adherence and outcome evaluation; and separately governed federated aggregates, model deltas and knowledge assertions. Public reference nodes and patient evidence must never be merged indiscriminately. Wet-lab experimental evidence can inform a hypothesis without becoming proof of clinical benefit.
7 Source record
The review covered all pages or paragraphs of NEWGenetiq.pdf, PLAN-deck.pdf, Our Mission.docx, The_Prepaire_Bible_edited_V2.pdf, Dubai Longevity Diagnostic Network.pdf, Dubai 20th June 2026 2.pdf, Prepaire Biology Intelligence Api - Open Ai Partnership Pack copy.pdf, Keynote2.docx, PrepaireSummary.pdf, Letter to team.pdf and Pitch.docx. Image-only material in the network and summary decks was read through local OCR. The Cohort50 video was reviewed through visual frames sampled every ten seconds; its audio was not transcribed or reviewed. Source files remain outside the application public directory.
Commercial pricing, financial plans, proposed partnerships and illustrative clinical screenshots were not converted into system facts, credentials, patient results or medical rules. The source set informs product direction; implementation and validation status are established separately by the code and verification record.
Interoperability references are HL7 FHIR Observation, Provenance and Consent. VERA's current custom JSON contracts are not a claim of FHIR conformance. PostgreSQL integration follows Prisma driver adapter guidance.
Implementation entrypoints are src/lib/biological-context.ts, src/lib/typed-evidence.ts, src/lib/twin-access-policy.ts, src/lib/released-twin-evidence.ts, src/lib/twin-evidence.ts and src/lib/prisma-client.ts. Generated schemas and the OpenAPI supplement accompany these modules. The verification record distinguishes executed local checks from remaining laboratory and infrastructure acceptance tests.