0.12.2.59 NOV/12/2026 - fix(mcp): the MCP event stream (`GET /` on the MCP port) no longer goes silent. It wrote no bytes until a tool call was broadcast, so MCP clients with an idle-body timeout, Claude Code's HTTP client among them, dropped it and reconnected over and over (cloudllm#57: hundreds of `SSE stream disconnected: TimeoutError` lines per session), and a reconnect that met a brief network stall could leave the server disconnected. MentisDB now builds on `cloudllm_mcp` 0.4.1, which sends an SSE comment (`: keepalive`) after 15 s with nothing else to send; clients ignore comment lines. - fix(storage): a thought too large to load is refused at append. The 10 MiB cap on one thought record was enforced only when a chain was opened, so an append over it was written, and the next open failed (`binary thought payload length ... exceeds maximum 10485760`): one oversized thought made the whole chain unreadable. Ordinary REST and MCP bodies are capped at 2 MiB, so the way in was the library and the large-body import routes (`/v1/import-markdown`, `/v1/extract-memories`, `/v1/skills/upload`, for a token holder). The append now fails with `InvalidInput` (400) before anything is written. - feat(cli): `--source-episode` on `thought append` (stored) and on `search`, `search filter`, `search federated` and `search bundles` (exact-match filter), matching the REST and MCP fields of #27. Commands whose route does not apply it (`thought traverse`, `thought candidates`, `memory export`, `search lexical`) refuse the flag instead of sending a field the server would drop. - fix(rest, mcp): `source_episode` is stored, returned and filterable. `POST /v1/thoughts` and the MCP `mentisdb_append` tool accepted the field but dropped it without any error, so the thought came back with `source_episode: null` although the README documents it. The append request now stores it, and `source_episode` is also accepted as an exact-match filter on `/v1/search`, `/v1/ranked-search`, `/v1/federated-search`, `/v1/context-bundles` and their MCP tools. Clients that omit the field are unaffected. `/v1/lexical-search`, thought traversal, summary candidates and the MEMORY.md export do not take the filter yet. - fix(dashboard): the Settings screen lists every daemon setting. 18 variables the daemon reads were missing, among them `MENTISDB_DEDUP_THRESHOLD` / `_SCAN_WINDOW`, `MENTISDB_AUTO_EDGE_*`, the request-body limits, `MENTISDB_FSYNC`, `MENTISDB_GROUP_COMMIT_MS`, `MENTISDB_EMBEDDINGS`, the search defaults (`VECTOR_FUSION`, `COLLAPSE_DUPLICATES`, `DF_SCOPE`), the migration settings, `MENTISDB_DASHBOARD_ALLOWED_HOSTS` and `MENTISDB_WEBHOOK_ALLOWED_CIDRS`. The HTTPS ports were shown but refused on save. `MENTISDB_VERBOSE`, `MENTISDB_UPDATE_CHECK`, `MENTISDB_UPDATE_REPO`, `MENTISDB_STARTUP_SOUND` and `MENTISDB_THOUGHT_SOUNDS` were labelled hot-reload although the daemon reads them once at startup; they now say restart required. One catalog now drives what the screen shows, which names it accepts and whether a change needs a restart, and a test fails when the crate reads a `MENTISDB_*` variable the catalog does not list. Number inputs accept decimals. - fix(skills): Markdown skill import reads standard YAML frontmatter. A folded `description: >` or literal `description: |` spanning several lines was stored as just `>` or `|`, and `- item` block lists for `triggers`, `tags` and `warnings` were dropped, so skills written for agent harnesses (Claude Code, OpenCode, Grok) uploaded with no description and no triggers to search on. Block scalars, block lists and plain values continued on indented lines are now read; inline `[a, b]` lists and single-line values work as before. A multi-line description is exported as a literal block so it survives a Markdown round trip. `|` and `>` start a block only as a whole YAML block header (`|-`, `>2`, `> # note`); a one-line value that merely begins with one, such as `| separates columns`, is kept. 0.12.1.58 NOV/08/2026 - fix(security): a registered agent key could be replaced or revived through the proof-based registration path (`add_agent_key`, used by the dashboard keys route and the library). The proof shows possession of the new key only, yet an existing key id was overwritten and a revoked one un-revoked, so a caller who could reach the route could rebind another agent's key id to a key of their own. A key id is now never rebound, active or revoked, as `agent key add` already behaved: registering a different key under an existing id is refused, the same active key again is a no-op. Deployments that rely on key ids as identities should check their registries for keys they did not register. - fix(security): the dashboard routes that register and revoke an agent key (`POST/DELETE /dashboard/api/agents/{chain}/{agent}/keys`) now need a dashboard PIN, like `/chains/{chain}/access`. A dashboard started without one cannot tell the operator from any other local process, yet it accepted these changes to who may sign. Such a dashboard now answers 403 and says to set `MENTISDB_DASHBOARD_PIN`; the agent page's Generate key pair, Add Key and Delete show that explanation, and the message stays visible long enough to read. Run with a PIN (or use `agent key add|generate --offline`) to manage keys. - ci(coverage): every CI run now writes a coverage table (functions, branches, regions, lines, with covered/total counts, the 90% goal and the gate) into the job summary, from one run on a pinned nightly, and uploads the HTML report. `make coverage` runs the same thing locally. The gate is a floor at today's measured values (73 / 64 / 72 / 74) that only ratchets up; see README "Coverage". - fix(search): federated widening is bounded per chain. The per-chain limit is `fetch * chains`, but only `fetch` was capped, so with C chains each pass could build about 4096*C hits per chain. The first pass is unchanged (`limit * chains`); later passes never exceed the larger of that and `max(16 * (offset + limit), 4096)`. - fix(mcp): lean provenance no longer treats a malformed object as plain. Only exactly `segment: "public"` and `signature: "unsigned"` (both present, both strings) with no verifier is elided; a missing, non-string or unexpected value is rendered as it is, and a missing `segment` or `signature` is flagged `unknown: true`. - perf(search): context-bundle seeds read ranks in doubling blocks by partial selection instead of sorting every match, memoize the successor and contester lookups, and build a seed only for a thought that is actually placed. Tests added for `limit = usize::MAX`, `as_of` with lineage, a successor excluded by the request's filter, and reranking with lineage. - fix(mcp): lean timestamps keep their full precision. They were cut to whole seconds, so passing a hit's `timestamp` back as `as_of` or `since` excluded the thought itself. - fix(mcp): a `compact` (or `include_entries`) that is not a boolean, such as `"false"` or `0`, is refused with JSON-RPC `-32602` instead of being read as the default, which turned an agent's opt-out into the opposite. `POST /tools/execute` and REST now honour the `compact` they advertise on `mentisdb_lexical_search` (default `false` there; compact drops `match_sources` and the thought's integrity fields), where it used to be silently ignored. `/tools/list` no longer advertises `compact` on `mentisdb_context_bundles`, which only takes effect over streamable MCP (REST still accepts and ignores it). - fix(mcp): a lean hit keeps the kind of the link it replaces. Dropping the relation that `successor_of` names also dropped whether it was `Corrects` or `Invalidates`; that kind now shows as `successor_kind` (absent means `Supersedes`). The skill also says that `signature: valid` without a `verified_agent` means the key is not currently trusted. - docs(search): `successor_of` and `superseded_versions` are no longer described as the whole lineage. They list older versions that matched the query and were met before the page filled, so the count is a lower bound (rustdoc, the `compact` parameter description, the skill and the README). - fix(mcp): lean ranked hits drop `chain_key` only for the chain that was searched (the requested one, or the server's default when none was given). A hit from a branch's ancestor, or a cross-chain replacement living on another chain, keeps its key even when every hit shares it; the old rule elided any key all hits shared. - fix(mcp): lean provenance fails closed. A lean thought that arrives with no provenance is marked `provenance: {"unknown": true}` instead of passing for the plain public, unsigned case, and every lean search response carries one `default_provenance` field saying what an unmarked hit is ("public, unsigned: anyone could have written it"). - fix(search): cross-chain redirection could shrink a REST page. Ranked search (the chain and its ancestors) and federated search cut each chain's page at `offset + limit` before redirecting hits to a replacement on another searched chain and removing duplicate ids, so thirty ancestor facts replaced by one branch thought left a page of one hit. The fetch now doubles until the page is full or the matches are exhausted, up to `max(16 * (offset + limit), 4096)` per chain (a page whose live matches lie beyond that comes back short). `query_federated` in the library still cuts each chain at `limit`. - perf(search): refilling a page after near-duplicate collapsing is incremental and bounded. Each refill pass used to re-materialize and re-tokenize the whole window and the window had no limit; with 20% identical matches, collapse 0.9 and limit 10 a search cost 7.8 ms at 20,000 thoughts and 32.5 ms at 100,000. The walk now resumes where it stopped, compares only new hits with the survivors, merges same-text hits without tokenizing them, reads ranks with a lazy partial sort and memoizes lineage lookups: 1.2 ms and 3.5 ms. The window is capped at `max(16 * limit, 4096)` ranked slots, so a page whose distinct matches lie beyond that comes back short (remaining limitation). - fix(search): REST paging repeated and skipped hits around contested thoughts. A contester stands in at its contested thought's score plus a bump, so page order was not score order, and the REST ranked and federated handlers (which fetch `offset + page`, re-sort by score and skip `offset`) moved contesters between windows: 30 contested decisions paged by 5 returned 60 hits, 44 distinct. Emitted totals are now non-increasing in page order. Chains without lineage or contests are unaffected. - fix(dashboard): the agent page's "Add Key" button never worked. It posted to the agent keys API, which needs a registration timestamp and a proof of possession that a pasted public key cannot give, so every click failed. It now registers through the operator route `agent key add` uses (`register_key`; the PIN session vouches for the key), and takes 64 hex characters, `0x` hex or 32 comma-separated bytes. On a dashboard with no PIN the registration is refused with the reason, as for every operator action; nothing is widened for a non-PIN session. - fix(security): `key generate --force` and `agent key generate --force` no longer follow a symbolic link at `--out`. The seed was written into, and the mode changed on, whatever the link pointed at. A symlink target is now refused (checked, and opened with `O_NOFOLLOW` on Unix); name the real file instead. - fix(cli): on Windows `key generate` and `agent key generate` no longer say the key file is "owner-only". Nothing sets an ACL there, so the file inherits the folder's permissions; the messages and help now say so and ask the user to restrict the folder. Unix output is unchanged (0600). - fix(dashboard): the generated key's download revokes its Blob URL after 10 seconds, not right after the click. Some browsers begin reading the blob after the click handler returns, so the file could be empty while the page invited the user to tick "saved". - feat(dashboard): "Generate key pair" on the agent page's Public Keys card. It takes a Key ID, generates the Ed25519 pair in the browser with WebCrypto, signs the registration proof there and registers only the public key through the agent keys API, so the private key never crosses the network or touches the server. Only after registration succeeded a modal shows the key once, as the 64-hex seed `--private-key-file` reads, with a "Download key file" button (`-.key`, Blob URL revoked right after), a "Copy" button and an "I have saved this key" box that must be ticked before Escape, the backdrop or the Close button can dismiss it; the modal also tells the user to `chmod 600` the downloaded file; closing removes the key from the DOM. A browser without WebCrypto Ed25519 is pointed at `mentisdb agent key generate`; there is no server-side fallback. The JavaScript helpers are tested under node against the Rust payload, proof and seed derivation, and the body is posted to the real endpoint. - feat(cli): `mentisdb agent key generate --key-id ID --chain KEY [--out FILE] [--force]` creates an Ed25519 key pair, saves the private seed to an owner-only (0600) file and registers the public key, in one operator command (PIN or `--offline`, same flags and catalog as `agent key add`). The private key is never printed, logged or sent; the order is generate, refuse a taken key id, write the file (refusing to overwrite without `--force`), register, print. A wrong PIN, an unreachable daemon or a taken key id is found before anything is written; a registration that fails after the file was written keeps the file and prints the `agent key add ... --public-key-hex` command that registers it later. `--json` carries the public key, key id, agent, chain and file path, never the seed. `key generate` and `agent key add` point at it. - feat(mcp): lean output for agents. The streamable-HTTP MCP surface (JSON-RPC `tools/call`) returns minified JSON text and no second `structuredContent` copy (the MCP library pretty-printed the object and repeated it); `POST /tools/execute` and REST are unchanged. `mentisdb_ranked_search`, `_federated_search`, `_lexical_search` and `_context_bundles` are compact by default over MCP (`compact: false` opts out; REST defaults stay `false`) and a lean thought leaves out defaults: no `provenance` for a public unsigned thought (private segment, signature and `verified_agent` are still listed), no `role: Memory`, no `importance: 0.5`, no `chain_key` for the searched chain, rounded floats, `successor_of` reduced to the immediate predecessor plus a `superseded_versions` count, and the relation it names not repeated. Version status, successors and a verified writer are kept. `mentisdb_standing_context` returns the rendered `prompt` once; `entries` (a second copy of the same memories) needs `include_entries: true`. On a generated 3,500-thought chain a 10-hit ranked search went from 23,657 to 5,948 characters and standing context from 36,191 to 13,050. `cargo run --release --example token_diet` reproduces the numbers; the rules are in the `mentisdb::server_lean` rustdoc. - fix(search): superseded versions starved live results. `MentisDb::query_ranked` (ranked, lexical and federated search, and the seeds of context bundles) ranked a fixed window of `2 * limit` thoughts that included superseded ones, then collapsed them into their live successor, so one decision rewritten 30 times filled the window and a `limit = 5` search returned a single hit while `total` counted 21. Only live memories now compete for the page: every match is scored once, superseded ones nominate their live successor, and the walk stops when the page holds `limit` distinct live memories. `total` still counts live matches. Near-duplicate collapsing refills its page the same way instead of guessing a window. 0.12.0.57 NOV/04/2026 - feat(server): the minimum request-body rate is configurable. `MENTISDB_MIN_BODY_BYTES_PER_SEC` (default 65536; `0` switches the rule off; validated at startup like the other body limits) and `MentisDbServiceConfig::with_min_body_bytes_per_sec`. The fixed 64 KiB/s rejected imports over slow links, and a busy server that polls a body late could look slow too. - security(server): the minimum transfer rate could be pre-paid. It compared the whole body's byte count with the time past the grace period, so a client that sent 63 MiB at once could then trickle for about 16 minutes while holding a 64 MiB reservation. The rate is now judged per window (one idle timeout long, from the end of the grace period), each window on its own bytes, so credit cannot be banked: the trickle fails with `408` at the end of the first window. - fix(server): a request body cut off by the body limits (stalled, too slow, or over the in-flight budget) is `408` or `503` with `Retry-After` on every route, also with bearer-token access off. Handlers' own JSON extractors used to turn it into a generic `400`; the admission layer now replaces a client-error response with the real cause when it was the one that stopped the body. - security(server): a body could hold the large pool indefinitely by declaring 64 MiB and sending a byte every 29 s: the idle timer restarts on every chunk and large bodies had no total deadline. Every body (large ones too) must now average at least 64 KiB/s (`MIN_BODY_BYTES_PER_SEC`) once its grace period (twice the idle timeout, 60 s by default) is over, otherwise it fails with `408`. A genuinely slower link than 64 KiB/s (about 0.5 Mbit/s) cannot upload a body for longer than the grace period. - security(server): anonymous request bodies no longer share a pool with authenticated traffic. Bodies from a caller with no valid token (bearer-token access on) draw on a 16 MiB pool of their own (8 MiB per peer), so slow anonymous peers can never push legitimate small requests into `503`; the small pool is 64 MiB with a 32 MiB share per peer, so with bearer access off one peer cannot take all of it either. The per-peer bookkeeping now holds only peers with something charged and removes an entry as soon as its counters reach zero (it grew without bound under IPv6 address rotation, and kept entries for refused charges). - security(server): the in-flight body budget could starve normal traffic. Large imports and ordinary requests now draw on separate pools: only the three import routes (from a caller allowed the large cap) use the large pool, reserved from their declared length, with a per-peer share (2x the cap) and at most four large bodies per peer; every other request is charged only for the bytes that actually arrive, from a fixed 64 MiB pool with no per-peer limit (on a loopback bind every local agent is one peer), and an anonymous peer (bearer on, no valid token) may hold 8 MiB of it. A declared length costs nothing by itself, a reservation is returned as soon as the body has been read, and small and anonymous bodies get a total deadline of twice the idle timeout so one-byte-per-chunk drips cannot hold a charge. A stalled body is `408` and an exhausted budget `503` with `Retry-After` even through the bearer middleware (both were a generic `400`). `with_max_inflight_body_bytes` (and the env var) below one maximum body is raised to it instead of refusing every import. MCP bodies stay capped at 2 MiB: a large import goes through the REST import routes. - security(server): an anonymous peer could make a bearer-protected daemon buffer, and JSON-parse, a request body of up to 64 MiB before the token was checked, and many peers could multiply that. Introduced by the large-body change in this cycle; not in 0.11.0.56. Body admission is now decided before any body is read, by one outermost layer (`server_body`): the token is checked from the headers first, and a request with no valid token is refused (`401`) without a byte of its body being pulled; only the import routes (`/v1/import-markdown`, `/v1/skills/upload`, `/v1/extract-memories`) take more than 2 MiB, and only up to `MENTISDB_MAX_BODY_BYTES` from an authenticated caller (every other route, and any caller without a valid token, is held to 2 MiB: `413`). The body bytes held by requests in flight are budgeted (`MENTISDB_MAX_INFLIGHT_BODY_BYTES`, default 4x the cap, and a per-peer share of 2x the cap): beyond it `503` with `Retry-After`. A body that stops arriving fails after `MENTISDB_BODY_IDLE_TIMEOUT_SECS` (default 30). The cap also holds for a body with no declared length (chunked, HTTP/2), including a digest-checked one. A read proof is verified per chain and the chain is named in the body, so a proof from an unregistered key cannot be told from a real one before the body is read; proof requests are bounded by the budgets above instead of a smaller cap. - security(server): `MENTISDB_MAX_BODY_BYTES` must be a whole number from 1048576 to 1073741824; the daemon refuses to start on anything else (and on a bad `MENTISDB_MAX_INFLIGHT_BODY_BYTES` or `MENTISDB_BODY_IDLE_TIMEOUT_SECS`) instead of silently using 64 MiB. - security(pymentisdb): requests carrying a read proof never follow redirects (`allow_redirects=False`; a redirect is an error), as the CLI already did. - BREAKING (public API; with the 0.12.0 change below): `MentisDbServiceConfig` is `#[non_exhaustive]`, so it can no longer be built with a struct literal; use `MentisDbServiceConfig::new(..)` and the `with_*` builders (`with_max_body_bytes`, `with_max_inflight_body_bytes`, `with_body_idle_timeout`). The fields stay readable and assignable; the body cap is clamped to 1 MiB..1 GiB wherever it is used. - docs(cli): `mentisdb --help` no longer lists "Supported agents (setup/wizard)". MentisDB works with any agent that can reach it over MCP (HTTP or stdio), REST or the CLI, and the help now says so. The agents `mentisdb setup` can write a config for are listed only in `mentisdb setup --help`, as the targets it knows. The daemon's first-run notice says the same. - BREAKING (public API; the next crate version must be 0.12.0, not 0.11.x). Every signature change, because `cargo-semver-checks` does not see field and parameter type changes (run against 0.11.0 it reports only the private field in the third item; `UnwindSafe` is kept): * `VectorSidecarEntry::vector` is a `VectorRow` (a handle into a flat store that dereferences to `&[f32]`), not a `Vec`. Use `.to_vec()` where a `Vec` is needed, `VectorRow::standalone(&values)` to make one. * `VectorSidecarEntry::new` takes `impl Into` for the vector, not `Vec`: `Vec` and `&[f32]` still convert, but an argument whose type is only inferred (for example a bare `.collect()`) no longer compiles; annotate it. * `VectorSidecar` has a new private field, so it can no longer be built with a struct literal; use `VectorSidecar::build`. * New public API: `search::flat_store` (`VectorStore`, `VectorRow`, `dot`, `DOT_EPSILON`), `VectorIndex::{from_rows, upsert_row}`, `VectorSearchBackend::upsert_row` (provided, so implementors keep compiling), `HnswBackend::{from_rows, share_cached_rows}`. * Behaviour: exact-search scores equal the old sequential cosine within `1e-5` (float reassociation), so documents whose scores differed by less than that may swap rank. Sidecar files, their integrity digest and persisted HNSW graphs are byte-identical and load unchanged. perf(search): exact vector search runs over a flat, aligned store with a lane-parallel dot product (portable safe Rust that the compiler turns into NEON on aarch64 and SSE2 on x86_64; no nightly, no runtime probing; same bits on every platform): measured with `benches/exact_search.rs`: `VectorIndex::search`, top 10, one thread, 384 dimensions, p50 per query, background priority, baseline-new-baseline. 100 000 vectors: 65.6 / 64.2 ms before, 14.2 ms after (15.5 to 71.7 queries per second); 20 000 vectors: 11.5 / 12.3 ms before, 2.7 ms after (80 to 366 queries per second). Full LoCoMo and LongMemEval recall is identical on all five protocol runs (LoCoMo R@10 76.7 / 76.9 %, R@5 67.9 %, LongMemEval R@5 70.2 / 69.8 %; the LoCoMo result file is byte-identical). perf(storage): every vector exists once in memory. The sidecar entries, the exact index, the HNSW graph (items and exact-vector cache) and the implicit-edge scanner hold handles to the same 128-row, 64-byte-aligned chunks instead of copies; a snapshot still clones only `entries / 128` chunk pointers. An HNSW graph loaded from disk keeps the graph's own copy (the `hnsw` crate owns its items); only its cache is re-pointed. Exact live heap of the whole `embed_commit_latency` process (counting allocator, `compaction` scenario, 100 000 thoughts x 384, exact backend, background priority) against the build before: 475.2 to 332.4 MiB after the fixture (-142.8 MiB, the exact index's copy of the corpus) and 531.5 to 369.5 MiB after 12 700 appends (-162.0 MiB). This stacks on the earlier entry's 239.2 to 56.3 MiB, which is heap growth over the append phase (the scan store's copy). A rebuild now packs rows as it embeds, so the corpus is not held loose and packed at once. - fix(search): the exact index no longer grows without bound under churn: a removed document's slot is reused, and once replaced or removed rows in the index's own store outnumber the live ones (beyond 256) the live rows are copied to a fresh store. `flat_store::dot` asserts equal row lengths in debug builds. Documented: exact search (lane-parallel dot) and the HNSW / implicit-edge paths (sequential cosine) can score one pair up to 1e-5 apart. - perf(storage): the implicit-edge queue holds positions, not vectors, so it cannot grow without bound in memory. A backlog costs a few bytes per run of consecutive appends; it never blocks an append and never drops an edge (the overlay just trails the chain). The sustainable append rate is the scan throughput: about 155 appends per second at 100 000 thoughts and 720 per second at 20 000 (4 threads, 384 dimensions, a shared machine); while appends outrun it the backlog grows and edges for recent thoughts appear late, and it drains when they slow down (12 475 queued at 100 000 drained in 80 s). - feat(server): `GET /v1/chains` (and the MCP chain listing) reports `derived_backlog` per open chain: `embeddings_in_flight`, `embeddings_parked`, `embeddings_missing` and `implicit_edges`, all zero when healthy; zero for a chain that is not open or whose private segments are hidden from the caller. Library: `MentisDb::derived_backlog` and `DerivedBacklog`. - feat(server): large request bodies. The 1 MiB ceiling is gone for clients that opt in. A read proof that also sends `X-Mentis-Content-Sha256` (the SHA-256 it already signs) is verified before the body is read, and the body is hashed as it streams: the signed body goes through, any other body fails at its end with `400` and no handler has run, so memory use no longer depends on its size. A proof without the header behaves exactly as before, limited to 1 MiB, and its `413` now says how to send more. The bearer-token authorization step buffered at most 1 MiB as well and answered `413` beyond it; both now share one overall cap, `MENTISDB_MAX_BODY_BYTES` (default 64 MiB, never below 1 MiB), also `MentisDbServiceConfig::with_max_body_bytes`. Over it, `413`. The bearer path still buffers the body (it reads `chain_key` from it) up to the cap. - feat(pymentisdb): pymentisdb 0.10.1. Every read proof is sent with `X-Mentis-Content-Sha256` (the digest the proof signs), so a body over 1 MiB is accepted by a daemon that supports it; older daemons ignore the header. New `ReadSigner.content_digest` and `read_auth.CONTENT_DIGEST_HEADER`. - docs(limits): README, `docs/CHAIN_ACCESS.md`, `mentisdb --help`, ROADMAP and docs.mentisdb.com drop the "1 MiB, import in batches" limitation: new "Large request bodies" section, `MENTISDB_MAX_BODY_BYTES` in the env table, the `413` row corrected. The CLI (`memory import` and every other command with a read key) and pymentisdb send `X-Mentis-Content-Sha256` with every proof. - feat(auth): the proof format is unchanged (old clients, mentischat and pymentisdb verify as before); `read_auth::{body_digest, parse_content_digest, verify_request_for_digest, CONTENT_DIGEST_HEADER}` and a `content_digest` fuzz target are new. 0.11.0.56 NOV/02/2026 - security(host): REST on a loopback bind now checks `Host` for every request, not only browser-flagged ones, matching what `cloudllm_mcp` 0.4 does for MCP. A `curl`, CLI or agent request that names a foreign `Host` (and, on the plain HTTP listener, the `my.mentisdb.com` alias unless it is allowlisted) gets `403` with the dashboard's message; loopback names, `MENTISDB_BIND_HOST`, `MENTISDB_DASHBOARD_ALLOWED_HOSTS` and, on the HTTPS REST listener, the alias are accepted; a request with no `Host` passes. Wildcard and LAN binds are unchanged (browser guard only). New `server::rest_router_on` (the standalone servers use it); `rest_router` is unchanged for embedders. Upgrade note, behavior change for nginx/Caddy-fronted loopback daemons: add the public name the proxy forwards as `Host` to `MENTISDB_DASHBOARD_ALLOWED_HOSTS` (or send `Host: 127.0.0.1:9472` upstream), or proxied REST calls answer 403. - security(tls): expired or expiring TLS certificates are no longer silent. The generator already dated certificates relative to the moment of generation (one day before to two years after; the docs and the rcgen example still said 2025-01-01 to 2027-01-01, which made it look like every installation expired in January 2027, and are corrected), but nothing ever looked at an existing certificate again: one made two years ago just started failing HTTPS clients. At startup the daemon now reads the certificate it is about to serve: expired and generated by MentisDB (Common Name `MentisDB Local`) means it is regenerated with the same SANs and a new key pair, with a warning that clients must trust the new certificate; expiring within 30 days means a warning that names `mentisdb cert --force` (log and the terminal UI's TLS pane); an expired certificate you supplied yourself is only warned about. New API: `server::tls_cert_validity`, `tls_cert_expiry_warning`, `TlsCertValidity`, `TLS_CERT_WARN_DAYS`. - security(dashboard): the PIN brute-force limiter no longer has the three holes the review found. It was per full IP address, so an IPv6 attacker rotating addresses inside their `/64` never reached it: clients are now keyed per `/64` (IPv4-mapped addresses count as IPv4). Only expired entries were ever evicted, so many source addresses inside one window grew the table without bound: it is capped at 4096 clients and the oldest makes room. And nothing bounded an attacker using many addresses: more than 50 failures from all clients together in 5 minutes now lock every PIN attempt (correct ones too, so a correct guess is indistinguishable) for 60 s, doubling per repeat up to 1 h and forgiven after two quiet hours. The login form and the `Authorization: Bearer ` path share it, and `429` carries `Retry-After`. Residual trade-off, documented: an attacker can make the owner wait (a signed-in session is unaffected), and behind a NAT or reverse proxy all clients share one bucket. README now recommends a long random PIN (12+ characters) for any dashboard reachable beyond localhost. - security(keys): `mentisdb key generate` without `--out` printed the private seed on standard output, where it lands in terminal scrollback, shell logs and the context of any AI agent that runs the command. It now always saves the seed to an owner-only (`0600`) file (`--out FILE`, else `$MENTISDB_KEY_DIR`, default `~/.mentisdb/keys/.key`, directory `0700`) and prints only the public key and the path; `--force` makes an existing file `0600` before the new seed is written (it used to keep a looser mode). Seeds (the CLI's and the operator key's) now come straight from the operating system's CSPRNG (`getrandom`, already in the tree) instead of a SHA-256 over UUIDs and the clock. Loading a seed file that group or other users can read (`--private-key-file`, `--read-key-file`, `MENTISDB_READ_KEY_FILE`, the operator key) still works but warns on stderr with the `chmod 600` fix (`mentisdb::signing::seed_file_mode_warning`); MentisDB never changes the mode of a file it did not create. Upgrade note: scripts that parsed `private_key_seed_hex:` from `key generate` must pass `--out` (the seed is read from that file). - security(access): a write that points into a private segment is no longer an oracle for which indices and ids are private. An unsigned (or not read-authorized) writer who linked a thought to a private index or id got a specific "links to a private segment" refusal, while a missing target got a different one. Over REST and MCP the refusal is now the same generic "did not accept the write" as every other probe-sensitive refusal (`AccessError::PrivateTarget` joins `is_probe_sensitive`), and for such a writer on a chain with private segments a target that does not exist fails exactly like a private one (the check now runs before the range check). Writers who may read the private segments, chains without private segments, and in-process library callers are unaffected. - security(list): `GET /v1/chains` (and the MCP list tool) no longer leaks private-chain totals or paths. A chain the registry flags as private that could not be opened (the error was swallowed with `let _ =`) was listed with the registry's stored thought and agent counts, which include private thoughts, and its absolute storage path. It is now listed with only its public thought count, no agents and an empty path, and the failed open is logged at warn level. Finalizing a storage migration wrote `has_private: false` and the whole thought count as the public count, so a private chain was listed unmasked until something opened it; it now keeps the registry's flag, and a chain the registry has never seen is assumed private until its first open writes the real value. - security(dashboard): destructive and administrative routes now follow the private-chain PIN rule. `DELETE /dashboard/api/chains/{key}` never opened the chain, so a dashboard with no PIN would delete a private chain that every other route refuses to show; it now answers `403`. With no PIN, and while the daemon holds any private chain (an open chain or a registry entry flagged `has_private`), settings writes, bearer-token creation, revocation and deletion, and daemon restart answer `403` too, so a visitor who can reach the port cannot weaken the daemon that guards private data. A daemon without private chains, or with a PIN, behaves as before. Upgrade note: an operator who keeps private chains and runs the dashboard without a PIN must set `MENTISDB_DASHBOARD_PIN` to use those routes. - security(ci): release workflow least privilege and pinned third-party actions. `build.yml` gave `contents: write` to the build jobs, which also run on pull requests; every job is now read-only and a new `release` job (tag pushes only, after all seven builds succeeded) is the only one that can write, downloading the seven binaries from the build artifacts and attaching them with `softprops/action-gh-release`. `test.yml` and `clippy.yml` get an explicit `contents: read`. Third-party actions (`softprops/action-gh-release`, `pypa/gh-action-pypi-publish`, `dtolnay/rust-toolchain`) are pinned to full commit SHAs with a version comment (the toolchain is now chosen with the `toolchain:` input); `actions/*` and `docker/*` keep version tags. `.dockerignore` now also excludes `*.mentis`, `*.mbak`, `*.tcbin`, `*.bak`, `*~`, `.env~`, `results/`, `promo/`, `operator/`, `tls/`, the registry, webhook and skill files and `*.p12`/`*.pfx`, so a data directory or backup lying in the working tree cannot enter an image. - security(mcp): the event stream (`GET /`, action `events/subscribe`) is global-token only. It reports every tool call on every chain (tool name, chain key, outcome), but was authorized for any active token, so a token scoped to one chain could learn which other chains exist and when they are used. The authorization table for MCP methods now fails closed: a method it does not name needs a global token (`initialize`, `ping`, `tools/list`, `resources/list`, `resources/read`, `notifications/*`, the discovery probes `prompts/list` and `resources/templates/list` (answered "method not found" as before) and `tools/call` keep working for scoped tokens as before); a comment that called the `_` arm safe is replaced by the rule. The `tool_called` event no longer forwards the client's raw `chain_key` JSON (any type, any size): it carries the validated, trimmed chain key string or `null`, and only a tool-shaped tool name (else `unknown`). Upgrade note: a dashboard or monitor that subscribes with a chain-scoped token must use a global one. - security(cli): the CLI and the stdio MCP proxy no longer follow HTTP redirects. ureq re-sends custom headers to a redirect target, so a daemon address that answered `3xx` (misconfigured proxy, hostile `--url`) received the read proof (`X-Mentis-Auth`) and, on the daemon-flush call, the bearer token. A `3xx` is now an error naming the target ("point --url at the final address"); the dashboard's login redirect still reports "asked for a login". The read-proof preimage and wire format are unchanged (mentischat interop). - security(files): MentisDB data is no longer created world-readable under a default umask. Directories MentisDB creates (the data directory, migration backups, restore staging) are `0700`; chain files (binary and JSONL), registries, agent and entity-type registries, vector sidecars and WAL, graph and implicit-edge files, the skill registry, the webhook registry (it holds signing secrets), migration stamps, journals and staged files are created `0600`; backup archives are `0600` with every zip entry `0600`, and restored files are `0600` (Unix; no-ops elsewhere). Existing files and directories are never chmod'ed silently, except files MentisDB itself rewrites (temp file plus rename, so they become `0600`) and a backup archive it overwrites. A daemon whose existing data directory is group- or world-accessible logs a warning with the `chmod 700` fix (`mentisdb::paths::data_dir_mode_warning`). Backups still exclude `operator/operator.key` (owner decision): `backup` and `restore` now print a reminder to back it up separately, and the CLI help, README and docs/CHAIN_ACCESS.md say so. Upgrade note: existing directories keep their mode; run `chmod 700 ` and `chmod 600` on the files you want private. - security(docker): the daemon now says so when it is reachable from other machines without full authentication. The Docker image binds `0.0.0.0` (needed for published ports) with bearer tokens and the dashboard PIN off, and nothing warned about it. Whenever an MCP/REST listener is bound to a non-loopback address while `MENTISDB_BEARER_TOKEN_ACCESS` is off, or the dashboard is on a non-loopback address with no `MENTISDB_DASHBOARD_PIN`, startup logs a `SECURITY:` warning (log and stderr, so `docker logs` shows it), the terminal UI lists it under Endpoints, and the dashboard shows a red banner (`GET /dashboard/api/version` carries `warnings`). New library API: `MentisDbServerConfig::network_exposed` and `exposure_warnings`. The daemon still starts, so existing Docker deployments keep running. README documents publishing the ports on loopback (`-p 127.0.0.1:9471:9471`) and the Dockerfile comment points at the warning. - security(host): `my.mentisdb.com` is no longer a permanent DNS-rebinding trust anchor. It is a public DNS name MentisDB does not control; whoever controls it (a lapsed domain, a compromised registrar account) could serve a page and rebind the name to `127.0.0.1`, passing every `Host`, `Origin` and CSRF guard of a plain-HTTP listener. The alias is now accepted as `Host` and `Origin` on TLS listeners only (HTTPS MCP, HTTPS REST, dashboard: it is the name their certificate carries). The plain HTTP MCP and REST ports answer `403` to it unless the operator lists it in `MENTISDB_DASHBOARD_ALLOWED_HOSTS`. Upgrade note: switch any `http://my.mentisdb.com:9471` / `:9472` client to the `https://` URL (9473/9474/9475) or to `http://localhost:9471`, or list the alias to keep the old behaviour. The startup endpoint list no longer prints an `http://my.mentisdb.com` URL. Docs say to enable the registrar lock and DNSSEC for the name and to keep bearer tokens and the dashboard PIN on. Listeners mark requests with the new public `ListenerTls` extension; a request without it is judged as plain HTTP. - security(read-auth): a flood of self-signed read proofs could lock every honest reader out of private chains. A proof verifies against the key written in its own header, so any fresh keypair made a valid one, and each was written into the 100 000-entry replay cache before any authorization; once full, every genuine proof was refused with `503`, and behind one NAT those refusals also exhausted the shared invalid-proof budget (`429`). The nonce is now spent only when a proof is about to grant access to a private segment (once per request), so a key no chain authorizes, or a request that touches no private chain, never reaches the cache. The cache is also capped per key (25 000 of 100 000) and drops expired entries from an ordered queue instead of rescanning on every refusal. Behavior change: a proof refused by a full cache, or one that loses a race for its nonce, now reads the public view (as documented) instead of `503`; malformed, stale, badly signed and already-spent proofs still get `401`. Spent nonces are looked up without being recorded, so the check costs unauthorized keys nothing. - security(standing): stored text could forge the standing-context block loaded at session start. Content and agent labels were concatenated raw, so a thought containing line breaks could close the `=== STANDING CONTEXT ===` block early, add a `SYSTEM:` line and print a fake `[#n] Constraint/...` entry, ranked first by a writer-supplied importance of 1.0. Every rendered entry is now a single line: line breaks, control and invisible characters (bidi overrides, zero-width, tag characters) in content, agent ids, display names, owners, tags and concepts are replaced by visible marks and `===` / `[#` are broken up (new `mentisdb::prompt_text`). The same escaping covers `to_catchup_prompt`, `to_bootstrap_prompt` and the `MEMORY.md` export. Each standing entry now shows `trust=verified|unsigned|unverified` (new `mentisdb::provenance`, `MentisDb::trust_of`, `StandingEntry.trust`) and the block opens with a line saying its entries are data, not instructions. On a chain that requires signatures, an entry that is not verified ranks with importance capped at `UNVERIFIED_IMPORTANCE_CAP` (0.5); on an open chain importance is used as written (documented). Entry lines changed shape: `(agent, date, trust=...)`. - security(lineage): any writer could Supersede, Correct or Invalidate anyone's thought and the replacement took its slot in ranked search and standing context, and a plain reference from a Decision or Correction promoted the writer's thought as "contested". On a chain with a signing policy a strong link now replaces its target only when its writer's thought was verified when the chain opened and is by the same agent or by a key authorized on the chain; any other link only contests (`version_status: contested`, listed under `successors` with `authorized: false`, not redirected to or promoted). On an open chain redirection is unchanged on purpose (corrections from another agent are the point of the valid-version fix), but it is now visible: `SuccessorNote` gained `agent_id`, `trust`, `cross_agent` and `authorized`, `VersionInfo` and hit JSON gained `cross_agent`, standing entries gained `replaces` and `cross_agent` and print `[REPLACES #n ... replaced by another agent, check it]`, and the operating skill tells agents to check them. A write that would make a chain of more than `MAX_LINEAGE_DEPTH` (64) versions of one thought is refused (reads follow supersessions only that far). - fix(server): federated search, and branch search with ancestors, could deadlock both chains. Resolving cross-chain lineage held a read lock on every searched chain while waiting for the next, in the caller's order; two searches over the same chains in opposite order, each with a writer queued behind it (tokio's lock is write-preferring), blocked each other and every later reader and writer of those chains until restart. It now reads one chain at a time and never holds two. Every other multi-chain path in the crate was audited and already did. New `lineage::cross_chain_lineage_on` is the per-chain half of `cross_chain_successor` and `CrossLineage::merge` combines them. - security(lineage): cross-chain and branch lineage now obey the rules single-chain lineage got in the same release. A replacement written on another searched chain was redirected to whoever wrote it, even on a governed chain, and carried none of the new fields. It now uses the same note builder and the same authorization (`MentisDb::strong_link_is_authorized_for_agent`): on an open chain it still redirects and the hit, `current_version` and `successors` carry `agent_id`, `trust`, `cross_agent`, `authorized` and the `chain_key` it lives on; on a governed chain a writer who is neither the target's agent nor an authorized key only contests (target stays current, `version_status: contested`, the link listed with `authorized: false`, nothing redirected). `cross_chain_successor` gained a `target_agent` argument. - fix(server): a failed sidecar/overlay flush after a stored thought no longer turns the append into a `500`. The thought was already durable, so clients that retried errors wrote it twice. The failure is logged and the queued writes are retried on the next append. - fix(migration): restarting the daemon no longer pushes a chain toward quarantine. Every start counted as an attempt and three interruptions of any kind quarantined the chain, so three ordinary restarts (`SIGTERM`, `systemctl restart`, quitting the TUI) during a long migration locked the chain out until an operator ran `migrate retry`. The signal and quit paths now call `MigrationManager::shutdown`, which halts the migration in flight at its next record and hands its attempt back (new `run_chain_migration_cancellable`, `MigrationOutcome::Interrupted`, `MigrationError::Interrupted`, `MigrationManager::wait_stopped`); the daemon waits up to 15 s for it. Only a crash (`kill -9`, out of memory, power loss) still counts, so a chain that crash-loops the daemon is still quarantined after three attempts. Verified on the real daemon: four `SIGTERM`s in the middle of a 1.5M-thought migration left the attempt count at 0 and the fifth start migrated it. - fix(migration): the recovery command in the quarantine, skip and rollback messages did not work. The 503 body clients see, the crash-loop error, `migrate run` and `migrate status` said `mentisdb migrate retry `, which the CLI rejects (`unknown flag`): it only takes `--chain `. All say `mentisdb migrate retry --chain ` now, and a test parses every command those messages suggest with the real CLI parser so they cannot drift apart. - fix(migration): a huge day count could delete every migration backup. `mentisdb migrate purge-backups --older-than-days N` and `MENTISDB_MIGRATION_BACKUP_RETENTION_DAYS` computed `N * 86_400` unchecked: a debug build panicked, and a release build wrapped (to zero seconds for N = 2^57), which treated every backup, however fresh, as expired. The conversion now saturates, so an absurdly long retention keeps everything. - fix(search): `total` of a ranked search on a chain with superseded thoughts counted the superseded ones. The lineage-resolving pass ranks them so their successors can take their place, and its candidate count leaked into REST `total` and the library's `total_candidates`: one more than the live matches per superseded thought, and more than the page could ever show. The total now excludes thoughts a default query would hide; audit mode (`include_invalidated`) still counts them. - fix(migration): `migrate retry` through a running daemon no longer opens a window in which the chain is served. The manager removed the old status and only then recorded the new one, so a request landing in between got `None` from the migration gate and read a chain that was about to be rewritten. The swap is now one step. - fix(server): caller-sized numbers can no longer make a search or a standing context cost minutes. `offset + limit` above 10,000 on `ranked-search`, `lexical-search`, `federated-search` and `context-bundles` (REST, MCP and the CLI) is now refused with `400` and a message naming the maximum (`server::MAX_RESULT_WINDOW`); it is not clamped, since a clamped page would be the wrong page. To read deeper, narrow the query with filters or `since`/`until`. A standing-context `per_type_limit` above 100 is refused the same way (`standing::MAX_STANDING_PER_TYPE_CAP`). CLI help and the MCP tool schemas state the limits. Release note: a client that asked for a window above 10,000 now gets a `400` instead of a very slow answer. - perf(search): near-duplicate collapsing no longer compares every hit with every survivor. It interns tokens and finds candidates through a prefix-filtered inverted index (rarest tokens first), then checks them exactly, so results are identical (a differential test against the pairwise scan covers every threshold) while a 1,000-hit window over a 3,000-hit pool drops from 322 ms to 5 ms and a 2,000-hit window from 829 ms to 8 ms (new `search_ranked_collapse` bench). - perf(standing): `standing_context` only tokenizes and compares each group's best `per_type_cap x 16` thoughts (never fewer than 1,024) instead of every standing-type thought on each call, and skips pairs whose token-set sizes cannot reach the duplicate threshold. A restatement ranked far below the window is no longer counted in `duplicates_collapsed`. - build: Cargo.toml now declares `rust-version = "1.90"`, the real floor of the locked dependency set (roaring needs 1.90, uuid 1.89); a new `msrv` CI job checks all features and no default features on 1.90. - security(mcp): `cloudllm_mcp` 0.4.0. The library now rejects every `Host` that is not `localhost`, `127.0.0.1` or `[::1]` on a loopback bind (DNS rebinding, for every client, not only browsers), authenticates the `GET /` event stream, caps and sanitizes what it sends, and fixes the other 0.3.6 holes itself. Left alone, that upgrade would have made a loopback daemon answer `403` to `my.mentisdb.com` and to a VPS reached through `MENTISDB_DASHBOARD_ALLOWED_HOSTS`. MentisDB now has one host policy (`HostPolicy`): the dashboard, the REST and MCP browser guard and the allowlist handed to the library are all derived from it (`localhost`, `127.0.0.1`, `[::1]`, `my.mentisdb.com`, `MENTISDB_BIND_HOST`, `MENTISDB_DASHBOARD_ALLOWED_HOSTS`, interface IPs for a wildcard `MENTISDB_BIND_HOST`). Streamable HTTP, the legacy `/tools/*` and `/resources/*` routes and the event stream refuse any other `Host` with `403` on a loopback bind. Wildcard binds (Docker, LAN) keep doing no `Host` check for programmatic clients; browsers are still checked by the browser guard. The library's loopback-only `Origin` check is switched off (it refused `https://my.mentisdb.com` although the host is allowed); the guard compares the `Origin` host against the same policy. Set `MENTISDB_DASHBOARD_ALLOWED_HOSTS` before the daemon starts: the MCP list is read when the routers are built. IPv6 entries match in canonical form. - refactor(mcp): deleted the workarounds for the 0.3.6 holes now that the library closes them: MentisDB's own `GET /` route (`SseGate`, `sse_events_middleware`, which existed because the library's stream was unauthenticated) and the `RedactingEventHandler` that stripped tool arguments (the library's default `SsePayloadMode::Minimal` removes arguments, results and error text). `GET /` is the library's stream: same `Host`, bearer (action `events/subscribe`, any active token) and `Origin` checks as `POST /`, CR/LF stripped from event fields, a lagging subscriber is told how many events it missed. The stream now also carries the library's metadata-only events per JSON-RPC method (method, client address, outcome) next to MentisDB's `tool_called` events. Kept: MentisDB's exact-host `Origin` guard (it follows the host policy), and `tool_called`. - feat(mcp): the library's 401 body no longer names MentisDB's environment variable or CLI. MentisDB puts its guidance back on every MCP 401 (streamable HTTP, legacy routes, event stream): `MENTISDB_BEARER_TOKEN_ACCESS=false` and `mentisdb bearertoken create`. - build(deps): `cloudllm_mcp` 0.4.0 and `openai-rust2` 2.0 (reqwest 0.13, shared with MentisDB's own reqwest). The tree no longer builds reqwest 0.12 except for fastembed's `hf-hub`. `ResourceMetadata` gained `name`/`title` and writes `mimeType`; `mentisdb://skill/core` lists with a name and `mimeType: text/markdown` on `resources/list` and `POST /resources/list`. - test(mcp): regression tests for the host policy (`tests/mcp_host_policy_tests.rs`: alias, allowlisted names and public IPs, bind host, wildcard interface IPs, foreign hosts and look-alikes rejected on every MCP transport; `Origin`; REST; event-stream authentication; resource shape; 401 guidance), an agreement test between the dashboard decision and the library list, and a check that the legacy `/tools/execute` route leaks no arguments into the event stream. - fix(dashboard): the PIN login form, and every other dashboard POST from a browser, was rejected with "cross-origin request rejected". The dashboard sent `Referrer-Policy: no-referrer`, under which browsers send `Origin: null` on POST, and the CSRF guard read `null` as a foreign origin. The policy is now `same-origin` (links to other sites still get no referrer), and the guard treats `Origin: null` as absent and then accepts `Sec-Fetch-Site: same-origin`, which browsers set and pages cannot. A cross-site or sandboxed page still sends `Sec-Fetch-Site: cross-site` and is still refused. - fix(signing): a stored zero-length `thought_signature` is a placeholder, not a signature. Older clients sent an empty field and it was stored as `Some([])`, so `verify_signatures` reported each such thought as an invalid signature (43 of them in one real chain, which holds no signed thoughts at all). They now count as unsigned everywhere: verification, provenance, open-time checks, merge/copy blocking and audience. New writes normalize an empty signature to none (library and REST/MCP); empty hex is still a 400. Stored bytes are not rewritten, the hash covers them. New `Thought::signature_bytes`. - fix(storage): real chains written in March and April 2026 (the oldest chain of at least one installation: 365 records, then 160 more) stamp `schema_version = 4` on schema-3 records and hash them with that stored value; records appended afterwards have `entity_type` but not `source_episode`, a third schema-3 layout. Master 8cfebe2 refused the 4s as "newer than supported" and, like every earlier release, decoded the third layout as the base one, shifting its fields (the entity type was lost and the hashes came out empty, which accidentally triggered a silent rehash). Schema 4 is now an accepted alias (`MENTISDB_LEGACY_SCHEMA_V4_ALIAS`), the third layout has its own decoder, every layout must consume its whole payload, and both the loader and the migration engine verify alias records under the rule that produced them (stored schema, stored link) and the rest against the rebuilt chain, refusing anything that does not verify instead of rehashing it. Both real chains verify and migrate with identical content, head hash and entity types. Schema 4 is taken: the next thought schema must be 5; only values above 4 are refused as newer. - fix(daemon): a second daemon on a data directory that is already in use now refuses to start (it used to start without the directory lock and could append to the same chain files); the `--offline` operator commands rely on the same lock. The refusal names the holder's pid and the directory, and now also covers `restore` and the mutating `migrate` subcommands (run, retry, skip, rollback, purge-backups); `migrate status`, `verify` and `run --dry-run` stay read-only. The lock is an OS lock, so a killed daemon releases it. See docs/CHAIN_ACCESS.md "One writer per data directory". - fix(migration): chains from schemas 0 to 2 are now checked before their hashes are rebuilt: the old stored hash links must be intact (a removed, inserted or reordered record, or a broken link, is refused and the chain left untouched; an edit that keeps the stored hash is not detectable), and the report counts the links verified. A migration that rewrites hashes also removes the chain's signed `.verified.json` checkpoint, which is bound to the old hashes. - docs(storage): the durability table states what each setting survives (the buffered queue holds up to 128 records, not 15; the default does not fsync without MENTISDB_FSYNC=1). - feat(retrieval): cross-chain and branch lineage. A `Supersedes`, `Corrects` or `Invalidates` relation carrying a `chain_key` now applies wherever one read path sees both chains: server branch search (the branch plus its ancestors), server and library federated search. The superseded hit is replaced by the live successor on the other chain (`successor_of`, `successor_of_chain`), or annotated `superseded` with `current_version.chain_key` under `include_invalidated`. Only edges whose source the caller's audience may see count, so a public reader is never redirected to a private successor. `lineage::cross_chain_successor` is the library entry point. A chain read alone is unchanged. Weak (untyped) links are not applied across chains. - feat(retrieval): context bundles redirect seeds the same way as ranked search: a superseded seed becomes its live successor and a contested seed is preceded by the thought contesting it. - behavior change for programmatic callers: `RankedSearchQuery::new()` now defaults to relative vector fusion, near-duplicate collapse at Jaccard 0.9 for text queries, successor redirection and thesaurus expansion at 0.3, so result lists and `total_candidates` differ from earlier releases. Opt out per query with `with_vector_fusion(VectorFusion::Absolute)`, `with_collapse_duplicates(None)`, `with_resolve_successors(false)`, `with_thesaurus(false)`, per request with `vector_fusion: "absolute"`, `collapse_duplicates: 0`, `resolve_successors: false`, `synonym_weight: 0`, or process-wide with `MENTISDB_VECTOR_FUSION=absolute` and `MENTISDB_COLLAPSE_DUPLICATES=off`. - bench: full LoCoMo-10P and LongMemEval protocol run on these defaults (fresh ingest, fastembed-minilm): LoCoMo R@5/R@10/R@20 67.9/76.7/83.4, rerank 68.6/76.9/83.5; LongMemEval 69.8/75.6/81.4, rerank 70.2/75.8/82.0. See results/benchmarks/2026-11-01-full-protocol/. - feat(api): ranking knobs are reachable everywhere. REST, MCP and the CLI (`search`, `search federated`, `search bundles`) accept `resolve_successors`, `collapse_duplicates`, `vector_fusion`, `synonym_weight`, `df_scope` and `df_cutoffs.*` (flags `--resolve-successors`, `--collapse-duplicates`, `--vector-fusion`, `--synonym-weight`, `--df-scope`, `--df-cutoff-*`). Bad values are errors, not silent defaults. See docs/CLI_PARITY.md. - feat(search): ranked and federated search accept `compact: true` (MCP `mentisdb_ranked_search` / `mentisdb_federated_search`, REST `/v1/ranked-search` / `/v1/federated-search`, CLI `mentisdb search --compact` and `mentisdb search federated --compact`), contributed by Austin Faulkner-Pearce (PR #25). Each hit is returned as its `chain_key`, total `score` and the thought without `hash`, `prev_hash`, `thought_signature`, `signing_key_id`, `schema_version`, `agent_name`, `agent_owner` and top-level empty fields, in the same order as the full form; score components, `matched_terms` and `match_sources` are left out. The per-hit `provenance` (segment, signed, signature, verified_agent, trust), the version fields (`version_status`, `successors`, `current_version`, `successor_of`, `collapsed_duplicates`) and graph provenance are always kept, and the public/private boundary is applied before compaction, so a public reader still sees only the public segment. Fields are dropped by name, so relations, concepts, refs, content and any field added later are kept. On real chains the response was 23.7% smaller across 12 searches (34.2% on a generated corpus) with every relation, concept and graph link kept; `search_compact` benchmarks show no time cost. The default response is unchanged. The MCP tool schemas and the MentisDB skill served to agents (`MENTISDB_SKILL.md`) say when to pass it (routine recall) and when not (verifying hashes or signatures, auditing provenance, score debugging; `mentisdb_get_thought` returns the full record). `compact_thought_json` filters in place instead of rebuilding each thought map. New `tests/server_compact_trust_tests.rs` pins provenance, successor and contested fields, collapsed duplicates and the private-segment boundary over REST and MCP. - change(search): library and server now share the thesaurus default. The library used to apply no expansion at synonym weight 0.7 while the server expanded at 0.3. `RankedSearchQuery::new()` now expands with the built-in thesaurus at 0.3 (`with_thesaurus(false)` or `synonym_weight` 0 turns it off; the `lexical-search` endpoint stays literal). LoCoMo R@10 / LongMemEval R@5: no expansion 75.3 / 69.6, weight 0.3 75.2 / 70.0, weight 0.7 74.8 / 68.2. 0.3 is best on LongMemEval and within noise on LoCoMo, and it is what every published server number used. - deprecate: `RankedSearchQuery::{llm_rerank, llm_model, llm_rerank_top_k, with_llm_reranking}` and `RankedSearchScore::llm_score` are no-ops (LLM reranking was never implemented; `llm_score` is always 0). Marked `#[deprecated]`; removed in the next breaking release. - deprecate: `search::ppr` (personalized PageRank) is never called by ranked search. Wiring it in could not be justified: the benchmark chains only carry sequential `ContinuesFrom` edges that bounded breadth-first expansion already covers. Marked deprecated; removed in the next breaking release. - fix(pymentisdb): pymentisdb 0.10.0. The 0.9.0 wheel on PyPI held only metadata (`packages.find` found no package), so `pip install pymentisdb` installed nothing importable; the package is now mapped onto its directory and the publish workflow builds from the repository root and checks the wheel. `import pymentisdb` no longer fails without LangChain or on langchain-core 1.x (no `langchain_core.memory`): `MentisDbMemory` loads lazily, takes `BaseMemory` from langchain-core < 1.0 or langchain-classic, implements the `save_context` it lacked, and without LangChain raises an ImportError naming `pymentisdb[langchain]` only when used. Vendored third-party wheels removed from the package directory. - feat(pymentisdb): the Python client supports compact search. `ranked_search` gains `compact=True` and there is a new `federated_search`; both return a `RankedSearchResponse` by default (unchanged) or a `CompactRankedSearchResponse` whose `CompactThought` / `CompactRankedSearchHit` types make the difference explicit: the fields the server drops (hashes, signatures, agent name and owner, score components, matched terms) are not attributes, omitted empty fields read as their empty value and unknown fields land in `extra`. Full thoughts gain `provenance`, `version_status`, `successors`, `current_version`, `successor_of` and `collapsed_duplicates`, hits gain `graph_path`, and `Z`-suffixed server timestamps now parse on Python 3.10. Keyword-only `graph`, `as_of`, `include_invalidated`, `df_scope`, `df_cutoffs`, `vector_fusion`, `resolve_successors`, `collapse_duplicates` and `synonym_weight` reach `ranked_search`, `federated_search` and `context_bundles` (they were unreachable from Python). Tests parse 14 responses recorded from the real server and pin every payload. - feat(pymentisdb): read proofs. `ReadSigner` (optional `cryptography` extra) signs every request with the `X-Mentis-Auth` format, from a key file or MENTISDB_READ_KEY_FILE/ AGENT_ID/KEY_ID; a pinned vector is shared with the Rust tests. - security(mcp): audited the published cloudllm_mcp 0.3.6 holes. Not exposed or already closed in mentisdb, each with a regression test (tests/sec_mcp_library_tests.rs): the streamable-HTTP GET SSE stream, the prefix-match Origin check (MentisDB's own guard compares the host exactly), an empty bearer token (no static token is used; an empty presented token matches nothing) and CR/LF in SSE event/id. The MCP client holes (unbounded body, redirects) do not apply: MentisDB is not an MCP client. With cloudllm_mcp 0.4 the library closes them itself and the workarounds are gone; the tests stay and now exercise the library. - fix(build): `lineage` was gated on the `llm-extraction` feature by a misplaced attribute, so `--no-default-features` (with or without `server`) did not compile. Both configurations build again. - fix(invalidation): the live `is_invalidated` check ignored a relation's `invalid_at`/`valid_at`, so an expired supersession still hid its target while `is_invalidated_as_of` disagreed. They now agree; lineage edges also treat "live" as "now". - feat(security): public and private chains. A chain is public (unsigned writes, free reads) or private (signed writes by an allowed key; the segment written while private is readable only by a reader who proves possession of an allowed key). Every access-policy record is a mode-transition entry that opens a segment, so each thought belongs to one segment by position; governance records themselves are always private. Segments are derived when a chain opens: chains with no record are public, chains already `signed`/`allowlist` are private from their record, nothing is rewritten. An unauthorized reader sees public segments only on every read surface: ranked/lexical/vector/graph search, recent and standing context, traversal, get/head/genesis, bundles, summaries, federated and branch-ancestor search, Markdown export, chain and agent listings and counts, policy and verification reports. BM25 document frequency, length averages and the recency anchor are computed over the visible set so scores do not move with private writes, graph expansion never passes through a hidden thought, and a public thought that only a private one supersedes still reads as current. Library: `mentisdb::audience::{Audience, Segment, SegmentMap}`, `ThoughtQuery::audience`, `StandingContextQuery::audience` and `*_for(audience)` variants. - feat(security): open-time verification of governed chains. Thoughts in a private segment must carry a valid signature by a key allowed at that point; those that fail are quarantined (hidden from every reader, reported by `MentisDb::verification` and `chain access verify`). A checkpoint signed by the operator key lets later opens verify only what is new; a chain that no longer matches its checkpoint (truncated, rewritten) is locked instead of being served as public. Nothing is served before verification finishes. - feat(security): read proofs. `X-Mentis-Auth: v1 agent=;key=;pk=;ts=;nonce=;sig=` is an Ed25519 signature over method, path and query, body hash, key identity, timestamp and a single-use nonce (60 s window, bounded replay cache that fails closed). The private key never travels and never has to enter an LLM context: `mentisdb --read-key-file/--read-agent/--read-key-id` (or MENTISDB_READ_KEY_FILE/AGENT_ID/KEY_ID) and the stdio MCP proxy sign locally. New module `read_auth`, fuzz target `read_auth_header`. - feat(security): operator-only key administration. Adding or removing allowed keys, registering or revoking agent keys, disabling agents and switching a chain public/private are done from the dashboard (behind its PIN) or the local CLI (`mentisdb chain access set|allow|deny|admin`, `agent key add|revoke`, `agent disable|activate`, `--offline` against the data directory). The operator signs policy records with `/operator/operator.key`, which is always a governor (recovery path). REST routes `/v1/agents/keys`, `/v1/agents/keys/revoke`, `/v1/agents/disable`, `/v1/access/policy/set` answer 403 with any token and the matching MCP tools are no longer offered. New module `operator`, fuzz targets `operator_op` and `segment_map`. WIRE CHANGE: clients that registered keys or set policies over REST/MCP must use the operator commands. - fix(security): self-service `add_agent_key` let any token holder register a key and impersonate an agent; `revoke_agent_key`, `disable_agent` and the `status` field of `agents/upsert` were open to any token. All are operator-only now (restating the current status is still accepted). - fix(security): a governor could lock a chain by writing a record with no governor; such records are refused and the operator key is always kept. - fix(security): a branch-scoped token searched its ancestor chains through `ranked_search`; each ancestor now needs the token's scope and its own audience. - fix(security): merge deleted a governed source and stripped signatures, and merge, dashboard copy would have published private thoughts. Merge and copy refuse sources with private segments, governance records or signed thoughts, with a clear error and no change. Branching is unchanged. - fix(security): append advice quoted 120-character excerpts of any thought, private ones included, to an unauthorized writer; automatic dedup could supersede a private thought and leak its id; an unsigned writer could link to or supersede a private thought. All three are closed. - fix(security): a refused write told an anonymous caller whether an agent or key existed, was revoked or was allowed; it now says only that the policy did not accept the write. Registry edits on a private chain need a read proof. A disabled agent can no longer write signed thoughts. - feat(security): every thought JSON carries `provenance` (segment, signed, signature valid/invalid/unsigned, verified_agent, `trust: untrusted_data`) and the operating skill tells agents to treat memories as data, never as instructions. docs/CHAIN_ACCESS.md rewritten with the threat model, read authentication, per-surface visibility and residual risk. - feat(dashboard): chains with private segments are shown only behind a PIN; access administration routes `GET/POST /dashboard/api/chains/{chain}/access`. - perf(security): `cargo bench --bench audience_search`: ranked search over a chain with a 10 000-thought private segment takes about 423 µs for a public reader against 334 µs for a public chain of the same visible size; chains without private segments pay a single comparison. - fix(build): the `llm-extraction` feature gate sat on `mod lineage` instead of `mod llm`, so `--no-default-features --features server` (the fuzz crate) did not compile. - feat(registry): `chains.json` entries gain `has_private` and `public_thought_count` (optional, written on the next flush) so listings show public counts without opening a chain. - feat(migration): chain format upgrades are now background, journaled, backed up and recoverable, and never block startup. The daemon comes up in about a second (measured: 0.97 s with a 600 000-thought legacy chain, which finished migrating 17 s later while the daemon served), migrates chains through a bounded worker pool, and answers a request for a chain that is still migrating with HTTP 503, `Retry-After` and the percent done instead of stalling or reading a half-written file. Status is logged and exposed by `GET /v1/migrations`, the `mentisdb_migration_status` MCP tool, a dashboard banner, the TUI and `mentisdb migrate status`. Each chain migrates through a durable journal (planned, backed up, staged, committed, finalized): the original is hard-linked into `migrations/backup/` first (kept 14 days, `MENTISDB_MIGRATION_BACKUP_RETENTION_DAYS`), the upgraded chain is streamed (flat memory, about 120 000 thoughts/s) into a staging file, re-verified end to end and swapped in with an atomic rename. A kill at any step is resumed or discarded on the next start; a chain interrupted three times is quarantined instead of crash-looping. Records are upgraded one schema step at a time. A trusted stored hash that does not verify (corruption or tampering) and a migration that would invalidate a v2 signature both refuse the migration and leave the chain byte-for-byte untouched; a failing chain is quarantined and reported while the others and the daemon carry on. New `mentisdb migrate status|run [--dry-run]|verify|retry|skip|rollback| purge-backups` command. Upgrade note: the startup passes that migrated chains synchronously (`migrate_registered_chains_with_adapter`, `migrate_chain_hash_algorithm`) are no longer run by the daemon (they remain as library functions); a data directory or chain written by a newer release is now refused with a clear message instead of being half-read, and the registry counts refresh runs on a background thread without losing concurrent updates. Library users that open a legacy chain directly keep the in-place upgrade, now with a one-time copy of the original under `migrations/backup/in-place/`. New `migration_record` and `migration_chain` fuzz targets. - feat(server): `GET /v1/migrations`, `POST /v1/migrations/retry`, `POST /v1/migrations/skip` (global tokens only) and the `mentisdb_migration_status` MCP tool; a 503 response carries `Retry-After` while a chain migrates. The dashboard refuses to open a chain the manager owns. - fix(retrieval): an agent that saved a policy change linked to the old policy could later be handed the OLD policy. Measured on a real installation: none of 14 Correction/AssumptionInvalidated and none of ~90 Decision thoughts carried a typed Supersedes/Corrects/Invalidates relation (7 of the 14 corrections carried no link at all, the rest only `refs`, stored as `References`), so the invalidated set stayed empty and the old memory won lexically. Now (new module `lineage`, derived at open time, no migration): a superseded thought that would have ranked is replaced by its live successor (`successor_of`), and a thought merely referenced by a newer Correction/AssumptionInvalidated/Decision-over-Decision, or contradicted by anything, is kept but reported `version_status=contested` with the contesting thought promoted above it. Weak links do not hide: a reference from a correction is often background (a consolidation note references six memories that stay valid), so hiding would lose good memory. `RankedSearchQuery::with_resolve_successors(false)` restores plain hiding. - feat(retrieval): every thought JSON on every surface (search, get, head, recent, traverse, bundles, dashboard) carries `version_status`, `successors` and `current_version` when not plainly current, including results returned with `include_invalidated=true`. Library: `RankedSearchHit::version`, `MentisDb::{version_status, current_version, version_info, hit_json}`. - feat(standing): standing context replaces a superseded constraint or decision with its live successor (previously it vanished whenever the successor was not itself a standing type) and flags contested entries. - feat(append): the append response (REST and MCP) carries `warnings` naming candidate target ids when a Correction/AssumptionInvalidated/Decision replaces memory without a typed invalidating relation. `MentisDb::append_advice` is the library entry point. - fix(export): `to_memory_markdown(None)` (the MEMORY.md agents reload) listed superseded thoughts as current. It now drops them and marks contested entries `contested by #N`. Federated hits carry `version` too. - feat(search): vector fusion no longer depends on query length. The vector multiplier decayed as exp(-bm25/3), and BM25 grows with the number of query terms, so a paraphrased question of ten words silenced the vector channel exactly when the wording differed. New default `VectorFusion::Relative` (`MENTISDB_VECTOR_FUSION=absolute` restores the old blend) decays on the lexical score relative to the query's best. Sweep over the decay on the shipped benchmark chains, R@10 LoCoMo / R@5 LongMemEval: absolute 73.1 / 68.0; relative r=0.10 73.0 / 67.8, 0.25 73.6 / 68.4, 0.40 74.0 / 69.0, 0.80 75.2 / 69.4 (chosen), 1.5 75.5 / 70.2, 3.0 and up 75.9 / 69.6. Above ~1.5 the order is essentially vector-only, so 0.8 keeps lexical precision. Final defaults with collapse: 75.2 / 70.0. - feat(search): near-duplicate hits collapse at result time (`RankedSearchQuery::collapse_duplicates`, default Jaccard 0.9, `MENTISDB_COLLAPSE_DUPLICATES=off` or request `collapse_duplicates: 0` disables, text queries only). One real chain had 301 of 749 live thoughts in near-duplicate clusters and 149 duplicate pairs beyond the 64-thought dedup window. Survivors list the folded ids in `collapsed_duplicates`. Benchmarks: LongMemEval R@5 68.0 -> 68.4, LoCoMo unchanged at 73.1 (thresholds 0.85 and 0.95 identical). On that real chain, with a folded target counted as found, recall_audit hybrid R@1 rose 75 -> 98 (drop50) and 76 -> 98 (rare), paraphrase (sem) R@10 43 -> 52. - perf(search): chains with no supersession or contest edge skip the wider redirect pass. Criterion `search_ranked` on a 5,000 thought chain, 25 hits: resolve off 59 us, resolve on (no lineage) within noise of off, collapse adds roughly 0.3 ms for the 2x-wide page (tokenizing and comparing about 58 candidates). Numbers vary +-3x with machine load. - fix(search): a description, owner, display name or alias added to an agent after its thoughts were written was invisible to lexical search until a restart, because the index baked the registry text in at append time. The lexical index is now rebuilt when an agent record's indexed text changes. - decision(search): `MENTISDB_DF_SCOPE=field` stays opt-in. LoCoMo 72.8 vs 73.1 and LongMemEval 68.0 vs 68.0 under the old blend, identical under the new defaults (75.2 / 70.0). On the real chain, recall_audit hybrid `ref` probes (n=43) went R@1 21 -> 19 and R@10 65 -> 67 and nothing else moved, a wash, so the behaviour every published number was measured with is kept. - docs(skill): policy changes must carry `Supersedes` with the old id; the include_invalidated retry advice is replaced by "read version_status". - test(retrieval): end-to-end regression for the policy scenario over library, REST and MCP for seven link styles, old wording and paraphrase. - perf(storage): the embedding model call no longer runs under the chain's exclusive write lock. A server append now issues an `EmbedTicket` under the lock, embeds with no lock held, then commits the vector under a brief lock; vectors are applied to the sidecar in chain order even when concurrent appends finish out of order, a failed or lost embedding schedules the background rebuild instead of wedging the sidecar, and the whole sequence runs in a detached task so a dropped request cannot strand it. Lock hold per append with a 5 ms model, measured on a 200-thought chain: about 9.5 ms before, about 0.33 ms plus a 0.15 ms commit after (local model: about 4 ms before, about 0.4 ms plus 0.24 ms). That is the embedding's share only: on a large chain the implicit-edge scan then dominated the lock hold (about 24 ms at 100 000 thoughts), see the next entries. Library callers are unchanged unless they opt in with `MentisDb::defer_next_embedding`. New `storage_paths/append_lock_hold` bench. - fix(storage): one slow embedding no longer re-embeds the whole corpus. A straggling embedding that outlasted 64 later appends (a 1.3 s provider hiccup at 50 appends per second) cleared every parked vector and rebuilt the sidecar: the rebuild built an input row per thought under the write lock, embedded the entire chain again and then adopted the result under the write lock. Now later vectors wait behind the slow one (up to `MAX_PIPELINED_EMBEDDINGS`, 512, so memory stays bounded; appends past that are shed and embedded again alone), a failed or dropped embedding is detected exactly (a drop guard on the ticket) and only that thought is embedded again on the background worker, and the full rebuild remains only for a sidecar that cannot be extended or a thought that failed `MAX_EMBED_ATTEMPTS` times. A synchronous append that lands while deferred embeddings are in flight (import, branch copy) is applied in order behind them instead of being read as a stale sidecar. One commit applies at most 32 parked vectors; the rest drain on later commits or polls. New `MentisDb::embedding_backlog` and `EmbeddingBacklog`. At 20 000 thoughts a 600-append straggler used to embed 20 667 thoughts and stall adoption for 5.1 s; it now embeds 601 and the worst stall is 0.29 s. - perf(storage): vector sidecar compaction no longer runs under the chain's write lock. Every `N / 16` appends the append path serialized and SHA-256 hashed the whole sidecar and deep-copied every vector under the write lock, and the flush then wrote the snapshot under the read lock that blocks the next writer (the doc claimed constant cost; the spike was `O(N x dimension)`: seconds at 100 000 x 384). The append path now only queues a request; a background thread (`spawn_sidecar_compaction`) re-reads the files, folds the WAL into a new snapshot and swaps it in, holding the I/O lock for two short file steps. The live handle keeps chaining WAL records from its incremental digest: a compacted snapshot records where the WAL continues in a new optional `wal_base_digest_hex` field (older binaries ignore it, fail to replay the WAL and rebuild the derived sidecar). The snapshot is swapped before the WAL, and replay skips records the snapshot already covers, so a crash between the two steps recovers; records appended during a compaction are retained. At 20 000 thoughts the worst append-cycle lock exposure fell from 1559 ms to 14 ms (p99.9 34 ms to 10 ms). New `embed_commit_latency` bench (p50/p99/p99.9/max at a large corpus, before and after). - perf(storage): implicit-edge neighbours are computed off the chain's write lock. Every applied vector was compared with every earlier vector under the write lock (`O(entries x dimension)`, about 24 ms at 100 000 x 384), which made it the dominant lock hold on a large chain (p50 24 ms at 100 000 thoughts, 4.8 ms at 20 000). Above `DEFAULT_INLINE_EDGE_SCAN_LIMIT` (4096 entries; `MentisDb::with_inline_edge_scan_limit`) the scan runs on a background thread against a snapshot of the sidecar vectors (sealed chunks behind `Arc`, so a snapshot copies no vector) and a later commit, append or `poll_vector_backend_upgrades` applies it after scanning the fewer-than-128 vectors the snapshot lacked. Candidates are produced in the same order with the same `cosine_similarity` calls and applied in append order, so the overlay is identical to the inline one (a randomized test with out-of-order commits, scans held on a latch and appends landing meanwhile compares the two entry by entry, scores bit for bit); a scan for an overlay replaced meanwhile is discarded and a failed scan drops the overlay for the usual rebuild. Trade-offs: on a large chain the overlay can trail the chain by a few appends (`MentisDb::implicit_edge_backlog`), and the scan store keeps a second copy of the vectors in memory. Small chains are unchanged (inline). `ImplicitEdgeOverlay::add_thought_among` is now `scan_candidates` plus `apply_candidates`. Append cycle at 100 000 x 384 (write hold p50 / p99 / max): 24.1 / 26.3 / 38.6 ms before, 0.03 / 0.72 / 16.3 ms after; at 20 000: 4.8 / 5.7 / 6.2 ms before, 0.03 / 0.61 / 3.8 ms after (machine load average 8 to 20). Straggler release at 100 000: worst commit 726 ms to 17 ms, worst adoption stall 1464 ms to 0.7 ms. - perf(storage): adopting a rebuilt vector sidecar no longer hashes and rewrites the whole sidecar under the write lock (`compact_to_path`) to persist the thoughts embedded during adoption: they go to the WAL, chained from the rebuilt snapshot's digest. Adoption also uses the live sidecar to rebuild the implicit-edge overlay instead of parsing the file again. - fix(storage): loading a vector sidecar while a background compaction swapped its files could return the old snapshot without its WAL (stale, so rebuilt at open). The load now notices the snapshot changed under it and reads again. - fix(storage): sidecar WAL replay checked the digest chain but not the rows: a record of the wrong dimension, with a non-finite component or out of `thought_index` order loaded as part of the sidecar. It is now rejected like the same row in a snapshot (the digest is a checksum, not an authenticator). New `sidecar_wal` fuzz target (loading and compaction with arbitrary WAL bytes). - fix(storage): a persisted HNSW graph was trusted when its entry count matched the sidecar, so a same-size graph built from other vectors (or another model) was served. The graph file (format 2) now starts with a magic and a SHA-256 digest of the embedding space plus its documents; the digest is checked against the sidecar and against the graph body on load, and any mismatch, torn write or legacy headerless file rebuilds the graph. Graph temp files are unique per writer. Upgrade note: existing graphs are rebuilt once, in the background. - perf(storage): appends no longer rewrite and rename `*.agents.json` once per thought. The per-agent counters (`thought_count`, `last_seen_*`) were already recomputed from the chain at every open, so only an identity change (new agent, rename, learned owner) is written immediately; counters ride along every 16 appends, on `Drop` and on `set_auto_flush(true)`. A killed daemon loses nothing. No format change. - fix(security): dashboard responses now carry a Content-Security-Policy (`frame-ancestors 'none'`, `base-uri 'none'`, same-origin connections), `X-Content-Type-Options: nosniff`, `X-Frame-Options: DENY` and `Referrer-Policy: no-referrer`, closing clickjacking of the state-changing UI and adding defence in depth against stored XSS in thought, agent, skill and chain-key text (the UI already escapes all of it). - feat(access): a v2-signed append built on an older head now fails with the typed `AccessError::StaleHead` (HTTP 400, "fetch the head, sign again") instead of an indistinguishable `BadSignature`; forged signatures stay `BadSignature`. Nothing is written either way. New `AccessError` variant. - test(access): Merkle-root replay, v1 downgrade on allowlist chains, the two-signer stale-head race and governor-key revocation are pinned. - fix(security): MCP authorization was fail-open for chain-scoped tools it did not list. A tool outside the hard-coded default-chain list that named no chain was allowed for any token while its handler used the server's default chain. It is now fail-closed: every chain-scoped tool requires the default chain unless it is one of the three explicit-only tools (merge, branch, federated search). - fix(security): `thoughts/traverse` reserved `chunk_size` entries up front, so `chunk_size = 2^64-1` panicked with a capacity overflow (and a few hundred million exhausts memory). The reservation is capped by the chain length. - fix(validation): chain keys that were only whitespace, contained control characters or exceeded 256 bytes could open (and persist) a chain through the library API, branch creation and restore; only the empty string was refused. `mentisdb::validate_chain_key` now guards every entry point and the server shares it. New `chain_key` fuzz target. - fix(security): the bearer-token registry was written world-readable; it is now created 0600. - fix(security): the dashboard PIN could be guessed without limit through `Authorization: Bearer ` on any dashboard route (only the login form was rate limited). The bearer path now shares the login form's per-IP failed-attempt limiter (5 failures per 5 minutes, then 429, even for the right PIN). - fix(security): DNS rebinding and cross-site browser requests could drive the REST and MCP listeners while bearer enforcement is off (the default). A request carrying `Origin` or `Sec-Fetch-Site` (i.e. from a browser) must now name an allowed host (loopback, `MENTISDB_BIND_HOST`, `MENTISDB_DASHBOARD_ALLOWED_HOSTS`); programmatic clients are unaffected. - fix(security): restoring a backup that extends a signed or allowlist chain spliced the new records in raw, bypassing the write policy, so a crafted backup could add unsigned thoughts. Such a chain now keeps its history and the backup is imported as a separate renamed chain. BEHAVIOUR CHANGE: a newer backup no longer fast-forwards a governed chain. - fix(access): merging chains (REST/MCP and dashboard) and copying an agent (dashboard) aborted half-way when the source held `AccessPolicy` records (the reserved type is refused on append), leaving a partial copy. Those records are skipped, and merging or copying into a signed/allowlist target is refused up front with 403 instead of failing thought by thought. - fix(security): chain-scoped bearer tokens could read any chain through a decoy field. A request that named `target_chain_key`, `source_chain_key`, `branch_chain_key`, `chain_key_filter` or `chain_keys` instead of `chain_key` satisfied the authorizer (it saw only the decoy's chain) while the handler ignored the decoy and fell back to the server's default chain, on REST and MCP, for single-chain, multi-chain tokens alike. Injection of a single-chain token's chain now keys on `chain_key` alone, and the authorizer requires the default chain whenever `chain_key` is blank. - fix(security): federated search skipped blank entries of `chain_keys` when authorizing but resolved them to the default chain when executing, so a token scoped to one chain could search the default chain with `{"chain_keys": ["", "mine"]}`. Entries are now trimmed and validated (blank, oversized or control-character keys are a 400) and de-duplicated. - fix(dedup): automatic dedup could retire a thought the author rated more important than the new one (a throwaway near-copy superseding a critical Constraint/Decision, which then vanished from search). A prior thought with higher importance than the incoming one is no longer a supersession candidate. Dedup stays off unless `MENTISDB_DEDUP_THRESHOLD` is set; the whitepaper wrongly called 0.85 a default. - feat(search): `DfScope` / `MENTISDB_DF_SCOPE` / `RankedSearchQuery::df_scope` choose how the lexical stop-word gate measures document frequency. The shipped `global` scope counts a thought as containing a term if it is in ANY field, so words in an agent's registry text (project name, "developer", "owner") were gated out of `content` on real chains although they occur in 2-9% of it. `field` counts per field as the whitepaper claimed. Default unchanged (`global`); needs a LoCoMo/LongMemEval run before it can become the default. `RankedSearchQuery::df_cutoffs` overrides the cutoffs per query. - docs(search): `Bm25DfCutoffs` rustdoc and WHITEPAPER 6.3/7.2 now state exactly what the gate does (hard cliff, global DF, off below 20 thoughts, IDF always global, no stop-word list) and that auto-dedup is off by default. - test(search): `examples/recall_audit.rs`, an empirical recall audit for a chain copy (age-decile self-recall lexical vs hybrid vs RRF, near-duplicate clusters, supersession quality, vector coverage, embedding-window overflow, DF gating, embedding dilution). New `MentisDb::embedding_text`. - fix(cli): `--url` and `--dashboard-url` accepted values that are not absolute http(s) URLs (`mentisdb search q --url thought` built the request URL `thought/v1/ranked-search`); they are now validated at parse time with a clear message. Found by the new `cli_args` fuzz target. - fix(security): agent public keys were accepted without validation or proof. `add_agent_key` took any bytes (even four) and any key a caller named, so a client could squat someone else's key. It now requires a 32-byte on-curve, non-weak Ed25519 key and a proof-of-possession signature (domain `mentisdb/key-registration/v1`: chain, agent, key id, key, timestamp within 10 minutes). REST, MCP and the dashboard take the key and proof as byte arrays or hex (`public_key_hex`, `registered_at_unix_secs`, `registration_signature_hex`). BREAKING for clients that registered keys without a proof; `MentisDb::add_agent_key` gained a `&KeyRegistrationProof`. - fix(security): thought signatures were stored but never verified. A thought that carries a signature must now verify against an active, unrevoked key of its agent or the append is refused (typed `AccessError`, HTTP 403), on every chain. A new v2 payload (`mentisdb/thought/v2`, see docs/CHAIN_ACCESS.md) covers every semantic field including entity type, scope and relation validity and is bound to the chain key and head hash, so a signed thought cannot be replayed onto another chain or position; v1 signatures stay readable (the version is recorded in the 64/65-byte stored signature) but are not accepted on restricted chains. Signed thoughts are committed exactly as signed (no automatic relations, `valid_at` or dedup edges). - fix(storage): a crash that left more than about 40% of the final record on disk made the chain refuse to open ("length prefix ... points past end of file but the following bytes hold a complete record"). The torn-tail check decoded the partial payload, and a prefix of a current-layout record parses as a complete record in the shorter legacy layout (its `prev_hash`/`hash` are read from the zero bytes of absent `None` tags). A partial payload now only counts as a complete record when it carries a 64-digit hex hash, so genuine tears are truncated and preserved as `.torn-*` while a corrupt length prefix over an intact record still fails open untouched. Found by a new test that cuts the last record at every byte. - fix(storage): a failed group commit kept its bytes in the writer buffer, so the writer's shutdown flush appended them a second time. After a full disk (partial write) or a failed `fsync` the chain file held a torn record followed by its duplicate, which no repair can read past. The buffer is now always cleared and a failed write is rolled back to the pre-commit length. - fix(storage): a forged length prefix inside a chain record (restored backup, imported or copied `.tcbin`) or inside a persisted HNSW graph made bincode attempt a `String`/`Vec` allocation of the claimed size and abort the whole process (`memory allocation of 1125899906842624 bytes failed`), a one-file denial of service for the daemon. Every bincode decode of untrusted bytes (thought records, skill registries, sidecar WAL, implicit-edge overlay, HNSW graphs) now runs under a decode budget (64 MiB per thought record, 1 GiB per derived file) and fails with `InvalidData` instead. The wire format is unchanged. - fix(storage): an append against a missing or stale vector sidecar embedded the whole chain synchronously under the chain's write lock (a failed embed made the very next append do it), contradicting the "opening a chain never embeds its history on the request path" guarantee. It now queues a single-flight background rebuild with the chain's own provider, keeps serving lexical and graph signals until the rebuild is adopted, and a failed embed schedules the repair immediately instead of waiting for another append. The managed provider is now shared (`Arc`) with the worker. - fix(storage): vector sidecar freshness only compared thought count and head hash, so a sidecar with the right count and head but missing entries read as fresh and left those thoughts findable only lexically. Freshness now also requires one entry per thought and reports a gap as `StaleThoughtCount`. - feat(recall): agents no longer forget older memory at session start. The mandatory startup loaded only the last 12 thoughts, so a preference stated months ago was never loaded and users had to repeat themselves. New `MentisDb::standing_context` (module `standing`), MCP tool `mentisdb_standing_context`, REST `POST /v1/standing-context` and CLI `mentisdb thought standing` return the durable half of memory regardless of age: live Constraint, PreferenceUpdate, UserTrait, RelationshipUpdate, Goal, Decision and LessonLearned thoughts (user-scoped or unscoped), ranked by importance then recency, near-duplicate restatements collapsed (Jaccard >= 0.85, newest kept), capped per type (8) and in total (40), plus the newest Handoff and Checkpoint/Summary. Additive: no existing tool changed. Criterion bench `standing_context` (10k thoughts). - docs(skill): MENTISDB_SKILL.md startup now loads `mentisdb_standing_context` before `mentisdb_recent_context`, and a new RECALL TRIGGERS section (the read-side twin of WRITE TRIGGERS) tells agents to search before answering about past preferences, decisions and constraints, or when the user says "again" / "remember" / "last time". `initialize` instructions, the bootstrap tool description, README, WHITEPAPER 8.4 and CLI_PARITY follow. - fix(storage): registry files claimed to be written through a synced temp file but were only flushed, so after a power loss the rename could land before the data and leave a zero-length registry. `MENTISDB_FSYNC=1` now syncs the temp file before the rename (default unchanged: a sync per registry per append costs milliseconds on macOS). - perf(storage): a managed vector sidecar compacted its snapshot every 32 appends, and each compaction serialized and hashed the whole corpus three times (about 200 ms per pass at 10 000 thoughts x 384 dimensions, inside the chain write lock, plus a full-corpus JSON copy in memory), so append cost grew with the chain. The compaction threshold now scales with the corpus (`search::wal_compact_threshold`, 1/16 of the entries, at least 32), the integrity digest is streamed into SHA-256 instead of buffered (digest unchanged, pinned by a test), and the flush no longer recomputes the digest the append already rebased onto. Append with a 3 000 thought sidecar: 4.6 ms to 2.1 ms (`append_sidecar/local_sidecar_3000_base`). - perf(storage): with `auto_flush` (the default) every append rewrote and renamed the entity-type registry even for thoughts without an entity type; it is now persisted only when a thought names one. - perf(storage): automatic dedup re-tokenized (stemming and lemma expansion) the last 64 thoughts on every append, about 0.49 ms of pure repeated work per append at 40 words per thought. A self-validating sliding window now tokenizes each thought once (`benches/storage_paths.rs`, `dedup_tokenize_window64`); results are identical. - perf(search): `LexicalIndex::scan` allocated and zeroed O(documents) score, term-mask and restriction arrays per query. The arrays are now kept in a per-thread scratch (capped at 64 MiB) and only the touched positions are cleared on drop, so a rare one-term query on a 100 000 document index drops from 9.9 us to 1.8 us and a three-term query from about 1.8 ms to 0.93 ms; scores are identical. - feat(access): per-chain write access control. Policies `open` (default), `signed` and `allowlist` are stored as signed `AccessPolicy` governance thoughts in the chain (hash-chained, auditable) with a Merkle commitment to the key set, replayed on open; changes need a current governor's signature, and the first record bootstraps governance with a global token. New library API `MentisDb::{access_policy, set_access_policy, verify_signatures}`, module `mentisdb::access`, module `mentisdb::signing` (one documented `verify_ed25519_signature`, key validation, payload builders, Merkle root), thought type `AccessPolicy` (reserved), MCP tools `mentisdb_get_access_policy`, `mentisdb_set_access_policy`, `mentisdb_verify_signatures`, REST routes `/v1/access/{policy,policy/set,verify}`, and a read-only policy panel in the dashboard. Design, threat model and formats: docs/CHAIN_ACCESS.md. COMPAT: a chain that contains an `AccessPolicy` record cannot be read by a MentisDB version that predates the type; chains without one are unchanged. - feat(cli): `mentisdb chain access show|set|allow|deny|verify`, `mentisdb key generate|show`, `--private-key-file` on `agent key add`, `thought append` and `thought retro` (signing happens locally; the seed is never sent). `chain access verify` exits non-zero when any signature fails. - fix(dashboard): bootstrap, import, copy and merge report access-control refusals as 403/400 with the reason instead of a generic 500. - fix(rest): `rest_router`, the public way to embed the REST API, answered 404 for `/v1/chains/merge` and `/v1/vectors/rebuild` because it kept its own copy of the route table; it now shares the daemon's. `mentisdb agents` sent GET to the POST-only `/v1/agents` route and always failed; it now POSTs (it is the same command as `mentisdb agent list`). - feat(cli): the CLI covers every MCP tool, REST route and dashboard action. New groups `thought`, `search` (ranked, `lexical`, `filter`, `federated`, `bundles`), `chain` (list, head, bootstrap, branch, merge, info, delete), `agent` (list, get, registry, upsert, describe, alias, key add/revoke, disable, activate, copy), `entity-type`, `memory` (export, import, extract), `skill` (guide, manifest, list, search, read, versions, upload, deprecate, revoke, delete, diff), `webhook`, `vectors` (enable, disable, sync, rebuild) and `daemon` (health, version, flush, restart, settings). Memory commands use the running daemon's REST API (`--url`, bearer token from `--token` or `MENTISDB_BEARER_TOKEN`), dashboard-only actions use the PIN-gated dashboard API (`--dashboard-url`, `--pin` or `MENTISDB_DASHBOARD_PIN`). Arguments are typed and validated before any request (thought types, roles, UUIDs, RFC 3339 times, scores, hex keys), `--json` prints compact JSON, `-` reads content from standard input, destructive commands need `--yes`, and every command has `--help` with examples; `mentisdb --help` lists them all. `search` gained the filters the MCP tool has (type, role, tag, agent, time range, graph depth, `--include-invalidated`, `--as-of`, reranking). `docs/CLI_PARITY.md` maps each tool, route and dashboard action to its command and a test keeps it in sync. - test: removed the wall-clock assumptions from the migration, embedding and event-stream tests. The migration manager and slow-embedding tests park the worker on a latch and assert while the work is provably in flight (they used 300 ms and 150 ms bounds and a 100 ms sleep that a loaded CI machine breaks); the SSE tests end at a sentinel call instead of 300 ms of silence. The daemon migration test defaults to 100,000 thoughts (13 s instead of 80 s; the 600,000-thought run is `--ignored`) and kills its daemon on any failure. 0.10.10.55 OCT/22/2026 - feat(webhooks): `MENTISDB_WEBHOOK_ALLOWED_CIDRS` lets self-hosted deployments deliver webhooks to private targets (WireGuard, Tailscale `100.64.0.0/10`, LAN subnets) that the 0.10.9 SSRF guard refuses (issue #22). Takes CIDR ranges or single addresses separated by commas and/or whitespace; addresses inside a listed range are permitted even when they fall in a blocked range, everything else stays blocked. Localhost host names are still rejected and any entry broader than `/8` (IPv4 or IPv6; `fd00::/8` still fits) is refused, so the guard cannot be re-opened wholesale with something like `0.0.0.0/1`. Host bits are normalized, IPv4-mapped IPv6 addresses match IPv4 ranges, and the allowlist applies at registration, when persisted registrations are reloaded, in the delivery-time DNS resolver and in the literal-IP re-check. An invalid list fails daemon startup; active ranges are logged at startup, with a dedicated warning when a listed range covers loopback or the 169.254.169.254 cloud metadata address. New public API: `WebhookUrlPolicy::AllowCidrs`, `WebhookUrlPolicy::from_env`, `WebhookUrlPolicy::from_allowed_cidrs`, `WebhookUrlPolicy::permits_ip`, `WebhookCidr`, `WEBHOOK_ALLOWED_CIDRS_ENV`, `MIN_ALLOWED_PREFIX_V4`, `MIN_ALLOWED_PREFIX_V6`, `WebhookManager::policy`; `WebhookUrlPolicy` is now `Clone` instead of `Copy`. Thanks to takver for the request. - feat(docker): official multi-arch (`linux/amd64`, `linux/arm64`) image `ghcr.io/cloudllm-ai/mentisdb`, published on every release tag as `` (`0.10.10.55`), `` (`0.10.10`) and `latest`. Debian trixie (`debian:trixie-slim`, glibc 2.41) base so the ONNX Runtime used by local embeddings links; features server + local-embeddings + llm-extraction (no audio); runs as non-root uid/gid 991 with data, TLS certificates and the model cache in the `/var/lib/mentisdb` volume; `HEALTHCHECK` on REST `/health`; entrypoint `mentisdb --headless` under `tini`, so no TTY is needed. HTTPS MCP/REST and the update check are off in the image. Native amd64/arm64 runners build by digest and merge a manifest list; pull requests build without pushing; publishing is refused unless the tag's first three components match the Cargo.toml version, so a stray tag cannot move `latest`. `.dockerignore` keeps `.env*`, `*.pem`, `*.key` and keypair JSON files out of the build context. Contributed by @nycterent in #16, finished in #24. - fix(daemon): headless mode drains the HTTP servers and exits 0 on SIGTERM (`docker stop`, Kubernetes, systemd). It used to wait only for Ctrl+C, so SIGTERM killed the process without a graceful shutdown. SIGTERM/SIGINT handlers are registered before readiness is announced, so a signal right after startup is not lost. TUI mode also shuts down cleanly on SIGTERM (`kill`, systemd, `docker run -t` + `docker stop`), restoring the terminal and draining the servers. Integration test runs `mentisdb --headless` without a TTY and asserts a clean exit. - ci: Linux release binaries now come in two flavours (issue #21). The full-featured `mentisdb-linux-x86_64` / `-arm64` assets are unchanged (local embeddings, glibc 2.39+: Ubuntu 24.04+, Debian 13+). New `mentisdb-linux-x86_64-compat` / `-arm64-compat` assets are built in an `ubuntu:22.04` container without `local-embeddings` (lexical + `local-text-v1` vectors, like the Intel macOS binary) and without `startup-sound` (no chime, no `libasound.so.2`/ALSA runtime dependency on minimal servers), and measure a glibc 2.34 requirement, so they run on Ubuntu 22.04 LTS, Debian 12 and RHEL 9. A CI guard (`objdump -T`) fails the build if a compat binary ever needs glibc newer than 2.35, plus a `--help` smoke test inside the old userland. A full-featured binary cannot go lower without building ONNX Runtime from source: its prebuilt library needs glibc 2.38+ and GCC 13 libstdc++. The Docker image is the full-featured option on older distros. - docs: README and docs.mentisdb.com cover the webhook CIDR allowlist, Docker install (compose example, volume, ports, security notes) and the full vs `-compat` Linux binary choice (`ldd --version`). - Benchmarks (LoCoMo, LongMemEval) were not re-run for this release by owner exception: nothing in retrieval or scoring changed since 0.10.9.54, whose numbers stand. 0.10.9.54 OCT/21/2026 - fix(security): SECURITY — legacy MCP `/tools/execute` authorization bypass. A chain-scoped bearer token could invoke tools against other chains, call global-only tools (for example list every chain with its storage path), and merge or delete chains outside its scope. Affects 0.10.8.53 and earlier when bearer-token access (`MENTISDB_BEARER_TOKEN_ACCESS`) is enabled; daemons without bearer tokens are unaffected because they grant full access by design. Authorization now inspects exactly the request fields that are executed. Upgrading is strongly recommended for any daemon that issues chain-scoped tokens. - fix(security): one shared REST/MCP operation authorization table. Listing chains, webhook register/list/delete, cross-chain agent listing, skill mutations and `POST /v1/admin/flush` now require a global token; chain-scoped tokens are confined to their chains on every route. Token scope is resolved once per request. - fix(security): merge/branch chain keys are trimmed and validated before authorization and execution, so a scoped token can no longer reach a different chain through a whitespace-padded key or branch into an out-of-scope key. Branching into an existing chain returns 409. - fix(security): webhook SSRF hardening. Targets resolving to loopback, private, link-local, IPv4-mapped/translated (`::ffff:0:0:0/96`), local NAT64 (`64:ff9b:1::/48`) and Teredo addresses are refused, every resolved address is re-checked at delivery time (DNS rebinding), redirects are not followed, URLs are redacted in logs, and a circuit breaker pauses a webhook after 5 consecutive failures. - fix(dashboard): stored XSS via crafted chain/agent keys (inline onclick handlers replaced by `data-act` delegation), CSRF guard on every state-changing dashboard API call and on login (`Origin`/`Referer` or `X-MentisDB-Dashboard: 1`), DNS-rebinding defence through a `Host` allowlist on all dashboard routes (`MENTISDB_DASHBOARD_ALLOWED_HOSTS` for extra names), per-IP login rate limiting, `GET /settings` no longer returns the PIN, registry `storage_location` confined to the data dir, and generic error bodies. - fix(security): backup restore bounds the manifest (8 MiB), file count (100k) and declared sizes (cross-checked against the zip central directory, plus a free-space check on Unix), and rejects zip bombs, symlinks and partial writes. The dashboard `.env` (holds the PIN), integration-config `.bak` copies and `.torn` files are written 0600; integration temp files use unpredictable names opened `create_new`. - fix(search): issue #23 — memory blow-up / OOM after upgrading with many chains. Every chain used to load its own FastEmbed ONNX session and embed its whole history in one unbounded batch on the request path; a 13-chain, 2,704-thought repro exceeded a 6 GB cap (the reporter hit OOM at 28.8 GiB) and now peaks at ~1.7 GB. One model is shared per process, inference runs in small bounded chunks, missing or stale sidecars are rebuilt by a single background worker (single-flight per sidecar) while the chain serves lexical/graph results, opening a chain never rewrites its provider config, the model cache lives in `/.fastembed_cache` (`FASTEMBED_CACHE_DIR` overrides), and `MENTISDB_EMBEDDINGS=off|local-text|fastembed` selects the mode process-wide. Thanks to takver for the detailed report. - fix(search): `enable_reranking=true` was broken (LoCoMo R@5 3.6%, LongMemEval R@5 2.8%) because the raw RRF total replaced the additive score. RRF is now a scaled consensus bonus over positive-only lists: LoCoMo rerank R@5/R@10 66.0/74.1, LongMemEval rerank R@5 68.6. RRF merge is deterministic; federated search keys RRF by (chain, thought id) and dedups before paging. - fix(search): thesaurus synonyms keyed by stem so inflected terms expand, damped to weight 0.3 with at most 3 synonyms per term (the old 0.7 / 5 cost ~2.4 pt of LongMemEval R@5 once stem keys fired more often). Default path vs 0.10.8 baseline: LoCoMo R@5/R@10 63.8/72.7 -> 63.9/73.5; LongMemEval R@5/10/20 66.8/72.0/78.2 -> 68.0/72.8/78.8. Filtered HNSW searches use an exact scan or recall-aware oversampling. - fix(lib): durability. A torn final record is preserved to a `.torn` file and truncated before the writer reopens the chain; only a strict partial last record counts as torn, so mid-file corruption fails open with InvalidData and nothing is dropped. Agent, entity-type and chain registries are written atomically; chain migration rewrites via a synced temp file; the implicit-edge overlay records its coverage and catches up after a crash. Durable group commits can `fsync` once per commit with the new opt-in `MENTISDB_FSYNC=1`; explicit flush, shutdown and drop always sync; a lone durable append no longer waits for the group-commit window. - perf(lib/search): per-append cost 6.3-7.8 ms -> 1.4 ms (fsync off); ranked query paths score-only with top-k selection, dense lexical scans, cached vector norms, arena graph expansion (criterion: ranked lexical 997us -> 96us, filtered 138us -> 11us, heuristic 1.52ms -> 94us). Benchmark query throughput ~206/159 -> ~384/385 q/s (LoCoMo/LME); ingest LoCoMo 171.5 -> 75.1 s, LongMemEval 725.6 -> 184.2 s (host load varied). fastembed stays on 5.x on purpose: fastembed 7 / ort rc.15 auto-registers CoreML on macOS and cut query throughput ~2.5x. - fix(server): reads of an unknown chain return 404 instead of creating it (call bootstrap first); chains open single-flight off the async workers; disk I/O runs on the blocking pool; finished background sidecar rebuilds are adopted on the read path; errors map to accurate statuses (400/401/403/404/409/413/500) without leaking internals; REST bodies over 1 MiB return 413 while bearer-token access is enabled; MCP payloads mixing `tool`/`parameters` and `name`/`arguments` return 400; skill upload no longer creates an unknown chain. - fix(dashboard): chain keys restricted to `[A-Za-z0-9_-]{1,128}` on create paths, paging clamped, stale fetches ignored, branch/merge dialogs and chain pickers refresh, skill edit/import counts fixed, copy-to reuses the live cached chain, 390px layout fixes. - fix(bin): the daemon loads `/.env` after `./.env`, so settings saved from the dashboard apply regardless of the working directory. `mentisdb backup`/`restore` send `MENTISDB_BEARER_TOKEN` with the daemon flush. - ci: the Intel macOS (x86_64-apple-darwin) release binary returns, built without `local-embeddings` (ort ships no prebuilt binaries for that target); GitHub Actions moved to Node 24 runtimes. - chore(deps): ureq 3, sha2 0.11, ed25519-dalek 3, zip 9, crossterm 0.29, diffy 0.5, roaring 0.11, toml_edit 0.25, rodio 0.23, criterion 0.8, plus `cargo update`. fastembed intentionally kept on 5.x (see perf). - fix(build/bench): `--no-default-features` builds compile again (cli/tui gated behind `server`, llm behind `llm-extraction`); the LoCoMo harness passes `--reranking`/`--rerank-k` through to ranked_search; LLM extraction accepts code-fenced JSON; TUI logger channel is bounded. - Gates green (fmt, clippy --all-targets --all-features -D warnings, full test suite). Full LoCoMo and LongMemEval re-run; see the release notes. 0.10.8.53 SEP/16/2026 - fix(sidecar): keep the vector sidecar WAL chain head consistent with the on-disk snapshot, fixing a deterministic chain brick (GitHub issue #20). Compaction rewrote the snapshot with the full-corpus digest but never rebased the live in-memory sidecar, so the first append past the 32-record WAL threshold wrote a record whose `prev_digest` no longer matched the snapshot. The next chain open then failed with "vector sidecar WAL digest chain mismatch", and every daemon request on that chain failed because the chain could not be opened. `compact_to_path` now rebases the WAL head, the managed append path rebases when it schedules a compaction, and a full snapshot write clears any sibling `.wal` before the atomic rename. An unreadable sidecar now degrades to a rebuild on open (the documented rebuildable-derived-state contract) instead of aborting the chain. Regression tests: append-after-compact replay, full snapshot clears stale WAL, reopen across two compaction boundaries, and a foreign-generation WAL triggering rebuild. - fix(cli): `mentisdb add` always sends the required `thought_type`, defaulting to `fact-learned` as documented, and validates an explicit `--type` locally with the list of valid types (GitHub issue #17). Previously the field was omitted when `--type` was absent, so a plain `mentisdb add "text"` failed with HTTP 422 `missing field thought_type`, and a typo such as `--type note` produced an opaque server 400. Extracts pure `build_add_body` / `build_ranked_search_body` helpers covered by payload regression tests. - refactor(thought-type): one canonical `ThoughtType` string mapping. Replaced three hand-maintained copies in `server.rs`, `llm.rs`, and `lib.rs` with `FromStr`/`Display`/`as_str`/`ALL` and a typed `ParseThoughtTypeError` that lists the valid types. Fixes a latent bug where the REST/MCP layer rejected the valid `Goal` and `LLMExtracted` variants. Parsing is case- and separator-insensitive. - test(sidecar/cli/thought-type): new `search_sidecar_tests`, `search_vector_sidecar_integration_tests`, `cli_payload_tests`, and `thought_type_tests` coverage; doctest for `ThoughtType::as_str`. - Phase 2 gates green (fmt, clippy --all-targets --all-features -D warnings, full test suite). Full LoCoMo/LongMemEval not re-run: technical debt release, no retrieval-scoring change. 0.10.7.52 AUG/16/2026 - fix(skills): open 0.10.5 `mentisdb-skills.bin` files after 0.10.6 inserted `SkillVersion.schema_version` before `content`. Bincode treated the Full payload length as the content-enum discriminant (`invalid value: integer 10633, expected variant index 0 <= i < 2`) and the daemon panicked on boot. Load now decodes the pre-schema V2 layout, rewrites the file, and starts. Existing skill bodies are unchanged. 0.10.6.51 AUG/15/2026 - feat(skills/dashboard): permanent skill delete. Revoke still keeps an audit row; `SkillRegistry::delete_skill` removes the skill and all versions so the same `skill_id` can be reused. Dashboard: Revoke (active/deprecated) then Delete / Delete Permanently (revoked list row and skill detail, with type-to-confirm). REST `POST /v1/skills/delete`, MCP `mentisdb_delete_skill`, dashboard `DELETE /dashboard/api/skills/{id}`. Skills list now shows total / active / revoked / deprecated counts. - perf(search): vector sidecar appends write one integrity-chained WAL record instead of rewriting the full JSON snapshot. Load replays `*.json.wal`; the snapshot is compacted every 32 records. Older binaries that only read JSON see a stale sidecar and rebuild. - perf(server): MCP/REST append releases the chain write lock before sidecar WAL and overlay I/O, so ranked search can proceed during derived persist. Crate `append_thought` still flushes derived files before returning. - perf(search): implicit-edge first build uses a temporary HNSW top-k search when N > 128 instead of pairwise N². Tiny corpora stay pairwise so existing overlay unit tests remain exact. - perf(dashboard): `get_or_open_chain` reopens a cached chain only when the on-disk thought count is ahead of the live handle (external writer). Matching counts reuse the Arc so normal requests do not re-deserialize. - perf(search): `query_ranked` scores the cached Exact/HNSW backend with `search_filtered` instead of cloning candidate vectors and rebuilding a throwaway `VectorIndex` per request. - perf(search): append-time vector sidecar sync keeps the live sidecar in memory and `save_to_path` no longer recomputes the integrity hash (checked on load). Graph-enabled ranked search caches `ThoughtAdjacencyIndex` by thought count. - perf(search): exact cosine search uses `select_nth_unstable_by` for top-k instead of sorting the whole corpus. - perf(search): Porter stemmer is process-wide `OnceLock`; thesaurus lookup returns `&[String]` instead of cloning synonym lists; HNSW `ef_search` is read from the environment once. - perf(auth): bearer-token registry loads are cached until `bearer-tokens.json` mtime changes, so middleware + authorize no longer re-read the file twice per request. - perf(skills): persist encodes the live skill map by reference instead of cloning every entry and version before bincode. Upload, revoke, deprecate, and delete no longer double peak memory on the write path. - perf(skills): `SkillVersion` stores `schema_version` so index rebuilds skip reconstruct+reparse for current records. - perf(webhooks): delivery reuses one process-wide `reqwest::Client`. - docs: skill delete + sidecar WAL documented in README lifecycle table, rustdoc, MENTISDB_SKILL.md, cookbook 2.3/3.2, docs.mentisdb.com user/developer/agent guides, integrations HTML, WHITEPAPER, and the 0.10.6.51 blog / release notes. 0.10.5.50 JUL/13/2026 - fix(search): default retrieval now excludes superseded, corrected, and invalidated thoughts via the live `invalidated_thought_ids` set (query, ranked search, context bundles, recent context, memory markdown export). Previously the set was only applied under `as_of` point-in-time queries, so normal search kept returning stale memories on large chains. Opt in to audit mode with `include_invalidated=true` (crate, REST, MCP). Point-in-time `as_of` still shows thoughts that were valid at that timestamp. - docs: document invalidation filtering and recommended `MENTISDB_DEDUP_THRESHOLD=0.85` for long-lived chains in README, `mentisdb --help`, `mentisdb search --help`, and docs.mentisdb.com (user, agent, and developer guides). - fix(auth): single-chain bearer tokens are full read+write within scope. When MCP/REST clients omit `chain_key`, a single-chain token is bound to that chain for both authorization and execution (append, import, search, etc.). Previously writes often failed with a generic "Bearer token required" error because auth fell back to the server default chain while reads that passed an explicit `chain_key` succeeded. There is still no read-only token mode in the CLI or dashboard. - feat(auth/dashboard/cli): permanent bearer-token delete. Revoke still keeps an audit row; operators can now remove revoked tokens from the registry so the dashboard list stays clean. Dashboard: Revoke (active) then Delete (revoked). CLI: `bearertoken revoke` vs `bearertoken remove`/`delete`/`rm`. API: `POST .../bearer-tokens/{alias}/revoke` and `DELETE .../bearer-tokens/{alias}` (permanent). - fix(dashboard): chain explorer table columns were misaligned — a stray content cell under Role shifted Role, Agent, Content, and Date one column to the right; row template now matches the header order. - perf(startup): migration-phase checks no longer fully open every registered chain on each boot. Registry count refresh uses payload skipping and agent sidecar reads; hash migration peeks at the first thought only; reconciliation uses lightweight file health probes instead of deserializing entire chains. - docs(cli): `mentisdb --help` now documents `--mode stdio|http|both` as client transport choices (how MCP clients connect) rather than implying HTTP only starts in http mode; plain `mentisdb` already exposes HTTP MCP, REST, and the operator TUI. 0.10.4.49 JUN/20/2026 - fix(dashboard): session cookie `Secure` attribute is now conditional on `X-Forwarded-Proto` — browsers were silently dropping the cookie when the dashboard sat behind a TLS-terminating reverse proxy that talked plain HTTP to the daemon, making login impossible. - fix(dashboard): session timeout was 5 hours instead of the intended 8 hours due to `RATE_LIMIT_WINDOW_SECS * 60` being used for session expiry. Replaced with an explicit `SESSION_TIMEOUT_SECS` constant independent of the brute-force rate-limit window. - refactor: HNSW is no longer a separate Cargo feature — it is unconditionally compiled in. The `hnsw-backend` feature gate has been removed along with the `HnswBackendNotEnabled` error variant. - refactor: `local-embeddings` is now a default feature, so `cargo install` and the self-updater no longer need `--features local-embeddings`. The Makefile install target, `build_cargo_install_args`, and the non-interactive update messages have been simplified accordingly. 0.10.3.48 JUN/20/2026 - fix(auto-update): `build_cargo_install_args` now includes `--features local-embeddings` so auto-updates preserve the `fastembed-minilm` vector provider instead of silently regressing to `local-text-v1`. - feat(wizard): interactive setup wizard now supports Grok CLI / Build TUI harness (writes to ~/.grok/config.toml on macOS, ~/.config/grok on Linux, %APPDATA%\grok on Windows). - feat(wizard): optional bearer token collection via `--bearer` / `--token` flag or interactive prompt; token is injected as `Authorization: Bearer ...` header (or `http_headers` map for TOML-based clients) for all remote integrations. - feat(integrations): Codex, OpenCode, Qwen, Claude Code, Copilot CLI, Gemini CLI, VS Code Copilot, and Grok targets now write the bearer token using the exact header shape observed in real user configs (`headers.Authorization` for JSON clients, `http_headers.Authorization` for TOML clients). - fix(wizard): URL override prompt now shows two concrete examples with schemes and default ports (`http://127.0.0.1:9471`, `https://203.0.113.77:9473`) and explicitly instructs users to include the http/https prefix. - fix(integrations): `url_for` now correctly prefers http overrides when the user supplies an http:// URL even if the https slot still contains a value; Grok writer only emits `NODE_TLS_REJECT_UNAUTHORIZED` env var for https URLs. - feat(wizard): when Grok CLI is selected with an https URL, show a clear warning that Grok cannot skip self-signed certificate verification and recommend using the plain http:// URL on port 9471 instead. - feat(wizard): setup plan summary now shows a masked bearer token hint (first 8 chars + *****) when a bearer token is provided. - feat(search): HNSW approximate-nearest-neighbor vector backend is now enabled by default. The exact f32 cosine scan remains the fallback for small sidecars; once a managed sidecar exceeds `MENTISDB_HNSW_THRESHOLD` vectors (default 50,000) MentisDB switches to HNSW automatically. Both backends implement the same `VectorSearchBackend` trait, so public APIs and hybrid/ranked search semantics are unchanged. Build without the feature by disabling `hnsw-backend` in your Cargo feature set. - feat(search): HNSW graph persistence. Built graphs are serialized to disk and reloaded on daemon startup when the persisted thought count matches the live chain; stale graphs are deleted when a sidecar is rebuilt from scratch. Rebuilding uses an atomic temp-file + rename so readers never see a partial graph. - feat(search): background HNSW graph construction. When enabled via `MENTISDB_HNSW_BACKGROUND_BUILD` (default true), the daemon keeps an exact placeholder while the HNSW graph is built off-thread, then swaps the graph into the cached sidecar without interrupting queries. Dashboard status exposes `backend_kind` and `backend_building`. - feat(config): four new runtime environment variables for HNSW tuning: `MENTISDB_HNSW_THRESHOLD`, `MENTISDB_HNSW_EF_CONSTRUCTION`, `MENTISDB_HNSW_EF_SEARCH`, and `MENTISDB_HNSW_BACKGROUND_BUILD`. Dashboard Settings lists all four and reads them on demand. - feat(bench): `benches/hnsw_scale.rs` evaluates build time, recall@10, and per-query latency at 50k (default), 100k, and 1M vectors; 100k/1M are opt-in via env vars. - chore(search): removed the experimental quantized HNSW path; raw f32 HNSW yielded higher recall and lower latency than the quantized prototype. - fix(search): HNSW code review fixes. Module doc corrected (scaled-cast encoding, not bit-cast). `upsert_document` no longer wastes an orphan graph node on updates. `searcher()` method removed (was allocating fresh each call despite "reusable" doc). `HNSW_M` doc fixed (48, not 24). `with_backend_kind` returns `HnswBackendNotEnabled` error instead of silently creating a stub-metadata Exact backend. Removed `validate_vector_public` wrapper. Swallowed persistence/upsert errors now logged. All stale "upcoming"/"H0"/"H1" docs updated to present tense. `matches!()` test no-ops converted to `assert!(matches!())`. - fix(server): REST bearer-token middleware now extracts chain keys from the request body and query string to enforce chain-scoped token authorization. Previously, all REST endpoints accepted any active token regardless of scope, allowing chain-scoped tokens to access any chain. - fix(dashboard): settings API validates setting names against a whitelist and rejects values containing newlines, preventing arbitrary environment variable injection and `.env` file injection. - fix(dashboard): PIN authentication middleware now uses constant-time comparison (`subtle::ConstantTimeEq`) for all PIN checks, matching the login handler. The session cookie is now a random UUID token instead of the PIN itself. - fix(server): TLS certificates now use dynamic validity (now - 1 day to now + 2 years) instead of the hardcoded 2025-01-01 to 2027-01-01 range. - fix(server): TLS private key file is now written with 0600 permissions on Unix to prevent other local users from reading it. - fix(webhooks): webhook URL registration now validates the scheme (http/https only) and rejects URLs pointing to loopback, private, link-local, and CGNAT IP addresses to prevent server-side request forgery (SSRF). - fix(auth): `BearerTokenStore` now uses a mutex around the read-modify-write cycle on `bearer-tokens.json` to prevent concurrent token creation from silently losing tokens. `authorize_matching` save errors are now logged instead of silently swallowed. - fix(integrations): config files written by `mentisdb setup` / wizard that contain bearer tokens are now created with 0600 permissions on Unix. - fix(lib): agent registry and entity-type registry `thought_count` no longer doubles on every chain reopen. Loaded records are reset to zero before re-observing all thoughts. - fix(lib): `compute_thought_hash` integrity gap for `entity_type` and `source_episode` is now documented. These fields are excluded from the canonical hash for backward compatibility. - fix(lib): `BinaryStorageAdapter::clone` documentation now warns that concurrent writes from both original and clone will corrupt the hash chain. - fix(skills): `migrate_skill_registry` now writes atomically (temp file + rename) to prevent registry corruption on crash during migration. - fix(lemmas): `-ed` stripping no longer produces wrong lemmas for silent-e verbs (e.g. "hoped" → "hope" instead of "hop"). `-ing` stripping now skips common nouns (thing, string, morning, etc.) via a denylist. 0.10.1.46 JUN/05/2026 - feat(auth): built-in bearer-token authentication for remote MCP servers. `MENTISDB_BEARER_TOKEN_ACCESS=true` now protects standard Streamable HTTP MCP and legacy HTTP MCP routes with `Authorization: Bearer ...`; when the flag is disabled, local/default deployments keep the old unauthenticated behavior. Tokens are stored in `bearer-tokens.json` as SHA-256 hashes only, never as plaintext. This is the headline change in 0.10.1.46 — it is the prerequisite for any non-loopback deployment of the HTTPS MCP / REST surfaces and unlocks the rest of the auth work in this release. - feat(auth): scoped bearer-token registry and CLI. Operators can issue global tokens or tokens limited to one or more chains with: `mentisdb bearertoken create --global ` `mentisdb bearertoken create --chain [--chain ...] ` `mentisdb bearertoken list [--global | --chain ...]` `mentisdb bearertoken remove ` The CLI help is focused and explicit when users run `mentisdb bearertoken` or `mentisdb bearertoken --help`. - feat(auth): MCP chain-scope enforcement. Global tokens can call server-wide tools and access every chain. Chain-scoped tokens may call tools only for their configured chain set, including omitted `chain_key` requests only when the daemon default chain is within scope. Server-wide tools such as `mentisdb_list_chains` require a global token. - feat(dashboard): dedicated Bearer Tokens page in the header navigation (`Chains | Agents | Skills | Bearer Tokens | Settings`). The page exposes the bearer-token feature toggle, alias input, Global/Chains radio controls with Global selected by default, a full-width multi-chain selector table, one-time token display, copy-to-clipboard button, token table, and revoke action. - feat(dashboard): Settings can edit `MENTISDB_BEARER_TOKEN_ACCESS`, and the Settings page now includes a Restart Daemon button for environment changes that require a daemon restart. - feat(mcp): updated `cloudllm_mcp` integration to support dynamic bearer authorization context, including request payload/params so MentisDB can make chain/global authorization decisions inside the MentisDB auth policy layer. - feat(cli): new `mentisdb cert []` subcommand mints a self-signed TLS certificate for the HTTPS MCP and REST surfaces and the web dashboard, makes it the active cert on disk, and persists `MENTISDB_TLS_CERT` / `MENTISDB_TLS_KEY` into the local `.env` so the next daemon start picks the new paths up automatically. Supports: `mentisdb cert` `mentisdb cert ` (IPv4/IPv6 literal → IP SAN, DNS name → DNS SAN) `mentisdb cert --force` (regenerate an existing cert) `mentisdb cert --reset` (delete existing cert/key first, then generate a fresh factory-default certificate; implies `--force`) `mentisdb cert --out-dir ` (write to a non-default directory) `mentisdb cert --env-file ` (point at a non-default .env) `mentisdb cert --no-env-update` (print the export lines, leave .env alone) The standard SAN set (my.mentisdb.com, localhost, 127.0.0.1, every unicast IP on every host interface, plus MENTISDB_BIND_HOST when it is a DNS name) is always included; the user-supplied host is appended. Refuses to overwrite without `--force`, prints the SAN list and SHA-256 fingerprint for `openssl x509 -fingerprint -sha256` cross-check, and tells the operator to restart the daemon so the next HTTPS request serves the new cert. Full help lives in `mentisdb cert --help` and the "Minting a Custom Certificate" section of the User Guide. - feat(cli): comprehensive `--help` output. `mentisdb --help` now prints both the daemon help AND the full CLI subcommand help in one view, so users can discover all commands and flags at once. Subcommand-specific help works as expected: `mentisdb cert --help`, `mentisdb setup --help`, `mentisdb wizard --help`, `mentisdb add --help`, `mentisdb search --help`, `mentisdb agents --help`, `mentisdb backup --help`, `mentisdb restore --help`, `mentisdb bearertoken --help` each show only that subcommand's focused help. - feat(skill): MENTISDB_SKILL.md adds a prominent "🔎 SEARCH BEFORE YOU WRITE" section between MANDATORY STARTUP and WRITE TRIGGERS. The routine (`recent_context` → `ranked_search` → tighten with `tags_any` / `thought_types` / `concepts_any` / `since`) plus three decisions per append — do I need to write at all, do I need to update a prior lesson, which 1–3 neighbours to link via typed edges — and a new "Blind appends" anti-pattern. Search-first is the upstream half of the dedup discipline: 5–15 seconds of search before write is the single highest-leverage habit for keeping `ranked_search` useful as chains grow past a few hundred thoughts. - feat(server): expose `ensure_tls_cert_with_sans(cert, key, extra_sans, overwrite) -> TlsCertArtifacts` and the matching `TlsCertArtifacts { cert_path, key_path, sans, sha256_fingerprint }` so library consumers and the new `mentisdb cert` CLI can mint or inspect certs with custom SAN sets without re-implementing the `rcgen` + `x509-parser` dance. The existing `ensure_tls_cert` is now a one-line wrapper (overwrite=false, no extra SANs), so no behaviour change for existing callers. The `sans` field in `TlsCertArtifacts` is extracted from the freshly written cert with `x509-parser` (newly wired under the `server` feature in `Cargo.toml`) and rendered in the same `dns:` / `ip:` style the cert was built with, so a CLI caller can print them and a downstream consumer can grep for an IP or hostname. - feat(cli): `--headless` is now a real top-level flag. `mentisdb --headless` starts the HTTP/MCP/REST servers without the interactive terminal UI, matching the long-standing `--mode http --headless` invocation that the stdio proxy has used internally since 2ae780f. `--help` now lists the flag in both the Usage block and the Flags section. - fix(tui): the daemon auto-promotes to headless HTTP mode when stdin or stdout is not a TTY. Previously the TUI main loop was entered with an already-EOF stdin; crossterm's `event::poll(100ms)` returned `Ok(false)` immediately instead of honouring the timeout, and the loop re-rendered the full ratatui UI on every iteration — pinning one CPU core at 100% on a 2-core cloud VM. The new `tui_can_run()` guard in `src/tui.rs` detects the non-TTY case at startup and `run()` then delegates to the existing `run_headless()` so the HTTP servers come up and the process idles near 0% CPU. Affects every non-interactive launch: `docker run` without `-t`, `nohup mentisdb &`, `systemd` without `StandardInput=tty`, `cron`, and the SSH-disconnect scenario that produced the original report. - fix(restore): preserve local registries during cross-instance restores, append verified same-chain suffixes, and import divergent same-name chains under renamed keys. Restores are now idempotent and chain-scope-safe: the local `mentisdb-registry.json` is merged, not replaced, and `--overwrite` only allows same-path chain file replacement when a safe suffix merge is not possible. - fix(auth): generated token secrets now use the clearer `mentisdb_` prefix instead of `mdb_live_`; README, tests, docs site, and the demo script were updated to match. - fix(cli): `mentisdb cert` snapshots the on-disk existence of the cert + key before delegating to `ensure_tls_cert_with_sans`, so the human-readable report correctly distinguishes "Wrote new self-signed TLS cert" from "Reusing existing TLS cert" on a brand-new tempdir. The helper writes the files in the no-overwrite path, so a post-call existence check would always return true and the CLI would print "Reusing existing TLS cert" on a fresh cert. The `cert_existed_before` snapshot in `cli::cert::run_cert` is the reliable signal. - fix(tui): increased contrast for the bottom instruction/hint bar so navigation hints remain readable on low-contrast terminal themes. - refactor(cli): collapse the duplicated `writeln!` blocks in `cli::cert::run_cert` into small named helpers (`write_status`, `write_sans`, `write_fingerprint`, `write_export_instructions`, `write_or_warn_env_update`) so the report is composed in one place and every section can be tweaked without copy-paste. Help text is one source of truth: `cli::cert::help_text()` is consumed by `args::help_text()` and the binary's `daemon_help_text()`, so `mentisdb cert --help` and `mentisdb --help` always show the same wording. The shared help covers 6 worked examples (IP, DNS, `--force`, `--out-dir`, `--env-file`, `--no-env-update`), a flag table, a "when the new cert takes effect" paragraph, and the `openssl s_client` cross-check callout. - refactor(server): promote `default_tls_dir` to `pub` in `server.rs` and remove the duplicate `default_tls_dir` helper from `src/cli/cert.rs`. The `cert` module now reuses the canonical `crate::server::default_tls_dir()` for its fallback path, so the default TLS directory is defined in one place and library consumers can read the constant directly. - docs: new "TLS Certificates" section in README.md between Web Dashboard and Backup and Restore, with six worked examples, a full options table, the restart-required note, the `openssl s_client` cross-check snippet, and a "When the auto-generated SAN set is not enough" subsection. docs.mentisdb.com user_docs.rs gains a "Minting a Custom Certificate" subsection inside HTTPS & TLS with the SAN set contents, six worked examples, the options table, and the cross-check callout. docs.mentisdb.com agent_docs.rs gains a "When the Operator Needs a New TLS Certificate" section that helps agents recognize the symptoms (remote IP, custom hostname, new interface, key rotation, machine migration) and point the user at `mentisdb cert --force` plus a daemon restart. - docs: expanded remote bearer-token documentation in README and docs.mentisdb.com, including server activation, CLI token management, dashboard management, scoped access behavior, Codex `config.toml` header examples, and future usage-stats room in the token registry model. - docs: expanded crate-level and API rustdoc toward a manual-quality developer experience: custom integration guidance, production considerations, query/ranked-search examples, storage adapter extension notes, skill registry docs, thought/relationship/scope structs, and installation prerequisites. Follow-up fixes removed unresolved and redundant rustdoc links so strict docs builds stay clean. - docs(search): README now records the post-0.9.9 ranked-search validation scores: LoCoMo-10P overall R@10 72.6% (1436/1977), single-hop R@10 76.8%, multi-hop R@10 57.4%, weak-vector baseline 44.9% R@10, and ~317 queries/s evaluation throughput with the `fastembed-all-minilm-l6-v2` vector sidecar. - test: 9 new `cli::cert` unit tests cover the SAN builder across IPv4 / IPv6 / DNS / empty / invalid / None inputs, the env-line replacement (in-place update, append-when-missing, similar-prefix preservation, comment pass-through, mtime idempotence), the env file writer (create-when-missing, preserve-existing-entries, idempotent rewrite), `resolve_env_file` (override vs. fallback), `resolve_paths` (out-dir vs. env-var vs. default), and the help-text content (every flag mentioned, at least 5 example invocations). 15 new `tests/cert_tests.rs` integration tests cover parsing (positional, --force, --reset, --out-dir, --env-file, --no-env-update, error paths, --help), end-to-end PEM write + SAN verification via `x509-parser`, reuse without --force, regeneration with --force, --reset that deletes and regenerates, --reset with custom SAN, --no-env-update that leaves the .env alone, and the help-text roundtrip. All tests are isolated via `tempfile::tempdir` (unique per test) and a global `env_lock` mutex that serialises env-touching tests, so no test depends on inherited `MENTISDB_TLS_CERT`, `MENTISDB_DIR`, or `HOME` values. - chore: ignore generated LaTeX build artifacts and LME benchmark pycache files to keep future working trees cleaner. 0.9.9.45 MAY/30/2026 - feat(search): thesaurus now applies **automatically by default** to all ranked search queries (REST `/v1/ranked-search`, MCP, dashboard, CLI, and benchmark harnesses). No client changes required. The static thesaurus (895 headwords + 300+ lemmas) is invoked transparently via `apply_thesaurus_if_text` in the server for every text-bearing `RankedSearchQuery`. This surfaces the +31% NDCG research improvement to all users and the official LoCoMo/LongMemEval benchmarks. - feat(search): comprehensive static thesaurus for query-time synonym expansion — ~895 headwords covering verbs, nouns, adjectives, adverbs, and technical vocabulary; data is embedded into the binary at compile time via include_str! with no external file or network dependency; parser builds a unidirectional map from headwords to synonym lists; query terms are lemmatized (irregular + regular suffix stripping) before lookup so past-tense verbs like "went" resolve to "go" and find synonyms; default synonym_weight is 0.7; research harness shows +31% NDCG improvement over baseline (0.52 → 0.68) on synthetic corpus - feat(search): expand irregular verb lemma coverage from ~100 to 300+ entries — covers all common English irregular verbs and their past tense, past participle, and present participle forms; new lemmatize() helper combines irregular lookup with regular suffix stripping (-ing, -ed, -ies, -s) for comprehensive verb-form normalization - feat(search): add embedding-based synonym generator as alternative to static thesaurus — uses LocalTextEmbeddingProvider + VectorIndex to find cosine-similar terms from a fixed vocabulary; kept for experimentation but research shows it underperforms (NDCG 0.48 vs 0.68 thesaurus) due to hash-based feature vectors rather than true semantic similarity - feat(search): integrate synonym expansion into BM25 lexical scoring and ranked queries — LexicalQuery gains synonyms HashMap and synonym_weight (default 0.7); LexicalIndex::search_in_positions adds a fast path that bypasses synonym overhead when no synonyms are configured, keeping baseline latency neutral; when synonyms are present, expanded terms are scored with reduced weight relative to original term matches; RankedSearchQuery wires synonym maps through to rank_candidates_lexically - test(search): add search quality research harness comparing synonym generators — synthetic corpus (140 docs, 12 queries) with R@5, R@10, P@5, MRR, NDCG@5 metrics; compares manual oracle map, static thesaurus auto, embedding auto, and combined configurations; key finding: one high-quality source (thesaurus) outperforms combined maps because synonym noise degrades precision - feat(search): auto-infer implicit RelatedTo edges from vector cosine similarity — the vector sidecar and graph adjacency index were previously disconnected signals; chains where agents never author explicit refs or relations now have a dense implicit graph populated automatically; disconnected signals; chains where agents never author explicit refs or relations now have a dense implicit graph populated automatically; edges with cosine >= threshold (default 0.85, env MENTISDB_AUTO_EDGE_THRESHOLD) are kept, top-K per thought (default 5, env MENTISDB_AUTO_EDGE_K); the overlay is persisted to .auto_edges.bin with atomic rename and reloaded on chain open; threshold or K mismatch triggers a full rebuild; chains > 50 000 thoughts skip the O(N²) open-time build and grow the overlay incrementally; targets the 25.8% near-miss bucket (R@20 hits not in R@10) identified in whitepaper §9.3 - feat(search): VectorIndex::get_vector — retrieve one stored vector by document id from the in-memory cosine index - feat(search): ThoughtAdjacencyIndex::locator_map — expose id→locator map for callers that need to convert Uuid values to ThoughtLocator - feat(core): cache VectorIndex in-memory on ManagedSidecarEntry — rank_candidates_semantically no longer loads the vector sidecar from disk on every search call; the in-memory index is kept in sync on every append and full sidecar rebuild - fix(core): remove redundant load_or_rebuild_implicit_edge_overlay calls in apply_persisted_managed_vector_sidecars — the inner manage_vector_sidecar and register_vector_sidecar_for_search calls already trigger the overlay load/rebuild; the duplicate calls at the end of each cfg branch caused an unnecessary extra disk read on every daemon startup - feat(dashboard): chains table redesign — replaced "Agent Idx", "Entity Idx", and "Vector Idx" columns with "Chain" (on-disk file), "Semantic" (vector embeddings sidecars), and "Lexical (RAM)" (in-memory BM25 index); the Lexical column shows `—` for unloaded chains and an estimated size (e.g. `53 KB`) once the chain is accessed and its index is built; Lexical header and values are styled in amber to indicate in-memory-only state - feat(search): add `LexicalIndex::estimated_memory_bytes()` to approximate the RAM footprint of the in-memory BM25 postings map, document-stats vector, and metadata; lower-bound estimate — real heap may be 1.2–1.5× larger - feat(api): add `MentisDb::estimated_lexical_index_bytes()` public method so dashboard and other callers can surface the lexical index size without accessing private fields - refactor(dashboard): rename `chain_sidecar_sizes` → `vector_index_size` and simplify `api_chains` JSON to expose only the three meaningful index sizes (chain file, semantic sidecars, lexical RAM estimate) per chain - feat(dashboard): comprehensive tooltips across the entire UI — every nav link, summary stat, table header, action button, form field, filter control, and modal now has a friendly HTML title attribute explaining what it does and what data it represents; uses native browser tooltips for zero-dependency compatibility - feat(backup): include .auto_edges.bin in backup archives — implicit edge overlay files are now packed alongside vector sidecars in .mentis archives and cleaned up on chain deregister/deletion - fix(core): daemon no longer silently fails to recreate .auto_edges.bin on restart after deletion — load_or_rebuild_implicit_edge_overlay now prints a diagnostic eprintln! when the sidecar load fails, when all managed sidecars lack a cached index (VectorIndex build failure), when the > 50 000 thought branch saves an empty overlay (was never saved — caused rebuild on every restart), and when save_to_path itself fails; all silent early-return paths are now observable - fix(dashboard): escape backtick in Lexical column tooltip title attribute - feat(dashboard): expose auto_edges_size in chains API and UI — chains table gains an "Edges" column showing the on-disk size of the implicit-edge overlay sidecar (.auto_edges.bin), plus a "Total Edges" summary stat in the header bar; the API response includes auto_edges_size and auto_edges_size_formatted for registered, live, and unregistered chains - docs(whitepaper): update to v0.9.8 with implicit edge overlay — document ImplicitEdgeOverlay in abstract, contributions, file layout, and retrieval sections; update benchmark scores, keywords, and file layout diagram to include .auto_edges.bin and entity-types.json - feat(tui): show total chain + index size and storage path in chains table — the "Storage" column now shows the total on-disk size of the chain file plus all sidecar indices (agents.json, entity-types.json, vector sidecars, auto_edges.bin); a new "Location" column shows the chain file path; replaces the previous single column that showed only the chain file size prefixed to the path - fix(core): repair missing .auto_edges.bin for already-open daemon chains — cached server and dashboard chain accesses now opportunistically call ensure_implicit_edge_overlay() when no writer holds the chain lock, so deleting the overlay sidecar while the daemon is running no longer leaves the file absent until a full process restart; added regression coverage for both cached-chain repair and reopen-time rebuild - feat(search): add retrieval improvement primitives for the next search pipeline iteration — new isolated modules provide deterministic Personalized PageRank graph scoring, pseudo-relevance feedback query expansion, append-only summary candidate selection, and heuristic query-intent route planning; modules are exported for testing and future integration but do not change default ranked search behavior yet - feat(memory): expose read-only append-only summary candidates — core, REST, and MCP callers can request deterministic source windows for future Summary thoughts using `mentisdb_summary_candidates` / `/v1/summary-candidates`; the API only selects candidate ranges and never generates text, rewrites memory, or appends summary thoughts - revert(search): remove PRF query expansion, PPR graph scoring, and query-aware routing from ranked-search pipeline — benchmark validation (LongMemEval 500q) showed these features did not improve recall and added latency; the primitive modules remain in src/search/ for future work but are no longer wired into default or opt-in ranked search; REST/MCP request parsing and score fields for prf/ppr removed; summary candidates API is unaffected 0.9.8.44 MAY/07/2026 - BREAKING: rename binary from `mentisdbd` to `mentisdb` — all CLI commands, documentation, install scripts, CI artifact names, and TUI references updated; `cargo install mentisdb` still installs the crate, but the resulting binary is now `mentisdb` (no trailing `d`) - feat(dashboard): chains table now shows a "Size" column with human-readable storage size (B, KB, MB, GB, TB, PB) computed from each chain's on-disk file; summary bar shows total size, thoughts, agents, and per-index size totals - feat(dashboard): new Settings tab — view and edit all 18 `MENTISDB_*` env vars in a table with type-aware controls (checkbox for booleans, number for ports, text for strings); shows current value, default, and description per setting; "Reset to Default" per row; "Apply Settings" persists changes to a `.env` file and hot-reloads `auto_flush` immediately; restart-required flag for network/storage changes that cannot be applied to a running daemon - feat(tui): show chain file size in Storage Location column — prefixed with human-readable size in brackets (e.g. [10 KB] /path/to/chain.tcbin); sizes shown in B, KB, MB, or GB as appropriate; running status now includes PID - feat(config): dotenvy support — mentisdb now loads environment variables from a `.env` file in the current working directory at startup; existing shell environment variables take precedence over `.env` values; silently ignored when no `.env` file is present; all `MENTISDB_*` env vars, `RUST_LOG`, and `OPENAI_API_KEY` can now be managed via project-local `.env` files for cleaner per-project configuration - test: add `start_servers_headless_without_tui_state` regression test for the headless daemon startup path used by stdio proxy auto-launch and `--mode http --headless` - bench: LoCoMo R@10 = 71.80% (single 75.80%, multi 57.20%) 0.9.7.43 APR/30/2026 - fix(dashboard): harden skill Markdown rendering — dashboard-rendered skill links now escape labels and href attributes, allow only http/https/mailto protocols, and render unsafe links as plain text, preventing stored skill content from creating scriptable links in the same-origin dashboard - fix(dashboard): editing from the skill detail page now targets the version being viewed and defaults to the latest version instead of the oldest version; valid-but-missing version UUIDs now return 404 instead of 500 - chore(backup): ignore the new *.mentis backup archive extension in git so private chain, agent, vector, and skill data is not accidentally committed - fix(stdio): remove synthetic ack for notifications in stdio proxy — the old {id:'ack', result:{}} response broke Claude Desktop's MCP SDK which validates that response ids match pending requests; notifications are now silently absorbed (forwarded to daemon, nothing written to stdout), fixing the 'Unexpected end of JSON input' error that prevented Claude Desktop from connecting - feat(stdio): --headless mode for background daemon auto-launch — the stdio proxy now passes --mode http --headless when spawning a background daemon, starting HTTP servers without the TUI (which crashes when stdin is null); adds DaemonArgMode::RunHeadless and run_headless() that skips TUI/terminal setup, runs migrations silently, and waits for SIGINT - feat(dashboard): skill editing — each skill row now has an Edit button that opens a modal with a textarea pre-filled with the skill's current markdown content; Save calls the existing upload endpoint to create a new version; preserves original agent_id and format; also fixes uploader column showing '—' instead of actual agent name - fix(stdio): tighten SSE detection in proxy — changed from contains('event:') to starts_with('event:') / starts_with('data:') to avoid false positives from tool descriptions containing the substring; added empty response body filter so 202 Accepted responses don't write empty lines to stdout - fix(stdio): local stdio mode now echoes client's protocol version instead of hardcoded 2025-06-18, and tool definitions include execution field {taskSupport:'optional'} matching the daemon's streamable HTTP output - feat(primer): updated priming phrase to 'use mentisdb as your memory system' across TUI, mentisdb.com, and docs.mentisdb.com - refactor(skill): MENTISDB_SKILL.md — strengthened TaskComplete trigger rule to emphasize immediate write on completion (not deferred), added 'deferring memory writes' to anti-patterns list - fix(update): clean up TUI terminal before restart to prevent ANSI garbage; old code called cmd.spawn()+exit(0) which killed the TUI thread without running TerminalCleanup, so the new process inherited alternate screen + raw mode; new restart_process() helper disables raw mode, leaves alternate screen, and uses exec() on Unix to replace the process (no zombie window), falling back to spawn+exit on non-Unix with terminal restored 0.9.6.42 APR/29/2026 - feat(tui): wider update dialog (80 cols) so GitHub release URL fits without wrapping; successful update now shows a green "Update Complete" overlay with the exact relaunch command and offers r to restart in-place or q to quit; mentisdb auto-restarts with the same CLI args when the user presses r - feat(backup): rename backup format from .mbak to .mentis; backup CLI now uses -o shorthand for --output (both still accepted); restore aborts with a clear error if mentisdb is detected running, preventing the daemon's in-memory state from overwriting restored files on next flush - feat(mcp): SSE support on MCP servers — start_mcp_server and start_https_mcp_server now return (ServerHandle, SseBroadcaster) tuples; GET endpoint returns text/event-stream with live MCP events, POST requests auto-broadcast JSON-RPC results/errors as SSE events; cloudllm_mcp bumped to 0.3.0 - feat(server): bind_host parameter on standard_mcp_router — respects MENTISDB_BIND_HOST env var (defaults to 127.0.0.1) for flexible network binding on multi-homed machines - feat(mcp): add agent_id parameter to mentisdb_recent_context — allows filtering recent context by specific agent identity instead of always using the chain's default agent 0.9.5.41 APR/26/2026 - feat(mcp): upgrade cloudllm_mcp to 0.2.1 — MCP 2025-11-25 protocol support; streamable HTTP servers now validate Origin headers for security on bound addresses and transparently skip validation on unspecified (0.0.0.0/::/::1) addresses for compatibility with tools that don't send Origin; protocol version negotiated during initialize is now "2025-11-25" - feat(ecosystem): Hermes agent by Nous Research ships a native MentisDB MemoryProvider — Hermes can now connect directly to a running mentisdb instance for durable semantic memory without an intermediary MCP bridge; the Hermes team implemented their own memory plugin against the MentisDB API for deeper integration into the Hermes agent lifecycle - fix(dashboard): restore "+Bootstrap New Chain" and "↺ Refresh" buttons on the Chains page — a refactor in 8ce4ff2 moved the Bootstrap modal HTML to a static section and introduced a one-shot `_chainBootstrapWired` guard, but accidentally dropped the `cl-bootstrap-btn` and `cl-refresh-btn` click handlers; the buttons rendered but did nothing after the first renderChainList() call because the guard prevented re-attaching handlers when the header DOM was rebuilt - fix(dashboard): header buttons (Refresh, Bootstrap) now re-attach their event listeners on every `renderChainList()` call instead of only on the first call, fixing a latent bug where navigating between pages (Chains → Agents → back to Chains) silently broke those buttons after any page transition 0.9.4.40 APR/23/2026 - perf(search): incremental LexicalIndex — built once at chain open time and updated incrementally on every append_thought; eliminates the O(n) full-index rebuild that was happening inside every ranked search query; drops query_ranked_lexical_content latency from ~35 ms to ~237 µs (99.3% faster) and query_ranked_filtered_lexical from ~35 ms to ~23 µs (99.9% faster) on a 5 000-thought chain; scales sub-linearly with chain size instead of linearly - feat(daemon): per-read-operation sine-wave sounds — each logged read command (search, list_chains, get_thought, etc.) plays a unique 60–150 ms chime when MENTISDB_THOUGHT_SOUNDS=true; read sounds use pure sine waves in the 2 500– 4 500 Hz range, while write sounds remain square-wave at 250–1 000 Hz, making the read/write distinction instinctive by pitch and timbre - perf(dashboard): Agents page now loads in two phases — phase 1 renders an instant skeleton from /dashboard/api/chains (fast registry read), then phase 2 fires parallel per-chain requests to /dashboard/api/agents/:chain_key; each section populates independently as its response arrives, eliminating the serial O(total chains × total thoughts) blocking that made the page unusable with many chains - fix(dashboard): align Recent Thoughts table columns on agent detail page — the was missing the Content , causing the Date to slide under the Content header and the Branch button to slide under the Date header; restored the content preview cell and reordered cells to match headers - docs: agent memory protocol post — Hermes MemoryProvider as community standard - docs: OpenClaw × MentisDB integration post and protocol reassessment 0.9.3.39 APR/18/2026 - feat(tui): full ratatui-based terminal user interface replaces text startup output — three-pane layout: top (banner + config + endpoints), middle (tabbed tables for chains/agents/skills with FocusedPane cycling via Tab/Shift+Tab, mouse click focus, contextual vim-style hint bar), bottom (agent primer + terminal-close warning); all panes scrollable with clamped bounds; TerminalCleanup RAII guard ensures safe terminal restoration on panic or early return; standard 8-color palette adapts to dark and light terminal backgrounds - feat(tui): drag-to-select copies any visible text — drag the mouse across any content (log lines, chain/agent/skill rows, endpoints, config, primer); on mouse release the selected rectangle is read from ratatui's live render buffer and written to clipboard via arboard + OSC 52 (enables Cmd+C on macOS in iTerm2, Terminal.app, kitty, WezTerm); live selection highlight via REVERSED cell style - feat(tui): 'c' key copies focused item — chain key, agent ID, skill name, full primer paste line, or visible log lines; 2-second green toast anchored near the focused pane confirms every copy - feat(tui): startup progress overlay — TUI renders immediately with a centered modal showing current phase; update dialog appears as an in-TUI modal - fix(tui): seamless single-TUI lifecycle — daemon runs one TUI instance for its entire lifetime; eliminates the visible flash/crash between startup and running phases that occurred when two TUI instances were started sequentially - fix(tui): startup crash overlay — when startup fails, a red full-screen overlay shows the error and keeps the TUI alive so the user can scroll logs before quitting; previously the daemon exited silently - fix(tui): log auto-scroll corrected for newest-first display — was pinned to the oldest entry (scroll=len-1 in a reversed list); now pins to scroll=0 (top=newest) - fix(tui): ratatui buffer swap — text extraction from drag-select now runs inside the terminal.draw() closure via frame.buffer_mut(), which is the live pre-swap buffer; current_buffer_mut() after draw() returns the cleared next-frame buffer - fix(tui): overlays use Clear widget to prevent background content bleeding through popup borders; startup overlay and update dialog are mutually exclusive - fix(tui): accurate startup status — "Checking chains for migrations…" instead of "Running migrations…" when no migrations are needed - fix(tui): chain key and skill name columns auto-sized to longest entry + 1 - fix(tui): custom TuiLogger routes log output into TUI log buffer via mpsc channel, preventing raw stderr from corrupting the ratatui alternate screen - fix(tui): first-run setup wizard deferred to a separate terminal — wizard cannot run while TUI owns the terminal in raw/alternate-screen mode; TUI shows a note directing the user to run `mentisdb wizard` in a separate terminal instead - perf(tui): render_logs no longer allocates an intermediate Vec<&str> on every frame; single .iter().rev() pass reduces allocations at 10 Hz render rate - refactor(tui): removed dead code left by a prior session — show_update_dialog(), background_tip field, and background_launch_tip() were set/defined but never called or rendered - fix(stdio): proxy_jsonrpc_to_daemon now forwards raw JSON-RPC to the daemon's streamable HTTP endpoint (POST /) instead of manual method mapping, supporting the full MCP protocol (tools, resources, prompts, sampling, roots, notifications); resources/read still served locally (embedded skill markdown) - fix(daemon): remove broken `brew services start mentisdb` from macOS background launch tip — the formula does not ship a launchd plist; startup messaging now shows only the working nohup one-liner - chore: make ratatui 0.30 a non-optional always-on server dependency - fix: silence per-thought audio during benchmarks (MENTISDB_THOUGHT_SOUNDS=false) - chore: gitignore pymentisdb build artefacts + *.mbak backups 0.9.2.38 APR/17/2026 - feat(stdio): smart daemon detection in stdio MCP mode — the stdio process now checks if a daemon is running via the health endpoint, proxies to it if found, or launches one in the background (nohup on Unix, start /B on Windows); all MCP clients that spawn stdio subprocesses (Claude Desktop, Cursor, etc.) now share the same live chain cache with zero configuration; falls back to local mode if daemon launch fails - fix(server): `start_servers` now shares ONE `MentisDbService` across the HTTP MCP, HTTP REST, HTTPS MCP, HTTPS REST, and dashboard surfaces. Previously each surface received its own `MentisDbService::new(...)` and therefore its own `DashMap>>`, causing a cross-surface split brain: an append via REST was invisible to MCP (and vice versa) until the daemon restarted and both services reloaded the chain from disk. Public single-surface entry points (`start_mcp_server`, `start_rest_server`, `start_https_*_server`) are unchanged. Adds regression test `start_servers_shares_state_across_mcp_and_rest` that pre-warms the MCP service, appends via REST, and asserts MCP immediately sees the new `head_hash` / `thought_count` / `latest_thought.index`. - feat: POST /v1/admin/flush REST endpoint — iterates all open chains and calls flush() on each BinaryStorageAdapter; documented in server module header - feat: backup/restore — new mentisdb backup / mentisdb restore subcommands create and restore .mbak zip archives of the full MENTISDB_DIR; manifest with SHA-256 checksums for every file; verification before any file is written on restore; --flush, --include-tls, --overwrite flags; 33 integration tests in tests/test_backup.rs covering roundtrip, TLS inclusion, idempotent restore, overwrite, corruption detection, chain count, byte totals, manifest JSON round-trip, required vs optional file tagging, subdirectory creation - feat: backup CLI auto-detects running daemon — calls POST /v1/admin/flush before reading files; connection refused means daemon not running (files captured as-is); other errors warn but proceed; BackupOptions docs updated to explain flush behavior - feat: restore CLI interactive conflict prompt — when files exist in target dir and --overwrite not passed, lists conflicting files and prompts user with boxed_yn_prompt; user decline exits gracefully with no changes; restore is fully idempotent without prompt - feat: terminal-close warning printed at daemon startup — yellow ⚠ notice that closing the terminal stops mentisdb, followed by OS-specific background-launch tip: macOS: nohup one-liner Linux: systemd user service unit snippet or nohup one-liner Windows: schtasks /create one-liner or Start-Process -WindowStyle Hidden - feat: CLI help text updated for backup and restore subcommands — clarifies daemon flush detection, idempotent restore behavior, interactive prompt, and --overwrite skip note - fix(search): federated search dedup now keeps the higher-scoring duplicate occurrence, matching the documented contract, instead of whichever chain surfaced the UUID first - fix(relations): relation dedup no longer collapses distinct edges that differ by `chain_key`, `valid_at`, or `invalid_at`; only exact duplicate relations are removed - fix(webhooks): webhook registry persistence now uses temp-file-plus-rename instead of truncating the live registry in place; delivery fan-out is now bounded by a queue and concurrency semaphore so bursty append workloads do not spawn an unbounded number of webhook tasks immediately; added tests for rename-failure preservation and bounded delivery - fix: branch ancestor discovery is now transitive — branch-aware search can walk from child to parent to grandparent chains instead of stopping at the direct parent only - fix: restore now rejects path-traversal entries inside `.mbak` archives before any file extraction; crafted manifest paths like `../escape.txt` or absolute paths now fail restore with `InvalidData`, preventing writes outside the target directory - fix: interactive restore confirmation now actually enables overwrite mode when the user answers yes; previously the prompt implied overwrite but still passed `overwrite=false` unless `--overwrite` was supplied explicitly - fix: LLM-extracted memories no longer send an OpenAI `response_format` hint — some OpenAI-compatible endpoints rejected the request with a schema/type error; MentisDB now relies on the prompt plus strict JSON validation of the returned payload, preserving portability across providers; added a regression-style test covering raw parse error output - fix(pymentisdb): `context_bundles()` now decodes proper typed `ContextBundleSeed` and `ContextBundleHit` objects instead of incorrectly nesting `ContextBundle` inside `ContextBundle.seed`; `append_thought()` now uses one canonical `ThoughtInput` payload builder instead of duplicated request assembly; `ranked_search()` and `context_bundles()` now accept `MemoryScope` enums directly and serialize them to the API's lowercase request form; added focused Python client tests - fix: wizard — ensure_prerequisites for Claude Desktop now prompts before brew install on macOS (previously silently ran brew install mcp-remote without asking); on macOS brew is tried first, npm is the fallback; dead check_node_version and detect_brew_mcp_remote functions removed; detect_mcp_remote_any() checks Homebrew paths then PATH - fix: wizard — mcp-remote is now used directly without a node wrapper when installed as an absolute executable (is_absolute_executable check); the shebang-based is_directly_executable fallback is retained for npm-installed scripts with a good shebang; integration_apply_tests updated to assert the correct behavior - fix(bench): rebuild session_map after --limit filter in LoCoMo — on dev runs, ground-truth evidence from filtered-out personas was leaking back into R@K scoring via _expand_evidence() neighbor lookups; the fix rebuilds session_map on the kept item set immediately after filtering; full-scale runs were unaffected - chore(server): extract `invalid_input_error()` and `not_found_error()` helpers next to `service_call`; replace four `Box::new(io::Error::new(...))` callsites with them for tighter request-rejection plumbing (net: -8 lines of boilerplate, identical behavior) - test(skill-signing): strengthened server-side signature-verification coverage for skill uploads — now explicitly checks missing signature fields, unknown signing-key ids, and tampered signatures with clearer failure assertions - docs(whitepaper): rewrote WHITEPAPER.md in academic register with formal definitions (Thought, Chain, BM25, RRF, Jaccard dedup, temporal validity), a tamper-evidence proof sketch, and a References section; added WHITEPAPER.tex LaTeX port using amsmath/amsthm/booktabs/\newtheorem; added build-whitepaper.sh with macOS and Ubuntu install instructions, --open/--clean flags, and path_helper sourcing so it finds pdflatex after a fresh BasicTeX install; added author affiliation (Universidad Católica Andrés Bello, Venezuela) - docs(whitepaper): corrected v0.8.9 benchmark numbers to match reproducible results — LongMemEval R@10 changed 74.1% → 72.2%, added R@20 = 78.0%; filled in previously empty LoCoMo-10P v0.8.9 single-hop (75.8%), multi-hop (57.4%), and R@20 (79.1%) cells; three independent full-scale runs (2026-04-14, 2026-04-17 × 2) produced bit-identical scores; added a reproducibility caption under the results table - docs(blog): new ranked-search pipeline walkthrough (docs/mentisdb-ranked-search-pipeline.html) covering filter-first selection, as-of temporal filter, three parallel scorers (BM25, dense vector, graph BFS), smooth exponential fusion, session cohesion, RRF, and deterministic sort — with file:line citations for every phase; prefaced with a "Three Signals, Three Failure Modes" explainer (vocabulary match vs meaning match vs relationship match) and a subsection on why BFS vs DFS for graph expansion - docs(server,readme): introduce `invalid_input_error()` / `not_found_error()` helpers; fill README coverage gaps for `source_episode`, `entity_type`, `BranchesFrom`, `mentisdb_federated_search`, `mentisdb_extract_memories`, `mentisdb_list_entity_types`, `mentisdb_upsert_entity_type` (MCP catalog count 37 → 42) - docs(docs.mentisdb.com): add Advanced Retrieval section (RRF, context bundles, dense vector sidecars, branching chains, federated search), Entity Types & Provenance section (per-chain entity_type registry, source_episode), Webhook Callbacks, LLM-Extracted Memories, and pymentisdb Python Client sections to user_docs.rs; add LLM-based reranking, Operations & Admin (POST /v1/admin/flush, .mbak backup/restore, MENTISDB_DASHBOARD_PIN) to developer_docs.rs - docs: daemon endpoint catalog and REST rustdocs updated to include the live router surface (`/v1/federated-search`, `/v1/import-markdown`, entity types, chain merge, webhooks, extract-memories, admin flush, and related endpoints); startup catalog generation now uses a shared helper to keep HTTP/HTTPS REST listings aligned - docs: `mentisdb --help` now documents `MENTISDB_DASHBOARD_PIN`, matching the daemon's supported environment variables and startup output - docs: new content-ingestion tutorial blog post (`docs/mentisdb-content-ingestion.html`) covering setup, REST/MCP/Rust usage, live-tested behavior, review-before-append workflow, troubleshooting, and use cases for normal users, enterprise knowledge workers, and coders - docs: new MentisDB vs Cognee comparison post (`docs/mentisdb-vs-cognee.html`) with a fair architectural comparison and comprehensive side-by-side table; blog index updated to surface the new posts first - docs(skill): audited the live MentisDB project chain and found heavy concentration in `Summary` / `LessonLearned` plus near-total collapse of typed edges to `References`; revised `MENTISDB_SKILL.md` to push minimum backlinking, richer relation selection, `Invalidates`, `LLMExtracted`, and higher-value underused types; added a new blog post (`docs/mentisdb-memory-usage-audit.html`) documenting the findings and the fix - docs: refreshed README, Rust docs, and `docs/llm-extracted-memories-design.md` to match the shipped ingestion behavior: 31 thought types total, `gpt-4o` defaults, no auto-append, no `response_format` requirement, and explicit JSON schema validation instead - docs: `docs/mentisdb-backup-and-restore.html` blog post covering backup/restore CLI, consistency model, SHA-256 manifest, .mbak format, REST endpoint, security notes 0.9.1.37 APR/14/2026 - feat: LLM-extracted memories — GPT-4o (or any OpenAI-compatible endpoint) converts raw agent text/logs/transcripts into structured ThoughtInput records for review and append; opt-in behind llm-extraction feature (default), uses openai-rust2 with 3× retry on 429/5xx, 60s timeout, ResponseFormat::JsonObject, temperature 0.1; LlmExtractionConfig::from_env() reads OPENAI_API_KEY, LLM_BASE_URL, LLM_MODEL; ExtractionResult includes model identifier and token usage; callers must review and validate thoughts before appending - feat: federated cross-chain search — ancestor_chain_keys() walks BranchesFrom relations to discover parent chains; ranked search on branch chains transparently includes ancestor chain results and annotates them with chain_key; enables fleet memory hierarchies where specialist chains share a common base - feat: pymentisdb Python client v0.9.0 — pip-installable Python package with MentisDbClient (append_thought, ranked_search, context_bundles, list_chains, upsert_agent, lexical_search, search, get_thought, traverse_thoughts, recent_context, head, register/list/delete_webhook, skill methods, memory_markdown, import); MentisDbMemory LangChain integration; full ThoughtType, ThoughtRole, MemoryScope, ThoughtRelationKind enums; Typed relations; Complete working examples - feat: wizard brew-first install — ensure_prerequisites tries brew install mcp-remote before npm; added PrerequisiteStatus::Skipped variant; detect_brew_mcp_remote() reads mcp-remote shebang to detect Homebrew-installed mcp-remote (which has a proper shebang pointing to the correct Node version, usable directly without node wrapper) - fix: wizard overwrite prompt changed to "Overwrite it with a fresh setup?" (was "Overwrite or keep the existing config?") for clarity - fix: CI doctest for LlmExtractionConfig uses unwrap_or_else instead of unwrap on OPENAI_API_KEY to avoid panic in CI environments without the env var - fix: LlmExtractionError::NotConfigured no longer panics on empty API key; returns a proper error instead - docs: two new blog posts covering complete MCP + REST integration: docs/mentisdb-third-party-integrations.html (wizard setup, Claude Desktop mcp-remote+Homebrew, OpenCode, REST API with full endpoint coverage, Python requests examples, all 37 MCP tools, troubleshooting) docs/pymentisdb-python-client.html (complete MentisDbClient API, LangChain integration, typed relations, complete working example) - docs(README): Python client section with pip install and example; consolidated Setup Scenarios section for Claude Desktop, Claude Code, OpenCode, Codex, Qwen - docs(docs.mentisdb.com): MCP section expanded with all 37 tools, REST section back-to-back with complete endpoint coverage and request/response schemas - docs: LLM extraction design doc (llm-extracted-memories-design.md) updated to reflect openai-rust2 usage, extract_memories_from_text API, LlmExtractionConfig, ExtractionResult, TokenUsage, LlmExtractionError variants - docs(ENGINEERING_PIPELINE): Phase 5 step 5l added — doc audit requirement for all public API changes reflected in docs/, README, docs.mentisdb.com, docs.rs - bench: LoCoMo 10-persona R@10 72.0%, LongMemEval R@5 66.8% (fresh chain) - WebhookManager registered at MentisDbService level, cloned per chain - Registration: POST /v1/webhooks with url, chain_key_filter, thought_type_filter - List: GET /v1/webhooks, Get one: GET /v1/webhooks/{id}, Delete: DELETE /v1/webhooks/{id} - MCP tools: mentisdb_register_webhook, mentisdb_list_webhooks, mentisdb_delete_webhook - WebhookPayload includes webhook_id, chain_key, thought full details, timestamp - Delivery is fire-and-forget (tokio::spawn, non-blocking from append path) - Exponential backoff retries: up to 5 attempts, max 32s delay - Persisted to $MENTISDB_DIR/webhooks.json - feat(search): irregular verb lemma expansion at query time in lexical search - normalize_lexical_tokens() gains expand_lemmas bool parameter - expand_lemmas=false at index time (avoids duplicate postings) - expand_lemmas=true at query time (bridges went→go, ran→run, etc.) - Uses existing lemmas.rs lookup table (160+ irregular verbs) - Dedup logic (dedup_threshold) also uses expand_lemmas=true - fix: duplicate closing braces in lexical.rs (syntax error from prior edit) - test: add integration tests for webhook manager persistence and delete 0.8.8.34 APR/13/2026 - feat: add source_episode field to Thought for episode provenance tracking - Optional episode/conversational context identifier groups related thoughts - Added to Thought, ThoughtInput (with with_source_episode() builder), ThoughtQuery (with with_source_episode() filter), thought_json output, and dashboard API - Not included in thought hash (backward compatible, like entity_type) - feat(search): add opt-in LLM-based reranking for ranked search - New fields on RankedSearchQuery: llm_rerank (bool), llm_model (Option), llm_rerank_top_k (usize, default 20), with_llm_reranking() builder - RankedSearchScore gains llm_score field (0.0 when disabled) - MentisDb::llm_rerank_candidates() calls OpenAI or Anthropic API with graceful fallback on failure (falls back to original ranking) - REST: POST /v1/search/rerank dedicated endpoint - LLM reranking is query-time only, no persistence required - feat(search): verify and fix cross-chain graph query traversal - resolve_context_by_id now properly skips cross-chain relations (those with chain_key.is_some()) during local traversal - ThoughtAdjacencyIndex correctly tracks cross-chain targets via ThoughtLocator::cross_chain - Graph expansion works across chains via BranchesFrom relations - ancestor_chain_keys() discovers parent chains for cross-chain ranked search - test: add 8 search sanity-check regression tests - query_with_tags_any_returns_all_matching_thoughts - query_with_types_returns_only_matching_types - query_returns_empty_when_no_match_exists - query_with_text_search_finds_content - query_with_text_search_is_case_insensitive - query_filter_by_importance_threshold - entity_type_filter_returns_only_matching_entity_types - cross_chain_relation_traversal, query_respects_cross_chain_chain_key - test: LLM reranking tests (llm_rerank_disabled_by_default, llm_rerank_falls_back_on_failure, llm_rerank_top_k_respected) - test: source_episode tests (source_episode_field_round_trips, source_episode_filter_in_query, source_episode_none_when_not_set) 0.8.7.33 APR/13/2026 - feat(entity_type): add entity_type field to Thought struct with V3 backward-compatible deserialization - Thought struct gains optional `entity_type: Option` field with `#[serde(default)]` - Per-thought version detection for V3 chains with and without entity_type field - `ThoughtInput` gains `entity_type` field, passed through builder pattern - `Thought::with_entity_type()` builder method - entity_type is NOT included in the thought hash (backward-compatible) - bincode 2.0.1 respects `skip_serializing_if` — must NOT use it on entity_type - feat(entity_type): EntityTypeRegistry per chain with auto-observe, persistence, query filter - New `EntityTypeRegistry` struct tracking first_seen_index, last_seen_index, count - Auto-observed on every append when entity_type is set - Persisted as `chain_key-entity-types.json` alongside the chain binary - `list_entity_types()`, `get_entity_type()`, `upsert_entity_type()` on MentisDb - MCP endpoint: `POST /v1/entity-types` for upsert, `GET /v1/entity-types` for list - MCP tool: `mentisdb_upsert_entity_type` - ThoughtQuery gains `entity_type` filter for semantic filtering - Dashboard search UI gains entity_type filter input - feat(dashboard): display entity_type badge in thought rows and add entity_type filter - `thought_json()` now includes entity_type field in output - entity_type badge next to thought_type badge in all thought row views - entity_type badge in thought detail modal - DashboardSearchQuery gains entity_type filter parameter - dashboard_search_filter wires entity_type to ThoughtQuery - fix(dashboard): convert branch/delete/merge modals to popup overlays - Modals now use .modal-overlay hidden popup dialogs instead of inline display:none divs - Moved modal HTML and JS handlers to top-level of script for availability from any page - Added X close buttons and backdrop click-to-close for all modals - All style.display toggles replaced with classList.add/remove('hidden') - fix(server): resolve_chain_key now trims and filters empty strings before fallback - Added `.map(str::trim).filter(|value| !value.is_empty())` before `unwrap_or` - Matches the pattern already used in `resolve_agent_identity` - Handles `Some("")` and `Some(" ")` correctly - fix(wizard): continue past failed integrations instead of aborting (Issue #14) - `ensure_prerequisites` returns `PrerequisiteStatus` (Ok or Warning) not errors - `apply` loop in wizard.rs catches per-integration failures and continues - `apply_setup_with_environment` returns warnings not errors for soft checks - fix(dashboard): _openBranchChain accepts optional thoughtId parameter - Branch button on thought rows passes thought UUID to the modal - fix(dashboard): define global onclick handlers early as stubs with queue-draining - Branch/delete/merge onclick handlers are now top-level functions available from any page - fix(server): accept schema v4+ chains by trying current Thought deserialization first - Changed `v == MENTISDB_CURRENT_VERSION` to `v >= MENTISDB_CURRENT_VERSION` - Falls back to LegacyThoughtV2 for older schemas - Schema version normalized to MENTISDB_CURRENT_VERSION on next persist 0.8.6.32 APR/12/2026 - feat(search): Reciprocal Rank Fusion (RRF) reranking for ranked search - New `src/search/ranked.rs` with `rrf_merge()`, `rrf_merge_three()`, RRF_K=60 - `RankedSearchQuery` gains `enable_reranking: bool` (default false) and `rerank_k: usize` (default 50) fields with `with_reranking()` builder - When enabled, three single-signal rankings (lexical-only, vector-only, graph-only) are merged via `1/(k + rank)` and replace the additive total; importance, confidence, recency, session cohesion, and graph signals are added back as small additive adjustments - `RankedSearchScore` gains `rrf: f32` field (0.0 when reranking disabled) - REST and MCP transports pass `enable_reranking`/`rerank_k` through - 6 unit tests for RRF merge logic - feat(search): per-field BM25 document-frequency cutoffs (global DF) - `Bm25DfCutoffs` struct on `LexicalQuery` with configurable cutoff ratios per field: content, tags, concepts, agent_id, agent_registry - Terms whose global DF exceeds `cutoff_ratio * N` are filtered from that field only — preserves original stop-word suppression while allowing per-field tuning - Default cutoffs: content=0.30, tags=0.30, concepts=0.30, agent_id=0.70, agent_registry=0.60 - `with_df_cutoffs()` builder on `LexicalQuery` - feat(search): irregular verb lemma expansion - `src/search/lemmas.rs` with ~170 irregular English verb mappings - Query tokenization expands "went"→"go", "gave"→"give", "ran"→"run", etc. - Indexed content is NOT changed — lemma expansion is query-time only - feat(branching): BranchesFrom relation and chain branching - `ThoughtRelationKind::BranchesFrom` for cross-chain divergence points - `MentisDb::branch_from()` creates a new chain with a genesis thought pointing back to the branch-point thought on the source chain - `ancestor_chain_keys()` walks BranchesFrom relations to discover parent and grandparent chains - Ranked search on branch chains transparently searches ancestor chains and annotates results with chain_key - REST endpoint: `POST /v1/chains/branch` - MCP tool: `mentisdb_branch_from` - fix(search): use global DF for Bm25DfCutoffs comparison - Per-field DF calculation was less aggressive than original global DF check, letting high-frequency terms pass through and adding noise - Changed to use global DF (postings list length) for cutoff comparison, matching the original stop-word suppression behavior - docs(whitepaper): expanded BM25 explanation, per-field DF cutoffs table, RRF section 6.8 - bench: LoCoMo 73.0% R@10 (fresh chain), LongMemEval 57.6% R@5 0.8.5.31 APR/11/2026 - fix(cli): panic in update/force-update subcommands — cannot start tokio runtime within runtime - run_update_standalone() created a nested tokio runtime inside #[tokio::main], causing "Cannot start a runtime from within a runtime" panic - Made run_update_standalone async and .await'd fetch directly instead of rt.block_on() - Added test: parse_daemon_args_accepts_update_subcommands verifies update/force-update parse 0.8.4.30 APR/11/2026 - fix(updater): move update check before chain migrations - Users who couldn't open mentisdb after upgrading were stuck because the update check ran AFTER migrations, which crashed on the old binary. Now the update check runs FIRST, giving users the fix before their chains are touched. - If an update is found and accepted, mentisdb exits with instructions to restart. No automatic in-process restart — simpler and safer. - feat(cli): add `mentisdb update` and `mentisdb force-update` subcommands - `mentisdb update` checks for a newer release and prompts y/N to install - `mentisdb force-update` installs the latest release unconditionally, even if the current version appears up to date — useful for repairing a corrupted binary or forcing a fresh install - Both use the same cargo install path as the startup update check - refactor(updater): remove async update check task and restart channel - The update check now runs synchronously before migrations instead of in a background tokio task after servers start - Removed dead code: run_update_check_task(), RestartRequest, shutdown_all_servers(), restart_installed_binary() 0.8.3.29 APR/10/2026 - fix(migration): per-thought schema detection for mixed-schema binary chains - Users upgrading from 0.8.1 to 0.8.2 encountered a crash when opening existing chains: "UnexpectedVariant { type_name: Option, found: 64 }" or "UUID parsing failed: invalid length". We sincerely apologize for the snag. - Root cause: the old load_binary_thoughts() peeked only the FIRST thought's schema_version and applied one legacy format to the entire chain. Chains containing thoughts from multiple schema versions (e.g. V1 thoughts followed by V2 thoughts appended by a later daemon) would fail deserialization because the wrong struct layout was used for later thoughts. - Fix: replace single-schema-path approach with load_binary_thoughts_per_thought() which reads each thought's payload individually, peeks its schema_version varint, and dispatches to the correct legacy deserializer (V0/V1 with 2-field ThoughtRelation, V2 with 3-field, or V3 direct). Rebuilds the hash chain for migrated thoughts after loading. - Remove dead migrate_v2_thoughts() function whose logic is now inline. - test(migration): comprehensive migration tests for all schema versions - migrate_v2_chain_with_all_relation_kinds: all 11 ThoughtRelationKind variants with and without chain_key, verifying valid_at/invalid_at are None after migration - migrate_v1_chain_with_all_thought_types: all 30 ThoughtType variants survive - migrate_v2_chain_with_all_thought_roles: all 8 ThoughtRole variants survive - migrate_mixed_chain_with_v1_v2_v3_thoughts: per-thought detection across V1, V2, and V3 thoughts in the same chain - migrate_v2_chain_with_signed_thought: signing_key_id and thought_signature - migrate_v1_chain_with_relations: 2-field LegacyTestRelation migrates to 5-field ThoughtRelation with chain_key=None, valid_at=None, invalid_at=None - docs(whitepaper): complete rewrite covering 0.8.2 features - 12 sections: architecture, schema evolution, semantic memory model, storage, query & retrieval, dedup, CLI, MCP, benchmarks, competitive landscape, future 0.8.2.28 APR/10/2026 - feat(temporal): add temporal edge validity with schema V3 migration - Add valid_at/invalid_at fields to ThoughtRelation for explicit temporal bounds (e.g. "this fact was true from 2024 to 2025") - invalidated_thought_ids: HashSet built at chain open time from all Supersedes, Corrects, Invalidates relations for O(1) superseded detection - as_of: Option> on RankedSearchQuery enables point-in-time queries: excludes thoughts appended after the timestamp and thoughts superseded by thoughts appended at or before the timestamp - Schema V3 with full V2→V3 migration: LegacyThoughtRelationV2 (3-field), LegacyThoughtV1, migrate_v2_thoughts() with hash chain rebuild - Version-aware load_binary_thoughts() with peek_first_schema_version() - Bincode empty-Vec fast-path guard: always check schema_version after successful deserialization to detect silently-wrong old chains - REST API: RankedSearchRequest exposes as_of parameter - append_thought() auto-sets valid_at = Some(now) on new relations - ThoughtRelation::new(kind, target_id) convenience constructor - open_with_storage() persists migrated chains so future opens use native - migrate_legacy_chain_v0() generalized to detect actual from_version - REST API: rest_append_handler includes valid_at/invalid_at fields - feat(dedup): add automatic memory deduplication with Jaccard similarity - When dedup_threshold is set, each new thought's normalized lexical tokens are compared against recent thoughts using Jaccard similarity - If the best match exceeds threshold (0.0–1.0), a Supersedes relation is auto-added pointing to the most similar prior thought - dedup_scan_window (default 64) limits how many recent thoughts are scanned - Configurable via MENTISDB_DEDUP_THRESHOLD and MENTISDB_DEDUP_SCAN_WINDOW - MentisDb::with_dedup_threshold() and with_dedup_scan_window() builders - MentisDbServiceConfig: with_dedup_threshold(), with_dedup_scan_window() - invalidated_thought_ids updated correctly on auto-supersede - feat(scopes): add multi-level memory scopes via tag-based MemoryScope - MemoryScope enum: User (default), Session, Agent — stored as scope:user, scope:session, scope:agent tags to avoid schema migration - ThoughtInput::with_scope() adds the tag automatically - RankedSearchQuery::with_scope() filters by scope tag - REST API: AppendThoughtRequest.scope and RankedSearchRequest.scope - MemoryScope::as_tag(), from_tag(), Display impl for round-tripping - feat(cli): add add, search, agents subcommands via daemon REST - mentisdb add [--type] [--scope] [--tag] [--agent] [--chain] [--url] - mentisdb search [--limit] [--scope] [--chain] [--url] - mentisdb agents [--chain] [--url] - Default REST URL: http://127.0.0.1:9472 - Uses ureq for synchronous HTTP (no async runtime needed) - AddCommand, SearchCommand, AgentsCommand structs in cli::args - Updated help text with new subcommand documentation - fix(clippy): remove dead load_legacy_v0_thoughts/load_legacy_v0_binary_thoughts functions and convert match→if let in load_binary_thoughts fast path 0.8.1.27 APR/10/2026 - feat(search): session cohesion boost and improved importance/vector/graph scoring - Session cohesion: thoughts within ±8 positions of a high-scoring lexical seed (score >= 3.0) receive a proximity boost up to 0.8, decaying linearly with distance — surfaces evidence turns adjacent to the matching turn but sharing no lexical terms; seeds with lexical≥5.0 excluded from boost; self excluded via nearest>0 guard - Importance scoring: replace flat 3.0× multiplier with differential boost proportional to lexical score (lexical × (importance-0.5) × 0.3) - Vector-lexical fusion: replace step-function boosts with smooth exponential decay; VECTOR_ONLY_BOOST=35, VECTOR_DECAY_RATE=3.0 — faster decay reduces vector interference with moderate-lexical results, improving ranking precision for queries with partial lexical overlap - BM25 DF cutoff lowered 50%→30% — filters non-discriminative entity names that appear in many turns without contributing relevance signal - ContinuesFrom relation kind boost raised 0.12 → 0.30; Corrects/Invalidates 0.18 → 0.25; Supersedes 0.16 → 0.22; DerivedFrom 0.14 → 0.20 - Graph proximity score raised 0.3/depth → 1.0/depth; seed support per extra seed 0.05 → 0.1 (max 5); MAX_GRAPH_SEEDS cap of 20 to bound BFS cost - Add session_cohesion field to RankedSearchScore for observability - LoCoMo 2-persona R@10: 55.8% (baseline) → 88.7%, single-hop 90.7% - LoCoMo 10-persona R@10: 74.2% (full benchmark, 1977 queries) - LongMemEval R@5: 65.0% → 67.6%, R@10: 70.6% → 73.2% - feat(locomo-benches): expand evidence with session-neighbor turns - _expand_evidence() broadens gold evidence to ±2 turns around each target within the same session group for fairer hit evaluation - Build session_map in load_locomo() for O(1) neighbor lookup - Show up to 5 evidence snippets in miss output (was 3) - fix(dashboard): guard against NaN/Infinity floats and null agents - with_confidence() and with_importance() now reject non-finite floats (NaN.clamp() returns NaN in Rust, which crashes serde_json serialization) - thought_json() sanitizes confidence/importance before json!() macro - renderAgentList() filters null agents to prevent JS TypeError - fix(server): propagate chain_key in RelationInput for cross-chain relations - RelationInput struct was missing the chain_key field; all cross-chain relation writes via REST and MCP silently defaulted to None, dropping the target chain reference and breaking cross-chain graph traversal - fix(server): add session_cohesion field to RankedSearchScoreResponse - Missing from initial session_cohesion commit which only added it to the dashboard response; REST /v1/ranked-search would fail to compile - fix(dashboard): add session_cohesion field to DashboardRankedScoreResponse - Mirrors the new session_cohesion field in RankedSearchScore so the dashboard serialization compiles and exposes the new score component - fix(ci): rustfmt formatting issue in session cohesion code - Use abs_diff() for correct single-line formatting that passes CI check 0.8.0.26 APR/08/2026 - feat(search): Porter stemming in lexical tokenizer (normalizer v2) - Added rust-stemmers dependency with English Porter stemmer - normalize_lexical_tokens() now stems all tokens before indexing and querying so word variants share a common root (e.g. prefers/preferred/ preferences → prefer) - LEXICAL_NORMALIZER_VERSION bumped to 2 to force index rebuilds - LongMemEval R@5 improved from 57.2% to 61.6% (stemming alone) - feat(search): tiered vector-lexical fusion in ranked-search scoring - Replace flat lexical+vector addition with tiered boost: vector gets 60× when lexical==0, 20× ramp when lexical<1.0, additive otherwise - Surfaces semantically-relevant hits without overriding strong lexical matches (fixes preference-category regression from previous RRF approach) - LongMemEval R@5 improved from 61.6% to 65.0% (fusion + importance) - feat(search): boost importance weight from 0.2× to 3.0× in ranked scoring - User-originated thoughts (importance=0.8) now get +2.4 vs assistant thoughts (importance=0.2) at +0.6 — enough to tip close BM25 races where verbose assistant responses dominated preference/factual queries - feat(search): lower MIN_VECTOR_COSINE threshold from 0.12 to 0.06 - Catches more short-evidence semantic matches that previously fell below the cosine cutoff - feat(thought): add Goal thought type for high-level objectives - Broader than Plan (which describes how) and Subgoal (a component) - Captures what the agent is trying to achieve so future sessions can orient quickly even if plan details have changed - Appended at end of ThoughtType enum (bincode-safe); dashboard string parser and startup-sound sequence updated - perf: -13.8% single-append latency (p=0.01) via three hot-path improvements: - Zero-copy record assembly: encode directly into length-prefixed Vec with one allocation using encode_into_std_write() — eliminates intermediate copy in append_thought - Bincode hashing: compute_thought_hash() now uses bincode instead of serde_json, eliminating a full JSON serialization per append (bincode ~3-5x faster for structs) - Configurable group commit window via MENTISDB_GROUP_COMMIT_MS env var (default 2ms); set to 0 for lowest latency, higher for bulk-load throughput - Double background write queue capacity (FLUSH_THRESHOLD*8 = 128 slots) to reduce backpressure stalls under concurrent multi-agent writes - Pre-allocate background writer buffer to FLUSH_THRESHOLD*512 bytes - security(skills): SkillReadOutput wrapper — SkillRegistry::read_skill() now returns SkillReadOutput { content, warnings, status } instead of a plain String, so callers can no longer silently ignore skill warnings or revocation status - security(skills): add MAX_SKILL_SIZE_BYTES=1MB limit to import_skill() to prevent unbounded skill uploads from exhausting server memory - security(skills): add XSS warning to render_markdown_skill() doc comment — output is raw Markdown, callers MUST sanitize before rendering in HTML contexts - security(skills): lower per-thought MAX_THOUGHT_PAYLOAD_BYTES from 64 MB to 10 MB as DoS protection against large blob uploads on shared chains - security(dashboard): add rate limiting to /dashboard/login — 5 failed attempts per IP within 5 minutes returns 429 Too Many Requests; counter resets on successful login - security(dashboard): use subtle::ConstantTimeEq for PIN comparison to prevent timing attacks; add subtle=2.6 dependency - refactor(skill): rewrite MENTISDB_SKILL.md from 68,270 to ~8,000 chars - Mandatory startup protocol as FIRST section (was buried at line 280 of 1579) - Explicit WRITE TRIGGERS table consolidating 4 scattered trigger definitions - All 29 thought types listed from codebase (was missing 13 types) - Back-referencing & thought graph section with full relation kinds table - Sub-agent orchestration rules (context ≤50%, flush before exit, handoffs) - Skill registry section (git-like versioning, upload/read/deprecate/revoke) - Added explicit READ-BEFORE-WRITE rule and per-turn write trigger checklist - Anti-patterns as concise list (was prose sections) - remove(JsonlStorageAdapter): binary is the only supported format for new chains - JsonlStorageAdapter re-opened the file on every append (O(n) file handles per chain) - StorageAdapterKind::Jsonl retained for registry backward-compat and migration reads - Legacy .jsonl chains still readable via mentisdb migrate; write path removed - MentisDb::open_with_key_and_storage_kind returns Err if called with Jsonl - refactor(sidecar): ManagedSidecarEntry with auto_sync flag - Introduce ManagedSidecarEntry wrapping provider + auto_sync so FastEmbed can be registered for search without per-append ONNX cost during bulk ingestion - Add register_vector_sidecar_for_search() for search-only registration - FastEmbed auto-init now uses search-only registration instead of manage_vector_sidecar(), avoiding initial full rebuild on startup - fix(integrations): Claude Desktop mcp-remote bridge uses explicit node path as command to bypass shebang resolution picking an older Node.js version (mcp-remote requires Node >= 20; its undici dependency uses the File global added in Node 20, causing ReferenceError: File is not defined on Node 18) - fix(integrations): BridgeCommand struct carries both node_path and mcp_remote_path; detect_node_path() prefers the same directory as mcp-remote first (handles nvm-managed installs) - fix(cli): ensure_prerequisites() now validates Node >= 20 before installing or accepting mcp-remote; clear error messages guide users to upgrade via nvm/fnm - fix(integrations): remove hardcoded platform-specific mcp-remote paths from plan.rs; setup plan snippet and notes updated for node+mcp-remote pattern with Node >= 20 requirement - fix(integrations): fix qwen.rs to use set_path() instead of ensure_path(IfMissing) so $version=3 is always written (not silently skipped when present) - fix(bench): --force-reingest creates fresh timestamped chain - Prevented duplicate ingestion into the same chain (was causing 3× duplicate entries that corrupted vector sidecar results) - Switch rebuild_vectors to fastembed-minilm provider (was local-text-v1) - Increase graph max_visited from 50 to 200 for cross-session recall - Increase rebuild timeout from 300s to 600s for large chains - feat(bench): add full_bench.sh one-shot benchmark runner - Starts mentisdb, waits for health, creates a fresh chain, and runs the full LongMemEval pipeline (ingest + vector rebuild + eval) - refactor(server): extract HasOptionalQueryFields trait — build_query, build_markdown_query, and build_traversal_query now share apply_optional_query_fields() helper (~40 lines) eliminating ~150 lines of duplicated optional-field application logic - refactor(platform): extract PlatformPaths struct in mod.rs to centralize home directory, config_root, and copilot_root computation for linux/macos/windows; reduces boilerplate by 8-18 lines per platform file - refactor: extract read_length_prefixed_thoughts helper to DRY the two identical ~40-line bincode length-prefix read loops in load_legacy_v0_binary_thoughts and load_binary_thoughts; net ~70 lines removed; MAX_THOUGHT_PAYLOAD_BYTES hoisted to module-level constant - code(lib): fix unresolved doc links — to_memory_markdown → MentisDb::to_memory_markdown, append_thought → MentisDb::append_thought, Corrects/Invalidates → ThoughtRelationKind::Corrects/Invalidates; remove broken link to private WriterState - docs(README): rewrite Claude Desktop setup section with node+mcp-remote config pattern, Node >= 20 requirement, nvm/Homebrew examples, and shebang-issue explanation; recommend mentisdb setup claude-desktop as primary setup path - docs(README): add MENTISDB_TLS_CERT, MENTISDB_TLS_KEY, MENTISDB_HTTPS_MCP_PORT, MENTISDB_HTTPS_REST_PORT environment variable documentation - docs(MENTISDB_SKILL.md): fix all wrong REST API examples — /v1/memories/append → POST /v1/thoughts, /v1/memories/search (GET) → POST /v1/search, and /v1/memories/recent (GET) → POST /v1/recent-context with JSON body - docs(MENTISDB_SKILL.md): add Step 0 chain/agent auto-selection guidance for agents - docs(WHITEPAPER): remove 'DRAFT:' prefix from title - bench: add append_latency_percentiles group (p50/p95/p99 per-append via iter_custom) and concurrent_append_query group (2/4/8 writer+reader threads on shared Mutex) - test: add test_read_skill_nonexistent_version() asserting NotFound error for invalid version_id; update all read_skill() call sites to use .content for string operations - test: update Claude Desktop apply test for node+mcp-remote bridge pattern; add parse_node_major and snippet Node-requirement tests 0.7.7.25 APR/05/2026 - fix(dashboard): Add Agent modal Memory Chain dropdown showed numeric indices instead of chain names - GET /dashboard/api/chains returns an array of objects; JS was calling Object.keys() on the array which yielded "0", "1", etc. instead of chain_key values - Fixed by checking Array.isArray and mapping c.chain_key before sorting 0.7.6.24 APR/04/2026 - feat(dashboard): clickable relation thought-id links in Thought Detail popup - Relation target_id values in the Thought Detail modal are now styled blue underlined buttons instead of plain spans - Clicking a relation target fetches the related thought via GET /dashboard/api/thoughts/{chainKey}/{thoughtId} and opens it in a new Thought Detail modal, enabling full navigation depth through related thoughts - Cross-chain relations resolve correctly using the relation's own chain_key when set, falling back to the current modal's chain context - All openModal() call sites updated to propagate chain key so relation navigation works from every view (explorer, agent detail, agent thoughts) - feat(dashboard): Upload Skill form on Skills page - Added POST /dashboard/api/skills endpoint (DashboardUploadSkillBody, api_upload_skill handler) accepting agent_id, content, optional skill_id, and format (markdown/json) - Skills page now has a "+ Upload Skill" button that opens a modal with Agent ID, Skill ID, Format, and Content textarea fields - On success the skill list reloads automatically after 1.8 s - feat(dashboard): Add Agent form on Agents page - Added POST /dashboard/api/agents endpoint (AgentCreateBody, api_create_agent handler) — creates or updates an agent registry entry; preserves existing status on update - Agents page now has a "+ Add Agent" button that opens a modal with a chain dropdown (populated live from existing chains), Agent ID, Display Name, Owner, and Description fields - Chain dropdown auto-populates from GET /dashboard/api/chains on open; on success the Agents page reloads scrolled to the correct chain - feat(skill): MENTISDB_SKILL.md — Large Chain Context Budget section - New section documenting index hierarchy table (6 levels from hybrid ranked search down to full traversal), chain-size tiers with recommended strategies (< 50 / 50-200 / 200-500 / > 500 thoughts), Checkpoint-First Bootstrap pattern for chains > 100 thoughts, per-query token budget caps, filter-before-load discipline rules, ranked_search as the default for topical queries on large chains, guidance on avoiding redundant context loads after search, and summarize-in-waves pattern for historical audits - Session Reload Summary section updated to reference Checkpoint-First Bootstrap on large chains instead of a raw recent_context dump - Operating Loop section updated to call mentisdb_head first and apply the size-appropriate retrieval strategy 0.7.5.23 MAR/31/2026 - fix(auto-update): robust restart after cargo install - Removed the silent current_exe() fallback in install_latest_release(): if installed_binary_path() is not found, PATH is now searched before giving up with a clear error — prevents exec() silently re-running the old binary when CARGO_INSTALL_ROOT or CARGO_HOME differ from defaults - shutdown_all_servers() errors during restart are now treated as warnings instead of aborting the entire restart flow; the exec/spawn proceeds regardless so a partially-shut-down server no longer leaves the user with no running daemon - exec() failure on Unix is now logged explicitly and falls back to spawn() + process::exit(0), ensuring the old process always terminates and the new one always starts even if exec() cannot replace the process image (e.g. due to Tokio FD state on macOS multi-threaded runtimes) - Update prompt now defaults to N on empty input [y/N]; prompt_yes_no extracted to prompt_yes_no_with_io for testability - Added four tests covering prompt defaults, y/n responses, and invalid input handling 0.7.4.22 MAR/30/2026 - fix(daemon): conditional agent primer with HTTPS + friendly address - Primer box is now context-aware: no chains → full bootstrap primer (bootstrap chain, load mentisdb://skill/core, write Summary); chains exist → short resume notice directing the agent to mentisdb_recent_context since MCP initialize auto-delivers setup instructions on connect - Primer always shows the HTTPS MCP address when TLS is running, falls back to plain HTTP otherwise - my.mentisdb.com: friendly alias now shown as an alternative address alongside the 127.0.0.1 local address - refactor(tests): move inline mentisdb tests to tests/mentisdb_tests.rs - Removed the #[cfg(test)] mod tests block from src/bin/mentisdb.rs; all three agent-primer tests now live in the external test suite so the public API surface is exercised the same way third parties would use it and test parallelism is easier to manage 0.7.3.21 MAR/30/2026 - fix(skills): dashboard and service now refresh the skill registry without restart - The shared in-process `SkillRegistry` now reloads itself when `mentisdb-skills.bin` changes on disk, so newly uploaded or updated skills appear immediately - Dashboard skill list/detail/diff/version views and skill lifecycle actions now read against the refreshed registry instead of requiring a full `mentisdb` console restart - MCP/REST skill reads and writes also refresh before use, keeping agent uploads and the dashboard in sync even when skills are added from another surface - feat(wizard): interactive checkbox TUI for integration selection - Replaced the confusing text prompt ("default", "all", "none") with a live checkbox list rendered in raw terminal mode - Detected integrations show as [x] (will be configured) or [ ] (skipped) with a navigable > cursor; arrow keys or j/k move the cursor, Space toggles an item, 'a' selects all, 'n' deselects all, Enter confirms, Esc restores the auto-detected defaults - Falls back to the text-based boxed prompt when stdin is not a terminal (CI pipelines, piped input, --yes flag) so non-interactive use is unaffected - Added crossterm dependency for raw terminal key-event handling - fix(wizard): clippy implicit_saturating_sub lint in cursor navigation - Replaced guarded `cursor_idx -= 1` with `cursor_idx.saturating_sub(1)` - feat(daemon): agent primer notice printed at startup - `mentisdb` now prints a copy-paste primer prompt after the endpoint addresses at startup so users can immediately hand their AI agent the exact one-liner needed to bootstrap memory for a project - The primer box shows the MCP address (and dashboard URL when TLS is enabled) and walks the agent through `mentisdb_bootstrap`, loading `mentisdb://skill/core`, and writing a first Summary checkpoint - Implemented as `build_agent_primer_lines(mcp_addr, dashboard_url)` with two unit tests covering the with- and without-dashboard cases - feat(docs): "Priming Your Agent" section on mentisdb.com - New `` Leptos component with a 3-step visual walkthrough: bootstrap the chain, load the skill rules, write a Summary checkpoint - Includes a copyable primer prompt block matching the startup box wording so users can grab it straight from the docs site - Section positioned after the InstallBox and before the Problem section; navbar gets a `#primer` anchor link between Rust Docs and Install CTA 0.7.2.20 MAR/29/2026 - feat(search): managed vector sidecars and seamless hybrid ranked retrieval - Added a built-in local text embedding provider plus persisted per-chain managed vector-sidecar settings for `mentisdb` - Managed sidecars now stay synchronized on append when enabled, and ranked search automatically blends lexical, graph, and vector signals through `hybrid` / `hybrid_graph` backends instead of requiring a separate semantic-search mode - Ranked result payloads now expose a `vector` score component across crate, REST, MCP, and dashboard surfaces, and strong semantic hits can surface even when lexical overlap is weak or absent - Vector sidecar writes now go through temp-file replacement, stale/corrupt sidecars degrade cleanly back to lexical+graph retrieval, and deleting a chain removes its sidecar/config artifacts - feat(dashboard): per-chain vector-sidecar management and hybrid-search visibility - Chain detail pages now show vector-sidecar status, freshness, indexed-thought counts, and the on-disk sidecar path for each managed provider - Added dashboard actions to enable/disable append-time sidecar sync, run `Sync now`, and `Rebuild from scratch` with explicit delete-and-recreate confirmation - The `Vector Sidecars` panel is now collapsible and collapsed by default so it does not get in the way of the search form - Explorer search copy and ranked result metadata now reflect the fact that dashboard search transparently uses lexical, graph, and managed vector retrieval when available - feat(setup): refresh first-run and integration-setup behavior - `mentisdb` can now launch the interactive setup wizard directly from the first-run daemon notice - Claude Code setup now targets the global `~/.claude.json` / `%USERPROFILE%\\.claude.json` config (`mcpServers.mentisdb`), while the legacy `~/.claude/mcp/mentisdb.json` path remains detectable as a legacy companion file - GitHub Copilot CLI setup remains `~/.copilot/mcp-config.json` by default and respects `XDG_CONFIG_HOME/copilot/mcp-config.json` on XDG hosts - Expanded setup/apply/wizard regression coverage to lock the current path and detection behavior in place - docs: refresh README and release-facing docs for the current system reality - Updated README to document managed vector-sidecar APIs, default daemon behavior, transparent hybrid search, dashboard vector controls, and the current setup targets for Claude Code and Copilot - Added/updated regression coverage that keeps the release docs aligned with the implemented search/vector behavior 0.7.1.19 MAR/28/2026 - feat(dashboard): wire chain explorer search to ranked retrieval and context bundles - Dashboard chain search now uses canonical ranked lexical+graph retrieval when search text is present, while preserving chronological filtering for plain agent/type-only browsing - Added grouped dashboard context-bundle inspection so operators can see seed-anchored supporting thoughts without flattening the entire graph into one list - Thought modal now surfaces ranked-search metadata such as score breakdowns, matched terms, graph distance, relation kinds, and bundle support preview - Added dashboard regression coverage for ranked search pagination, graph-support retrieval, grouped bundles, and legacy non-text filtering behavior - feat(search): add optional vector sidecars for semantic retrieval - Added `search::EmbeddingProvider`, `EmbeddingMetadata`, cosine-ranked `VectorIndex`, and deterministic vector validation helpers for provider-agnostic embedding pipelines - Added rebuildable per-chain vector sidecars with explicit integrity digests, model/version separation, and freshness states that distinguish fresh sidecars from stale or mismatched ones - Added explicit crate APIs to rebuild, load, inspect, and query vector sidecars without changing default `ThoughtQuery` or ranked-search behavior - Added regression coverage for vector ranking, sidecar corruption detection, model/version separation, stale-after-append behavior, and plain-chain fallback when the sidecar is damaged - feat(bootstrap): surface active skills in bootstrap response - `BootstrapResponse` now includes an `available_skills: Vec` field listing every active skill in the registry at spawn time - Uploaded skills are now discoverable at bootstrap time, but agents should only load trusted or relevant skills after verifying provenance - Core operating instructions are delivered through MCP `initialize.instructions` plus `resources/read(mentisdb://skill/core)`; uploaded skills are additive, not the bootstrap source of truth - fix(bootstrap): correct lock ordering to eliminate future deadlock risk - `bootstrap()` now captures `thought_count` and `head_hash`, drops the chain write-lock, then acquires the skills read-lock - Previously both locks could be held simultaneously; the fix ensures only one unrelated lock is held at a time - change(mcp): update tool descriptions to enforce eager spawn and checkpoint discipline - MCP `initialize.instructions` now points agents at `mentisdb://skill/core` so the official operating skill is discoverable without relying on out-of-band REST knowledge - `mentisdb_skill_md` remains as a compatibility fallback for clients that cannot read MCP resources - `mentisdb_bootstrap`: keeps checkpoint discipline guidance and available-skill discovery, but no longer carries the whole bootstrap burden by itself - `mentisdb_append`: emphasises saving a Summary/Checkpoint eagerly at every meaningful milestone and always before compaction, truncation, or agent handoff - `mentisdb_append_retrospective`: clarifies scope as hard failures, repeated snags, and non-obvious fixes only; adds requirement to call before context compaction or handoff so lessons survive agent clearance - `mentisdb_read_skill`: aligned to "trusted or relevant skills" language; references the `available_skills` bootstrap field and adds provenance warning for unknown skills - test(server): add bootstrap `available_skills` regression tests - New test: `bootstrap_response_includes_empty_available_skills_when_registry_is_empty` — asserts the field is present and empty when no skills are registered - New test: `bootstrap_response_includes_active_skills_after_skill_upload` — uploads a skill then bootstraps and asserts the skill appears in `available_skills` with the correct `skill_id` and `status` 0.6.4.17 MAR/24/2026 - feat(storage): durable group commit for strict binary writes - `BinaryStorageAdapter` now routes `auto_flush=true` appends through the bounded background writer and acknowledges them only after the worker flushes to the OS - Concurrent strict-mode appends can share a short group-commit window, reducing contention while preserving zero-loss semantics for acknowledged writes - Added regression coverage to prove a strict append is already visible on disk before the original chain handle is dropped - fix(storage): buffered writes now behave like real buffering instead of silent data loss - `MENTISDB_AUTO_FLUSH=false` continues to persist thoughts through the background writer instead of skipping thought storage entirely - Buffered mode now batches per-chain agent-registry sidecar rewrites instead of rewriting the JSON sidecar on every append - The strict append hot path no longer pays the extra record-buffer allocation that had regressed single-append latency after the first background-writer refactor - feat(bench): persist and compare HTTP concurrency runs automatically - `benches/http_concurrency.rs` now saves per-mode baselines under `target/http_concurrency/` and prints delta tables on subsequent runs - New `MENTISDB_BENCH_AUTO_FLUSH` and `MENTISDB_BENCH_BASELINE` env vars make it easy to compare durable and buffered modes without manual table diffing - feat(dashboard): chain agent counts deep-link to per-chain agent registries - The Chains page `Agents` column now links directly to the matching chain section on `#/agents` - Agent registry section headers are linkable so the dashboard can auto-scroll to the right chain table 0.6.3.16 MAR/23/2026 - fix(dashboard): deleted chains no longer linger or reappear - Dashboard reads now treat the on-disk chain registry as the source of truth for existence, so a deleted chain returns `404` instead of being silently reopened from a stale cached handle - Chain deletion now detaches persistence from any surviving in-memory handle before deregistering the chain, preventing the last drop from re-registering the chain after it was deleted - `deregister_chain()` now removes the per-chain agent-registry sidecar alongside the main chain storage file - The Chains and Agents dashboard views now skip chains that were externally deleted while still present in the live cache - Added regression tests for cached-handle deletion, external deregistration, stale reads after delete, and live-cached chain visibility - feat(dashboard): chain-level stats on the Agents page - Each `CHAIN: ` section on `#/agents` now shows `Total Agents` and `Total Thoughts` above the table - `GET /dashboard/api/agents` now returns a per-chain summary envelope with `chain_key`, `total_agents`, `total_thoughts`, and the chain `agents` list - Cross-chain agent links, memory export, and copy-to-chain dialogs were updated to consume the richer response shape without breaking existing agent lookups - fix(ci): restore Linux workflow reliability for audio-enabled builds - GitHub Actions Linux jobs now install `pkg-config` and `libasound2-dev`, fixing `rodio` / ALSA build failures in `build`, `test`, and `clippy` - The release build workflow now explicitly grants `contents: write` so tagged builds can attach release artifacts 0.6.2.15 MAR/23/2026 - fix(daemon): defer update prompt until startup output is complete - The update check still runs in the background, but it now waits to print until after the banner, configuration, and resolved endpoints are shown - The install question is rendered inside the ASCII dialog so the prompt is readable instead of colliding with startup logs 0.6.1.14 MAR/23/2026 - change(daemon): enable update checks by default - `MENTISDB_UPDATE_CHECK` now defaults to `true` - Set `MENTISDB_UPDATE_CHECK=0` to disable the background GitHub release check - Updated daemon regression tests and docs to reflect the new default-on behavior 0.6.0.13 MAR/23/2026 - feat(daemon): opt-in GitHub release update checks for `mentisdb` - New `MENTISDB_UPDATE_CHECK=1` enables a background check against the latest GitHub release for `CloudLLM-ai/mentisdb` - Version comparison intentionally uses only the first three numeric components, ignoring the fourth monotone release counter - When a newer core version is found on an interactive terminal, `mentisdb` shows an ASCII prompt window and accepts `Y`/`N` - Accepting the prompt runs `cargo install --git ... --tag ... --locked --force --bin mentisdb mentisdb`, then gracefully shuts down and restarts the daemon - Non-interactive sessions never block on stdin; they print the manual cargo command instead - New `MENTISDB_UPDATE_REPO` env var allows overriding the GitHub repository used for update checks - fix(dashboard): Agent detail description rendering and freshness - Agent detail form fields (`Display Name`, `Description`, `Owner`) are now populated via DOM `.value` assignment after insertion, fixing the missing-description regression in the textarea - Dashboard chain reads now refresh cached chains from disk when auto-flush is enabled, so the Chains explorer and agent latest-thoughts panels show externally appended thoughts without requiring a daemon restart - fix(agent-registry): preserve agent metadata during append and copy flows - Cross-chain agent copy now upserts `description` into the target chain registry in addition to `display_name` and `owner` - Appending a thought without `agent_name` no longer downgrades a registered agent display name back to the raw `agent_id` - Case-only display-name corrections (for example `astro` -> `Astro`) no longer create alias churn - test: expand dashboard and daemon updater regression coverage - Added dashboard integration tests under `tests/dashboard_tests.rs` for agent detail hydration, copy-to-chain description preservation, and live thought refresh without daemon restart - Added updater tests under `tests/mentisdb_tests.rs` for release-tag parsing, version comparison, opt-in env configuration, cargo install command construction, and startup-sound scheduler spacing 0.5.3.12 MAR/23/2026 - feat(branding): real MentisDB infinity-M logo - Vectorized the official MentisDB logo (infinity/M mark) from JPEG source using potrace - Produced white-on-transparent SVG at public/logo.svg (1.5 KB, 3 paths) - mentisdb.com: replaced hand-drawn node-graph placeholder SVG in navbar and footer - docs.mentisdb.com: added logo.svg to public/; navbar img replaces plain wordmark - Dashboard: replaced 🧠 emoji in nav-brand with inline SVG data URI (embedded in binary, no external file) - docs: Claude for Desktop MCP connection guide (all OSes) - Documented that Claude for Desktop requires mcp-remote (npm install -g mcp-remote) as a bridge - Per-OS config examples (macOS, Windows, Linux) with correct command paths - NODE_TLS_REJECT_UNAUTHORIZED=0 env var required for self-signed cert; explained why and how to permanently trust the cert instead - Added Linux config file path (~/.config/Claude/claude_desktop_config.json) - Updated both README.md and docs.mentisdb.com user docs - fix: mcp-remote Claude Desktop config - node mcp-remote is wrong (node tries to run a file named mcp-remote) - Correct invocation: use the full path to the mcp-remote binary as the command - MCP endpoint is at POST / (root), not /mcp 0.5.2.11 Mar/22/2026 - feat: Reframe ThoughtType - New `ThoughtType::Reframe` variant for reframing thoughts that were accurate but unhelpfully framed - Distinct from Correction (factually wrong) and Invalidates (correct but stale) - Added to Corrections section in `to_memory_markdown` output - Sound signature: E5→D5→B4 gentle falling pattern in mentisdb - Added to dashboard TYPE_GROUPS (Correction/red group) - feat: Supersedes ThoughtRelationKind - New `ThoughtRelationKind::Supersedes` variant for typed semantic "this replaces that" edges - Complements Reframe: use Reframe as ThoughtType, Supersedes as RelationKind pointing to the old thought - feat: cross-chain thought references - `ThoughtRelation` now has an optional `chain_key: Option` field - Intra-chain refs remain backward-compatible (chain_key = None, skipped in JSON) - Binary (bincode) serialization always includes all 3 fields; JSON omits chain_key when None - Legacy v0 chains without chain_key are migrated transparently via LegacyThoughtRelation - New `ThoughtInput::with_cross_chain_relation()` builder method - feat: schema V2 - `MENTISDB_SCHEMA_V2 = 2` constant added; `MENTISDB_CURRENT_VERSION` bumped to V2 - Registry version is normalized to current version on load - feat: bulk import from MEMORY.md format - New `MentisDb::import_from_memory_markdown(markdown, default_agent_id)` library method - Parses all 29 ThoughtType variants, ThoughtRole, importance, confidence, tags from bullet lines - Source `[#N]` indices are discarded; thoughts are re-appended in order on the target chain - New REST endpoint: `POST /v1/import-markdown` (+ legacy alias `thoughtchain_import_memory_markdown`) - New MCP tool: `mentisdb_import_memory_markdown` - New dashboard endpoint: `POST /dashboard/api/chains/{chain_key}/import-markdown` - Tests: round-trip export→import, default agent fallback, malformed-line skipping - Benchmark: `bench_import_memory_markdown` (100-thought bulk import) - feat(dashboard): refs and relations in thought detail modal - Positional refs (intra-chain indices) displayed as #N, #M list - Typed relations displayed as `kind → target_id (chain: other-chain)` with chain_key omitted when intra-chain - feat(dashboard): Import MEMORY.md button on chain detail page - "📥 Import MEMORY.md" button opens a modal with textarea + default_agent_id input - Calls `POST /dashboard/api/chains/{chain_key}/import-markdown`, shows imported count on success - docs(skill): MENTISDB_SKILL.md updated for 0.5.2 - Reframe ThoughtType entry with when-to-use guidance - Back-referencing section: how to use refs and relations on LessonLearned, Correction, and Reframe thoughts - Supersedes vs Corrects vs Invalidates decision guide - Cross-chain references section with examples - Example: Reframe superseding an overly broad constraint (bad/good patterns) - chore: bump crate version to 0.5.2 0.5.1.10 MAR/22/2026 - feat(dashboard): copy agent memories to another chain - New "📋 Copy to Chain…" button on the Agent detail page (next to "Export Memory…") - Opens a modal showing only chains where the agent does NOT already have thoughts (preventing diverged history) - User must type the exact target chain name before the "Copy Memories" button is enabled - All semantic fields are preserved (type, role, content, tags, concepts, confidence, importance); positional refs and relations are intentionally dropped - Agent display name and owner are propagated via the first copied thought so the target chain's agent registry is populated correctly - New backend: `POST /dashboard/api/agents/{chain_key}/{agent_id}/copy-to/{target_chain_key}` - Returns 409 Conflict if the agent already has thoughts on the target chain - fix(dashboard): skill diff version picker defaults to oldest → newest - "From version" selector pre-selects v1 (oldest); "To version" pre-selects vN (newest) - Both selectors now use consistent chronological (oldest-first) ordering 0.5.0.9 MAR/21/2026 - deprecate(config): rename MENTISDB_DEFAULT_KEY to MENTISDB_DEFAULT_CHAIN_KEY - New canonical env var is MENTISDB_DEFAULT_CHAIN_KEY - MENTISDB_DEFAULT_KEY remains fully functional as a deprecated alias (backwards compatible) - Updated .env.example, start_mentisdb, README.md, and rustdocs - feat(dashboard): agent thoughts explorer - Per-agent detail page now includes cross-chain links: "All 's thoughts on " for every chain the agent participated in - Clicking the link opens a filterable thought explorer pre-filtered to that agent's contributions - `renderAgentThoughts(agentId, chainKey)` function added to the SPA; supports pagination and per-page controls - feat(dashboard): skill revoke / deprecate with GitHub-style confirmation - "Revoke Skill…" button in skill detail header triggers an overlay panel - User must type the exact skill ID before "Revoke Forever" is enabled (mirrors GitHub repository deletion UX) - New admin-only `POST /dashboard/api/skills/{skill_id}/revoke` and `POST /dashboard/api/skills/{skill_id}/deprecate` routes in the dashboard server; these manage skill lifecycle entries in the `SkillRegistry` (backed by `SkillRegistry::revoke_skill` and `deprecate_skill`) and are separate from the MCP/REST API endpoints exposed to agents - feat(dashboard): version number in navigation header - Brand now reads "🧠 MentisDB v0.5.0" — fetched from new `GET /dashboard/api/version` endpoint on page load - New endpoint returns `{ "version": "…" }` compiled in via `env!("CARGO_PKG_VERSION")` - feat(dashboard): chain list refresh button - "↺ Refresh" button in the Chains page header re-fetches counts from the server without a full page reload - fix(dashboard): `api_chains` now includes mid-session chains - Result set is the union of disk-registry chain keys and chains live in the `Arc` cache - Chains created mid-session via MCP (e.g. `foo-chain`) appear immediately without daemon restart - fix(dashboard): agent thought counts were stale - `api_agents_all`, `api_agents_by_chain`, and `api_get_agent` now compute thought counts live via `chain.thoughts().iter().filter(|t| t.agent_id == agent_id).count()` instead of reading the stored `AgentRecord.thought_count` field which can drift - fix(dashboard): `renderAgentThoughts` used wrong element ID - Function was targeting `document.getElementById('main')` but the SPA container is `
`; corrected to `getElementById('app')` - fix(dashboard): `setActive` JS error in agent thoughts view - `renderAgentThoughts` was calling the non-existent `setActive('agents')` — replaced with the correct `updateNav()` call - fix(dashboard): skill diff version picker shows sequential numbers - `From` / `To` selectors now display `N: short-hash (date)` so the relative order of versions is unambiguous - fix(dashboard): agent IDs in agents list are now clickable links - Each agent ID cell in the agents table renders as `` to navigate directly to the agent detail page - fix(startup): per-agent thought counts in startup report were stale - `print_agent_registry_summary` now counts live via the same filtered-iterator pattern used by dashboard handlers - fix: silence `DeviceSink` drop log from rodio 0.22 - Calling `.log_on_drop(false)` on the `DeviceSink` suppresses the "Dropping DeviceSink, audio playing through this sink will stop" message on daemon exit - fix: resolve clippy errors in bench and tests - `benches/http_concurrency.rs`: filled all missing `MentisDbServerConfig` fields in the struct literal - `tests/mentisdb_tests.rs`: replaced four `vec![…]` array literals that hold only stack types with plain `[…]` arrays (`clippy::useless_vec`) - chore: bump crate version to 0.5.0 - feat: HTTPS/TLS support for mentisdb - Added HTTPS listeners for both MCP (port 9473) and REST (port 9474) alongside existing HTTP listeners - Auto-generates a self-signed TLS certificate on first startup via `rcgen`, saved to `~/.mentisdb/tls/cert.pem` and `~/.mentisdb/tls/key.pem` - Certificate includes SANs: `my.mentisdb.com`, `localhost`, `127.0.0.1` - `my.mentisdb.com` is a public DNS A-record → 127.0.0.1; use it as a friendly hostname for the local daemon once the cert is trusted - New env vars: `MENTISDB_HTTPS_MCP_PORT` (default 9473, 0=disabled), `MENTISDB_HTTPS_REST_PORT` (default 9474, 0=disabled), `MENTISDB_TLS_CERT`, `MENTISDB_TLS_KEY` - Added `start_https_mcp_server` and `start_https_rest_server` public API functions - `MentisDbServerConfig` extended with `https_mcp_addr`, `https_rest_addr`, `tls_cert_path`, `tls_key_path` - `MentisDbServerHandles` extended with `https_mcp: Option`, `https_rest: Option` - Daemon startup prints HTTPS endpoints, TLS cert path, per-OS cert trust commands, and `my.mentisdb.com` tip - feat: Startup jingle (PC-speaker style, `startup-sound` feature) - 4-note square-wave sequence on daemon start: C5 → E5 → D5 → B5 ("men-tis-D-B") - Implemented via `rodio` (CoreAudio / ALSA / WASAPI); feature-gated as `startup-sound` (on by default) - Jingle plays after the banner and configuration block are fully flushed to stdout, so visual output is always complete before sound - Silence with `MENTISDB_STARTUP_SOUND=0` / `false` / `no` / `off` - `MENTISDB_STARTUP_SOUND` added to the Configuration printout and `.env.example` - feat: Per-thought-type sound signatures (`MENTISDB_THOUGHT_SOUNDS`) - When enabled, a distinct ≤200ms square-wave sequence plays every time a thought is appended, keyed to its `ThoughtType` - 28 unique signatures; sequences are tuned to evoke the thought type (e.g. `Surprise` mirrors the Metal Gear Solid "!" alert: C5→E5→G5→C6) - Implemented via an `on_thought_appended: Option>` callback on `MentisDbServiceConfig`; fired asynchronously via `spawn_blocking` so audio never blocks the append path - Defaults to `false` (opt-in) to avoid annoying users; toggle with `MENTISDB_THOUGHT_SOUNDS=true` - `MENTISDB_THOUGHT_SOUNDS` added to the Configuration printout and `.env.example` - ux: Reorder daemon startup output — useful info first, branding last - Endpoint catalog is now printed first (MCP / REST / HTTPS addresses) - Chain summary, Agent Registry summary, and Skill Registry summary follow - ASCII banner, version line, and Configuration block move to the bottom so operators see actionable info immediately - ux: ASCII-table startup summaries with ANSI colour - Chain Summary, Agent Registry, and Skill Registry are rendered as bordered ASCII tables using box-drawing characters - Column headers are printed in cyan; section separators and borders use dim styling - Agent Registry groups agents by chain key with a full-width pink section label row per chain - ux: Startup summaries show all configured env variables - Every supported `MENTISDB_*` env var is listed in the Configuration block, including those that were previously omitted - fix: Chain Summary now reads live thought and agent counts instead of stale registry values - Each chain is opened via `MentisDb::open_with_storage` at print time; stale registry values are only used as a fallback when a chain cannot be opened - fix: Off-by-one in `persist_chain_registration` — registry always stored N-1 thoughts - `persist_registries()` was called before `self.thoughts.push()` so `thought_count` written to `mentisdb-registry.json` was the pre-append count - Moved `persist_registries()` to after `self.thoughts.push()` so the persisted count always equals the post-append chain length - feat: `refresh_registered_chain_counts()` — startup registry repair - New public function that opens each registered chain, reads live `thought_count` and `agent_count`, and rewrites the registry JSON only when at least one entry has drifted - Called at daemon startup after chain migrations so any counts corrupted by the previous off-by-one bug (or by chains appended outside the daemon) are corrected on first boot - chore: Add `.env.example` documenting all supported environment variables with comments - feat: Web dashboard — admin UI embedded in the mentisdb binary - Self-contained HTML/CSS/vanilla-JS single-page app served at `http://:9475/dashboard`; no npm, no Node.js, zero new crate dependencies - HTML/CSS/JS live as real tracked files in `src/dashboard_static/` and are compiled into the binary via `include_str!` — diffs and IDE tooling work normally - Chain Manager: lists all chains with live thought/agent counts; click any chain to open the Thought Explorer - Thought Explorer: paginated table (25/50/100 per page) with 28-ThoughtType grouped multi-select filter (All/Clear per colour group); coloured type badges; click any row to open a full-detail modal (all fields, refs as links, content in scrollable pre block) - Agent Manager: agents grouped by chain; status badges; per-agent detail page with editable Display Name / Description / Owner fields, Revoke/Activate toggle, ed25519 public key add/revoke, and recent-thoughts preview - Skills Registry: lists all skills with status and version count; per-skill view with Rendered / Source / Diff tabs; inline markdown renderer; version selector; coloured unified-diff viewer comparing any two versions - PIN protection: set `MENTISDB_DASHBOARD_PIN` to gate all dashboard routes behind a login page; auth via `mentisdb_pin` cookie or `Authorization: Bearer ` header; unset = open (suitable for localhost deployments) - New env vars: `MENTISDB_DASHBOARD_PORT` (default 9475; 0 = disabled), `MENTISDB_DASHBOARD_PIN` (default unset) - Dashboard URL printed in startup endpoint catalog; both env vars listed in Configuration block - `src/server.rs`: `MentisDbService.{chains,skills}` made `pub(crate)`; `MentisDbServerConfig` + `MentisDbServerHandles` extended with dashboard fields; `start_dashboard_server()` added; dashboard shares the same live `Arc` chains and `Arc>` as the REST service - fix: Chain Summary stale thought/agent counts resolved at startup - `refresh_registered_chain_counts` runs before servers start and writes live counts to the registry - `print_chain_summary` now reads directly from the refreshed registry (no redundant chain re-opens) - `api_chains` dashboard endpoint now uses `get_or_open_chain()` for all chains (eliminates stale fallback from registry) - fix: Thought detail modal missing ID, hash, and creation date - Frontend now reads `thought.id` (with fallback to `thought.thought_id`) and `thought.hash` (with fallback to `thought.thought_hash`) - Hash value is now copyable via a clipboard button (⎘ → ✓ on click) - feat: Chain browser sort order toggle + Genesis/Head navigation - New "⬇ Newest first / ⬆ Oldest first" toggle button (default: newest first) - "⏮ Genesis" and "Head ⏭" jump buttons for fast navigation - Backend: `ThoughtsQuery.order` param; `paginated_thoughts()` accepts `reverse: bool` flag - ux: Startup endpoint catalog shows friendly `my.mentisdb.com` URLs alongside `127.0.0.1` addresses - fix: Agent detail Owner field not displaying saved value - Frontend was reading `agent.agent_owner` but `AgentRecord` serializes the field as `agent.owner` - feat: Agent list table now shows Owner and Thoughts columns - chore: Bump dependencies — diffy 0.3→0.4, axum-server 0.7→0.8, rcgen 0.13→0.14, rodio 0.17→0.22 - rodio 0.22 breaking changes: `OutputStream`/`Sink` removed; new API uses `DeviceSinkBuilder::open_default_sink()` + `Player::connect_new()`; `Source` trait: `current_frame_len`→`current_span_len`, `channels()`/`sample_rate()` return `NonZero`/`NonZero` - bincode reverted to 2.0.1 (3.0.0 dropped serde compatibility) - chore: MENTISDB_SKILL.md updated to v3 — 10 new undocumented agent patterns documented from borganism-brain chain analysis 0.4.3.8 MAR/16/2026 - chore: Add Makefile - Added `Makefile` to the standalone repository root with targets: `build`, `build-mentisdb`, `release`, `fmt`, `check`, `clippy`, `test`, `bench`, `doc`, `publish`, `publish-dry-run`, `install`, `clean`, and `help` - `bench` target pipes Criterion output through `tee` to `/tmp/mentisdb_bench_results.txt` so benchmark numbers are captured alongside the live terminal display - `install` target installs the `mentisdb` daemon binary via `cargo install --path .` 0.4.2.7 MAR/16/2026 - repo: Move MentisDB into its own standalone Git repository - Split the `mentisdb/` subtree out of the former `cloudllm` monorepo and preserved the MentisDB commit history in the new repository - Updated crate metadata to point at the standalone `CloudLLM-ai/mentisdb` repository - Replaced the old local `../mcp` path dependency with the published `cloudllm_mcp` crate so `mentisdb` builds and runs from the standalone checkout - api: Make skill uploads warning-clean under strict Clippy - Replaced the long `SkillRegistry::upload_skill(...)` parameter list with a public `SkillUpload` request type - Updated server, tests, and benchmark call sites to use the new upload request builder methods - Fixed the remaining Clippy findings in `server.rs` and `skills.rs` so `cargo clippy -- -D warnings` passes on the standalone repository - chore: Track standalone repo build artifacts more cleanly - Added a root `.gitignore` for `target/` and editor backup files - Added `Cargo.lock` to the standalone repository so the daemon build resolves against a checked-in lockfile 0.4.1.6 MAR/16/2026 - feat: Agent registry public key support - Added `AgentPublicKey { key_id, algorithm, public_key_bytes, revoked }` to the per-chain agent registry - Added `mentisdb_add_agent_key` MCP tool and `POST /v1/agents/{id}/keys` REST endpoint for key registration - Added `mentisdb_revoke_agent_key` MCP tool and `DELETE /v1/agents/{id}/keys/{key_id}` REST endpoint for key revocation - Public keys are serialized and persisted alongside the agent registry record - Ed25519 (`ed25519-dalek 2`) is the first supported algorithm; algorithm field is open for future extension - feat: Skill registry delta/diff versioning - First version of each skill is stored as full raw content; subsequent versions store only unified diff patches via `diffy` - Added `SkillVersionContent` enum (`Full { raw }` / `Delta { patch }`) replacing the embedded `SkillDocument` in `SkillVersion` - Added `version_number: u32` (zero-based monotone index) to `SkillVersion` and `SkillVersionSummary` - Version reconstruction applies the patch chain from v0 forward; all read and export paths go through `reconstruct_raw_content` - Content integrity hash is now SHA-256 of the full reconstructed raw content string - feat: Ed25519 cryptographic skill upload signing - Agents with registered public keys must provide `signing_key_id` and `skill_signature` (64-byte Ed25519) on every skill upload - Agents without registered public keys may upload without signatures for backward compatibility - Signature is verified against the agent's active public key in the agent registry before the upload is accepted - `signing_key_id` and `skill_signature` are stored on each `SkillVersion` for auditability - Added `verify_ed25519_signature` to the server layer using `ed25519-dalek 2` - feat: Skill registry V1→V2 startup migration - `migrate_skill_registry(chain_dir)` migrates the persisted `mentisdb-skills.bin` from registry V1 (full document per version) to V2 (delta content model) - Migration is idempotent; returns `None` if the registry is already at the current version or does not exist - `mentisdb` runs skill registry migration at startup, after chain migration and before opening the skill registry - Panics on unrecoverable migration failure to prevent serving stale data - feat: Add `SkillRegistryMigrationReport` public type reporting migration outcome - perf: Replace outer `RwLock` with `DashMap` for concurrent chain lookup - Hot path for `get_chain` now acquires only a per-shard read lock instead of a global write lock - New chains are inserted using `entry().or_try_insert_with()` for shard-level atomicity; no global async lock held during chain open - Benchmark: `DashMap` delivers 750–930 read req/s at 10k concurrent tasks vs previous sequential bottleneck - perf: Add write buffering to `BinaryStorageAdapter` - Replaced per-append `File::open` with a lazily-initialized `Mutex>` - `auto_flush = false` batches writes and flushes every `FLUSH_THRESHOLD = 16` appends or on `Drop` - `auto_flush = true` (default) flushes immediately after each append, preserving full crash durability - feat: Add `MENTISDB_AUTO_FLUSH` env var and `MentisDbServiceConfig::auto_flush` builder - Set `MENTISDB_AUTO_FLUSH=false` (or `0`) for high-throughput write workloads at reduced durability - Defaults to `true` for backward-compatible crash-safe behavior - Config field exposed via `with_auto_flush(bool)` builder method on `MentisDbServiceConfig` - bench: Add Criterion benchmark suite (22 benchmarks) - `benches/thought_chain.rs`: 10 benchmarks covering append throughput, query latency, and traversal patterns - `benches/skill_registry.rs`: 12 benchmarks covering skill upload, search, delta reconstruction, and lifecycle operations - Baselines committed; run with `cargo bench` - bench: Add harness-free HTTP concurrency benchmark - `benches/http_concurrency.rs`: starts `mentisdb` in-process on a random port, measures write and read throughput at 100 / 1k / 10k concurrent Tokio tasks with p50/p95/p99 latency reporting - test: Expand skill registry coverage for delta versioning and signing - docs: Update MENTISDB_SKILL.md with Fleet Orchestration and multi-CLI sub-agent guide - Added 9-subsection Fleet Orchestration section: PM pattern, agent registration, parallel dispatch, context window protocol, anti-patterns, and self-improving fleet guidance - Added concrete spawning examples for GitHub Copilot CLI (`task` tool + `mode="background"`), Claude Code (parallel `Task()` calls), OpenAI Codex CLI (`--dangerously-auto-approve-everything` + shell backgrounding), and Qwen Code (`spawn_agent`) - Added universal 6-step PM pattern table applicable to any CLI - docs: Document `MENTISDB_AUTO_FLUSH` in README daemon configuration section - Added durability vs. throughput trade-off explanation and two example launch commands - docs: Update WHITEPAPER with delta versioning and cryptographic authorship sections 0.4.0.5 MAR/13/2026 - feat: Complete the MentisDB skill registry release - Added the built-in `MENTISDB_SKILL.md` plus versioned uploaded skill documents for specialist agents - Finished the MCP and REST skill registry surfaces for list, manifest, upload, search, read, version listing, deprecate, and revoke flows - Tightened MCP tool metadata so live tool discovery advertises the full skill query parameter set - feat: Speed up durable memory queries with append-maintained indexes - Added indexes for agent id, thought type, and role to narrow candidate thoughts before full query filtering - Added timestamp-window position bounds so UTC `since` and `until` searches avoid scanning the full chain - feat: Add direct thought lookup and append-order traversal APIs - Added direct lookup by stable thought id, chain index, and content hash, plus explicit genesis vs head semantics - Added forward and backward chunk traversal from thought anchors or logical `genesis`/`head` boundaries, with reusable search filters - Added numeric traversal time windows using `start + delta` in `seconds` or `milliseconds` for MCP and REST callers - Exposed the new lookup and traversal surface through MCP and REST, separate from graph/context traversal - docs: Sync daemon and protocol documentation with the shipped server surface - Updated the daemon endpoint catalog, crate README, MCP spec, and REST spec to include the skill registry APIs and built-in skill endpoint - Clarified the current skill registry model: daemon-global storage with uploader validation against a chain agent registry - Documented head-vs-genesis semantics and the distinction between append-order traversal and graph/context traversal - feat: Default `MENTISDB_VERBOSE` to `true` when unset - Daemon now logs interaction events to the console out of the box without requiring explicit env configuration - `MENTISDB_VERBOSE=0` or `MENTISDB_VERBOSE=false` disables console interaction output - feat: Add file-backed interaction logging via `MENTISDB_LOG_FILE` - Set `MENTISDB_LOG_FILE=/path/to/mentisdb.log` to append all interaction events to a durable file - File logging is independent of `MENTISDB_VERBOSE`: operators can run a silent console with a durable file log, verbose console with no file, or both simultaneously - Log file path is displayed in daemon startup configuration output alongside other active env settings - Added `log_file` field to `MentisDbServiceConfig` with a `with_log_file` builder method - feat: Colorize daemon startup configuration output - Env variable names and their resolved values are now color-coded in the startup banner for easier visual scanning - test: Expand coverage for the new registry and query behavior - Added crate tests for skill import/export, persistence, lifecycle operations, and query timestamp windows - Added server tests for live skill registry MCP/REST flows and embedded skill retrieval - Moved skill parser tests into integration test files under `tests/` for consistency with crate standards 0.3.0.4 MAR/12/2026 Note: historical entries below use the original ThoughtChain / thoughtchaind names because they describe earlier releases. The project is now being rebranded to MentisDB / mentisdb. This release also records the project rename from ThoughtChain to MentisDB. - feat: Introduce ThoughtChain schema version `1` - Added explicit `schema_version` to durable thought records - Added optional `signing_key_id` and `thought_signature` fields for future signed-agent provenance - Added a stable signable thought payload path so signatures can target canonicalized thought data - feat: Move shared-agent metadata into registries - Added per-chain `AgentRegistry` sidecars for display names, owners, aliases, public keys, and agent activity metadata - New thoughts now store stable `agent_id` attribution while registry metadata resolves `agent_name` and `agent_owner` at read time - Query, memory export, JSON rendering, and `thoughtchain_list_agents` now resolve identity metadata from the registry instead of scanning or duplicating inline agent profile fields - feat: Add a global ThoughtChain registry and richer discovery metadata - Added a durable registry of chains with chain key, schema version, storage adapter, storage location, thought count, and agent count - `thoughtchain_list_chains` and `GET /v1/chains` now return richer chain summaries instead of only chain keys - Server chain discovery overlays live in-process counts on top of persisted registry metadata - feat: Add automatic migration from legacy schema version `0` - `thoughtchaind` now scans discovered chains at startup, migrates legacy JSONL and binary chains to version `1`, archives the old files, and reports progress in stdout - Migration logic lives in the library so it is reusable from tests and future tooling, not only from the daemon - Added migration coverage for both legacy JSONL and binary chains - feat: Add a versioned skill registry with adapter-based import and export - Added a binary `mentisdb-skills.bin` registry with explicit registry versioning, schema versioning, integrity hashes, uploader attribution, timestamps, immutable skill versions, and lifecycle status - Added structured skill adapters for Markdown -> Skill, JSON -> Skill, Skill -> Markdown, and Skill -> JSON - Added indexed registry search by skill id, name, tags, triggers, uploader identity, status, format, schema version, and upload time window - feat: Expose the skill registry through MCP and REST - Added MCP tools and REST endpoints for `list_skills`, `skill_manifest`, `upload_skill`, `search_skill`, `read_skill`, `skill_versions`, `deprecate_skill`, and `revoke_skill` - `read_skill` now returns explicit warnings that skill files may contain malicious or untrusted instructions - Added the embedded `mentisdb_skill_md` surface for the official built-in MentisDB skill file - feat: Make binary storage the default for new chains - `BinaryStorageAdapter` is now the default storage backend for new chains - Added `THOUGHTCHAIN_DEFAULT_STORAGE_ADAPTER` and retained `THOUGHTCHAIN_STORAGE_ADAPTER` as a compatibility alias - Added bootstrap-time storage adapter override support so callers can explicitly create JSONL or binary chains - Fixed adapter filename resolution so JSONL and binary chains always reopen using the correct file extension - feat: Make the daemon/server stack the default crate experience - `thoughtchain` now enables the `server` feature by default so `cargo install thoughtchain` and `cargo run --bin thoughtchaind` work without extra feature flags - Updated workspace manifests and launcher scripts to rely on the default server-enabled build - docs: Refresh installation, daemon, protocol, and design documentation - Updated README quick-start guidance to emphasize `cargo install thoughtchain`, `thoughtchaind`, and `nohup thoughtchaind &` - Updated MCP and REST protocol docs for schema `1`, registry-backed chain discovery, binary-default storage, bootstrap adapter overrides, signature fields, and the new skill registry - Updated the white paper to describe registries, schema versioning, migration, and the signing-oriented data model - test: Expand coverage for the new schema and migration model - Added coverage for stable signable payload generation - Added coverage for v0 to v1 migration - Added server coverage for registry-backed chain summaries, bootstrap adapter overrides, and the skill registry endpoints 0.2.1.3 MAR/11/2026 - feat: Add env-controlled verbose interaction logging to `thoughtchaind` - Added `THOUGHTCHAIN_VERBOSE` with support for `1`, `0`, `true`, and `false` - When enabled, the daemon logs each ThoughtChain read and write interaction with chain key, touched agents, thought types, roles, tags, and concepts - Startup configuration output now shows the effective verbose setting - test: Add coverage for verbose env parsing in server configuration 0.2.0.2 MAR/11/2026 - feat: Add retrospective memory support - Added `ThoughtType::LessonLearned` - Added `ThoughtRole::Retrospective` - Markdown memory export now surfaces non-default roles such as retrospectives - feat: Add guided retrospective append APIs - Added MCP tool `thoughtchain_append_retrospective` - Added REST endpoint `POST /v1/retrospectives` - Retrospective append defaults to `LessonLearned` and always stores thoughts with role `Retrospective` - feat: Add shared-daemon discovery APIs - Added MCP tool `thoughtchain_list_chains` - Added MCP tool `thoughtchain_list_agents` - Added REST endpoint `GET /v1/chains` - Added REST endpoint `POST /v1/agents` - docs: Update daemon and protocol documentation - Updated `thoughtchain/README.md` with retrospective guidance and MCP setup for Codex, Claude Code, Qwen Code, and GitHub Copilot CLI - Updated the white paper and protocol docs to explain retrospective memory, lessons learned, and shared-daemon discovery - test: Add coverage for retrospective type/role queries, discovery endpoints, and server append behavior 0.1.0.1 MAR/11/2026 - feat: First public release of `thoughtchain` - Standalone Rust crate for semantic, hash-chained memory in long-running and multi-agent systems - Append-only, adapter-backed storage with explicit integrity verification - `StorageAdapter` abstraction for pluggable persistence backends - `JsonlStorageAdapter` as the current default backend - Stable crate metadata prepared for crates.io publishing - feat: Semantic thought model for durable agent memory - Rich `ThoughtType` taxonomy covering preferences, insights, facts, plans, corrections, checkpoints, summaries, surprises, and more - `ThoughtRole` separates semantic meaning from runtime roles such as memory, summary, compression, checkpoint, handoff, and audit - Stable thought ids, timestamps, importance, confidence, tags, concepts, refs, and typed relations - Shared-chain agent attribution via `agent_id`, `agent_name`, and optional `agent_owner` - feat: Query, replay, and export capabilities - Query by text, type, role, tags, concepts, agent ids, importance, confidence, and date range - Prompt-oriented catch-up rendering for session resumption - `MEMORY.md`-style Markdown export generated from chain walks and filters - Chain head inspection and integrity checks for durable memory operations - feat: Server support and standalone daemon - `thoughtchain::server` module behind the `server` feature - MCP server surface for remote agents - REST server surface for services, dashboards, CLIs, and generic HTTP clients - `thoughtchaind` binary to run ThoughtChain as a long-lived process - Env-configurable host, ports, default chain key, and storage directory - docs: Fully documented public API - Rustdoc coverage across public functions, enums, structs, and implementations - Added protocol documentation in the parent repository for both MCP and REST use - test: Dedicated crate test coverage - Separate tests under `thoughtchain/tests` - Coverage for persistence, integrity, querying, export behavior, and server routing