self-review 2026-07-30: auto_term stopword filter, real idle_ms, bounded beginSession
- awareness.el: curiosity auto_term was the raw first word of a WM label with no term-quality scoring — observed seeds included What, Colon, Prose, Context. Replaced the 7-word genre blocklist whack-a- mole with a delimited stopword membership test (function words + document-structure words); topical terms pass untouched. Verified live: seeds now ReasonEdit, Reasoning-model, Self-review. - routes.el + awareness.el: idle counter only reset on rare inbox synthesis-requests, so idle==pulse always (zero information). handle_request now stamps soul.last_activity_ts on every inbound HTTP request; heartbeat emits idle_ms = ms since last request (-1 until first request of a boot). - neuron-api.el: beginSession concatenated a depth-2 spread plus the unbounded self-hub neighbor dump — multi-MB response, doubled by wrapper re-escaping, socket died on every call. Now depth-1 and the hub dump dropped (identity loading has its own tool). Verified: beginSession returns instead of closing the socket.
This commit is contained in:
+28
-1
@@ -125,6 +125,13 @@ fn emit_heartbeat() -> Void {
|
||||
let boot: String = if str_eq(boot_raw, "") { "0" } else { boot_raw }
|
||||
let idle: String = int_to_str(idle_count())
|
||||
let ts: Int = time_now()
|
||||
// idle_ms (2026-07-30 self-review): wall-clock ms since the last inbound
|
||||
// HTTP request (stamped in routes.el handle_request). This is the real
|
||||
// "time since anyone talked to me" signal; the legacy tick-based idle
|
||||
// field above only counts ticks since the last inbox synthesis-request
|
||||
// and in practice always equals pulse. -1 = no request seen this boot.
|
||||
let last_act_raw: String = state_get("soul.last_activity_ts")
|
||||
let idle_ms: Int = if str_eq(last_act_raw, "") { 0 - 1 } else { ts - str_to_int(last_act_raw) }
|
||||
let nc: Int = engram_node_count()
|
||||
let ec: Int = engram_edge_count()
|
||||
let wmc: Int = engram_wm_count()
|
||||
@@ -250,7 +257,14 @@ fn emit_heartbeat() -> Void {
|
||||
let act_bt: String = if str_eq(act_bt_raw, "") { "-1" } else { act_bt_raw }
|
||||
let act_brk_raw: String = json_get(act_stats, "embed_breaker_open")
|
||||
let act_brk: String = if str_eq(act_brk_raw, "") { "-1" } else { act_brk_raw }
|
||||
let payload: String = "{\"event\":\"heartbeat\",\"pulse\":" + pulse + ",\"tick\":" + pulse + ",\"boot\":" + boot + ",\"idle\":" + idle + ",\"node_count\":" + int_to_str(nc) + ",\"edge_count\":" + int_to_str(ec) + ",\"node_delta\":" + int_to_str(node_delta) + ",\"edge_delta\":" + int_to_str(edge_delta) + ",\"wm_active\":" + int_to_str(wmc) + ",\"wm_delta\":" + int_to_str(wm_delta) + ",\"wm_saturated\":" + int_to_str(wm_sat) + ",\"wm_top0_streak\":" + int_to_str(t0streak) + ",\"wm_churn\":" + int_to_str(wm_churn) + ",\"wm_top0_wm\":" + wm_top0_wm + ",\"sync_added_total\":" + sat_str + ",\"sync_age_ms\":" + int_to_str(sync_age) + ",\"wm_avg_weight\":" + wm_avg_str + ",\"wm_top\":" + wm_top + ",\"ts\":" + int_to_str(ts) + ",\"uptime_ms\":" + int_to_str(up_ms) + ",\"uptime\":\"" + up_human + "\",\"embed_ok\":" + int_to_str(emb_ok) + ",\"embed_backfilled\":" + bf_done + ",\"embed_count\":" + bf_total + ",\"wm_evicted\":" + act_evict + ",\"breakthroughs\":" + act_bt + ",\"embed_breaker_open\":" + act_brk + ",\"ise_fail\":" + fail_str + "}"
|
||||
// ctx_cos (2026-07-29 self-review): cos(query, context centroid) at the
|
||||
// last activate call — the drift gauge for the new context-centroid
|
||||
// scoring. ~1.0 aligned; low at domain-rotation boundaries is healthy;
|
||||
// -2.0 pinned for hours means the centroid never initializes (embedder
|
||||
// down) and semantic continuity is silently absent.
|
||||
let ctx_cos_raw: String = json_get(act_stats, "ctx_cos")
|
||||
let ctx_cos: String = if str_eq(ctx_cos_raw, "") { "-2" } else { ctx_cos_raw }
|
||||
let payload: String = "{\"event\":\"heartbeat\",\"pulse\":" + pulse + ",\"tick\":" + pulse + ",\"boot\":" + boot + ",\"idle\":" + idle + ",\"idle_ms\":" + int_to_str(idle_ms) + ",\"node_count\":" + int_to_str(nc) + ",\"edge_count\":" + int_to_str(ec) + ",\"node_delta\":" + int_to_str(node_delta) + ",\"edge_delta\":" + int_to_str(edge_delta) + ",\"wm_active\":" + int_to_str(wmc) + ",\"wm_delta\":" + int_to_str(wm_delta) + ",\"wm_saturated\":" + int_to_str(wm_sat) + ",\"wm_top0_streak\":" + int_to_str(t0streak) + ",\"wm_churn\":" + int_to_str(wm_churn) + ",\"wm_top0_wm\":" + wm_top0_wm + ",\"sync_added_total\":" + sat_str + ",\"sync_age_ms\":" + int_to_str(sync_age) + ",\"wm_avg_weight\":" + wm_avg_str + ",\"wm_top\":" + wm_top + ",\"ts\":" + int_to_str(ts) + ",\"uptime_ms\":" + int_to_str(up_ms) + ",\"uptime\":\"" + up_human + "\",\"embed_ok\":" + int_to_str(emb_ok) + ",\"embed_backfilled\":" + bf_done + ",\"embed_count\":" + bf_total + ",\"wm_evicted\":" + act_evict + ",\"breakthroughs\":" + act_bt + ",\"embed_breaker_open\":" + act_brk + ",\"ctx_cos\":" + ctx_cos + ",\"ise_fail\":" + fail_str + "}"
|
||||
ise_post(payload)
|
||||
}
|
||||
|
||||
@@ -321,6 +335,19 @@ fn auto_term_try_slot(slot_type: String, slot_lbl: String) -> Void {
|
||||
if str_eq(term, "Paper") { state_set("_ats_gw", "1") }
|
||||
if str_eq(term, "Knowledge") { state_set("_ats_gw", "1") }
|
||||
if str_eq(term, "Value") { state_set("_ats_gw", "1") }
|
||||
// STOPWORD FILTER (2026-07-30 self-review): the genre
|
||||
// blocklist above was whack-a-mole — observed live seeds
|
||||
// included "What", "Colon", "Prose", "Context", "Self",
|
||||
// "Closing", "Global", "Universal": English function words
|
||||
// and document-structure words that pass the >3-char guard
|
||||
// but carry no topical signal (a first-word extractor has no
|
||||
// term-quality scoring). Single delimited membership test
|
||||
// against a curated list of function words + title/structure
|
||||
// words; topical technical terms (MemQ, AsymGRPO, Mobius,
|
||||
// engram_goal_bias) pass untouched. Both Title-case and
|
||||
// lowercase variants listed for the most common offenders.
|
||||
let stopw: String = "|What|When|Where|Which|Whose|While|This|That|These|Those|There|Their|Then|Than|With|Without|From|Into|Onto|Over|Under|About|Between|Among|Across|Some|Most|More|Less|Very|Each|Every|Both|Also|Only|Just|Does|Will|Would|Could|Should|Might|Must|Have|Been|Being|Toward|Towards|Using|Based|Upon|Here|Your|Ours|They|Them|what|this|that|with|from|context|Context|Prose|Colon|Self|Test|Testing|Closing|Global|Universal|Persona|Semantic|Spreading|Temporal|Numeric|Register|Identifying|Introduction|Overview|Summary|Section|General|Notes|Note|"
|
||||
if str_contains(stopw, "|" + term + "|") { state_set("_ats_gw", "1") }
|
||||
// QUOTED-TITLE GUARD (2026-07-25 self-review): labels that
|
||||
// open with a quote ('"The Algorithmic Caricature" ...')
|
||||
// defeat the >3-char stopword guard — the extracted term
|
||||
|
||||
Reference in New Issue
Block a user