// ───────────────────────────────────────────────────────────────────────── // server.route.patch.el — GATED route for task #50, for engram/src/server.el. // NOT APPLIED. Exposes the engram_ground_propagate native over HTTP so the // soul's consolidation beat can fire one grounded edge-propagation pass. // ───────────────────────────────────────────────────────────────────────── // [1] New handler — add beside route_strengthen (server.el ~line 194). // Mutation (appends grounding events, updates confidence), so it is gated // on _auth via check_auth_ok, exactly like /api/edges. Persists once after // the beat — the whole point of running propagation as one batched beat // rather than per-node is to pay the snapshot cost a single time. fn route_ground_propagate(method: String, path: String, body: String) -> String { if !check_auth_ok(method, body) { return err_json("unauthorized") } let tel: String = engram_ground_propagate() // native — one beat over the store let saved: Int = persist_canonical() return tel // gep_* telemetry JSON straight through } // [2] Dispatch — register in handle_request (server.el ~line 461, next to the // /api/strengthen arm): // // if str_eq(method, "POST") && (str_eq(clean, "/api/ground/propagate")) { // return route_ground_propagate(method, clean, body) // } // // [3] Native declaration — engram_ground_propagate must be declared as an // extern runtime builtin (el_runtime.h) and seed-wrapped (el_seed.c / // el_seed.h __engram_ground_propagate) so the EL side can call it, same as // engram_strengthen / engram_hebb_drain_json.