mnemo-engine 0.20.2__tar.gz → 0.21.0__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.
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/PKG-INFO +3 -2
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/README.md +2 -1
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/mnemo/Cargo.lock +3 -3
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/mnemo/Cargo.toml +2 -1
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/mnemo/README.md +75 -6
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/mnemo/guide/guide.md +61 -0
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/mnemo/src/bin/mnemo/export.rs +2 -1
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/mnemo/src/bin/mnemo/inspect.html +5 -2
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/mnemo/src/bin/mnemo/inspect.rs +12 -0
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/mnemo/src/bin/mnemo.rs +453 -37
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/mnemo/src/lib.rs +18 -1
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/mnemo/src/mcp/context.rs +7 -2
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/mnemo/src/memory.rs +119 -5
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/mnemo/src/store/coordination.rs +49 -16
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/mnemo/src/store/crud.rs +117 -3
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/mnemo/src/store/flush.rs +13 -1
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/mnemo/src/store/hooks.rs +104 -0
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/mnemo/src/store/keyed.rs +147 -9
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/mnemo/src/store/maintenance.rs +8 -1
- mnemo_engine-0.21.0/mnemo/src/store/merge.rs +2403 -0
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/mnemo/src/store/mod.rs +194 -0
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/mnemo/src/store/open.rs +15 -0
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/mnemo/src/store/recall.rs +4 -1
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/mnemo/src/store/records.rs +235 -4
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/mnemo/src/store/threads.rs +7 -4
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/mnemo-python/Cargo.lock +2 -2
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/mnemo-python/Cargo.toml +1 -1
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/mnemo-python/README.md +2 -1
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/mnemo-python/src/lib.rs +121 -2
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/mnemo-python/test_mnemo.py +68 -11
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/pyproject.toml +1 -1
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/mnemo/.gitignore +0 -0
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/mnemo/benches/corpus.rs +0 -0
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/mnemo/build.rs +0 -0
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/mnemo/deny.toml +0 -0
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/mnemo/examples/ann_defaults_v0_6_0.rs +0 -0
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/mnemo/examples/ann_diagnose.rs +0 -0
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/mnemo/examples/ann_recall_grid.rs +0 -0
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/mnemo/examples/ann_recall_grid_v2.rs +0 -0
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/mnemo/examples/candle_hard.rs +0 -0
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/mnemo/examples/embedder_server.py +0 -0
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/mnemo/examples/file_size_breakdown.rs +0 -0
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/mnemo/examples/inspect_demo_brain.rs +0 -0
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/mnemo/examples/open_rss.rs +0 -0
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/mnemo/examples/perf2_split.rs +0 -0
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/mnemo/examples/quickstart.rs +0 -0
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/mnemo/examples/ranking_v2.rs +0 -0
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/mnemo/examples/session.rs +0 -0
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/mnemo/examples/shared_bench.rs +0 -0
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/mnemo/examples/thread_profile.rs +0 -0
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/mnemo/src/bin/mnemo/hook.rs +0 -0
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/mnemo/src/bin/mnemo/mcp_install.rs +0 -0
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/mnemo/src/bin/mnemo/onboard.rs +0 -0
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/mnemo/src/bin/mnemo/project.rs +0 -0
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/mnemo/src/bin/mnemo/wait.rs +0 -0
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/mnemo/src/builtin.rs +0 -0
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/mnemo/src/cache.rs +0 -0
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/mnemo/src/crypto.rs +0 -0
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/mnemo/src/embed.rs +0 -0
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/mnemo/src/embed_cmd.rs +0 -0
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/mnemo/src/error.rs +0 -0
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/mnemo/src/format.rs +0 -0
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/mnemo/src/freelist.rs +0 -0
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/mnemo/src/guide.rs +0 -0
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/mnemo/src/ident.rs +0 -0
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/mnemo/src/index.rs +0 -0
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/mnemo/src/keys/display.rs +0 -0
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/mnemo/src/keys/mod.rs +0 -0
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/mnemo/src/keys/os_store.rs +0 -0
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/mnemo/src/keys/recovery.rs +0 -0
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/mnemo/src/keyslot.rs +0 -0
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/mnemo/src/mcp.rs +0 -0
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/mnemo/src/pager.rs +0 -0
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/mnemo/src/redact.rs +0 -0
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/mnemo/src/result_cache.rs +0 -0
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/mnemo/src/session.rs +0 -0
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/mnemo/src/shared/call.rs +0 -0
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/mnemo/src/shared/fscheck.rs +0 -0
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/mnemo/src/shared/lock.rs +0 -0
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/mnemo/src/shared/mod.rs +0 -0
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/mnemo/src/shared/presence.rs +0 -0
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/mnemo/src/shared/sidecar.rs +0 -0
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/mnemo/src/store/ann.rs +0 -0
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/mnemo/src/store/cache_api.rs +0 -0
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/mnemo/src/store/catchup.rs +0 -0
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/mnemo/src/store/continuation.rs +0 -0
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/mnemo/src/store/essence.rs +0 -0
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/mnemo/src/store/findings.rs +0 -0
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/mnemo/src/store/header_graft_tests.rs +0 -0
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/mnemo/src/store/load.rs +0 -0
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/mnemo/src/store/shared.rs +0 -0
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/mnemo/src/store/snapshots.rs +0 -0
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/mnemo/src/text.rs +0 -0
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/mnemo/src/transcript.rs +0 -0
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/mnemo/src/veccol.rs +0 -0
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/mnemo/src/wal.rs +0 -0
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/mnemo-python/.gitignore +0 -0
- {mnemo_engine-0.20.2 → mnemo_engine-0.21.0}/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.
|
|
3
|
+
Version: 0.21.0
|
|
4
4
|
Classifier: Development Status :: 4 - Beta
|
|
5
5
|
Classifier: Intended Audience :: Developers
|
|
6
6
|
Classifier: License :: OSI Approved :: Apache Software License
|
|
@@ -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.
|
|
1523
|
+
version = "0.21.0"
|
|
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.
|
|
1564
|
+
version = "0.21.0"
|
|
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.
|
|
1574
|
+
version = "0.21.0"
|
|
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.
|
|
13
|
+
version = "0.21.0"
|
|
14
14
|
edition = "2021"
|
|
15
15
|
rust-version = "1.94"
|
|
16
16
|
# `benches/corpus.rs` is a shared helper module pulled into real benches
|
|
@@ -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,15 +1065,15 @@ 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) |
|
|
@@ -1021,10 +1088,12 @@ cargo run --bin mnemo -- <command>
|
|
|
1021
1088
|
| `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
1089
|
| `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
1090
|
| `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` |
|
|
1091
|
+
| `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
1092
|
| `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) |
|
|
1093
|
+
| `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
1094
|
| `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
|
|
1095
|
+
| `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 |
|
|
1096
|
+
| `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 |
|
|
1028
1097
|
| `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
1098
|
| `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
1099
|
| `embedder status` | The built-in embedder's model, identity and cache, and whether it's installed (v0.15) |
|
|
@@ -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,58 @@ 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.
|
|
331
|
+
|
|
332
|
+
To make the merged file the project brain, close the sessions that have
|
|
333
|
+
the brain open, keep the old one, and move the merged file into its
|
|
334
|
+
place. Give the project brain's copy first, so the merged file opens with
|
|
335
|
+
its key:
|
|
336
|
+
|
|
337
|
+
```sh
|
|
338
|
+
mv .git/mnemo/project.mnemo .git/mnemo/project.mnemo.before-merge
|
|
339
|
+
mv merged.mnemo .git/mnemo/project.mnemo
|
|
340
|
+
```
|
|
341
|
+
|
|
342
|
+
Copies an older build (before v0.21) wrote to merge too, with two limits.
|
|
343
|
+
A delete it made is known only while the copy still holds the deleted
|
|
344
|
+
row: a compaction drops those, and so does a commit once a quarter of the
|
|
345
|
+
rows are deleted. And when it writes a key this build wrote in that copy
|
|
346
|
+
while the copy's clock ran ahead, the merge may put its version first,
|
|
347
|
+
since an older build's write has no stamp to say it came after.
|
|
348
|
+
|
|
288
349
|
## 5. Hooks and MCP extras
|
|
289
350
|
|
|
290
351
|
`onboard` installs four hooks: `mnemo hook session-start`, `mnemo hook
|
|
@@ -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
|
-
|
|
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
|