diff --git a/chat.el b/chat.el index 1b69862..4e6c2af 100644 --- a/chat.el +++ b/chat.el @@ -81,7 +81,15 @@ fn build_system_prompt(ctx: String) -> String { "\n\n[ENGRAM CONTEXT — compiled from your graph]\n" + ctx } - return identity + date_line + voice_rules + security_rules + identity_block + engram_block + let safety_addendum: String = state_get("layered_cycle_safety_system_addendum") + let safety_block: String = if str_eq(safety_addendum, "") { + "" + } else { + state_set("layered_cycle_safety_system_addendum", "") + safety_addendum + } + + return identity + date_line + voice_rules + security_rules + identity_block + engram_block + safety_block } fn hist_append(hist: String, role: String, content: String) -> String { @@ -184,7 +192,8 @@ fn handle_chat(body: String) -> String { let cutoff: Int = now_ts - 259200 let found_recent: Bool = if has_nodes { let dn0: String = json_array_get(distress_nodes, 0) - let ts0_str: String = json_get(dn0, "created_at") + let ts0_raw: String = json_get(dn0, "created_at") + let ts0_str: String = if str_eq(ts0_raw, "") { json_get(dn0, "updated_at") } else { ts0_raw } let ts0: Int = if str_eq(ts0_str, "") { 0 } else { str_to_int(ts0_str) } ts0 > cutoff } else { false } diff --git a/soul.el b/soul.el index 598324a..a77f736 100644 --- a/soul.el +++ b/soul.el @@ -312,15 +312,6 @@ 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)