fix(safety): crisis detection — 4 targeted fixes
Neuron Soul CI / build (pull_request) Failing after 14m43s

- soul.el: fix state key bug in layered_cycle (conversation_history -> conv_history)
- safety.el: add indirect crisis location patterns to soft_bell phrase list
- soul.el: wire safety_augment_system into layered_cycle for soft_bell turns
- chat.el: load cross-session affective context at session start when distress signals found within 72h
This commit is contained in:
2026-06-22 11:20:42 -05:00
parent ddd858d2ec
commit e9a8a659e0
3 changed files with 30 additions and 3 deletions
+10 -1
View File
@@ -258,7 +258,7 @@ fn emit_session_start_event() -> Void {
// L0 (core) L1 (safety screen) L2a (continuity + behavioral profiling) L2b (mission alignment) L3 (imprint) L1 (safety validate)
// Internal cognition (heartbeat, proactive, memory ops) bypasses layers use one_cycle directly.
fn layered_cycle(raw_input: String) -> String {
let history: String = state_get("conversation_history")
let history: String = state_get("conv_history")
let session_id: String = state_get("current_session_id")
// L1 in: safety screen
@@ -312,6 +312,15 @@ fn layered_cycle(raw_input: String) -> String {
json_get(steward_result, "redirect_to")
}
// L1 safety augment: if a soft bell fired, inject the safety directive into state
// so imprint_respond (and build_system_prompt) can incorporate it before the LLM call.
// Hard bell is handled above (early exit). Here we act on soft_bell only.
if str_eq(screen_action, "soft_bell") {
let base_system: String = state_get("soul_identity")
let augmented: String = safety_augment_system(base_system, raw_input)
state_set("soul_safety_system_augment", augmented)
}
// L3: imprint responds
let output: String = imprint_respond(aligned, imprint_id)