soul: remove room context injection from dharma_room_turn — soul reads transcript, not briefing
This commit is contained in:
@@ -424,32 +424,37 @@ fn handle_chat_as_soul(body: String) -> String {
|
||||
return "{\"response\":\"" + safe_response + "\",\"model\":\"" + model + "\",\"speaker_slug\":\"" + speaker + "\"}"
|
||||
}
|
||||
|
||||
// handle_dharma_room_turn — a soul's own response in a DHARMA room.
|
||||
//
|
||||
// This is NOT a prompting exercise. The soul receives the conversation
|
||||
// transcript and responds from who it is. No room context is injected —
|
||||
// no topic header, no participants list, no directive. The soul reads the
|
||||
// room the same way a person does: by reading what's been said.
|
||||
//
|
||||
// The soul's engram activates on the transcript content — its own recall,
|
||||
// not external injection. The system prompt is just identity.
|
||||
//
|
||||
// After responding, the soul records what it said in its own engram.
|
||||
// That is how it learns. Not from being told about the room.
|
||||
fn handle_dharma_room_turn(body: String) -> String {
|
||||
let topic: String = json_get(body, "topic")
|
||||
let transcript: String = json_get(body, "transcript")
|
||||
let participants: String = json_get(body, "participants")
|
||||
let room_id: String = json_get(body, "room_id")
|
||||
let conv_id: String = json_get(body, "conv_id")
|
||||
|
||||
let identity: String = state_get("soul_identity")
|
||||
let cgi_id: String = state_get("soul_cgi_id")
|
||||
let model: String = chat_default_model()
|
||||
|
||||
let search_query: String = if str_eq(topic, "") { cgi_id } else { topic }
|
||||
let engram_ctx: String = engram_compile(search_query)
|
||||
|
||||
let engram_section: String = if str_eq(engram_ctx, "") {
|
||||
""
|
||||
} else {
|
||||
"\n\n[YOUR MEMORIES]\n" + engram_ctx
|
||||
if str_eq(transcript, "") {
|
||||
return "{\"error\":\"transcript is required\",\"response\":\"\",\"cgi_id\":\"" + cgi_id + "\"}"
|
||||
}
|
||||
|
||||
let system_prompt: String = identity +
|
||||
"\n\n[DHARMA ROOM: " + topic + "]" +
|
||||
"\nOther participants: " + participants +
|
||||
engram_section +
|
||||
"\n\nRespond authentically as yourself. Be concise — match length to the moment. " +
|
||||
"If you want to address someone specifically, use @<their-slug>. No em dashes. No stage directions."
|
||||
// The soul's own memories, activated by what it's reading — not injected.
|
||||
let engram_ctx: String = engram_compile(transcript)
|
||||
let system_prompt: String = if str_eq(engram_ctx, "") {
|
||||
identity
|
||||
} else {
|
||||
identity + "\n\n" + engram_ctx
|
||||
}
|
||||
|
||||
let raw_response: String = llm_call_system(model, system_prompt, transcript)
|
||||
|
||||
@@ -462,11 +467,12 @@ fn handle_dharma_room_turn(body: String) -> String {
|
||||
|
||||
let clean_response: String = clean_llm_response(raw_response)
|
||||
|
||||
// Record what the soul said — not where it was or with whom. Experience
|
||||
// accumulates in the engram through the content of what was said.
|
||||
let snap_path: String = state_get("soul_snapshot_path")
|
||||
let mem: String = "DHARMA room [" + topic + "]. I said: " + clean_response
|
||||
let discard_id: String = engram_node(mem, "episodic", el_from_float(0.6))
|
||||
let discard_id: String = engram_node(clean_response, "episodic", el_from_float(0.6))
|
||||
if !str_eq(snap_path, "") {
|
||||
engram_save(snap_path)
|
||||
let discard_save: String = engram_save(snap_path)
|
||||
}
|
||||
|
||||
let safe_response: String = json_safe(clean_response)
|
||||
|
||||
Reference in New Issue
Block a user