Skip to content

feat(memory): wire APEX-MEM write path and QualityGate config#3637

Merged
bug-ops merged 2 commits intomainfrom
3631-feat-call-insert-or-supersede
May 6, 2026
Merged

feat(memory): wire APEX-MEM write path and QualityGate config#3637
bug-ops merged 2 commits intomainfrom
3631-feat-call-insert-or-supersede

Conversation

@bug-ops
Copy link
Copy Markdown
Owner

@bug-ops bug-ops commented May 6, 2026

Summary

Changes

File Change
zeph-config/src/memory.rs ApexMemConfig, WriteQualityGateConfig structs + 7 serde tests
zeph-memory/src/semantic/graph.rs Branch insert_edges() on apex_mem_enabled; sanitization before APEX path; unit test for new branch
zeph-memory/src/graph/store/mod.rs Tracing span on insert_or_supersede_with_metrics
zeph-memory/src/graph/resolver/mod.rs graph_store() accessor
zeph-agent-persistence/src/graph.rs Propagate apex_mem_enabled
zeph-core/src/agent/agent_access_impl.rs Propagate apex_mem_enabled in backfill path
src/bootstrap/mod.rs build_quality_gate() wired after attach_graph_stores()
config/default.toml Commented-out default sections for both features

Notes

  • Input sanitization (strip_control_chars + truncate_to_bytes_ref) applied in APEX-MEM path, matching legacy behavior
  • relation preserves original casing; canonical_relation is lowercased — matches the insert_or_supersede contract
  • Found pre-existing store bug during testing: insert_or_supersede_with_metrics violates unique index on supersede (filed as fix(memory): insert_or_supersede_with_metrics violates unique index on supersede #3635)

Test plan

@github-actions github-actions Bot added enhancement New feature or request size/L Large PR (201-500 lines) memory zeph-memory crate (SQLite) rust Rust code changes core zeph-core crate config Configuration file changes labels May 6, 2026
…3629)

Add ApexMemConfig to [memory.graph.apex_mem] in zeph-config and wire
insert_or_supersede_with_metrics() into SemanticMemory::remember() when
apex_mem.enabled = true, activating the APEX-MEM append-only write path.

Add WriteQualityGateConfig to [memory.quality_gate] in zeph-config and wire
SemanticMemory::with_quality_gate() from bootstrap after attach_graph_stores().

Both features default to disabled, preserving legacy behavior.

Changes:
- zeph-config: ApexMemConfig + WriteQualityGateConfig with serde(default)
- zeph-memory: branch insert_edges() on apex_mem_enabled with input sanitization
  (strip_control_chars + truncate_to_bytes_ref) before insert_or_supersede()
- zeph-memory: graph_store() accessor on EntityResolver
- zeph-memory: tracing span on insert_or_supersede_with_metrics()
- zeph-agent-persistence, zeph-core: propagate apex_mem_enabled to all
  GraphExtractionConfig construction sites
- bootstrap: build_quality_gate() wired after attach_graph_stores()
- config/default.toml: commented-out default sections for both features

Closes #3631, Closes #3629
@bug-ops bug-ops enabled auto-merge (squash) May 6, 2026 02:08
@bug-ops bug-ops force-pushed the 3631-feat-call-insert-or-supersede branch from e1363d9 to c7acf4d Compare May 6, 2026 02:08
@github-actions github-actions Bot added the documentation Improvements or additions to documentation label May 6, 2026
@bug-ops bug-ops merged commit 60dc3a3 into main May 6, 2026
32 checks passed
@bug-ops bug-ops deleted the 3631-feat-call-insert-or-supersede branch May 6, 2026 02:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

config Configuration file changes core zeph-core crate documentation Improvements or additions to documentation enhancement New feature or request memory zeph-memory crate (SQLite) rust Rust code changes size/L Large PR (201-500 lines)

Projects

None yet

1 participant