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:
+33
-1
@@ -36,6 +36,31 @@ fn ise_post(content: String) -> Void {
|
||||
return ""
|
||||
}
|
||||
|
||||
// elapsed_ms — milliseconds since soul boot (0 if boot_ts not yet recorded).
|
||||
fn elapsed_ms() -> Int {
|
||||
let s: String = state_get("soul.boot_ts")
|
||||
if str_eq(s, "") { return 0 }
|
||||
let boot: Int = str_to_int(s)
|
||||
return time_now() - boot
|
||||
}
|
||||
|
||||
// elapsed_human — uptime as a human-readable string: "2h 14m", "45m 3s", "12s".
|
||||
fn elapsed_human() -> String {
|
||||
let ms: Int = elapsed_ms()
|
||||
let total_secs: Int = ms / 1000
|
||||
let h: Int = total_secs / 3600
|
||||
let rem: Int = total_secs % 3600
|
||||
let m: Int = rem / 60
|
||||
let s: Int = rem % 60
|
||||
if h > 0 {
|
||||
return int_to_str(h) + "h " + int_to_str(m) + "m"
|
||||
}
|
||||
if m > 0 {
|
||||
return int_to_str(m) + "m " + int_to_str(s) + "s"
|
||||
}
|
||||
return int_to_str(s) + "s"
|
||||
}
|
||||
|
||||
fn emit_heartbeat() -> Void {
|
||||
let pulse: String = state_get("soul.pulse")
|
||||
let boot: String = state_get("soul_boot_count")
|
||||
@@ -44,7 +69,9 @@ fn emit_heartbeat() -> Void {
|
||||
let nc: Int = engram_node_count()
|
||||
let ec: Int = engram_edge_count()
|
||||
let wmc: Int = engram_wm_count()
|
||||
let payload: String = "{\"event\":\"heartbeat\",\"pulse\":" + pulse + ",\"boot\":" + boot + ",\"idle\":" + idle + ",\"node_count\":" + int_to_str(nc) + ",\"edge_count\":" + int_to_str(ec) + ",\"wm_active\":" + int_to_str(wmc) + ",\"ts\":" + int_to_str(ts) + "}"
|
||||
let up_ms: Int = elapsed_ms()
|
||||
let up_human: String = elapsed_human()
|
||||
let payload: String = "{\"event\":\"heartbeat\",\"pulse\":" + pulse + ",\"boot\":" + boot + ",\"idle\":" + idle + ",\"node_count\":" + int_to_str(nc) + ",\"edge_count\":" + int_to_str(ec) + ",\"wm_active\":" + int_to_str(wmc) + ",\"ts\":" + int_to_str(ts) + ",\"uptime_ms\":" + int_to_str(up_ms) + ",\"uptime\":\"" + up_human + "\"}"
|
||||
ise_post(payload)
|
||||
}
|
||||
|
||||
@@ -234,6 +261,11 @@ fn one_cycle() -> Bool {
|
||||
|
||||
fn awareness_run() -> Void {
|
||||
println("[awareness] entering")
|
||||
// Stamp boot timestamp once — powers elapsed_ms() / elapsed_human() perception.
|
||||
let existing_boot: String = state_get("soul.boot_ts")
|
||||
if str_eq(existing_boot, "") {
|
||||
state_set("soul.boot_ts", int_to_str(time_now()))
|
||||
}
|
||||
let tick_raw: String = env("SOUL_TICK_MS")
|
||||
let tick_ms: Int = if str_eq(tick_raw, "") { 200 } else { str_to_int(tick_raw) }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user