Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Crate map

Every crate in crates/ is listed here, with the file where it starts and the chapter that covers its behavior. The module docs at the top of each entry file are the maintained description. When this table and a crate disagree, the crate is right and this table needs fixing. boundaries keeps Duet and the physician client from importing each other’s clinical crates. The Shared table below is the list of crates both products may use. One crate sits a level deeper: coda-sandbox, the agent sandbox tool, lives in crates/workspace-tools/sandbox/ and is listed under Tooling and guards.

Shared

CrateEntryOwnsChapter
uisrc/lib.rsCoda’s design, as a catalog of AI-native component families: tokens, icons, and each component’s look, motion, gestures, states and accessibility, with no product rules—
extension-popupsrc/lib.rsThe Chrome extension’s popup, built from ui: where the connection stands, in one line, and its one action. The extension’s worker owns the connectionChrome extension
coda-httpsrc/lib.rsRequest and stream mechanics with no schema knowledgeBackend architecture
gmailsrc/lib.rsPlain-text or HTML messages through the Gmail API or the Workspace SMTP relay, plus the intake primitive, the history.list cursor reader (src/history.rs). Products own the copy, the links, the durable cursor, the polling schedule and the effectsGCP
sprucesrc/lib.rsRead-only Spruce REST reader and change cursor. Products own the cursor store, the effects, and patient linking—
encodersrc/lib.rs, src/main.rsOffline BGE encoder binary that speaks both the Duet and the physician encoder protocols; tests/compare.rs checks it against the existing Python workers. No crate depends on itPhysician site
harnesssrc/lib.rsOne product-neutral bounded provider/tool loop and ordered turn in engine. Chords chat and reply revisions supply a frozen recipe and implement engine::Product. The harness builds each request, emits ordered events and exposes the shared skill_view tool for each job’s visible package. Products keep authority, effects and persistence. The harness reconstructs recovery from their admitted records and messages.Harness spec
agent-skillssrc/lib.rsValidates and reads the physician skill packagePhysician site
clinical-librarysrc/lib.rs, src/bin/clinical-library-migrate.rs, src/bin/clinical-library-pubmed-status.rsThe clinical library’s records and the nightly’s failure rules: article states, night outcomes counted from each night’s ledger, the stop rule, the slot lease and activation, with their Postgres schema; the night runner every source goes through, and the alerts the records raise; and its sources, starting with PubMed’s retraction and correction status read from NCBI’s E-utilities. Depends on no other local crateClinical library nightly
telemetrysrc/lib.rsShared tracing, logging, and OpenTelemetry setup for the Rust services; the testing feature starts the disposable Docker Langfuse and collector for ignored testsObservability

Duet (patient app)

CrateEntryOwnsChapter
duet-appsrc/lib.rs, src/roots.rsStandalone account entry, tab roots and connection controlsUI and design
duet-apisrc/lib.rs, src/main.rsAxum owner for identity, evidence, the doctor workspace, health context, privacy and the existing connection adapterBackend architecture, Patient front door
duet-clientsrc/lib.rsDuet caller over the generated client, adding the app-build headersBackend architecture
duet-wire (package duet_wire)src/lib.rs, generated API indexModels, operations and reference docs generated from the pinned coda-app OpenAPI plus Duet-owned additions. Regenerate with cargo run -p workspace-tools -- generate-duet-wire; do not edit outputs by hand.API generation
duet-healthsrc/lib.rs, src/acquisition.rs, src/outbox.rsOn-device health samples from HealthKit and Health Connect; durable acquisition records, the native source adapter contract and the transactional upload outbox (account fencing and the batch transport live in duet-client::health_upload)Duet backend
duet-notifysrc/lib.rsAlert permissionDuet backend
duet-stubsrc/lib.rs, src/main.rsLocal Duet stand-in for the emulator and tests (cargo run -p duet-stub)Release

Physician product

CrateEntryOwnsChapter
physician-appsrc/lib.rs, src/main.rsThe physician Dioxus shell: sidebar, Today, patient page, and readerPhysician site
physician-wiresrc/lib.rsThe physician read types, following coda-agents’ apiTypes.tsPhysician site
physician-clientsrc/lib.rsThe caller for the Node CodaServer and the sample serverPhysician site
physician-samplesrc/lib.rs, src/main.rsServes the page and the synthetic practice, plus auth and live chat routes; the physician-migrate binary runs the physician schema migrationsPhysician site
physician-demo-dbsrc/lib.rs, src/seed.rsIn-memory and browser turso_core SQLite demo store, build-time fixture seeder (seed_demo_db), chart search, and verbatim citation matchingPublic site
physician-demo-apisrc/lib.rs, src/routes.rsEmbeddable pure-Rust demo API router serving per-visitor turso_core sessions, crates/harness tool loops, physician-bus SSE, DemoTurnBudget, and dual-mode cloud + quantized candle GGUF inferencePublic site
physician-authsrc/lib.rs, src/bin/physician-auth-migrate.rsPhysician identity, membership, panels, and sessionsPhysician site
local-productsrc/lib.rsLocal subscription or API model execution; the physician runtime store, and hosted chat’s instructions and skill_view tool (physician_chat)Physician site
physician-bussrc/lib.rsTelling open physician pages to reread changed state, through a local bus or Redis fan-out. Lossy invalidation, not a durable work queuePhysician site
patient-worksrc/lib.rsThe patient-work dispatcher’s grouping windowPhysician site

Between the products

CrateEntryOwnsChapter
front-doorsrc/lib.rs, src/bin/front-door-migrate.rsInvitation, roster and consent adapter; standalone account authority stays in DuetPatient front door
mobilesrc/lib.rs, src/main.rsThe one Android and iOS shell, with an explicit physician or client mode. It is the only crate that mounts both apps.Release

Public website

CrateEntryOwnsChapter
public-sitesrc/lib.rsThe startup-rendered public marketing site, isolated from the physician runtimePublic site
observability-relaysrc/lib.rsThe staging hop from public-site’s /grafana/ mount to Grafana’s private load balancerPublic site

Tooling and guards

CrateEntryOwnsChapter
patient-banksrc/lib.rs, src/main.rsThe synthetic patient bank: chart authoring checks, the verified code catalog, the FHIR build and its validationSynthetic patients
ui-gallerysrc/main.rs, scripts/ui-gallery.shEvery ui family rendered with its states, each at its own address, the command that builds and serves it, and the browser test that opens every family. Nothing depends on it—
boundariessrc/lib.rsTests that keep product dependencies apart, retain the reference shipping clients, and hold both apps’ raw controls, hand-built cards and library overrides to a checked-in tableThis page
workspace-toolssrc/main.rsWorkspace command entrypoints, including generate-duet-wire, install-doppler, apply-migrations, the observability-drill routes, among them the staging Langfuse drills, and discord (read-only bot discovery, private verified channel and thread backups, offline inspect and search, and an offline publish that writes a static search site of consenting authors’ messages, in src/discord/); supporting checks and generator assets remain in scripts/Build, CI, and release
coda-sandboxsrc/main.rs, src/lib.rsThe agent sandbox tool: its config, doctor and status, worktree (seeded reflink worktrees), ci run (the CI spool client and the spool format the controller shares), ci-controller (the Firecracker CI controller the coda-ci units run), carry, and broker (the token broker that serves the container’s tokens from the host keyring) with its container clients credential and token. A root workspace member nested under workspace-tools, with its own flake (README) that builds only this crate from the root lockfile and ships the NixOS module services.coda-sandbox, which declares the container and CI it checks, so a host deploys it without the product flake. No crate depends on it—
androidsrc/main.rsBuilds the APK, opens the Android emulator (a window, or headless in CI) and runs one UI Automator class (cargo run -p android -- test [--headless] coda.duet.ModeShellTest)Release

Platform bindings

platform/ holds the native code that the Rust crates call. It is not a Cargo crate.

FileBound to
ios/HealthKitBridge.swiftduet-health
ios/NotificationBridge.swiftduet-notify
android/HealthConnectBridge.ktduet-health
android/NotificationBridge.ktduet-notify
android/HardwareKeyDispatch.ktmobile WebView key input, copied in by cargo run -p android -- build (build.rs)
android/ModeShellTest.ktThe UI Automator class that android runs

Chrome extension

extension/ holds Coda’s Chrome extension, which reads the practice’s EHR under the physician’s own sign-in, and its local sandbox bridge and tests. Its popup is the extension-popup crate; the rest is not a Cargo crate. Its README covers loading it and running a sandbox read.