Module writeplane
Expand description
The shared write-plane machinery for the public one-shot SQL surface
(303-PUBLIC-SQL-COORDINATOR-EXTRACTION-PLAN.md). PR 0 landed two layers, PRs 1–4 the
coordinator’s batch, DDL, script, and migration slices:
bookkeeping— the outcome cache, migrations journal, idempotency key/identity family, and result-limit family the one-shot orchestrations read and write, moved wholesale from the replicator (decision C2) so no later slice enumerates symbols across the crate boundary again.budget— the shared wall-clock watchdog and VM-instruction ceiling for one public statement holding a write connection.storage— connection-only lmid/producer-watermark bookkeeping, table bootstrap/upgrades, and destructive-DDL safety guards.- the error plane (decision C3):
WritePlaneErrorwith the two public renderers (render_public_sql_error,render_public_script_error) over the moved body builders, andBookkeepingError— the moved helpers’ narrow error currency, which converts losslessly into both the replicator’sMasterErrorandWritePlaneError. oneshot— theOneShotBackendtrait (decision C1) and the shared coordinators:execute_public_batch(PR 1),execute_public_ddl(PR 2 — the optimistic C5 flow whose fresh apply is the backend’s own critical section),execute_public_script(PR 3 — per-index derived keys dispatching into the other two, failure as data inScriptOutcome), andexecute_public_migration(PR 4 — the replay/adopt matrix as a closure inside the host-ownedwith_migration_barrier, over theMigrationSectionview — C6), plus the replay spine (stored_public_operation, generic underneath asPublicReplayReadsandresolve_replay_cursor— C4).conformance(behind thetestkitfeature) — the tier-A scripted mock battery and the tier-B black-box scenarios everyOneShotBackendhost must pass.request— pure/v1/sql/*path/body shaping intoPublicSqlRequestorPublicSqlRejection.public_httpshares the two-token decision, request-id validation, response envelopes, read execution, and schema-generation refresh without depending on an HTTP library. Hosts retain header extraction, project fencing, body limits, sockets, and dispatch.
Nothing in this module reads a clock — functions that need time take it as a parameter
and the hosts pass their own now_millis().
Modules§
- bookkeeping
- The public-SQL bookkeeping layer every one-shot write host shares
(
303-PUBLIC-SQL-COORDINATOR-EXTRACTION-PLAN.md, PR 0 — decision C2): the exact-replay outcome cache, the migrations journal, the idempotency key/identity family, and the result-limit family, moved wholesale from the replicator. Conn-bound functions included — this crate links SQLite — so the coordinator’s control flow never reaches back across the crate boundary for a helper. - budget
- Shared limits for one public statement holding a write connection.
- oneshot
- The shared one-shot coordinator (
303-PUBLIC-SQL-COORDINATOR-EXTRACTION-PLAN.md, PRs 1–4): the public-SQL batch, DDL, script, and migration orchestrations — validation, replay decisions, the statement loops with their byte accounting, the lost-race re-reads, and the migration replay/adopt matrix inside the host-owned barrier — written once over theOneShotBackendtrait so a second write host implements the trait instead of re-deriving the control flow. - public_
http - Transport-neutral policy and JSON bodies shared by the two
/v1/sql/*HTTP hosts. - request
- Pure request shaping for the write plane’s two intake surfaces.
- storage
- Connection-only write-plane storage, schema upgrades, and DDL safety guards.
Structs§
- Deploy
Migration Request - One private deploy migration after transport parsing. This is deliberately distinct from the
public
/v1/sql/migraterequest (PublicSqlRequest::Migration): deploy migrations also admit data-only files and an operator-reviewed checksum override. - Migration
Record - One row of the migrations journal — the durable identity a replayed migration tag is validated against. Every decision over it belongs to the caller; the readers here only decode.
- Producer
Census - How many distinct producers hold durable watermark state — the growth signal design 306 §4 names as the mitigation for the one contract it cannot enforce server-side.
- Public
Migrate Ack - The typed outcome of one public migration:
appliedisfalseon an exact replay. The cursor is required — a fresh apply always commits one, and a replay either resolves the exact stored cursor or refusesMIGRATION_OUTCOME_UNAVAILABLE(extraction plan C6). - Public
Operation Commit - The typed outcome of one committed — or exactly replayed — public one-shot operation.
resultsare wire-encoded statement results (the dedicated tagged SQL codec), so a stored replay is byte-equivalent to the fresh commit; the hosts wrap this in their own success envelope (decision C7 — routing metadata and the HTTP layer stay per-host). - Public
SqlRejection - A transport-neutral public SQL parse/validation failure. The host supplies only its concrete HTTP response wrapper; status, typed code, retry scope, and transaction-state semantics are fixed here.
- Script
Outcome - The typed outcome of one public script (execute-multiple). A script never fails at the
top level — failure is data: the completed prefix’s wire-encoded
results, the last committed statement’scursor, and the failing statement’s index with its pre-classified error. The hosts renderfailurethroughrender_public_script_errorand wrap success per-host (decision C7). - SqlAuthorization
Error - Stored
Public Outcome - One stored exact-replay outcome of the public SQL surface (the replicator’s
SqlOutcomeRecord, renamed on the move — extraction plan C2).
Enums§
- Bookkeeping
Error - The narrow error currency of the moved
bookkeepinghelpers (extraction plan, decision C2). It converts losslessly into BOTHMasterError(the replicator’s remaining call sites, via itsFromimpl there) andWritePlaneError(the coordinator) — four 1:1 arms each, no catch-all, so a fifth variant is a compile error on both conversions. - Migration
File Kind - The classification of one migration file: only-DDL or only-data (mixed files are refused).
- Public
Read Consistency - The read routing posture selected by the public request’s explicit or client-wide default.
- Public
SqlRequest - A fully shaped request from the public SQL surface. Hosts map this value into their own dispatch currency; no transport-specific response or command type crosses this boundary.
- SqlIngress
Auth - Authentication posture for the versioned public SQL surface.
- SqlOutcome
Namespace - The two durable retention-floor namespaces of the outcome cache: one-shot operations
(
sql-operation:keys) and public transactions (sql-transaction:keys). - Write
Plane Error - The one-shot write plane’s error currency (extraction plan, decision C3). Classification
into this enum happens exactly once per host — the replicator’s exhaustive
From<MasterError>— and rendering happens exactly once, inrender_public_sql_error/render_public_script_error, so the typed public codes and theSQLITE_ERROR/sqlite_codeclassification can never be collapsed into strings and reconstructed. There is deliberately NO conversion out of this type: helpers that both hosts and the coordinator call returnBookkeepingErrorinstead, so the one-way promise is enforced by the type graph.
Constants§
- CLIENT_
MUTATIONS_ TABLE - The replicated bookkeeping table carrying each client’s high-water mutation id.
Single-
_prefixed: captured by CDC (unlike__replica_meta) and hosted by the engine like any base table — each client’s lmid flows to it through its own one-row system query, transactionally with the data (§8.2). - DATA_
MIGRATIONS_ TABLE - Replicated apply-once journal for pure-DML migration files. Unlike the DDL journal this table is part of the capture registry: its marker row is the final change in every data-migration run, making zero-user-effect files durable and carrying identity through restore/promotion.
- LOG_
META_ TABLE - A tiny single-row-per-key bookkeeping table. Holds
gc_floor— the highest cursor the GC has reclaimed, persisted so the fan-out’scursor-too-oldcheck survives restart and never regresses (CHANGE-SOURCE-DESIGN.md§10.2) — and the durable SQL-outcome retention floors (SqlOutcomeNamespace::floor_key). Not registered for capture. - MIGRATIONS_
JOURNAL_ TABLE - The producer-side migration journal (
MIGRATIONS-VIA-CHANGELOG-DESIGN.md§4): a master’s record of “have I already minted addljournal frame for this migration id.” It is the idempotency key for the migrate surface (a re-POST of a knowntagis a no-op), NOT the ordered transport — that is the journal’sddlframe. Host-local, NOT registered for capture, so it never ships downstream (Drizzle-compatibletag, §3.2). - OUTCOME_
RETENTION_ LMIDS - Retention bound for
ROOM_MUTATION_OUTCOMES_TABLErows, by lmid distance — never by time (Slice I-ii). When a room flush advances a(doc, client)ledger row tolmid, rows withmid ≤ lmid − Kprune in the same transaction.K = 512mirrors the room shell’s per-client recorded-outcome FIFO cap (MAX_RECORDED_OUTCOMES_PER_CLIENT = 512,packages/room/src/shell.ts) — the two ends of the outcome-resolution surface degrade at the same depth. The accepted loss class is the H-v one: a pruned mid reads asappliedthrough the daemon, exactly as an evicted map entry re-answers with silence on the room socket; a client is only ever that far behind its own ledger with a backlog ≥ K in flight. - PRODUCER_
OFFSETS_ TABLE - The foreign-write dedup watermark (design 306): one row per producer, overwritten in place.
- RINDLE_
REQUEST_ ID_ HEADER - ROOM_
CLIENT_ MUTATIONS_ TABLE - The domain-scoped ledger for room-flush lmid co-commits
(RINDLE-REALTIME-QUERY-ENABLEMENT-DESIGN.md §7.1). Keyed by
(doc, client_id)— one gapless mid stream per domain, one ledger row per domain — so a room flush and a slow-path daemon mutation for the SAME client never collide on a shared row (the Rev 1 data-loss bug, §8.5’s “ledger isolation” invariant).CLIENT_MUTATIONS_TABLEstays exclusively the slow-path stream; room flushes retarget here. - ROOM_
MUTATION_ OUTCOMES_ TABLE - The durable twin of the H-iv-b
mutationOutcomeframe ({mid, kind, reason?, name?, args?}), keyed(doc, client_id, mid)— the §4 lifecycle’s outcome-resolution surface for THE NAMED INVARIANT: never retire a room-domain entry off a daemon-carried lmid without outcome resolution (§3.3/§7.5). After downgrade the room socket that ordered outcome-before-ack is gone, so non-applied verdicts must be readable through the daemon subscription plane like the §7.1 ledger row. Rows are written by Slice I-ii’s flush split — this slice only creates + registers the table; an absent row for a covered mid reads asapplied(only non-applied outcomes are recorded, matching the room shell’s recorded-outcome map). - ROOM_
PLACEMENT_ TABLE - The room placement-fence table (
RINDLE-REALTIME-DESIGN.md§2.5): one row per doc, bumped by every claim. A flush carrying an epoch below the current claim is fenced — validated with the apply on the single-threaded engine, so the check and the commit are atomic. Unregistered bookkeeping likeSOURCE_OFFSETS_TABLE. - ROOM_
WATERMARK_ TABLE - The §4.2 downgrade fence:
(doc, flush_seq), co-committed monotonically in every room flush’s transaction (ClusterConsumer::commit_room_flush). Cross-authoritycvs are incomparable, so the fence is data that RIDES THE ECHO: a downgraded client keeps its frozen ghost source until its daemon subscription deliversflush_seq ≥ finalFlushSeq— proof the store it fell back to holds the room’s final flush, whatever the authority shape (single daemon / lagging read-follower / PG). - SCOPE_
SESSIONS_ TABLE - The §4.1 occupancy table (RINDLE-REALTIME-QUERY-ENABLEMENT-DESIGN.md): one row per
(scope, session), upserted by the api-server on every labeled lease mint/renewal and aged out lazily byexpires_at(mark/refresh/age-out — lease expiry needs no hook anywhere). The row delta IS the upgrade doorbell: a solo client’s only live connection is its daemon subscription, so the 1→2 wake signal must materialize as a row in the store it is subscribed to — which is whyDb::enable_realtime_lifecycleregisters this table rather than just creating it. - SOURCE_
OFFSETS_ TABLE - The durable per-change-source cursor table (CHANGE-SOURCE-DESIGN.md §4). One row per
source; the offset upsert is co-transactional with the batch it covers
(
ClusterConsumer::commit_normalized_with_offset). Daemon bookkeeping — NOT registered for capture (same posture as_rindle_sql_outcomes; the consumer’s own resume position is meaningless on any other host). - SOURCE_
OFFSET_ WHOLE_ RUN - The
chunk_seqsentinel meaning “the whole run at thisoffsetis durably applied” — the common case (every pure-row run and every run-boundary commit). A genuine value< thisis a mid-run checkpoint(offset, chunk_seq)left by the commit-at-DDL-boundary follower (RELAY-DDL-DESIGN.md §6.6): chunks0..=chunk_seqofoffsetare applied, the tail is not. The resume/dedup compare is the keyset(offset, chunk_seq), with the incomingbegin(R)treated as(R, WHOLE_RUN)— so a whole run sorts at/above any of its mid-run positions.i64::MAXis safe as a sentinel:chunk_seqis a 0-based within-run ordinal (one per spilled ≤CHUNK_ROWSchunk), so a real value reachingi64::MAXis physically impossible. Mirrors the relay fan-out’sScanPos“past the end of this run’s chunks” sentinel (rindle-replicator). - SQL_
IDEMPOTENCY_ MAX_ FUTURE_ SKEW_ MS - Public idempotency keys carry their mint time so an evicted outcome can fail closed without retaining one tombstone per operation. A modest future-skew allowance accommodates ordinary client clock drift while bounding how far one forged key can ratchet the durable floor.
- SQL_
IDEMPOTENCY_ PREFIX - The canonical public idempotency-key prefix:
sql1.<13-digit-unix-ms>.<32-lowercase-hex>. - SQL_
OUTCOMES_ TABLE - Exact replay records for the public SQL surface. The result is stored before commit;
run_idis known before the journal assigns a cid and resolves back to that journal point on replay. A zero-effect mutation uses a local metadata-only commit and therefore stores no run id/cursor. - SQL_
OUTCOME_ MAX_ RECORDS - Retained-outcome count ceiling; the sweep evicts oldest-first beyond it.
- SQL_
OUTCOME_ RETENTION_ MS - How long one stored public outcome is retained before the sweep may evict it.
- WRITE_
DDL_ TIME_ BUDGET - DDL’s longer wall-clock fence while every other writer is quiesced.
- WRITE_
STATEMENT_ TIME_ BUDGET - Default public writer-statement wall-clock fence.
Traits§
- Migration
Section - The migration-store view
OneShotBackend::with_migration_barrierpasses to its closure. Reads carry NO decisions — the replay/adopt matrix over them isexecute_public_migration’s, the same compiled code on every host; every op executes under the barrier’s exclusion span. - OneShot
Backend - The backend contract of the one-shot public SQL surface. The master implements it over its
session-transaction primitives; a standalone daemon implements it over its own store (303
S5). Every method returns pre-classified
WritePlaneError— classification happens once, host-side, and there is no conversion back out (decision C3). - Public
Replay Reads - The three reads behind the shared replay spine, generic over the host’s error currency.
The coordinator instantiates it over
OneShotBackend(withWritePlaneError); the replicator’s transaction-outcome cursor path instantiates it over a raw connection withMasterError— ONE decision matrix and ONE resolver, no twin, which is what decision C4 means by “generic by construction”.
Functions§
- adopt_
migration_ checksums - Backfill a migration row’s optional identities without overwriting values already made durable. Hosts own the surrounding transaction because producer metadata commits differently on HCTree and WAL2; the column contract is shared.
- append_
bounded_ script_ results - Append one batch’s results to a script’s partial-result set, charging the shared aggregate byte allowance (separators included) and failing with the public result-cap error on overflow.
- authorize_
sql_ ingress - Apply the two-token authority rule after a host has supplied its header matcher.
- classify_
migration_ file - Classify one migration file’s statement vector as DDL or data, refusing mixed and unsupported statement classes.
- cursor_
history_ lost - data_
migration_ checksum - The recorded content checksum of a DATA migration
tag, if one was applied (the kind-collision probe for the DDL surface’sMIGRATION_KIND_MISMATCHrefusal). - ddl_
only_ violation_ message - Enrich the DDL-only guard’s rejection when a
DROP TABLEcaused SQLite’s implicit foreign-key delete. - encoded_
statement_ result_ len - The encoded wire length of one statement result — the unit the aggregate result cap accounts in.
- enforce_
encoded_ result_ array_ limit - Enforce the aggregate cap over an already-encoded result array (the replay path’s check).
- ensure_
data_ migrations_ table - Create the captured apply-once data-migration journal.
- ensure_
log_ meta_ table - Create the host-local outcome-floor table.
- ensure_
master_ migrations_ table - Create the producer/master shape of the DDL migration journal. A daemon with its existing
surrogate-key shape calls
ensure_migration_identity_columnsinstead. - ensure_
master_ run_ id_ indexes - Index the two
run_idcolumns the master’s post-commit path seeks on — master only, and deliberately not part ofensure_sql_outcomes_table. - ensure_
migration_ identity_ columns - Add the common identity columns to either supported
_rindle_migrationstable shape. - ensure_
outcome_ matches_ request - Refuse a replay whose stored request identity differs from the retried request
(
OPERATION_ID_MISMATCH). - ensure_
producer_ offsets_ table - Create the foreign-write producer watermark table.
- ensure_
sql_ outcome_ identity_ column - Add exact-request and resolved-cursor columns to a legacy outcome cache.
- ensure_
sql_ outcomes_ table - Create the exact public SQL outcome cache in its current shape.
- ensure_
writeplane_ tables - Create every storage table owned by the producer/master write plane.
- execute_
public_ batch - Execute one public SQL batch: validate the idempotency key against the caller’s
now_ms(future skew bounded — the coordinator reads no clock), check for an exact replay, then run every statement inside one backend transaction while bounding the encoded result array — the JSON array delimiters (2 bytes) and inter-result separators count towardaggregate_result_byte_limit— and commit with the outcome row. Any statement or accounting error rolls the unit back. A commit error is re-read: a concurrent request carrying the same identity may have won while this attempt was open, and its co-transactional outcome is authoritative — the exact stored bytes are returned instead of a duplicate-key/conflict error. - execute_
public_ ddl - Execute one public DDL operation: validate the idempotency key against the caller’s
now_ms, refuse non-DDL statements before any backend call, check for an exact replay, then hand the fresh apply to the backend’s critical section as one atomic unit (OneShotBackend::apply_public_ddl). - execute_
public_ migration - Execute one public migration (extraction plan C6): apply a permanent, checksum-guarded migration identity, where reusing an id with identical bytes is an exact replay and reusing it for different DDL is refused instead of silently accepting schema drift.
- execute_
public_ read - Execute the shared public read path on a host-owned read connection. The host supplies its current committed cursor lookup; connection ownership stays outside.
- execute_
public_ script - Execute one public script (execute-multiple): an ORDERED sequence of autocommit units,
each dispatched by statement class into
execute_public_batch(reads/writes) orexecute_public_ddl(DDL) under a per-index derived idempotency key —sql-script:<key>:<index>. Replay identity across retries depends on that exact format: every completed statement’s outcome is stored under its derived key, so a retry of the whole script replays the durable prefix instead of re-applying it, then resumes at the statement that failed. Transaction-control statements and classes outside the v1 surface are refused without reaching the backend. - insert_
sql_ outcome - Insert one outcome row inside the caller’s open transaction (co-transactional with the
effects it records).
created_atis the host’snow_millis()— this module reads no clock. - insert_
sql_ outcome_ with_ cursor insert_sql_outcomewith an exact cursor written atomically. Standalone WAL2 commits use this form because their nextTxIdis known inside the open transaction; the HCTree master continues to insert a run id and backfill its engine-assigned cursor after commit.- journal_
data_ migration - Record a pure-data migration inside the caller’s captured transaction. The marker is the final captured row in that migration, so a zero-user-effect file is still durable and replay identity survives restore.
- journal_
migration - Record that
tag’sddlentry has been minted, inside the caller’s open transaction (so the journal can never disagree with the log entry it guards across a crash, §4). - journal_
migration_ with_ cursor journal_migrationwith the host’s exact commit cursor written in the same transaction. WAL2 authorities know their nextTxIdbefore COMMIT and use this form; HCTree keeps using the run-id form and resolves/backfills its engine-assigned cursor after commit.- migration_
content_ checksum_ from_ record - A record’s canonical content checksum: the stored one when present, else derived from the
normalized statements (the legacy pre-
content_checksumrow shape). - migration_
normalized_ statements_ from_ record - Decode and re-normalize the statement vector a migration record stored, if any.
- migration_
record - Whether migration
taghas already minted addllog entry (the producer idempotency check,MIGRATIONS-VIA-CHANGELOG-DESIGN.md§4). - parse_
public_ idempotency_ key_ at - Parse one canonical public idempotency key (
sql1.<13-digit-unix-ms>.<32-lowercase-hex>) against the caller’snow, returning its mint time. Future skew beyondSQL_IDEMPOTENCY_MAX_FUTURE_SKEW_MSis refused. - parse_
public_ or_ derived_ idempotency_ key_ at - Like
parse_public_idempotency_key_at, additionally admitting the server-derived script form (sql-script:<canonical-parent>:<index>). - pre_
ddl_ table_ names - Snapshot the non-internal table names before a DDL run.
- producer_
offsets_ ddl - The
CREATE TABLEfor the foreign-write producer watermark. Shared verbatim by every host that mints it — the connection-only bootstrap here, rindled’s cluster DDL, the write-master’s open batch, and the restore’s runtime initialization — so the four cannot drift into two shapes. - producer_
offsets_ upsert_ sql - The producer watermark’s upsert, shared with the capture-aware writers that must run it through
their own
exec(the row is replicated data, not connection-local bookkeeping) rather than throughupsert_producer_seq. - public_
commit_ outcome_ on_ conn - Resolve the terminal outcome of a public transaction from committed metadata only.
- public_
idempotency_ minted_ at_ ms - Derived execute-multiple keys retain their parent public identity and therefore its floor timestamp. The suffix is server-created and never accepted directly at public intake.
- public_
transaction_ minted_ at_ ms - The mint time encoded in one public transaction id (
…-<hex-nanos>[-ro]), if parseable. A pure parser — the transaction-namespace seams stay host-side, but the outcome sweep consults this forsql-transaction:keys. - read_
lmid - Read the durable last mutation id for
client_id, or zero when absent. - read_
producer_ seq - Read the durable last sequence a producer wrote, or zero when the producer is new.
- read_
sql_ outcome - Read one stored outcome row — a record read only, no decisions.
- refresh_
generation_ bound - Replace a generation-bound resource only after its successor opens successfully. Failed refreshes retain a healthy predecessor and stay retryable.
- refuse_
broken_ foreign_ keys - Refuse a DDL run that leaves a dangling foreign key or recreates a referenced table without its referenced key.
- render_
public_ script_ error - Render one script (execute-multiple) failure: the same classification ladder as
render_public_sql_errorwith the script’sstatement_index+partial_resultskeys, preserving the completed prefix of the ordered autocommit script (the replicator’s oldscript_sql_error, arm for arm). - render_
public_ sql_ error - Render one one-shot public SQL error — the single classification-to-bytes truth every
host shares (the replicator’s old
master_sql_errormatch, arm for arm). A host classifies its own error type intoWritePlaneErroronce, renders here, and wraps the(status, body)pair in its HTTP layer. - resolve_
public_ outcome_ cursor - Resolve the exact cursor carried by one retained outcome row —
resolve_replay_cursorwired to the outcome surface: the run_id scan, and the durable outcome row as the GC-race re-read. - resolve_
replay_ cursor - The ONE exact-cursor resolution algorithm (decision C4), generic over the durable row it
resolves: the stored
cursorshort-circuits, then the legacyrun_idscan, then the GC-race re-read of the durable row filtered on the same run_id — journal GC may have backfilled the row and removed the run frame between the first read and the scan, so the re-read is what carries correctness. The outcome surface wires it to the outcome row (resolve_public_outcome_cursor); the migration surface wires it to the section’s scan withrecord()as the re-read leg, inside the barrier. - shape_
deploy_ migrations - Shape the private
/migratebody into its migrations plus whether the caller used the batch form. - shape_
public_ sql_ request - Shape one public SQL path/body pair.
Nonemeans the path is not a recognized public SQL route and lets the host preserve its ordinary 404 behavior. - sql_
error_ response - Build one public SQL error body:
{code, message, retry_scope}plus the optionalsqlite_codeandtransaction_statekeys. Returns(status, body); the hosts wrap the pair in their own HTTP layer (C7 — response wrapping stays per-host). - sql_
operation_ key - The outcome-cache key of one public one-shot operation.
- sql_
outcome_ floor_ ms - The retention floor for
namespace: the durable ratcheted floor, never below the TTL horizon derived from the caller’snow_ms. - sql_
outcome_ minted_ at_ ms - The mint time carried by one stored
sql-operation:outcome key, if canonical. - sql_
request_ identity - The canonical request identity of a statement vector — the compact JSON encoding an outcome row stores so a replayed key can prove it carries the same request.
- sql_
result_ limit_ error - The public result-cap error, worded once.
- sql_
success_ body - Wrap statement results in the common write-authority success envelope.
served_bynames the authority role that actually answered —"master"on the replicator,"standalone"on a source-less daemon — so observability keyed on routing never invents a replication plane that isn’t there. - statement_
class_ name - The wire-visible human name of one statement class — embedded in stable public error messages, so it moves with the classifier rather than being re-derived per host.
- statement_
is_ drop_ table - Whether
sqlis a comment-tolerantDROP TABLEstatement. - statement_
sql_ error - Render one typed public-surface statement failure.
- statement_
sql_ error_ status - The public statement surface’s status ladder: result caps are 413, an expired exact outcome is 410 (gone), an identity/checksum conflict is 409, everything else 400.
- stored_
public_ operation - The replay spine at the coordinator surface:
stored_public_operation_overdriven through the backend trait. Used by both the batch and DDL flows. - stored_
public_ operation_ over - The shared replay decision matrix (decision C4), generic over the host error: a miss whose
key minted at or below the retention floor fails closed (
OPERATION_OUTCOME_EXPIRED); a stored request identity that differs from the retry refuses (OPERATION_ID_MISMATCH); a run_id-bearing outcome whose exact cursor cannot be resolved refuses (OPERATION_OUTCOME_EXPIRED) rather than answer with a fabricated cursor. - sweep_
sql_ outcomes - Evict expired and over-quota outcome rows and ratchet the durable per-namespace retention
floors.
nowis the host’s clock; runs inside the host’s own bookkeeping transaction. - take_
changes - Move a validated
changesarray out of a parsed request body without cloning itsValuetree. Non-array and absent fields preserve the existing empty-vector fallback. - upsert_
lmid - Upsert the durable last mutation id inside the caller’s open transaction.
- upsert_
producer_ seq - Upsert the producer watermark inside the caller’s open transaction. MUST run in the same transaction as the effects it deduplicates, so a crash can never commit an effect without its receipt (design 306 §3.2).
- validate_
public_ ddl_ poststate - Validate the producer-side post-state shared by standalone deploy migrations and public SQL DDL. Call this from the schema transaction’s final validation hook, before any outcome/journal tail and before COMMIT, so every refusal rolls the schema and its host bookkeeping back as one unit.
- validate_
public_ request_ id - Validate the optional public request-id header and build the shared typed rejection body.
- validated_
request_ id - Return the one canonical request id, rejecting absent, duplicate, and malformed values alike.
Callers use this only for response echo; absence therefore maps to
None. - with_
writer_ statement_ budget - Run one public writer statement under the standard DML or DDL limits.
- with_
writer_ statement_ limits - Run one public writer statement under caller-supplied limits. Exposed for deterministic
boundary tests; production hosts normally use
with_writer_statement_budget.