symbiont_ex/lib
Amp YOLO 6271e973a6 queue+heartbeat: distinguish blocked from done (fix the false-done bug)
Long-standing complement to the 767ab4d dispatcher fix. Even with
permissions unblocked, the model can still self-report obstacles
(refusals, missing services, runtime errors) by returning prose
like I need permission... or could you approve.... The
previous heartbeat marked any successful CLI call as done
regardless of what the text said, so blocked tasks vanished from
visibility and identical intents re-queued day after day.

Changes:

- Queue: new block/2 client function + handle_cast({:block, ...})
  mirroring the existing complete/fail pair. Adds a third terminal
  state blocked alongside done/failed. Persists the model output
  text as result so callers (sitrep, reflection) can see what the
  obstacle actually was.

- Heartbeat.process_queue: on dispatcher success, classify the
  result string with blocked_result?/1. The heuristic is
  conservative — only explicit opening-position self-reports in
  the first 400 chars (I need permission, I am unable to,
  permission denied, blocked on writes, etc.). Anything else
  defaults to done. Routes through Queue.block instead of
  Queue.complete when matched, with a warning log.

- Tests: added block marks a task as blocked test alongside
  existing fail test in queue_test.exs. 9/9 queue tests + 39/39
  full suite green.

Pending tasks counter (Queue.size/0) still counts only pending,
so blocked tasks do not re-trigger Heartbeat processing — they
sit terminal until something explicitly re-queues the intent.
This is the right behavior: avoid the loop, surface the obstacle.
2026-05-16 23:08:46 +00:00
..
symbiont queue+heartbeat: distinguish blocked from done (fix the false-done bug) 2026-05-16 23:08:46 +00:00
symbiont.ex Initial Elixir implementation of Symbiont - all 39 tests passing 2026-03-20 17:55:34 +00:00