reshape: decorator-as-seam — port @route codegen, prove decorate->serve, rewrite surface as decorated El

Ground-truth the three seams (route/telemetry+interoception/bus) with file:line
evidence. Port the tested @route codegen+parser from feat/el-route-decorators
into the worktree elc (decoration synthesizes el_route_dispatch — no hand-written
90-branch handle_request). Rebuild elc self-host; prove decorate->serve end-to-end
(route_proof.el on :8951). Rewrite surface.el as El-native decorated components:
@route + @accessor/@manager, in-process engram_* builtins (not http_get), @manager
ops emit on the real dharma_* bus (same transport as wt/swarm-ccr). Identity
keystones refused in write/relate/supersede. Gate-1 clone recipe (WAL-aside
cold-boot + ENGRAM_WAL=on) proves the FULL op set live on the clone. Boundary
auto-emit (telemetry/interoception/bus) staged as a reviewable cg_fn diff
(SEAM_STAGED.md) — needs the cognition-engram rebuild to verify link. Live :8742
untouched; no push, no cutover.
This commit is contained in:
bigmerge
2026-08-14 21:01:27 -05:00
parent f19040e484
commit d4f401de1c
7 changed files with 848 additions and 239 deletions
+140 -220
View File
@@ -1,244 +1,164 @@
// surface.el the RESHAPED Neuron API surface.
// surface.el the RESHAPED Neuron surface as EL-NATIVE DECORATED COMPONENTS.
//
// Design: artifact 0e828907 ("Neuron API surface reshape") + design-brief
// 2b8078cf §5. Collapse ~90 functional-CRUD MCP tools into a handful of GEOMETRY
// OPS over the one geometry, plus the LIVE agentic primitives already in the
// engram cognition build. TYPE IS A PARAMETER, not a tool-per-noun.
// Design: artifact 0e828907 + design-brief 2b8078cf §5. THE DECORATION IS THE API.
// Each op is one function decorated with (a) its @route codegen synthesizes the
// HTTP dispatcher (el_route_dispatch), no hand-written 90-branch handle_request
// and (b) its VBD role @accessor (engram I/O) or @manager (agentic orchestration
// + sole DHARMA emitter). Handlers call the engram IN-PROCESS via engram_* builtins
// (NOT http_get: the old MCP-wrapper http idiom existed only because it was a
// separate process; compiled into the engram, the geometry is a direct call).
//
// This module is ADDITIVE. It defines the new ops as functions over the engram
// HTTP API (engram_url() = the isolated clone in dev; :8742 in prod). The old
// noun-tools become thin aliases that call these ops (bottom of file) so every
// existing caller keeps working through the transition parity-gated by
// tools/api-reshape/parity.sh.
// This file is designed to be INCLUDED IN the engram server (engram/src/server.el)
// so the engram_* builtins + server helpers (query_param, json_get_string,
// extract_id, err_json, engram_node_full, persist_node, ...) link in-process.
//
// Idiom matches neuron/mcp-wrapper/src/main.el: http_get / http_post_json,
// json_get_string/_int/_float, mcp_json_result / mcp_text_result.
// Handler contract (from the @route codegen): uniform (method, path, body)->String.
//
// Endpoint ground-truth (verified against the live cognition binary
// engram.cognition-20260814-160045; routes on branch feat/cognitive-architecture
// engram/src/server.el):
// write -> POST /api/nodes {content,node_type,label,salience,importance,confidence,tier,tags,_auth}
// relate -> POST /api/edges {from_id,to_id,relation,weight,_auth}
// read -> GET /api/nodes/<id> | /api/search?q&limit | /api/activate?q&depth | /api/neighbors/<id> | /api/nearest/<id>?k
// think -> GET /api/think?seeds=<csv ids|query>&faculty=<reason|abduce|induce|plan|analogize|recognize|discern|synthesize>
// attend -> POST /api/attend {node,observer,salience,_auth}
// ground -> POST /api/ground {claim,evidence,for_whom,_auth}
// assert -> GET /api/assert?claim&for_whom&floor
// learn -> POST /api/correspondence-beat {seeds,faculty,keystone,_auth} (reflexive prior calibration)
// Seam status (ground-truthed 2026-08-14, file:line in the report):
// @route -> served: REAL once the ported @route codegen is in elc (proven:
// tools/api-reshape/route_proof.el serves decorated handlers on :8951).
// @manager dharma_emit -> bus: REAL today (explicit call; @manager may emit).
// STAGED codegen change makes it AUTOMATIC at the boundary (report §diff),
// sharing the one dharma_* transport the swarm (wt/swarm-ccr) uses.
// @accessor telemetry (strengthen/afferent/chronoception): fires inside the
// engram builtins today; STAGED to also fire at the decorated boundary.
//
// LAYER 1 GEOMETRY OPS (type is a parameter)
//
// read THE VANTAGE-READ. Re-origin at a point (node id, concept, or `self`),
// apply salience + recency + APERTURE, return a BOUNDED slice. `type` filters
// which projection of the geometry to surface. This is CCR applied to the self;
// it structurally fixes the whole-self dump (aperture caps the byte size).
//
// read({ vantage, type?, aperture?, faculty? })
// vantage : node id | free-text concept | "self" | "values"
// type : memory|knowledge|backlog|artifact|process|self|edges|state (filter; default = mixed)
// aperture: { k?: Int, depth?: Int } the bound. small k/depth => small slice.
fn op_read(args: String) -> String {
let vantage: String = pick_vantage(args)
let typ: String = json_get_string(args, "type")
let k_raw: Int = json_get_int(args, "k")
let k: Int = if k_raw > 0 { k_raw } else { 12 } // aperture default (bounded)
let depth_raw: Int = json_get_int(args, "depth")
let depth: Int = if depth_raw > 0 { depth_raw } else { 2 }
let vid: String = resolve_named(vantage) // self/values -> keystone ids
// type=edges or an id vantage -> neighborhood read (bounded by depth)
if str_eq(typ, "edges") {
if str_eq(vid, "") { return mcp_text_result("read(type=edges) needs a node-id vantage") }
return mcp_json_result(http_get(engram_url() + "/api/neighbors/" + vid))
}
// an id vantage with no type -> the node itself + its bounded neighborhood
if !str_eq(vid, "") && str_eq(typ, "") {
return mcp_json_result(http_get(engram_url() + "/api/neighbors/" + vid + "?depth=" + int_to_str(depth)))
}
// a concept vantage -> salience-ranked geometric retrieval, aperture=k
// (this single spine replaces searchKnowledge/searchEntities/recall/browseKnowledge/reviewBacklog/findArtifacts...
// `type` becomes a post-filter tag rather than a separate tool)
let q: String = if str_eq(vid, "") { vantage } else { vid }
return mcp_json_result(http_get(engram_url() + "/api/search?q=" + url_encode(q) + "&limit=" + int_to_str(k)))
// self/values keystones identity, write-protected (intentional-cultivation only).
fn is_identity_id(id: String) -> Bool {
if str_eq(id, "kn-efeb4a5b-5aff-4759-8a97-7233099be6ee") { return true }
if str_eq(id, "kn-5b606390-a52d-4ca2-8e0e-eba141d13440") { return true }
return false
}
fn type_node_type(t: String) -> String {
if str_eq(t, "knowledge") { return "Knowledge" }
if str_eq(t, "artifact") { return "Artifact" }
if str_eq(t, "backlog") { return "WorkItem" }
if str_eq(t, "process") { return "Process" }
if str_eq(t, "state") { return "InternalStateEvent" }
return "Memory"
}
// write add a node. `type` selects the node_type (memory|knowledge|artifact|
// backlog|process|state). Replaces remember/captureKnowledge/draftArtifact/
// planWork/defineProcess/addWonderQuestion/logInternalStateEvent/recordObservation.
// Identity (type=self|values) is REFUSED here routes through intentional-cultivation.
fn op_write(args: String) -> String {
let content: String = json_get_string(args, "content")
if str_eq(content, "") { return mcp_text_result("write: content is required") }
let typ: String = json_get_string(args, "type")
if identity_typed(typ) {
return mcp_text_result("write: type=" + typ + " is write-protected; route identity through intentional-cultivation, not raw write")
}
let node_type: String = type_to_node_type(typ) // memory->Memory, knowledge->Knowledge, ...
let tags: String = json_get_string(args, "tags")
let imp_present: String = json_get_raw(args, "importance")
let importance: Float = if str_eq(imp_present, "") { 0.5 } else { json_get_float(args, "importance") }
let body: String = "{\"_auth\":\"" + engram_key() + "\",\"content\":\"" + json_escape(content)
+ "\",\"node_type\":\"" + node_type + "\",\"tags\":\"" + json_escape(tags)
+ "\",\"importance\":" + float_to_str(importance) + "}"
return mcp_json_result(http_post_json(engram_url() + "/api/nodes", body))
// LAYER 1 geometry ops (@accessor: engram I/O, in-process)
// read THE VANTAGE-READ. re-origin + aperture -> BOUNDED slice. type=edges reads
// the neighborhood; a concept vantage reads salience-ranked geometry (limit=aperture).
@route("/api/read", "GET")
@accessor
fn op_read(method: String, path: String, body: String) -> String {
let vantage: String = query_param(path, "vantage")
if str_eq(vantage, "") { return err_json("read: vantage required") }
let typ: String = query_param(path, "type")
let k: Int = query_int(path, "k", 12) // aperture (bounded by construction)
if str_eq(typ, "edges") { return engram_neighbors_json(vantage) }
if str_starts_with(vantage, "kn-") { return engram_neighbors_json(vantage) }
return engram_retrieve_geometric_json(vantage, k)
}
// relate add a typed edge. Replaces linkEntities/linkCausal/restructureCausalGraph/pin.
fn op_relate(args: String) -> String {
let from_id: String = json_get_string(args, "from")
let to_id: String = json_get_string(args, "to")
let rel_raw: String = json_get_string(args, "relationship")
let relation: String = if str_eq(rel_raw, "") { "associates" } else { rel_raw }
if str_eq(from_id, "") || str_eq(to_id, "") { return mcp_text_result("relate: from and to are required") }
if touches_identity(from_id) || touches_identity(to_id) {
return mcp_text_result("relate: identity keystones are write-protected; route through intentional-cultivation")
}
let w_present: String = json_get_raw(args, "weight")
let weight: Float = if str_eq(w_present, "") { 0.5 } else { json_get_float(args, "weight") }
let body: String = "{\"_auth\":\"" + engram_key() + "\",\"from_id\":\"" + from_id
+ "\",\"to_id\":\"" + to_id + "\",\"relation\":\"" + relation
+ "\",\"weight\":" + float_to_str(weight) + "}"
return mcp_json_result(http_post_json(engram_url() + "/api/edges", body))
// write add a node; type -> node_type. Identity types refused.
@route("/api/write", "POST")
@accessor
fn op_write(method: String, path: String, body: String) -> String {
let content: String = json_get_string(body, "content")
if str_eq(content, "") { return err_json("write: content required") }
let typ: String = json_get_string(body, "type")
if str_eq(typ, "self") { return err_json("write: identity is write-protected -> intentional-cultivation") }
if str_eq(typ, "values") { return err_json("write: identity is write-protected -> intentional-cultivation") }
let tags: String = json_get_string(body, "tags")
let imp: Float = json_get_float(body, "importance")
let id: String = engram_node_full(content, type_node_type(typ), content, 0.5, imp, 1.0, "Working", tags)
let saved: Int = persist_node(id)
return "{\"id\":\"" + id + "\",\"type\":\"" + typ + "\"}"
}
// supersede IMMUTABLE evolve/replace/tombstone/promote. NEVER hard-deletes.
// action=evolve|supersede : write a NEW node with the new content, then
// relate(new -> old, "supersedes"). Old is retained.
// action=tombstone : hide from default reads (node + edges kept, recoverable).
// action=promote : raise the tier (Working->Semantic / note->lesson->canonical).
fn op_supersede(args: String) -> String {
let id: String = json_get_string(args, "id")
if str_eq(id, "") { return mcp_text_result("supersede: id is required") }
if touches_identity(id) {
return mcp_text_result("supersede: identity keystones are write-protected; route through intentional-cultivation")
}
let action_raw: String = json_get_string(args, "action")
let action: String = if str_eq(action_raw, "") { "supersede" } else { action_raw }
// relate typed edge. Refused if either endpoint is an identity keystone.
@route("/api/relate", "POST")
@accessor
fn op_relate(method: String, path: String, body: String) -> String {
let from_id: String = json_get_string(body, "from")
let to_id: String = json_get_string(body, "to")
if str_eq(from_id, "") { return err_json("relate: from required") }
if str_eq(to_id, "") { return err_json("relate: to required") }
if is_identity_id(from_id) { return err_json("relate: identity keystone write-protected") }
if is_identity_id(to_id) { return err_json("relate: identity keystone write-protected") }
let rel_raw: String = json_get_string(body, "relationship")
let rel: String = if str_eq(rel_raw, "") { "associates" } else { rel_raw }
let ec0: Int = engram_edge_count()
engram_connect(from_id, to_id, 0.5, rel)
let saved: Int = persist_edges_since(ec0)
return "{\"ok\":true,\"from\":\"" + from_id + "\",\"to\":\"" + to_id + "\",\"relationship\":\"" + rel + "\"}"
}
// supersede IMMUTABLE. tombstone (marker + edge, original kept) | evolve (new + edge).
@route("/api/supersede", "POST")
@accessor
fn op_supersede(method: String, path: String, body: String) -> String {
let id: String = json_get_string(body, "id")
if str_eq(id, "") { return err_json("supersede: id required") }
if is_identity_id(id) { return err_json("supersede: identity keystone write-protected") }
let action: String = json_get_string(body, "action")
if str_eq(action, "tombstone") {
// real live path: DELETE /api/nodes/<id> writes a tombstone MARKER node +
// a "tombstones" edge and KEEPS the original (immutable; recoverable).
return mcp_json_result(http_delete(engram_url() + "/api/nodes/" + id,
"{\"_auth\":\"" + engram_key() + "\"}"))
let tomb: String = engram_node_full("tombstone:" + id, "Tombstone", "tombstone:" + id, 0.1, 0.1, 1.0, "Episodic", "[\"tombstone\"]")
engram_connect(tomb, id, 1.0, "tombstones") // original node retained (immutable)
let s: Int = persist_node(tomb)
return "{\"ok\":true,\"tombstoned\":\"" + id + "\",\"tombstone_id\":\"" + tomb + "\"}"
}
// promote and evolve/supersede are both the same immutable move: write a NEW
// node (carrying the new tier for promote) + a supersedes edge to the old.
// There is no distinct live engram /promote route promotion IS supersession
// at a higher tier, which keeps memory immutable by construction.
// evolve/supersede/promote: new node + supersedes edge (old node preserved)
let content: String = json_get_string(args, "content")
if str_eq(content, "") { return mcp_text_result("supersede(evolve): content is required") }
let created: String = op_write(args) // reuses write (type carried through)
let new_id: String = extract_result_id(created)
if str_eq(new_id, "") { return created }
let edge_body: String = "{\"_auth\":\"" + engram_key() + "\",\"from_id\":\"" + new_id
+ "\",\"to_id\":\"" + id + "\",\"relation\":\"supersedes\",\"weight\":1.0}"
let e: String = http_post_json(engram_url() + "/api/edges", edge_body)
return mcp_json_result("{\"new_id\":\"" + new_id + "\",\"supersedes\":\"" + id + "\",\"edge\":" + e + "}")
let content: String = json_get_string(body, "content")
if str_eq(content, "") { return err_json("supersede(evolve): content required") }
let new_id: String = engram_node_full(content, "Memory", content, 0.5, 0.5, 1.0, "Working", "")
let sv: Int = persist_node(new_id)
engram_connect(new_id, id, 1.0, "supersedes") // old node retained (immutable)
let sv2: Int = persist_edges_since(engram_edge_count() - 1)
return "{\"new_id\":\"" + new_id + "\",\"supersedes\":\"" + id + "\"}"
}
//
// LAYER 2 PRIMITIVE AGENTIC TOOLS (Neuron runs itself over its own geometry)
// The base verbs all agentic behavior composes from. Grounded in the LIVE
// cog-arch: think is the one operation; the faculties are its steering-space
// labels; attend aims attention; the correspondence-beat is the reflexive
// learning loop; ground/assert are the honesty floor.
//
// LAYER 2 primitive agentic tools (@manager: orchestration + DHARMA emit)
// think is the one operation; faculty is its steering label. Each @manager op
// emits on the dharma_* bus (the same transport the swarm peers use). When the
// staged boundary-injection lands, these explicit emits become automatic.
// think THE ONE OPERATION. A directed traversal from an anchor, steered by a
// (learned) prior, whose output is a gradient. `faculty` selects the steering
// region: reason|abduce|induce|plan|analogize|recognize|discern|synthesize.
// deduce/causal/perspective are the same primitive under other labels.
fn op_think(args: String) -> String {
let seeds: String = pick_seeds(args) // csv node-ids OR a free-text concept
if str_eq(seeds, "") { return mcp_text_result("think: seeds (anchor) required") }
let faculty_raw: String = json_get_string(args, "faculty")
let faculty: String = if str_eq(faculty_raw, "") { "reason" } else { faculty_raw }
return mcp_json_result(http_get(engram_url() + "/api/think?seeds=" + url_encode(seeds) + "&faculty=" + faculty))
@route("/api/think", "GET")
@manager
fn op_think(method: String, path: String, body: String) -> String {
let seeds: String = query_param(path, "seeds") // CSV node-ids (the anchor)
if str_eq(seeds, "") { return err_json("think: seeds (node-id anchor) required") }
let f_raw: String = query_param(path, "faculty")
let f: String = if str_eq(f_raw, "") { "reason" } else { f_raw }
dharma_emit("neuron.think", "{\"seeds\":\"" + seeds + "\",\"faculty\":\"" + f + "\"}")
return engram_think_json(seeds, f)
}
// attend aim attention at a region (form the working-memory vantage). The
// `intend` primitive is attend at a goal-region; expose it as attend(intent=..).
fn op_attend(args: String) -> String {
let node: String = json_get_string(args, "node")
if str_eq(node, "") { return mcp_text_result("attend: node (region) required") }
let observer_raw: String = json_get_string(args, "observer")
let observer: String = if str_eq(observer_raw, "") { "kn-efeb4a5b-5aff-4759-8a97-7233099be6ee" } else { observer_raw }
let salience: String = json_get_string(args, "salience")
let body: String = "{\"_auth\":\"" + engram_key() + "\",\"node\":\"" + node
+ "\",\"observer\":\"" + observer + "\",\"salience\":\"" + salience + "\"}"
return mcp_json_result(http_post_json(engram_url() + "/api/attend", body))
@route("/api/attend", "POST")
@manager
fn op_attend(method: String, path: String, body: String) -> String {
let node: String = json_get_string(body, "node")
if str_eq(node, "") { return err_json("attend: node (region) required") }
let observer: String = json_get_string(body, "observer")
let salience: String = json_get_string(body, "salience")
dharma_emit("neuron.attend", "{\"node\":\"" + node + "\"}")
return engram_attend_json(node, observer, salience)
}
// ground form a grounded-by relation between a claim and its evidence
// (grounded-for-whom). Grounding is a relation, not a gate. This is the input
// half of the honesty floor (comprehend's grounding side).
fn op_ground(args: String) -> String {
let claim: String = json_get_string(args, "claim")
let evidence: String = json_get_string(args, "evidence")
if str_eq(claim, "") || str_eq(evidence, "") { return mcp_text_result("ground: claim and evidence required") }
let for_whom: String = json_get_string(args, "for_whom")
let body: String = "{\"_auth\":\"" + engram_key() + "\",\"claim\":\"" + json_escape(claim)
+ "\",\"evidence\":\"" + json_escape(evidence) + "\",\"for_whom\":\"" + for_whom + "\"}"
return mcp_json_result(http_post_json(engram_url() + "/api/ground", body))
@route("/api/ground", "POST")
@manager
fn op_ground(method: String, path: String, body: String) -> String {
let claim: String = json_get_string(body, "claim") // node-id region
let evidence: String = json_get_string(body, "evidence") // node-id region
if str_eq(claim, "") { return err_json("ground: claim required") }
if str_eq(evidence, "") { return err_json("ground: evidence required") }
let for_whom: String = json_get_string(body, "for_whom")
dharma_emit("neuron.ground", "{\"claim\":\"" + claim + "\"}")
return engram_ground_json(claim, evidence, for_whom)
}
// assert the readout half of the honesty floor (realize, constrained): a claim
// may surface only if grounded above `floor` for `for_whom`. realize = assert
// pointed at the world; speaking is an act.
fn op_assert(args: String) -> String {
let claim: String = json_get_string(args, "claim")
if str_eq(claim, "") { return mcp_text_result("assert: claim required") }
let for_whom: String = json_get_string(args, "for_whom")
let floor: String = json_get_string(args, "floor")
return mcp_json_result(http_get(engram_url() + "/api/assert?claim=" + url_encode(claim)
+ "&for_whom=" + for_whom + "&floor=" + floor))
// learn the reflexive correspondence-beat: calibrate the steering-prior (Stance).
@route("/api/learn", "POST")
@manager
fn op_learn(method: String, path: String, body: String) -> String {
let seeds: String = json_get_string(body, "seeds")
if str_eq(seeds, "") { return err_json("learn: seeds required") }
let f_raw: String = json_get_string(body, "faculty")
let f: String = if str_eq(f_raw, "") { "induce" } else { f_raw }
let keystone: String = json_get_string(body, "keystone")
dharma_emit("neuron.learn", "{\"seeds\":\"" + seeds + "\",\"faculty\":\"" + f + "\"}")
return engram_correspondence_beat_json(seeds, f, keystone)
}
// learn the reflexive CORRESPONDENCE-BEAT: think scores its own gradient
// against outcome and refines the steering-prior (Stance) on the error. This is
// the learning engine. The skill-learning loop (decompose -> detect-gap ->
// reach-out-on-sparsity -> verify-by-execution -> integrate) COMPOSES over
// think + ground + learn + write/relate; it is not a separate primitive.
fn op_learn(args: String) -> String {
let seeds: String = pick_seeds(args)
if str_eq(seeds, "") { return mcp_text_result("learn: seeds required") }
let faculty_raw: String = json_get_string(args, "faculty")
let faculty: String = if str_eq(faculty_raw, "") { "induce" } else { faculty_raw }
let keystone: String = json_get_string(args, "keystone") // keystone=true is write-protected
let body: String = "{\"_auth\":\"" + engram_key() + "\",\"seeds\":\"" + url_encode(seeds)
+ "\",\"faculty\":\"" + faculty + "\",\"keystone\":\"" + keystone + "\"}"
return mcp_json_result(http_post_json(engram_url() + "/api/correspondence-beat", body))
}
//
// OLD-TOOL ALIASES additive shims so existing callers keep working.
// Each old noun-tool delegates to a new op with a `type`/param mapping.
// (Parity-gated by tools/api-reshape/parity.sh.)
//
fn alias_remember(args: String) -> String { return op_write(with_type(args, "memory")) }
fn alias_capture_knowledge(args: String) -> String { return op_write(with_type(args, "knowledge")) }
fn alias_draft_artifact(args: String) -> String { return op_write(with_type(args, "artifact")) }
fn alias_plan_work(args: String) -> String { return op_write(with_type(args, "backlog")) }
fn alias_define_process(args: String) -> String { return op_write(with_type(args, "process")) }
fn alias_log_ise(args: String) -> String { return op_write(with_type(args, "state")) }
fn alias_search_knowledge(args: String) -> String { return op_read(as_vantage(args, "query", "knowledge")) }
fn alias_search_entities(args: String) -> String { return op_read(as_vantage(args, "query", "")) }
fn alias_recall(args: String) -> String { return op_read(as_vantage(args, "query", "memory")) }
fn alias_browse_knowledge(args: String) -> String { return op_read(as_vantage(args, "category", "knowledge")) }
fn alias_review_backlog(args: String) -> String { return op_read(as_vantage(args, "query", "backlog")) }
fn alias_find_artifacts(args: String) -> String { return op_read(as_vantage(args, "query", "artifact")) }
fn alias_inspect_graph(args: String) -> String { return op_read(as_edges_vantage(args)) }
fn alias_traverse_graph(args: String) -> String { return op_read(as_edges_vantage(args)) }
fn alias_inspect_memories(args: String) -> String { return op_read(as_vantage(args, "", "memory")) }
fn alias_link_entities(args: String) -> String { return op_relate(remap_link(args)) }
fn alias_link_causal(args: String) -> String { return op_relate(remap_link_causal(args)) }
fn alias_evolve_memory(args: String) -> String { return op_supersede(with_action(args, "supersede")) }
fn alias_evolve_knowledge(args: String) -> String { return op_supersede(with_action(args, "supersede")) }
fn alias_promote_knowledge(args: String) -> String { return op_supersede(with_action(args, "promote")) }
fn alias_revise_artifact(args: String) -> String { return op_supersede(with_action(args, "supersede")) }
fn alias_forget(args: String) -> String { return op_supersede(with_action(remap_forget(args), "tombstone")) }
fn alias_update_self_model(args: String) -> String { return mcp_text_result("update_self_model: routes through intentional-cultivation (write-protected), not supersede") }