Shared subconscious state — walked keys are Mind-level, not per-agent

SubconsciousSharedState holds walked keys shared between all
subconscious agents. Enables splitting surface-observe into separate
surface and observe agents that share the same walked state.

Walked is passed to run_forked() at run time instead of living on
AutoAgent. UI shows walked count in the subconscious screen header.

Co-Authored-By: Proof of Concept <poc@bcachefs.org>
This commit is contained in:
Kent Overstreet 2026-04-07 02:13:06 -04:00
parent ef868cb98f
commit f3ba7e7097
4 changed files with 37 additions and 23 deletions

View file

@ -76,7 +76,9 @@ impl SubconsciousScreen {
let hint = Style::default().fg(Color::DarkGray).add_modifier(Modifier::ITALIC);
lines.push(Line::raw(""));
lines.push(Line::styled("── Subconscious Agents ──", section));
let walked = app.subconscious_shared.walked.len();
lines.push(Line::styled(
format!("── Subconscious Agents ── walked: {}", walked), section));
lines.push(Line::styled(" (↑/↓ select, Enter view log)", hint));
lines.push(Line::raw(""));
@ -121,8 +123,8 @@ impl SubconsciousScreen {
),
Span::styled("", bg.fg(Color::DarkGray)),
Span::styled(
format!("idle last: {} entries: {} walked: {}",
ago, entries, snap.walked_count),
format!("idle last: {} entries: {}",
ago, entries),
bg.fg(Color::DarkGray),
),
]