self-review 2026-05-28: checkpoint ISE decay fix + auto-linking for MCP nodes

Three changes:

1. Fix checkpoint ISE temporal_decay_rate: engram_emit_ise_internal was
   hardcoded to 0.0 (global 168h default) instead of 2.310 (Working-tier
   48h). Result: checkpoint ISEs accumulated at 3.5x intended rate.

2. Raise CHECKPOINT_INTERVAL 1→10: checkpoint ISE fires on every single
   node write, producing 2:1 checkpoint:content ratio in ISE stream.
   MCP routes still call engram_write_binary_el explicitly after each
   important write, so no knowledge durability is lost.

3. Add auto_link_content_node to server.el: route_neuron_memory and
   route_neuron_knowledge_capture were creating nodes with zero edges —
   invisible to BFS traversal, only reachable via lexical/semantic seed.
   New helper runs BM25 over top-20 results, skips ISE nodes (which
   dominate the 14K-node corpus), connects up to 3 related nodes.
This commit is contained in:
2026-05-28 08:42:41 -05:00
parent 8f922e68b3
commit a000599bfe
4 changed files with 144 additions and 12 deletions
+5 -2
View File
@@ -5768,7 +5768,7 @@ static uint8_t g_user_pub[1568];
static uint8_t g_user_priv[3168];
static int g_keys_loaded = 0;
static int64_t g_writes_since_checkpoint = 0;
#define ENGRAM_CHECKPOINT_INTERVAL 1 /* save binary on every write */
#define ENGRAM_CHECKPOINT_INTERVAL 10 /* save binary every 10 writes (MCP routes still save explicitly) */
/* Initialize the five canonical layers on a fresh store. Called once from
* engram_get(). Layer ids 0..4 are reserved; runtime-injected imprint/suit
@@ -8198,7 +8198,10 @@ static void engram_emit_ise_internal(const char* content, const char* label) {
n->salience = 0.3f;
n->importance = 0.5f;
n->confidence = 1.0f;
n->temporal_decay_rate = 0.0;
/* Working-tier decay: 48h half-life (lambda=2.31). Previously 0.0 which
* incorrectly used the 168h global default, causing checkpoint ISEs to
* accumulate at ~3.5x their intended rate. (2026-05-28 self-review) */
n->temporal_decay_rate = 2.310;
n->activation_count = 0;
int64_t now = engram_now_ms();
n->last_activated = now;