AI / Apache Burr Interview questions
How do you troubleshoot a Burr application that halts without reaching a specified halt condition?
Burr documents this scenario explicitly as undefined behavior: if the state machine reaches an action that has no outgoing transition matching the current state, it halts anyway and logs a warning, even though you never told it to stop there.
- Inspect the static graph. Call
application.graphto get a structural view of every action and its transitions, and check that every action which could be reached actually has an outgoing edge for every state it might see. - Check for a missing catch-all. Look for actions whose transitions only cover specific
when(...)/expr(...)conditions with no trailingdefault— add one so the machine always has somewhere to go. - Replay the last known step. Use the Burr UI or your tracker’s logs to see the last action that actually ran and the state at that point, which usually reveals exactly which condition failed to match.
- Add a debug hook. A simple
PreRunStepHook/PostRunStepHookpair that prints the action name and relevant state keys pinpoints precisely where execution stopped, without needing to modify your actions. - Route to a terminal Result action. If the dead-end is intentional (a genuine end state), make that explicit with a named terminal action rather than letting the machine fall off the edge of the graph.
More Related questions...