arrow_backResources Technical design

Four services, one store, one bus.

The technical reference for your IT team, kept in step with the current design.

This page summarises the Corvair Virtual Worker design as it stands at version 2.2 (14 September 2026). It is written for the people who will evaluate the platform, grant it access to systems, and check what it may and may not do. The buyer-facing pages explain the same things in plain words; this page gives the mechanism. The full design set, with requirements, acceptance criteria and a decision log, is available to evaluating customers on request.

Status. This is a design under active development, not a description of a finished system. What is running today is the conversational demonstration. Everything below is designed and specified; a pilot establishes what is ready for a given customer. Where this page differs from an older description you may have seen, this page is current.
Overview

Three surfaces call one API. Four services. One PostgreSQL database.

The platform runs as four services in its own Google Cloud project, on the same stack as the Knowledge Substrate. There is one database, and only two services touch it.

Surfaces Client workspaceworkers, work, decisions, results Administration and setupcatalogue, contracts, instances, profiles, billing API and MCP coversame operations, same authorization The platform cvw-api · every decision, all durable state work engine (queue, leases, hand-off, stops, fan-out) · head (situations, objectives, planning) policy and authority · conversation runtime · ledgers (outcome, cost, billing, audit) event spine (envelope, dedup, per-subject order, outbox, fan-out) · learning and calibration Request driven on Cloud Run. Nothing held in process; everything in the database. cvw-voice media bridge, carrierWebSocket, live modelsession, barge-in.No durable state. cvw-jobs evaluators, regression,rollups, reconciliation,absence evaluator,sweeps, maintenance. cvw-hands · one persistent environment per worker browser, files, bound credentials. Reaches the API only as a principal,over the same routes an external recipient uses. No database access. PostgreSQL (Cloud SQL) · the single store truth, work queue, event store, outbox,LISTEN/NOTIFY. Only api and jobs touch it. Outside the platform, behind adapters and hand-off contracts, both ways. Dashed arrows: reached through an adapter or a hand-off contract. Teal: the platform's own control paths. Channelsphone, messaging, email, web Systems of recordERP, CRM, orders, calendar Knowledge Substrateknowledge, memory, warrants IdentityFirebase tokens Other handspeople, agents, other bots
Figure 1. System context. Three surfaces call one API. The API owns every decision and all durable state. Voice, batch jobs and hands are separate services because they scale on different terms. PostgreSQL is the single system of truth, including the work queue and the event store; the bus is LISTEN/NOTIFY over a transactional outbox. Everything outside the platform is reached through an adapter or a hand-off contract, never directly. Design version 2.2 · 14 September 2026
ServiceOwnsScaling and state
cvw-apiAll decisions: the head, work engine, hand-off, stops, policy and authority, dispatcher, compliance engine, ledgers, event spine and outbox relay, verification, the client and administration projections, the operations console projections, and the MCP cover.Request driven on Cloud Run; concurrency 40 to 80; at least one instance in production with CPU always allocated so the outbox relay runs between requests and event streams stay warm. Nothing held in process.
cvw-voiceThe audio path: carrier WebSocket, transcoding, the live model session, barge-in, transcript and tool calls streamed to the API.Four to eight calls per instance; CPU always allocated; session affinity. Nothing durable: an instance loss ends the calls on it and creates a callback obligation for each from the persisted call events.
cvw-jobsEvaluators, regression and simulation, grading, rollups, reconciliation, the absence evaluator, the readiness and lease sweep, partition maintenance, cost export, retention.Cloud Run Jobs started by Cloud Scheduler; task parallel; no ingress. Writes to the same tables through the same repository layer as cvw-api.
cvw-handsOne persistent environment per worker: browser, files and bound credentials, for work that has to be done through a screen or a file rather than an API.One pod per environment on GKE Autopilot with a persistent volume. No database access; it reaches the API as a principal over the same routes an external recipient uses.
history
What changed from earlier descriptions. Earlier versions of this page described three services and a graph database as an active store. The current design has four services (hands was added when screen and file work moved into its own environment), and one PostgreSQL database holds everything, including the work queue and the event store. A graph is an optional later projection built from the same records, not a store of its own. Both changes are recorded in the decision log.
The worker model

A definition plus an assignment. A head that decides, hands that do one step.

A worker definition is a reusable, versioned role in a global catalogue with no customer data in it. A worker instance is one customer's worker: a durable identity bound to a definition version, a contract, a team, a country profile, grants, limits and bindings. Configuration has three scopes: the template (the definition), the customer's adaptation of it, and the bindings to that customer's credentials, systems and telecom routes. A version records which scope each value came from, so an engineer can see what was inherited and what was changed.

The head is the instance's engine: it recognises the situation, chooses from its objective set, selects a procedure, holds the conversation, plans, hands out work, verifies returns and records outcomes. A hand is any recipient that executes one work item under the head's authority: the platform's own hands environment, a person, another worker, an external agent or a system adapter. Only the head may hold contact and commitment actions.

Objectives are a set, not a ladder. An instance holds an objective set with priorities, eligibility, dependencies, deadlines, capacity and conflict rules; an individual objective may carry an ordered fallback path. A durable business objective belongs to the customer's operation and links objective assignments, requests, work items and evidence, so shared goals guide work without a central controller deciding every step.

The work engine

Queued, claimed under a lease, returned, verified, and only then complete.

Every unit of work is a work item with one lifecycle, whoever performs it. Items are created only by the head's approval transaction from plan items. Hands, people and external agents can claim them; they can never create them.

Field groupWhat it carriesWhy it matters
Identity and subjectTenant, owning instance, subject (contact, account, order, conversation, request), the motivating objective assignment and business objective.An item with no motivating objective is rejected at creation. Ordering and conflict detection are per subject.
Action contractAction type and kind (stock.read, quote.enter, decision.price_exception, order.submit, and so on), action class (read, write, contact, commitment, transaction, decision, research), verification level (none, receipt, read_back, corroborated, person), required capability, authority class, latency class, data scope, cost class.The verification level is copied from the action type and can never be lowered. Anything that commits the business is verified by reading back the system of record.
Operation keyA stable identity for the external effect the item will cause, derived for fan-out children from the parent's key.Retries, redeliveries and fan-out cannot cause a duplicate side effect. Reconciliation looks the effect up by this key.
Lease and stateState machine: ready, claimed, running, returned, verifying, complete, waiting (with blocked_by, wait reason, wait owner and wake condition), failed, stopped. Lease with expiry; boundary_at marks the authority boundary.A lost recipient returns the item to the queue within one lease period. An effect after the authority boundary is recorded as a fact but never credited.
DelegationFor a delegated result: the agreement (what was asked, who accepted, due time, scope, evidence expected) and whether the case owner stays the same (contribution) or changes at acceptance (transfer).The distinction on the handoffs page is a field on the item, not a convention.

Verification and reconciliation

A return is not completion. Every return is verified at the declared level before the item completes: a receipt from the system, a read-back of the record, corroboration from a second source, or a person. An unverifiable return is routed to a person. When the outcome of a write is unknown (a timeout, a lost connection), reconciliation looks the operation key up in the system of record and records confirmed, absent or unknown. Absent means the item may be retried under the same key. Unknown is never retried automatically; it stays visible on the work board until a person resolves it. Every external effect is recorded as its own immutable fact, with the item, the key and the system reference.

Conflicts and fan-out

Items that touch the same conflict resource (a quote, an order, a contact's attention) are serialised on that resource. A parent item can fan out to children with a join rule (all, any, quorum); the parent cannot complete while a child is blocked, and nothing is silently dropped.

Stopping work

Stop anything in motion. Block what depends on it. Say why.

A stop order is a first-class object with an actor, a reason, a scope (item, subject, worker, objective, campaign, tenant or recipient class), a strength (hold, stop at the next cut point, abort) and a time. It is published on the scope's topics, acknowledged by every recipient holding affected work, and lifted only by a second recorded event. Lifting never resumes work blindly: every affected item re-checks eligibility before it moves.

Ready items in scope are held. Running items stop at the next cut point, or immediately on abort, and then reconcile by operation key. Dependents and join parents are blocked with the stop order as the reason. Obligations to people that depended on the work are not blocked; they are flagged as threatened commitments to their owner, who decides. For recipients the platform does not control, the backstops are grant revocation (adapter writes fail, the next claim is refused), the authority boundary (a later effect is recorded but never credited), and an acknowledgement deadline after which the item is marked stop unconfirmed and routed to a person. Safety stops are immediate and never batched.

The event spine

Readiness, claims, returns and stops are events. Nothing polls.

Every event is persisted before anything acts on it. The spine does five things in order: persist the envelope (occurred_at, received_at, class, type, subject); deduplicate on the tenant and a natural key, with a unique constraint deciding; order per subject under an advisory lock, applying and flagging late arrivals; apply caps (coalescing, breakers, bulk detection), which stop events bypass; then fan out through the transactional outbox and LISTEN/NOTIFY to subscriptions.

Three classes say where an event came from: observed (a CRM stage change, a signature completed, a payment failed), derived (computed from other events and business state, such as a champion gone quiet or coverage about to fall short) and emitted (produced for others: work ready, meeting booked, stop issued). Every event carries an event identity that survives replay; replay produces no duplicates, and a causal divergence on replay is detected and reported rather than applied.

Delivery is per subscription with a sequence cursor. A consumer checkpoints the cursor it has processed; after a reconnect within the cursor's retention window nothing is skipped. Deliveries that cannot be processed go to a dead letter with the reason and an owner. The absence evaluator, a scheduled job, is the only way "something did not happen" becomes an event.

The schedule catalogue is the complete list of clocked behaviour: timers that produce events (lease expiry, intended-time fire, stop acknowledgement deadline, acceptance window, response deadline), recovery sweeps (readiness and lease, stranded delivery) and jobs (absence evaluator, grading, maintenance). Each entry has an owner and a recovery rule. An interval read of a state table in the work, hand-off, stop or hands modules is a defect the architecture test catches.

Data

One PostgreSQL database. Every row knows its tenant.

Every table is one of four kinds, and the kind decides which rules apply. A schema conformance test classifies every table and index from the catalogue and fails on anything that fits no kind or breaks its kind's rules.

KindExamplesRules
Tenant-ownedEverything not listed below: instances, work items, plans, conversations, contacts, requests.tenant_id not null with a foreign key to tenant; application-generated UUID key; UNIQUE (tenant_id, id); created_at, updated_at where there is an update path, deleted_at where deletion is meaningful; every composite index leads with tenant_id.
Platform catalogueWorker definitions and versions, prompt layers, objectives, situations, procedures, skills, tool capabilities, authority classes, country profiles, evaluation cases, packs.The same columns; tenant_id is the platform tenant for library rows and the customer's tenant for rows the customer authored. A customer reads library rows through a repository method that allows the platform tenant plus its own tenant and nothing else.
Global transportevent_type, outbox, schema_migration.No tenant column where the row is not a tenant's data. The outbox carries tenant_id inside the envelope and uses a serial key because the relay needs commit order.
Immutable factevent, event_identity, audit_event, outcome_event, billing_event, invoice_line, adjustment, cost_record, hands_action, external_effect, identity_merge, verification, consent_record, compliance_decision.Tenant-owned columns plus the timestamp of the fact; no update or delete path in the application; UPDATE and DELETE revoked from the application role at the database, so immutability does not rest on convention. Anything that changes later is a new row in a separate table pointing at the fact.

Tenant-consistent references. A reference from one tenant-owned row to another is a composite foreign key on (tenant_id, id), so a row of one tenant cannot point at a row of another whatever the application supplies. References into the platform catalogue are the one exception, guarded by a trigger. Version pointers belong to their parent: every active_version_id is a composite key on the parent's own id, so a parent cannot point at another parent's version. There is no archive table. Retention is a policy per table kind; derived records have their own retention separate from the facts they were derived from. Identity merges are journaled as facts, never applied by rewriting history.

Business context

What is true, believed, promised or pending, as dated records with a source.

People, positions, relationships, initiatives, budgets, customer objectives, observations, commitments, work items, plans and interaction history are held as dated records with provenance and access control, in the same database. Reported information, verified authority and approved knowledge are distinct records with distinct trust. Approved product and policy knowledge, and the worker's long-term memory, live in the Knowledge Substrate, reached through its API with warrants; the platform does not reimplement a knowledge base.

Relationships are stored relationally in PostgreSQL. A graph projection (organisation, person, position, budget, initiative and their edges) can be built from the same tables when multi-hop path queries justify it, isolated from the Knowledge Substrate's stores. It is an option, not a store of its own, and no design decision depends on it.

Systems of record

The platform speaks its own model. An adapter translates. A grant decides.

The platform never speaks a vendor's vocabulary. Field and value mapping is versioned configuration per customer and per connector, because two systems of the same brand differ more than two brands do, and "what changed" must be answerable in seconds.

Connector admission. Every connector meets one common set of requirements: credentials from the tenant's vault prefix, a capability document listing every supported and unsupported capability of its class, health and rate reporting, stable identifiers for every record, idempotent writes on the operation key, receipts with a system reference and version marker for every write, and an authoritative lookup by operation key where the system can offer one. Then it meets the requirements of its class. The inventory class must read stock by item and location with a snapshot time and available-to-promise; reservation, where offered, is a transaction-class write. The quote and order class must create and read quotes with a version, take order intake, acknowledgement and status, and offer cancellation as the compensation path; order submission is two-phase, and status is read-back evidence. The CRM class must accept a suppression change without batching, which is what makes a system eligible to hold contact data at all.

Three integration methods. A native adapter, a scoped API or MCP tool, and an evaluated computer-use path through the hands environment are different methods with different evidence. Read access never establishes write readiness: write capability for a connector and action class is admitted only on recorded evidence from that customer's deployment (a test write, its receipt and its read-back), and the admission is itself a record. Connection readiness has three states: stored, authorised and tested.

Authority and compliance

Nothing is switched off. Everything privileged is granted. Compliance is a gate in the request path.

Every privileged action class starts at not granted. A grant carries a grantor with standing, a scope, a ceiling, an expiry, a reason and a review interval, and a grantor cannot confer authority they do not hold. Grades per action class are not granted, propose, act with approval, act within limits and act freely; tool grants and prompt-layer edit rights have their own short ladders, and a call resolves all of them with the most restrictive winning. A worker never authors a commitment; it sources one, from a price list, a pricing tool, an approval or a person, and records the source.

The compliance engine evaluates the customer's rule set in the request path before any contact and fails closed on an unanswered dimension. Control paths (a stop, an acknowledgement, a health check) are exempt from business gates so that a gate can never prevent a stop. Consent, suppression and the duty not to misrepresent the worker when asked are floors the platform enforces regardless of configuration. Human access, worker authority, compliance and entitlement are four separate checks with separate records.

Corvair's operating tenant. Corvair's own service operations run as a tenant of kind operations with its own scope and rights: health, cost, pause and release, and only the customer data those need, with every access recorded. It has no commercial authority in a customer's tenant.

Ledgers

Three separate things: a quality score, a verified business outcome, a customer charge.

A model may propose an outcome candidate. Independent system-of-record receipts or read-backs establish the business event, and the customer contract defines verification, acceptance and the billable unit. The ledger lifecycle is recorded, verified, accepted under the contract, billable, invoiced, with disputes, cancellations and reversals as appended adjustments. The business event is deduplicated across contacts, channels, retries and instances; one owning worker is attributed by a versioned policy and every contributing worker's costs are retained. A definition or skill version change cannot alter a contracted rate. A product's selling price, an internal transfer between a customer's own companies, the customer's budget and Corvair's fee are labelled separately on every record.

Cost. Every model, voice, messaging, email, retrieval, tool, simulation, evaluation, retry and failure cost is recorded against a usage key with an amount state (estimated, reconciled, unreconciled), attributed to tenant, deployment, instance, configuration version, work item, conversation, provider route and trace. Allowances are windows with soft alerts, hard holds and bounded grace for an active conversation; held work keeps its deadline and attribution. Traces may be sampled; cost, outcome and billing records may not.

Learning

Every conversation is scored. Every finding goes to one artefact. Every change is proven before a person approves it.

Scoring covers conversations and non-conversational work alike: tool results, verification failures, waiting time and rework. A finding is classified to one artefact (a business fact, a procedure, a configuration value, a prompt layer, a skill) and becomes a proposal against that artefact's version. Proposals are run against the evaluation cases and the regression suite before a person approves a release. No judged dimension gates a promotion, a grade or a floor without a passed calibration for the rubric version and evaluator binding. A corrected business fact does not change procedure; a changed procedure affects future work only from its release.

Infrastructure

Its own project. Shared only where it must be.

The platform runs in a separate Google Cloud project (production and staging as separate projects with the same layout) with its own Cloud SQL instance, backends, buckets, secrets and service accounts. It shares two things with the Corvair estate: the existing load balancer host rules and the Firebase project that issues identity tokens. Cross-project IAM is empty by default; any grant is a documented exception.

Ingress: the application host and the voice host through the load balancer only; jobs and hands have no ingress. Egress: every service through Direct VPC egress and Cloud NAT with reserved static addresses published to customers for allow-lists. Identity: people through Firebase with authorization native in the database and deny by default; six service accounts (api, voice, jobs, hands, tasks, scheduler) plus the CI deployer. Timers run on Cloud Tasks with one queue per priority. Secrets are held in Secret Manager by reference under tenant credential prefixes; a hands environment binds the secrets it is granted and never sees a value it is not. Cloud SQL is regional with a private IP and point-in-time recovery. Observability is Cloud Trace, Logging and Monitoring with billing export to BigQuery.

ComponentChoice
API and jobsPython and FastAPI on Cloud Run; jobs as Cloud Run Jobs started by Cloud Scheduler, one image and one entry point per job.
Voice bridgeCloud Run with CPU always allocated and session affinity; carrier media over WebSocket; Telnyx as the default carrier adapter with alternatives admitted on capability checks.
HandsGKE Autopilot, one pod per worker environment with a persistent volume.
StoreCloud SQL for PostgreSQL: truth, queue, event store, outbox, LISTEN/NOTIFY.
SurfacesStatic client, administration and setup surfaces from a bucket, served on one origin beside the API.
KnowledgeThe Corvair Knowledge Substrate through its API, with warrants.
Selected decisions

Why it is built this way.

A short selection from the decision log. Each has a recorded alternative and a reason.

DecisionReason
One PostgreSQL database for truth, queue and events; no separate queue, event store or graph database.One transaction can create a work item, its event and its outbox row together. A second store would need a second consistency story and a second recovery drill.
Hands as a fourth service in its own environment, without database access.Screen and file work needs persistent state and different scaling. Keeping it off the database means a compromised environment holds a principal's rights and nothing more.
Pending work exists only as plan items approved by the head.One creation path means one place to check objective, authority and cost before anything can be claimed.
Immutability by database permission, not by convention.A revoked UPDATE cannot be bypassed by a later feature. Later changes to a fact are new rows that point at it.
Verification level fixed by the action type and never lowered.The level a commitment needs is a property of the action, not of the moment. A quote or an order is always read back.
No automatic retry from an unknown reconciliation.An unknown write may have succeeded. Retrying blindly is how duplicate orders happen.
Configuration in three scopes: template, adaptation, binding.An engineer can see what was inherited and what was changed, and release a customer's version without touching the template.
Corvair service operations as a tenant of kind operations.The same authorization model governs Corvair's own access; it has no route to commercial authority in a customer's tenant.
Targets

Targets to design and test against.

MeasureTargetVerified by
Voice first token800 ms median, 1200 ms p95 from the contact finishing speakingPer-provider conformance suite; production metric
Barge-in to silence100 ms including the carrier clearConformance suite with reference audio
Voice availability99.5% in business hours; a dropped call is not a retry; an instance loss accounts for every call on itUptime metric; one callback obligation per affected call
Claim latencyp95 under 500 ms from work.ready to work.claimed within a regionBus integration test; production metric
Stop acknowledgementp95 under 5 s for platform hands; deadline configurable per recipient class, default 60 s, fail closedStop service metrics; acceptance test
Event durabilityZero events processed without a persisted envelope; replay produces no duplicates; nothing skipped after a reconnect within cursor retentionSpine acceptance tests
Unknown effectsZero automatic retries from an unknown reconciliation; every unknown visible until a person resolves itFault-injection tests
Duplicate side effectsZero across retries, redeliveries and fan-out childrenIdempotency tests with injected failures
Tenant isolationZero cross-tenant reads or writesRole matrix and cross-tenant test suite
Verification coverage100% of returns verified at the declared level before completion; no outcome event below read-backLedger invariant test
Environment recoveryA lost hands environment returns its task to the queue within one lease periodChaos test in staging
Operations visibilityEvery state change on the relevant board within 5 s; every alert has an owner and a runbook entry; a stale view says so after 15 sStream latency metric; alert catalogue review
AccessibilityThe four acceptance journeys pass keyboard only, screen reader, 200% zoom, 320 px width and reduced motionRecorded checks per release
RecoveryRecovery point under fifteen minutes; recovery time under four hours for the databaseQuarterly restore drill in staging
For evaluating customers

Ask for the full design set.

The complete design, requirements, acceptance criteria and decision log at version 2.2 are available to customers evaluating a pilot, under a simple confidentiality agreement.