feat(memory): ClawVM typed pages, MemReader quality gate, APEX-MEM graph#3260
Merged
feat(memory): ClawVM typed pages, MemReader quality gate, APEX-MEM graph#3260
Conversation
…aph (#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
This was
linked to
issues
Apr 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #3221, #3222, #3223.
Summary
TypedPagewith BLAKE3 page id,PageTypeenum, per-typePageInvarianttrait,CompactionAuditSink.ContextAssemblerclassifies every context slot and enforces invariants at compaction boundaries.QualityGatewith three scoring dimensions (information value, reference completeness, contradiction risk). Fail-open. Wired intoSemanticMemory::remember()after A-MAC viawith_quality_gate(). Disabled by default.supersedes/canonical_relationtograph_edges+edge_reassertionstable.insert_or_supersede(atomic, depth-capped).OntologyTable(ArcSwap + LRU).ConflictResolver(recency/confidence/llm).Test plan
cargo nextest run --workspace --lib --bins)cargo +nightly fmt --checkcleancargo clippy --workspace -- -D warningscleanFollow-up issues (non-blocking)
recent_embeddings_snapshot()not implemented —Redundantrejection branch unreachable in productioncall_llm_scorer/build_conflict_prompt(untrusted content without delimiters)SystemContextInvariantchecks prefix only, not full pointer bodyCompactionAuditSink::flush()yield_now vs doc MUST-flush semanticsRollingRateTrackerwindow hardcoded at 100, log reportsconfig.recent_window=32