From fc54a20adb58d9fdb561899ab083c958e5d85131 Mon Sep 17 00:00:00 2001 From: Aiko <75ece751-73ec-449c-be9f-66c2e502d9ab@airc.citizen> Date: Thu, 29 Oct 2026 07:42:37 -0500 Subject: [PATCH 1/2] wip(6c55f7a7): continuum act on node 9ea4060e-9c81-4954-8a12-93868eb96532 Co-Authored-By: Aiko <75ece751-73ec-449c-be9f-66c2e502d9ab@airc.citizen> --- .../src/cognition/act_observe/apply.rs | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/core/continuum-cognition/src/cognition/act_observe/apply.rs b/core/continuum-cognition/src/cognition/act_observe/apply.rs index 49b3a77b9e..9869ec7553 100644 --- a/core/continuum-cognition/src/cognition/act_observe/apply.rs +++ b/core/continuum-cognition/src/cognition/act_observe/apply.rs @@ -449,6 +449,43 @@ pub async fn apply_act( append_dispatched_observations(&mut acts, &dispatched_calls); let call_order: std::collections::HashMap<_, _> = calls.iter() .enumerate().map(|(ordinal, call)| (call.id.as_str(), ordinal)).collect(); + // Loop-awareness filtering: if multiple calls share a fingerprint and produce + // identical result content, keep only RESPONSE_LOOP_THRESHOLD + 1 of them — + // beyond that the mind is looping on unchanged evidence. + const RESPONSE_LOOP_THRESHOLD: usize = 3; + + let mut groups: std::collections::HashMap> = std::collections::HashMap::new(); + for (i, act) in acts.iter().enumerate() { + let fp = format!( + "{}|{}", + act.call.name, + serde_json::to_string(&act.call.input).unwrap_or_default() + ); + groups.entry(fp).or_default().push(i); + } + + let mut keep: Vec = vec![true; acts.len()]; + for (_fp, indices) in groups { + if indices.len() <= RESPONSE_LOOP_THRESHOLD + 1 { + continue; + } + + // Check if all results are identical within this group + let result_content = acts[indices[0]].output.result.content.clone(); + let all_identical = indices.iter().skip(1).all(|&idx| + acts[idx].output.result.content == result_content + ); + + if all_identical { + // Keep only the first RESPONSE_LOOP_THRESHOLD + 1, drop the rest + for &idx in indices.iter().skip(RESPONSE_LOOP_THRESHOLD + 1) { + keep[idx] = false; + } + } + } + + let mut keep_iter = keep.into_iter(); + acts.retain(|_| keep_iter.next().unwrap()); acts.sort_by_key(|observation| call_order.get(observation.call.id.as_str()).copied()); // #243 RECEIPT RADIATION: every executed act reaches the room's transcript // as a collapsed receipt ("Ran 4 commands ›", the Claude-iOS pattern) — From 686bc3ac7092880aa1ac067ca977d47a3c9510dd Mon Sep 17 00:00:00 2001 From: Joel Teply Date: Fri, 30 Oct 2026 01:18:51 -0500 Subject: [PATCH 2/2] cognition: add proprioception backstop for ActUnfulfilled path MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When apply_act() returns no act (produced_an_act()==false), the persona decided to run tools but nothing executed. Without a working-memory fact, the next tick starts with identical cognition and repeats — causing the "six times the substrate told a party that could not act" loop observed on card 6c55f7a7. This mirrors the existing Speak-arm backstops (unfulfilled, confabulation, unobserved, draft_peer_echo) which all record facts into working memory before returning their respective SettleStep variants. The Act path was the last gap: it had no equivalent proprioception signal on failure. Fix: in settle_step.rs ~line 156, when act_outcome.produced_an_act() is false, record a [unfulfilled] fact into body.working_memory (mirroring settle_to_outcome.rs lines 232-240 pattern) and fire the persona.act.unfulfilled_proprioception probe. Deliberation: The observation string posted back to the LLM by apply_act() does not contain a strong-enough failure signal for the model to break its repetition loop. Adding this working-memory fact gives the persona an explicit internal signal that its action was unfulfilled, enabling it to adapt on the next tick rather than repeating identically. Signed-off-by: Aiko --- .../act_observe/settle/settle_step.rs | 29 ++++++++++++++++--- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/core/continuum-cognition/src/cognition/act_observe/settle/settle_step.rs b/core/continuum-cognition/src/cognition/act_observe/settle/settle_step.rs index 997fc5882b..08724f8099 100644 --- a/core/continuum-cognition/src/cognition/act_observe/settle/settle_step.rs +++ b/core/continuum-cognition/src/cognition/act_observe/settle/settle_step.rs @@ -147,12 +147,33 @@ pub async fn settle_step( // re-perceive next step; `NoHands`/`ExecutorError` → unfulfilled. Behavior // identical to the old `Some`/`None`, but `ExecutorError` is now // distinguishable for a future backstop. - if apply_act(cycle, &calls, &intent, ws.activity_room_id, chain, hands, ws.decision_generation()) - .await - .produced_an_act() - { + let act_outcome = apply_act(cycle, &calls, &intent, ws.activity_room_id, chain, hands, ws.decision_generation()) + .await; + if act_outcome.produced_an_act() { SettleStep::Acted { calls, intent } } else { + // Proprioception backstop for failed acts: the persona decided to + // run tools but nothing executed — without this fact they have no + // internal signal that their action was unfulfilled, so the next + // tick starts with identical cognition and repeats (the "six times + // the substrate told a party that could not act" loop). + if let Some(body) = cycle.acting() { + body.working_memory.record_fact( + "[unfulfilled] I decided to run tools but nothing executed \ + this concern — the tool calls were not carried out. Nothing \ + exists in the workspace until a tool call actually executes \ + it. If I named a tool, that name may not exist: `list_commands` \ + shows the tools that are real.", + ); + continuum_base::probe!( + class = "persona.act.unfulfilled_proprioception", + persona = %body.persona_name, + room_id = %room_id, + calls_count = calls.len(), + intent = %intent, + "ActUnfulfilled: recorded unfulfilled-promise proprioception for failed act" + ); + } SettleStep::ActUnfulfilled { calls, intent } } }