self-review 2026-05-29: fix dampening floor and cleanup route_create_node auto-link

Two changes:

1. el_runtime.c — engram_activation_dampen(): add floor of 0.35.
   ISE nodes with ac=900+ had dampen=0.128, giving effective salience=0.038
   which fell below the epist>=0.1 gate in engram_activate. This silently
   killed curiosity seeds "self identity values" and "decision pattern lesson"
   — the only corpus matches were high-ac ISEs that were then excluded from
   results, causing activated=0 on 50% of proactive_curiosity scans.
   Floor at 0.35 keeps salience=0.3 nodes at effective_bg=0.105, above the
   visibility threshold, without disrupting relative ordering of content nodes.

2. server.el — route_create_node: replace stale inline auto-link with
   auto_link_content_node(). The inline logic used the old engram_search_json
   (substring, no ISE filter) while the better BM25-based auto_link_content_node
   was added in 2026-05-28 and wired to /api/neuron/* routes but not to the
   raw /api/nodes POST path. Removes ~40 lines of duplicated logic.
This commit is contained in:
2026-05-29 08:36:48 -05:00
parent a000599bfe
commit 412bd2744e
3 changed files with 20 additions and 103 deletions
+1 -49
View File
@@ -354,55 +354,7 @@ el_val_t route_create_node(el_val_t method, el_val_t path, el_val_t body) {
salience = el_from_float(0.5);
}
el_val_t id = engram_node(content, node_type, salience);
el_val_t auto_linked = 0;
el_val_t clen = str_len(content);
if (clen >= 20) {
el_val_t sp1 = str_index_of(content, EL_STR(" "));
el_val_t w1end = sp1;
if (sp1 < 0) {
w1end = clen;
}
el_val_t word1 = str_slice(content, 0, w1end);
el_val_t search_term = EL_STR("");
if (str_len(word1) >= 5) {
search_term = word1;
}
if (str_eq(search_term, EL_STR(""))) {
if (sp1 >= 0) {
el_val_t rest = str_slice(content, (sp1 + 1), clen);
el_val_t sp2 = str_index_of(rest, EL_STR(" "));
el_val_t w2end = sp2;
if (sp2 < 0) {
w2end = str_len(rest);
}
el_val_t word2 = str_slice(rest, 0, w2end);
if (str_len(word2) >= 5) {
search_term = word2;
}
}
}
if (!str_eq(search_term, EL_STR(""))) {
el_val_t results = engram_search_json(search_term, 10);
el_val_t n = json_array_len(results);
el_val_t i = 0;
while (i < n) {
if (auto_linked >= 5) {
i = n;
}
if (auto_linked < 5) {
el_val_t elem = json_array_get(results, i);
el_val_t rid = json_get_string(elem, EL_STR("id"));
if (!str_eq(rid, EL_STR(""))) {
if (!str_eq(rid, id)) {
engram_connect(id, rid, el_from_float(0.5), EL_STR("related"));
auto_linked = (auto_linked + 1);
}
}
i = (i + 1);
}
}
}
}
el_val_t auto_linked = auto_link_content_node(id, content);
return el_str_concat(el_str_concat(el_str_concat(el_str_concat(el_str_concat(el_str_concat(el_str_concat(el_str_concat(EL_STR("{\"id\":\""), id), EL_STR("\",\"content\":\"")), content), EL_STR("\",\"node_type\":\"")), node_type), EL_STR("\",\"auto_linked\":")), int_to_str(auto_linked)), EL_STR("}"));
return 0;
}