self-review 2026-08-13: seed curiosity from the argmax, not the first word

auto_term_try_slot now passes the WM node's ID to engram_salient_term()
instead of passing its label to a first-word extractor. The runtime scores
every candidate token in the node's text and returns the best one, falling
back from a sentinel label ("memory:remembered") to content — which is the
only reason Memory nodes are visible to the extractor at all. They dominate
working memory, and dynamic seeding had been dead for 50+ consecutive scans
because of it.

Policy stays here: node-type filter, df thresholds, stopword list. The
runtime measures, the soul decides — same split as engram_label_df.

The stopword list stays, and not as belt-and-braces. An earlier draft assumed
the min_df floor would subsume it based on 08-03's finding that function
words have df 0 in labels. Re-measured under word-boundary df: about:2,
whole:1, them:2 — they clear a floor of 1. What keeps them from winning is
the argmax, not the floor.

The old extractor and its five guards are retained as
auto_term_try_slot_legacy, unreferenced, so the reasoning behind each guard
stays readable next to what replaced it. Delete once the new path has a month
of live telemetry.

Live after restart: auto_term producing DRIFT, Wrote; empty streak reset to 0
and holding; activation counts 123-281, within the normal band, no flood.
This commit is contained in:
2026-08-13 08:43:25 -05:00
parent 02ed4e297d
commit d5588ed4aa
3 changed files with 200 additions and 90 deletions
+83 -11
View File
@@ -587,7 +587,77 @@ fn emit_heartbeat() -> Void {
// neuron-api label fix. Sentinel-shaped labels ("knowledge:captured",
// "memory:remembered" — colon, no space) carry no seed signal and are
// skipped so legacy nodes cannot seed the scan with the word "knowledge".
fn auto_term_try_slot(slot_type: String, slot_lbl: String) -> Void {
// ARGMAX REWRITE (2026-08-13 self-review). auto_term_empty_streak — the
// counter the 2026-08-06 review added to catch exactly this — read 50 and
// climbing: fifty consecutive scans where dynamic seeding produced nothing
// and the loop ran on its four hardcoded phrases. The live WM top said why:
// every one of the top slots was a Memory node labelled "memory:remembered".
// This function read the LABEL only, the sentinel guard below (correctly)
// rejects sentinels, so there was never anything to extract. The extractor
// was written against Knowledge nodes, which have real titles, and was
// structurally blind to the node type that actually dominates WM.
//
// Rather than add a sixth guard to the five below, the selection algorithm
// is now inverted and lives in the runtime: engram_salient_term() scores
// EVERY candidate token in the node's text and returns the argmax of
// idf·position·casing (YAKE, Campos et al. 2020, with real corpus IDF
// substituted for YAKE's corpus-free proxies), falling back from a sentinel
// label to the node's content. Term quality is now the selection criterion
// instead of a veto, so a bad token loses to a better token in the same text
// without needing to be on any list. Tabu is applied during the argmax, so
// inhibition-of-return costs seed quality rather than costing the scan.
//
// MEASURED BEFORE SHIPPING, on 60 live Memory nodes: 0 empty, versus 60 of 60
// empty under the old extractor. Terms produced are topical — HEBBIAN,
// CONSOLIDATION, TEMPORAL, crash-loop, PRIMING, NEIGHBORHOOD, DRIFT. Three of
// sixty are weak header words ("STEP", "DONE"). They are left alone
// deliberately: adding them to a list is the exact move that produced four
// previous blocklists, and a mediocre seed on 5% of scans is not a flood.
//
// The stopword list below STAYS, and not as belt-and-braces. An earlier draft
// of this change assumed the min_df floor would subsume it, on 08-03's
// finding that function words have df 0 in labels. Re-measured under
// word-boundary df: about:2, whole:1, them:2 — they clear a floor of 1. What
// keeps them from winning is the argmax, not the floor. The list still earns
// its keep on the Title-case cases.
//
// What stays here is policy: the node-type filter, the df thresholds, and the
// stopword list. The runtime measures; the soul decides. Same split as
// engram_label_df.
fn auto_term_try_slot(slot_type: String, slot_id: String) -> Void {
state_set("_ats_ok", "0")
if str_eq(slot_type, "Memory") { state_set("_ats_ok", "1") }
if str_eq(slot_type, "BacklogItem") { state_set("_ats_ok", "1") }
if str_eq(slot_type, "Entity") { state_set("_ats_ok", "1") }
if str_eq(slot_type, "Knowledge") { state_set("_ats_ok", "1") }
if str_eq(state_get("_ats_ok"), "1") {
if !str_eq(slot_id, "") {
// Tabu ring, pipe-delimited, excluded inside the argmax.
let tabu: String = "|" + state_get("soul.tabu_t0")
+ "|" + state_get("soul.tabu_t1")
+ "|" + state_get("soul.tabu_t2")
+ "|" + state_get("soul.tabu_t3") + "|"
let df_max: Int = engram_node_count() / 400
let df_cap: Int = if df_max > 8 { df_max } else { 8 }
let term: String = engram_salient_term(slot_id, df_cap, 1, tabu)
if !str_eq(term, "") {
state_set("_ats_gw", "0")
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") }
if str_eq(state_get("_ats_gw"), "0") {
state_set("cseed_auto", term)
}
}
}
}
return ""
}
// SUPERSEDED 2026-08-13 — retained for the record. The first-word extractor
// and its five accumulated guards, replaced by the argmax above. Kept
// unreferenced so the reasoning behind each guard stays readable next to what
// replaced it; delete once engram_salient_term has a month of live telemetry.
fn auto_term_try_slot_legacy(slot_type: String, slot_lbl: String) -> Void {
state_set("_ats_ok", "0")
if str_eq(slot_type, "Memory") { state_set("_ats_ok", "1") }
if str_eq(slot_type, "BacklogItem") { state_set("_ats_ok", "1") }
@@ -806,16 +876,18 @@ fn proactive_curiosity() -> Bool {
let wm10_n2: String = json_array_get(wm10, 2)
let wm10_n1: String = json_array_get(wm10, 1)
let wm10_n0: String = json_array_get(wm10, 0)
auto_term_try_slot(json_get(wm10_n9, "node_type"), json_get(wm10_n9, "label"))
auto_term_try_slot(json_get(wm10_n8, "node_type"), json_get(wm10_n8, "label"))
auto_term_try_slot(json_get(wm10_n7, "node_type"), json_get(wm10_n7, "label"))
auto_term_try_slot(json_get(wm10_n6, "node_type"), json_get(wm10_n6, "label"))
auto_term_try_slot(json_get(wm10_n5, "node_type"), json_get(wm10_n5, "label"))
auto_term_try_slot(json_get(wm10_n4, "node_type"), json_get(wm10_n4, "label"))
auto_term_try_slot(json_get(wm10_n3, "node_type"), json_get(wm10_n3, "label"))
auto_term_try_slot(json_get(wm10_n2, "node_type"), json_get(wm10_n2, "label"))
auto_term_try_slot(json_get(wm10_n1, "node_type"), json_get(wm10_n1, "label"))
auto_term_try_slot(json_get(wm10_n0, "node_type"), json_get(wm10_n0, "label"))
// 2026-08-13: pass the node ID, not the label. engram_salient_term reads
// the node directly so it can fall back from a sentinel label to content.
auto_term_try_slot(json_get(wm10_n9, "node_type"), json_get(wm10_n9, "id"))
auto_term_try_slot(json_get(wm10_n8, "node_type"), json_get(wm10_n8, "id"))
auto_term_try_slot(json_get(wm10_n7, "node_type"), json_get(wm10_n7, "id"))
auto_term_try_slot(json_get(wm10_n6, "node_type"), json_get(wm10_n6, "id"))
auto_term_try_slot(json_get(wm10_n5, "node_type"), json_get(wm10_n5, "id"))
auto_term_try_slot(json_get(wm10_n4, "node_type"), json_get(wm10_n4, "id"))
auto_term_try_slot(json_get(wm10_n3, "node_type"), json_get(wm10_n3, "id"))
auto_term_try_slot(json_get(wm10_n2, "node_type"), json_get(wm10_n2, "id"))
auto_term_try_slot(json_get(wm10_n1, "node_type"), json_get(wm10_n1, "id"))
auto_term_try_slot(json_get(wm10_n0, "node_type"), json_get(wm10_n0, "id"))
let auto_term: String = state_get("cseed_auto")
let results_auto: String = if str_eq(auto_term, "") { "[]" } else { engram_activate_json(auto_term, 1) }
let found_auto: Int = json_array_len(results_auto)