Repository navigation
Memory conflicts are judged in the background, every automatic retirement can be listed and undone, and graph facts follow the rows that state them - #26
Merged
Conversation
zlareb1
force-pushed
the
fix/same-key-cross-session-revision
branch
from
October 13, 2026 15:14
fa91cab to
7f82a64
Compare
This was referenced Oct 13, 2026
zlareb1
force-pushed
the
fix/same-key-cross-session-revision
branch
from
October 15, 2026 07:55
b50e29c to
c199b56
Compare
8 tasks done
…le rule The budget module says a background spender reads a failed read as over; _cap_share says the resolver also stops at the whole cap; and the docs say the 30-day owed age is the vector row's, the write time of the revision owed. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
… handler now passes Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…sserted-versions statement Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…fails with 503 when it cannot Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…ed by the restore version in its record Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…conflict resolver Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…he two heads together Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…t keeps the earlier ones Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…ed restore after its record answers 503 Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…d that a pin prevents it Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…_versions Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…t Undo record stops holding Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…ement, not a new statement Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
… answers restored Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…, by the audit log's ts key Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]> # Conflicts: # docs/reference/operations.md # sdk/typescript/src/generated/ops.ts
…e repair scan skips failures a retry would leave pending, and graph reads see pending closes - cluster_peers keeps another session of the anonymous user only when one side flags the other, so such rows take no place from a same-session peer - the projection repair scan leaves out orgs under erasure and follow intents within their grace, so they cannot hold every pass - reads after a triple close apply pending mutations on the fly - a relation verb keeps letters of every script - the supersede re-reads the winner, as the comment now says Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
- PR 26's migrations follow main's last: 046-052 become 062-068. - The resolver's settings live in server/settings/catalog.py (main's one catalog): call-time knobs are LIVE, and the worker's pass budget, burst, attempts, pause and recheck pacing, and the bulk follow cap are settings instead of module constants. - The resolver's model calls name the row's org, an org whose model calls are switched off takes no place in the queue, and a held call leaves its row owed with no attempt or error (main's org attribution and switch for the per-write judge and conflict sweep this PR removes). - The projection repair names each failure's org and skips switched-off orgs. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…cope The Auto-resolved tab read memory.auto_supersede records through audit.list, which scopes by namespace only, so a token narrowed to one user or session saw every user's retired keys and ids. The new viewer op flattens the records server-side, keeps each entry only when row_in_read_scope holds, and pages by retired memories with a keyset cursor that never splits a record. The dashboard reads it instead of audit.list. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
_resolve_one passed the 50-statement gate once it handled a held model call. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
- PR 26's migrations follow main's 062_extraction_policies: 062-068 become 063-069. - set_from_messages' bulk write records its result in its own function, keeping _step_bulk_write under the 200-line gate with main's extraction policy step. - The resolver's high-shape check and the security page name every high shape main's detector reads (cards, SSNs, stated PINs), not credentials only. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…and round-147 fixes - The cluster's nearest read takes only the anonymous user's own session and skips the other-session same-key branch for it, so forty such rows no longer fill its places; the duplicate filter in _judge_and_act and the row_id parameter go. - The race test compares superseded_by to "" (the column is not Nullable). - memory_conflict_resolver_burst_seconds is checked to be at most half the pass deadline, and is no longer LIVE so the check holds. - The projection repair scan reads erasing orgs as a subquery. - A wide character (CJK) counts twice toward the 2-character minimum of a fact's subject, relation and object: one is a whole word. - The sidebar's call budget names memory.auto_retirements. - The bulk 'high' drop test asserts each row was rewritten and owes a drop before it checks the links, so a failure tells the two apart. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
Main's sensitivity sweep made sort_key a required field of SweepCandidate. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…ents test - A fact's subject, relation and object need two characters again, as the triple writer requires: a wide character counted twice let one-character CJK copulas through, and the triple writer then dropped what it accepted. - The env contract test leaves the cross-checked burst and pass deadline alone. - The burst validator test writes its accepted case directly. - The repair scan reads with sequential consistency, so an erasure queued a moment ago is seen. - The sidebar asks memory.auto_retirements for the 50 newest records in its one call; the docstring says what a narrowed token can miss. - An HTTP test: under newest_wins, V's retired key is listed to V's narrowed token and never to U's. - The gaps ledger drops a setting a test now names. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…nd-149 nits - canCall knows memory.auto_retirements; the sidebar's probe asks it, and the Review queue's Auto-resolved tab needs it and audit.list (its Undo records). - The sidebar comment points at hasAutoResolved instead of a stale record count. - The env contract test leaves out only the burst, so the pass deadline's variable is still checked to reach its field. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…eue's tab needs Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
- PR 26's migrations follow main's 063_memory_webhooks: 063-069 become 064-070. - A restore of a tombstoned row announces memory.restored right after its insert, and the sensitivity sweep announces its relabels and still closes a relabelled row's mined facts. - The task dedup test stubs webhook delivery at server.core.webhooks.post. - Round 151: ERASING_ORGS_SQL's comment names its second reader and it is exported; _nearest_sql says a one-sided flag from another anonymous session waits for a person. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…vent list, and same-key tests drain their side effects - docs/features/memory/writing.md names what the conflict resolver lands after the write (retirements, its conflicted flags) among the changes that send no webhook event, as write-time supersessions are, and points a mirroring receiver at memory.auto_retirements; the bullet that named the removed deferred judge is gone. - The webhook rule in rolling-upgrades.md is rule 22, not a second rule 14, and the memory architecture page links it. - The same_key `ch` fixture drains after-write tasks, intent marks and graph write marks before it disconnects, so one test's side effects no longer land in the next test. - A plain restore whose key lock is busy says "retry the restore", not "retry the Undo". Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…er, and the auto_retirements pointer covers every supersession A hook installed with monkeypatch.context() put the real end_edges back through the outer monkeypatch, so the outer teardown reinstalled the hook and later tests ran it inside their drops. The hook now restores through the context patcher. The teardown drain added for the same symptom is removed: it was not the cause. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
Signed-off-by: zlareb1 <[email protected]> # Conflicts: # tests/analyzer/shapes.txt
Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…in during the drop gets its links back A same-value plain re-set landing between the drop's last read and its DELETE loses its links to the DELETE, and only the restore brings them back. A failed restore was recorded as the drop, whose replay skips a row no longer 'high', so the links stayed gone and the row's next drop found nothing to end its undeclared edges by. The restore now records its own projection, entity_edges_restore, with the links and closes it owes; the repair replays it against the rows as they are then. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
Main's 064_learnings_agent_and_supporters takes 064: this branch's migrations move to 065-071, and main's rolling-upgrade rule 15 becomes 23 after this branch's 10-22. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…inks and drops them again The restore's replay skipped a row made 'high' again before the repair ran, but that row's own drop had found none of the links the DELETE took and ended none of their edges. The replay now writes those links back for a row still holding the same value and runs its drop again. The restore failure names its op, its payload holds each link once with whether the DELETE took it, and the warning counts the links owed back. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
This was referenced Oct 21, 2026
5 of 9 tasks
1 task done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changelog category (leave one):
Changelog entry (one or two sentences a user of Loom can read without the diff; the release pull request collects these into the release notes):
Memory conflicts are judged by a background worker instead of an LLM call on each write. Under
auto_reinforce(the default) andnewest_winsit retires the older row of an update it is sure of; otherwise it flags a real conflict or clears a false one, and the Review queue's Auto-resolved tab lists every automatic retirement with an Undo. Removed: theLOOM_MEMORY_CONFLICT_JUDGE*settings, thememory.setfieldawait_verdict(the Python SDK keyword now raisesTypeError), the response fieldverdict_at, thependingverdict and theconflict_sweepworker.Why
The conflict check decides whether a write adds a memory or revises one. The per-write judge was slow and often wrong:
gpt-6.1-sol) takes 5.6 s p50 and 10.3 s p95, on every write that has a peer.conflictedon its word alone; 48 of them (21%) were real.Two more problems showed up in the same paths:
user_ethnicity. Retiring every same-key row is not a fix: of 60 sampled cross-session same-key pairs, 1 was an update.newest_wins, templated substitutions, value updates), with no record anyone could see or undo.Judging after the write removes the latency limit, so the judge can use the stronger model and see all peers at once. It also removes the code the deferred judge needed: the
pendingverdict, theconflict_sweepworker andawait_verdict.What changes
Marking. A write no longer calls an LLM for conflicts (bulk
contextualizeand message extraction still do). It marks its row owed (memory_embeddings.conflict_checked_at) when a live peer of the samememory_typeand subject is at cosine 0.60 or more, when the row is flaggedconflicted, when an earlier row of the same bulk batch is that close, or, outsidenewest_wins, when another session of the subject holds the key. A subject is (org, namespace,user_id), plus the agent for the anonymous user (-or an emptyuser_id, which are treated as the same user).append_onlymarks nothing.The worker (
server/memory/workers/conflict_resolver.py, leader only). Each pass takes up to 40 owed rows, newest first, round-robin across (org, namespace), plus 8 oldconflictedrows, and judges 8 at a time. A full batch without errors is followed by the next one for up to 300 s; otherwise it waits 10 s. Each call sends the row and up to 8 peers (its flagged peers, up to 4 same-key rows from other sessions, then the nearest) togpt-6.1-solat reasoning effortlow, and gets back one strict-JSON verdict per peer. The resolver spends at most 25% of the namespace's daily LLM cap, counted over its own calls, and stops when requests have used the whole cap. A row owed for more than 30 days is dropped.What a verdict does (
server/memory/domain/conflict_resolution.py,action_for):update/contradictionabout a different entity or attributeupdate/contradictionacross sessions of the anonymous userupdate/contradictionupdateunderauto_reinforceornewest_winsupdate(0.95–0.98, ormanual_review),contradictionelaboration,restatement,related,unrelatedThe settings reject thresholds unless clear ≤ flag ≤ retire. Two rows whose writers dated the fact (
valid_at) on the same day are flagged, never retired, since they have no order.Locking. Before acting, both rows are re-read under their key write locks (taken in lock-name order). The resolver acts only if both are still live, unexpired, unpinned, not
highand hold the hash it judged, and it decides which row is older from those re-read rows. Its writes land at the read version + 1, so a user write that started after the read stays newest. Orgs with an erasure queued, running or due a retry are skipped, and erasure state is read again before each write.memory.pinandunpinnow take the key lock (409 while it is held, 503 when Keeper is down).Failures. A row is stamped judged only after its actions, and repeating an action changes nothing. A 429, 5xx or timeout leaves the row owed without counting an attempt, and three in a row end the pass. A malformed answer is retried once; after 3 unusable answers the row is stamped
errored. A 4xx refusal is stamped, unless it repeats on three rows of a namespace in a row, which pauses that namespace for 5 minutes. A pass that cannot run at all (no key, refused model, outage, locks down) pauses the worker for 5 minutes.Records, Auto-resolved and Undo (
server/memory/app/auto_resolution.py,frontend/src/views/admin/ReviewQueue.tsx).memory.auto_supersedeaudit record (ids and keys, no values) with reasonconflict_resolver,same_key_newest_wins,newest_wins_contradictionorvalue_update. Resolver records also carry the verdict, confidence, model and prompt version (v3).triples_follow_owedintent before the retirement commits, so a crash leaves them to the projection repair.memory.auto_retirements, filtered to the caller's read scope, and shows each row's current status through the new opmemory.statuses.memory.restorewith the newif_superseded_by, so it restores only a row still retired behind that memory. Under the key lock it first writes amemory.unsupersederecord; if that write fails it answers 503 and restores nothing. The resolver then leaves the pair alone until one of the rows is written again. Retrying an Undo whose answer was lost finishes it without writing anything twice.Graph facts follow rows (
server/memory/app/{set_entities,graph_holders,edge_links,edge_repair,triple_projections,triple_follow,graph_undo}.py). A row holds graph facts only while it is live, unexpired, inside itsvalid_toand nothigh. Retirements, revisions that drop a fact and Undos close or reopen the triples and edges that depend on it. The new tablesentity_triple_rowsandentity_edge_rowsrecord which row and content hash stated each fact. A single-valued relation keeps one current value, ordered the same way by racing writers and replays. Point writes acceptrelations(up to 8). A delete closes no facts.High rows. A
highrow is never a peer, so its value is never sent to the LLM (labels are checked again before the prompt). It keeps only the edges of the entities its writer declared. When a row becomeshigh, or is re-set naming fewer entities, its other links are deleted and their edges end unless another live row holds them. A write that lands during that drop keeps its links: the drop reads the rows again after its DELETE and writes back what they still hold. If that restore fails, it is recorded asentity_edges_restoreand replayed by the projection repair; a row madehighagain in the meantime gets its links back and is dropped again.memory.get_by_idtakesomit_high_value, which the Review queue uses for peers.Other fixes in the same paths:
task.createwith an idempotency key holds a Keeper lease from lookup to insert, so concurrent creates store one task. A retry finishes a create that was cut off after its row was written.memory.set(422, 409, 423). Bulk results carrymemory_id,pinned_blocker_id, refusal verdicts andskipped_blacklisted, andset_from_messagesreturnsrefused.newest_winsagain;preserves_quantities, which kept both rows, is removed.loom erasure-re-verify --completed-sincere-checks erasures that an older build completed during a rollout.Results
Long-session benchmark (
bench/conflict_resolver_long_session.py --variant both): one user, 12 sessions, six attributes that change over time. 5 runs per arm, each on its own ClickHouse; a run fails if the resolver does not drain. Rubric v3, thresholds 0.90 / 0.95 / 0.98, owed floor 0.60. Mean [min–max]:newest_winsauto_reinforcenewest_winsauto_reinforceNo run retired the wrong row. The updates missed in the set variant are pairs below the 0.60 floor (cosine 0.39–0.59). With a 0.70 floor the same runs caught 0.11 / 0.18 (set) and 0.69 / 0.73 (messages) with 40% fewer calls; two real updates sit at cosine 0.696.
LongMemEval-S, 30 questions, seeds 42 and 7,
memory.askand a reader arm (gpt-5, k=200), asked again after a full drain:Re-run from the same start with the resolver off on both builds, the reader scored 56/60 here and 53/60 on main, and all five questions that flipped had the same answer in context on both. Every knowledge-update miss in the drained run was in a namespace the resolver never acted on, so the reader gap is extraction and dedup variance. A drained run on the final rubric (v3, retire 0.98, seed 42) scored
ask29/30 (main 28–29) and reader 27/30 (main 26–28). Ingest and search latency match main within noise.Precision on agent notes, held-out half (384 rows, 2,927 pairs), hand-labelled. Most retirements there replace a running tally; the second column leaves those out:
Assistant chat. The v2 drained LongMemEval run retired 63 rows, 49 of them correctly. The 13 wrong ones were additions (a substitution retiring the base recipe), items of one kind (two rides), successive events (chess moves) and two same-day pairs in reverse order; they led to the v3 rubric, the 0.98 threshold and the same-day rule. The v3 drained run judged 17,078 rows and retired 1, wrongly: extraction had put event dates in
valid_at.Thresholds:
Cost. A judged row costs $0.005–0.006 on chat and $0.008–0.009 on longer agent notes. About 80% of chat writes get marked, so 1,000 chat writes cost $3.94–4.92. One leader judges 54–60 rows a minute. Under the default $1 daily cap the resolver gets $0.25, about 40–50 rows a day per namespace, newest first:
The share exists because an earlier run let the resolver use the whole cap, and
memory.askdropped from 58/60 to 4/60.The default and how to opt out
The old per-write judge was off by default. The resolver is on unless
LOOM_LLM_PROVIDERor the resolver model's provider isfake, and it retires at 0.98 underauto_reinforce(the default) andnewest_wins. In agent use nobody works the Review queue, so a flagged update leaves search serving the stale value; a retirement is recorded, can be undone, and the old row stays readable withinclude_supersededandas_of.To keep a person in the loop, register the namespace with
default_conflict_policy: manual_review, so updates are only flagged. To turn judging off, setLOOM_MEMORY_CONFLICT_RESOLVER_ENABLED=false; writes are then not marked.Scope and risk
This touches every memory write path (
memory.set,bulk_set,update,update_by_id,restore,pin,unpin), adds a leader-only worker that writes memory rows, and changes the triple and edge projections, audit records, the Review queue, erasure andtask.create. The identity tuple, audit hashing and read responses are unchanged apart from the added fields.What covers the main risks:
Known limitations:
-are never acted on.loom.audit_log. IfLOOM_RETENTION_AUDIT_LOG_DAYSis shorter than a pair's life, the record ages out and the pair can be retired again.highcan leave one link.memory.historydoes.memory_key), hiding a second live same-key row from another session; the duplicate gate can mark a later knowledge update as a duplicate; the credential check misses a password inside a JSON value; an entity name over 128 KiB fails the request; 25 erasure mutations use subqueries, which replicated tables refuse; and the bulk path's in-batch replay of a repeated key needs restructuring.Compatibility, rollout and rollback
memory.setfieldawait_verdict(accepted and listed inignored_args), the response fieldverdict_at, and thependingvalue ofconflict_verdict. Break: the Python SDK'smemory.set(await_verdict=...)keyword is gone and raisesTypeError.memory.statuses(status andsuperseded_byfor up to 5,000 ids) andmemory.auto_retirements(the automatic retirements in the caller's read scope), both experimental, viewer and read-only;memory.restoretakesif_superseded_byandonly_if_superseded;memory.get_by_idtakesomit_high_value;memory.set,updateandupdate_by_idtakerelations;MemoryGetOutputcarriesuser_idandsession_id; bulk results gain the fields above andset_from_messagesreturnsrefused;memory.auto_supersedeandmemory.conflict_resolver;triples_follow_owed,triples_reopen,triples_reconcile,entity_edges_close,entity_edges_drop_undeclaredandentity_edges_restore, and anabandonedstatus.possèdeis stored aspossèd;владеетand所有are accepted). Break: a relation an older build stored with those letters dropped (poss_d) no longer matches the same verb written now, so revising that fact leaves the old triple open next to the new one until it is restated.auto_reinforcenow retires rows without a person. Retirements write no key-levelmemory.linkedge (refinesorsupersedes), somemory.backlinksno longer shows them; usesuperseded_byand the audit record.memory.auto_retirements.LOOM_MEMORY_CONFLICT_JUDGE,_MAX_PEERSand_MIN_SIMILARITY. One still set is logged as an unknown key at boot.server/settings/catalog.py(LOOM_MEMORY_CONFLICT_RESOLVER_*unless named):ENABLED,MIN_SIMILARITY0.60,MAX_PEERS8,RETIRE_CONFIDENCE0.98,FLAG_CONFIDENCE0.95,CLEAR_CONFIDENCE0.90,BATCH40,RECHECK_BATCH8,CAP_SHARE0.25,MAX_OWED_AGE_DAYS30,CONCURRENCY8,INTERVAL_SECONDS10,MAX_PASS_SECONDS600,BURST_SECONDS300 (at most half ofMAX_PASS_SECONDS),MAX_ATTEMPTS3,PAUSE_AFTER_STOP_SECONDS300,RECHECK_IDLE_SECONDS300,LOOM_MEMORY_BULK_FOLLOW_MAX_PAIRS1024 andLOOM_CONFLICT_RESOLVER_MODELgpt-6.1-sol.MAX_PEERS,BATCH,RECHECK_BATCH,CAP_SHARE,MAX_OWED_AGE_DAYS,MAX_ATTEMPTS,PAUSE_AFTER_STOP_SECONDS,RECHECK_IDLE_SECONDSand the bulk follow cap can be overridden live.065_entity_triple_rows,066_projection_failure_abandoned,067_entity_triple_seen_at,068_graph_restore_id,069_entity_edge_rows,070_entity_edge_close_id,071_projection_failure_ttl(resolved failures are deleted after 30 days).docs/architecture/rolling-upgrades.md, rules 10–17): task-dedup leases hold only among new replicas; the old build ignores the new request fields, writes no row links and misses the link tables in erasure; its per-write judge, if on, can overwrite the new build's mark, and its pin takes no lock; it leaves the new projection-failure kinds to the new build's repair. While an old replica leads the workers, marked rows wait.LOOM_MEMORY_CONFLICT_JUDGE*from the environment.gpt-6.1-sol, or the inference gateway's route for it where calls must go through the gateway (LOOM_INFERENCE_GATEWAY_REQUIRED, orLOOM_INFERENCE_TOKEN_URLset). Each call names the row's org inLOOM_INFERENCE_CUSTOMER_HEADERand the featureconflict_resolver. Until the model answers, marked rows wait, as do rows of an org whose model calls are switched off.LOOM_DEFAULT_DAILY_COST_CAP_USDbounds very little; lowerLOOM_MEMORY_CONFLICT_RESOLVER_CAP_SHAREor set per-namespace caps.loom erasure-re-verify --completed-since <rollout start> --resume.conflictedneed no manualallow; the resolver re-checks 8 per pass. To keep that drain from retiring anything, usemanual_reviewuntil it is done.memory.restorebrings one back.Reading guide
306 files. Read in this order; each part builds on the previous one:
server/memory/app/{bulk_rows,bulk_set,bulk_verdicts,pipeline,pipeline_state,ops,write}.py,server/memory/api/models_bulk.py,server/memory/store/{conflict_candidates,lifecycle,embeddings}.py,sdk/python/loom/memory.py,server/tasks/,server/insights/{app,store}/audit.py; rolling-upgrades rule 10.server/memory/domain/{triples_follow_rows,graph_quality,temporal_sql}.py;server/memory/app/{set_entities,graph_holders,edge_links,edge_repair,triple_projections,triple_follow,graph_undo,projections,projection_failures}.py;server/memory/workers/projection_repair.py;server/erasure/;docs/features/entity-graph.md; rules 11–14, 16 and 17.server/memory/domain/conflict_resolution.py, thenserver/memory/store/conflict_resolver.py,server/memory/app/conflict_resolver.pyand the worker;server/memory/app/{auto_resolution,intent_marks,key_supersession,restore,conflicts,set_commit,update,value_updates}.py; the deletedconflict_judge.py,conflict_deferred.py,store/conflict_marks.pyandworkers/conflict_sweep.py;server/settings/catalog.py;frontend/src/views/admin/ReviewQueue.tsx;bench/conflict_resolver_*;docs/features/memory/conflicts-and-refusal.md; rule 15.Tests
test_conflict_resolver_ch.py(118),test_conflict_resolver_invariants_ch.py(6 seeds),test_conflict_resolver_long_session_ch.py,tests/integration/same_key/(290, run in random order),test_task_create_dedup_live_ch.py,test_cross_principal_leakage.py,test_read_scope_isolation.py, the erasure files and the search analyzer corpus.test_conflict_resolver.py,test_auto_resolution.py,test_restore_unsupersede.py,test_intent_marks.py,test_triples_follow_rows.py,test_triple_row_links.py,test_projection_failures.py. Frontend:ReviewQueue.test.tsx,api.autoResolved.test.ts.AI assistance in the code (leave one; writing this description with AI is fine):
AI-generated (an agent wrote most of the diff): Claude Code. Each fix started from a reproduced failure and a test that failed first against real ClickHouse. A separate reviewer agent reviewed every push. The last completed review found one P2 (a failed link restore on a row made
highagain before the repair ran) and five P3s, all fixed in this PR. The owner made the design calls: dropping the per-write judge, the thresholds, retiring by default underauto_reinforce, row-level fact links, task dedup, and keeping this as one PR.I can explain every line of this diff and how it interacts with the rest of Loom.
Checklist
make format-check,make lint,make typecheckandmake test-unitpass; the integration suite passes if server behaviour changed.docs/reference/configuration.mdand thedocs/reference/tables (python scripts/codegen/docs_reference.py), the reach manifest,schemas/schema.sql(make schema-dump) and the Codex plugin copies (python3 scripts/codegen/agent_plugin_sync.py).main; no merged migration is edited.hooks/,lib/,bin/,skills/,.mcp.json, the Codexplugin-defaults.json) bumps both plugin manifests' version, and no other open PR uses that version.npm --prefix frontend run build) and its tests pass, iffrontend/changed.docs/describe the system as it now is, and this description names any operator steps and wire changes.tests/unit/test_public_copy.py).git commit -s), as CONTRIBUTING.md asks. A few early commits lack it; the squash commit carries it.🤖 Generated with Claude Code