Skip to content

feat(memory): ClawVM typed pages, MemReader quality gate, APEX-MEM graph#3260

Merged
bug-ops merged 3 commits intomainfrom
memory-research
Apr 19, 2026
Merged

feat(memory): ClawVM typed pages, MemReader quality gate, APEX-MEM graph#3260
bug-ops merged 3 commits intomainfrom
memory-research

Conversation

@bug-ops
Copy link
Copy Markdown
Owner

@bug-ops bug-ops commented Apr 19, 2026

Closes #3221, #3222, #3223.

Summary

Test plan

  • 8506 unit tests pass (cargo nextest run --workspace --lib --bins)
  • cargo +nightly fmt --check clean
  • cargo clippy --workspace -- -D warnings clean
  • Live session: typed page audit log written correctly
  • Live session: quality gate rejection rate metrics visible
  • Live session: APEX-MEM supersession chain verified in graph store

Follow-up issues (non-blocking)

  • P2: recent_embeddings_snapshot() not implemented — Redundant rejection branch unreachable in production
  • P2: Prompt injection in call_llm_scorer / build_conflict_prompt (untrusted content without delimiters)
  • P3: SystemContextInvariant checks prefix only, not full pointer body
  • P3: CompactionAuditSink::flush() yield_now vs doc MUST-flush semantics
  • P3: RollingRateTracker window hardcoded at 100, log reports config.recent_window=32

…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
@github-actions github-actions Bot added documentation Improvements or additions to documentation memory zeph-memory crate (SQLite) rust Rust code changes dependencies Dependency updates enhancement New feature or request size/XL Extra large PR (500+ lines) labels Apr 19, 2026
@bug-ops bug-ops enabled auto-merge (squash) April 19, 2026 18:25
@bug-ops bug-ops merged commit 02517ef into main Apr 19, 2026
32 checks passed
@bug-ops bug-ops deleted the memory-research branch April 19, 2026 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Dependency updates documentation Improvements or additions to documentation enhancement New feature or request memory zeph-memory crate (SQLite) rust Rust code changes size/XL Extra large PR (500+ lines)

Projects

None yet

1 participant