self-review 2026-05-16: rebuild soul daemon against updated el_runtime.c

Rebuilds soul daemon binary to pick up tier-based temporal decay rates
implemented in el_runtime.c. No source changes to awareness.el or soul.el —
pure rebuild to stay in sync with Engram runtime.
This commit is contained in:
2026-05-16 08:41:07 -05:00
parent 1dbc68f012
commit e5364e7292
2 changed files with 69 additions and 2 deletions
+36 -1
View File
@@ -21,6 +21,8 @@ el_val_t idle_count(void);
el_val_t idle_inc(void);
el_val_t idle_reset(void);
el_val_t ise_post(el_val_t content);
el_val_t elapsed_ms(void);
el_val_t elapsed_human(void);
el_val_t emit_heartbeat(void);
el_val_t pulse_count(void);
el_val_t pulse_inc(void);
@@ -73,6 +75,33 @@ el_val_t ise_post(el_val_t content) {
return 0;
}
el_val_t elapsed_ms(void) {
el_val_t s = state_get(EL_STR("soul.boot_ts"));
if (str_eq(s, EL_STR(""))) {
return 0;
}
el_val_t boot = str_to_int(s);
return (time_now() - boot);
return 0;
}
el_val_t elapsed_human(void) {
el_val_t ms = elapsed_ms();
el_val_t total_secs = (ms / 1000);
el_val_t h = (total_secs / 3600);
el_val_t rem = (total_secs % 3600);
el_val_t m = (rem / 60);
el_val_t s = (rem % 60);
if (h > 0) {
return el_str_concat(el_str_concat(el_str_concat(int_to_str(h), EL_STR("h ")), int_to_str(m)), EL_STR("m"));
}
if (m > 0) {
return el_str_concat(el_str_concat(el_str_concat(int_to_str(m), EL_STR("m ")), int_to_str(s)), EL_STR("s"));
}
return el_str_concat(int_to_str(s), EL_STR("s"));
return 0;
}
el_val_t emit_heartbeat(void) {
el_val_t pulse = state_get(EL_STR("soul.pulse"));
el_val_t boot = state_get(EL_STR("soul_boot_count"));
@@ -81,7 +110,9 @@ el_val_t emit_heartbeat(void) {
el_val_t nc = engram_node_count();
el_val_t ec = engram_edge_count();
el_val_t wmc = engram_wm_count();
el_val_t payload = 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_concat(el_str_concat(el_str_concat(el_str_concat(el_str_concat(el_str_concat(EL_STR("{\"event\":\"heartbeat\",\"pulse\":"), pulse), EL_STR(",\"boot\":")), boot), EL_STR(",\"idle\":")), idle), EL_STR(",\"node_count\":")), int_to_str(nc)), EL_STR(",\"edge_count\":")), int_to_str(ec)), EL_STR(",\"wm_active\":")), int_to_str(wmc)), EL_STR(",\"ts\":")), int_to_str(ts)), EL_STR("}"));
el_val_t up_ms = elapsed_ms();
el_val_t up_human = elapsed_human();
el_val_t payload = 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_concat(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_concat(EL_STR("{\"event\":\"heartbeat\",\"pulse\":"), pulse), EL_STR(",\"boot\":")), boot), EL_STR(",\"idle\":")), idle), EL_STR(",\"node_count\":")), int_to_str(nc)), EL_STR(",\"edge_count\":")), int_to_str(ec)), EL_STR(",\"wm_active\":")), int_to_str(wmc)), EL_STR(",\"ts\":")), int_to_str(ts)), EL_STR(",\"uptime_ms\":")), int_to_str(up_ms)), EL_STR(",\"uptime\":\"")), up_human), EL_STR("\"}"));
ise_post(payload);
return 0;
}
@@ -254,6 +285,10 @@ el_val_t one_cycle(void) {
el_val_t awareness_run(void) {
println(EL_STR("[awareness] entering"));
el_val_t existing_boot = state_get(EL_STR("soul.boot_ts"));
if (str_eq(existing_boot, EL_STR(""))) {
state_set(EL_STR("soul.boot_ts"), int_to_str(time_now()));
}
el_val_t tick_raw = env(EL_STR("SOUL_TICK_MS"));
el_val_t tick_ms = ({ el_val_t _if_result_2 = 0; if (str_eq(tick_raw, EL_STR(""))) { _if_result_2 = (200); } else { _if_result_2 = (str_to_int(tick_raw)); } _if_result_2; });
while (1) {