Dev.to AI 🤖 Ai 👁 0 📖 6 min read

My Memory Engine's Default Would Auto-Resolve 215 Conflicts. A 10-Pair Sample Found 1 Duplicate.

Issue #369 on yantrikdb came in on 2026-12-01 from Hugo Gundlach, who goes by Huy3ko on GitHub. It quotes one line from a dry run of the engine's maintenance pass against their 25,182-record store: open_before=280 aut

Issue #369 on yantrikdb came in on 2026-12-01 from Hugo Gundlach, who goes by Huy3ko on GitHub. It quotes one line from a dry run of the engine's maintenance pass against their 25,182-record store:

open_before=280 auto_resolved=215 routed_to_operator=65 errors=[]

yantrikdb is the persistent memory engine I build for AI agents: Rust core, Python bindings, SQLite underneath. run_maintenance_cycle() runs a handful of housekeeping passes, and one of them burns down open conflicts. MaintenanceCycleConfig::default() switches that pass on with burn_down_conflicts: true, so any host calling the cycle with defaults gets it.

Of Huy3ko's 280 open conflicts, 215 were consolidation at medium priority and 65 were preference at high. The 65 went to an operator. The 215 would each have been settled by tombstoning the older of two memories. Huy3ko didn't trust that number and went to read the memories behind it.

What the pass actually checks

Everything below is from origin/main as of today, 2026-12-03, at 49d2c97, the merge of PR #374 that shipped v0.26.0 on 2026-12-02. None of it has changed since the issue was filed. This is the doc comment I wrote on the function, in crates/yantrikdb-core/src/engine/conflict.rs:

    /// Task 26 — burn down open conflicts by auto-resolving the unambiguous
    /// ones and leaving the genuinely ambiguous / high-stakes ones for an
    /// operator. Dry-run first.
    ///
    /// Auto-resolution policy (deliberately conservative): a conflict is
    /// auto-resolved only when it is low/medium priority AND of a type where
    /// "newer value supersedes" is clearly correct (temporal / preference /
    /// minor / consolidation). The newer memory (by `created_at`) wins; the
    /// older is tombstoned via [`Self::resolve_conflict`]. Identity facts and
    /// high/critical conflicts are always routed to an operator — the engine
    /// never silently picks a winner on something load-bearing.
    pub fn auto_resolve_conflicts(&self, dry_run: bool) -> Result<ConflictBurndownReport> {

And here is the whole test for "unambiguous," a few lines further down:

            let unambiguous = matches!(c.priority.as_str(), "low" | "medium")
                && matches!(
                    c.conflict_type.as_str(),
                    "temporal" | "preference" | "minor" | "consolidation"
                );

Priority and type. Neither memory's text is ever read. The newer created_at wins, and the loser goes through resolve_conflict(), which calls forget(). That writes a Supersedes record-link and marks the record forgotten. It's a soft tombstone, so the record is still stored, but it drops out of recall and I couldn't find a restore call anywhere in the API.

Three of those four types fit the doc comment. consolidation gets created somewhere else entirely, in crates/yantrikdb-core/src/distributed/conflict.rs:

        if let Some(conflict) = create_conflict_if_absent(
            db,
            &ConflictType::Consolidation,
            &rid_a,
            &rid_b,
            None,
            None,
            &format!(
                "Concurrent consolidation: both '{}' and '{}' consumed source '{}'",
                rid_a, rid_b, shared_source
            ),
        )? {

Two summaries were built from the same source memory. That's the entire signal. Whether the two summaries say the same thing is a separate question this code never asks.

Ten pairs

Huy3ko took the ten conflict pairs one real maintenance cycle produced and computed Jaccard similarity on 4-char tokens over the actual text:

pair chars A / B Jaccard (4-char tokens) created_at delta
1 867 / 1098 0.24 0 s
2 446 / 1098 0.27 0 s
3 757 / 1211 0.17 0 s
4 8503 / 4337 0.12 -198 s
5 2436 / 4337 0.25 +1 s
6 4842 / 4337 0.41 -12 s
7 1353 / 1211 0.66 -50 s
8 671 / 671 1.00 0 s
9 5802 / 877 0.15 -25148 s
10 1376 / 1098 0.44 -0 s

Pair 8 is a duplicate. The other nine run from 0.12 to 0.66, and Huy3ko puts the median at 0.27. The issue also notes that two of the ten pairs carry identical created_at, which means the tie-break, created_at_a >= created_at_b, picks a winner on nothing at all. Huy3ko's line: "the correct number of tombstones for these ten conflicts is 1 (the duplicate), not 10."

Ten is a small sample, and I'm not going to extrapolate a duplicate rate for all 215 from it. It's enough to show the type field can't stand in for one.

A follow-up comment broke the headline number apart:

quantity measured
auto-resolvable conflicts 215
distinct records appearing in them 207
distinct records that would actually be tombstoned 145

ConflictBurndownReport surfaces only the first row. Someone reading auto_resolved: 215 has no way to see that a live run would pull 145 distinct memories out of recall.

Huy3ko raised one more thing I hadn't considered. Even pair 8 isn't automatically safe, because identical text can sit on records with different source, temporal_kind, confidence_basis, or namespace. Tombstone one twin and that provenance leaves recall with it, even though the words survive in the other record. Their suggestion: similarity can at most gate whether to act, and real near-duplicates should be linked through record_links/supersedes with both kept readable. I agree.

February, then June

consolidation and the code that emits it landed on 2026-02-23 in 0bcda35c, "Add replication, sync, and conflict resolution (V1+V2)," co-authored with Claude Opus 4.6, with 77 Rust and 60 Python tests passing. It was CRDT replication with a human resolving conflicts. In that design a consolidation conflict meant "someone might want to look at these two," which was harmless.

In June I was working an epic I'd called "Close Every Loop," after an audit turned up 36 open conflicts against 7 ever resolved. On 2026-06-10 at 17:12:45 -0500, 9ba388a4 added auto_resolve_conflicts(), co-authored with Claude Fable 5, with the commit message "Full lib suite green (1582)." About fifteen minutes later e22db730 made true the default. I put consolidation into the newer-wins list beside temporal and preference and never went back to check what it had meant in February. The 1582 tests confirmed the burn-down ran. Not one of them asked whether two records sharing a source were redundant.

Nineteen minutes

The #369 thread also has a mistake of mine in it.

At 12:31 UTC on 2026-12-01 I posted a correction about the Hermes plugin. It does not pass burn_down_conflicts: false. Its _run_maintenance in yantrikdb/__init__.py never calls run_maintenance_cycle() at all; it calls think() directly, and the conflict scan in cognition.rs only flags conflicts. The burn-down is unreachable from the plugin, a thinner kind of safety than having it switched off.

At 12:47 Huy3ko accepted that and added that their own fork is different: it wires _run_maintenance to the native cycle when the client exposes it, and sets burn_down_conflicts=False deliberately. On their deployment that flag is load-bearing. They also warned that a regression test pinning "the plugin never burns down" would keep passing until the day the plugin adopts the native cycle and someone forgets the flag.

At 12:50, nineteen minutes after my correction and three after Huy3ko confirmed it, I posted again: "Also noted: the Hermes plugin passes burn_down_conflicts: false, which is the only reason this hasn't surfaced through that integration path yet."

That's the claim I had corrected myself, restated as fact, two comments further down the same thread. I didn't catch it until I reread the thread to write this. The other thing I wrote there, "This is a real default-destructive-behavior bug, not a hypothetical," I still stand behind.

Which fix

The issue proposes three directions, in Huy3ko's words:

  1. "Stop emitting consolidation conflicts as content conflicts." A source consumed twice is a writer-side invariant violation, and it belongs in report.errors or a dedicated counter, out of the table an operator uses for contradictions.
  2. "If they stay in the table, exclude the type from auto-resolution" until (1) is fixed.
  3. "If any content-based auto-resolution is wanted, the criterion has to be a property of the two texts (near-duplicate), not of the source set."

My view is that the original error was February's, not June's. Two consolidations eating the same source is the consolidator reporting its own bug, and I filed it as a disagreement between memories. June only trusted the label. So (1) is the real fix, and (2) is the stopgap I'd ship first.

I'd leave (3) unbuilt. Given the provenance problem, I don't want the engine resolving anything on content by itself, near-duplicates included. Link them, keep both recallable, and let an operator decide if it matters. People running stores this size who want deduplication without babysitting it will reasonably disagree, and I'd rather hear that argument on #369 than build (3) to head it off.

The stopgap is deleting | "consolidation" from the matches! above.

Pranab Sarkar, Independent Researcher

📰 Read the original article on Dev.to AI

Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.