feat(memory): wire APEX-MEM write path and QualityGate config#3637
Merged
feat(memory): wire APEX-MEM write path and QualityGate config#3637
Conversation
…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
e1363d9 to
c7acf4d
Compare
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.
Summary
ApexMemConfigunder[memory.graph.apex_mem]in zeph-config; wiresinsert_or_supersede_with_metrics()intoSemanticMemory::remember()whenenabled = true(closes feat: call insert_or_supersede from SemanticMemory to activate APEX-MEM write path #3631)WriteQualityGateConfigunder[memory.quality_gate]in zeph-config; wireswith_quality_gate()from bootstrap afterattach_graph_stores()(closes feat: wire QualityGateConfig into zeph-config [memory.quality_gate] TOML section #3629)enabled = false, preserving legacy behavior with no breaking changesChanges
zeph-config/src/memory.rsApexMemConfig,WriteQualityGateConfigstructs + 7 serde testszeph-memory/src/semantic/graph.rsinsert_edges()onapex_mem_enabled; sanitization before APEX path; unit test for new branchzeph-memory/src/graph/store/mod.rsinsert_or_supersede_with_metricszeph-memory/src/graph/resolver/mod.rsgraph_store()accessorzeph-agent-persistence/src/graph.rsapex_mem_enabledzeph-core/src/agent/agent_access_impl.rsapex_mem_enabledin backfill pathsrc/bootstrap/mod.rsbuild_quality_gate()wired afterattach_graph_stores()config/default.tomlNotes
strip_control_chars+truncate_to_bytes_ref) applied in APEX-MEM path, matching legacy behaviorrelationpreserves original casing;canonical_relationis lowercased — matches theinsert_or_supersedecontractinsert_or_supersede_with_metricsviolates unique index on supersede (filed as fix(memory): insert_or_supersede_with_metrics violates unique index on supersede #3635)Test plan
cargo +nightly fmt --check— cleancargo clippy --workspace -- -D warnings— cleancargo nextest run --workspace --lib --bins— 8904 passed, 21 skippedcargo doc --no-deps -p zeph-config -p zeph-memory— no broken intra-doc linksapex_mem.enabled = true(blocked by fix(memory): insert_or_supersede_with_metrics violates unique index on supersede #3635 — supersede bug in store)