Rolling upgrades: builds N-1 and N side by side
Every Loom process is a full replica behind one URL, and an upgrade replaces them one at a time.
Every Loom process is a full replica behind one URL, and an upgrade replaces them one at a time. For the length of a rollout, and again during a rollback, the previous build (N-1) and the new one (N) serve the same clients against the same ClickHouse, on N’s schema. These rules keep that safe. The operator procedure is in upgrades.
An insertion fence cannot coordinate a writer that does not take it. The memory writer fence cutover drains older serving and background writers and settles their bounded sends before the source-head guarantee applies.
Retirement of an N-1 participant also requires its authority-store work to settle.
Under Postgres, a client without participant session tags is recertified only
after all generic loom authority backends are absent, including idle pools.
Stop and drain those legacy clients before the final retirement census; tagged
participants can remain live. ClickHouse-authority recovery uses the verified
deployment’s ClickHouse checks. Neither path treats an unknown authority as empty.
See the participant lifecycle baseline.
The rules
-
Migrations are additive and run at boot under the migration lock. N-1 keeps reading and writing every table it knew (
tests/unit/test_migrations_additive.py). N-1 booting on N’s schema logs one WARNING naming the migrations it does not carry (server/boot.py::warn_newer_schema) and serves. -
A version row keeps columns its build does not know.
loom.memory,loom.shared,loom.memory_embeddings,loom.session_summaries,loom.entity_summariesandloom.documentsareReplacingMergeTree(version): the newest row replaces the whole previous one. Before each insert into them,ch.insertfills every stored column outside its build’s row builder from the newest stored version of the row’s key (server/core/rmt_carry.py), so N-1’s touch, revision or tombstone keeps the values N wrote to N’s new columns. This costs a cached lookup while every build agrees with the schema, and one extra keyed read per insert while a newer column exists. A moved document’s row is a new key (its new namespace). A move N-1 makes after N’s migration added aloom.documentscolumn fills that column from the new key’s newest row (a document deleted there, or the column’s default), not from the source’s: the copy lacks that value for good, and a restore of the source, whose deleted row keeps it, brings it back there. A move N makes builds the row with every column; its chunks and table rows are copied withSELECT *and keep every column.- Each process checks
loom._migrationsand the carried tables’ metadata time every 2 s in the background and then re-reads the column lists. - A write that took the lists before the
ALTERwould still drop the column. So each process acknowledges the lists it carries by inloom.carry_acks(a fingerprint per carried table), once no write that took older lists is in flight, and a booting process waits, after its migrations and before it serves, until every other live process acknowledges the schema it now has (await_acks, 120 s, orLOOM_CH_TIMEOUT_WRITE_S+ 60 s when that is longer, then the boot fails naming them). A process killed without withdrawing can leave a carried INSERT running after its acknowledgement expires, so each carried query id names its process, and the boot also waits whilesystem.processeson any replica shows a carried insert of a process that no longer acknowledges (when it cannot read them, while such a process acknowledged within the longest an insert can run). A process withdraws at shutdown (acknowledges no table) only once no carried write of it is in flight or pinned, and the boot also waits for a withdrawn process whose carried insert still runs. N therefore writes a new column only once no writer that would drop it is left. The acknowledgement gates the writes: a carried write runs only while this process’s last published acknowledgement is younger than 15 s (half the 30 s a boot counts it for). Otherwise (never enrolled, a failed publish, a pause past expiry) the process publishes, re-reads the lists and publishes again before writing, and refuses the write (503, retryable) when any step fails, as it does when it cannot read the lists. The watcher re-publishes every 7.5 s, so a write rarely renews it, and concurrent writes that find it stale wait for one renewal. ClickHouse fences each carried batch on arrival: it is sent asINSERT … SELECT … FROM input(…)whoseWHERE throwIf(…)refuses it when, as the query starts, the table has a stored column outside the lists the rows were built against: a request held in transit (a proxy, a retry) past an ALTER lands no row, and the write answers 503 and is retried with fresh lists. A query that started earlier is bounded by itsmax_execution_time(60 s when the write class has no limit); the guard reads the receiving replica’s metadata. Each batch also carries a start deadline on the server’s clock (send time + 15 s, the clock measured from this process): one that starts later is refused, so a request still in transit can start only until then. A write that ends in an error or a cancellation after a send stays in flight, no newer lists acknowledged, until the server’s clock passes its deadline plus itsmax_execution_time(when no query of it can run or start); once the deadline has passed,KILL QUERY … SYNCand a count of 0 insystem.processeson every replica release it earlier. A held write whose queries cannot be counted shows on/v1/healthascarry_write_pinned. The acknowledgements keep old writers from meeting that refusal during a rollout; the guard makes a late one harmless. It costs a carried insert about 5 ms at p50. This fails closed: whileloom.carry_ackscannot be written, every carried write (memory.setamong them) answers 503. - A new key’s row leaves the column out, so ClickHouse computes its
DEFAULT. - Only state columns may be added to these tables. A column derived from the value
goes stale when N-1 revises the value, so one that must exist records what it was
computed from (for example the
content_sha256it describes), and N can tell it is stale. - A hand-written
INSERT … SELECTwith a column list is not carried. Only operator commands (loom reembed) write those; run them when one build serves.
- Each process checks
-
New enum or status values: N ships readers that accept them, and only N+1 writes them. N-1’s Pydantic
Literalwould answer 500 on a value it does not know. A projection failure’s name is a plain string that N-1 already tolerates: its repair worker leaves a name it does not know active asunsupported_projection. So N records a triples repair that failed after its insert asentity_triples_repair, notentity_triples, which N-1 would replay by inserting the triples again. A replay of anentity_triplesfailure that inserts them and then fails its repair keeps the failure: one mutation records that they landed and moves itsentriesandresultsto keys N-1 does not read, so N-1 refuses it (no entries) and leaves it active. N writes a failure’sabandonedstatus because N-1 reads that status as a plain string and lists onlyactiveones; thestatus="abandoned"list filter works only on N replicas. The conflict resolver’s owed follow istriples_follow_owed, nottriples_follow_rows, for the same reason: N-1’s follow does not check that the loser is still retired. While N-1 leads, its repair re-reads every failure whose name it does not know on every pass (oldest first, each answeredunsupported_projectionand left active), so they take places in its batch (LOOM_PROJECTION_REPAIR_MAX_FAILURES_PER_PASS); past that many, N-1 replays nothing else until an N replica leads. -
Wire formats (cursors, session and run ids, worker resume cursors, JSON stored in rows): N reads the old and the new format, and only N+1 writes the new one. Exception: a cursor for a request N-1 answers for
namespacealone (aknowledge.listnamingnamespaces) is new in N, and each build refuses the one the other wrote (rule 12). Thecode_ingestresume cursor names each cut asorg/namespacein N; the other build finds no entry of that name and serves its entries in configured order for that pass. Theknowledge_source_retireresume cursor carries the copy age scan’s position in N, after the org hash in its second string. N-1 reads that string whole as the queue’s position, where it sorts as the hash does, so its page is the same; it writes the cursor back without the scan’s position, and N’s scan starts over (rule 81). -
Signing keys: rotate with
--activate-inof at least twice the slowest keyring refresh interval (the command refuses less), so no process signs with a kid an N-1 replica cannot verify yet. -
Workers: one leader runs them, elected by a ClickHouse lease. Workers stay idempotent under one overlapping in-flight statement, since there are no fencing tokens. An older build leaves the lease to a newer one only when their schema versions differ (each build’s last migration number): a code-only release never hands over, and the old leader keeps the workers until it stops. Either way the order replicas are replaced in does not matter.
-
Settings: a removed setting warns at boot rather than refusing to start. A new setting’s default accepts what N-1 is configured with.
-
Retiring a column or table: stop using it in N, drop it in N+1 or later.
-
Replica-wide state lives in the deployment’s stores, never in a process. Anything a replica must agree on (leases, runs, the conflict resolver’s queue, the similarity calibration, the frontend bundle of every live build) is in a ClickHouse table, so a request can land on any replica of either build. Under the Postgres memory authority (storage authority) Postgres holds the memory heads, the revision journal, the deliveries, the scope generations and the requests’
Idempotency-Keyrecords, and N and later read and write them there (rule 33); the ClickHouse rule holds for everything else. The one exception is the bytes of document originals withLOOM_DOCUMENT_OBJECT_STORE=s3: they live in an S3-compatible bucket that every replica reads the same way, and the catalog row naming each object is in ClickHouse. A build that does not read that row’s location answers such a download 410 and cannot erase such an object, so the store is switched on after the rollout, and no rollback goes past this build while rows name objects. -
A
task.createkey’s exclusion holds only among N’s replicas.task.createwith an idempotency key holds a lease on the poster and its key (_one_create_per_key) and inserts under the key’s dedup token (insert_created_task); the coverage watch’s ready-event delivery holds one on the event’s task id (insert_ready_event). One whose lease ran out before its insert can still race the next, so both insert under one dedup token (named by the same poster and key, or the event’s task id) and storage drops the later row. An erased row’s token can outlive it and drop a new row too: with nothing stored, the row goes in again under a fresh token. The build before takes the delivery’s lease and writes its token too, so deliveries exclude across builds. Creates do not: the build before names the create’s lease and token without the poster, so neither build’s create of a key excludes the other’s, and racing they can store two tasks. A build that looks a key up without the poster answers another poster’s task to a create with the same key until it stops serving. Each task is whole (its event and its lease row) and claimable: a create of N cut off after its task row is finished by its retry, which under the key’s lease writes the created event the first one left out, and by the lease sweep, which writes its lease row after its grace. The created event takes a fresh seq, so cursor readers deliver it, unless the task has events since: then it goes just before the first of them and is history only. A first create that was only stalled past its lease, or cancelled while its insert ran on, can still land its own event. Both inserts carry one token, the task’s (insert_event), so storage keeps whichever lands first. Past the dedup window both can be stored: the backfill is markedbackfilledin its patch, and N’s readers drop it when the task has an earlier created event, so history shows one creation and a cursor delivers at most one. A reader that passed the first one’s seq before it landed and reads the backfill after misses the creation, as it misses any event landing behind it. A retry that reads an N-1 create’s task between its row and its event logs such a backfill too. N-1’s readers do not drop it; that ends once N-1 stops serving. -
A link N adds is not yet complete. N links each value to the triples and edges it stated (
entity_triple_rows,entity_edge_rows); N-1 links only keys, just after it writes the row. So a value with no row link still holds by its key link when that link is no older than the value and no row of the key links the fact, and a close N runs keeps what an N-1 row states. A key that rows of both builds link to one fact reads as N’s: there an N-1 row can lose that fact until it is stated again. -
A request field N adds is ignored by N-1 until N-1 stops serving: it answers the call as if the field were not sent, naming it in
ignored_args. Somemory.restore’s preconditionsif_superseded_byandonly_if_superseded(the dashboard’s Undo sends them) do not hold on an N-1 replica, which restores a deleted row or one retired behind another memory, and therelationsofmemory.set,memory.updateandmemory.update_by_idare dropped there, so that write graphs none of the facts it names.memory.get_by_id’somit_high_valuedoes not hold there either: N-1 answers ahighrow with its value and hash, and audits that read as a sensitive one.memory.verify’sif_match_sha256does not hold on an N-1 replica, which attests or revokes the row it reads. N’s conflict resolver does not read thememory.unsupersederecord of an Undo made on an N-1 replica, or before the upgrade: it carries neither the restored hash nor the restore version. The restored row then reads as a statement made at the Undo, newer than the memory it was retired behind, so a confident update verdict can retire that memory although the person kept both. Pinning it prevents that. N-1’sknowledge.listrows carry nonamespace, on any list; one namingnamespaceslistsnamespacealone there, and each build refuses the cursor the other wrote for such a list, so a client paging it starts again.memory.set’sif_match_sha256='absent'uses an existing, nonempty precondition field. A build without this meaning refuses it as a hash mismatch, including on a missing key, instead of storing an unconditional write. First creation may therefore answer 409 while such a build serves; clients must not retry without the condition. Ordinary content hashes still work across builds, and rollback needs no data change.memory.copy_rule.run’sdry_runandrevisiondo not hold on an N-1 replica, which answers a preview and writes no memory: a run sent there proposes nothing, and its answer names both fields inignored_args. -
A name N spells differently is a different node. N keeps combining marks and NFKC-normalises an entity’s name (
दिल्ली,İstanbulasistanbul); N-1 split them into fragments (द ल ल,i stanbul). ASCII names spell the same in both, and so do Latin ones but for compatibility characters, which N folds and N-1 keeps (the ligaturesfiandij, full-width letters, superscripts, fractions,ª,º,ſ). For the other scripts the two builds write separate nodes until N-1 stops serving, and a node N-1 wrote keeps its fragment name until a write states that entity again. -
An erasure N-1 runs misses the tables N adds. N-1’s saga and its census do not know
entity_triple_rowsandentity_edge_rows, so an erasure it runs during the rollout leaves their rows in its scope and still records the sagacompleted. Once N-1 stops serving, re-verify the erasures completed since the rollout began:loom erasure-re-verify --completed-since <rollout start> --resumedeletes, in each one’s scope, the rows of those two tables whose memory has no live row and no row written since the saga’s census (orphan row links). Of the saga’s steps it runs one again,read_receipts.delete, bounded to the receipts that landed after the saga’s census (read receipts), and it touches nothing else: data written in the scope after the erasure finished, its links included, stays, tombstoned bymemory.deleteor not. -
A marker N writes in a column N-1 reads is not one N-1 reads as its own. The conflict resolver’s queue lives on
memory_embeddings.conflict_checked_at, where an N-1 with the per-write judge on reads the epoch itself as a judgement it owes and re-runs it. N writes00:00:01(owed) and00:00:02(judged), which N-1’s statements read as settled (they match the epoch exactly); N treats N-1’s epoch marks as owed once N-1’s own settle had a minute. N-1’s Python is wider: itsis_marktakes any time before 2000 as its pending mark, so where N-1 runs its per-write judge (LOOM_MEMORY_CONFLICT_JUDGE, off by default) its settle of a row it wrote can stamp its settle time over N’s mark on that row; N then reads an older build’s verdict, owed again only while the row isconflicted, and that one row may go unjudged. While N-1 holds the worker lease (a code-only release keeps it until it stops) N’s marks wait, and the first N leader judges them. A pin is the other way round: N’smemory.pinholds the key’s write lock, N-1’s does not, so during the rollout an N-1 pin racing an N retirement can leave the pinned row’s vector superseded until the row’s next write (orloom reconcile-status). -
A triple row N-1 writes arrives at its whole second. N-1 does not set
entity_triples.seen_at(migration 067), so its rows take the column’s default, theirlast_seensecond (.000000). Two values of a single-valued relation starting the same day and arriving in the same second, one from each build, then order the N-1 row first, whichever arrived later; the next write of either fact orders them again. -
N-1 does not know N’s retirement intents. A user erasure N-1 runs deletes no projection failure (N-1 erases them by namespace only), so a point-write retirement intent naming that user in
retired[]stays until N erases the user again, or the intent is resolved and its TTL ends it. A projection repair on N-1 leaves every projection kind N adds (rule 3),triples_follow_owed,entity_edges_drop_undeclared,entity_edges_restoreandsensitivity_facts_owedamong them, active asunsupported_projection; N’s repair replays them once N-1 stops serving. -
A new revocation key (such as SCIM’s
SCIM_PREFIX): N-1 does not read it, so a token it revokes still works on an N-1 replica. The feature that writes it is turned on only once no N-1 replica serves: SCIM provisioning (LOOM_SCIM_TOKEN) after the whole rollout. -
A new access rule (such as collections, sharing): N-1 does not know that a
col-namespace opens only through grants, so an org admin’s wildcard token reads one on an N-1 replica, and a personal collection is one too. An end-user token is refused there (N-1 has no key for itskid), but on N its first@mewrite creates a personal collection. N-1 also rewrites a document (a metadata edit, a delete) without the provenance columns, so a user erasure would miss that version; it registers acol-name that N refuses (the boot warning lists the first 20); and it resumes a user purge without purging (it reads nopurgecolumn). Collections are created (collection.create, which N-1 does not serve) and end-user issuers registered (LOOM_JWT_END_USER_ISSUERS_JSON) only once no N-1 replica serves. -
Saved conversation messages: older builds can compact concurrently saved turns and rebuild embeddings without carrying their saved state. Clients use
conversation.save_messageonly once every serving replica runs the build that preserves saved messages. A rollback pauses saved-message writes and compaction until every replica supports that state again. -
An extraction policy (
extraction_policy.set): N-1 does not readloom.extraction_policiesand extracts without it. Set a policy only once no N-1 replica serves. A rollback leaves the rows in place but no replica applies them until the build that reads them is back. -
A new side effect of a write (such as memory webhook events): N-1 does not perform it. A memory write served by an N-1 replica leaves no
loom.memory_webhook_outboxrow, so it sends no event, and an erasure saga run by N-1 has no step for the outbox and its census does not count it. Webhooks are registered (webhook.register) only once no N-1 replica serves, so no outbox row exists while an N-1 replica can complete an erasure. A rollback to N-1 after webhooks exist leaves the outbox rows written before it: N-1 never reads or erases them, and they leave the disk within about 4 days (the outbox is read for 3 days and drops a day’s part once its last row is 3 days old). Rolling forward again, N’s worker sends none of an erased user’s events, because it skips an event whose key has no history left inloom.memory_versions, which every build’s erasure deletes. -
Assistant-turn learnings (
memory_extract_agent_learnings): N-1 does not eraseloom.learnings_supporters, where a user’s quotes behind a bot’s rule live, and onlearnings.reviewit promotes anassistant_turncandidate as the approver’s own memory. Turn the setting on, and reviewassistant_turncandidates, only once no N-1 replica serves. Before a rollback, turn it off and delete the rows ofloom.learnings_supportersand theassistant_turnrows ofloom.learnings_queue(extraction). N-1 has no per-agent filter on knowledge reads, so after a rollback it serves a promoted bot rule to every agent in the namespace. To keep a rule to its bot, delete the documents taggedsource-kind:assistant_turnwithknowledge.deletebefore the rollback; otherwise accept the wider serving. -
A namespace guide (
namespace.guide_set): N-1 does not serve the guide ops, shows no guide innamespace.browse,namespace.getor the session-start pack, and a namespace erasure it runs has no step forloom.namespace_guides. Sonamespace.guide_setanswers 503OVERLOADEDwhile any live replica’s schema version (loom.instances) is below 72, or no heartbeat has been read: no guide is written while an N-1 replica could erase its namespace. A rollback to N-1 after guides exist leaves them in place, and a namespace erasure N-1 runs then leaves them too; run that erasure again once N serves.tests/unit/test_namespace_guide.pychecks the refusal; the mixed-version gate does not. The gate counts the deployment’s processes (loom.instancesof its kind): an older process outside it on the same ClickHouse, such as a branch server, is not counted. -
Platform-admin bots (
loom.machine_identities.platform_admin, migration076_machine_platform_admin.sql): the column’sUInt8 DEFAULT 0reads 0 for every bot made before it. N-1 refuses an admin bot’s exchange but accepts a flat admin JWT issued by N, and its SSO account routes lack the human-only check. Both OAuth admin exchanges andloom mint-token --platform-admintherefore refuse until a fresh, nonempty fleet view shows every replica at migration 76 or later, including processes outside the deployment on the same ClickHouse. Neither path uses the kind-filtered replica cache. OAuth answers 503temporarily_unavailable; the CLI refreshes the fleet before minting and prints no token when it is unreadable or contains an older replica. Register and use such bots only after the rollout. Before starting any N-1 replica for a rollback, disable admin bots and revoke every standalone CLI-minted admin subject or token. N-1 writes the column back to 0 when it disables or replaces a bot. -
A bot’s longest token (
loom.machine_identities.max_access_token_s, migration077_machine_access_token_ttl.sql): the column’sUInt32 DEFAULT 3600reads an hour for every bot made before it. N-1 ignores a request’sexpires_inand issues an hour, its/v1/admin/bots.createrefuses the field (422), and when it saves a bot (a disable, a replace, a namespace release that drops one of its roles) it writes 3600 back. This can lengthen a token requested or capped below an hour, or shorten one allowed longer. Socreate_bot(the admin route andloom bot create) refuses a maximum other than 3600 until a fresh fleet view shows every replica, in every deployment, at migration 77 or later; an unread or empty view (no server registered yet) refuses too. A request’sexpires_inneeds no gate: N-1 answers it with an hour. After a rollback, reapply each maximum once N serves again (loom bot create --replacewith the bot’s key or trust and roles as registered, which also ends its tokens). The mixed-version gate does not check this rule. -
An erasure saga’s audit actor (
loom.erasure_requests.actor, migration081_erasure_request_actor.sql): N-1 inserts ledger rows without the column, so a saga it checkpoints reads''afterwards, and a later resume by N names the resuming process (erasure-recovery-workeror the CLI command) on its failed and completed rows instead of the principal that asked. N-1 also still writes the body’srequesteras theactorof theerasure.*rows of a request or export it serves, or of a saga it resumes. No gate holds the rollout: the cost is the actor named on those audit rows, nothing is lost or refused, and it ends once no N-1 replica serves. The mixed-version gate does not check this rule. -
A new document-source kind (
recordingornotioninloom.knowledge_sources.kind): N-1 refuses to add one (BAD_KIND) and lists and inspects one like any source. Itscheckandrotateof one fail with a server error, since it has no probe for the kind. An N-1 sync worker that takes such a source’s turn reads it as a shared folder: the credential is not a service account key, so the turn endscredential_invalidbefore any request and retires nothing, and the next turn by N writes the real status. An N-1 mining step keys a document by its revision alone, while N keys anotiondocument by its revision and text hash, so a hand-off between the builds mines anotiondocument again. No gate holds the rollout: the cost is that status, shown until N’s turn, and those extra mining calls, and it ends once no N-1 replica serves. -
Typed datasets (
loom.datasets,loom.dataset_rows, migration083_knowledge_datasets.sql): N-1 ingests a file without its datasets and serves no dataset op. A dataset is served only while the source’s live document row has the version it was published with, so a write or a delete N-1 makes of the source stops serving N’s datasets as N’s own would; N-1’s delete or ingest of the source leaves their rows, which the source’s next ingest or delete by N removes (a delete of a source already deleted included). A metadata edit N-1 makes of an ingested source carries nothing, unlike N’s: its datasets stop being served, and the next ingest infers their types again, an earlier approval dropped; ingest the file again after the rollout to serve them, and approve again. An erasure N-1 runs does not know the two tables, so the rows N wrote in its scope stay and the saga still recordscompleted: once N-1 stops serving, request the erasures completed since the rollout began again, which N’s saga runs through every table. No gate holds the rollout. -
Extracted decisions in the model’s words (
loom decisions extract, the document-source sync’s mining step): N records a decision’s reasons in the model’s words and retires a row only when its support check finds it gone twice; N-1 retires the extractor’s row whose reasoning is not a span of the document. So an N-1 run on a document N mined (an operator’s N-1 command, an N-1 replica’s sync turn on a changed document, every changed document after a rollback) deletes the extractor’s unpinned rows N wrote and tags its pinned, attested or acted-on onessource-changed, and writes its own. The rows are the extractor’s own and the next run by N writes them again from the document; asource-changedtag stays until a run by N emits the key and finds it stated. No gate holds the rollout: the cost is that churn while N-1 serves, and after a rollback until the document is mined by N. -
A new shared-folder file kind (
docxin agdrivesource’sinclude): N accepts the kind and writes it only when a caller names it; a config withoutinclude, and the dashboard form’s default, take the four kinds N-1 knows. N-1 has nodocxin its file-kind table, so it refuses to add a config that names it (BAD_CONFIG), itscheckandrotateof such a source answer a server error, and its sync worker fails such a source’s turn before any request: the source’s state shows statusfailed, errorKeyError, nothing is retired, and the next turn by N syncs it. No gate holds the rollout: the cost falls only on sources whose config namesdocx, and it ends once no N-1 replica serves. After a rollback it stays for those sources, every file kind of them unsynced, until each is removed; a second source that names onlydocxbeside one that names the other kinds (the way document sources add a kind) confines that to the.docxfiles. N+1 may takedocxby default. This departs from rule 3 the way rule 28 does for a new source kind: holdingaddback a release would hold back every folder of.docxfiles, while the cost falls on the sources a maintainer opts in, ends with the rollout, and loses nothing. The mixed-version gate does not check this rule. -
A native document’s pictures out of its export (the
gdrivesync’sdocsconversion): N drops each pasted picture’s base64 reference definition from a native document’s Markdown export; N-1 stores the export as it comes. A document N-1 writes is found by N on its next full listing, whose stored-revision read checks each stored text for such a definition, and converted again at the same revision. N writes every native document with atext_sha256in its metadata, so the mining step of either build, which keys a document carrying one by its revision and that hash, mines the converted text once; a document N-1 writes carries none and is keyed by its revision alone, which is new whenever N-1 writes; N-1 rewrites the document only when its file changes. No gate holds the rollout: the cost is the base64 a document N-1 writes holds until N’s next full listing, and the check, which reads each document’s stored text on every full listing, stays while a build that stores raw exports may serve. The mixed-version gate does not check this rule. -
The memory authority (
loom.storage_authority, migration085_storage_authority.sql;schemas/pg_migrations/): N records the deployment’s authority at the first boot that runs its migrations (LOOM_BOOT_MIGRATE) and refuses to serve against another. A build before N does not read the record and writesloom.memorydirectly, so once a Postgres deployment is recorded every replica must run N or later, and it never rolls back past N. Postgres migrations follow rule 1: additive, applied at boot under an advisory lock, and a build at or after N serves on a later build’s Postgres schema with a warning naming the files it does not carry (Postgres migrations). The mixed-version gate does not check this rule. -
A user purge deletes the memory rows last (
memory.retire): N-1 has nomemory.retire, and itsloom erasure-re-verify --resumeruns a user saga as a tombstone, so a user saga N started and N-1 resumes can keep the answers that quoted a summary, and a purge can end with the user’s rows or the summaries built from them only tombstoned; resume user sagas N started from N. A saga’s mutation tag names its step on N, so a step resumed across builds submits its mutation again; the statements are idempotent. No gate holds the rollout, and the mixed-version gate does not check this rule. -
One token mint (
service_accounts.create,caller_home.minted_home,token_saves_to,me_service_accounts.dev_caller,admin_routes.admin_token_mint).- Where a token saves. N sends a delegated token’s unaddressed calls to the
namespace its claim names before
*when it may write there; N-1 sends them to the owner’s saved pick, as for a bare*token. A token of that shape (one fromservice_accounts.createwith a namespace before*, or anadmin/token.minttoken whosenamespacesstart with one) writes to either namespace while both builds serve, depending on the replica; both are namespaces it may write, and the split ends with the rollout. After a rollback such a token follows the pick for the rest of its life. - Where a list token saves (
saves_toclaim andloom.service_accounts.saves_to, migration093_service_account_saves_to.sql). N records the list token’s target in the token and its row, and sends its unaddressed calls there, then down its own list, never to the owner’s saved pick. N-1 ignores the claim: on an N-1 replica the token follows the saved pick, as every list token did before, until the rollout ends. A list mint N-1 serves dropssaves_to(both mint routes ignore an unknown field) and mints a token without the claim, which follows the saved pick for its life;service_accounts.createanswers where it saves under that rule, andadmin/token.mintanswers nosaves_to. A*token’s home stays the name before*, and one that may no longer write there still falls back through the saved pick. On N a delegated token, with the claim or without, never saves to a collection unasked (one it may only read can still be its default for reads,caller_home._pick_default): a list token whose only writable entry is a collection saves there by default on N-1 and nowhere by default on N, so its calls name where they save. N-1 revoking a row writessaves_toempty: a revoked token saves nowhere. - Mints refused by the other build, before anything is saved. N-1 refuses
*in a list,namespaces: "*"or none at all (create_token(),loom token createwithout--namespace) and a mint without a name (the dashboard’s form with its Name left empty,loom token createwithout--name). N has no/v1/me/setup/mcp_config, which N-1’s dashboard calls. N refusessaves_tobeside*and a collection before*, which N-1 mints (droppingsaves_to). A retry once the rollout ends works. - A mint N-1 accepts. A named list mint is saved by N-1, which answers without
saves_to,mcp_url,reads_everything,rolesandclients; N’s dashboard fills those from the page (its own/mcp, the claim) and shows the token. A list token N-1 mints gets no bound tracker record. N-1’s dashboard posting a list mint to N sends nosaves_to, so N records the first writable memory entry, kept for the token’s life; N’s answer names it, and the created dialog shows it. - The list. N-1 matches a token’s maker by the exact subject, so a person signed in
under another spelling of theirs neither sees nor revokes there a token made under
the first, and N-1’s dashboard lists a
*token N minted by the names in its claim (it reads every namespace all the same). - Who owns an auth-off token. With auth off and no bearer, N saves a token with
the single user
youas its owner and N-1 withdev. Each build’s Tokens page shows the tokens of its own owner (and, as for any owner, those on a namespace it administers); every token stays valid. On N, a token N-1 saved is listed and revoked by naming its owner:subject=devand the token’sorg(defaultfor one made on the Tokens page) onGET /v1/me/service_accountsandPOST /v1/me/service_accounts.revoke.
- Where a token saves. N sends a delegated token’s unaddressed calls to the
namespace its claim names before
-
The memory a cached
code.askanswer quoted (loom.code_answers.memory_namespaceandmemory_keys, migration086_code_answer_memory_scope.sql): N-1 writes an answer without them, and a tombstone N-1 writes of an entry N stamped (a stale entry, a negativecode.outcome) drops them, so its text stays where no erasure finds it. N-1’s saga, census andmemory.redactdo not know the table, so an erasure or redact N-1 runs leaves the answers N stamped in its scope and still recordscompleted. A saga N-1 leftin_progressrunscode_answers.deletewhen N resumes it, since the step is not in itssteps_completed; one N-1 completed is not run again, andloom erasure-re-verifydoes not reach this table. So an erasure N runs before the cache is cleared can leave text in the cache. N also changes the answer policy in the cache key, and each build reads an entry of another prompt version as dead: it serves it to nobody and tombstones it on sight. While both serve, a question asked of each in turn is synthesized again at every switch, and N-1’s tombstones of N’s entries, which carry no stamp, are the main way the stamp is lost. Where a memory namespace is bound, clear the cache once N serves alone (upgrade procedure, step 9); after a rollback, clear it once N-1 serves alone and again once N serves again. No gate holds the rollout. -
What a summary of the user’s memories fed (its history, chunks, entity vectors, graph rows and shared copies; erasure saga): N-1’s user saga and census reach only the user’s own, so a user erasure N-1 runs leaves the summary’s rows and records
completed. Outside a purge, a saga N-1 left in progress that N resumes fails N’s census when N-1 ran those rows’ steps, and the recovery worker’s next resume runs them again; the shared copies, which the user-scope census does not count, stay when N-1 passedmemory.retire. In a purge, N’smemory.retireruns them again, except for the search rows of shared copies of the user’s own memories when N-1 ran itsshared.tombstone, which deleted the rows they are found by. After a purge that passedmemory.retire, including one N-1 completed, the user’s keys are gone and nothing finds the summaries’ rows. Every build before N leaves them, and the ledger does not name the build that ran a saga: once N serves alone, request again each user erasure withoutpurgethat was requested before then (theuser_idrows ofloom.erasure_requests), and after a rollback, those requested since the rollback once N serves again (upgrade procedure, step 10, which names what the new saga also erases); no gate holds the rollout. -
Knowledge document heads (
loom.knowledge_heads, Postgres migration002_knowledge_documents.sql): under the Postgres authority N commits each document write as its source’s head; N-1 writesloom.documentsalone. N reads both and serves the newer version, and a commit over a head older than the row its writer read replaces it, so N serves N-1’s writes and a rollback loses none. Two writes of one source are refused one against the other only when both run N. N-1’s erasure has nopg_knowledge.deletestep and leaves the scope’s heads. Its tombstone stamps the rows at their version, and at a tie N serves ClickHouse’s copy, so the document reads as deleted; after a purge the first N read finds no ClickHouse row at the head’s version and nothing owed, and deletes the head instead of serving it. A delivery still owed or parked when N-1 erases its scope stays, and N’s delivery worker publishes it again; an erased document’s text stays in its head. Once N-1 stops serving, run again with N every erasure that completed while an N-1 replica served since N first served, a rollback’s included, before an operator retries a parked delivery (upgrade procedure, step 11). N refuses to boot withLOOM_RETENTION_DOCUMENTS_DAYSset under this authority (unset it first, step 2) and puts no namespace retention TTL onloom.documentsorloom.chunks; while an N-1 replica leads theretention_reconcilepass it applies a namespace’sretention_daysto both again and N’s next pass removes it, so a document whose rows age out in that window is gone from ClickHouse, and the first N read of it drops its head as a purged one. N-1’s originals sweep and user erasure readloom.documentsalone, so while N-1 runs them they may delete an original only an unpublished N commit names (any owed or parked one for a user erasure; for the sweep, one whose original is older thanLOOM_DOCUMENT_BLOB_MIN_AGE_SECONDS): that document’s download then answers 410 once its row lands, until the file is uploaded again. N-1’s restore does not wait for a delivery still owed, or for one the worker settled whose replaced request may still be sending: one that restores a source whose N tombstone landed in ClickHouse before its delivery finished (an insert that timed out and landed, a failed completion) has its chunks retired again when N’s worker publishes that delivery or the replaced request’s retirement lands, and the document serves no search hits until it is written again. No gate holds the rollout, and the mixed-version gate does not check this rule. -
The chunks a knowledge head serves (
chunks_revision,chunks_versiononloom.knowledge_heads, Postgres migration004_knowledge_chunk_heads.sql): under the Postgres authority N’s search, outline, synthesis andmemory.stackknowledge reads serve only a head’s chunks (a source with no head serves what ClickHouse holds) (knowledge search); N-1 serves every chunk ClickHouse reads as live, as before, so while it serves, a search it answers can show an older version still being retired or a write not committed. N-1’s commits leave both columns as they were, so after one that numbers a new revisionchunks_revisionis no longer the head’s and N judges that source’s chunks by revision alone, which also serves a refused writer’s chunks of that revision until the source’s next N write that inserts chunks (a delete, a metadata edit or a restore keeps the columns as they are). A head N-1 created holds none. N-1’sknowledge.addandbulk_addagain keep the earlier version’s chunks, which N does not serve and retires at the source’s next N write that inserts chunks. No gate holds the rollout, and the mixed-version gate does not check this rule. -
Knowledge ingestion jobs (
loom.knowledge_jobs, Postgres migration005_knowledge_jobs.sql): under the Postgres authority N keeps each job in Postgres and projects each committed version intoloom.knowledge_ingestions, best effort, so N-1 may read a job a version behind until N’s next save, or until N’s worker next takes it, and may run again a job N ended whose last projection did not land (a published one N-1 finds published); N-1’s originals sweep and user erasure read open jobs from ClickHouse alone, so while N-1 runs them they may delete the original of an N job whose projection has not landed and whose upload has expired, and that job then failsoriginal_gone; N-1 keeps its jobs in ClickHouse alone. N’s status and cancel read the newer version of the two stores, and its worker’s queue interleaves its own due jobs with ClickHouse’s, the two leading in turn from one pass to the next. A job N-1 queued runs in ClickHouse alone, as N-1 runs it; a run of one Postgres holds first takes the version N-1 saved when it is the newer, and waits while an earlier open job of its source is held in Postgres or only in ClickHouse, so a source’s jobs still run one at a time, oldest first. N thus runs, reports and cancels the jobs N-1 queued or ran. A cancel N accepts is also written toloom.knowledge_ingest_cancels, which N-1 reads, and N reads the cancels N-1 writes there. The deployment-wide job lease alone keeps a run of each build from overlapping the other’s: N-1 does not raise a job’slease_token, so the token does not fence an N run whose lease lapsed against an N-1 taker. N-1’s erasure has no step forloom.knowledge_jobsand leaves the scope’s jobs there, and N’s worker projects an open one back intoloom.knowledge_ingestionsand runs it; once N-1 stops serving, run such an erasure again with N, as for rule 38 (upgrade procedure, step 12). N breaks a tie between two jobs of a source created in one millisecond by the id’s text, N-1 by its UUID, so the two builds may each run one of such a pair at once. No gate holds the rollout, and the mixed-version gate does not check this rule. -
The erasure receipt (
loom.erasure_requests.census, migration091_erasure_census.sql): N writes every count of a complete census with the verify columns of a saga’s terminal and failed rows, and the recovery worker’s abandonment checkpoint carries it forward; a resume writes in-progress rows without it until its own census lands. N-1 neither writes nor reads it, so a row N-1 checkpointed reads'', which N’serasure.statusanswers as no receipt (census: null). N also writes the purge a saga applies to thepurgecolumn (false for a single namespace), which N-1 reads as before, since N-1 never purged a single namespace either. No gate holds the rollout, and the mixed-version gate does not check this rule. -
The knowledge dataset catalog (
loom.knowledge_datasets, Postgres migration007_knowledge_datasets.sql): under the Postgres authority N commits each catalog row there and projects it intoloom.datasets, best effort, so N-1 may read a catalog row a version behind until N’s next write of it; N-1 writesloom.datasetsalone. Every read of the catalog by N (datasets_repo.at_version:knowledge.dataset_get,knowledge.query, an approval’s reads, a publish’s and a metadata edit’s carry, and a publish’s check that no approval landed) takes Postgres’s rows and those only ClickHouse holds, the newer version of a dataset winning, so N serves and queries what N-1 published or approved. N’s approval commits in the transaction that holds the source’s head, over the version of the catalog row it read: Postgres’s, or a newer one N-1 wrote to ClickHouse, which the approval then commits to Postgres. N-1’s approval writes ClickHouse alone, and N reads it as the newer version once the replica it reads has caught up: until then N serves Postgres’s older row, whose replaced snapshot N-1 may already have deleted, so the dataset reads empty, and an approval by N in that window outranks N-1’s. Both builds take the source’s claim for an approval and a publish, so an approval and a publish of one source never overlap, whichever builds run them. N-1’s deletes (knowledge.delete, a later publish’s retirement) and its erasure removeloom.datasetsrows alone and leave N’s catalog rows in Postgres until that source is next published or deleted by N: ask such a delete again with N, which removes them; once N-1 stops serving, run such an erasure again with N (upgrade procedure, step 12). No gate holds the rollout, and the mixed-version gate does not check this rule. -
A revision’s delivery time (
delivered_atonloom.memory_revisions, Postgres migration010_revision_delivered_at.sql): under the Postgres authority N stamps a revision it delivers more than 15 minutes after its commit, and the payload clearing pass takes an unstamped one as delivered within 15 minutes ofcommitted_at(payload clearing). N-1 completes a late delivery without the stamp, so a revision it delivered late counts as delivered earlier than it was, by up to that delivery’s lateness, and stays so. TurnLOOM_PG_PAYLOAD_CLEAR_ENABLEDon no sooner than one clearing horizon after N serves alone: every revision N-1 delivered is then past the horizon from its real delivery. A rollback to N-1 starts that wait again: turn the switch off before it, and on again no sooner than one clearing horizon after N serves alone after the roll forward. The switch is off by default, and N-1 runs no clearing pass. N-1’s delivery cannot send a revision whose payload was cleared. Once a clearing pass has run,loom reconcileruns only with a build that carries 010, and that build is the one the deployment starts on after it; a rollback waits until N owes no claimable delivery for a cleared revision, and while N-1 serves a retry of parked deliveries leaves the cleared revisions out (rollback). No gate holds the rollout, and the mixed-version gate does not check this rule. -
Document sources on any namespace (
knowledge.source.*without the trunk check): N-1 still refusesadd,check,rotateandsync_nowon a namespace that is not a repository’s trunk (NOT_A_CODE_NAMESPACE), so while it serves, the dashboard’s Add (the list the Library’s Sources button opens offers it on every shared namespace), Check, Sync now and Rotate of such a source fail on the replicas it answers from, and its sync worker skips such a source until N leads the workers. N-1’snamespace.delete,collection.deleteand erasure do not retire a namespace’s sources. A source whose namespace N-1 deleted stays active with its credential, and the sync skips it (its namespace is inactive); one whose namespace N-1 erased keeps syncing, and its next full listing writes the namespace’s documents back. An erasure N-1 started and N finished runsknowledge_sources.retirelate, and its final census reopens the steps for what the source wrote back meanwhile;loom erasure-re-verify --completed-since(rule 14) runs none of those steps. N-1’sadddoes not read the ledger, so a source it adds during an erasure N runs, after N’sknowledge_sources.retire, stays active and syncs after the erasure completes. Once N serves alone, the upgrade procedure, step 13, lists what N-1 left, with its queries and cleanup. No gate holds the rollout: the cost is those refusals and that cleanup, and it ends once no N-1 replica serves. The mixed-version gate does not check this rule. -
A namespace’s promoted rows (
shared.tombstonein the namespace saga): N-1’s namespace erasure has no step forloom.sharedand its census does not count the table, so anamespaceornamespace_listerasure N-1 runs completes with the namespace’s promoted rows live, and so did every one an older build completed. Their search rows are gone (memory_embeddings.tombstone), butmemory.lineageand the shared reads still return them. Once N serves alone, the upgrade procedure, step 14, lists each namespace an erasure in the ledger (kept 90 days) reached and runs over it what N’s step runs: rows promoted before the erasure are tombstoned, or deleted after a purge. An older erasure’s rows cannot be found and stay. No gate holds the rollout, and the mixed-version gate does not check this rule. -
An
/assistanthistory entry (the dashboard’s expanded assistant window has no address): an N-1 tab pushed/assistantentries, and after the ReloadBar’s reload on N, Back or Forward onto one reaches N in the same document. N answers it: the address becomes the landing page’s (landingTargetfor the tab’s namespace; the view the tab shows when that is Setup), the page arrives there, and the assistant opens over it (expanded from 1024 px; nothing opens on Setup, on a namespace the tab cannot read, or at phone widths). The server keeps serving theassistantpage segment for bookmarks, which N answers the same way at boot (except that on a phone the sheet opens over the landing page), so this answer stays as long as the segment is served. The mixed-version gate does not check this rule;frontend/e2e/assistant-launch.spec.ts(“an entry an earlier build pushed opens the assistant on Back after a reload”) does. -
A cell’s org triggers and
loom.tenancyguard keep their names and shape (cells). The session markerloom.tenancy_checked, the functionsloom.tenancy_refuse_unheld()andloom.tenancy_refuse_unmarked(), the trigger namestenancy_insert,tenancy_updateandtenancy_record, and their shape (AFTER, row level, on their events) do not change, since builds N-1 and N create and read them on one cell. Each function’s body changes only through a numbered migration (CREATE OR REPLACE FUNCTION), andmissingaccepts the body and settings any shipped file writes. A changed body ships in two releases: release K adds the new body tomissingas an accepted value beside the shipped files’, and the migration that writes it ships no earlier than K+1, so an N-1loom doctoror attach on a migrated cell names no defect. TheWHENtext lives in the code that creates the triggers (server/core/cell_triggers.py), so a changedWHENships in three releases, in the body’s order: release K adds the newWHENtomissing(whichloom doctorand attach read) as an accepted value beside the one it creates; K+1 creates the newWHENand keeps the old one accepted, so a K pod that creates a trigger on a skipped table, and a Kmissingreading one K+1 created, both name no defect; and the migration that drops the triggers, which the same boot then creates with the newWHEN, ships no earlier than K+2, so the N-1 that could create a skipped table’s trigger already carries the new text. The gate on processes withLOOM_CELLunset, the marker and the triggers ship in one release: a release that carried the triggers without the marker would refuse Loom’s own writes on a cell, and one with the gate alone would leave its unchecked writers unguarded. It breaks side-by-side serving in one place: on a later cell already prepared, the release’s first migrating boot creates the triggers, and an older pod still serving there has its inserts of a tenant org’s rows refused, so such a cell is rolled out in one step (upgrades, step 2). The mixed-version gate does not check this rule. -
Knowledge gaps (
loom.search_missesandloom.knowledge_gaps, migration 95): N-1’s erasure saga has no step for either table. So while any live replica’s schema version is below 95, or no heartbeat has been read, no miss is recorded, theknowledge_gapsworker writes nothing andknowledge.gaps.listanswers 503, asnamespace.guide_setdoes under rule 24. The operator turnsLOOM_KNOWLEDGE_GAPS_ENABLEDon only once every replica runs N. Before a rollback, turn it off and delete both tables’ rows, then delete again after the first N-1 replica serves (knowledge gaps).tests/unit/test_knowledge_gaps.pychecks the refusals; the mixed-version gate does not. -
A document source’s items (
loom.knowledge_sources.source_kind,items_json,secret_enc, migration096_knowledge_source_items.sql): N writes a source whose items the id-listconfigcan hold (only non-recursive folders, at most 20 of anything) as N-1 writes it,kind,config_jsonand the credential incredential_enc, withitems_jsonbeside them, so N-1 lists, checks, rotates and syncs it as before. Any other source is stored withkindempty, its kind insource_kind, its credential insecret_enc(purposeknowledge_sources.secret),credential_encempty andconfig_jsonholding no item. N-1 lists such a source with kind''; itscheckanswerscredential_invalid(itscredential_encis empty) and asks for a rotate, and itsrotatefails with a server error before writing, since it has no probe for kind''; and its sync turn reads it as a shared folder with no credential, so the turn endscredential_invalidbefore any request and retires nothing. N-1’sremoveof it, and its retirement when its namespace goes, write an inactive row whose new columns read empty. Soknowledge.source.addandknowledge.source.updateanswer 503OVERLOADED(retry_after_s30) for a source they would store withkindempty while any live process of any deployment on the ClickHouse service (loom.instances,read_live(all_deployments=True)) reports a schema version below 96, or none has been read. N readssource_kindfirst andkindwhen it is empty, anditems_jsonfirst andconfig_jsonwhen it holds no item, so a row N-1 rewrote reads as it wrote it. N-1’ssync_nowwithoutfullwritesfull: falseover an update’s waiting full request, so while it serves, an added item’s files older than the stamp wait for the periodic full listing. N-1’sloom secrets resealdoes not resealsecret_enc, and its--checkreports clean, so run the reseal from build N before droppingLOOM_JWT_SECRET_PREVIOUS: asecret_encleft under the old key reads as no credential and its source’s turns endcredential_invaliduntil rotated. A later release, once no build below 96 runs, writeskindfor every source and keeps one credential column.tests/unit/test_knowledge_sources.pychecks the refusal, andtests/unit/test_knowledge_source_sync.pythat a folder turn over such a row ends before any request; N-1’scheckandrotatefailing is read from its code, and the mixed-version gate does not check this rule. -
A source’s document bound (
LOOM_KNOWLEDGE_SOURCE_MAX_DOCUMENTS): N reads a source’s stored copies in pages and holds back new files past the setting, for every kind. N-1 reads at most 50,001 of them: itsgdriveturn holds back new files past 50,000 and endsfailedwithtoo_many_documentsover it, retiring nothing; itslinear,notionandrecordingturns check no bound, so past the cut a stored copy reads as new and is fetched again each turn, and the cut read retires less. Both rewrite and retire under the same source lease. While N-1 serves, a setting at or below 50,000 is safe; raise it only once every replica runs N. The bound tests intests/unit/test_knowledge_source_sync.py,test_knowledge_source_sync_linear.py,test_notion_source_sync.pyandtest_knowledge_source_recordings.pycheck N’s side; N-1’s is read from its code, and the mixed-version gate does not check this rule. -
Mirror names are reserved (migration
097_mirror_names_reserved.sql): N’s gate refuses every request that names a namespace of the formacl-and 24 hex digits (only a platform admin’serasure.requestmay name one), with auth on or off.namespace.registerandnamespace.restorerefuse the form, and N’s org-wide scopes, thesql_v1_views and the analytics export leave it out. N-1 admits the form as any other name. The migration refuses to run while any namespace of the form is registered or holds live rows in ClickHouse (the registry, memory, documents, conversations, threads, sources and code repositories), naming up to ten asorg/namespacewith their tables and counting the rest. Since N refuses every request naming such a namespace, the operator clears it with N-1: an erasure of what it holds,code.repo.removefor a repository andnamespace.delete. The build that writes mirrors comes after this one, so the build beside it already refuses the form; the one gap is a name an N-1 process registers or writes after the migration ran. The mirror writer draws a new name again while the one it drew is in use (server/knowledge/app/mirrors.py, rule 54), so no such namespace is ever taken for a mirror.tests/unit/test_mirror_names_refused.pychecks N’s side, and the mixed-version gate does not check this rule. -
The mirror registry (migration
098_knowledge_mirrors.sql): N addsloom.knowledge_mirrorsand theaccesscolumn ofloom.knowledge_sources, whose default (namespace) is what every row N-1 writes means. N stores a source whoseaccessismirroredwithkindempty, so a build without items finds no probe or credential for it. N serves none either: its sync pass skips one (rule 54’s build syncs a mirroredgdriveone into the mirror), its retire pass leaves its delete request alone, andcheck,rotate,update,sync_nowand anaddof a removed one’s name refuse withSOURCE_NOT_SERVED. So beside the build that writes mirrors, N never syncs a mirrored source into the named namespace or orphans its documents.On N, each namespace erasure step reads the registry, which keeps every mirror the named namespaces have had, so every run of the step, a resume’s or a replay’s included, covers them: a scope that holds a mirror is erased as a purge, in one pass over the named namespaces and their mirrors, and the census counts it the same way. After the Loom steps that erase the mirrors’ rows,
knowledge_mirrors.forgetwrites the mirrorsdeleted, and a live one keeps the name in use. N-1 runs no mirror pass and counts no registry row; N writes no mirror, so N-1 meets an empty registry, and the build that writes mirrors (rule 54) runs beside N, which reads them.tests/unit/test_knowledge_mirrors.pyand the mirrored cases intests/unit/test_knowledge_sources.pyandtests/unit/test_knowledge_source_sync.pycheck N’s side. -
A document’s permission list (migration
099_document_access_lists.sql): N addsloom.documents.access_json, the permission list of a mirrored document (document sources); under the Postgres authority it rides in the head’srow, with no Postgres migration. No writer in N passes a list, and the row builder carries none forward: every row N builds, a tombstone included, has the column empty, so it readsunreadand admits nobody; an erasure purges a mirror’s rows outright (rule 52). N-1 never meets a list: N writes none, and the first build that writes one runs beside N, never beside N-1, which matters because N-1 would carry a list through its rewrites (rule 2). No op’s input or output has the field.tests/unit/test_access_list.pyandtests/unit/test_document_row_builder.pycheck N’s side. -
Mirrored folder sources sync (migration
100_knowledge_source_listings.sql): N’s sync worker runs a mirroredgdrivesource, while its ops still refuse one (SOURCE_NOT_SERVED, rule 52). Each turn lists every file with its permissions, readingpermissions.listfor a file the listing leaves them out of, and writes into the namespace’s mirror (made under the namespace’s sources lease when it has none) at<address>#<source id>, taggedsource-id:<id>. Once the turn starts, it brings every stored copy’s list to the store’s (only narrowing a copy behind its file’s revision), or tounreadfor a copy a whole listing does not have at its address (bounded as rule 55 says); then it fetches and writes each new or changed file with its list, and at the full interval retires a copy whose file is gone, with no audit row, since the audit log outlives an erasure. The listing’s start goes toloom.knowledge_source_listingsonce every stored copy’s list is written. No request can add a mirrored source yet, so N meets none it did not write, and N runs every mirroredgdrivesource as one shared service account: the build that adds sources of another credential mode stores them in a formmirror_syncedrejects while N may run. By rule 52, N-1 serves no mirrored source, and it reads no listing row; an N-1 namespace erasure has no listings step, so it leaves the mirror’s listing rows (source names and times, no memory content), which the next erasure of the namespace on N removes, since its scope holds every mirror the namespace has had. N counts a document as searchable when its chunks are those of its version or of its revision, which a row-only rewrite (a new list, a metadata edit) keeps, so such a rewrite stays until the file changes; N-1 checks the version alone, so after a metadata edit it fetches and writes the file again, as it does today.tests/unit/test_knowledge_source_sync_mirror.pyandtests/unit/test_knowledge_source_revisions_sql.pycheck N’s side. -
The mirrored sources’ share of a pass: N runs the mirrored sources first, until a third of the time the pass starts work in has passed (a quarter of
knowledge_source_sync_max_pass_seconds) and under their own document bound (LOOM_KNOWLEDGE_SOURCE_MIRROR_DOCUMENTS_PER_PASS), the one synced longest ago first, a sync request included; the namespace sources then have the rest of the pass under their own bound. A mirrored source’s turn keeps its own state under its mirror and source id, leaving only its request, status and time in the namespace row. Its model calls are attributed to the mirror. It reads the lists on from a cursor in that state, in at most half of what is left of the mirrors’ share when its turn reaches them, so its new and changed files still get time, and a turn whose list reads stop there is still complete, so it retires gone files and keeps the full interval; a cycle’s listing row carries the start of the turn that began it. N-1 runs a mirrored source under the whole pass’s bounds and keeps its whole state in the namespace row; N reads neither N-1’s fields there nor N-1 the mirror row, so a mixed fleet reads some lists again and retries some waits, and the next N turn drops N-1’s fields from the namespace row. No request can add a mirrored source yet.tests/unit/test_knowledge_source_mirror_pass.pychecks N’s side. -
Mirror erasure receipts (migrations
101_erasure_mirror_mark.sqland Postgres013_erasure_mirror_mark.sql): N adds a Booleanmirror_marked, false for ordinary receipts, to both erasure ledgers. Before a namespace step or its failure census reaches mirrors, N persists true. Request replies and namespace audit rows then carry codes only; status and list expose counts only to a freshly authorized flat platform admin. Recovery, reverify resume and restore replay preserve the mark; cross-store copies promote it without replacing terminal state. A replay promotion changes no receipt or pending fence. Marked versions reserve bit 63 of the UInt64 version, so even a later unmarked checkpoint cannot replace one; timestamps order marked writes. N-1 ignores the column and cannot advance a marked saga. Mirrored sources remain refused until every process implements this protection and the later read and session protections. Before N-1 may serve after enablement, the enablement and rollback procedure must settle outstanding marked sagas, remove mirrored content and scrub marked receipts and audit counts while preserving their mark and version priority; a schema downgrade alone provides no privacy protection. -
Stopped mirrored sources retain their retirement requests: N writes a
knowledge_source_retire:<source id>key under the mirror incode_index_statebefore inactivating the registration. Its always-onknowledge_source_retireworker deletes that source id’s owned copies under its own cursor, deadline and document bound, even after the name is reused. N-1 ignores those queue keys and cannot serve the mirrored registration; its ordinary cleanup skips it. Queue rows remain until N finishes, and namespace erasure removes them with the mirror. Mirrored registration remains unavailable.tests/unit/test_knowledge_source_retirements.pychecks name replacement, bounded progress and cursor persistence. -
Mirrored work keeps diagnostics inside its namespace: N suppresses shared logs, spans, metrics and work figures while syncing or retiring mirrored content. Its worker summaries carry fixed codes and no elapsed time or document figures; billing rows stay in the mirror namespace. N-1 has no equivalent boundary, so mirrored source creation remains refused until every process implements the read, session and enablement protections. Before N-1 can serve after enablement, stop writers, settle outstanding inserts and sagas, scrub marked receipts and audit figures, and erase every mirror store, including
agent_events,agent_events_privateandagent_cost_rollup_daily, before clearing the enablement latch. Stopping a client after its timeout does not prove a sent insert has completed. -
Personal-agent reader claims and verified directory evidence (migration
103_sso_domain_evidence.sql): N adds empty-defaulthosted_domainandissuerString columns tosso_links. Direct verified sign-in writes them only for a fresh active passwordless account under its ownership lock, after the SCIM check. N-1 ignores them and its ordinary link writes clear them to defaults; missing evidence denies domain access. No backfill infers a domain from an email. N accepts the optional Booleanreads_as_creatorclaim, absent meaning false. Only the primary first-party sign-in routePOST /v1/me/personal_tokens.createand the assistant’s one-answer bridge set it; ordinary delegation omits it. Saved personal tokens use the existing Stringkindcolumn with valuepersonal_agent, which N-1 lists and preserves during revocation. N-1 ignores the claim and has no mirrored document leg, so it grants no mirrored access. Mirrored sources remain unavailable until every process implements the document and session protections.tests/unit/test_mirror_reader_identity.pychecks the claim and delegation boundaries. -
Checked mirror reads use source-scoped group evidence (migration
104_knowledge_group_members.sql): N reads each membership snapshot by org, mirror, source id and group, and admits only a nondeleted snapshot withinLOOM_KNOWLEDGE_SOURCE_ACL_STALE_SECONDS. An empty table admits no group. N-1 ignores the table; namespace erasure removes its rows with the mirror. Mirrored source creation remains refused until every process implements the read, marked request, session and enablement protections. -
Coarse permission keys and private lexical statistics (migration
105_mirror_access_candidates.sql):documents.access_keysis materialized from the existing permission JSON; N-1 writers need no new field. N still checks the strict current list, and Postgres heads do not depend on published keys. Each chunk-frequency view changes its query in place, retaining the input, target and output columns. Both views exclude mirror namespaces for either build. Mirror creation remains refused until the read, request, session and deployment protections are complete. -
User cost caps and private budget warnings (migration
107_user_cost_budgets.sql): activate the global and namespace user caps and alert inboxes only after every serving build supports the migration; keep them disabled and do not rely on user caps while any build is older or unknown. N-1 cannot enforce user caps, filters no private warning events, and has no user-erasure step for those events. Before the first N-1 process starts, the operator stops all warning producers for maintenance, settles scheduled and uncertain writes and their writer leases, deletes onlybudget.warningtask events, and verifies completed deletion and zero warning rows on every storage replica. There is no interval in which N-1 serves with private warnings stored. Save policy before rollback: N-1 namespace writes omit the user-cap and alert-inbox columns, so their defaults replace the saved values. Restore and verify the global default and namespace policies only after every serving build supports the migration again. The activation and rollback procedure defines the maintenance boundary; the warning fleet check alone does not make a downgrade safe. -
The
embed_excludemarker (unembedded by design: reference (embed_exclude)inembed_last_erroroncode_chunks) extends the reference fixtures’ marker, so N-1’s recovery, backfill embed phase and coverage counts skip it as they skip a fixture. N-1 reads neitherLOOM_CODE_EMBED_EXCLUDEnor an entry’sembed_exclude: where it runs, its ingest embeds a matching path’s new chunks, itscode_summarypass writes their cards, and itsloom code reembedand provider rebuild embed the marked rows under the target model. A chunk N-1 embedded keeps its vector until its content changes. -
A compiler tier’s checkout shares its mirror’s packs by hard link, each kept by a
.keepfile, only withLOOM_CODE_COMPILER_SHARE_MIRROR_PACKS, off by default. N-1’s git jobs mount the checkout writable and no shared pack read-only, so they could write the mirror’s packs: turn it on only once no N-1 replica serves, and before a rollback turn it off and remove the tier checkouts, which N-1 recreates with its own objects. Off, N’s checkout holds its own objects as N-1’s does. Intests/unit/test_code_compiler_checkout.py, a pass of N, then N-1’s fetch,checkout --forcewith the mirror out of sight and gc command, then N again, run on one repository volume with no checkout file shared, and a pass of N with the setting on then shares the packs. -
A code namespace being erased (
server/code/app/index/erasing.py): N’s code writers skip a namespace an unfinished erasure may reach, and N’scode_index.purgerefuses, retryably, while work begun before the erasure was recorded may still write it. N-1’s writers do neither and N-1’s purge does not wait, so an erasure during the rollout can leave rows written after its purge, as before;verify.residuefails the saga on those incode_chunksandcode_summaries, and it is repeated. No gate holds the rollout. -
A definition renamed as it moves to another file or scope (
server/code/domain/successor.py::elsewhere): the builds differ in which of these the link recheck follows, never in the link rows. One host rechecks a repository at a time, so a range is read by one build, and a link one build followed is read by the other as any followed link. Where N follows a definition and N-1 does not (its tokens in a range of more than 32 changed files or past new definitions in its own scope, its tokens under a name the file had for another text, a text nearly its own under another name, a definition under 30 tokens that went with its scope or under a name that holds its own), N-1 reads the linkmissingorunresolved. N weighs anunresolvedlink again from the commit its code was last read at, at its next recheck within 30 days or when its file changes. Amissinglink is never handed to a definition added since, so a link N-1 readmissingduring the rollout staysmissingunder N until its own name returns. Where both follow and differ (N takes the definition’s tokens under another name before a definition of its own name with an edit), the link is where the build that read the range put it.wide_rangesis a number in thememory_code_linkspass outcome, which every build serves as stored. No gate holds the rollout. -
A memory’s text revised after a rename (
server/memory/app/code_renames.py::revise): N’s link pass marks as due (policy_due, an existing column) a link that readsmoved, and a link to a definition that lands at another path or name readingchanged, and its policy step revises the memory’s text where the swap is certain. A build that marks neither, or only themovedone, clears in its policy step a mark N wrote without revising what it does not revise, so a rename followed during the rollout can leave its memory’s text as written:namespace.validatelists the edit of amovedlink, as before. A link that readmovedbefore N served is marked only when a recheck next rewrites it (its file changed and its lines shifted, for one): until then its memory’s text stays as written and listed, and no backfill marks it. A link that readchangedat its new place before N served is marked only when it moves again, and so is one whose mark an older build’s recheck dropped as it rewrote the link outside arevisenamespace. The revision is amemory.update_by_idwrite, which N-1 reads as any other version; N also writes the row’sfiles, an existing column. N links the revised memory itself, and writes achangedlink under the revised text with the baseline it had: rows of the link table as any other, under the inputs hash of the memory as it is, so N-1’s linker finds the memory linked and makes no link again. Under the Postgres authority N writes those rows also while the revision’s publication is pending, and its policy step leaves them until ClickHouse holds the head; an N-1 policy step that reads the old head in that window drops them, and the linker then makes themfresh.renamedis one more number in the pass outcome. No gate holds the rollout. -
Code store names are reserved (migration
118_store_names_reserved.sql): N’s gate refuses every request that names a namespace of the formcrs-and 24 hex digits (only a platform admin’serasure.requestmay name one), with auth on or off, as rule 51 does for mirrors, and through the same helper.namespace.registerandnamespace.restorerefuse the form, and N’s org-wide scopes, thesql_v1_views and the analytics export leave it out. The analyst’s event views hide it too, so the analyst entity version is 7: a build writes the entities only when its version is at least the stored one, so N-1 (version 6) never puts its narrower views back over N’s. N-1 admits the form as any other name. The migration refuses to run while any namespace of the form is registered or holds live rows in ClickHouse, naming up to ten asorg/namespacewith their tables and counting the rest; the operator clears it with N-1, as rule 51 says. N writes no such name: the build that creates code stores comes after this one, so the build beside it already refuses the form, and the one gap is a name an N-1 process registers or writes after the migration ran.tests/unit/test_store_names_refused.pychecks N’s side, and the mixed-version gate does not check this rule. -
Workspace crawl sources (migration
119_workspace_crawl.sql): N adds a source’s approval, registrant, selection and credential hash columns and a listing’s source generation. A crawl source is stored withcredential_modecrawl, mirrored access and the legacy kind and credential columns empty. N’sadd,updateandrotateof a crawl answer 503OVERLOADEDwhile any live process reports a schema version below 119, so N-1 never serves beside a crawl row N wrote during a rollout. N-1 that meets one anyway refuses it: itscredential_foradmits onlysharedandconnectedrows, so its sync turn fails ascredential_invalidbefore any provider request, writing only its sync state, and itscheckandrotateanswerSOURCE_NOT_SERVEDfor a mirrored row. An N-1removeor namespace retirement retires the row and queues its copies’ retirement;loom.knowledge_sourcesis not a carried table, so the row it writes holds the new columns’ defaults, which clears the selection, approval and registrant. N-1’s mirror leg admits onlysharedandconnectedrows, so it answers none of a crawl’s copies. A rollback stops every mirrored source and erases every mirror before an N-1 replica starts, as the mirrored sources’ procedure says.tests/unit/test_crawl_fleet_migration.pychecks N’s side, and the mixed-version gate does not check this rule. -
A TypeScript delta’s held edges (
ScipFile.held_edges, written byscripts/scip_harness/scip_to_delta.py): a delta that indexed one member lists a reference to a term the index holds no definition of apart from the file’sedges, and N’scode_scip_applymoves it intoedgeswhen the stored compiler-tier row of its target is a function. The delta staysdelta_version1. N-1 does not know the list: Pydantic ignores it, so an N-1 apply of the same delta, in a code-only rollout where the workers’ leader is still N-1 or after a rollback, writes the edges it wrote before and none of the held ones, and nothing fails. An edge N-1 left out stays out until N applies the file again. A held edge is never anedgesentry, so N-1 cannot write one into a const or a field.tests/unit/test_scip_ts_kind_prepass.pychecks the delta N-1 reads, and the mixed-version gate does not check this rule. -
A
/helpaddress (N drops the dashboard’s docs view and opens docs on the docs site): an N-1 tab pushed/help?page=<page>#<anchor>entries, and after the ReloadBar’s reload on N, Back or Forward onto one reaches N in the same document. N replaces the entry with that page and section on the docs site (helpAddressDocsinfrontend/src/lib/docsLinks.ts), which describes the latestmainand can be ahead of N. The server keeps serving thehelppage segment for bookmarks, which N answers the same way at boot (frontend/src/main.tsx), so this answer stays as long as the segment is served. A sign-in an N-1 tab started on its docs view and finished on N within ten minutes (SIGN_IN_TTL_MSinfrontend/src/lib/linkToken.ts) lands on the landing page instead:returnToSignInStartrestores the start address after the boot check has run. The mixed-version gate does not check this rule;frontend/e2e/help-address.spec.ts(“an entry an earlier build pushed opens its page on the docs site on Back after a reload”) checks the history entry, and no test checks the sign-in case. -
An agent’s usage label names its run and principal (migration
120_usage_label_provenance.sql): N addsrun_id,actorandcredited_at(defaultts) toloom.memory_usage_events, with bloom indexes onrun_idandactorand a minmax index oncredited_at, and stamps the run and principal on everyused,evidenceandharmlabel it writes. N-1 stamps neither, so its labels read as the server’s own events andrun.retract_creditnever reaches them. A compensation is an event of an existingevent_typewith a negativeevent_count, and every reader of the table (the totals view, the fold, the search payload, the label gauge) sumsevent_count, so N-1 nets it as N does: nothing double counts and nothing new is parsed. Two differences while an N-1 process leads the fold: it skips a memory whose every total is zero after a retraction and leaves its last folded boost, and it takes a compensation’s time as the memory’s last activity, so a retracted memory’s decay restarts. What it folded so stays after N leads: no counter N compares is behind, so the memory is folded again only at its next event. N counts the compensations, writes the base back and keeps as the last activity the later of the last recall, the newest credit that still counts, and the memory’s own last write. N saves its watermark as the fold’s cursor at the end of every complete pass that pending mutations did not skip, so an N leader that starts cold folds what the last one had not reached; an N-1 leader reads that cursor as a partial scan’s and resumes from it too, and N reads the reset an N-1 pass leaves as no saved watermark. An erasure an N-1 process runs does not know the columns, and its census does not count them, so it verifies clean while it leaves the namespace’s events, or the user’s principal and run on the labels N stamped; step 19 of the upgrade procedure and the rollback note run those erasures again once N serves alone. N-1 ignoresrun.complete’smemories_deliveredand credits everymemories_usedkey, so the Python SDK’sRunScopesends asmemories_usedonly the used keys among those it delivered (or an answer cited), and N-1 credits the same keys as N.tests/unit/test_usage_credit_retraction_sql.pyandtests/unit/test_usage_fold_sql.pycheck N’s side, and the mixed-version gate does not check this rule. -
Owner erasure covers worker sources (
connected_accounts._erase_worker_owners): N’s SCIM user delete erases the user’s worker source rows, which N-1 only preserves. N-1 still answers such a delete 409PRECONDITION_FAILEDfor an owner with worker rows, after it has stopped and revoked their accounts and erased their Postgres worker rows, and erases none of the owner’s registry rows, native or worker. The errors reference marks that 409 not retryable, so a provider need not send the delete again: once N serves every replica, the operator sends each such delete again, which N completes (step 20 of the upgrade procedure). Each build erases only rows of the deleted owner, so neither undoes the other. N-1 refusesknowledge.source.removeof a worker source withSOURCE_WORKER_OWNED, which N serves. No gate holds the rollout, and the mixed-version gate does not check this rule. -
An active worker source registration (
knowledge.source.worker_register, aloom.knowledge_sourcesrow withsource_kind = 'mcp'andcredential_mode = 'worker', no migration): N writes the first active worker rows, through its one store writer that accepts an active worker row (sources.insert_worker_registration); every other writer, in both builds, writes a worker row only inactive. N-1 keeps a worker row’s raw columns in its history and never interprets them, and treats an active one as it treats any worker-marked row.knowledge.source.listandinspectshow it asmcpwith its details withheld, and the dashboard offers no action on it;check,update,rotate,sync_nowand the push operations refuse it withSOURCE_WORKER_OWNEDbefore they write,removewrites it inactive, andaddanswersSOURCE_EXISTSfor its name. Its sync worker, mirror reads and pending retirement skip it, connected-account stop and its census match native rows only, andloom secrets resealfinds no sealed value in it. Namespace retirement (code.repo.remove,namespace.delete,collection.deleteand the erasure step) writes it inactive with its bytes unchanged. N-1’sknowledge.source.livedecodes an active worker row as N does, so it serves the new source to its owner. In both builds owner erasure, which SCIM user deletion runs, deletes the owner’s worker rows (rule 73), and the connected-account restore cleanup refuses for the whole deployment while any worker row exists (document sources). N counts an active worker source with connected sources, the class of sources on a person’s own account, in the per-namespace (knowledge_connected_sources_max_per_namespace) and per-person (knowledge_connected_sources_max_per_person) quotas, and so does its connectedadd. N-1 counts it with shared sources until it drains: on an N-1 replica worker sources take slots ofknowledge_sources_max_per_namespace, so an administrator’s sharedaddthere can answerSOURCE_QUOTAearly, and its connectedadddoes not count them. N-1 serves neither setup operation, so it answers a preview or a registration routed to it as an unknown operation; the evidence a preview returns opens on any N process. No gate holds the rollout.tests/unit/test_mcp_worker_setup_register.pychecks N’s writer, and the mixed-version gate does not check this rule. -
Read receipts (
loom.read_receipts, migration122_read_receipts.sql): N-1’s erasure saga has no step for the table. So while any live replica’s schema version is below 122, or no heartbeat has been read, N writes no receipt, as it records no miss under rule 48; reads answer as before. Before a rollback, turnread_receipts_enabledoff withloom settings setand truncate the table, then truncate it again after the first N-1 replica serves (read receipts, the rollback note).tests/unit/test_read_receipts.pychecks the gate; the mixed-version gate does not. -
The session’s run on a run row (
metadata.session_runonloom.agent_runs, no migration): over MCP, N labelsknowledge.get,memory.get_by_id,memory.for_fileandprocedure.matchwith the session’s run, and a run thatrun.beginopens there stores that run’s id inmetadata.session_run, a key only N’s server writes. N-1 labels none of the four, so a call it serves is filed under no run in every ledger it writes. N-1 stores ametadata.session_runa client sends as sent, letsrun.completeoverwrite the stored one, and drops the server’s on a begin sent again; its truncation marker drops the key. A run opened through an N-1 replica names no session run, and nothing adds one later unless its begin is sent again in an MCP session through N. N reads what N-1 wrote: asession_runof another form reads as absent, and one of the session-run form can be a client’s, so the value chooses which receipts a run is read by and never whose (read receipts). Both builds make the same id for a session’s run, so a session served by both keeps one run. No gate holds the rollout.tests/unit/test_run_ledger.pyandtests/unit/test_mcp_session_runs.pycheck N’s side, and the mixed-version gate does not check this rule. -
Worker copies (
knowledge_source_worker_copies_enabled, no migration): with the setting on, N registers owner-onlysnapshotandselected_refreshworker sources, syncs their copies into the collection’s mirror, serves those copies to the owner and queues their retirement onknowledge.source.remove, namespace retirement and owner erasure. N-1 registers no such source, its sync worker and mirror reads skip every worker row, itsknowledge.source.liverefuses a non-live registration, and its removal paths queue no worker copy. So the operator turns the setting on only once every replica runs N; it is off by default, so the rollout itself writes no copy. Whatever the setting, N’sknowledge.source.removeand namespace retirement queue a worker source’s copies and write its inactive row withpending_delete, since a copy written while the setting was on outlives turning it off. With no copy the entry finds nothing to delete: N clears it, and N-1’s retirement worker leaves it pending, since it still counts an inactive worker row as blocking. A rollback to N-1 leaves the copies in the mirror, unserved, and an owner erased or a source removed under N-1 queues none of them: before rolling back, remove every snapshot and selected-refresh worker source with N and let theknowledge_source_retireworker drain. A source worker build older than N’s names no reason on its403, so N never retires a copy on its denial, and an N-1 Loom ignores the reason N’s worker adds: a refused resource’s copy is kept and its source’s copies stop being served after the stale window, until a worker that names the reason answers. A copy answeringunsupportedfollows the lapsing rule with either worker build. No gate holds the rollout.tests/unit/test_worker_source_copies.pychecks N’s side, and the mixed-version gate does not check this rule. -
The session run’s caller and the run on an op ledger row (no migration): over MCP, N takes the caller of a session’s run from the keys the op’s input declares, as the read scope gate does, so a call joins the run exactly when the gate resolves its read scope. N-1 reads every argument. A call N-1 serves that names a
user_id,session_idorread_scopeon an op with no such field, where that key resolves no scope (a token pinned to a user names another user, aread_scopeneeds a user or session nobody supplies), begins no run and is filed under no run in every ledger N-1 writes, and a write among them carries norun_id; N labels or stamps it like the same call without the key. N-1 begins the session’s run on aknowledge.getthat names the session of anown_sessiontoken, or the user of anown_usertoken with no pin, and files the run’s row under that session or user; N begins none there, since the gate binds no scope for that read. Over both transports, N-1’s row inloom.agent_eventsnames arun_idthe request names on an op whose input has no such field, where N’s names the run bound to the request, as the request’s receipts do. Both builds make the same id for a session’s run, so a run either build began is joined by the other, and the rows N-1 wrote stay as they are. No gate holds the rollout.tests/unit/test_mcp_session_runs.pyandtests/unit/test_ledger_invariants.pycheck N’s side, and the mixed-version gate does not check this rule. -
The
other_namespacessection of a pack (context.pack, no migration): N renders the section and takes its name inonly_sections,section_token_budgetsandblock_order. N-1 renders no such section, refuses a request that names it inonly_sectionswith a 422 (its list of section names does not hold the value) and ignores the name in the other two fields. So a pack N-1 serves lacks the section and is otherwise what N serves, and a session whose packs alternate between the builds sees the section come and go, which moves its stable prefix. No shipped client names the section, and none may name it inonly_sectionsbefore the release that serves it is on every replica. The section reads existing tables through existing statements and writes only the read receipts and served counters a pack already writes, under each row’s own namespace, so a rollback leaves nothing behind. No gate holds the rollout.tests/unit/test_context_pack_other_namespaces.pychecks N’s side, and the mixed-version gate does not check this rule. -
A namespace’s curator mode (
loom.namespaces.curator_mode, migration123_namespace_curator_mode.sql): N stores the mode a namespace admin sets withnamespace.registerand writes it forward with the rest of the registry row. N-1 builds that row without the column, so anamespace.registerN-1 serves during the upgrade returns the namespace’s mode to the column’s default, which reads asoff, and N-1 ignores acurator_modeit is sent (rule 12). The loss is towardoff: the admin sets the mode again once every replica runs N. N-1 answersnamespace.getandnamespace.listwithout the field. N serves a stored word it does not accept on a write as it is, and keeps it through a register that omits the field, so a mode a later build adds outlives a write N serves. No gate holds a write of the mode (the namespace’s mode); the pass that reads it waits for the fleet (rule 83).tests/unit/test_namespace_curator_mode.pychecks N’s side, and the mixed-version gate does not check this rule. -
A source assigned to a worker subject (
worker_subjectonloom.knowledge_sources, migration124_knowledge_source_worker_subject.sql): N writes a worker row withaccessnamespace, no owner and the subject that syncs it (assigned sources). N-1 does not know the column. It lists the row as a worker source with its details withheld, skips it in its sync, refuses its other ops withSOURCE_WORKER_OWNED, and never writes it active: its only rewrite retires the row, which leavesworker_subjectat the column’s default'', a row that is assigned to nobody. Soknowledge.source.worker_assignanswers 503OVERLOADED(retry_after_s30) while any live process of any deployment on the ClickHouse service reports a schema version below the migration, or no heartbeat has been read; the gate reads the number from one constant, whichtests/unit/test_assigned_source.pyholds to the migration’s file name. The gate covers the roll forward only. N-1’sgrants.share_agentdoes not refuse a namespace that holds an assigned source, so a rollback below N is unsupported while one is active: remove each withknowledge.source.removefirst. This statement lists them:SELECT org, namespace, name FROM loom.knowledge_sources FINAL WHERE active AND credential_mode = 'worker' AND access = 'namespace' AND worker_subject != ''. A removed assignment’s retirement entry is filed under the namespace itself (removing an assigned source). N-1’s queue scan filters on a mirror name, so it never reads an entry filed under a plain namespace: the entry waits for a retirement pass of N, and the name it holds answersSOURCE_RETIRINGuntil then. No assigned row exists before the gate above opens, so no such entry is written while a process below the migration serves. N servesknowledge.source.worker.claimandknowledge.source.worker.commit(a worker subject’s turn) and writes the turn’s keys into the source’s sync state, a state row N-1 already stores as JSON and never reads for a worker row. N-1 answers both ops as unknown, so a worker routed to it retries; it refusessync_nowon the row withSOURCE_WORKER_OWNED. Only these handlers write the statusesimporting,needs_reconnect,blockedandrevoked, and N-1 shows no worker row’ssync. A rewrite of the row by N-1 changes its version, which ends the turn in progress: its next commit answersCLAIM_LOST. N also servesknowledge.source.worker.storedandknowledge.source.worker.put, which N-1 answers as unknown. A copy a turn uploads is a document row and chunk rows of the shape N-1 already reads, and a copy a turn retires is a tombstone N-1 honours. A retirement entry withreasonrevokedis filed as a removal’s is, so N-1’s queue scan never reads it. A commit N-1 serves keeps theretiredkey of the sync state it read, sosync.removedcan include an earlier turn’s count until N serves the first commit of a turn. N’s retirement worker queues an entry withreasonexpiredfor an assigned source nobody verified within the copy age bound (copies of a connection nobody verified) and writescopies_expired_atinto the source’s sync state. N-1 has no such scan and queues no such entry. The entry is filed as a removal’s is, so N-1’s queue scan never reads it and it waits for a retirement pass of N, andcopies_expired_atis a key of the state row N-1 never reads for a worker row. The scan’s position in the worker’s resume cursor is an exception to rule 4, described there. N assigns a source to a subject that is no agent’s, in a shared namespace (where an assigned source lives), and offers that subject its sources across the org. The row has the shape of every assigned row, so N-1 lists it, retires it onremoveand expires its copies as it does an agent’s. N-1 refuses to make or change one with 422SOURCE_WORKER_NAMESPACEand answers that subject’s claimnone, since it reads only an agent’s own namespace; a worker routed to N-1 polls again, and itsstored,putandcommiton a turn N opened are served by both builds. No gate holds the rollout. After a rollback below N such a source is never claimed: its copies are served until the copy age bound retires them, or until its registrant removes it. The mixed-version gate does not check this rule. -
The
primer,pinandunpinsections ofcurator.status(no migration): N computes them from tables both builds hold and writes nothing. N-1 refuses asectionslist that names one of them with a validation error, and its answer holds no field for them. A client that wants every section sends the empty list, which both builds accept, and reads a section missing from the answer as not computed;loom curator statusdoes both. No gate holds the rollout, and a rollback leaves nothing behind.tests/unit/test_curator_status.pyandtests/unit/test_cli_curator.pycheck N’s side, and the mixed-version gate does not check this rule. -
The curator’s scheduled pass (the worker
curator, no migration): N’s worker writes a row ofloom.agent_runsfor each pass, under the idcur-and ten digits (the scheduled pass). N-1 has no such worker. A tick makes no pass while any live process of any deployment on the ClickHouse service reports a schema version below the migration that addsloom.namespaces.curator_mode, or no heartbeat has been read: a build below it cannot read the column, and lets a caller’srun.begin,run.completeandrun.gradewrite under a pass’s id. The gate reads the number from the constant rule 80’s test holds to the migration’s file name. A build with the migration serves a pass’s row throughrun.getandrun.listand refuses a caller’s write to it. A row a caller opened under such an id before the fleet reached the migration stays in the ledger: itsversionis the nanosecond clock, below the floor every read of pass rows applies, so no tick and no later reader takes it for a pass. The switchLOOM_CURATOR_ENABLEDis read at start, so a replica runs the worker only once it runs N with the switch set. A rollback leaves the pass rows, which N-1 serves as it serves any run; they hold counts and codes and follow the ledger’s retention.tests/unit/test_curator_worker.pychecks N’s side, and the mixed-version gate does not check this rule. -
A namespace’s skills (
loom.skills, migration128_skills.sql): N-1 serves noskill.save, lists and reads no team skill, ignores thenamespace_scope,state,open_draft_only,revisionandhistoryfields ofskill.listandskill.get(rule 12), and a namespace erasure it runs has no step forloom.skills. Soskill.saveanswers 503OVERLOADEDwithretry_after_s: 30until a fresh, nonempty fleet view shows every live replica at migration 128 or later, processes outside the deployment on the same ClickHouse included (machines.fleet_at): no skill is written while an N-1 replica could erase its namespace.loom skill saveasksops.capabilitiesfirst and exits 2 on a replica without the op. A rollback to N-1 after skills exist leaves them in place and unread, and a namespace erasure N-1 runs then leaves them too; run that erasure again once N serves alone.tests/unit/test_skill_save_refusals.pychecks the refusal andtests/unit/test_skills_migration_constant.pythe number; the mixed-version gate does not check this rule. -
The dashboard adds a document source only after a stated access rule (no migration): N’s dashboard words who reads a source’s copies from the
access_ruleofknowledge.source.list,inspectandadd(who reads a source’s copies), and its Add source needs a Check whose answer carries a policy it words. N-1 answers noaccess_rule. While both builds serve, a Check that a replica of N-1 answers states no rule: the add dialog says the server did not say who can read the copies and keeps Add off until a Check is answered by N, and a source’s details say the server does not say. No answer reads as a rule the server did not state. N-1’s dashboard bundle ignores the field, andknowledge.source.addoutside the dashboard needs no rule. No gate holds the rollout, and a rollback leaves nothing behind.frontend/src/flows/KnowledgeSourceDialog.test.tsxchecks N’s side, and the mixed-version gate does not check this rule. -
Regression suites (
loom.knowledge_suites, migration130_knowledge_suites.sql): N-1 serves none of theknowledge.suites.*ops, and a namespace erasure it runs has no step for the table. Soknowledge.suites.publishanswers 503OVERLOADEDwhile any live replica of any deployment on the store is below schema version 130, or no heartbeat has been read (machines.fleet_at): no suite is written until every replica can erase one.knowledge.suites.getandknowledge.suites.listare not held. A rollback after suites exist leaves the rows in place, unserved, and a namespace erasure N-1 runs then leaves them too; run that erasure again once N serves (regression suites, the rollback note). Draft cases (loom.knowledge_suite_drafts, migration135_knowledge_suite_drafts.sql) are held the same way at schema version 135: theknowledge_suites.deletestep of a build below it leaves the drafts, soknowledge.suites.add_draftandknowledge.suites.dismiss_draftsanswer 503OVERLOADEDwithretry_after_s: 30until every live replica is at it, and a rollback leaves the draft rows as it leaves the suites. A build without draft cases refuses to publish a draft’s id that the suite’s current revision does not hold, and publishes a suite that already holds one: a draft is taken through a replica of N, and the suite it is in then publishes on either build. N-1 answersknowledge.suites.getandknowledge.suites.listwithout drafts. The three case kinds ship together: a later kind is a value N-1 would refuse to read back, so it takes two releases under rule 3.tests/unit/test_knowledge_suites.pyandtests/unit/test_knowledge_suite_drafts.pycheck the gates; the mixed-version gate does not. -
Stewardship (
loom.stewardship_events, migration132_stewardship_events.sql): N-1’s erasure saga has no step for the table. So while any live replica’s schema version is below 132, or no heartbeat has been read, N refusesstewardship.assignandstewardship.reviewwith a 503 and a 30-second retry;stewardship.listandstewardship.getare served, and N-1 serves none of the four. A build with the table and withoutstewardship.reviewanswers 404 for it and reads thereviewrows a newer replica wrote. A build that knows nodocumenttarget (no migration:target_kindis a plain string in the table) tolerates the rows a newer replica writes for one. It compares the kind as a string before it builds an item, so itsstewardship.listleaves document items out of its rows and its counts, and it answers 422VALIDATION_FAILEDfortarget_kind=documentonstewardship.get,stewardship.assignandstewardship.review; a retry that reaches a newer replica is served. Its admission of a memory does not count document items, so while both builds serve, a namespace can pass the 500-item ceiling, and a namespace that reaches 1,000 items fails its list on both builds until an admin ends items withreview_every_days=0. A dashboard page loaded from the older build draws a document item a newer replica lists as a memory row, whose actions address a memory of that key and write nothing to the document’s item; reload the page once the roll ends. After a rollback the document items stay stored and unlisted, and both erasure steps still cover them, since neither selects by kind. No row exists before the fleet is on N, so a roll forward leaves nothing for N-1’s erasure to miss. After a rollback, an erasure N-1 runs leaves the namespace’s rows, or the user as steward and actor on them; request it again once N serves alone (stewardship, the rollback note).tests/unit/test_stewardship_assign.pychecks the gate; the mixed-version gate does not. -
An unknown key inside
memory.apply’stargetor an action block (no migration): N refuses it at validation with 422VALIDATION_FAILEDnaming the key’s path, and the call does not run (unknown and removed fields). N-1 drops the key and runs the call on what is left: a filter that lost a predicate selects more rows than the caller wrote, and a block that lost a key acts on its defaults. While both builds serve, the same call is refused by one replica and run by another, so a client sends only the documented keys oftarget,target.filter,target.search,expire,lock,labelanddemote. Rule 12 does not hold inside these objects: a field a later build adds to one of them is refused by the build before, not ignored. A field removed from one of them is refused from then on, not served and named inignored_args. No gate holds the rollout, and a rollback leaves nothing behind.tests/unit/test_memory_apply.pychecks N’s side, and the mixed-version gate does not check this rule. -
The session’s reads in
run.reliance(no migration): for a run whose row names a session’s run inmetadata.session_run(rule 76), N also lists the receipts under that run stamped while the run was open, in the namespace the call names. N-1 reads the run’s own id alone. So an answer N-1 serves lacks the session’s reads, a reported key the session read readsnot_recordedthere, and a client that repeats the call sees the items come and go until every replica runs N. N’s dashboard words the session’s reads from the run’s row, so its line shows whichever build answers. The read writes nothing and both builds read the same rows, so a rollback leaves nothing behind (read receipts). No gate holds the rollout.tests/unit/test_run_reliance.pychecks N’s side, and the mixed-version gate does not check this rule. -
A connection record’s
resource_realm(source worker only, no migration): source worker build N reads a connection record with or withoutresource_realmand attests the realm’s digest at enrollment; N-1 refuses a record that carries the field and answersunavailablefor every read and enrollment of it. So the operator writes a realm into a record only once every worker replica runs N. Every Loom build accepts the digest. Loom keeps the digest an account was first enrolled with, so a connection gains, changes or loses a realm only under a new connection ID, and a worker source stays bound to the connection it was registered on: each source of the old connection is registered again on the new one under another name, sinceknowledge.source.worker_registeranswersname_takenfor a name an active source holds and for one a removed worker source keeps, and the old source is removed, which retires its copies. A rollback of the worker to N-1 stops every source on a realm-bearing connection; before rolling back, either move each such connection to a new connection ID without a realm and register its sources again there under other names, or accept that they stop. No gate holds the rollout.source_worker/tests/test_credential_store.pyandsource_worker/tests/test_enrollment_http.pycheck N’s side, and the mixed-version gate does not check this rule. -
Results of a regression suite’s cases (
loom.knowledge_suite_results, migration133_knowledge_suite_results.sql): N-1 serves neitherknowledge.suites.submit_resultsnorknowledge.suites.results, and theknowledge_suites.deletestep of a namespace erasure it runs deletes the suites and leaves the result sets. Soknowledge.suites.submit_resultsanswers 503OVERLOADEDwithretry_after_s: 30while any live replica of any deployment on the store is below schema version 133, or no heartbeat has been read (machines.fleet_at): no result set is written until every replica can erase one.knowledge.suites.resultsis not held. A rollback after result sets exist leaves the rows in place, unserved, and a namespace erasure N-1 runs then leaves them too; run that erasure again once N serves (regression suites, the rollback note). The three outcomes (pass,fail,unavailable) ship together: a later outcome is a value N-1 would refuse to read back, so it takes two releases under rule 3.tests/unit/test_suite_results.pychecks the gate; the mixed-version gate does not. -
Copy rules (
loom.memory_copy_rules, created by the migrationmemory_copy_rules): N servesmemory.copy_rule.set,memory.copy_rule.list,memory.copy_rule.deleteandmemory.copy_rule.run; N-1 answers each as an unknown operation. N-1’s erasure saga has no step for the table (rule 14), somemory.copy_rule.setstores nothing and answers 503OVERLOADEDwith a 30-second retry until every live replica, in every deployment on the store, runs that migration: no rule exists while an N-1 saga can run.list,deleteandrunare not gated, since none stores a rule. A run withdry_run: falsewritesproposedcopies toloom.memory, rows every build reads and erases, under asource_tracestarting withcopy_rule:, which a build that only previews does not refuse on a request (rule 12 covers that build’s answer to a run). The gate covers the roll forward only: after a rollback the rules stay stored, nothing reads them, and a namespace erasure N-1 runs leaves the rules stored in the erased namespace or reading from it (names, typed conditions and the owner’s subject, no memory value) until the erasure is run again on N. A condition a later build adds makes a rule unreadable on this build, never wider:listserves it withreadable: falseandrunanswers 422 before it reads a memory (copy rules).tests/unit/test_copy_rule_ops.pychecks N’s side, and the mixed-version gate does not check this rule. -
A skill’s decisions and its published reads (no migration):
skill.decidewritespublish,rejectandarchiverows toloom.skills, acts the fold of N-1 already reads. N-1 serves noskill.decide, answers the decided rows to the writers of the namespace, and serves no team skill belowwriter. While both builds serve, a reader that a replica of N-1 answers gets the missing body for a published skill and N’s answer on a retry: a publish is served by N alone, which is the closed direction, so no gate holds the rollout. N-1 writes no read receipt for a fetch and answers noapproved_byorpublished_at. Its reports count the calls of theloom skillcommands, which name the consumerloom-cli-inspect, as use of the namespace until it is replaced.loom skill publish,rejectandarchiveaskops.capabilitiesfirst and exit 2 on a replica without the op. A rollback to N-1 leaves the rows in place, read by writers and served to no reader.tests/unit/test_skill_reads_published.pyandtests/unit/test_skill_decide.pycheck N’s side; the mixed-version gate does not check this rule. -
The mode a close applied (
metadata.retainonloom.agent_runs, no migration): N’srun.completestores the retain mode it applied inmetadata.retain, over a value a client sent, and N’s extraction worker applies ademoteorexpireit reads there to the rows a deferred extraction writes under the closed run. N-1 stores no mode and leaves a client’sretainkey as sent; its worker reads no run. So a run closed through N-1 reads askeepto N, and the rows a replay writes under it keep their standing, as do the rows of a replay an N-1 worker makes, whichever build closed the run. One case differs: a run closed through N-1 whose client sentretainas its own metadata key with the valuedemoteorexpirereads to N as closed with that mode. N-1 treats N’s key as any other metadata, and nothing else reads it, so a rollback leaves nothing behind. No gate holds the rollout.tests/unit/test_run_ledger.pyandtests/unit/test_extraction_queue.pycheck N’s side, and the mixed-version gate does not check this rule. -
The curator mode
assist(no migration): N acceptsassistinnamespace.registerand stores the word inloom.namespaces.curator_mode; a pass of N over such a namespace asks a model about its pending proposals and addsprompt_version,model,llm_calls,spend_usd,opinionsandunansweredto its row’s metadata (the model step). N-1 refuses the word on a write with 422, serves a stored one as it is, keeps it through a register that omits the field, and its worker runs the namespace’s pass asfindings: it calls no model and recordsfindingsas the mode it ran in. While both builds serve, a namespace set toassisttherefore gets its opinions from the passes a replica of N runs. N’s tick takes a namespace whose newest closed pass ran in another mode, so a pass of N-1 is followed by one of N at N’s next tick: one more pass a cadence at the most. N-1’scurator.statusrefusessections: ["opinions"], as it refuses any section it does not know, and answers noopinions, noproposals.with_opinionand nomodel,llm_callsorspend_usdonlast_pass; a client reads each as not computed. No gate holds the rollout. A rollback leaves the stored mode and the pass rows: N-1 serves a row’s metadata, opinions included, as it serves any run’s, and sends nothing to a model.tests/unit/test_curator_worker.pyandtests/unit/test_namespace_curator_mode.pycheck how a build treats a mode it does not know, and the mixed-version gate does not check this rule. -
A sync request’s marker (
knowledge_source_request:<name>rows ofloom.code_index_state, no migration): build N writes a marker beside a sync request and itsknowledge_source_requestsworker starts the source’s turn from it; N-1 writes none, reads none (its reads of the table are by exact key or by another key prefix) and runs no such worker. The request isrequested_atin the source’s sync state on both builds, so a request N-1 recorded, or one whose marker no N worker reads, is served by the sync worker’s pass of either build, and a turn N-1 runs leaves the marker for N’s worker, which clears it once the request is gone. N-1’sknowledge.source.sync_nowanswers withoutstarts_after, which a client reads as empty, and its/v1/admin/workers.statusrows carry nomax_pass_seconds, where the dashboard keeps three intervals as the bound. A verified change notification writes the same marker on N, and N keeps two more keys in the sync state,push_delivered_atandrequest_idle_at. N-1 reads neither and keeps both: its request writes merge into the state they read and its turn rewrites that state. A notification that lands on an N-1 replica records its request with no marker, a turn N-1 runs does not renew a request asked for again while it ran and does not moverequest_idle_at, whose older value only ages, and N-1’s push status answers withoutlast_delivery_at, which a client reads as empty. Each costs latency up to the next pass, never a sync. A namespace erasure of either build purges the markers with the table’s other rows. A rollback leaves markers no build reads; they cost nothing and N settles them when it serves again. No gate holds the rollout.tests/unit/test_knowledge_source_requests.py,tests/unit/test_knowledge_source_sync.pyandtests/unit/test_source_push.pycheck N’s side, and the mixed-version gate does not check this rule. -
Team worker sources (
knowledge_source_worker_team_reads_enabled, no migration): with the setting on, N registers aliveworker source with thecurrent_team_accessreader policy and writes team reader links (knowledge.source.worker_link) inloom.mcp_worker_source_readers, which every build since migration017has. N-1 refuses a registration withteam_accessasunavailable, so a preview made on N answers that on an N-1 replica and the caller previews again, and it answersknowledge.source.worker_linkandknowledge.source.worker_unlinkas unknown operations. N-1’sknowledge.source.liveserves a team read from the source and link rows N writes with every check N makes but two: the owner’s standing and the setting. On an N-1 replica a reader keeps reading, through their own account only, after the owner was deactivated, revoked or lost the writer role, until owner erasure deletes the registration, and whether or not the setting is on. So the operator turns the setting on only once every replica runs N; it is off by default, so the rollout itself writes no team source or link. Whatever the setting, N’sknowledge.source.worker_unlinkunlinks a reader. With the setting off, N serves no team read either, so turning it off stops every team read on N replicas at its next check, and none on an N-1 replica. Before a rollback to N-1, remove every team source with N, or unlink every reader, since neither the setting nor the owner’s standing stops a team read there; otherwise accept both gaps while N-1 serves.tests/unit/test_mcp_worker_setup_link.py,tests/unit/test_mcp_worker_setup_register.pyandtests/unit/test_mcp_worker_authority.pycheck N’s side, and the mixed-version gate does not check this rule. -
The
skillssection of a pack and a skill’s listing line (context.pack,skill.get,skill.check,skill.list, no migration): N renders the section, takes its name inonly_sections,section_token_budgetsandblock_order, answerslisting_linefromskill.getandskill.checkandnamespaces_not_listedfromskill.list, and its session primer says to load a listed skill withskill.get. N-1 renders no such section, refuses a request that names it inonly_sectionswith a 422 (its list of section names does not hold the value), ignores the name in the other two fields, and answers neither field. So a pack N-1 serves lacks the listing and is otherwise what N serves, and a session whose packs alternate between the builds sees the section come and go, which moves its stable prefix: the section is the pack’s first. N’s primer beside N-1’s pack asks for nothing, since its sentence applies only to a skill a pack lists. The command line and the dashboard print a line, and the namespaces not listed, only from an answer that holds the field. No shipped client names the section inonly_sections, and none may before the release that serves it is on every replica. The section readsloom.skills, which every build since its migration has, through one statement that selects no text, and writes nothing, so a rollback leaves nothing behind. No gate holds the rollout.tests/unit/test_context_pack_skills.pyandtests/unit/test_skill_listing.pycheck N’s side, and the mixed-version gate does not check this rule. -
An MCP worker copy’s
synced_fromkeys (no migration): N’s copy turn writessource_document_idandsource_linkin a copy’s metadata, and N’s search reads them for a hit’ssynced_from. N decides from the stored row whether a copy has them, so a copy N-1 writes or rewrites without them readssynced_from: nulluntil N’s next turn of its source, which reads it through the worker once more and writes it with the keys. A snapshot copy whose resource changed upstream since it was copied takes the current text on that read, and its copy time moves. N-1’s search servesnullfor every MCP worker copy. That rewrite chunks and embeds each such copy again and spends the pass’s document bound, so a source with more such copies than the bound takes several passes and its turns markpass bound reached(shown as Incomplete) meanwhile. N also recordsrefused_aton the entry of a copy whose rewrite the store refused, or whose read for the keys the worker answeredunsupported, andretry_aton one whose read for the keys timed out (tried again half the stale window later), so the copy goes back to its access checks meanwhile. N-1 ignores both but keeps them in the entry. N honoursrefused_atonly while it is newer thancopied_at, so a copy N-1 rewrote without the keys after the refusal is read again on N’s next turn, not a full interval later; aretry_atholds until it passes, whatever N-1 does meanwhile. N-1 setscopied_atafter every read of a stored copy, a refused or skipped write included, so in the mixed window N can serve asynced_atnewer than the copy’s text, until N’s next write of that copy. A rollback leaves the keys,refused_atandretry_atin place, and N-1 reads none of them. No gate holds the rollout.tests/unit/test_worker_source_copies.pyandtests/unit/test_knowledge_search_synced_from.pycheck N’s side, and the mixed-version gate does not check this rule. -
A Worklist card in a saved Ask AI chat (browser storage, no migration): the dashboard keeps a signed-in person’s chats, with the cards read in them, in the browser’s storage for 30 days from their last use, and every tab the browser has on the deployment reads them, whichever build’s bundle the tab runs. N’s panel reads
namespace.worklistinto a card and saves it with its chat. N-1’s bundle knows no such card: a tab on it that shows the chat (chosen under History, or open there when a tab on N adds the card) looks the card’s operation up in a role table that does not hold it. Where the dashboard has read the person’s role on the namespace, that fails while the card is drawn and the tab shows the dashboard’s error page; Reload there starts with no chat open, and every other chat opens. With arolesclaim that reaches admin, or a role the dashboard cannot read, the card is drawn under the title “Inventory” without the rows it read, and its Read again reads nothing. This lasts for a tab on N-1’s bundle during the rollout, and for every tab after a rollback, until the chat is deleted under History (Delete in its row’s menu, which does not open it) or its 30 days end. N cannot change what N-1’s bundle does with a card it does not know. No gate holds the rollout.frontend/src/views/assistant/cards/WorklistCard.test.tsxchecks N’s card, and the mixed-version gate does not check this rule. -
Knowledge reports (
loom.knowledge_reports, migration137_knowledge_reports.sql): N-1’s erasure saga has no step for the table. So while any live replica, in every deployment sharing the database, has a schema version below 137, or no heartbeat has been read,knowledge.reports.submit,updateandevidenceanswer 503, as knowledge gaps do under rule 48; N-1 serves noknowledge.reports.*op. Before a rollback, delete the table’s rows, then delete again after the first N-1 replica serves (knowledge reports).tests/unit/test_knowledge_reports.pychecks the refusal; the mixed-version gate does not. -
A required regression suite (
knowledge.suites.publish,memory.proposal_decide, migration 138): N stores whether a revision requires the suite’s checks inloom.knowledge_suites.requiredand refuses an acceptance of a covered key whose checks are not satisfied. N-1 has no such check and accepts the key. Soknowledge.suites.publishwithrequired: trueanswers 503OVERLOADEDuntil every live replica of every deployment on the store runs migration 138, and while the fleet cannot be read: a requirement is never stated while a replica would skip it. A publish without the field or withfalseis not held by this gate. The column isInt8 DEFAULT -1, and N-1 names its columns when it inserts a revision, so a revision N-1 publishes states no requirement and the reads take the newest stated value (argMaxIf(required, revision, required >= 0)): the suite keeps the requirement it had. N-1 ignoresrequiredin a request and names it inignored_args, and its answers carry norequired, which a client reads as its signal that the requirement was not taken. After a rollback N-1 accepts unchecked and the stored requirement applies again once N serves; nothing is turned off first. A publish N-1 serves writes noknowledge.suites.requirementrow: a key, a prefix or a case it removes from a required suite is recorded only in the counts of itsknowledge.suites.publishrow, and the requirement holds less once N serves.tests/unit/test_proposal_requirement.pychecks the gate, the constant against the migration’s file name and the read of a row N-1 wrote, and the mixed-version gate does not check this rule. -
A review brief’s payload version (
PAYLOAD_VERSIONinserver/code/app/index/review_brief.py, no migration): N rebuilds a stored brief of a lower version on read and stores it under the same key; N-1 serves a brief of N’s higher version as it is, answering its verdict (where N-1 has one) by its own rules, and never rewrites a row of its own version or higher, or one a newer build marked. So a bump that adds a cause N-1 does not know ships N-1’s reading of that cause first (rule 3), or N-1 can settle a brief N leavesunsettled. A brief N-1’s ingest writes while both serve is of N-1’s version, and N rebuilds it once. A build that cannot store its brief writes the old one again withrebuilt_forset to its version, with the replaced row’sversioncolumn plus one, so any build stored later replaces it, and neither build tries that row again until a higher version serves, whatever made the build fail; a row whose marker could not be written is built again by the next read. A rebuild’sversionis its host’s clock: on a host whose clock runs behind the stale row’s writer by more than the time since that write, the stored rebuild loses to the row, and reads build again until the clock passes it. Both builds read the same rows, so a rollback leaves rebuilt briefs as newer rows N-1 serves as they are (PR history). No gate holds the rollout.tests/unit/test_code_review_brief_mirror.pychecks N’s side, and the mixed-version gate does not check this rule.
What checks them
scripts/gates/mixed_version.py (make test-mixed-version, the mixed-version CI job,
once with a Keeper and once without) boots the base build on an empty ClickHouse, then
this build, which applies its migrations, then the base again on the newer schema, and a
third process of this build with a changed dashboard bundle and one no-op migration more
(N+1). It checks:
- each build answers ready after the cross-boot;
- memories, a run begun on one build and completed on the other, and a conflict verdict through the other build’s version write read back whole across builds;
- a column added as N+1’s migration would survives a version write by each build, made as soon as every process has acknowledged the column (rule 2);
- a build on a ledger newer than itself logs the WARNING;
- every asset each dashboard page names loads from a replica of the other build (rule 9);
- with every process on
LOOM_BACKGROUND_WORKERS=auto, exactly one process runs the workers, and it is N+1: N, which took the lease first, hands it over to the higher schema version (rule 6).
It does not check new enum values (rule 3), wire formats (rule 4), signing keys other
than default (rule 5), new revocation keys (rule 18), an /assistant history entry
(rule 46), or a process killed mid-migration. It skips with exit 0 where docker is
unreachable; CI passes --require, which fails there instead.
Analyst event storage cutover
The ordinary agent_events table keeps the ordinary_events_only CHECK. It rejects
marked rows and reserved mirror namespaces. Marked requests and mirror workers write
to agent_events_private. Readers for trusted cost, budget and history-policy queries
cover both stores.
The analyst reads analysis_ordinary_agent_events for ordinary requests and worker
events. The signed view excludes marked rows and reserved namespaces. The
analysis_agent_events view combines both stores and masks marked fields before
returning rows. With column grants only on these views, the analyst cannot inspect
the physical event tables or their storage metadata.
Deploy Loom v1.3.0 or later to each serving replica before installing these views.
During setup, Loom revokes legacy grants on the physical event tables before
granting the views. Both versions keep the same analyst login and signed canary.
Once the new version writes its entities, a query that names loom.agent_events
must use loom.analysis_ordinary_agent_events. A replica still serving the previous
build can report the old catalog until it is upgraded.
The provisioner checks native SHOW CREATE ROW POLICIES ON <loom_database>.* before
writing Loom’s policies and grants. This requires policy visibility in Loom’s
database. The views filter data at read time and the analyst has no storage grants,
so setup needs no global policy catalog or per-writer proof of the ordinary table’s
contents. loom ch-setup --apply-analyst-sql runs the same live checks.
Mirrored creation remains disabled until the fleet, read and session protections
and enablement procedure are complete. Before an older build serves after enablement,
the rollback procedure must settle writes and erase every mirror store, including
agent_events_private; restoring a grant or downgrading the schema is insufficient.
Analyst probes across catalog versions
The analyst probe checks its signed key canary before reading the stored entity version. When a newer build owns the entities, the older probe leaves that build’s catalog and grant checks to it. It does not query retired tables or overwrite the newer entities. A failed key canary still refuses analysis, regardless of the version stamp.
Deploy this probe ordering across the fleet before a later catalog change revokes a raw
relation. Builds with the earlier probe order can refuse insights.query after that
cutover because they probe the retired relation before checking the entity version.
Statements naming a removed relation still fail its grant check; trusting the newer
catalog does not restore a retired grant.
Connected-account registrations
The account registry is additive and is read only by builds that understand connected
sources. Such a source stores an empty legacy kind and credential, with its provider
kind in source_kind; an older worker cannot interpret it as a shared credential. Its
owner_subject and connection_id bind every credential checkout and publication to
the canonical person’s current account generation. The source id also distinguishes
its mirror copies from another registration using the same item address.
Keep connected and mirrored creation disabled until the fleet’s mirror read and session
protections are complete. A rollback or restore must settle source writers and perform
the mirror cleanup described in document sources
before an older build serves. Account rows restored without their matching Keeper
fence refuse credential checkout. That refusal does not prove physical erasure: restored
provider identities, sealed credentials and source history still need canonical-owner
cleanup and its census. Namespace or end-user erasure cannot substitute for that exact
owner key. loom reconcile --apply ends connection authority before publication for
either restored store. On a ClickHouse-only deployment, stop all serving processes,
restore the configured stores, then run python dev/restore_connected_accounts.py first
without flags and then with --apply. It refuses recent worker activity and never
remaps a scratch restore target into the deployment client. Both paths fence all
historical connection keys and verify physical owner-history deletion. Complete the
separate mirror-content cleanup before serving; this account procedure does not replace it.
Independent proposal approval
Stop and drain every older API, worker and command-line writer before applying
114_memory_proposal_review.sql. Keep writes paused until the upgraded processes serve.
The migration adds review state to current and historical memory rows, marking proposed
and rejected rows pending. Older writers do not enforce approval and can reset the review
flag when they rebuild a row without the added column. Rolling back restores the older
authorization behavior.
If older writers ran after migration, keep writes paused until an independent audit has
identified every affected proposal lineage. Inspect historical proposal and rejection
transitions and their later revisions by full identity and memory id, including currently
active rows whose review flag is false or absent. A scan of requires_review = 1 cannot
find rows whose flag an older writer discarded. Under Postgres inspect the authoritative
revision journal and memory_current.row; a ClickHouse projection can lag. If available
history cannot establish the affected set, keep writes paused until the audit resolves it.
Quarantine affected current rows with memory.reject, then write each complete value as
a proposal with memory.set(proposed=true) for independent review. Do not clear the review
bit or treat a passing grade as approval. Consolidation excludes pending sources.
Legacy rejected native rows and snapshots without the review field conservatively require
review; an explicit false field on an ordinary rejected fact preserves its correction path.
Clients accepting proposals must send approved_sha256 for each key and use an
authenticated human administrator independent of the proposer. Automatic policies continue
to reject failed proposals and leave passing proposals pending human review.
A rejection is bound to the text that was read by the same field, which a build a release behind does not check:
- Build N refuses a rejection that sends no
approved_sha256for a key withhash_requiredand writes nothing. A client that rejects without it, such as a dashboard page loaded from build N-1, is refused until it sends the hash. A result withoutcode, from N-1, is shown by itsreason. - Build N-1 compares no hash on a rejection, accepts one without it, and rejects the
newest row of the key, whichever pending proposal the reviewer read. While both builds
serve, decide a key that several pending proposals hold only once every server is on N;
the dashboard offers no decision for a key that several of the proposals it lists hold.
A page listed oldest first (
order="oldest", the dashboard’s Oldest first) can hold a key’s older proposal while the key’s newest lies past the page, and nothing on that page shows the key is shared. While both builds serve, reject from the newest order.