wire thalamus idle state into consciousness binary

The consciousness binary now has its own idle state machine,
fed directly by TUI events:
- Key press → user_activity()
- Turn complete → response_activity()
- Render tick → decay_ewma(), snapshot to TUI

F5 thalamus screen shows presence/activity from the in-process
state instead of shelling out to poc-daemon status. No tmux
pane scraping, no socket RPC — the binary IS the presence.

Co-Developed-By: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
ProofOfConcept 2026-04-03 19:30:26 -04:00
parent e49b235957
commit e7be2a3ba0
3 changed files with 66 additions and 28 deletions

View file

@ -810,6 +810,10 @@ async fn run(cli: cli::CliArgs) -> Result<()> {
channel_supervisor.load_config();
channel_supervisor.ensure_running();
// Initialize idle state machine
let mut idle_state = poc_memory::thalamus::idle::State::new();
idle_state.load();
// Create UI channel
let (ui_tx, mut ui_rx) = ui_channel::channel();
@ -935,6 +939,7 @@ async fn run(cli: cli::CliArgs) -> Result<()> {
continue;
}
app.handle_key(key);
idle_state.user_activity();
dirty = true;
}
Some(Ok(Event::Mouse(mouse))) => {
@ -961,16 +966,20 @@ async fn run(cli: cli::CliArgs) -> Result<()> {
// Turn completed in background task
Some((result, target)) = turn_rx.recv() => {
session.handle_turn_result(result, target).await;
idle_state.response_activity();
dirty = true;
}
// Render tick
// Render tick — update periodic state
_ = render_interval.tick() => {
let new_count = session.process_tracker.list().await.len() as u32;
if new_count != app.running_processes {
app.running_processes = new_count;
dirty = true;
}
// Update idle state for F5 screen
idle_state.decay_ewma();
app.update_idle(&idle_state);
}
// DMN timer (only when no turn is running)