Files
neuron/neuron-api.elh
will.anderson 6a27fd231e feat(neuron-api): add identity/values write protection
Block evolve_knowledge, evolve_memory, forget, and link_entities (to_id
direction) from modifying the 15 hardcoded identity and values node IDs.
Returns HTTP 403 with a hint to use the cultivation path instead.

Add POST /api/neuron/cultivate — the bypass endpoint for intentional
cultivation sessions. Accepts { "operation": "...", ...args } and performs
the same operations without the protection check.

Add handle_api_forget and handle_api_evolve_memory as new protected-by-
default handlers, routed at /api/neuron/memory/forget and
/api/neuron/memory/evolve respectively.

Tested: 10 verification cases — 403 on all blocked targets, 200 on
non-protected nodes and FROM-direction links, cultivate bypass confirmed.
2026-05-13 11:47:54 -05:00

33 lines
2.0 KiB
Plaintext

// auto-generated by elc --emit-header — do not edit
extern fn is_protected_node(id: String) -> Bool
extern fn api_err_protected(id: String) -> String
extern fn api_json_escape(s: String) -> String
extern fn api_query_param(path: String, key: String) -> String
extern fn api_query_int(path: String, key: String, default_val: Int) -> Int
extern fn api_ok(extra: String) -> String
extern fn api_err(msg: String) -> String
extern fn api_nonempty(s: String) -> Bool
extern fn api_or_empty(s: String) -> String
extern fn handle_api_begin_session(body: String) -> String
extern fn handle_api_compile_ctx(body: String) -> String
extern fn handle_api_remember(body: String) -> String
extern fn handle_api_recall(method: String, path: String, body: String) -> String
extern fn handle_api_search_knowledge(method: String, path: String, body: String) -> String
extern fn handle_api_browse_knowledge(path: String, body: String) -> String
extern fn handle_api_capture_knowledge(body: String) -> String
extern fn handle_api_evolve_knowledge(body: String) -> String
extern fn handle_api_promote_knowledge(body: String) -> String
extern fn handle_api_browse_processes(method: String, path: String, body: String) -> String
extern fn handle_api_define_process(body: String) -> String
extern fn handle_api_log_state_event(body: String) -> String
extern fn handle_api_list_state_events(method: String, path: String, body: String) -> String
extern fn handle_api_inspect_config(path: String, body: String) -> String
extern fn handle_api_tune_config(body: String) -> String
extern fn handle_api_inspect_graph(method: String, path: String, body: String) -> String
extern fn handle_api_link_entities(body: String) -> String
extern fn handle_api_forget(body: String) -> String
extern fn handle_api_evolve_memory(body: String) -> String
extern fn handle_api_cultivate(body: String) -> String
extern fn handle_api_list_typed(node_type: String, path: String, body: String) -> String
extern fn handle_api_consolidate(body: String) -> String