self-review 2026-08-01: fix importance flattening in remember/evolve/cultivate paths

Four sites passed the Float local 'sal' through el_from_float() a second
time. el_val_t is the bit-pattern of the double, so re-wrapping performs
an int64->double VALUE conversion of the bits before re-bitcasting —
garbage that fails engram_decode_score's range check and clamps to
defaults. Net effect: importance="critical" stored 0.5/0.5 — importance
levels were cosmetic on the MCP memory path. Verified fixed live:
critical now stores salience/importance 0.95/0.95. Same bug fixed today
in engram server.el route_create_node (foundation/el 7f03876). Literal
wraps (el_from_float(0.9)) are safe — elc passes numeric literals raw.
This commit is contained in:
2026-08-01 08:42:44 -05:00
parent edb0670670
commit 456267a771
2 changed files with 8 additions and 8 deletions
+4 -4
View File
@@ -341,7 +341,7 @@ fn handle_api_remember(body: String) -> String {
"[" + inner + ",\"project:" + project + "\"]"
}
let id: String = engram_node_full(content, "Memory", "memory:remembered",
el_from_float(sal), el_from_float(sal), el_from_float(0.9),
sal, sal, el_from_float(0.9),
"Episodic", final_tags)
if !api_persisted(id) { return api_not_persisted(id) }
return "{\"id\":\"" + id + "\",\"ok\":true}"
@@ -368,7 +368,7 @@ fn handle_api_node_create(body: String) -> String {
}
}
let id: String = engram_node_full(content, node_type, label,
el_from_float(sal), el_from_float(sal), el_from_float(0.9),
sal, sal, el_from_float(0.9),
tier, tags)
if !api_persisted(id) { return api_not_persisted(id) }
return "{\"id\":\"" + id + "\",\"ok\":true}"
@@ -726,7 +726,7 @@ fn handle_api_evolve_memory(body: String) -> String {
}
let tags: String = "[\"Memory\",\"evolved\"]"
let new_id: String = engram_node_full(content, "Memory", "memory:evolved",
el_from_float(sal), el_from_float(sal), el_from_float(0.9),
sal, sal, el_from_float(0.9),
"Episodic", tags)
if !str_eq(prior_id, "") && !str_eq(new_id, "") {
engram_connect(new_id, prior_id, el_from_float(0.9), "supersedes")
@@ -808,7 +808,7 @@ fn handle_api_cultivate(body: String) -> String {
}
let tags: String = "[\"Memory\",\"evolved\",\"cultivated\"]"
let new_id: String = engram_node_full(content, "Memory", "memory:cultivated",
el_from_float(sal), el_from_float(sal), el_from_float(0.9),
sal, sal, el_from_float(0.9),
"Episodic", tags)
if !str_eq(prior_id, "") && !str_eq(new_id, "") {
engram_connect(new_id, prior_id, el_from_float(0.9), "supersedes")