"""v3-framed: Frame-based deterministic pipeline. Same node topology as v2-director-drives but executed by FrameEngine with tick-based deterministic ordering. Frame trace: Reflex: F1(Input) → F2(Output) Simple: F1(Input) → F2(Director) → F3(Thinker) → F4(Output+UI) With tools: F1(Input) → F2(Director) → F3(Thinker) → F4(Interpreter) → F5(Output+UI) """ NAME = "v3-framed" DESCRIPTION = "Frame-based deterministic pipeline (Director+Thinker+Interpreter)" ENGINE = "frames" # Signals Runtime to use FrameEngine instead of handle_message() NODES = { "input": "input_v1", "director": "director_v2", "thinker": "thinker_v2", "interpreter": "interpreter_v1", "output": "output_v1", "ui": "ui", "memorizer": "memorizer_v1", "sensor": "sensor", } EDGES = [ # Data edges — same as v2, engine reads for frame routing {"from": "input", "to": "director", "type": "data", "carries": "Command"}, {"from": "input", "to": "output", "type": "data", "carries": "Command", "condition": "reflex"}, {"from": "director", "to": "thinker", "type": "data", "carries": "DirectorPlan"}, {"from": "thinker", "to": ["output", "ui"], "type": "data", "carries": "ThoughtResult", "parallel": True}, {"from": "thinker", "to": "interpreter", "type": "data", "carries": "tool_output", "condition": "has_tool_output"}, {"from": "interpreter", "to": "output", "type": "data", "carries": "InterpretedResult", "condition": "has_tool_output"}, {"from": "output", "to": "memorizer", "type": "data", "carries": "history"}, # Context edges {"from": "memorizer", "to": "director", "type": "context", "method": "get_context_block"}, {"from": "memorizer", "to": "input", "type": "context", "method": "get_context_block"}, {"from": "memorizer", "to": "output", "type": "context", "method": "get_context_block"}, {"from": "director", "to": "output", "type": "context", "method": "get_context_line"}, {"from": "sensor", "to": "director", "type": "context", "method": "get_context_lines"}, {"from": "ui", "to": "director", "type": "context", "method": "get_machine_summary"}, # State edges {"from": "sensor", "to": "runtime", "type": "state", "reads": "flags"}, {"from": "ui", "to": "runtime", "type": "state", "reads": "current_controls"}, ] CONDITIONS = { "reflex": "intent==social AND complexity==trivial", "has_tool_output": "thinker.tool_used is not empty", } AUDIT = {}