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.
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
// 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
|
||||
@@ -23,5 +25,8 @@ 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
|
||||
|
||||
Reference in New Issue
Block a user