Skip to content

Commit 50166c8

Browse files
committed
v4.1.3: edge profile through persistence backend + corpus hardening
Squashed v4.1 release train. Closes the v4.0 GA "edge profile is theatrical" gap (handlers held a 6-row sqlite-vec smoke harness while list/get/search/create/update/delete still acquired raw asyncpg connections from the Postgres pool) and ships the v4.1.1-1.3 hardening on top. ## Persistence-backend dispatch (was v4.1.0 / v4.1.1) Every handler that previously did `_pool.acquire()` now goes through `_persistence_backend.transactional()` so the active backend (PostgresBackend or SqliteBackend) decides how to access storage: - list / get / search / create / update / delete memories - bulk_create_memories - /stats (MemoryStatsRow + CompressionStatsRow via gather_stats) - consultation completion + audit log + DAG live-merge webhook fan-out now go through the transactional outbox (delivery scheduled post-commit, not mid-handler) VisibilityFilter (ROOT_BYPASS / READABLE / OWN_ONLY) replaces the ad-hoc namespace + permission_mode predicates that handlers used to inline. Fail-closed: namespace=None for non-root callers raises at filter construction. `PostgresBackend.transactional()` uses the canonical `async with self._pool.acquire() as conn:` pattern (the previous shape awaited acquire() then async-with on the resolved proxy and broke on asyncpg's PoolConnectionProxy). ## GRAEAE provider routing (was v4.1.2) - `_is_reasoning_variant` helper in domain/graeae/engine.py prefers -non-reasoning over -reasoning siblings when ranking model candidates (xai grok-4.20-0309-non-reasoning was being shadowed by the -reasoning variant on len-tiebreak; surfaced as `\confidence{N}` trailers on consensus output). - Reasoning-variant rows in db/migrations_*model_registry.sql marked deprecated; non-reasoning kept canonical. - Container env standard codified: `MNEMOS_KEYS_PATH` env + `~/.api_keys_master.json:/etc/mnemos/api_keys.json:ro` mount + `RATE_LIMIT_STORAGE=memory://` are mandatory in every `mnemos serve` container or GRAEAE silently 401s every consultation. ## Corpus-review hardening (was v4.1.3) Fixes the 10 issues from the v4.1.1 full-corpus Codex review (docs/CORPUS-REVIEW-2026-04-29.md). Security: - Pin webhook delivery DNS resolution from validation through HTTP connect via `PinnedDNSAsyncHTTPTransport` (closes DNS-rebinding SSRF). - Apply the same SSRF URL validation to federation peers. Private peer URLs require `FEDERATION_ALLOW_PRIVATE=true`. Reliability: - Release GRAEAE provider concurrency slots in finally during cancelled fan-out (no slot leak on client disconnect). Profile correctness: - Sessions, entities, state, MORPHEUS routes now return explicit 503 on edge (SQLite) profile via `_require_postgres_backend`. - MORPHEUS run telemetry restricted to root/operator callers. - DAG read preflight aligned with memory read visibility; branch + merge writes stay strict-owner-scoped. - Typed `AuthSettings` + server-profile fail-closed auth defaults via `MNEMOS_AUTH_ENABLED`. - SQLite duplicate explicit memory IDs raise `DuplicateMemoryError` instead of silently succeeding. Plumbing: - Migrate route-level asyncpg acquires to `PoolManager.acquire()`. ## Tests - 1087 passed, 0 failed (was 633 before v4.1). - 9 new test files for the corpus findings (auth_failclosed, dag_visibility_alignment, edge_profile_unsupported_routes, federation_peer_ssrf, graeae_cancellation, morpheus_tenant_scoping, no_raw_pool_acquire, sqlite_insert_dup, webhook_ssrf_rebind). - `tests/_fake_backend.py` Postgres-flavored `FakePoolBackedBackend` so consultation/audit/entity/DAG handlers see consistent test data through the same FakePool that backed `_pool`.
1 parent 5983427 commit 50166c8

67 files changed

Lines changed: 4414 additions & 1853 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,55 @@
22

33
All notable changes to MNEMOS are documented here.
44

5+
## [4.1.3] — 2026-04-29
6+
7+
Corpus-review hardening release.
8+
9+
### Fixed
10+
11+
- Pinned webhook delivery DNS resolution from validation through HTTP connect to close DNS-rebinding SSRF.
12+
- Moved consultation completion and DAG live-merge webhooks into the transactional outbox path, with delivery scheduled only after commit.
13+
- Released GRAEAE provider concurrency slots in `finally` during cancelled fan-out.
14+
- Marked sessions, entities, state, and MORPHEUS HTTP routes as Postgres-only on edge profiles with explicit 503 responses.
15+
- Restricted MORPHEUS run telemetry reads to root/operator callers.
16+
- Migrated route-level asyncpg acquires to `PoolManager.acquire()`.
17+
- Aligned DAG read preflight with memory read visibility while keeping branch/merge writes strict-owner scoped.
18+
- Applied webhook SSRF URL validation to federation peers; private peer URLs require `FEDERATION_ALLOW_PRIVATE=true`.
19+
- Added typed `AuthSettings` and server-profile fail-closed auth defaults via `MNEMOS_AUTH_ENABLED`.
20+
- Made SQLite duplicate explicit memory IDs raise `DuplicateMemoryError` instead of silently succeeding.
21+
22+
## [4.1.2] — 2026-04-29
23+
24+
GRAEAE provider-routing fix + container-env operations standard.
25+
26+
### Fixed
27+
28+
- `mnemos.domain.graeae.engine._ranked_candidates` tiebreak ordering
29+
added an explicit non-reasoning preference between `last_synced` and
30+
`len(model_id)`. Before this fix, the `len()` fallback accidentally
31+
promoted `-reasoning` SKUs (shorter names) over `-non-reasoning`
32+
siblings of equal weight/version, so xAI Grok consultations came
33+
back tagged with `\confidence{N}` blocks instead of clean text.
34+
Provider helper `_is_reasoning_variant(model_id)` formalizes the
35+
classification.
36+
- New regression suite at `tests/test_graeae_ranked_candidates.py`
37+
covers the helper + the tiebreak ordering.
38+
39+
### Operational
40+
41+
- v4.x container env standard documented: every `mnemos serve`
42+
container MUST mount `~/.api_keys_master.json`
43+
`/etc/mnemos/api_keys.json` (read-only) AND set
44+
`MNEMOS_KEYS_PATH=/etc/mnemos/api_keys.json`. The v4.1.1 cutover
45+
surfaced that without these, GRAEAE quietly falls back to
46+
empty-key/no-provider state and every consultation 401s.
47+
- Pre-existing reasoning-variant rows in `model_registry` should be
48+
marked `deprecated=true` for Grok-family providers via:
49+
`UPDATE model_registry SET deprecated = true WHERE provider = 'xai'
50+
AND model_id ~ '-reasoning$' AND model_id NOT LIKE '%non-reasoning'`.
51+
v4.1.2 fleet rollout includes this UPDATE on PYTHIA + CERBERUS
52+
before container restart.
53+
554
## [4.0.0] — 2026-04-29
655

756
Major refactor + multi-backend persistence + multi-worker support release.

README.md

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
# MNEMOS + GRAEAE
66

7-
**MNEMOS v4.0.0 is the memory operating system for serious agentic work: a
7+
**MNEMOS v4.1.1 is the memory operating system for serious agentic work: a
88
packaged FastAPI runtime, multi-backend persistence layer, GRAEAE reasoning bus,
99
operator-audited compression stack, and CLI-first deployment surface.**
1010

@@ -28,7 +28,7 @@ federate, export, import, and operate**.
2828
the `/v1/` REST surface are services built on top of the kernel, not retrofits
2929
onto a vector store.
3030

31-
The v4.0 codebase is a coherent `mnemos/` package: `api/routes`, `core`, `db`,
31+
The v4.1 codebase is a coherent `mnemos/` package: `api/routes`, `core`, `db`,
3232
`domain`, `persistence`, `mcp`, `webhooks`, `workers`, `hooks`, `installer`,
3333
`tools`, and `cli`. The old top-level script sprawl is gone; operators use the
3434
single `mnemos` command.
@@ -61,26 +61,26 @@ single `mnemos` command.
6161
isolation, multi-worker smoke, and Postgres/SQLite persistence parity.
6262

6363
MNEMOS has been in daily production use since December 2025. The current release
64-
line is **v4.0.0**, shipped on **2026-04-29**, and it is the first release where
64+
line is **v4.1.1**, shipped on **2026-04-29**, and it is the first release where
6565
the package layout, persistence layer, deployment profiles, CLI, single-binary
6666
distribution, and multi-worker coordination all match the intended production
6767
shape.
6868

6969
## Quick Install
7070

7171
```bash
72-
pip install mnemos-os==4.0.0
72+
pip install mnemos-os==4.1.1
7373
mnemos serve --profile dev
7474
```
7575

7676
```bash
77-
docker pull ghcr.io/mnemos-os/mnemos:4.0.0
77+
docker pull ghcr.io/mnemos-os/mnemos:4.1.1
7878
```
7979

8080
For a single binary with no host Python:
8181

8282
```bash
83-
curl -L https://github.com/mnemos-os/mnemos/releases/download/v4.0.0/mnemos-linux-x86_64 -o mnemos
83+
curl -L https://github.com/mnemos-os/mnemos/releases/download/v4.1.1/mnemos-linux-x86_64 -o mnemos
8484
chmod +x mnemos
8585
./mnemos install --profile edge
8686
./mnemos serve --profile edge
@@ -141,7 +141,7 @@ MNEMOS was built to solve those problems in a way that reflects real platform ex
141141

142142
Its design is informed by years of enterprise platform work, large-vendor systems thinking, open-source infrastructure experience, and current work in the AI industry, without assuming that professional users want marketing language where they really need operational clarity.
143143

144-
**MNEMOS has been in daily production use since December 2025**, backing multiple active agentic systems simultaneously. By early 2026 the running install was holding thousands of memories and had performed thousands of compressions, each with a written quality manifest. The v3.0 release line unified that production codebase into the single-service FastAPI shape; **v4.0.0 is the current shipped GA line**, adding the coherent package layout, persistence abstraction, SQLite profiles, single-binary artifacts, and multi-worker production support. See [`CHANGELOG.md`](./CHANGELOG.md) for the release history.
144+
**MNEMOS has been in daily production use since December 2025**, backing multiple active agentic systems simultaneously. By early 2026 the running install was holding thousands of memories and had performed thousands of compressions, each with a written quality manifest. The v3.0 release line unified that production codebase into the single-service FastAPI shape; **v4.1.1 is the current shipped GA line**, adding the coherent package layout, persistence abstraction, SQLite profiles, single-binary artifacts, and multi-worker production support. See [`CHANGELOG.md`](./CHANGELOG.md) for the release history.
145145

146146
For the longer story — the original catalyzing moment, the architectural decisions (and mistakes) that took MNEMOS from a single-file prototype to a unified runtime, and the scrubs, refactors, and release-gate audits that landed the public cut — see [`EVOLUTION.md`](./EVOLUTION.md). Written for future contributors as much as for future readers who want to know what they're inheriting.
147147

@@ -248,7 +248,7 @@ The shared premise — that agent memory deserves first-class treatment — is t
248248

249249
## What works now
250250

251-
This is the current state of the v4.0.0 release line. Features described here are implemented unless explicitly called out as forward-looking in [`ROADMAP.md`](./ROADMAP.md).
251+
This is the current state of the v4.1.1 release line. Features described here are implemented unless explicitly called out as forward-looking in [`ROADMAP.md`](./ROADMAP.md).
252252

253253
The API surface is namespaced under `/v1/*`.
254254

@@ -622,7 +622,7 @@ Landed with the v3.0 release line:
622622

623623
v3.5.1 is a documentation-triage patch shipped on 2026-04-28. It bumps package/runtime version metadata to 3.5.1 and reconciles release-state docs with the v3.5.0 GA tag; it does not change product behavior from v3.5.0.
624624

625-
### Shipped in v4.0.0
625+
### Shipped in v4.1.1
626626

627627
-**Coherent package layout** — production code now lives under `mnemos/` with `api/routes`, `core`, `db`, `domain`, `persistence`, `mcp`, `webhooks`, `workers`, `hooks`, `installer`, `tools`, and `cli` subpackages.
628628
-**Persistence abstraction**`PersistenceBackend` owns the contract; `PostgresBackend` uses asyncpg + pgvector + RLS + LISTEN/NOTIFY, and `SqliteBackend` uses aiosqlite + sqlite-vec + FTS5 + JSON1 + WAL.
@@ -633,9 +633,23 @@ v3.5.1 is a documentation-triage patch shipped on 2026-04-28. It bumps package/r
633633
-**Architectural enforcement** — seven import-linter contracts keep API, domain, db, core, persistence, MCP, and webhook boundaries honest in CI.
634634
-**GRAEAE mode validation** — routing modes plus `single`, `debate`, and `majority` are modeled as a `Literal`; unknown modes 422 instead of falling through.
635635

636-
### Beyond v4.0
636+
### v4.1.3 known limitations
637637

638-
Forward-looking scope is maintained in [`ROADMAP.md`](./ROADMAP.md), which lists shipped v3.x/v4.0 scope and items explicitly deferred with rationale.
638+
- `bulk_create_memories` now runs through the backend transaction and webhook
639+
outbox surface, so it works on SQLite-backed edge profiles as well as
640+
Postgres-backed server profiles.
641+
- The SQLite-backed `edge` profile intentionally exposes a narrower HTTP API:
642+
sessions, entities, state, and MORPHEUS telemetry routes return 503 because
643+
those surfaces still depend on server-profile Postgres SQL.
644+
- MORPHEUS run and cluster endpoints are operator-only telemetry. They require
645+
root credentials because responses can include namespaces, configs, errors,
646+
and memory IDs across tenants.
647+
- v4.1 still does not ship the separate web frontend, mobile clients, hosted
648+
MNEMOS Cloud, or Rust hot-path rewrites; those remain roadmap items.
649+
650+
### Beyond v4.1
651+
652+
Forward-looking scope is maintained in [`ROADMAP.md`](./ROADMAP.md), which lists shipped v3.x/v4.1 scope and items explicitly deferred with rationale.
639653

640654
Near-term not-yet-scoped candidates:
641655

@@ -675,7 +689,7 @@ mnemos.core lifecycle/config/visibility
675689
### Edge install (single binary)
676690

677691
```bash
678-
curl -L https://github.com/mnemos-os/mnemos/releases/download/v4.0.0/mnemos-linux-x86_64 -o mnemos
692+
curl -L https://github.com/mnemos-os/mnemos/releases/download/v4.1.1/mnemos-linux-x86_64 -o mnemos
679693
chmod +x mnemos
680694
./mnemos install --profile edge
681695
./mnemos serve --profile edge
@@ -684,7 +698,7 @@ chmod +x mnemos
684698
### Package install
685699

686700
```bash
687-
pip install mnemos-os==4.0.0
701+
pip install mnemos-os==4.1.1
688702
mnemos install --profile dev
689703
mnemos serve --profile dev
690704
```

0 commit comments

Comments
 (0)