From 6819729429879d0f5e86178fa0140b83a91f09bd Mon Sep 17 00:00:00 2001 From: Will Anderson Date: Wed, 1 Jul 2026 11:25:54 -0500 Subject: [PATCH] fix(awareness): correct stale comment; add wm_top to curiosity_scan ISE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The hops=1 comment incorrectly claimed a semantic seed supplement (cosine-sim scan) was active — it was planned but never implemented. Corrected to accurately describe what the runtime does (istr_contains only). Also adds wm_top (top-3 WM nodes by weight) to the curiosity_scan ISE payload so activation patterns are visible without relying solely on the heartbeat's wm_active count. --- awareness.el | 20 +++++++++++++++++--- dist/awareness.c | 3 ++- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/awareness.el b/awareness.el index b0b7931..5b2a02c 100644 --- a/awareness.el +++ b/awareness.el @@ -219,9 +219,14 @@ fn proactive_curiosity() -> Bool { // Activate each term independently so substring seed-finding hits many nodes. // hops=1 (not 2): the in-process Engram has grown to 165K+ nodes. hops=2 BFS // visits far more nodes and returns much larger JSON blobs. On a graph this - // large, hops=1 still activates all directly-related nodes AND triggers the - // semantic seed supplement (cosine sim ≥ 0.70 scan over all embedded nodes), - // giving broad working-memory coverage without the quadratic blowup of hops=2. + // large, hops=1 still activates all directly-related nodes, giving broad + // working-memory coverage without the quadratic blowup of hops=2. + // + // NOTE: a semantic seed supplement (cosine sim ≥ 0.70 scan over embedded nodes) + // was planned alongside hops=1 but is NOT yet implemented — embed_ok in + // heartbeats confirms Ollama is reachable, but no embedding call is made during + // activation. The seed-finding loop in el_runtime.c uses istr_contains only. + // (2026-06-30 self-review: corrected stale comment) let curiosity_seed: String = curiosity_term_a + " " + curiosity_term_b + " " + curiosity_term_c let results_a: String = engram_activate_json(curiosity_term_a, 1) let results_b: String = engram_activate_json(curiosity_term_b, 1) @@ -278,11 +283,20 @@ fn proactive_curiosity() -> Bool { let safe_auto: String = str_replace(auto_term, "\"", "'") let wmc: Int = engram_wm_count() + // wm_top snapshot in curiosity_scan ISE: top-3 WM nodes by weight. + // Heartbeat already records top-5 every 60s; curiosity_scan fires every 30s + // (scan_ms = beat_ms/2) and is the PRIMARY activation driver during idle. + // Without wm_top here, we can't see which nodes actually entered WM after + // each curiosity round — only the aggregate count. Top-3 is enough to + // diagnose "stuck on X" patterns without bloating the ISE payload. + // (2026-07-01 self-review) + let wm3: String = engram_wm_top_json(3) let ise: String = "{\"event\":\"curiosity_scan\",\"seed\":\"" + curiosity_seed + "\",\"auto_term\":\"" + safe_auto + "\",\"minute_block\":" + int_to_str(minute_block) + ",\"activated\":" + int_to_str(total_found) + ",\"wm_active\":" + int_to_str(wmc) + + ",\"wm_top\":" + wm3 + ",\"ts\":" + int_to_str(ts) + "}" ise_post(ise) return total_found > 0 diff --git a/dist/awareness.c b/dist/awareness.c index 0c23d63..b61183a 100644 --- a/dist/awareness.c +++ b/dist/awareness.c @@ -229,7 +229,8 @@ el_val_t proactive_curiosity(void) { el_val_t total_found = (found + found_auto); el_val_t safe_auto = str_replace(auto_term, EL_STR("\""), EL_STR("'")); 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_concat(el_str_concat(el_str_concat(el_str_concat(EL_STR("{\"event\":\"curiosity_scan\",\"seed\":\""), curiosity_seed), EL_STR("\",\"auto_term\":\"")), safe_auto), EL_STR("\",\"minute_block\":")), int_to_str(minute_block)), EL_STR(",\"activated\":")), int_to_str(total_found)), EL_STR(",\"wm_active\":")), int_to_str(wmc)), EL_STR(",\"ts\":")), int_to_str(ts)), EL_STR("}")); + el_val_t wm3 = engram_wm_top_json(3); + 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_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("\",\"auto_term\":\"")), safe_auto), EL_STR("\",\"minute_block\":")), int_to_str(minute_block)), EL_STR(",\"activated\":")), int_to_str(total_found)), EL_STR(",\"wm_active\":")), int_to_str(wmc)), EL_STR(",\"wm_top\":")), wm3), EL_STR(",\"ts\":")), int_to_str(ts)), EL_STR("}")); ise_post(ise); return (total_found > 0); return 0;