MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / memory_injection_enabled

Function memory_injection_enabled

src/hooks/memory_inject.rs:62–67  ·  view source on GitHub ↗

Whether fact injection is enabled: the `TRACEDECAY_MEMORY_INJECTION` env var wins when set, otherwise the user-config flag (default on).

()

Source from the content-addressed store, hash-verified

60/// Whether fact injection is enabled: the `TRACEDECAY_MEMORY_INJECTION` env
61/// var wins when set, otherwise the user-config flag (default on).
62pub fn memory_injection_enabled() -> bool {
63 injection_enabled_from(
64 crate::config::brand_env("MEMORY_INJECTION").as_deref(),
65 crate::user_config::UserConfig::load().memory_injection_enabled,
66 )
67}
68
69/// Pure form of the gate for tests: env override beats the config flag.
70pub fn injection_enabled_from(env_value: Option<&str>, config_flag: bool) -> bool {

Callers 4

session_memory_digestFunction · 0.85
prompt_memory_recallFunction · 0.85

Calls 3

injection_enabled_fromFunction · 0.85
brand_envFunction · 0.85
loadFunction · 0.50

Tested by

no test coverage detected