1111from .config import DEFAULT_LOCK_STALE_SECONDS , REFLECT_SKILL_PREFIX
1212
1313
14+ @dataclass
15+ class StableMemoryConfig :
16+ """SessionStart stable memory injection configuration."""
17+
18+ # Whether SessionStart reads and injects project MEMORY.md.
19+ enabled : bool = True
20+
21+
1422@dataclass
1523class SessionReflectionTriggerConfig :
1624 """Deterministic Stop-hook trigger policy configuration."""
1725
1826 # Whether Stop-hook trigger evaluation is active.
1927 enabled : bool = True
28+ # Whether trigger policy may request memory review.
29+ memory_review : bool = True
30+ # Whether trigger policy may request skill review.
31+ skill_review : bool = True
2032 # Number of Stop events between memory-reflection nudges.
2133 memory_stop_interval : int = 3
2234 # Maximum transcript context sent to the memory-reflection decision path.
@@ -63,6 +75,10 @@ class SessionRecallConfig:
6375
6476 # Whether focused recall and archive storage are enabled.
6577 enabled : bool = True
78+ # Whether SessionStart injects the recall policy pointer.
79+ session_start_policy : bool = True
80+ # Whether manual `csep recall` queries may read the recall store.
81+ manual_query : bool = True
6682 # Whether the Stop hook archives transcripts into session recall.
6783 stop_hook_archive : bool = True
6884
@@ -81,6 +97,8 @@ class PluginConfig:
8197
8298 # Configuration schema version supported by this loader.
8399 schema_version : int = 2
100+ # Stable Memory startup injection configuration.
101+ stable_memory : StableMemoryConfig = field (default_factory = StableMemoryConfig )
84102 # Session reflection worker and trigger configuration.
85103 session_reflection : SessionReflectionConfig = field (default_factory = SessionReflectionConfig )
86104 # Session recall archive and recall configuration.
@@ -116,13 +134,16 @@ class LoadResult:
116134
117135_KNOWN_TOP_LEVEL_KEYS = {
118136 "schema_version" ,
137+ "stable_memory" ,
119138 "session_reflection" ,
120139 "session_recall" ,
121140 "log" ,
122141}
123142
124143_KNOWN_PATHS = {
125144 "schema_version" ,
145+ "stable_memory" ,
146+ "stable_memory.enabled" ,
126147 "session_reflection" ,
127148 "session_reflection.enabled" ,
128149 "session_reflection.backend" ,
@@ -135,6 +156,8 @@ class LoadResult:
135156 "session_reflection.max_concurrent_jobs" ,
136157 "session_reflection.trigger" ,
137158 "session_reflection.trigger.enabled" ,
159+ "session_reflection.trigger.memory_review" ,
160+ "session_reflection.trigger.skill_review" ,
138161 "session_reflection.trigger.memory_stop_interval" ,
139162 "session_reflection.trigger.memory_context_chars" ,
140163 "session_reflection.trigger.skill_tool_call_interval" ,
@@ -143,6 +166,8 @@ class LoadResult:
143166 "session_reflection.trigger.active_job_stale_seconds" ,
144167 "session_recall" ,
145168 "session_recall.enabled" ,
169+ "session_recall.session_start_policy" ,
170+ "session_recall.manual_query" ,
146171 "session_recall.stop_hook_archive" ,
147172 "log" ,
148173 "log.retention_days" ,
@@ -199,6 +224,15 @@ def load_config(
199224 sources = _default_sources (config )
200225 sources ["schema_version" ] = "config.toml" if "schema_version" in raw_toml else "default"
201226
227+ stable_memory_toml = _table (raw_toml , "stable_memory" , warnings )
228+ _apply_bool (
229+ config .stable_memory ,
230+ "enabled" ,
231+ stable_memory_toml ,
232+ "stable_memory.enabled" ,
233+ sources ,
234+ )
235+
202236 reflection_toml = _table (raw_toml , "session_reflection" , warnings )
203237 _apply_bool (
204238 config .session_reflection ,
@@ -278,6 +312,20 @@ def load_config(
278312 "session_reflection.trigger.enabled" ,
279313 sources ,
280314 )
315+ _apply_bool (
316+ config .session_reflection .trigger ,
317+ "memory_review" ,
318+ trigger_toml ,
319+ "session_reflection.trigger.memory_review" ,
320+ sources ,
321+ )
322+ _apply_bool (
323+ config .session_reflection .trigger ,
324+ "skill_review" ,
325+ trigger_toml ,
326+ "session_reflection.trigger.skill_review" ,
327+ sources ,
328+ )
281329 for field_name in (
282330 "memory_stop_interval" ,
283331 "memory_context_chars" ,
@@ -352,6 +400,20 @@ def load_config(
352400 "session_recall.enabled" ,
353401 sources ,
354402 )
403+ _apply_bool (
404+ config .session_recall ,
405+ "session_start_policy" ,
406+ recall_toml ,
407+ "session_recall.session_start_policy" ,
408+ sources ,
409+ )
410+ _apply_bool (
411+ config .session_recall ,
412+ "manual_query" ,
413+ recall_toml ,
414+ "session_recall.manual_query" ,
415+ sources ,
416+ )
355417 _apply_bool (
356418 config .session_recall ,
357419 "stop_hook_archive" ,
0 commit comments