mnemo-engine 0.20.2__tar.gz → 0.21.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) hide show
  1. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/PKG-INFO +4 -3
  2. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/README.md +2 -1
  3. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/mnemo/Cargo.lock +3 -3
  4. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/mnemo/Cargo.toml +3 -2
  5. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/mnemo/README.md +78 -6
  6. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/mnemo/guide/guide.md +88 -2
  7. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/mnemo/src/bin/mnemo/export.rs +2 -1
  8. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/mnemo/src/bin/mnemo/inspect.html +5 -2
  9. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/mnemo/src/bin/mnemo/inspect.rs +12 -0
  10. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/mnemo/src/bin/mnemo.rs +662 -39
  11. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/mnemo/src/guide.rs +1 -1
  12. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/mnemo/src/lib.rs +20 -1
  13. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/mnemo/src/mcp/context.rs +7 -2
  14. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/mnemo/src/mcp.rs +39 -6
  15. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/mnemo/src/memory.rs +119 -5
  16. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/mnemo/src/pager.rs +6 -0
  17. mnemo_engine-0.21.1/mnemo/src/store/backup.rs +347 -0
  18. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/mnemo/src/store/coordination.rs +252 -70
  19. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/mnemo/src/store/crud.rs +117 -3
  20. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/mnemo/src/store/flush.rs +13 -1
  21. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/mnemo/src/store/hooks.rs +104 -0
  22. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/mnemo/src/store/keyed.rs +147 -9
  23. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/mnemo/src/store/maintenance.rs +8 -1
  24. mnemo_engine-0.21.1/mnemo/src/store/merge.rs +2403 -0
  25. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/mnemo/src/store/mod.rs +251 -0
  26. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/mnemo/src/store/open.rs +34 -7
  27. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/mnemo/src/store/recall.rs +4 -1
  28. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/mnemo/src/store/records.rs +235 -4
  29. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/mnemo/src/store/threads.rs +7 -4
  30. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/mnemo-python/Cargo.lock +2 -2
  31. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/mnemo-python/Cargo.toml +2 -2
  32. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/mnemo-python/README.md +2 -1
  33. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/mnemo-python/src/lib.rs +121 -2
  34. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/mnemo-python/test_mnemo.py +68 -11
  35. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/pyproject.toml +1 -1
  36. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/mnemo/.gitignore +0 -0
  37. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/mnemo/benches/corpus.rs +0 -0
  38. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/mnemo/build.rs +0 -0
  39. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/mnemo/deny.toml +0 -0
  40. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/mnemo/examples/ann_defaults_v0_6_0.rs +0 -0
  41. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/mnemo/examples/ann_diagnose.rs +0 -0
  42. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/mnemo/examples/ann_recall_grid.rs +0 -0
  43. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/mnemo/examples/ann_recall_grid_v2.rs +0 -0
  44. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/mnemo/examples/candle_hard.rs +0 -0
  45. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/mnemo/examples/embedder_server.py +0 -0
  46. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/mnemo/examples/file_size_breakdown.rs +0 -0
  47. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/mnemo/examples/inspect_demo_brain.rs +0 -0
  48. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/mnemo/examples/open_rss.rs +0 -0
  49. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/mnemo/examples/perf2_split.rs +0 -0
  50. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/mnemo/examples/quickstart.rs +0 -0
  51. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/mnemo/examples/ranking_v2.rs +0 -0
  52. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/mnemo/examples/session.rs +0 -0
  53. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/mnemo/examples/shared_bench.rs +0 -0
  54. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/mnemo/examples/thread_profile.rs +0 -0
  55. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/mnemo/src/bin/mnemo/hook.rs +0 -0
  56. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/mnemo/src/bin/mnemo/mcp_install.rs +0 -0
  57. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/mnemo/src/bin/mnemo/onboard.rs +0 -0
  58. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/mnemo/src/bin/mnemo/project.rs +0 -0
  59. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/mnemo/src/bin/mnemo/wait.rs +0 -0
  60. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/mnemo/src/builtin.rs +0 -0
  61. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/mnemo/src/cache.rs +0 -0
  62. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/mnemo/src/crypto.rs +0 -0
  63. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/mnemo/src/embed.rs +0 -0
  64. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/mnemo/src/embed_cmd.rs +0 -0
  65. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/mnemo/src/error.rs +0 -0
  66. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/mnemo/src/format.rs +0 -0
  67. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/mnemo/src/freelist.rs +0 -0
  68. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/mnemo/src/ident.rs +0 -0
  69. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/mnemo/src/index.rs +0 -0
  70. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/mnemo/src/keys/display.rs +0 -0
  71. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/mnemo/src/keys/mod.rs +0 -0
  72. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/mnemo/src/keys/os_store.rs +0 -0
  73. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/mnemo/src/keys/recovery.rs +0 -0
  74. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/mnemo/src/keyslot.rs +0 -0
  75. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/mnemo/src/redact.rs +0 -0
  76. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/mnemo/src/result_cache.rs +0 -0
  77. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/mnemo/src/session.rs +0 -0
  78. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/mnemo/src/shared/call.rs +0 -0
  79. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/mnemo/src/shared/fscheck.rs +0 -0
  80. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/mnemo/src/shared/lock.rs +0 -0
  81. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/mnemo/src/shared/mod.rs +0 -0
  82. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/mnemo/src/shared/presence.rs +0 -0
  83. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/mnemo/src/shared/sidecar.rs +0 -0
  84. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/mnemo/src/store/ann.rs +0 -0
  85. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/mnemo/src/store/cache_api.rs +0 -0
  86. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/mnemo/src/store/catchup.rs +0 -0
  87. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/mnemo/src/store/continuation.rs +0 -0
  88. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/mnemo/src/store/essence.rs +0 -0
  89. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/mnemo/src/store/findings.rs +0 -0
  90. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/mnemo/src/store/header_graft_tests.rs +0 -0
  91. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/mnemo/src/store/load.rs +0 -0
  92. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/mnemo/src/store/shared.rs +0 -0
  93. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/mnemo/src/store/snapshots.rs +0 -0
  94. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/mnemo/src/text.rs +0 -0
  95. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/mnemo/src/transcript.rs +0 -0
  96. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/mnemo/src/veccol.rs +0 -0
  97. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/mnemo/src/wal.rs +0 -0
  98. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/mnemo-python/.gitignore +0 -0
  99. {mnemo_engine-0.20.2 → mnemo_engine-0.21.1}/python/mnemo_engine/__init__.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mnemo-engine
3
- Version: 0.20.2
3
+ Version: 0.21.1
4
4
  Classifier: Development Status :: 4 - Beta
5
5
  Classifier: Intended Audience :: Developers
6
6
  Classifier: License :: OSI Approved :: Apache Software License
@@ -17,7 +17,7 @@ Classifier: Topic :: Security :: Cryptography
17
17
  Classifier: Topic :: Software Development :: Libraries
18
18
  Summary: Shared memory for your coding agents, in one encrypted file: Python bindings for the embedded MNemo engine, with recall
19
19
  Keywords: mcp,agent-memory,encryption,vector-search,embedded-database
20
- Home-Page: https://toarchkumar.github.io/mnemo/
20
+ Home-Page: https://emnemo.com/
21
21
  License: Apache-2.0
22
22
  Requires-Python: >=3.8
23
23
  Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
@@ -233,7 +233,7 @@ db.notices() # what the handle warns about (also raised as UserWarning at open)
233
233
  | `search(query, top_k=10)` | Exact nearest-neighbour search |
234
234
  | `get(id)` / `delete(id)` | Fetch / soft-delete by id |
235
235
  | `about(*, visibility=None)` | Self-describing onboarding briefing — memories tagged `metadata.area="onboarding"`, manifest first. v0.17: private entries only when `visibility` asks (`["private"]`, `["all"]`) |
236
- | `stale(*, visibility=None)`, `kind_counts()` | v0.17: the stale records (`id`, `what`, `since`, `text`, `whose`, `visibility`), oldest first, private ones only when `visibility` asks; the live records by kind (`facts`, `turns`, `essence`, `coordination`) |
236
+ | `stale(*, visibility=None)`, `kind_counts()` | v0.17: the stale records (`id`, `what`, `since`, `text`, `whose`, `visibility`), oldest first, private ones only when `visibility` asks; the live records by kind (`facts`, `turns`, `essence`, `coordination`, and since v0.21.0 `tombstones`) |
237
237
  | `recent(n=20)` | The `n` most recently written live memories, newest first: facts only (no thread turns, essence items or onboarding records), nothing superseded or expired; not counted as an access (v0.16) |
238
238
  | `about_essence()` | The project essence render for the briefing (markdown), or `None` when the file has none |
239
239
  | `insert_default_manifest()` | Insert the canonical scaffold manifest (same one `mnemo init` adds); returns its id |
@@ -290,6 +290,7 @@ Plus two module-level functions:
290
290
  |---|---|
291
291
  | `mnemo.compact_file(path, passphrase)` | Rewrite the file out-of-place, dropping tombstoned and expired memories and reclaiming stale pages. Caller's own plain handle must be closed first; since v0.14 it waits up to 10 s for shared handles' calls. Returns `{"before": int, "after": int}` |
292
292
  | `mnemo.compact_file_with_key(path, key)` | The same for a raw-key file (`key`: 32 bytes, as from `generate_key()`), under the same key; converts a v8 file to v9 (since v0.13.1) |
293
+ | `mnemo.merge_files(a, b, out, *, passphrase=None, key=None, b_passphrase=None, b_key=None)` | v0.21.0: merge two diverged copies of one brain into a new file at `out`, leaving both as they were (the rules are the engine's `Mnemo::merge_files`). `a` opens with `passphrase` or `key`, and so does the output; `b` with `b_passphrase` or `b_key`, else with `a`'s. Returns the report: `merged`, `both`, `a_only` and `b_only` (ids), `conflicts` by kind, `conflict_ids`, `removed`, `dropped`, `kept_keys`, `renamed`, `after_cycles`, `lead_ms`, `hlc_since`, `older_deletes` (older deletes kept as tombstones), `settled` (conflict copies settled since), `conflict_labels` (a flagged record's key, task slug or finding id, by id), `local` (each input's claims and presence, which the output takes from `a`). A refused merge (not one brain, different embedders, a copy older than format 9, an output that exists) raises `InvalidArgumentError` with the reason. Merge copies, not a brain in use |
293
294
  | `mnemo.CancelToken()` | Shared mode: `token.cancel()` from another thread cancels a call that is waiting for the file's lock (`CancelledError`; nothing changes). Pass it as `open(..., cancel=token)`. A cancelled token stays cancelled |
294
295
  | `mnemo.install_builtin_embedder()` | **v0.15:** fetch the built-in embedder's model (91.0 MB) into the cache directory, checking each file's SHA-256, and return the directory; nothing is fetched when it's there. The size and the place are said on stderr first. `MNEMO_CACHE_DIR` moves the cache, `MNEMO_MODEL_URL` points at a mirror |
295
296
  | `mnemo.builtin_embedder_info()` | **v0.15:** `{"available": bool}`, and when the wheel has the built-in embedder, `model`, `revision`, `identity`, `dimensions`, `cache_dir`, `installed` and `download_bytes` |
@@ -204,7 +204,7 @@ db.notices() # what the handle warns about (also raised as UserWarning at open)
204
204
  | `search(query, top_k=10)` | Exact nearest-neighbour search |
205
205
  | `get(id)` / `delete(id)` | Fetch / soft-delete by id |
206
206
  | `about(*, visibility=None)` | Self-describing onboarding briefing — memories tagged `metadata.area="onboarding"`, manifest first. v0.17: private entries only when `visibility` asks (`["private"]`, `["all"]`) |
207
- | `stale(*, visibility=None)`, `kind_counts()` | v0.17: the stale records (`id`, `what`, `since`, `text`, `whose`, `visibility`), oldest first, private ones only when `visibility` asks; the live records by kind (`facts`, `turns`, `essence`, `coordination`) |
207
+ | `stale(*, visibility=None)`, `kind_counts()` | v0.17: the stale records (`id`, `what`, `since`, `text`, `whose`, `visibility`), oldest first, private ones only when `visibility` asks; the live records by kind (`facts`, `turns`, `essence`, `coordination`, and since v0.21.0 `tombstones`) |
208
208
  | `recent(n=20)` | The `n` most recently written live memories, newest first: facts only (no thread turns, essence items or onboarding records), nothing superseded or expired; not counted as an access (v0.16) |
209
209
  | `about_essence()` | The project essence render for the briefing (markdown), or `None` when the file has none |
210
210
  | `insert_default_manifest()` | Insert the canonical scaffold manifest (same one `mnemo init` adds); returns its id |
@@ -261,6 +261,7 @@ Plus two module-level functions:
261
261
  |---|---|
262
262
  | `mnemo.compact_file(path, passphrase)` | Rewrite the file out-of-place, dropping tombstoned and expired memories and reclaiming stale pages. Caller's own plain handle must be closed first; since v0.14 it waits up to 10 s for shared handles' calls. Returns `{"before": int, "after": int}` |
263
263
  | `mnemo.compact_file_with_key(path, key)` | The same for a raw-key file (`key`: 32 bytes, as from `generate_key()`), under the same key; converts a v8 file to v9 (since v0.13.1) |
264
+ | `mnemo.merge_files(a, b, out, *, passphrase=None, key=None, b_passphrase=None, b_key=None)` | v0.21.0: merge two diverged copies of one brain into a new file at `out`, leaving both as they were (the rules are the engine's `Mnemo::merge_files`). `a` opens with `passphrase` or `key`, and so does the output; `b` with `b_passphrase` or `b_key`, else with `a`'s. Returns the report: `merged`, `both`, `a_only` and `b_only` (ids), `conflicts` by kind, `conflict_ids`, `removed`, `dropped`, `kept_keys`, `renamed`, `after_cycles`, `lead_ms`, `hlc_since`, `older_deletes` (older deletes kept as tombstones), `settled` (conflict copies settled since), `conflict_labels` (a flagged record's key, task slug or finding id, by id), `local` (each input's claims and presence, which the output takes from `a`). A refused merge (not one brain, different embedders, a copy older than format 9, an output that exists) raises `InvalidArgumentError` with the reason. Merge copies, not a brain in use |
264
265
  | `mnemo.CancelToken()` | Shared mode: `token.cancel()` from another thread cancels a call that is waiting for the file's lock (`CancelledError`; nothing changes). Pass it as `open(..., cancel=token)`. A cancelled token stays cancelled |
265
266
  | `mnemo.install_builtin_embedder()` | **v0.15:** fetch the built-in embedder's model (91.0 MB) into the cache directory, checking each file's SHA-256, and return the directory; nothing is fetched when it's there. The size and the place are said on stderr first. `MNEMO_CACHE_DIR` moves the cache, `MNEMO_MODEL_URL` points at a mirror |
266
267
  | `mnemo.builtin_embedder_info()` | **v0.15:** `{"available": bool}`, and when the wheel has the built-in embedder, `model`, `revision`, `identity`, `dimensions`, `cache_dir`, `installed` and `download_bytes` |
@@ -1520,7 +1520,7 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a"
1520
1520
 
1521
1521
  [[package]]
1522
1522
  name = "mnemo-engine"
1523
- version = "0.20.2"
1523
+ version = "0.21.1"
1524
1524
  dependencies = [
1525
1525
  "aes-gcm",
1526
1526
  "apple-native-keyring-store",
@@ -1561,7 +1561,7 @@ dependencies = [
1561
1561
 
1562
1562
  [[package]]
1563
1563
  name = "mnemo-node"
1564
- version = "0.20.2"
1564
+ version = "0.21.1"
1565
1565
  dependencies = [
1566
1566
  "mnemo-engine",
1567
1567
  "napi",
@@ -1571,7 +1571,7 @@ dependencies = [
1571
1571
 
1572
1572
  [[package]]
1573
1573
  name = "mnemo-uniffi"
1574
- version = "0.20.2"
1574
+ version = "0.21.1"
1575
1575
  dependencies = [
1576
1576
  "mnemo-engine",
1577
1577
  "serde_json",
@@ -10,7 +10,7 @@
10
10
  # The CLI binary name stays `mnemo`, so users still invoke `mnemo` on
11
11
  # the command line after `cargo install mnemo-engine`.
12
12
  name = "mnemo-engine"
13
- version = "0.20.2"
13
+ version = "0.21.1"
14
14
  edition = "2021"
15
15
  rust-version = "1.94"
16
16
  # `benches/corpus.rs` is a shared helper module pulled into real benches
@@ -21,7 +21,7 @@ autobenches = false
21
21
  description = "Shared memory for your coding agents, in one encrypted file: an embedded Rust engine with recall, an MCP server and a CLI"
22
22
  license = "Apache-2.0"
23
23
  repository = "https://github.com/toarchkumar/mnemo"
24
- homepage = "https://toarchkumar.github.io/mnemo/"
24
+ homepage = "https://emnemo.com/"
25
25
  documentation = "https://docs.rs/mnemo-engine"
26
26
  readme = "README.md"
27
27
  # RB-003.4: the published crate carries the library, the CLI and the
@@ -40,6 +40,7 @@ exclude = [
40
40
  "examples/gen_*",
41
41
  "examples/device_budget.rs",
42
42
  "examples/fmt9_proto.rs",
43
+ "examples/merge_bench.rs",
43
44
  ]
44
45
  # crates.io takes at most 5 keywords, each at most 20 characters of ASCII
45
46
  # letters, digits, `_`, `-` or `+`, starting with a letter; pick the ones
@@ -667,6 +667,73 @@ compaction closes the old file before the rename, and the identity check
667
667
  before each commit is what catches a write that would land in the replaced
668
668
  file.
669
669
 
670
+ **Merging two copies** (v0.21.0, 13.7). `Mnemo::merge_files(a, a_secret,
671
+ b, b_secret, out, &opts)` combines two copies of one brain that diverged (a
672
+ laptop and a desktop, say) into a new file at `out`. It never changes its
673
+ inputs: each is opened read-only, with its own secret, so a copy rekeyed
674
+ since still merges. Two files are one brain when their salts match or their
675
+ manifests have the same id. The output takes the first input's secret, salt
676
+ and KDF settings, with a new data key, like a compaction.
677
+
678
+ - A delete in either copy wins, by id, with no clock: the record is gone
679
+ from the output, unless that copy wrote the id again afterwards. A delete
680
+ made by an older build (a deleted row and no tombstone) counts too, and
681
+ the output keeps it as a tombstone, so it stays deleted in later merges;
682
+ one the copy has since dropped (a compaction does, and so does a commit
683
+ once a quarter of its rows are deleted) doesn't.
684
+ - A record edited in one copy only takes that edit. Edited in both, the
685
+ newer edit wins, and a fact keeps the other text as a conflict copy
686
+ (`_mnemo.merge_conflict`, `_mnemo.merge_source`). Each in-place rewrite
687
+ lists the versions before it (`_mnemo.hlc_prev`, the 8 latest), which is
688
+ how a merge tells one from the other. Past 8 versions a merge can't
689
+ tell, and keeps a conflict copy rather than lose one. A record an older
690
+ build wrote has no such list: this build's first edit of it lists the
691
+ version it found, so an edit in one copy still wins with no copy.
692
+ - A record a merge combines lists the concurrent versions it holds
693
+ (`_mnemo.merge_heads`). An essence item, task or finding is flagged while
694
+ two of them hold different text, and a conflict copy stays while its
695
+ text is one of them: edit the record (from the merged file) and its
696
+ flag goes at once, or for a fact, its copy goes at the next merge, which
697
+ counts it as settled. A write of a flagged conflict copy settles it too,
698
+ and `mnemo forget <id>` forgets one. Forgetting the record instead keeps
699
+ the copy beside its tombstone. So copies merge to the same records in any order, a copy of a
700
+ copy too.
701
+ - A key written in both copies becomes one chain, both versions in
702
+ history: each version after the one it was written over, and versions
703
+ with no written path between them by when each was first written
704
+ (`_mnemo.first_hlc`; an older build's version by when it was created,
705
+ to the millisecond of its id).
706
+ When the versions nothing written follows hold different text, each but
707
+ the last is flagged. The
708
+ chain comes from what was written, never from links an earlier merge
709
+ made, so copies merge to the same chain in any order: each version keeps
710
+ the link its write made, a link the merge makes is marked
711
+ (`_mnemo.merge_linked`, with the version it was written over), and a
712
+ deleted version's tombstone keeps what it was written over
713
+ (`_mnemo.tombstone_supersedes`), and the version a merge had put it
714
+ after (`_mnemo.tombstone_after`). Forgetting a key's live version ends
715
+ its chain, and a merge keeps it ended unless a version written after it
716
+ is kept; a version that lost to the one forgotten keeps its flag. A new
717
+ version of the key settles the versions a merge flagged before it
718
+ (`_mnemo.merge_settled`), and no later merge flags them again. A keyed
719
+ manifest's slot is one chain too. Essence items, tasks
720
+ and findings merge their status (`done`, `verified` and `resolved` are
721
+ final); two tasks or findings under one name keep both, the later
722
+ renamed `<name>-merge-2` and flagged until it can take its name back.
723
+ - Forgetting a thread takes every copy of its turns saved before the
724
+ forget, in either copy; a turn saved again after it, in a copy that had
725
+ the forget, stays.
726
+
727
+ `MergeReport` says what came from each side, what conflicted, what was
728
+ deleted (and the older deletes it kept as tombstones), the conflict copies
729
+ settled, what each flagged record is (`conflict_labels`: its key, task slug
730
+ or finding id), each copy's claims and presence (`local`, which the output
731
+ takes from the first copy), and how far each copy's clock ran ahead. Each input is held for
732
+ readers while it's read, so merge copies, not a brain in use.
733
+ `Mnemo::merge_conflicts` returns the records a merge flagged; `mnemo
734
+ merge a b -o out` runs it from a shell, and `about` and `inspect` show the
735
+ flagged records.
736
+
670
737
  **Shared mode** (v0.14, 12.4): `Mnemo::open_shared` returns a
671
738
  `SharedMnemo`, which takes the lock for each call (`read` under the shared
672
739
  lock, `write` under the exclusive one, committing before it returns) and
@@ -998,19 +1065,21 @@ cargo run --bin mnemo -- <command>
998
1065
  | `unlock` | Keep a brain's key in this machine's keychain, from its recovery code (read from a prompt or stdin) (v0.15) |
999
1066
  | `mcp install` | Add the brain's MCP server (`serve --mcp --shared`) to Claude Code, Cursor or Claude Desktop, with no secret and a diff first (v0.15) |
1000
1067
  | `info` | Print statistics (including ANN index shape) |
1001
- | `about` | Self-describing briefing — print onboarding memories. Since v0.17 its header counts facts, turns, essence items and coordination records apart, an entry past its review date is marked `[stale since <date>]`, and private entries show only with `--visibility private` (or `all`) |
1068
+ | `about` | Self-describing briefing — print onboarding memories. Since v0.17 its header counts facts, turns, essence items and coordination records apart (since v0.21.0 leaving out the tombstones deletes leave), an entry past its review date is marked `[stale since <date>]`, and private entries show only with `--visibility private` (or `all`). Since v0.21.0 it also says how many records a merge flagged as in conflict (`merge_conflicts` in its JSON) |
1002
1069
  | `import` | Bulk-load memories from a JSON Lines file |
1003
1070
  | `index` | Build, rebuild, or drop the IVF+PQ index |
1004
1071
  | `list` | Browse live memories (table / json / jsonl, filters). Since v0.17 private records only with `--visibility private` (or `all`, which marks them `[private]`); `history` takes `--visibility` too |
1005
- | `export` | Readable plaintext export (Markdown or JSON Lines, filters); `--git` for diff-clean output. Since v0.17 private records are left out (a stderr line says how many) unless `--visibility all`, which says it included them; `--git` never writes them, nor messages, claims or presence. Since v0.18, `--git` writes the findings (every status, in id order) after the tasks, then the project essence (its open items by section, then those resolved in the last 30 days); it leaves out thread essence, and a `SECURITY` finding until it's `verified`, and its Markdown header says it's the backup and names the build that wrote it. Since v0.18.1 it also leaves out a task whose refs name such a finding |
1006
- | `inspect` | Browse the file in a local, read-only web view (memories, keyed history, threads and essence, review findings, tasks, snapshots, about) |
1072
+ | `export` | Readable plaintext export (Markdown or JSON Lines, filters); `--git` for diff-clean output. Since v0.17 private records are left out (a stderr line says how many) unless `--visibility all`, which says it included them; `--git` never writes them, nor messages, claims or presence (nor, since v0.21.0, tombstones). Since v0.18, `--git` writes the findings (every status, in id order) after the tasks, then the project essence (its open items by section, then those resolved in the last 30 days); it leaves out thread essence, and a `SECURITY` finding until it's `verified`, and its Markdown header says it's the backup and names the build that wrote it. Since v0.18.1 it also leaves out a task whose refs name such a finding |
1073
+ | `inspect` | Browse the file in a local, read-only web view (memories, keyed history, threads and essence, review findings, tasks, snapshots, about). Since v0.21.0 a record a merge flagged is tagged `merge conflict`, the memories have a filter for them, and the about tab counts them |
1007
1074
  | `get` | Fetch one memory by its ULID, with its whole content. `get <ID>` uses the project brain, and `get <PATH> <ID>` a file (v0.16.1). Since v0.20.2, `get --key <KEY>` (or `get <PATH> --key <KEY>`) prints a keyed fact's live version the same way, from the slot `history --key` walks (`--agent`, `--shared`), and exits 1 when the key has none |
1008
1075
  | `post <TO> <SUBJECT>` | Post a message to an agent (`worker-a`), a role (`role:worker`) or `all`, with `--body`, `--refs`, `--conversation` (a reply). Prints its id and hop count. `--as <agent>` and `--role <role>` say who you are, else `MNEMO_AGENT` and `MNEMO_ROLE`; `--brain <PATH>` for a brain outside the repository (v0.17) |
1009
- | `inbox [PATH]` | Your messages (to you, your role or `all`, never your own) not yet acked; `--all` for acked ones too, `--visibility` for private ones; listing marks them seen. `--prune [--days N]` deletes those acked more than 30 (or N) days ago. `--as`, `--role`, `--format` (v0.17) |
1076
+ | `inbox [PATH]` | Your messages (to you, your role or `all`, never your own) not yet acked; `--all` for acked ones too, `--visibility` for private ones; listing marks them seen. `--prune [--days N]` deletes those acked more than 30 (or N) days ago (leaving no tombstone, since v0.21.0). `--as`, `--role`, `--format` (v0.17) |
1010
1077
  | `ack [PATH] <ID>` | Ack a message (`unread` to `acked`), with `--note`; `--as` (v0.17) |
1011
1078
  | `task add <TITLE> [--for <role>]` | Queue a task for a role (`--for`; any role without it), with `--body`, `--after <slugs>`, `--pre-approved`, `--slug`, and `--ref` (v0.18.1, repeatable: what it's about, such as a finding's id; `export --git` leaves out a task that refs a `SECURITY` finding until it's verified). Prints its slug, `added`, `updated` (the slug existed) or `unchanged`, and its status. A re-add of a `done` slug is refused (with a free slug to use), and only the task's creator changes it. An `after` that closes a cycle is refused (v0.17) |
1012
1079
  | `task next` | Take the oldest task for your role (`--role`, else `MNEMO_ROLE`) whose `--after` tasks are done, or one whose owner's 2 h claim lapsed (`active` or `blocked`). Your own task whose claim lapsed comes back to you first. Prints the slug, the claim token, the expiry and the title; exits 1 when there's nothing to take (v0.17) |
1013
1080
  | `task update <SLUG> [--status S] [--note N] [--token T]` | Move your task along: `ready` when finished (its creator sets `done`, unless it's `--pre-approved`), `blocked`, `queued` to hand it back, `active` again. Each renews your claim and prints it (the slug, the status, the token and the expiry); after a lapse nobody acted on, it takes the claim again with a new token. Exits 1 with `lost` when another agent took it back, or when the token isn't the claim's. Anyone may requeue a task (`active` or `blocked`) once its claim lapsed (v0.17) |
1081
+ | `task take <SLUG>` | v0.21.1: take the task a pointer names, as `task next` takes one (the same claim, printed the same way), for your role (`--role`, else `MNEMO_ROLE`). Refused, exit 1, when its `--after` tasks aren't done (it names them), when it's `ready` or `done`, and when another agent's claim on it is live; an `active` or `blocked` task whose claim lapsed is taken back |
1082
+ | `task update <SLUG> --after <slugs>` | v0.21.1: for the task's creator, replace what it waits for (comma-separated; `--after ""` for nothing), at any status but `done`. Refuses a slug that names no task, the task itself, and a cycle. It goes alone, without `--status`, `--note` or `--token`, and the change is a note in its history. The MCP `task` tool's `update` takes `after` the same way, and its `take` op is `task take` |
1014
1083
  | `task list [--status S] [--for <role>]`, `task get <SLUG>` | The tasks, oldest first; one with its history and refs; `--format` (v0.17; `refs` in the JSON since v0.18.1) |
1015
1084
  | `claim take <TOPIC> [--ttl 15m]` | Claim a topic so two agents don't do one thing (advisory: a record, not a lock). Prints `claimed`, a token and the expiry; exits 1 when another agent (or another session of yours) holds it. Leases are 30s to 24h, 15m by default. `--as`, `--role`, `--brain` (v0.17) |
1016
1085
  | `claim renew\|release\|check <TOPIC> <TOKEN>` | Renew (from now, `--ttl` or the lease), release, or check a claim; exits 1 with `lost` when it lapsed or another agent holds it. Check before anything irreversible (v0.17) |
@@ -1021,10 +1090,13 @@ cargo run --bin mnemo -- <command>
1021
1090
  | `recall` | Multi-signal ranked retrieval (sim + recency + …). Since v0.17 private records only with `--visibility private` (or `all`). Since v0.20.2 `--thread <ID>` (MCP `thread`) searches one thread's saved turns, a past session's (`claude-code:<session id>`), as `--filter _mnemo.thread=<ID> --filter _mnemo.kind=turn` does |
1022
1091
  | `stale [PATH] [--mine] [--visibility L]` | The stale records, oldest first (private ones only when asked): past their `review_by`, or older than their kind's default (essence `state` and `next` 14 days, `open` 30; an `active` task with no update 3 days, a `blocked` one 7; an unread message 3). `--mine` keeps yours (`--as`, else `MNEMO_AGENT`) (v0.17). Since v0.20.2 also the live, unkeyed episodic facts older than 30 days (`unkeyed episodic`), which nothing supersedes on its own; `about` and the session brief don't count those |
1023
1092
  | `supersede [PATH] <ID> --by <ID\|KEY>` | v0.20.2: mark an unkeyed memory superseded by a newer one (its ULID, or a key's live version), so recall and `about` leave it out as they leave out a keyed fact's older versions. Refuses a keyed memory (its key's next version supersedes it), an engine record (a turn, essence item, task, message or finding) and the manifest; the same again is `unchanged` |
1093
+ | `forget [PATH] <ID>` | v0.21.0: forget one memory by its ULID, as the MCP `forget` tool does: it leaves every read, a tombstone records the delete, and a merge removes it from every copy it meets. How to settle a merge's conflict copy you don't want. A thread's turns go with `thread forget`; a review finding is refused (triage it `rejected`); `compact` reclaims the space |
1024
1094
  | `stats [PATH] [--format table\|json\|jsonl]` | v0.20.2: what the MCP `stats` tool returns: the memory count, the file's size, the dimensions, the index, the snapshots and the page cache |
1025
- | `verify` | Decrypt and re-validate every live record; since v0.19.1 it also reads the ANN index and reports it on its own line (a damaged index is a warning: the memories are intact, and `mnemo index --rebuild` repairs it) |
1095
+ | `verify` | Decrypt and re-validate every live record; since v0.19.1 it also reads the ANN index and reports it on its own line (a damaged index is a warning: the memories are intact, and `mnemo index --rebuild` repairs it). Since v0.21.0 `--recover` opens the file read-write once first, which finishes a write a process left pending (its write-ahead log) or repairs a torn header and changes no record: what a read-only open (or a merge's input) that says to open read-write once needs |
1026
1096
  | `rekey` | Re-encrypt the data key under a new passphrase, or a new generated key (`--new-key`, v0.15, kept in the key store); `--rotate` also rewrites the file under a fresh data key (revokes the old secret) |
1027
- | `compact` | Rebuild the file, dropping tombstones and expired; writes v9, which converts a v8 (or older) file. Since v0.13 that's the only way to make a v8 file writable again. Since v0.15 it also rebuilds the keyword index with tokenizer 2 |
1097
+ | `compact` | Rebuild the file, dropping deleted rows and expired records (since v0.21.0 it keeps the tombstone record each delete leaves, so a delete no longer makes the file smaller); writes v9, which converts a v8 (or older) file. Since v0.13 that's the only way to make a v8 file writable again. Since v0.15 it also rebuilds the keyword index with tokenizer 2 |
1098
+ | `merge <A> <B> -o <OUT>` | v0.21.0: merge two diverged copies of one brain into a new file, leaving both as they were (`Mnemo::merge_files`; the rules are under "Merging two copies"). The output opens with the first copy's secret (`--passphrase`, `--key-file`, or the key store); the second copy takes its own with `--b-passphrase`, `--b-key-file` or `MNEMO_B_PASSPHRASE`, else the key store's entry for its salt, else the first copy's; when that doesn't open it, `merge` asks at a terminal, and the error names the copy. Prints what came from each copy, the conflicts by kind with the first ten flagged records (each with its key, task slug or finding id), the removals, keys deleted in one copy and written in the other, renamed tasks and findings, and `after` cycles; `--format json` adds the ids. A copy's clock more than an hour ahead is a warning on stderr. Refused, with the reason and exit 1, when the copies aren't one brain, their embedders differ, a copy is older than format 9, or the output exists. Merge copies, not the brain in use: each input is held for readers while it's read |
1099
+ | `backup [PATH] <DIR>` | v0.21.1: copy the brain, still encrypted with its key, to `<DIR>/mnemo-YYYY-MM-DD.mnemo` (the local date), and check the copy as `verify` does (`Mnemo::backup_to`). The copy is taken under the shared lock, so sessions go on reading and a write waits for it. It goes to a temp file in DIR, is synced and checked, then renamed into place: a second backup the same day replaces that day's copy, and a copy that fails its check is removed and changes nothing. `--keep N` (default 3) then removes the oldest files named `mnemo-YYYY-MM-DD.mnemo` past N, and nothing else; the new copy always stays. DIR is created (mode 700) if it's missing, and the copy is mode 600. Prints the copy, its bytes and records, what it kept and removed; `--format json` the same fields. Refused, with the reason and exit 1: a DIR inside a git working tree, the brain's own directory, and a brain with work a process left unfinished (`mnemo verify --recover` finishes it). Keep the key's backup, the recovery code (`mnemo recovery-code`), apart from the copies |
1028
1100
  | `reembed` | Embed every live memory again with a new embedder (`--embed-cmd`, `--embed-name`, `--embed-query`, `--embed-dims`; without `--embed-cmd`, the built-in) and record its identity: a compaction with new vectors, so an interrupted run leaves the file as it was (v0.15) |
1029
1101
  | `embedder install` | Fetch the built-in embedder's model (91.0 MB) into the cache directory, checking each file's SHA-256; prints the size first (v0.15) |
1030
1102
  | `embedder status` | The built-in embedder's model, identity and cache, and whether it's installed (v0.15) |
@@ -29,7 +29,7 @@ matches the version you run: `mnemo onboard --guide` prints it.
29
29
  ### Install
30
30
 
31
31
  ```sh
32
- curl -fsSL https://toarchkumar.github.io/mnemo/install.sh | sh
32
+ curl -fsSL https://emnemo.com/install.sh | sh
33
33
  ```
34
34
 
35
35
  The script downloads the `mnemo` binary for your platform, checks its
@@ -145,6 +145,15 @@ newest first.
145
145
  Good keys are short and stable: `decision.<topic>`, `status.<thing>`,
146
146
  `convention.<topic>`, `user.<preference>`.
147
147
 
148
+ ### Forgetting
149
+
150
+ `forget` deletes a memory by id. It leaves a small tombstone in its place:
151
+ the id, its key if it had one, and the time, never the content. A merge of
152
+ two copies of the brain reads it to know the memory was deleted, not
153
+ missing. A tombstone takes about as much space as a short fact, so a
154
+ delete doesn't make the file smaller, and `mnemo compact` keeps the
155
+ tombstones.
156
+
148
157
  ## 3. Organize memory
149
158
 
150
159
  ### The four types
@@ -285,6 +294,77 @@ mnemo export --git
285
294
  - `mnemo mcp install --client cursor` adds the MCP server to one client by
286
295
  hand.
287
296
 
297
+ ### Merge two copies
298
+
299
+ When a brain was copied (to a laptop, say) and both copies changed,
300
+ `mnemo merge` combines them into a new file and leaves both as they were:
301
+
302
+ ```sh test
303
+ cp .git/mnemo/project.mnemo laptop.mnemo
304
+ cp .git/mnemo/project.mnemo desktop.mnemo
305
+ mnemo essence add laptop.mnemo --project --section next --text "Ship the merge command"
306
+ mnemo essence add desktop.mnemo --project --section open --text "Which copy is newer?"
307
+ mnemo merge laptop.mnemo desktop.mnemo -o merged.mnemo
308
+ mnemo about merged.mnemo
309
+ ```
310
+
311
+ A delete in either copy wins. An edit made in one copy wins over the
312
+ copy that didn't change it. Edits made in both keep the newer, and the
313
+ merge flags the conflict: its report lists the first ten flagged records,
314
+ `about` counts them and `mnemo inspect` lists them all. The output opens
315
+ with the first copy's secret. If the second copy has a secret of its own
316
+ (it was rekeyed since), pass it with `--b-passphrase`, `--b-key-file` or
317
+ `MNEMO_B_PASSPHRASE`. Merge copies, not the brain in use: each input is
318
+ held for readers while it's read, so a session can't write to it.
319
+
320
+ After a merge, settle each flagged record; a write settles it at once.
321
+ A fact edited in both copies comes out twice: the newer edit as the
322
+ record and the other as a flagged conflict copy. Forget the copy you
323
+ don't want (`mnemo forget merged.mnemo <id>`, or the MCP `forget` tool),
324
+ or edit the record to say what it should: its copy then goes at the next
325
+ merge, and the report counts it as settled. Forgetting the record instead
326
+ keeps the copy, which then stands alone. A key written in both copies is
327
+ one chain, the newer version live and the other flagged: write the key
328
+ again (`mnemo remember merged.mnemo --key <key> --text "<what it should
329
+ say>"`) to settle it. An essence item, task or finding changed in both is
330
+ flagged until you next change it. A task or finding added under one name
331
+ in both copies keeps both: the later is renamed `<name>-merge-2`, and it
332
+ stays flagged while the rename stands.
333
+
334
+ To make the merged file the project brain, close the sessions that have
335
+ the brain open, keep the old one, and move the merged file into its
336
+ place. Give the project brain's copy first, so the merged file opens with
337
+ its key:
338
+
339
+ ```sh
340
+ mv .git/mnemo/project.mnemo .git/mnemo/project.mnemo.before-merge
341
+ mv merged.mnemo .git/mnemo/project.mnemo
342
+ ```
343
+
344
+ Copies an older build (before v0.21) wrote to merge too, with two limits.
345
+ A delete it made is known only while the copy still holds the deleted
346
+ row: a compaction drops those, and so does a commit once a quarter of the
347
+ rows are deleted. And when it writes a key this build wrote in that copy
348
+ while the copy's clock ran ahead, the merge may put its version first,
349
+ since an older build's write has no stamp to say it came after.
350
+
351
+ ### Back up the brain
352
+
353
+ `mnemo backup` copies the brain into a folder outside the repository, and
354
+ checks the copy:
355
+
356
+ ```sh test
357
+ mnemo backup ~/mnemo-backup
358
+ ```
359
+
360
+ The copy is named by the date, `mnemo-YYYY-MM-DD.mnemo`: a second backup
361
+ the same day replaces it, and the folder keeps the newest three
362
+ (`--keep`). Sessions can keep running: they go on reading, and a write
363
+ waits for the copy. The copy is encrypted with the brain's key, which
364
+ stays in this machine's key store. So back up the key apart from it: run
365
+ `mnemo recovery-code` and keep the code in a password manager, never in
366
+ the backup folder. On another machine, `mnemo unlock` takes the code.
367
+
288
368
  ## 5. Hooks and MCP extras
289
369
 
290
370
  `onboard` installs four hooks: `mnemo hook session-start`, `mnemo hook
@@ -360,6 +440,9 @@ MNEMO_AGENT=worker-a MNEMO_ROLE=worker mnemo task next
360
440
  mnemo task update fix-the-flaky-upload-test --note "the retry was racing the upload" --as worker-a
361
441
  mnemo task update fix-the-flaky-upload-test --status ready --as worker-a
362
442
  mnemo task update fix-the-flaky-upload-test --status done --as planner-a
443
+ mnemo task add "Update the changelog" --for worker --as planner-a
444
+ mnemo task update write-the-release-notes --after update-the-changelog --as planner-a
445
+ MNEMO_AGENT=worker-a MNEMO_ROLE=worker mnemo task take update-the-changelog
363
446
  mnemo task list
364
447
  ```
365
448
 
@@ -367,9 +450,12 @@ mnemo task list
367
450
  tasks are done, makes it yours, and holds it with a claim for 2 hours.
368
451
  Your own task whose claim lapsed comes back to you first, and a task
369
452
  whose owner went quiet is taken back.
453
+ - **`task take <slug>`** takes the task a pointer names, the same way,
454
+ once its `--after` tasks are done.
370
455
  - **`task update`** moves your task along: `--status ready` when you're
371
456
  finished, `blocked`, `queued` to hand it back, `active` again, or a
372
- `--note`. Each renews your claim.
457
+ `--note`. Each renews your claim. A task's creator changes what it
458
+ waits for with `--after <slug>[,<slug>]`.
373
459
  - **`lost`** means another agent took the task back after your claim
374
460
  lapsed. Stop working on it.
375
461
  - **`ready` waits for the task's creator to set `done`,** unless it's
@@ -229,7 +229,8 @@ pub fn select(mut all: Vec<Memory>, o: &ExportOptions) -> Vec<Memory> {
229
229
  .unwrap_or(0);
230
230
  all.retain(|m| !matches!(kind_of(m), Some("claim" | "presence")));
231
231
  if o.git {
232
- all.retain(|m| kind_of(m) != Some("message"));
232
+ // v0.21.0: tombstones are for a merge, not a backup to read.
233
+ all.retain(|m| !matches!(kind_of(m), Some("message" | "tombstone")));
233
234
  all.retain(|m| !done_long_ago(m, now));
234
235
  all.retain(|m| !resolved_long_ago(m, now));
235
236
  all.retain(|m| !kept_out_of_git(m));
@@ -125,7 +125,7 @@ async function session() {
125
125
  }
126
126
  const main = document.getElementById("main");
127
127
  let view = "memories";
128
- const state = { q: "", type: "", agent: "", keyed: "", thread: "", key: null, threadId: null,
128
+ const state = { q: "", type: "", agent: "", keyed: "", thread: "", conflict: "", key: null, threadId: null,
129
129
  fStatus: "", fCategory: "", fPriority: "", findingId: null, tStatus: "", taskSlug: null,
130
130
  dFrom: "", dTo: "", tDate: "created" };
131
131
 
@@ -190,6 +190,7 @@ function memoryCard(m) {
190
190
  if (m.thread) tags.push(el("span", { class: "tag mono" }, "thread " + m.thread));
191
191
  if (m.kind) tags.push(el("span", { class: "tag" }, m.kind));
192
192
  if (m.private) tags.push(el("span", { class: "tag" }, "private"));
193
+ if (m.conflict) tags.push(el("span", { class: "tag" }, "merge conflict"));
193
194
  if (m.superseded_by) tags.push(el("span", {}, "superseded " + when(m.invalid_at)));
194
195
  if (m.score != null) tags.push(el("span", {}, "score " + m.score.toFixed(2)));
195
196
  tags.push(el("span", {}, when(m.created_at)), el("span", {}, "importance " + m.importance));
@@ -202,7 +203,7 @@ function memoryCard(m) {
202
203
 
203
204
  async function showMemories() {
204
205
  const params = withRange({ limit: 200 });
205
- for (const k of ["q", "type", "agent", "keyed", "thread"]) if (state[k]) params[k] = state[k];
206
+ for (const k of ["q", "type", "agent", "keyed", "thread", "conflict"]) if (state[k]) params[k] = state[k];
206
207
  const [data, threads] = await Promise.all([api("/api/memories", params), api("/api/threads")]);
207
208
  const sel = (name, opts) => {
208
209
  const s = el("select", { onchange: e => { state[name] = e.target.value; render(); } },
@@ -217,6 +218,7 @@ async function showMemories() {
217
218
  sel("agent", [["", "All agents"], ...data.agents.map(a => [a, a])]),
218
219
  sel("keyed", [["", "Keyed or not"], ["yes", "Keyed"], ["no", "Not keyed"]]),
219
220
  sel("thread", [["", "Any thread"], ...threads.threads.map(t => [t.id, t.id])]),
221
+ sel("conflict", [["", "Flagged or not"], ["yes", "Merge conflicts"]]),
220
222
  ...dateInputs());
221
223
  const shown = data.memories.length;
222
224
  const note = shown < data.total ? `showing ${shown} of ${data.total}` : `${data.total} ${data.total === 1 ? "memory" : "memories"}`;
@@ -416,6 +418,7 @@ async function showAbout() {
416
418
  ["Memories", `${a.memories} live, ${a.tombstoned} tombstoned`],
417
419
  ["Threads / keyed facts", `${a.threads} / ${a.keys}`],
418
420
  ["Findings / tasks", `${a.findings} / ${a.tasks}`],
421
+ ["Merge conflicts", a.conflicts ? `${a.conflicts} (Memories, "Merge conflicts" lists them)` : "none"],
419
422
  ["Agents", a.agents.join(", ") || "—"],
420
423
  ["File size", bytes(a.file_bytes)],
421
424
  ["Vector column", bytes(a.vector_column_bytes)],
@@ -275,6 +275,10 @@ fn memory_json(m: &Memory) -> Value {
275
275
  if mnemo_engine::visibility_of(m) == "private" {
276
276
  r.insert("private".into(), json!(true));
277
277
  }
278
+ // v0.21.0 (13.7): a record a merge flagged.
279
+ if mnemo_engine::is_merge_conflict(m) {
280
+ r.insert("conflict".into(), json!(true));
281
+ }
278
282
  if let Some(s) = &m.session_id {
279
283
  r.insert("session".into(), json!(s));
280
284
  }
@@ -398,6 +402,12 @@ pub fn load(path: &str, secret: &Secret) -> Result<Loaded, String> {
398
402
  .collect();
399
403
  let contents = KeywordIndex::new(shown.iter().map(|m| m.content.as_str()));
400
404
  let memories: Vec<Value> = shown.iter().map(|m| memory_json(m)).collect();
405
+ // v0.21.0 (13.7): every record a merge flagged (a merge never flags a
406
+ // turn, so the shown records hold them all).
407
+ let conflicts = memories
408
+ .iter()
409
+ .filter(|m| m.get("conflict").is_some())
410
+ .count();
401
411
  let agents: Vec<String> = shown
402
412
  .iter()
403
413
  .map(|m| m.agent_id.clone())
@@ -468,6 +478,7 @@ pub fn load(path: &str, secret: &Secret) -> Result<Loaded, String> {
468
478
  "keys": keys.len(),
469
479
  "findings": findings.len(),
470
480
  "tasks": tasks.len(),
481
+ "conflicts": conflicts,
471
482
  });
472
483
  let snapshots = json!({
473
484
  "retained": summary.snapshots_retained,
@@ -932,6 +943,7 @@ fn route_in(l: &Loaded, req: &Request, range: (Option<i64>, Option<i64>)) -> Opt
932
943
  Some("no") => m.get("key").is_none(),
933
944
  _ => true,
934
945
  }
946
+ && (q("conflict") != Some("yes") || m.get("conflict").is_some())
935
947
  };
936
948
  // RB-003.7: count the matches, then clone only the page.
937
949
  let matches: Vec<(usize, Option<f32>)> = order