mnemo-engine 0.17.2__tar.gz → 0.18.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.
Files changed (93) hide show
  1. {mnemo_engine-0.17.2 → mnemo_engine-0.18.0}/PKG-INFO +2 -1
  2. {mnemo_engine-0.17.2 → mnemo_engine-0.18.0}/README.md +1 -0
  3. {mnemo_engine-0.17.2 → mnemo_engine-0.18.0}/mnemo/Cargo.lock +3 -3
  4. {mnemo_engine-0.17.2 → mnemo_engine-0.18.0}/mnemo/Cargo.toml +1 -1
  5. {mnemo_engine-0.17.2 → mnemo_engine-0.18.0}/mnemo/README.md +5 -2
  6. {mnemo_engine-0.17.2 → mnemo_engine-0.18.0}/mnemo/guide/guide.md +29 -2
  7. {mnemo_engine-0.17.2 → mnemo_engine-0.18.0}/mnemo/src/bin/mnemo/export.rs +123 -20
  8. {mnemo_engine-0.17.2 → mnemo_engine-0.18.0}/mnemo/src/bin/mnemo/hook.rs +35 -0
  9. {mnemo_engine-0.17.2 → mnemo_engine-0.18.0}/mnemo/src/bin/mnemo.rs +234 -4
  10. {mnemo_engine-0.17.2 → mnemo_engine-0.18.0}/mnemo/src/lib.rs +9 -0
  11. {mnemo_engine-0.17.2 → mnemo_engine-0.18.0}/mnemo/src/mcp.rs +107 -0
  12. {mnemo_engine-0.17.2 → mnemo_engine-0.18.0}/mnemo/src/memory.rs +61 -4
  13. {mnemo_engine-0.17.2 → mnemo_engine-0.18.0}/mnemo/src/store/coordination.rs +35 -2
  14. {mnemo_engine-0.17.2 → mnemo_engine-0.18.0}/mnemo/src/store/crud.rs +16 -2
  15. {mnemo_engine-0.17.2 → mnemo_engine-0.18.0}/mnemo/src/store/essence.rs +5 -3
  16. mnemo_engine-0.18.0/mnemo/src/store/findings.rs +480 -0
  17. {mnemo_engine-0.17.2 → mnemo_engine-0.18.0}/mnemo/src/store/keyed.rs +4 -0
  18. {mnemo_engine-0.17.2 → mnemo_engine-0.18.0}/mnemo/src/store/mod.rs +2 -0
  19. {mnemo_engine-0.17.2 → mnemo_engine-0.18.0}/mnemo-python/Cargo.lock +2 -2
  20. {mnemo_engine-0.17.2 → mnemo_engine-0.18.0}/mnemo-python/Cargo.toml +1 -1
  21. {mnemo_engine-0.17.2 → mnemo_engine-0.18.0}/mnemo-python/README.md +1 -0
  22. {mnemo_engine-0.17.2 → mnemo_engine-0.18.0}/mnemo-python/src/lib.rs +101 -0
  23. {mnemo_engine-0.17.2 → mnemo_engine-0.18.0}/mnemo-python/test_mnemo.py +50 -0
  24. {mnemo_engine-0.17.2 → mnemo_engine-0.18.0}/pyproject.toml +1 -1
  25. {mnemo_engine-0.17.2 → mnemo_engine-0.18.0}/mnemo/.gitignore +0 -0
  26. {mnemo_engine-0.17.2 → mnemo_engine-0.18.0}/mnemo/benches/corpus.rs +0 -0
  27. {mnemo_engine-0.17.2 → mnemo_engine-0.18.0}/mnemo/build.rs +0 -0
  28. {mnemo_engine-0.17.2 → mnemo_engine-0.18.0}/mnemo/deny.toml +0 -0
  29. {mnemo_engine-0.17.2 → mnemo_engine-0.18.0}/mnemo/examples/ann_defaults_v0_6_0.rs +0 -0
  30. {mnemo_engine-0.17.2 → mnemo_engine-0.18.0}/mnemo/examples/ann_diagnose.rs +0 -0
  31. {mnemo_engine-0.17.2 → mnemo_engine-0.18.0}/mnemo/examples/ann_recall_grid.rs +0 -0
  32. {mnemo_engine-0.17.2 → mnemo_engine-0.18.0}/mnemo/examples/ann_recall_grid_v2.rs +0 -0
  33. {mnemo_engine-0.17.2 → mnemo_engine-0.18.0}/mnemo/examples/candle_hard.rs +0 -0
  34. {mnemo_engine-0.17.2 → mnemo_engine-0.18.0}/mnemo/examples/embedder_server.py +0 -0
  35. {mnemo_engine-0.17.2 → mnemo_engine-0.18.0}/mnemo/examples/file_size_breakdown.rs +0 -0
  36. {mnemo_engine-0.17.2 → mnemo_engine-0.18.0}/mnemo/examples/open_rss.rs +0 -0
  37. {mnemo_engine-0.17.2 → mnemo_engine-0.18.0}/mnemo/examples/quickstart.rs +0 -0
  38. {mnemo_engine-0.17.2 → mnemo_engine-0.18.0}/mnemo/examples/ranking_v2.rs +0 -0
  39. {mnemo_engine-0.17.2 → mnemo_engine-0.18.0}/mnemo/examples/session.rs +0 -0
  40. {mnemo_engine-0.17.2 → mnemo_engine-0.18.0}/mnemo/examples/shared_bench.rs +0 -0
  41. {mnemo_engine-0.17.2 → mnemo_engine-0.18.0}/mnemo/examples/thread_profile.rs +0 -0
  42. {mnemo_engine-0.17.2 → mnemo_engine-0.18.0}/mnemo/src/bin/mnemo/inspect.html +0 -0
  43. {mnemo_engine-0.17.2 → mnemo_engine-0.18.0}/mnemo/src/bin/mnemo/inspect.rs +0 -0
  44. {mnemo_engine-0.17.2 → mnemo_engine-0.18.0}/mnemo/src/bin/mnemo/mcp_install.rs +0 -0
  45. {mnemo_engine-0.17.2 → mnemo_engine-0.18.0}/mnemo/src/bin/mnemo/onboard.rs +0 -0
  46. {mnemo_engine-0.17.2 → mnemo_engine-0.18.0}/mnemo/src/bin/mnemo/project.rs +0 -0
  47. {mnemo_engine-0.17.2 → mnemo_engine-0.18.0}/mnemo/src/builtin.rs +0 -0
  48. {mnemo_engine-0.17.2 → mnemo_engine-0.18.0}/mnemo/src/cache.rs +0 -0
  49. {mnemo_engine-0.17.2 → mnemo_engine-0.18.0}/mnemo/src/crypto.rs +0 -0
  50. {mnemo_engine-0.17.2 → mnemo_engine-0.18.0}/mnemo/src/embed.rs +0 -0
  51. {mnemo_engine-0.17.2 → mnemo_engine-0.18.0}/mnemo/src/embed_cmd.rs +0 -0
  52. {mnemo_engine-0.17.2 → mnemo_engine-0.18.0}/mnemo/src/error.rs +0 -0
  53. {mnemo_engine-0.17.2 → mnemo_engine-0.18.0}/mnemo/src/format.rs +0 -0
  54. {mnemo_engine-0.17.2 → mnemo_engine-0.18.0}/mnemo/src/freelist.rs +0 -0
  55. {mnemo_engine-0.17.2 → mnemo_engine-0.18.0}/mnemo/src/guide.rs +0 -0
  56. {mnemo_engine-0.17.2 → mnemo_engine-0.18.0}/mnemo/src/ident.rs +0 -0
  57. {mnemo_engine-0.17.2 → mnemo_engine-0.18.0}/mnemo/src/index.rs +0 -0
  58. {mnemo_engine-0.17.2 → mnemo_engine-0.18.0}/mnemo/src/keys/display.rs +0 -0
  59. {mnemo_engine-0.17.2 → mnemo_engine-0.18.0}/mnemo/src/keys/mod.rs +0 -0
  60. {mnemo_engine-0.17.2 → mnemo_engine-0.18.0}/mnemo/src/keys/os_store.rs +0 -0
  61. {mnemo_engine-0.17.2 → mnemo_engine-0.18.0}/mnemo/src/keys/recovery.rs +0 -0
  62. {mnemo_engine-0.17.2 → mnemo_engine-0.18.0}/mnemo/src/keyslot.rs +0 -0
  63. {mnemo_engine-0.17.2 → mnemo_engine-0.18.0}/mnemo/src/mcp/context.rs +0 -0
  64. {mnemo_engine-0.17.2 → mnemo_engine-0.18.0}/mnemo/src/pager.rs +0 -0
  65. {mnemo_engine-0.17.2 → mnemo_engine-0.18.0}/mnemo/src/redact.rs +0 -0
  66. {mnemo_engine-0.17.2 → mnemo_engine-0.18.0}/mnemo/src/result_cache.rs +0 -0
  67. {mnemo_engine-0.17.2 → mnemo_engine-0.18.0}/mnemo/src/session.rs +0 -0
  68. {mnemo_engine-0.17.2 → mnemo_engine-0.18.0}/mnemo/src/shared/call.rs +0 -0
  69. {mnemo_engine-0.17.2 → mnemo_engine-0.18.0}/mnemo/src/shared/fscheck.rs +0 -0
  70. {mnemo_engine-0.17.2 → mnemo_engine-0.18.0}/mnemo/src/shared/lock.rs +0 -0
  71. {mnemo_engine-0.17.2 → mnemo_engine-0.18.0}/mnemo/src/shared/mod.rs +0 -0
  72. {mnemo_engine-0.17.2 → mnemo_engine-0.18.0}/mnemo/src/shared/presence.rs +0 -0
  73. {mnemo_engine-0.17.2 → mnemo_engine-0.18.0}/mnemo/src/shared/sidecar.rs +0 -0
  74. {mnemo_engine-0.17.2 → mnemo_engine-0.18.0}/mnemo/src/store/ann.rs +0 -0
  75. {mnemo_engine-0.17.2 → mnemo_engine-0.18.0}/mnemo/src/store/cache_api.rs +0 -0
  76. {mnemo_engine-0.17.2 → mnemo_engine-0.18.0}/mnemo/src/store/continuation.rs +0 -0
  77. {mnemo_engine-0.17.2 → mnemo_engine-0.18.0}/mnemo/src/store/flush.rs +0 -0
  78. {mnemo_engine-0.17.2 → mnemo_engine-0.18.0}/mnemo/src/store/header_graft_tests.rs +0 -0
  79. {mnemo_engine-0.17.2 → mnemo_engine-0.18.0}/mnemo/src/store/hooks.rs +0 -0
  80. {mnemo_engine-0.17.2 → mnemo_engine-0.18.0}/mnemo/src/store/load.rs +0 -0
  81. {mnemo_engine-0.17.2 → mnemo_engine-0.18.0}/mnemo/src/store/maintenance.rs +0 -0
  82. {mnemo_engine-0.17.2 → mnemo_engine-0.18.0}/mnemo/src/store/open.rs +0 -0
  83. {mnemo_engine-0.17.2 → mnemo_engine-0.18.0}/mnemo/src/store/recall.rs +0 -0
  84. {mnemo_engine-0.17.2 → mnemo_engine-0.18.0}/mnemo/src/store/records.rs +0 -0
  85. {mnemo_engine-0.17.2 → mnemo_engine-0.18.0}/mnemo/src/store/shared.rs +0 -0
  86. {mnemo_engine-0.17.2 → mnemo_engine-0.18.0}/mnemo/src/store/snapshots.rs +0 -0
  87. {mnemo_engine-0.17.2 → mnemo_engine-0.18.0}/mnemo/src/store/threads.rs +0 -0
  88. {mnemo_engine-0.17.2 → mnemo_engine-0.18.0}/mnemo/src/text.rs +0 -0
  89. {mnemo_engine-0.17.2 → mnemo_engine-0.18.0}/mnemo/src/transcript.rs +0 -0
  90. {mnemo_engine-0.17.2 → mnemo_engine-0.18.0}/mnemo/src/veccol.rs +0 -0
  91. {mnemo_engine-0.17.2 → mnemo_engine-0.18.0}/mnemo/src/wal.rs +0 -0
  92. {mnemo_engine-0.17.2 → mnemo_engine-0.18.0}/mnemo-python/.gitignore +0 -0
  93. {mnemo_engine-0.17.2 → mnemo_engine-0.18.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.17.2
3
+ Version: 0.18.0
4
4
  Classifier: Programming Language :: Rust
5
5
  Classifier: Programming Language :: Python :: 3
6
6
  Classifier: License :: OSI Approved :: Apache Software License
@@ -249,6 +249,7 @@ db.notices() # what the handle warns about (also raised as UserWarning at open)
249
249
  | `claim(topic, ttl=None)` | v0.17: claim a topic for `set_author`'s agent for `ttl` seconds (900 by default, 30 to 86400): `{"status": "claimed", "token", "expires_at"}` or `{"status": "held_by", "agent", "expires_at"}`. Advisory: a record, not a lock |
250
250
  | `renew(topic, token, ttl=None)`, `release(topic, token)`, `check_claim(topic, token)` | v0.17: `{"status": "held", "expires_at"}`, `{"status": "released"}`, or `{"status": "lost"}` when the claim lapsed or another agent holds it (check before anything irreversible) |
251
251
  | `claims()`, `who()`, `touch_presence(role=None, tool=None)` | v0.17: the live claims (`topic`, `holder`, `expires_at`, `lease`); the agents (`agent`, `role`, `tool`, `last_active`, `alive`: `True`, `False` or `None` for unknown, `claims`); record this agent as active (at most once a minute; returns whether it wrote) |
252
+ | `finding_add(id, category, priority, title, body="", *, refs=None)`, `finding_triage(id, status, text)`, `finding_verify(id, ref)`, `findings(status=None, batch=None, category=None, priority=None)`, `finding_get(id)` | v0.18: review findings as dicts (`id`, `batch`, `category`, `priority`, `title`, `body`, `refs`, `author`, `status`, `triage`, `triaged_by`, `verified_ref`, `verified_by`, `created_at`, `history`); an id is unique, and only the allowed transitions are accepted |
252
253
  | `default_agent()`, `set_default_agent(agent)` | v0.17: the agent the manifest names for a write that names none (`_mnemo.default_agent`), or `None`; set it, or clear it with `None` (returns `"updated"` or `"unchanged"`) |
253
254
  | `set_turn_compress_after(secs)` | v9 files: compress thread turns once they're older than `secs` (default 7 days; `0` compresses at write). This handle only |
254
255
  | `memories()` | Enumerate every live (non-deleted, non-expired) memory as a list of dicts |
@@ -235,6 +235,7 @@ db.notices() # what the handle warns about (also raised as UserWarning at open)
235
235
  | `claim(topic, ttl=None)` | v0.17: claim a topic for `set_author`'s agent for `ttl` seconds (900 by default, 30 to 86400): `{"status": "claimed", "token", "expires_at"}` or `{"status": "held_by", "agent", "expires_at"}`. Advisory: a record, not a lock |
236
236
  | `renew(topic, token, ttl=None)`, `release(topic, token)`, `check_claim(topic, token)` | v0.17: `{"status": "held", "expires_at"}`, `{"status": "released"}`, or `{"status": "lost"}` when the claim lapsed or another agent holds it (check before anything irreversible) |
237
237
  | `claims()`, `who()`, `touch_presence(role=None, tool=None)` | v0.17: the live claims (`topic`, `holder`, `expires_at`, `lease`); the agents (`agent`, `role`, `tool`, `last_active`, `alive`: `True`, `False` or `None` for unknown, `claims`); record this agent as active (at most once a minute; returns whether it wrote) |
238
+ | `finding_add(id, category, priority, title, body="", *, refs=None)`, `finding_triage(id, status, text)`, `finding_verify(id, ref)`, `findings(status=None, batch=None, category=None, priority=None)`, `finding_get(id)` | v0.18: review findings as dicts (`id`, `batch`, `category`, `priority`, `title`, `body`, `refs`, `author`, `status`, `triage`, `triaged_by`, `verified_ref`, `verified_by`, `created_at`, `history`); an id is unique, and only the allowed transitions are accepted |
238
239
  | `default_agent()`, `set_default_agent(agent)` | v0.17: the agent the manifest names for a write that names none (`_mnemo.default_agent`), or `None`; set it, or clear it with `None` (returns `"updated"` or `"unchanged"`) |
239
240
  | `set_turn_compress_after(secs)` | v9 files: compress thread turns once they're older than `secs` (default 7 days; `0` compresses at write). This handle only |
240
241
  | `memories()` | Enumerate every live (non-deleted, non-expired) memory as a list of dicts |
@@ -1520,7 +1520,7 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a"
1520
1520
 
1521
1521
  [[package]]
1522
1522
  name = "mnemo-engine"
1523
- version = "0.17.2"
1523
+ version = "0.18.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.17.2"
1564
+ version = "0.18.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.17.2"
1574
+ version = "0.18.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.17.2"
13
+ version = "0.18.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
@@ -105,7 +105,9 @@ which would leak into shell history and process listings). Tools exposed:
105
105
  `cache_get_semantic`, and since v0.17 `inbox` (messages between agents:
106
106
  `list`, `read`, `post`, `ack`, as the server's `MNEMO_AGENT` and
107
107
  `MNEMO_ROLE`; `visibility` for private ones), `task` (the shared work queue: `next`, `update`, `add`,
108
- `list`, `get`) and `claim` (`take`, `renew`, `release`, `check`, `who`). A
108
+ `list`, `get`), `claim` (`take`, `renew`, `release`, `check`, `who`) and,
109
+ since v0.18, `finding` (review findings: `add`, `triage`, `verify`, `list`,
110
+ `get`). A
109
111
  `serve --mcp --shared` with `MNEMO_AGENT` holds that agent's presence lock
110
112
  in the sidecar directory for its life, and since v0.17.2 writes its
111
113
  presence record at start, so `who` sees it alive before its first call; it
@@ -980,7 +982,7 @@ cargo run --bin mnemo -- <command>
980
982
  | `import` | Bulk-load memories from a JSON Lines file |
981
983
  | `index` | Build, rebuild, or drop the IVF+PQ index |
982
984
  | `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 |
983
- | `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 |
985
+ | `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 |
984
986
  | `inspect` | Browse the file in a local, read-only web view (memories, keyed history, threads and essence, snapshots, about) |
985
987
  | `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) |
986
988
  | `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) |
@@ -993,6 +995,7 @@ cargo run --bin mnemo -- <command>
993
995
  | `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) |
994
996
  | `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) |
995
997
  | `claim who` | The agents: role, tool, last active, whether the process is alive (`unknown` without a long-lived `serve --mcp --shared`), and the topics each holds; `--format` (v0.17) |
998
+ | `finding add <ID> --category C --priority P --title T`, `finding triage <ID> --status S --text T`, `finding verify <ID> --ref R`, `finding list`, `finding get <ID>` | v0.18: review findings as records. A Reviewer adds one under an id (`RB-014.1`: capital letters, `-`, a number, `.`, a number; unique) with a category (SECURITY, CORRECTNESS, PERF, PLAN-REFINEMENT, PRODUCT, DX/DOCS), a priority (HIGH, MEDIUM, LOW, IDEA), a title, `--body` and `--ref`s; the Planner triages it (accepted, deferred, rejected, needs-user); a Reviewer verifies it against a commit or tag (a `SECURITY` finding, only a release tag, and it stays `private` until then). A finding changes only by triage and verification: `update`, `forget` and `essence remove` refuse it, and adding one needs an agent. JSON output has its `record_id`. `list` filters by `--status`, `--batch`, `--category` and `--priority`, ordered by id; `--format table\|json\|jsonl`. Kept out of recall, like tasks |
996
999
  | `default-agent` | Show, set (`--set <id>`) or clear (`--clear`) the agent a write that names none is made for, kept on the manifest (`_mnemo.default_agent`); the CLI and the MCP server use it in place of `default` (v0.17) |
997
1000
  | `search` | Exact nearest-neighbour search (similarity only); no path needed in a git repository (v0.16.1). Since v0.17 it leaves out coordination records, and private ones unless `--visibility` asks |
998
1001
  | `recall` | Multi-signal ranked retrieval (sim + recency + …). Since v0.17 private records only with `--visibility private` (or `all`) |
@@ -374,12 +374,39 @@ of one.
374
374
  {"name": "claim", "arguments": {"op": "who"}}
375
375
  ```
376
376
 
377
+ ### Review findings
378
+
379
+ A review's findings are records too. A Reviewer adds each one under an id
380
+ (`RB-014.1`) with a category, a priority and a one-line title: `mnemo
381
+ finding add RB-014.1 --category CORRECTNESS --priority HIGH --title "…"
382
+ --as reviewer-b`. The Planner triages it (`finding triage RB-014.1 --status
383
+ accepted --text "…"`: accepted, deferred, rejected or needs-user), and a
384
+ Reviewer verifies it against a commit or a tag (`finding verify RB-014.1
385
+ --ref abc1234`). `finding list` filters by status, batch, category and
386
+ priority. A Planner's turn says when findings wait for its triage.
387
+
388
+ A finding changes only by triage and verification: `update` and `forget`
389
+ refuse it, and a wrong one is rejected, with why. Adding one needs your
390
+ agent's name (`MNEMO_AGENT` or `--as`). The engine doesn't check who
391
+ triages or verifies; the Planner triages and a Reviewer verifies.
392
+
393
+ A `SECURITY` finding stays private until it's verified, and it's verified
394
+ only against a published release tag (`--ref v0.18.0`), so verified means
395
+ shipped. `mnemo export --git` leaves it out until then, so an unfixed one
396
+ never reaches a backup you commit. Anything else that refers to an
397
+ unverified one (a task, a fact, an essence item, a commit, a PR) names it
398
+ by its id only.
399
+
400
+ ```json mcp
401
+ {"name": "finding", "arguments": {"op": "list", "status": "open"}}
402
+ ```
403
+
377
404
  ### How work reaches a session
378
405
 
379
406
  - **Every turn:** the `user-prompt` hook adds a short line when something
380
407
  is new for you (a message, a task ready for your role, a claim of yours
381
- about to lapse, a task you added that's `ready` for your `done`), and
382
- nothing otherwise. Cursor runs it after a tool call, at most once a
408
+ about to lapse, a task you added that's `ready` for your `done`, and for
409
+ a Planner, findings that wait for triage), and nothing otherwise. Cursor runs it after a tool call, at most once a
383
410
  minute.
384
411
  - **When a turn ends,** with `onboard --wake stop`: the Stop hook keeps
385
412
  you going for a pre-approved task for your role or a message to you by
@@ -14,6 +14,15 @@
14
14
  //! - the result cache (and so the embedder-identity record) is never part
15
15
  //! of an export.
16
16
  //!
17
+ //! - v0.18.0 (the backup): review findings come after the tasks, every
18
+ //! status, in their id's order; then the project essence, its open items
19
+ //! by section, then its resolved ones by section, from the last 30 days
20
+ //! only.
21
+ //! - v0.18.0: a thread's essence (one session's working state) is left
22
+ //! out, and so is a `SECURITY` finding until it's `verified`: the backup
23
+ //! may be public, and an unfixed security finding never is. The Markdown
24
+ //! header names the build that wrote it.
25
+ //!
17
26
  //! The same unchanged file exports to the same bytes, and one new memory
18
27
  //! adds only its own lines. A new version of a keyed fact also changes the
19
28
  //! line of the version it supersedes (its `_mnemo.superseded_by` and
@@ -84,6 +93,73 @@ fn done_long_ago(m: &Memory, now: i64) -> bool {
84
93
  now - at > mnemo_engine::TASK_DONE_EXPORT_KEEP_SECS
85
94
  }
86
95
 
96
+ /// v0.18.0: a finding's place in the order: its id's prefix and numbers.
97
+ fn finding_order(m: &Memory) -> Option<(String, u64, u64)> {
98
+ mnemo_engine::Finding::from_memory(m).map(|f| f.sort_key())
99
+ }
100
+
101
+ /// v0.18.0: left out of a `--git` export: a thread's essence item, and a
102
+ /// `SECURITY` finding at any status but `verified`.
103
+ fn kept_out_of_git(m: &Memory) -> bool {
104
+ if kind_of(m) == Some(mnemo_engine::MNEMO_META_KIND_ESSENCE)
105
+ && m.metadata.contains_key(mnemo_engine::MNEMO_META_THREAD)
106
+ {
107
+ return true;
108
+ }
109
+ mnemo_engine::Finding::from_memory(m).is_some_and(|f| {
110
+ f.category == "SECURITY" && f.status != mnemo_engine::finding_status::VERIFIED
111
+ })
112
+ }
113
+
114
+ /// v0.18.0: a project essence item (no thread)'s place in the order: the
115
+ /// open items by section, then the resolved ones by section, each by id.
116
+ fn project_essence_order(m: &Memory) -> Option<(bool, usize)> {
117
+ if kind_of(m) != Some(mnemo_engine::MNEMO_META_KIND_ESSENCE)
118
+ || m.metadata.contains_key(mnemo_engine::MNEMO_META_THREAD)
119
+ {
120
+ return None;
121
+ }
122
+ const SECTIONS: [&str; 8] = [
123
+ "intent",
124
+ "conventions",
125
+ "decisions",
126
+ "state",
127
+ "open",
128
+ "next",
129
+ "lessons",
130
+ "timeline",
131
+ ];
132
+ let section = m
133
+ .metadata
134
+ .get(mnemo_engine::MNEMO_META_SECTION)
135
+ .and_then(Value::as_str)
136
+ .and_then(|s| SECTIONS.iter().position(|x| *x == s))
137
+ .unwrap_or(SECTIONS.len());
138
+ Some((is_resolved(m), section))
139
+ }
140
+
141
+ fn is_resolved(m: &Memory) -> bool {
142
+ m.metadata.get("_mnemo.status").and_then(Value::as_str) == Some("resolved")
143
+ }
144
+
145
+ /// v0.18.0: a project essence item resolved more than 30 days ago (by its
146
+ /// last history entry, else when it was last changed).
147
+ fn resolved_long_ago(m: &Memory, now: i64) -> bool {
148
+ if project_essence_order(m).is_none() || !is_resolved(m) {
149
+ return false;
150
+ }
151
+ let at = m
152
+ .metadata
153
+ .get("_mnemo.status_history")
154
+ .and_then(Value::as_array)
155
+ .and_then(|h| h.last())
156
+ .and_then(|e| e.get("at"))
157
+ .and_then(Value::as_i64)
158
+ .or_else(|| m.metadata.get("_mnemo.updated_at").and_then(Value::as_i64))
159
+ .unwrap_or(m.created_at);
160
+ now - at > mnemo_engine::TASK_DONE_EXPORT_KEEP_SECS
161
+ }
162
+
87
163
  fn is_turn(m: &Memory) -> bool {
88
164
  m.metadata.get(MNEMO_META_KIND).and_then(Value::as_str) == Some(MNEMO_META_KIND_TURN)
89
165
  }
@@ -99,10 +175,19 @@ pub fn select(mut all: Vec<Memory>, o: &ExportOptions) -> Vec<Memory> {
99
175
  let now = std::time::SystemTime::now()
100
176
  .duration_since(std::time::UNIX_EPOCH)
101
177
  .map_or(0, |d| d.as_secs() as i64);
178
+ // Tests shift the clock (dev-hooks builds only), as for coordination.
179
+ #[cfg(feature = "dev-hooks")]
180
+ let now = now
181
+ + std::env::var("MNEMO_DEV_CLOCK_OFFSET")
182
+ .ok()
183
+ .and_then(|v| v.parse::<i64>().ok())
184
+ .unwrap_or(0);
102
185
  all.retain(|m| !matches!(kind_of(m), Some("claim" | "presence")));
103
186
  if o.git {
104
187
  all.retain(|m| kind_of(m) != Some("message"));
105
188
  all.retain(|m| !done_long_ago(m, now));
189
+ all.retain(|m| !resolved_long_ago(m, now));
190
+ all.retain(|m| !kept_out_of_git(m));
106
191
  }
107
192
  if let Some(ts) = &o.types {
108
193
  all.retain(|m| ts.contains(&m.memory_type));
@@ -112,19 +197,25 @@ pub fn select(mut all: Vec<Memory>, o: &ExportOptions) -> Vec<Memory> {
112
197
  }
113
198
  if o.git {
114
199
  all.retain(|m| !is_turn(m));
115
- // Keyed memories in key order, then tasks in slug order, then the
116
- // rest, each by id.
117
- all.sort_by(|a, b| {
118
- let ka = key_of(a);
119
- let kb = key_of(b);
120
- let (ta, tb) = (task_slug(a), task_slug(b));
121
- (ka.is_none(), ka, ta.is_none(), ta, a.id).cmp(&(
122
- kb.is_none(),
123
- kb,
124
- tb.is_none(),
125
- tb,
126
- b.id,
127
- ))
200
+ // Keyed memories in key order, then tasks in slug order, then
201
+ // findings in id order, then the project essence by section (open
202
+ // before resolved), then the rest, each by id.
203
+ all.sort_by_cached_key(|m| {
204
+ let key = key_of(m).map(str::to_string);
205
+ let task = task_slug(m).map(str::to_string);
206
+ let finding = finding_order(m);
207
+ let essence = project_essence_order(m);
208
+ (
209
+ key.is_none(),
210
+ key,
211
+ task.is_none(),
212
+ task,
213
+ finding.is_none(),
214
+ finding,
215
+ essence.is_none(),
216
+ essence,
217
+ m.id,
218
+ )
128
219
  });
129
220
  } else {
130
221
  all.sort_by_key(|m| m.id);
@@ -257,17 +348,29 @@ fn record(m: &Memory, git: bool) -> Map<String, Value> {
257
348
  fn markdown(memories: &[Memory], o: &ExportOptions, facts: &FileFacts) -> String {
258
349
  let mut out = String::new();
259
350
  out.push_str("# mnemo export\n\n");
260
- out.push_str(&format!(
261
- "Plaintext export of a `.mnemo` file (format v{}, {} dimensions). \
262
- Keep it as safe as the file's passphrase.\n\n",
263
- facts.format_version, facts.dimensions
264
- ));
265
351
  if o.git {
352
+ // RB-014: what the file is, which build wrote it, and what's left
353
+ // out, so a review of the commit can check all three.
354
+ out.push_str(&format!(
355
+ "The brain's backup, written by mnemo {} with `--git` to be committed \
356
+ beside the project, from a `.mnemo` file (format v{}, {} dimensions). \
357
+ It's plaintext: read the diff before committing.\n\n",
358
+ env!("CARGO_PKG_VERSION"),
359
+ facts.format_version,
360
+ facts.dimensions
361
+ ));
266
362
  out.push_str(
267
- "Written with `--git`: ordered by key, then id; vectors, thread turns \
268
- and access stats are left out.\n",
363
+ "Keyed memories by key, then tasks, findings and the project essence, \
364
+ then the rest by id. Left out: vectors, thread turns, thread essence, \
365
+ messages, claims, presence, private records, access stats, and \
366
+ security findings until they're verified against a release.\n",
269
367
  );
270
368
  } else {
369
+ out.push_str(&format!(
370
+ "Plaintext export of a `.mnemo` file (format v{}, {} dimensions). \
371
+ Keep it as safe as the file's passphrase.\n\n",
372
+ facts.format_version, facts.dimensions
373
+ ));
271
374
  out.push_str(&format!(
272
375
  "{} {}. Vectors are left out.\n",
273
376
  memories.len(),
@@ -713,6 +713,27 @@ fn your_work(db: &mut Mnemo) -> String {
713
713
  }
714
714
  }
715
715
  }
716
+ // v0.18.0: for a Planner, the findings that wait for its triage.
717
+ if role.as_deref() == Some("planner") {
718
+ let open = mnemo_engine::FindingFilter {
719
+ status: Some(mnemo_engine::finding_status::OPEN.into()),
720
+ ..Default::default()
721
+ };
722
+ if let Ok(fs) = db.findings(&open) {
723
+ if !fs.is_empty() {
724
+ sections.push((
725
+ format!(
726
+ "{} {} for triage (call `finding` with `list`, then `triage`):",
727
+ fs.len(),
728
+ plural(fs.len(), "finding waits", "findings wait")
729
+ ),
730
+ fs.iter()
731
+ .map(|f| format!("- {}: {}", esc(&f.id), esc(&f.title)))
732
+ .collect(),
733
+ ));
734
+ }
735
+ }
736
+ }
716
737
  // Its own tasks' claims about to lapse.
717
738
  if let Some(a) = &agent {
718
739
  if let Ok(claims) = db.claims() {
@@ -1030,6 +1051,13 @@ pub fn turn_text(work: &mnemo_engine::NewWork, now: i64) -> String {
1030
1051
  "tasks ready for your `done`",
1031
1052
  ));
1032
1053
  }
1054
+ if !work.findings.is_empty() {
1055
+ counts.push(n(
1056
+ work.findings.len(),
1057
+ "finding waits for triage",
1058
+ "findings wait for triage",
1059
+ ));
1060
+ }
1033
1061
  // What to call, for only what the counts hold (ONBOARD-UX).
1034
1062
  let mut calls = Vec::new();
1035
1063
  let it = |k: usize, one: &'static str, many: &'static str| if k == 1 { one } else { many };
@@ -1055,6 +1083,10 @@ pub fn turn_text(work: &mnemo_engine::NewWork, now: i64) -> String {
1055
1083
  if !work.ready_for_done.is_empty() {
1056
1084
  calls.push("Call `task` with `list`, then `update --status done`.".to_string());
1057
1085
  }
1086
+ // v0.18.0: fixed text; the ids and titles are items, after the framing.
1087
+ if !work.findings.is_empty() {
1088
+ calls.push("Call `finding` with `list`, then `triage`.".to_string());
1089
+ }
1058
1090
  let head = format!(
1059
1091
  "mnemo: new for you: {}. {}\n{}",
1060
1092
  counts.join(", "),
@@ -1072,6 +1104,9 @@ pub fn turn_text(work: &mnemo_engine::NewWork, now: i64) -> String {
1072
1104
  esc(&t.title)
1073
1105
  ));
1074
1106
  }
1107
+ for f in &work.findings {
1108
+ items.push(format!("- finding {}: {}", esc(&f.id), esc(&f.title)));
1109
+ }
1075
1110
  for c in &work.lapsing {
1076
1111
  items.push(format!(
1077
1112
  "- your claim {} lapses in {} min",
@@ -82,6 +82,7 @@ fn brain_arg(cmd: &mut Command) -> Option<&mut String> {
82
82
  | Command::Ack { path, .. }
83
83
  | Command::Post { brain: path, .. }
84
84
  | Command::Claim { brain: path, .. }
85
+ | Command::Finding { brain: path, .. }
85
86
  | Command::Task { brain: path, .. }
86
87
  | Command::Wake { brain: path, .. }
87
88
  | Command::Search { path, .. }
@@ -774,6 +775,25 @@ enum Command {
774
775
  #[arg(long, global = true)]
775
776
  passphrase: Option<String>,
776
777
  },
778
+ /// v0.18.0: review findings: a Reviewer adds and verifies, the Planner
779
+ /// triages (`add`, `triage`, `verify`, `list`, `get`).
780
+ Finding {
781
+ #[command(subcommand)]
782
+ cmd: FindingCmd,
783
+ #[command(flatten)]
784
+ who: AsArgs,
785
+ /// The brain's path. Left out, this project's brain.
786
+ #[arg(
787
+ long,
788
+ global = true,
789
+ value_name = "PATH",
790
+ default_value = "",
791
+ hide_default_value = true
792
+ )]
793
+ brain: String,
794
+ #[arg(long, global = true)]
795
+ passphrase: Option<String>,
796
+ },
777
797
  /// 13a: show, set or clear the agent a write that names none is made
778
798
  /// for (the manifest's `_mnemo.default_agent`). The CLI and the MCP
779
799
  /// server use it in place of `default`.
@@ -1418,6 +1438,79 @@ enum TaskCmd {
1418
1438
  },
1419
1439
  }
1420
1440
 
1441
+ /// v0.18.0: `mnemo finding`.
1442
+ #[derive(Subcommand)]
1443
+ enum FindingCmd {
1444
+ /// Add a finding, `open`, under an id you give (`RB-014.1`). Prints its
1445
+ /// id and status.
1446
+ Add {
1447
+ /// Capital letters, `-`, a number, `.`, a number (`RB-014.1`).
1448
+ id: String,
1449
+ /// SECURITY, CORRECTNESS, PERF, PLAN-REFINEMENT, PRODUCT or DX/DOCS.
1450
+ #[arg(long)]
1451
+ category: String,
1452
+ /// HIGH, MEDIUM, LOW or IDEA.
1453
+ #[arg(long)]
1454
+ priority: String,
1455
+ /// One line.
1456
+ #[arg(long)]
1457
+ title: String,
1458
+ #[arg(long, default_value = "")]
1459
+ body: String,
1460
+ /// What it points at (repeatable): a file and line, a commit, a PR.
1461
+ #[arg(long = "ref", value_name = "REF")]
1462
+ refs: Vec<String>,
1463
+ },
1464
+ /// Triage a finding: `--status accepted|deferred|rejected|needs-user`,
1465
+ /// with `--text` (why).
1466
+ Triage {
1467
+ id: String,
1468
+ #[arg(long)]
1469
+ status: String,
1470
+ #[arg(long)]
1471
+ text: String,
1472
+ },
1473
+ /// Verify a finding against `--ref` (a commit, a tag, a PR). A
1474
+ /// `SECURITY` finding takes only a published release tag (`v0.18.0`).
1475
+ Verify {
1476
+ id: String,
1477
+ #[arg(long = "ref", value_name = "REF")]
1478
+ verified_ref: String,
1479
+ },
1480
+ /// The findings, ordered by id.
1481
+ List {
1482
+ #[arg(long)]
1483
+ status: Option<String>,
1484
+ /// Its id's prefix (`RB-014`).
1485
+ #[arg(long)]
1486
+ batch: Option<String>,
1487
+ #[arg(long)]
1488
+ category: Option<String>,
1489
+ #[arg(long)]
1490
+ priority: Option<String>,
1491
+ #[arg(long, value_enum, default_value_t = OutputFormat::Table)]
1492
+ format: OutputFormat,
1493
+ },
1494
+ /// One finding, with its history.
1495
+ Get {
1496
+ id: String,
1497
+ #[arg(long, value_enum, default_value_t = OutputFormat::Table)]
1498
+ format: OutputFormat,
1499
+ },
1500
+ }
1501
+
1502
+ /// v0.18.0: a finding as JSON (the CLI's `--format json|jsonl`, and the
1503
+ /// MCP tool's shape).
1504
+ fn finding_json(f: &mnemo_engine::Finding) -> serde_json::Value {
1505
+ serde_json::json!({
1506
+ "id": f.id, "record_id": f.record_id.to_string(), "batch": f.batch, "category": f.category, "priority": f.priority,
1507
+ "title": f.title, "body": f.body, "refs": f.refs, "author": f.author,
1508
+ "status": f.status, "triage": f.triage, "triaged_by": f.triaged_by,
1509
+ "verified_ref": f.verified_ref, "verified_by": f.verified_by,
1510
+ "created_at": f.created_at, "history": f.history,
1511
+ })
1512
+ }
1513
+
1421
1514
  /// 13a (13.3): `mnemo claim`.
1422
1515
  #[derive(Subcommand)]
1423
1516
  enum ClaimCmd {
@@ -4081,10 +4174,18 @@ fn run() -> std::result::Result<(), String> {
4081
4174
  };
4082
4175
  let selected = export::select(all, &opts);
4083
4176
  let body = export::render(&selected, &opts, &facts);
4084
- eprintln!(
4085
- "warning: the export is plaintext, not encrypted; keep it as safe as \
4086
- the file's passphrase"
4087
- );
4177
+ if git {
4178
+ eprintln!(
4179
+ "note: the export is plaintext, written by mnemo {} with `--git` to be \
4180
+ committed; read the diff first",
4181
+ env!("CARGO_PKG_VERSION")
4182
+ );
4183
+ } else {
4184
+ eprintln!(
4185
+ "warning: the export is plaintext, not encrypted; keep it as safe as \
4186
+ the file's passphrase"
4187
+ );
4188
+ }
4088
4189
  match output {
4089
4190
  Some(p) => {
4090
4191
  export::write_private(&p, &body)?;
@@ -4724,6 +4825,135 @@ fn run() -> std::result::Result<(), String> {
4724
4825
  db.flush().map_err(fmt)?;
4725
4826
  out?;
4726
4827
  }
4828
+ Command::Finding {
4829
+ cmd,
4830
+ who,
4831
+ brain: path,
4832
+ passphrase: pp,
4833
+ } => {
4834
+ let writes = !matches!(cmd, FindingCmd::List { .. } | FindingCmd::Get { .. });
4835
+ let (agent, role) = if writes {
4836
+ who.resolve_for_write()?
4837
+ } else {
4838
+ who.resolve()?
4839
+ };
4840
+ let pp = secret_for(&path, &pp, &None)?;
4841
+ let mut db = if writes {
4842
+ open_w(&path, &pp, "finding").map_err(fmt)?
4843
+ } else {
4844
+ open_ro(&path, &pp).map_err(fmt)?
4845
+ };
4846
+ if agent.is_some() {
4847
+ db.set_author(agent.clone());
4848
+ }
4849
+ if writes && agent.is_some() {
4850
+ let _ = db.touch_presence(role.as_deref(), Some("cli"));
4851
+ }
4852
+ let row = |f: &mnemo_engine::Finding| {
4853
+ format!(
4854
+ "{} [{}] {} {} {}",
4855
+ f.id, f.status, f.category, f.priority, f.title
4856
+ )
4857
+ };
4858
+ let out: std::result::Result<(), String> = match &cmd {
4859
+ FindingCmd::Add {
4860
+ id,
4861
+ category,
4862
+ priority,
4863
+ title,
4864
+ body,
4865
+ refs,
4866
+ } => {
4867
+ let spec = mnemo_engine::FindingSpec {
4868
+ id: id.clone(),
4869
+ category: category.clone(),
4870
+ priority: priority.clone(),
4871
+ title: title.clone(),
4872
+ body: body.clone(),
4873
+ refs: refs.clone(),
4874
+ };
4875
+ let f = db.finding_add(&spec).map_err(fmt)?;
4876
+ println!("{}\t{}", f.id, f.status);
4877
+ Ok(())
4878
+ }
4879
+ FindingCmd::Triage { id, status, text } => {
4880
+ let f = db.finding_triage(id, status, text).map_err(fmt)?;
4881
+ println!("{}\t{}", f.id, f.status);
4882
+ Ok(())
4883
+ }
4884
+ FindingCmd::Verify { id, verified_ref } => {
4885
+ let f = db.finding_verify(id, verified_ref).map_err(fmt)?;
4886
+ println!("{}\t{}", f.id, f.status);
4887
+ Ok(())
4888
+ }
4889
+ FindingCmd::List {
4890
+ status,
4891
+ batch,
4892
+ category,
4893
+ priority,
4894
+ format,
4895
+ } => {
4896
+ let filter = mnemo_engine::FindingFilter {
4897
+ status: status.clone(),
4898
+ batch: batch.clone(),
4899
+ category: category.clone(),
4900
+ priority: priority.clone(),
4901
+ };
4902
+ let fs = db.findings(&filter).map_err(fmt)?;
4903
+ match format {
4904
+ OutputFormat::Json => println!(
4905
+ "{}",
4906
+ serde_json::Value::Array(fs.iter().map(finding_json).collect())
4907
+ ),
4908
+ OutputFormat::Jsonl => {
4909
+ fs.iter().for_each(|f| println!("{}", finding_json(f)))
4910
+ }
4911
+ OutputFormat::Table => {
4912
+ if fs.is_empty() {
4913
+ println!("no findings");
4914
+ }
4915
+ fs.iter().for_each(|f| println!("{}", row(f)));
4916
+ }
4917
+ }
4918
+ Ok(())
4919
+ }
4920
+ FindingCmd::Get { id, format } => match db.finding(id).map_err(fmt)? {
4921
+ None => Err(format!("no finding {id:?}")),
4922
+ Some(f) => {
4923
+ match format {
4924
+ OutputFormat::Table => {
4925
+ println!("{}", row(&f));
4926
+ for l in f.body.lines() {
4927
+ println!(" {l}");
4928
+ }
4929
+ if !f.refs.is_empty() {
4930
+ println!(" refs: {}", f.refs.join(", "));
4931
+ }
4932
+ for h in &f.history {
4933
+ println!(
4934
+ " {} {} -> {} by {}{}",
4935
+ export::rfc3339(h["at"].as_i64().unwrap_or(0)),
4936
+ h["from"].as_str().unwrap_or(""),
4937
+ h["to"].as_str().unwrap_or(""),
4938
+ h["by"].as_str().unwrap_or(""),
4939
+ h["note"]
4940
+ .as_str()
4941
+ .map(|n| format!(": {n}"))
4942
+ .unwrap_or_default()
4943
+ );
4944
+ }
4945
+ }
4946
+ _ => println!("{}", finding_json(&f)),
4947
+ }
4948
+ Ok(())
4949
+ }
4950
+ },
4951
+ };
4952
+ if writes {
4953
+ db.flush().map_err(fmt)?;
4954
+ }
4955
+ out?;
4956
+ }
4727
4957
  Command::Claim {
4728
4958
  cmd,
4729
4959
  who,