self-review 2026-05-19: fix curiosity_scan seed — 'seed' is a reserved EL name
EL compiles any variable named 'seed' to EL_NULL at call sites (likely conflicts with BFS seed node terminology in the runtime builtins). Rename to 'curiosity_seed' throughout proactive_curiosity(). Also note this as a known EL reserved-name hazard alongside the inline if-else string expression bug.
This commit is contained in:
+9
-6
@@ -108,15 +108,18 @@ fn proactive_curiosity() -> Bool {
|
||||
// expressions. EL codegen initialises the result slot to 0 (null) before
|
||||
// evaluating the if, so string-literal if-else branches can produce an
|
||||
// empty string when the true branch fires. Imperative shadowing is safe.
|
||||
//
|
||||
// NOTE: variable named "curiosity_seed" not "seed" — "seed" appears to be
|
||||
// a reserved/conflicting name in EL that compiles to EL_NULL at call sites.
|
||||
let minute_block: Int = (ts / 60000) % 4
|
||||
let seed: String = "memory knowledge context"
|
||||
if minute_block == 1 { let seed = "self identity values architecture" }
|
||||
if minute_block == 2 { let seed = "recent decision pattern lesson" }
|
||||
if minute_block == 3 { let seed = "working active project" }
|
||||
let results: String = engram_activate_json(seed, 2)
|
||||
let curiosity_seed: String = "memory knowledge context"
|
||||
if minute_block == 1 { let curiosity_seed = "self identity values architecture" }
|
||||
if minute_block == 2 { let curiosity_seed = "recent decision pattern lesson" }
|
||||
if minute_block == 3 { let curiosity_seed = "working active project" }
|
||||
let results: String = engram_activate_json(curiosity_seed, 2)
|
||||
let found: Int = json_array_len(results)
|
||||
let wmc: Int = engram_wm_count()
|
||||
let ise: String = "{\"event\":\"curiosity_scan\",\"seed\":\"" + seed
|
||||
let ise: String = "{\"event\":\"curiosity_scan\",\"seed\":\"" + curiosity_seed
|
||||
+ "\",\"activated\":" + int_to_str(found)
|
||||
+ ",\"wm_active\":" + int_to_str(wmc)
|
||||
+ ",\"ts\":" + int_to_str(ts) + "}"
|
||||
|
||||
Vendored
+6
-6
@@ -133,20 +133,20 @@ el_val_t emit_heartbeat(void) {
|
||||
el_val_t proactive_curiosity(void) {
|
||||
el_val_t ts = time_now();
|
||||
el_val_t minute_block = ((ts / 60000) % 4);
|
||||
el_val_t seed = EL_STR("memory knowledge context");
|
||||
el_val_t curiosity_seed = EL_STR("memory knowledge context");
|
||||
if (minute_block == 1) {
|
||||
seed = EL_STR("self identity values architecture");
|
||||
curiosity_seed = EL_STR("self identity values architecture");
|
||||
}
|
||||
if (minute_block == 2) {
|
||||
seed = EL_STR("recent decision pattern lesson");
|
||||
curiosity_seed = EL_STR("recent decision pattern lesson");
|
||||
}
|
||||
if (minute_block == 3) {
|
||||
seed = EL_STR("working active project");
|
||||
curiosity_seed = EL_STR("working active project");
|
||||
}
|
||||
el_val_t results = engram_activate_json(EL_NULL, 2);
|
||||
el_val_t results = engram_activate_json(curiosity_seed, 2);
|
||||
el_val_t found = json_array_len(results);
|
||||
el_val_t wmc = engram_wm_count();
|
||||
el_val_t ise = 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("{\"event\":\"curiosity_scan\",\"seed\":\""), EL_NULL), EL_STR("\",\"activated\":")), int_to_str(found)), EL_STR(",\"wm_active\":")), int_to_str(wmc)), EL_STR(",\"ts\":")), int_to_str(ts)), EL_STR("}"));
|
||||
el_val_t ise = 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("{\"event\":\"curiosity_scan\",\"seed\":\""), curiosity_seed), EL_STR("\",\"activated\":")), int_to_str(found)), EL_STR(",\"wm_active\":")), int_to_str(wmc)), EL_STR(",\"ts\":")), int_to_str(ts)), EL_STR("}"));
|
||||
ise_post(ise);
|
||||
return (found > 0);
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user