Faurenis architecture specification
Faurenis is a clinical workspace for dental practices. It captures the visit by voice, drafts the record with governed AI, and commits nothing to the patient record until a clinician has reviewed it. It is built as one modular monolith on Google Cloud in the EU, with tenant isolation enforced in PostgreSQL itself, and a fleet of hosted and self-hosted models behind a single routing and guardrail layer. This document specifies how it works, module by module, and states the lifecycle status of every capability it names.
System at a glance
- HTTP routes
- 700+
- plus 8 SSE streams and 4 WebSocket paths, every one in a generated route manifest
- Relational tables
- 220+
- clinical plane, plus 20+ in a physically separate research database
- Forward-only migrations
- 300+
- expand → migrate → verify → contract, never generated down-SQL
- Test files
- 3,300+
- plus 18 end-to-end browser specs
- CI ratchets
- 40+
- one-way lints that block a regression from merging
- Architecture decisions
- 32
- 28 accepted, 4 proposed — each one cited where it binds
- QMS hazards tracked
- 129
- 126 requirements, 121 mitigations, 52 verifications
- Interface strings
- 17,000+
- English and Croatian, with key parity enforced in CI
What the platform is
A dental visit produces speech, measurements, images and documents. Faurenis turns those into a structured clinical record without asking the clinician to type. It has three jobs, and the architecture is organised around them:
- Capture. One microphone shared by the whole app: ambient and dictated notes (Scribe), hands-free periodontal charting (Perio), spoken commands and a speech-to-speech assistant (Voice OS).
- Reason. A clinical assistant (Copilot) that answers from the patient chart and from retrieved, cited literature, and a deterministic layer for everything that has a published algorithm.
- Commit. A governed artifact lifecycle: every AI output is a draft with recorded provenance, and only a clinician action moves it into the patient record.
The architecture in one diagram
- Voice OSone microphone
- Scribenotes · dictation
- Periovoice charting
- Documents · Imagingingest
- Model routertiers · fallback · worker
- Copilotclinical · concierge
- Evidence baseretrieve · rank · entail
- Deterministic enginesperio · plan rules
- Encounter spineone visit, one parent
- Artifact lifecycledraft → review → lock
- Clinical factsprojections · timeline
- Audit chain · provenancehash-chained, append-only
Connections (10)
- Voice OS → Scribe
- Scribe → Copilot
- Perio → Deterministic engines
- Copilot → Evidence base
- Model router → Copilot
- Copilot → Artifact lifecycle
- Scribe → Encounter spine
- Encounter spine → Artifact lifecycle · binds
- Artifact lifecycle ⇢ Clinical facts · on accept
- Artifact lifecycle ⇢ Audit chain · provenance
Status legend
A specification that does not say what is shipped is a brochure. Every capability in this document carries one of five statuses, and the same five are used everywhere:
- ProductionProductionServing clinical users under the production configuration.
- PilotPilotBuilt and deployed; enabled per clinic or per user through a rollout grant.
- ShadowShadowRuns on real traffic and records its result, but never changes what a clinician sees.
- Rolling outRolling outImplemented, with deployment or training in progress.
- PlannedPlannedNot available to users: specified in an ADR or plan, or implemented behind a switch that is off everywhere.
How to read this document
Each chapter opens with a three-sentence summary written for a reader who will stop there. Everything below it is the engineering specification. Chapters 1–5 describe the system as a whole; the module chapters use one fixed template so they can be compared side by side.
- An investor or board member
- Start with
- This page, then the summary at the top of each chapter
- An engineer joining the team
- Start with
- Design invariants (02), then the clinical spine (05)
- A security or privacy reviewer
- Start with
- System topology (03) and platform runtime (04)
- A clinical or regulatory reviewer
- Start with
- Product and intended purpose (01), then design invariants (02)
| If you are… | Start with |
|---|---|
| An investor or board member | This page, then the summary at the top of each chapter |
| An engineer joining the team | Design invariants (02), then the clinical spine (05) |
| A security or privacy reviewer | System topology (03) and platform runtime (04) |
| A clinical or regulatory reviewer | Product and intended purpose (01), then design invariants (02) |
Chapters
- 01Product and intended purpose
Faurenis assists licensed dental clinicians with documentation, charting, evidence lookup and practice operations. It drafts; the clinician decides, and nothing it drafts reaches the record without a clinician action. Each AI feature is registered with a written intended purpose, input, output and automation level, and the build fails if a new AI route is not registered.
- 02Design invariants
Eight rules decide every architectural trade-off in Faurenis, and each is enforced by code, a database constraint or a CI gate rather than by convention. Behind them sit numbered clinical invariants — for artifacts, tenant isolation, recovery, Scribe, Perio, evidence and voice — that a change must not regress. A regression against any of them stops a pull request, regardless of what else it delivers.
- 03System topology
One application service on Cloud Run — a Node.js modular monolith — serves the web app and its API, backed by Cloud SQL PostgreSQL 16, Cloud Storage and Cloud KMS. Work that needs different hardware or a hard isolation boundary runs as a small number of satellite services: a document renderer, an imaging pre-processor, and GPU inference workers. Everything runs in approved EU regions; there is no message broker — asynchronous work is carried by Postgres outboxes drained on a schedule.
- 04Platform runtime
The application is a modular monolith: domains are separated by module boundaries and lint rules, not by network hops, which keeps a clinical transaction in one database transaction. Every request passes a fixed middleware chain, and every AI request additionally passes compliance, consent, budget, audit and output-scanning gates before a model is called. The HTTP surface — 700+ routes — is described by a generated manifest that CI checks on every change.
- 05The clinical spine
Every module plugs into the same spine: one encounter per visit, a governed lifecycle for everything AI produces, a fact layer that only clinician-confirmed data can enter, and an audit and provenance trail behind all of it. This is what makes Faurenis one application rather than a set of AI features: Scribe, Perio, Copilot, Imaging and Documents all write through the same rails, so review, finalization and correction work identically everywhere. The spine contains no AI; it is the deterministic structure the AI works inside.
- 06Module catalogue
Faurenis is 19 modules in six domains — capture, reason, see, produce, operate and govern — all writing through the clinical spine. Every module is specified on one template: purpose, pipeline, data owned, models, guardrails, rollout status, interfaces, invariants and known limits. A module that makes no model calls says so explicitly; most of the operational modules are deterministic code.
- 07AI architecture
Every model call in Faurenis goes through one routing layer: endpoints map to capability tiers, tiers map to models, and a retry engine falls back one tier down rather than failing. Hosted Gemini models on Vertex AI in the EU serve production traffic; a self-hosted estate of open-weight clinical models, embeddings and entailment on GPUs is rolling out beside them, with Vertex as its fallback. Around every call sits a layered guardrail stack — consent, budget, PII stripping, schema validation, output rules, deterministic red-flag checks and a decision record — so no model output reaches a clinician unchecked.
- 08Model lifecycle
Models improve from one signal: what clinicians kept, changed or rejected. Those decisions are exported de-identified, used to fine-tune small open-weight adapters, evaluated against locked sets with clinician sign-off, and released only as signed packages that three roles approve. A release reaches clinicians in stages — shadow, then pilot, then clinical — and any change to the files that define a model’s behaviour invalidates its sign-off automatically. The export, evaluation harness and release control plane are built; adapter training and the self-hosted deployment are rolling out now.
- 09Data architecture
One relational system of record — Cloud SQL PostgreSQL 16 with 220+ tables — holds the clinical plane, with object storage for images and documents and a physically separate database for research. Identifying fields are encrypted per patient under keys wrapped by a per-clinic key in Cloud KMS, and searchable through keyed hashes rather than plaintext. Erasure is engineered for backups as well as the live database: erasure tombstones are replayed after any restore, and destroying a clinic key makes every backup of that clinic unreadable.
- 10Security and tenancy
Tenant isolation is enforced by PostgreSQL itself: every tenant table forces row-level security keyed on a clinic id that is set per transaction from the authenticated session, never from the request. Static lints prove every table is covered and every route uses a scoped connection, and an adversarial cross-tenant suite runs in CI on every change. Around that sit layered controls — signed short-lived tokens, MFA, a strict content security policy, upload scanning, a web application firewall — and a written STRIDE threat model with a residual-risk register.
- 11Reliability and operations
Every production deploy goes blue-green: a new revision is health-checked with no traffic before traffic moves, and rollback is redeploying the previous revision against a schema that only ever expands. Recovery is rehearsed on a schedule — a weekly restore drill from backup and a weekly resilience drill that injects provider outages, slow dependencies, database failover and crashes. Capacity, timeouts and alerts are written down as numbers, and every scheduled job records its runs.
- 12Quality and regulatory engineering
Faurenis keeps its quality system in the repository as machine-checked registries: 126 requirements, 129 hazards, 121 mitigations and 52 verifications, traced to each other and to the code. The engineering lifecycle is mapped to IEC 62304, risk management to ISO 14971 and the design history to ISO 13485, and every AI feature carries a written intended purpose. Regulatory classification is a legal determination that has not been made; the platform is built as if the stricter outcome applies.
- 13Engineering system
Code reaches production through one pipeline, shared by human and AI contributors: plan, implement with tests, a focused safety audit, an independent AI code review against the clinical invariants, then 20+ CI workflows and 40+ one-way ratchets. Ratchets let quality move in one direction only — a file may shrink but not grow past its limit, an `any` count may fall but not rise, a snapshot of exceptions may only lose entries. Guards are themselves tested: a check that cannot observe its own failure is treated as a defect.
- 14Known limits and roadmap
This chapter lists what is not built, not enabled or not yet evidenced, in one place. Every item also appears in the chapter it belongs to; collecting them here is so that nobody has to infer the gaps from what the other chapters leave out. A gap that is written down gets scheduled; a gap that is implied does not.
- AAppendix A — Decision records
All 32 architecture decision records, with their status as each record states it: 28 accepted and 4 proposed. The index is generated from `docs/adr/`, so a new decision appears here in the same change that adds it.
- BAppendix B — Glossary
Terms used across this specification, with the Croatian term clinicians see in the product. Status words follow the five-status vocabulary: Production, Pilot, Shadow, Rolling out, Planned.