Home Contact
Universal Substratev1.4
/
For agents Markdown

30. Runtime architecture, persistence, replay, scale, and recovery

The runtime uses one provenance spine and several explicitly subordinate stores. This is not accidental polyglot persistence: semantic records, high-volume telemetry, immutable artifacts, full-text discovery, graph traversal and low-latency feeds have…

Concept & directionLNK

The runtime uses one provenance spine and several explicitly subordinate stores. This is not accidental polyglot persistence: semantic records, high-volume telemetry, immutable artifacts, full-text discovery, graph traversal and low-latency feeds have different access patterns. Only the canonical ledger and artifact digests are required to rebuild the others.

Diagram showing the append-only semantic ledger as the source of record with object storage, telemetry lake, search, graph projections, cache and feeds as specialized rebuildable stores.
Picture 8

Specialized stores accelerate access; none may silently mutate semantic history.

#30.1 Store responsibility matrix

Logical storeAuthoritative contentRebuild / consistency
semantic ledgerrecord envelope, canonical bytes/digest, subjects, time, proofs, grants, receipts and outboxprimary transactional authority; append-only backups and point-in-time recovery
artifact storemedia, documents, raw telemetry, signatures, exports and model artifactscontent-addressed; manifest/digest audit; replicated independently
telemetry lakecolumnar sample segments, channel metadata and partition statisticsmanifest-authoritative; indexes/catalog rebuildable from manifests
graph projectionconfiguration, topology, relationships, provenance and continuity traversalseventually consistent; checkpointed deterministic replay
search indexpolicy-safe text, aliases, facets, recipes, public fields and discoverability rankingeventually consistent; never stores secret source as hidden searchable field
profile/feed cacheaudience-specific serialized views with ETag/versionshort-lived; key includes policy/schema/knownAt/location class
analytics warehousede-identified/authorized facts and derived aggregatespurpose-bound exports with lineage and revocation/deletion propagation

#30.2 Aggregate stream head and fenced writer

FieldPurpose / invariant
tenant_id + stream_idStable address of one independently ordered aggregate stream; neither value is inferred from a display name.
stream_kindDeclares the aggregate contract and legal transition set, such as entity, configuration, auction, action or settlement.
last_stream_seqMonotonic sequence inside this stream. A write supplies the expected prior value or is rejected as a concurrency conflict.
last_record_id + digestTail of the semantic hash chain. It makes omission or rewriting detectable when receipts are compared.
writer_epochFencing token issued to the active writer lease. A delayed writer from an earlier epoch cannot append after failover.
home_cellCurrent write cell for routing and recovery; moving it requires an explicit fenced handoff.
logical_shard_idStable routing to one logical ledger shard. The receipt-chain tail exists only on ShardHead.
  • Only one writer epoch is accepted for a stream at a time; lease expiry alone is insufficient without fencing.
  • RTracer promises no global semantic order across independent streams. Cross-stream views expose their contributing checkpoints.
  • A hash chain is tamper-evident, not magically tamper-proof. Independent receipt anchoring, backups and comparison are still required.
  • Cross-stream workflows are explicit sagas with durable intents, compensations and reconciliation—not hidden distributed transactions.

#30.3 Atomic append and transactional outbox

Table
Atomic append and canonical outbox - v1.4 pseudocode
BEGIN
  lock idempotency_binding(tenant, principal, operation, key)
  if existing.request_digest == request_digest: return existing result
  if existing and digest differs: quarantine EQUIVOCATION
  lock ShardHead rows in canonical shard-key order
  lock stream_head rows in canonical stream-key order
  recheck writer, policy, registry and shard-map epochs
  require expected_stream_seq == stream_head.last_stream_seq
  nextStreamSequence = stream_head.last_stream_seq + 1
  nextCommitSequence = shard_head.last_commit_sequence + 1
  build receipt using shard_head.last_receipt_digest
  insert record, receipt, exactly one canonical admission event and outbox row
  advance stream_head and ShardHead in the same transaction
COMMIT

Publisher emits the canonical lane by tenant + logicalShardId + chainEpoch in
commitSequence order. Consumer deduplication, projection mutation and checkpoint
advance commit atomically over a contiguous applied prefix.
BEGIN
  lock idempotency_binding(tenant, principal, key)
  if existing.request_digest == request_digest: return existing.result
  if existing and digest differs: quarantine EQUIVOCATION
  lock stream_head(tenant, stream_id)
  require writer_epoch == stream_head.writer_epoch
  require expected_stream_seq == stream_head.last_stream_seq
  validate canonical record and authorization at policy checkpoint
  assign tenant ledger_seq and next stream_seq
  insert record_ledger, record_subject, record_relation
  insert idempotency_binding(request_digest, result_record_id)
  insert outbox_event(ledger_seq, canonical_event_digest)
  advance stream_head(stream_seq, record_id, record_digest, receipt_digest)
COMMIT

Publisher claims outbox rows, emits at-least-once, records acknowledgement.
Consumers deduplicate by tenant + ledger_seq + event kind and checkpoint only
after the projection mutation is durable.
Table
Exactly-once is an outcome, not a transport promise
The platform assumes messages can be duplicated, delayed and reordered. Idempotent writes, immutable sequence IDs, deterministic consumers and durable checkpoints make the resulting projection effectively once-applied.

#30.4 Projection contract

AreaRequired declaration
identityprojection ID, version, code digest, schema/pack lock and owning team
inputtenant/logical shard epoch, starting/ending commitSequence, required record families and dependency projections
policyaudience, purpose, privacy/rights version and location precision class
determinismsame ordered inputs and versions produce byte-equivalent canonical projection output
checkpointlast committed sequence, state digest, watermark, lag and rebuild generation
correctionlate/corrected inputs update the projection; prior materializations may remain in audit storage
failurepoison event quarantine, retry policy, skip prohibition, degraded status and operator receipt
explanationinput record IDs, conflict decisions, derivation receipts and known/valid time

#30.5 Partitioning and tenancy

ConcernDefaultBoundary rule
ledger partitiontenant/realm then ordered sequenceCross-tenant global order is neither promised nor required
entity affinityentity hash inside tenantMulti-entity transaction uses coordinator or explicit eventual workflow
telemetrytenant / time / asset bucket / schemaPartition choice never becomes semantic identity
artifactcontent-addressed object plus tenant policy envelopeDeduplicated bytes do not imply shared authorization
search/graphtenant and disclosure classPrivate graph edges cannot leak through counts, ranking or timing
keystenant data-encryption key hierarchy and purpose-specific subkeysOwnership transfer does not transfer tenant/platform keys
regional residencypolicy-selected write region and replicasExports/replicas require explicit jurisdiction and receipt

#30.6 Consistency model

SurfaceConsistencyClient-visible contract
record appendlinearizable for one stream and one logical shard commit prefixIdempotency, next streamSequence, and next commitSequence observed atomically
read-your-writessupported by minimum checkpoint tokenClient may request projection checkpoint >= committed sequence
cross-projection vieweventually consistentResponse exposes each projection checkpoint; no false single snapshot
auction close/settlementstrongly serialized per auctionTrusted close decision, bid eligibility and sale authority evaluated once
social feed/searcheventually consistentStaleness acceptable within declared SLO; deletion/revocation priority lane
physical controloutside this platform planeRTracer record latency is not a safety-control guarantee

#30.7 Capacity and performance model

Capacity planning starts with record and artifact classes, not vehicle count alone. One museum car may produce a few records per month; a race car may produce millions of samples per session; a public vehicle agent may produce many reads with few writes.

DimensionPlanning inputControl
semantic writesrecords/second, canonical bytes, subject links and outbox fanoutbatch-free atomic writes, partition headroom and backpressure
telemetrysamples/second, channels, bytes/sample, duty cycle and compressionedge filtering, chunk size, multipart upload and tiering
mediacaptures/hour, resolution/duration, derivatives and retentiondirect object upload, digest verification and asynchronous processing
read trafficprofile/feed/search/query mix, audience policy and cacheabilitycheckpoint-aware cache, pagination, cost budget and rate limits
graph complexitynodes/edges/configuration, path depth and time slicesbounded queries, precomputed views and explainable truncation
replayledger records, projection cost, parallel partitions and target recovery timeversioned snapshots/checkpoints plus full reproducibility test

#30.8 Service objectives and error budgets

SurfaceObjective familyImportant qualification
canonical appendavailability and p95/p99 latency by write classExcludes authorized rejection; includes atomic durability and receipt
owner projectioncheckpoint lag and read availabilityMust expose staleness token; read-your-write option budgeted
public profile/feedfreshness, cache hit, correction/removal propagationPrivacy revocation has tighter objective than ordinary content
telemetry admissionaccepted bytes/sec, queue age, dropout and manifest latencyBackpressure before memory/disk exhaustion; no silent sampling
auctionbid acceptance/ordering and close/settlement availabilityNo degraded close that changes winner semantics
recoveryRPO/RTO per ledger, artifact, telemetry and projectionsCanonical history and keys have stricter targets than rebuildable indexes

#30.9 Backup, disaster recovery, and integrity scrubbing

  1. Continuously replicate canonical ledger logs and object manifests to an administratively independent failure domain.
  2. Back up schema/vocabulary/pack registries and encryption/key metadata under separate access controls; encrypted data without recoverable authorized keys is lost.
  3. Verify backups by scheduled restore into an isolated environment, then replay projections and compare known digests/checkpoints.
  4. Run periodic artifact integrity scrubs against stored digests; repair from replica or mark unavailable with an incident record.
  5. Maintain a documented failover decision, split-brain prevention, recovery sequence and reconciliation path for writes accepted near outage boundaries.
  6. Record recovery actions and data-loss boundaries as operational receipts; do not imply perfect continuity when RPO was exceeded.
  7. Exercise tenant-level export and restoration so a local failure or commercial migration is not dependent on the original platform instance.