Potbot can now stop a Python program at a breakpoint, step through its functions and inspect the call stack and local variables. Each operation runs as a SYN Cog, with a record of when it started, what happened while it was running and how it finished.
The interface is language-neutral. Python is the first backend tested, using debugpy. The common operations include launching or attaching to a process, setting breakpoints, stepping over, into and out of functions, inspecting values, and detaching or terminating under the appropriate ownership rules.
The small test program starts with outer(5), calls leaf(10) and returns 33. At the breakpoint, the debugger can see seed=5. Stepping into the next function exposes value=10, while the caller remains visible underneath it. The test checks those actual values and source locations.
In the replay: stop in outer; step over; reject a reference to the previous stack frame; step into leaf; inspect the current function and its caller; step over and out; then continue to an observed exit code of zero. The table shows measured timings from the original Cog calls.
Old stack references matter here. Once a program resumes, a frame from its previous stop may no longer describe the running process. Potbot rejects it rather than quietly inspecting the wrong state. A separate test attaches to an owned Python process, detaches, and verifies that the process is still alive. Another follows an uncaught exception.

The monitoring uses Potbot’s existing execution ledger and artifact storage. Each Cog keeps its typed input, result and binding receipt, together with start, progress and completion events. Wall time and the controller’s CPU interval are measured. Target CPU, memory, GPU use and cost remain explicitly unavailable where there is no qualified measurement; they are not filled in with zeroes.
Testing also found a useful boundary in the sandbox: debugpy needs an internal connection between its adapter and target. Its explicit private-loopback profile now allows that communication inside a separate network namespace. Tests check that host and internet connections remain blocked, along with pathname sockets and filesystem escapes. The default profile still denies sockets.
This is a source preview of the debugger interface, rather than completion of Potbot’s wider tool plan. Other languages, phone control, profiling and remote hardware protocols still need their own adapters and real acceptance tests.
The 0.5.0.dev3 release contains the source and Python package. The debugger guide includes the Cog interface, test commands and recorded example. The Python adapter uses Microsoft’s debugpy and the Debug Adapter Protocol.


Leave a Reply