Commit 02517ef
authored
feat(memory): ClawVM typed pages, MemReader quality gate, APEX-MEM graph (#3260)
* feat(memory): ClawVM typed pages, MemReader quality gate, APEX-MEM graph (#3221, #3222, #3223)
Closes #3221, #3222, #3223.
**#3221 — ClawVM-style typed page compaction (zeph-context)**
- New `TypedPage` with BLAKE3 content-hash page id and `PageType` enum
(ToolOutput, ConversationTurn, MemoryExcerpt, SystemContext)
- Per-type `PageInvariant` trait with four implementations enforcing
minimum-fidelity invariants at compaction boundaries
- `InvariantRegistry` and bounded async `CompactionAuditSink` (mpsc)
- `ContextAssembler::gather()` classifies every slot into a typed page
and appends an audit record per compacted page
**#3222 — MemReader write quality gate (zeph-memory)**
- New `QualityGate` scoring three dimensions: information value
(cosine similarity vs recent context), reference completeness
(pronoun/deictic heuristic), contradiction risk (graph edge conflicts)
- Fail-open contract: embed/LLM/graph errors yield neutral defaults
- Wired into `SemanticMemory::remember()` and `remember_with_parts()`
after A-MAC admission via `with_quality_gate()` builder
- Disabled by default; configurable via `[memory.quality_gate]` TOML
**#3223 — APEX-MEM append-only property graph for MAGMA (zeph-memory)**
- SQLite migration 075: adds `supersedes`, `canonical_relation` to
`graph_edges`; new `edge_reassertions` provenance table
- `GraphStore::insert_or_supersede`: atomic supersession (single tx),
byte-identical reassertion path, supersede depth cap (64 hops)
- `OntologyTable` with ArcSwap + LRU-4096 cache for predicate
normalization with LLM fallback
- `ConflictResolver` with recency / confidence / llm strategies
* build: update lru 0.12.5 → 0.17.01 parent e09e0ae commit 02517ef
24 files changed
Lines changed: 3848 additions & 21 deletions
File tree
- crates
- zeph-context
- src
- zeph-db/migrations/sqlite
- zeph-memory
- src
- graph
- store
- semantic
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
9 | 34 | | |
10 | 35 | | |
11 | 36 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
| 58 | + | |
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| 67 | + | |
67 | 68 | | |
68 | 69 | | |
69 | 70 | | |
| |||
106 | 107 | | |
107 | 108 | | |
108 | 109 | | |
109 | | - | |
110 | | - | |
| 110 | + | |
| 111 | + | |
111 | 112 | | |
112 | 113 | | |
113 | 114 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| 20 | + | |
| 21 | + | |
19 | 22 | | |
20 | 23 | | |
21 | 24 | | |
| |||
25 | 28 | | |
26 | 29 | | |
27 | 30 | | |
28 | | - | |
| 31 | + | |
29 | 32 | | |
30 | 33 | | |
31 | 34 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
0 commit comments