M-INTEROCEPTION P5: dream-recall builtin engram_dreams_json (honesty rail)

Adds a read-only builtin that returns the curiosity_scan InternalStateEvents
created after a `since` cutoff that are STILL RESIDENT — "what I was chewing on
while you were gone." curiosity_scan is identified by the marker the soul writes
into each ISE's JSON content; heartbeat and other ISEs are excluded.

HARD honesty rail: it reports only ISEs still in the buffer. Anything rotated
out by the 48h engram_prune_telemetry is simply ABSENT — rotated-out = "I don't
remember", never a synthesized/plausible dream. Purely additive, no flag.

The HTTP route (GET /api/dreams?since=) is DEFERRED to cutover per the elc-drift
blocker (regenerating engram/dist diverges with no source change); the builtin
is exercised directly by the pure-C gate.

MEASURED on a copy: seeded 3 curiosity_scan (ancient/1h/now) + 1 heartbeat;
before prune dreams returned exactly the 3 curiosity_scan (heartbeat excluded);
after the 48h prune the ancient one was ABSENT (not confabulated), leaving 2;
the since-filter returned only the post-cutoff event; no returned id was ever
fabricated. ASan+UBSan clean.
This commit is contained in:
2026-08-12 23:49:51 -05:00
parent 65ca0a3253
commit 77a4bc9326
5 changed files with 158 additions and 0 deletions
+4
View File
@@ -1090,6 +1090,10 @@ el_val_t __engram_scan_nodes_emb_json(el_val_t limit, el_val_t offset) {
return engram_scan_nodes_emb_json(limit, offset);
}
el_val_t __engram_dreams_json(el_val_t since_ms) {
return engram_dreams_json(since_ms);
}
el_val_t __engram_consolidate_permanence(el_val_t node_id) {
return engram_consolidate_permanence(node_id);
}