reactive agent statecharts, blackboards & worker actors
Building multi-step workflows with reactive-agent mixed data values and workflow control flow inside shared signals (such as passing ##STOP## sentinel strings), causing cyclic effect() ping-pong loops between interviewer, human, and verification steps. Separating workflow control into an explicit statechart or tuple-space blackboard while projecting UI views through read-only signals eliminates illegal state transitions and runaway feedback cycles.
Hypothesis
Moving cyclic
Agent <-> Human <-> Verifiercontrol flow out ofeffect()signals into explicit finite statecharts or fixed-point blackboards inside Dedicated Workers eliminates runaway ping-pong loops while keeping UI projection reactive.
What confirms it: Under identical confidence/rejection triggers, cyclic effect() exceeds bounded step limits while pure transition(state, event, ctx) statecharts reject illegal events deterministically and Worker actors recover cleanly after simulated crashes.
What falsifies or bounds it: Multi-step verification rules grow too rigid in explicit FSM transitions compared to pure tuple-space predicates or unbounded event loops.
What this lab tests
Reactive Agent Machines (GitHub) runs cyclic effect() loops head-to-head against a pure FSM reducer (transition(state, event, ctx)) and a Rete/Linda tuple-space blackboard (runBlackboardToFixedPoint) executed inside a supervised Dedicated Web Worker pool (/worker-actor.js) over MessageChannel.
// Control flow sits in a pure reducer; UI reads derived state signals
const { nextState, valid, effects } = transition(machine.state, {
type: "CONFIDENCE_LOW",
claimId,
confidence: 0.42,
});
// Guards reject illegal events rather than firing ambiguous effect() cycles
Open questions
- When do tuple-space blackboards (
runBlackboardToFixedPoint) outperform explicit hierarchical statecharts for opportunistic tool synthesis? - What supervision protocol cleanly replays unacknowledged Worker mailbox messages across tab reloads using OPFS?
Iteration log
- — Built side-by-side runner pitting cyclic
effect()loops against deterministic FSM reducers and Worker-supervised blackboard predicates. - — Refined 700px embed flow, added CSP-safe syntax highlighting and live statechart confidence-guard recovery, and routed static assets through the Worker with
no-cacheheaders.
Primitives tested: Finite Statecharts, Tuple-Space Blackboard, Dedicated Web Workers, MessageChannel Supervision.
This is an active lab under /labs/ and stays off the main RSS feed until graduated into a full essay.