Make engram deletes/updates/forgets immutable on the launch branch
The ship-soul builds from this branch, which has the bounded-persona floor (#93) but never received the tombstone/supersede immutability fix (that went to main; hotfix diverged before it). So the launch soul failed verify-soul-contract IMMUTABILITY on the delete/update/forget routes — they hard-removed engram nodes via engram_forget/mem_forget. Apply the same fix, mirroring the knowledge routes' supersede pattern: - node/update -> create new node + "supersedes" edge to the original, KEEP the original (no engram_forget). - node/delete, memory/delete, memory/forget, cultivate forget, and the autonomous awareness forget -> TOMBSTONE via the canonical mem_tombstone (memory.el): keep the node + its edges, record a Tombstone marker, hide from default bounded list reads (?include_deleted recovers). Never engram_forget. The MCP forget tool now routes to the tombstoning delete instead of faking a delete. Internal GC that genuinely removes transient nodes (awareness inbox-trigger consume, consolidation dedup, session-summary replace, telemetry pruning) still calls engram_forget directly and is unchanged. Regenerated dist/soul.c (single-TU) + per-module dist/{memory,awareness, neuron-api}.c from THIS branch's sources under a 3GB physical-RSS watchdog (peak ~32MB), built against the release el_runtime (v1.0.0-20260501). The bounded-persona floor is preserved — verified in the emitted C and the linked binary (BOUNDED PERSONA / SOUL_PERSONA_NAME strings present). verify-soul-contract.sh: GATE PASS — PRESENCE all 27 routes, IMMUTABILITY 5/5 KEPT (memory-update, memory-delete, node-update, node-delete, memory-forget).
This commit is contained in:
+12
-1
@@ -10,6 +10,7 @@ el_val_t mem_remember(el_val_t content, el_val_t tags);
|
||||
el_val_t mem_recall(el_val_t query, el_val_t depth);
|
||||
el_val_t mem_search(el_val_t query, el_val_t limit);
|
||||
el_val_t mem_strengthen(el_val_t node_id);
|
||||
el_val_t mem_tombstone(el_val_t node_id);
|
||||
el_val_t mem_forget(el_val_t node_id);
|
||||
el_val_t mem_consolidate(void);
|
||||
el_val_t mem_save(el_val_t path);
|
||||
@@ -69,8 +70,18 @@ el_val_t mem_strengthen(el_val_t node_id) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
el_val_t mem_tombstone(el_val_t node_id) {
|
||||
el_val_t tags = EL_STR("[\"Tombstone\",\"status:deleted\"]");
|
||||
el_val_t marker = engram_node_full(node_id, EL_STR("Tombstone"), el_str_concat(EL_STR("tombstone:"), node_id), el_from_float(0.01), el_from_float(0.01), el_from_float(1.0), EL_STR("Episodic"), tags);
|
||||
if (!str_eq(marker, EL_STR(""))) {
|
||||
engram_connect(marker, node_id, el_from_float(1.0), EL_STR("tombstones"));
|
||||
}
|
||||
return marker;
|
||||
return 0;
|
||||
}
|
||||
|
||||
el_val_t mem_forget(el_val_t node_id) {
|
||||
engram_forget(node_id);
|
||||
el_val_t _marker = mem_tombstone(node_id);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user