Skip to content
Loom Docs
Esc
↑↓navigate↵open⌘Jpreview
Product
View as Markdown
On this page

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

  1. 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.

  2. A version row keeps columns its build does not know. loom.memory, loom.shared, loom.memory_embeddings, loom.session_summaries, loom.entity_summaries and loom.documents are ReplacingMergeTree(version): the newest row replaces the whole previous one. Before each insert into them, ch.insert fills 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 a loom.documents column 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 with SELECT * and keep every column.

    • Each process checks loom._migrations and 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 ALTER would still drop the column. So each process acknowledges the lists it carries by in loom.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, or LOOM_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 while system.processes on 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 as INSERT … SELECT … FROM input(…) whose WHERE 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 its max_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 its max_execution_time (when no query of it can run or start); once the deadline has passed, KILL QUERY … SYNC and a count of 0 in system.processes on every replica release it earlier. A held write whose queries cannot be counted shows on /v1/health as carry_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: while loom.carry_acks cannot be written, every carried write (memory.set among 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_sha256 it describes), and N can tell it is stale.
    • A hand-written INSERT … SELECT with a column list is not carried. Only operator commands (loom reembed) write those; run them when one build serves.
  3. New enum or status values: N ships readers that accept them, and only N+1 writes them. N-1’s Pydantic Literal would 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 as unsupported_projection. So N records a triples repair that failed after its insert as entity_triples_repair, not entity_triples, which N-1 would replay by inserting the triples again. A replay of an entity_triples failure that inserts them and then fails its repair keeps the failure: one mutation records that they landed and moves its entries and results to keys N-1 does not read, so N-1 refuses it (no entries) and leaves it active. N writes a failure’s abandoned status because N-1 reads that status as a plain string and lists only active ones; the status="abandoned" list filter works only on N replicas. The conflict resolver’s owed follow is triples_follow_owed, not triples_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 answered unsupported_projection and 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.

  4. 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 namespace alone (a knowledge.list naming namespaces) is new in N, and each build refuses the one the other wrote (rule 12). The code_ingest resume cursor names each cut as org/namespace in N; the other build finds no entry of that name and serves its entries in configured order for that pass. The knowledge_source_retire resume 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).

  5. Signing keys: rotate with --activate-in of 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.

  6. 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.

  7. Settings: a removed setting warns at boot rather than refusing to start. A new setting’s default accepts what N-1 is configured with.

  8. Retiring a column or table: stop using it in N, drop it in N+1 or later.

  9. 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-Key records, 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 with LOOM_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.

  10. A task.create key’s exclusion holds only among N’s replicas. task.create with 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 marked backfilled in 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.

  11. 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.

  12. 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. So memory.restore’s preconditions if_superseded_by and only_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 the relations of memory.set, memory.update and memory.update_by_id are dropped there, so that write graphs none of the facts it names. memory.get_by_id’s omit_high_value does not hold there either: N-1 answers a high row with its value and hash, and audits that read as a sensitive one. memory.verify’s if_match_sha256 does not hold on an N-1 replica, which attests or revokes the row it reads. N’s conflict resolver does not read the memory.unsupersede record 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’s knowledge.list rows carry no namespace, on any list; one naming namespaces lists namespace alone there, and each build refuses the cursor the other wrote for such a list, so a client paging it starts again. memory.set’s if_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’s dry_run and revision do 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 in ignored_args.

  13. A name N spells differently is a different node. N keeps combining marks and NFKC-normalises an entity’s name (दिल्ली, İstanbul as istanbul); 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 ligatures fi and ij, 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.

  14. An erasure N-1 runs misses the tables N adds. N-1’s saga and its census do not know entity_triple_rows and entity_edge_rows, so an erasure it runs during the rollout leaves their rows in its scope and still records the saga completed. Once N-1 stops serving, re-verify the erasures completed since the rollout began: loom erasure-re-verify --completed-since <rollout start> --resume deletes, 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 by memory.delete or not.

  15. 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 writes 00:00:01 (owed) and 00: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: its is_mark takes 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 is conflicted, 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’s memory.pin holds 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 (or loom reconcile-status).

  16. 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, their last_seen second (.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.

  17. 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_restore and sensitivity_facts_owed among them, active as unsupported_projection; N’s repair replays them once N-1 stops serving.

  18. 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.

  19. 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 its kid), but on N its first @me write 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 a col- name that N refuses (the boot warning lists the first 20); and it resumes a user purge without purging (it reads no purge column). 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.

  20. Saved conversation messages: older builds can compact concurrently saved turns and rebuild embeddings without carrying their saved state. Clients use conversation.save_message only 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.

  21. An extraction policy (extraction_policy.set): N-1 does not read loom.extraction_policies and 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.

  22. 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_outbox row, 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 in loom.memory_versions, which every build’s erasure deletes.

  23. Assistant-turn learnings (memory_extract_agent_learnings): N-1 does not erase loom.learnings_supporters, where a user’s quotes behind a bot’s rule live, and on learnings.review it promotes an assistant_turn candidate as the approver’s own memory. Turn the setting on, and review assistant_turn candidates, only once no N-1 replica serves. Before a rollback, turn it off and delete the rows of loom.learnings_supporters and the assistant_turn rows of loom.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 tagged source-kind:assistant_turn with knowledge.delete before the rollback; otherwise accept the wider serving.

  24. A namespace guide (namespace.guide_set): N-1 does not serve the guide ops, shows no guide in namespace.browse, namespace.get or the session-start pack, and a namespace erasure it runs has no step for loom.namespace_guides. So namespace.guide_set answers 503 OVERLOADED while 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.py checks the refusal; the mixed-version gate does not. The gate counts the deployment’s processes (loom.instances of its kind): an older process outside it on the same ClickHouse, such as a branch server, is not counted.

  25. Platform-admin bots (loom.machine_identities.platform_admin, migration 076_machine_platform_admin.sql): the column’s UInt8 DEFAULT 0 reads 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 and loom mint-token --platform-admin therefore 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 503 temporarily_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.

  26. A bot’s longest token (loom.machine_identities.max_access_token_s, migration 077_machine_access_token_ttl.sql): the column’s UInt32 DEFAULT 3600 reads an hour for every bot made before it. N-1 ignores a request’s expires_in and issues an hour, its /v1/admin/bots.create refuses 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. So create_bot (the admin route and loom 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’s expires_in needs no gate: N-1 answers it with an hour. After a rollback, reapply each maximum once N serves again (loom bot create --replace with the bot’s key or trust and roles as registered, which also ends its tokens). The mixed-version gate does not check this rule.

  27. An erasure saga’s audit actor (loom.erasure_requests.actor, migration 081_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-worker or the CLI command) on its failed and completed rows instead of the principal that asked. N-1 also still writes the body’s requester as the actor of the erasure.* 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.

  28. A new document-source kind (recording or notion in loom.knowledge_sources.kind): N-1 refuses to add one (BAD_KIND) and lists and inspects one like any source. Its check and rotate of 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 ends credential_invalid before 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 a notion document by its revision and text hash, so a hand-off between the builds mines a notion document 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.

  29. Typed datasets (loom.datasets, loom.dataset_rows, migration 083_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 records completed: 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.

  30. 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 ones source-changed, and writes its own. The rows are the extractor’s own and the next run by N writes them again from the document; a source-changed tag 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.

  31. A new shared-folder file kind (docx in a gdrive source’s include): N accepts the kind and writes it only when a caller names it; a config without include, and the dashboard form’s default, take the four kinds N-1 knows. N-1 has no docx in its file-kind table, so it refuses to add a config that names it (BAD_CONFIG), its check and rotate of 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 status failed, error KeyError, nothing is retired, and the next turn by N syncs it. No gate holds the rollout: the cost falls only on sources whose config names docx, 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 only docx beside one that names the other kinds (the way document sources add a kind) confines that to the .docx files. N+1 may take docx by default. This departs from rule 3 the way rule 28 does for a new source kind: holding add back a release would hold back every folder of .docx files, 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.

  32. A native document’s pictures out of its export (the gdrive sync’s docs conversion): 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 a text_sha256 in 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.

  33. The memory authority (loom.storage_authority, migration 085_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 writes loom.memory directly, 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.

  34. A user purge deletes the memory rows last (memory.retire): N-1 has no memory.retire, and its loom erasure-re-verify --resume runs 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.

  35. 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 from service_accounts.create with a namespace before *, or an admin/token.mint token whose namespaces start 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_to claim and loom.service_accounts.saves_to, migration 093_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 drops saves_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.create answers where it saves under that rule, and admin/token.mint answers no saves_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 writes saves_to empty: 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 create without --namespace) and a mint without a name (the dashboard’s form with its Name left empty, loom token create without --name). N has no /v1/me/setup/mcp_config, which N-1’s dashboard calls. N refuses saves_to beside * and a collection before *, which N-1 mints (dropping saves_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, roles and clients; 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 no saves_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 you as its owner and N-1 with dev. 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=dev and the token’s org (default for one made on the Tokens page) on GET /v1/me/service_accounts and POST /v1/me/service_accounts.revoke.
  36. The memory a cached code.ask answer quoted (loom.code_answers.memory_namespace and memory_keys, migration 086_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 negative code.outcome) drops them, so its text stays where no erasure finds it. N-1’s saga, census and memory.redact do not know the table, so an erasure or redact N-1 runs leaves the answers N stamped in its scope and still records completed. A saga N-1 left in_progress runs code_answers.delete when N resumes it, since the step is not in its steps_completed; one N-1 completed is not run again, and loom erasure-re-verify does 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.

  37. 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 passed memory.retire. In a purge, N’s memory.retire runs them again, except for the search rows of shared copies of the user’s own memories when N-1 ran its shared.tombstone, which deleted the rows they are found by. After a purge that passed memory.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 without purge that was requested before then (the user_id rows of loom.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.

  38. Knowledge document heads (loom.knowledge_heads, Postgres migration 002_knowledge_documents.sql): under the Postgres authority N commits each document write as its source’s head; N-1 writes loom.documents alone. 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 no pg_knowledge.delete step 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 with LOOM_RETENTION_DOCUMENTS_DAYS set under this authority (unset it first, step 2) and puts no namespace retention TTL on loom.documents or loom.chunks; while an N-1 replica leads the retention_reconcile pass it applies a namespace’s retention_days to 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 read loom.documents alone, 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 than LOOM_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.

  39. The chunks a knowledge head serves (chunks_revision, chunks_version on loom.knowledge_heads, Postgres migration 004_knowledge_chunk_heads.sql): under the Postgres authority N’s search, outline, synthesis and memory.stack knowledge 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 revision chunks_revision is 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’s knowledge.add and bulk_add again 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.

  40. Knowledge ingestion jobs (loom.knowledge_jobs, Postgres migration 005_knowledge_jobs.sql): under the Postgres authority N keeps each job in Postgres and projects each committed version into loom.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 fails original_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 to loom.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’s lease_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 for loom.knowledge_jobs and leaves the scope’s jobs there, and N’s worker projects an open one back into loom.knowledge_ingestions and 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.

  41. The erasure receipt (loom.erasure_requests.census, migration 091_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’s erasure.status answers as no receipt (census: null). N also writes the purge a saga applies to the purge column (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.

  42. The knowledge dataset catalog (loom.knowledge_datasets, Postgres migration 007_knowledge_datasets.sql): under the Postgres authority N commits each catalog row there and projects it into loom.datasets, best effort, so N-1 may read a catalog row a version behind until N’s next write of it; N-1 writes loom.datasets alone. 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 remove loom.datasets rows 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.

  43. A revision’s delivery time (delivered_at on loom.memory_revisions, Postgres migration 010_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 of committed_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. Turn LOOM_PG_PAYLOAD_CLEAR_ENABLED on 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 reconcile runs 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.

  44. Document sources on any namespace (knowledge.source.* without the trunk check): N-1 still refuses add, check, rotate and sync_now on 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’s namespace.delete, collection.delete and 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 runs knowledge_sources.retire late, 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’s add does not read the ledger, so a source it adds during an erasure N runs, after N’s knowledge_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.

  45. A namespace’s promoted rows (shared.tombstone in the namespace saga): N-1’s namespace erasure has no step for loom.shared and its census does not count the table, so a namespace or namespace_list erasure 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), but memory.lineage and 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.

  46. An /assistant history entry (the dashboard’s expanded assistant window has no address): an N-1 tab pushed /assistant entries, 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 (landingTarget for 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 the assistant page 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.

  47. A cell’s org triggers and loom.tenancy guard keep their names and shape (cells). The session marker loom.tenancy_checked, the functions loom.tenancy_refuse_unheld() and loom.tenancy_refuse_unmarked(), the trigger names tenancy_insert, tenancy_update and tenancy_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), and missing accepts the body and settings any shipped file writes. A changed body ships in two releases: release K adds the new body to missing as an accepted value beside the shipped files’, and the migration that writes it ships no earlier than K+1, so an N-1 loom doctor or attach on a migrated cell names no defect. The WHEN text lives in the code that creates the triggers (server/core/cell_triggers.py), so a changed WHEN ships in three releases, in the body’s order: release K adds the new WHEN to missing (which loom doctor and attach read) as an accepted value beside the one it creates; K+1 creates the new WHEN and keeps the old one accepted, so a K pod that creates a trigger on a skipped table, and a K missing reading one K+1 created, both name no defect; and the migration that drops the triggers, which the same boot then creates with the new WHEN, 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 with LOOM_CELL unset, 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.

  48. Knowledge gaps (loom.search_misses and loom.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, the knowledge_gaps worker writes nothing and knowledge.gaps.list answers 503, as namespace.guide_set does under rule 24. The operator turns LOOM_KNOWLEDGE_GAPS_ENABLED on 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.py checks the refusals; the mixed-version gate does not.

  49. A document source’s items (loom.knowledge_sources.source_kind, items_json, secret_enc, migration 096_knowledge_source_items.sql): N writes a source whose items the id-list config can hold (only non-recursive folders, at most 20 of anything) as N-1 writes it, kind, config_json and the credential in credential_enc, with items_json beside them, so N-1 lists, checks, rotates and syncs it as before. Any other source is stored with kind empty, its kind in source_kind, its credential in secret_enc (purpose knowledge_sources.secret), credential_enc empty and config_json holding no item. N-1 lists such a source with kind ''; its check answers credential_invalid (its credential_enc is empty) and asks for a rotate, and its rotate fails 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 ends credential_invalid before any request and retires nothing. N-1’s remove of it, and its retirement when its namespace goes, write an inactive row whose new columns read empty. So knowledge.source.add and knowledge.source.update answer 503 OVERLOADED (retry_after_s 30) for a source they would store with kind empty 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 reads source_kind first and kind when it is empty, and items_json first and config_json when it holds no item, so a row N-1 rewrote reads as it wrote it. N-1’s sync_now without full writes full: false over 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’s loom secrets reseal does not reseal secret_enc, and its --check reports clean, so run the reseal from build N before dropping LOOM_JWT_SECRET_PREVIOUS: a secret_enc left under the old key reads as no credential and its source’s turns end credential_invalid until rotated. A later release, once no build below 96 runs, writes kind for every source and keeps one credential column. tests/unit/test_knowledge_sources.py checks the refusal, and tests/unit/test_knowledge_source_sync.py that a folder turn over such a row ends before any request; N-1’s check and rotate failing is read from its code, and the mixed-version gate does not check this rule.

  50. 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: its gdrive turn holds back new files past 50,000 and ends failed with too_many_documents over it, retiring nothing; its linear, notion and recording turns 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 in tests/unit/test_knowledge_source_sync.py, test_knowledge_source_sync_linear.py, test_notion_source_sync.py and test_knowledge_source_recordings.py check N’s side; N-1’s is read from its code, and the mixed-version gate does not check this rule.

  51. Mirror names are reserved (migration 097_mirror_names_reserved.sql): N’s gate refuses every request that names a namespace of the form acl- and 24 hex digits (only a platform admin’s erasure.request may name one), with auth on or off. namespace.register and namespace.restore refuse the form, and N’s org-wide scopes, the sql_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 as org/namespace with 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.remove for a repository and namespace.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.py checks N’s side, and the mixed-version gate does not check this rule.

  52. The mirror registry (migration 098_knowledge_mirrors.sql): N adds loom.knowledge_mirrors and the access column of loom.knowledge_sources, whose default (namespace) is what every row N-1 writes means. N stores a source whose access is mirrored with kind empty, 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 mirrored gdrive one into the mirror), its retire pass leaves its delete request alone, and check, rotate, update, sync_now and an add of a removed one’s name refuse with SOURCE_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.forget writes the mirrors deleted, 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.py and the mirrored cases in tests/unit/test_knowledge_sources.py and tests/unit/test_knowledge_source_sync.py check N’s side.

  53. A document’s permission list (migration 099_document_access_lists.sql): N adds loom.documents.access_json, the permission list of a mirrored document (document sources); under the Postgres authority it rides in the head’s row, 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 reads unread and 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.py and tests/unit/test_document_row_builder.py check N’s side.

  54. Mirrored folder sources sync (migration 100_knowledge_source_listings.sql): N’s sync worker runs a mirrored gdrive source, while its ops still refuse one (SOURCE_NOT_SERVED, rule 52). Each turn lists every file with its permissions, reading permissions.list for 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>, tagged source-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 to unread for 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 to loom.knowledge_source_listings once 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 mirrored gdrive source as one shared service account: the build that adds sources of another credential mode stores them in a form mirror_synced rejects 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.py and tests/unit/test_knowledge_source_revisions_sql.py check N’s side.

  55. 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.py checks N’s side.

  56. Mirror erasure receipts (migrations 101_erasure_mirror_mark.sql and Postgres 013_erasure_mirror_mark.sql): N adds a Boolean mirror_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.

  57. Stopped mirrored sources retain their retirement requests: N writes a knowledge_source_retire:<source id> key under the mirror in code_index_state before inactivating the registration. Its always-on knowledge_source_retire worker 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.py checks name replacement, bounded progress and cursor persistence.

  58. 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_private and agent_cost_rollup_daily, before clearing the enablement latch. Stopping a client after its timeout does not prove a sent insert has completed.

  59. Personal-agent reader claims and verified directory evidence (migration 103_sso_domain_evidence.sql): N adds empty-default hosted_domain and issuer String columns to sso_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 Boolean reads_as_creator claim, absent meaning false. Only the primary first-party sign-in route POST /v1/me/personal_tokens.create and the assistant’s one-answer bridge set it; ordinary delegation omits it. Saved personal tokens use the existing String kind column with value personal_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.py checks the claim and delegation boundaries.

  60. 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 within LOOM_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.

  61. Coarse permission keys and private lexical statistics (migration 105_mirror_access_candidates.sql): documents.access_keys is 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.

  62. 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 only budget.warning task 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.

  63. The embed_exclude marker (unembedded by design: reference (embed_exclude) in embed_last_error on code_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 neither LOOM_CODE_EMBED_EXCLUDE nor an entry’s embed_exclude: where it runs, its ingest embeds a matching path’s new chunks, its code_summary pass writes their cards, and its loom code reembed and provider rebuild embed the marked rows under the target model. A chunk N-1 embedded keeps its vector until its content changes.

  64. A compiler tier’s checkout shares its mirror’s packs by hard link, each kept by a .keep file, only with LOOM_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. In tests/unit/test_code_compiler_checkout.py, a pass of N, then N-1’s fetch, checkout --force with 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.

  65. 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’s code_index.purge refuses, 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.residue fails the saga on those in code_chunks and code_summaries, and it is repeated. No gate holds the rollout.

  66. 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 link missing or unresolved. N weighs an unresolved link again from the commit its code was last read at, at its next recheck within 30 days or when its file changes. A missing link is never handed to a definition added since, so a link N-1 read missing during the rollout stays missing under 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_ranges is a number in the memory_code_links pass outcome, which every build serves as stored. No gate holds the rollout.

  67. 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 reads moved, and a link to a definition that lands at another path or name reading changed, and its policy step revises the memory’s text where the swap is certain. A build that marks neither, or only the moved one, 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.validate lists the edit of a moved link, as before. A link that read moved before 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 read changed at 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 a revise namespace. The revision is a memory.update_by_id write, which N-1 reads as any other version; N also writes the row’s files, an existing column. N links the revised memory itself, and writes a changed link 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 them fresh. renamed is one more number in the pass outcome. No gate holds the rollout.

  68. Code store names are reserved (migration 118_store_names_reserved.sql): N’s gate refuses every request that names a namespace of the form crs- and 24 hex digits (only a platform admin’s erasure.request may name one), with auth on or off, as rule 51 does for mirrors, and through the same helper. namespace.register and namespace.restore refuse the form, and N’s org-wide scopes, the sql_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 as org/namespace with 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.py checks N’s side, and the mixed-version gate does not check this rule.

  69. 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 with credential_mode crawl, mirrored access and the legacy kind and credential columns empty. N’s add, update and rotate of a crawl answer 503 OVERLOADED while 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: its credential_for admits only shared and connected rows, so its sync turn fails as credential_invalid before any provider request, writing only its sync state, and its check and rotate answer SOURCE_NOT_SERVED for a mirrored row. An N-1 remove or namespace retirement retires the row and queues its copies’ retirement; loom.knowledge_sources is 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 only shared and connected rows, 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.py checks N’s side, and the mixed-version gate does not check this rule.

  70. A TypeScript delta’s held edges (ScipFile.held_edges, written by scripts/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’s edges, and N’s code_scip_apply moves it into edges when the stored compiler-tier row of its target is a function. The delta stays delta_version 1. 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 an edges entry, so N-1 cannot write one into a const or a field. tests/unit/test_scip_ts_kind_prepass.py checks the delta N-1 reads, and the mixed-version gate does not check this rule.

  71. A /help address (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 (helpAddressDocs in frontend/src/lib/docsLinks.ts), which describes the latest main and can be ahead of N. The server keeps serving the help page 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_MS in frontend/src/lib/linkToken.ts) lands on the landing page instead: returnToSignInStart restores 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.

  72. An agent’s usage label names its run and principal (migration 120_usage_label_provenance.sql): N adds run_id, actor and credited_at (default ts) to loom.memory_usage_events, with bloom indexes on run_id and actor and a minmax index on credited_at, and stamps the run and principal on every used, evidence and harm label it writes. N-1 stamps neither, so its labels read as the server’s own events and run.retract_credit never reaches them. A compensation is an event of an existing event_type with a negative event_count, and every reader of the table (the totals view, the fold, the search payload, the label gauge) sums event_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 ignores run.complete’s memories_delivered and credits every memories_used key, so the Python SDK’s RunScope sends as memories_used only 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.py and tests/unit/test_usage_fold_sql.py check N’s side, and the mixed-version gate does not check this rule.

  73. 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 409 PRECONDITION_FAILED for 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 refuses knowledge.source.remove of a worker source with SOURCE_WORKER_OWNED, which N serves. No gate holds the rollout, and the mixed-version gate does not check this rule.

  74. An active worker source registration (knowledge.source.worker_register, a loom.knowledge_sources row with source_kind = 'mcp' and credential_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.list and inspect show it as mcp with its details withheld, and the dashboard offers no action on it; check, update, rotate, sync_now and the push operations refuse it with SOURCE_WORKER_OWNED before they write, remove writes it inactive, and add answers SOURCE_EXISTS for its name. Its sync worker, mirror reads and pending retirement skip it, connected-account stop and its census match native rows only, and loom secrets reseal finds no sealed value in it. Namespace retirement (code.repo.remove, namespace.delete, collection.delete and the erasure step) writes it inactive with its bytes unchanged. N-1’s knowledge.source.live decodes 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 connected add. N-1 counts it with shared sources until it drains: on an N-1 replica worker sources take slots of knowledge_sources_max_per_namespace, so an administrator’s shared add there can answer SOURCE_QUOTA early, and its connected add does 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.py checks N’s writer, and the mixed-version gate does not check this rule.

  75. Read receipts (loom.read_receipts, migration 122_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, turn read_receipts_enabled off with loom settings set and truncate the table, then truncate it again after the first N-1 replica serves (read receipts, the rollback note). tests/unit/test_read_receipts.py checks the gate; the mixed-version gate does not.

  76. The session’s run on a run row (metadata.session_run on loom.agent_runs, no migration): over MCP, N labels knowledge.get, memory.get_by_id, memory.for_file and procedure.match with the session’s run, and a run that run.begin opens there stores that run’s id in metadata.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 a metadata.session_run a client sends as sent, lets run.complete overwrite 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: a session_run of 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.py and tests/unit/test_mcp_session_runs.py check N’s side, and the mixed-version gate does not check this rule.

  77. Worker copies (knowledge_source_worker_copies_enabled, no migration): with the setting on, N registers owner-only snapshot and selected_refresh worker sources, syncs their copies into the collection’s mirror, serves those copies to the owner and queues their retirement on knowledge.source.remove, namespace retirement and owner erasure. N-1 registers no such source, its sync worker and mirror reads skip every worker row, its knowledge.source.live refuses 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’s knowledge.source.remove and namespace retirement queue a worker source’s copies and write its inactive row with pending_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 the knowledge_source_retire worker drain. A source worker build older than N’s names no reason on its 403, 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 answering unsupported follows the lapsing rule with either worker build. No gate holds the rollout. tests/unit/test_worker_source_copies.py checks N’s side, and the mixed-version gate does not check this rule.

  78. 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_id or read_scope on an op with no such field, where that key resolves no scope (a token pinned to a user names another user, a read_scope needs 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 no run_id; N labels or stamps it like the same call without the key. N-1 begins the session’s run on a knowledge.get that names the session of an own_session token, or the user of an own_user token 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 in loom.agent_events names a run_id the 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.py and tests/unit/test_ledger_invariants.py check N’s side, and the mixed-version gate does not check this rule.

  79. The other_namespaces section of a pack (context.pack, no migration): N renders the section and takes its name in only_sections, section_token_budgets and block_order. N-1 renders no such section, refuses a request that names it in only_sections with 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 in only_sections before 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.py checks N’s side, and the mixed-version gate does not check this rule.

  80. A namespace’s curator mode (loom.namespaces.curator_mode, migration 123_namespace_curator_mode.sql): N stores the mode a namespace admin sets with namespace.register and writes it forward with the rest of the registry row. N-1 builds that row without the column, so a namespace.register N-1 serves during the upgrade returns the namespace’s mode to the column’s default, which reads as off, and N-1 ignores a curator_mode it is sent (rule 12). The loss is toward off: the admin sets the mode again once every replica runs N. N-1 answers namespace.get and namespace.list without 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.py checks N’s side, and the mixed-version gate does not check this rule.

  81. A source assigned to a worker subject (worker_subject on loom.knowledge_sources, migration 124_knowledge_source_worker_subject.sql): N writes a worker row with access namespace, 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 with SOURCE_WORKER_OWNED, and never writes it active: its only rewrite retires the row, which leaves worker_subject at the column’s default '', a row that is assigned to nobody. So knowledge.source.worker_assign answers 503 OVERLOADED (retry_after_s 30) 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, which tests/unit/test_assigned_source.py holds to the migration’s file name. The gate covers the roll forward only. N-1’s grants.share_agent does not refuse a namespace that holds an assigned source, so a rollback below N is unsupported while one is active: remove each with knowledge.source.remove first. 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 answers SOURCE_RETIRING until then. No assigned row exists before the gate above opens, so no such entry is written while a process below the migration serves. N serves knowledge.source.worker.claim and knowledge.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 refuses sync_now on the row with SOURCE_WORKER_OWNED. Only these handlers write the statuses importing, needs_reconnect, blocked and revoked, and N-1 shows no worker row’s sync. A rewrite of the row by N-1 changes its version, which ends the turn in progress: its next commit answers CLAIM_LOST. N also serves knowledge.source.worker.stored and knowledge.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 with reason revoked is filed as a removal’s is, so N-1’s queue scan never reads it. A commit N-1 serves keeps the retired key of the sync state it read, so sync.removed can include an earlier turn’s count until N serves the first commit of a turn. N’s retirement worker queues an entry with reason expired for an assigned source nobody verified within the copy age bound (copies of a connection nobody verified) and writes copies_expired_at into 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, and copies_expired_at is 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. The mixed-version gate does not check this rule.

  82. The primer, pin and unpin sections of curator.status (no migration): N computes them from tables both builds hold and writes nothing. N-1 refuses a sections list 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 status does both. No gate holds the rollout, and a rollback leaves nothing behind. tests/unit/test_curator_status.py and tests/unit/test_cli_curator.py check N’s side, and the mixed-version gate does not check this rule.

  83. The curator’s scheduled pass (the worker curator, no migration): N’s worker writes a row of loom.agent_runs for each pass, under the id cur- 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 adds loom.namespaces.curator_mode, or no heartbeat has been read: a build below it cannot read the column, and lets a caller’s run.begin, run.complete and run.grade write 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 through run.get and run.list and 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: its version is 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 switch LOOM_CURATOR_ENABLED is 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.py checks N’s side, and the mixed-version gate does not check this rule.

  84. A namespace’s skills (loom.skills, migration 128_skills.sql): N-1 serves no skill.save, lists and reads no team skill, ignores the namespace_scope, state, open_draft_only, revision and history fields of skill.list and skill.get (rule 12), and a namespace erasure it runs has no step for loom.skills. So skill.save answers 503 OVERLOADED with retry_after_s: 30 until 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 save asks ops.capabilities first 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.py checks the refusal and tests/unit/test_skills_migration_constant.py the number; the mixed-version gate does not check this rule.

  85. 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_rule of knowledge.source.list, inspect and add (who reads a source’s copies), and its Add source needs a Check whose answer carries a policy it words. N-1 answers no access_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, and knowledge.source.add outside the dashboard needs no rule. No gate holds the rollout, and a rollback leaves nothing behind. frontend/src/flows/KnowledgeSourceDialog.test.tsx checks N’s side, and the mixed-version gate does not check this rule.

  86. Regression suites (loom.knowledge_suites, migration 130_knowledge_suites.sql): N-1 serves none of the knowledge.suites.* ops, and a namespace erasure it runs has no step for the table. So knowledge.suites.publish answers 503 OVERLOADED while 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.get and knowledge.suites.list are 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, migration 135_knowledge_suite_drafts.sql) are held the same way at schema version 135: the knowledge_suites.delete step of a build below it leaves the drafts, so knowledge.suites.add_draft and knowledge.suites.dismiss_drafts answer 503 OVERLOADED with retry_after_s: 30 until 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 answers knowledge.suites.get and knowledge.suites.list without 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.py and tests/unit/test_knowledge_suite_drafts.py check the gates; the mixed-version gate does not.

  87. Stewardship (loom.stewardship_events, migration 132_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 refuses stewardship.assign and stewardship.review with a 503 and a 30-second retry; stewardship.list and stewardship.get are served, and N-1 serves none of the four. A build with the table and without stewardship.review answers 404 for it and reads the review rows a newer replica wrote. A build that knows no document target (no migration: target_kind is 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 its stewardship.list leaves document items out of its rows and its counts, and it answers 422 VALIDATION_FAILED for target_kind=document on stewardship.get, stewardship.assign and stewardship.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 with review_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.py checks the gate; the mixed-version gate does not.

  88. An unknown key inside memory.apply’s target or an action block (no migration): N refuses it at validation with 422 VALIDATION_FAILED naming 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 of target, target.filter, target.search, expire, lock, label and demote. 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 in ignored_args. No gate holds the rollout, and a rollback leaves nothing behind. tests/unit/test_memory_apply.py checks N’s side, and the mixed-version gate does not check this rule.

  89. The session’s reads in run.reliance (no migration): for a run whose row names a session’s run in metadata.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 reads not_recorded there, 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.py checks N’s side, and the mixed-version gate does not check this rule.

  90. A connection record’s resource_realm (source worker only, no migration): source worker build N reads a connection record with or without resource_realm and attests the realm’s digest at enrollment; N-1 refuses a record that carries the field and answers unavailable for 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, since knowledge.source.worker_register answers name_taken for 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.py and source_worker/tests/test_enrollment_http.py check N’s side, and the mixed-version gate does not check this rule.

  91. Results of a regression suite’s cases (loom.knowledge_suite_results, migration 133_knowledge_suite_results.sql): N-1 serves neither knowledge.suites.submit_results nor knowledge.suites.results, and the knowledge_suites.delete step of a namespace erasure it runs deletes the suites and leaves the result sets. So knowledge.suites.submit_results answers 503 OVERLOADED with retry_after_s: 30 while 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.results is 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.py checks the gate; the mixed-version gate does not.

  92. Copy rules (loom.memory_copy_rules, created by the migration memory_copy_rules): N serves memory.copy_rule.set, memory.copy_rule.list, memory.copy_rule.delete and memory.copy_rule.run; N-1 answers each as an unknown operation. N-1’s erasure saga has no step for the table (rule 14), so memory.copy_rule.set stores nothing and answers 503 OVERLOADED with 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, delete and run are not gated, since none stores a rule. A run with dry_run: false writes proposed copies to loom.memory, rows every build reads and erases, under a source_trace starting with copy_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: list serves it with readable: false and run answers 422 before it reads a memory (copy rules). tests/unit/test_copy_rule_ops.py checks N’s side, and the mixed-version gate does not check this rule.

  93. A skill’s decisions and its published reads (no migration): skill.decide writes publish, reject and archive rows to loom.skills, acts the fold of N-1 already reads. N-1 serves no skill.decide, answers the decided rows to the writers of the namespace, and serves no team skill below writer. 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 no approved_by or published_at. Its reports count the calls of the loom skill commands, which name the consumer loom-cli-inspect, as use of the namespace until it is replaced. loom skill publish, reject and archive ask ops.capabilities first 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.py and tests/unit/test_skill_decide.py check N’s side; the mixed-version gate does not check this rule.

  94. The mode a close applied (metadata.retain on loom.agent_runs, no migration): N’s run.complete stores the retain mode it applied in metadata.retain, over a value a client sent, and N’s extraction worker applies a demote or expire it reads there to the rows a deferred extraction writes under the closed run. N-1 stores no mode and leaves a client’s retain key as sent; its worker reads no run. So a run closed through N-1 reads as keep to 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 sent retain as its own metadata key with the value demote or expire reads 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.py and tests/unit/test_extraction_queue.py check N’s side, and the mixed-version gate does not check this rule.

  95. The curator mode assist (no migration): N accepts assist in namespace.register and stores the word in loom.namespaces.curator_mode; a pass of N over such a namespace asks a model about its pending proposals and adds prompt_version, model, llm_calls, spend_usd, opinions and unanswered to 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 as findings: it calls no model and records findings as the mode it ran in. While both builds serve, a namespace set to assist therefore 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’s curator.status refuses sections: ["opinions"], as it refuses any section it does not know, and answers no opinions, no proposals.with_opinion and no model, llm_calls or spend_usd on last_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.py and tests/unit/test_namespace_curator_mode.py check how a build treats a mode it does not know, and the mixed-version gate does not check this rule.

  96. A sync request’s marker (knowledge_source_request:<name> rows of loom.code_index_state, no migration): build N writes a marker beside a sync request and its knowledge_source_requests worker 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 is requested_at in 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’s knowledge.source.sync_now answers without starts_after, which a client reads as empty, and its /v1/admin/workers.status rows carry no max_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_at and request_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 move request_idle_at, whose older value only ages, and N-1’s push status answers without last_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.py and tests/unit/test_source_push.py check N’s side, and the mixed-version gate does not check this rule.

  97. Team worker sources (knowledge_source_worker_team_reads_enabled, no migration): with the setting on, N registers a live worker source with the current_team_access reader policy and writes team reader links (knowledge.source.worker_link) in loom.mcp_worker_source_readers, which every build since migration 017 has. N-1 refuses a registration with team_access as unavailable, so a preview made on N answers that on an N-1 replica and the caller previews again, and it answers knowledge.source.worker_link and knowledge.source.worker_unlink as unknown operations. N-1’s knowledge.source.live serves 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’s knowledge.source.worker_unlink unlinks 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.py and tests/unit/test_mcp_worker_authority.py check N’s side, and the mixed-version gate does not check this rule.

  98. The skills section 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 in only_sections, section_token_budgets and block_order, answers listing_line from skill.get and skill.check and namespaces_not_listed from skill.list, and its session primer says to load a listed skill with skill.get. N-1 renders no such section, refuses a request that names it in only_sections with 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 in only_sections, and none may before the release that serves it is on every replica. The section reads loom.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.py and tests/unit/test_skill_listing.py check N’s side, and the mixed-version gate does not check this rule.

  99. An MCP worker copy’s synced_from keys (no migration): N’s copy turn writes source_document_id and source_link in a copy’s metadata, and N’s search reads them for a hit’s synced_from. N decides from the stored row whether a copy has them, so a copy N-1 writes or rewrites without them reads synced_from: null until 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 serves null for 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 mark pass bound reached (shown as Incomplete) meanwhile. N also records refused_at on the entry of a copy whose rewrite the store refused, or whose read for the keys the worker answered unsupported, and retry_at on 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 honours refused_at only while it is newer than copied_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; a retry_at holds until it passes, whatever N-1 does meanwhile. N-1 sets copied_at after every read of a stored copy, a refused or skipped write included, so in the mixed window N can serve a synced_at newer than the copy’s text, until N’s next write of that copy. A rollback leaves the keys, refused_at and retry_at in place, and N-1 reads none of them. No gate holds the rollout. tests/unit/test_worker_source_copies.py and tests/unit/test_knowledge_search_synced_from.py check N’s side, and the mixed-version gate does not check this rule.

  100. 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.worklist into 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 a roles claim 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.tsx checks N’s card, and the mixed-version gate does not check this rule.

  101. Knowledge reports (loom.knowledge_reports, migration 137_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, update and evidence answer 503, as knowledge gaps do under rule 48; N-1 serves no knowledge.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.py checks the refusal; the mixed-version gate does not.

  102. A required regression suite (knowledge.suites.publish, memory.proposal_decide, migration 138): N stores whether a revision requires the suite’s checks in loom.knowledge_suites.required and refuses an acceptance of a covered key whose checks are not satisfied. N-1 has no such check and accepts the key. So knowledge.suites.publish with required: true answers 503 OVERLOADED until 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 with false is not held by this gate. The column is Int8 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 ignores required in a request and names it in ignored_args, and its answers carry no required, 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 no knowledge.suites.requirement row: a key, a prefix or a case it removes from a required suite is recorded only in the counts of its knowledge.suites.publish row, and the requirement holds less once N serves. tests/unit/test_proposal_requirement.py checks 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.

  103. A review brief’s payload version (PAYLOAD_VERSION in server/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 leaves unsettled. 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 with rebuilt_for set to its version, with the replaced row’s version column 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’s version is 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.py checks 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_sha256 for a key with hash_required and 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 without code, from N-1, is shown by its reason.
  • 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.

Last updated on

Was this page helpful?