aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_trace_rpc.py (follow)
Commit message (Collapse)AuthorAge
* Spawn TUI panes in slosh, the multiplexer we actually useblasty2026-09-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `pane spawn` knew tmux and zellij, so under slosh every entry point answered "error: not inside tmux or zellij" — the agent skill described a workflow that could not run. slosh is now the first thing autodetected ($SLOSH, then $ZELLIJ, then $TMUX), and a slosh pane id is a bare integer, so a registry row written before this commit still routes its own stop/capture/keys. Everything goes through the control socket, always the JSON form ($SLOSH_BIN -s $SLOSH_SESSION cmd): the bare-verb alias answers unwrapped, and a parser written for one shape silently finds nothing in the other. $SLOSH_BIN rather than `slosh` because a session may have been started from a build tree that is not on $PATH. Spawning is the one place slosh differs in kind. Its `split` verb only ever makes a shell pane, and typing a command into somebody's shell is the thing not to do — a pane that was *given* a command is the one with alive/exit_code to poll and `rerun` to repeat. So spawn applies a one-tab layout whose pane carries command= and a declared purpose=idatui:<hex>, finds it by that purpose (declared purposes are locked, so the TUI cannot relabel itself out from under us, and titles change anyway), then move-panes it into the tab we were called from: it lands beside the caller with its pty and scrollback intact, and the layout's now-empty tab removes itself. --detached restores focus afterwards, since slosh focuses what it creates and moves. The rest follows the zellij precedent. A dead command pane stays on screen as a husk, which _pane_alive must read as dead or a launcher that died on startup would burn the whole 300s readiness timeout instead of reporting "pane exited during startup". `capture` cuts the pane's content_* rect out of `snapshot` (which is the whole composited session) and hops tabs if the pane is parked in another one, because only the active tab is composed at all. `keys` keeps taking tmux-flavoured names and turns them into the bytes a terminal sends: it focuses the target, writes with `raw`, and restores focus — `send` would be decoded as session input first, where C-a is slosh's own leader and never reaches the TUI. --size stays tmux-only and now says so for whichever mux is in play. The two RPC integration tests gated on $TMUX/$ZELLIJ, so they skipped silently under slosh; they accept $SLOSH now. Verified against the live session, not just in unit checks: a probe pane spawns, reports alive, captures its own output, receives real keystrokes and dies on close; `pane spawn --open targets/echo` reaches ready:true with 128 functions, `drive where` answers, `pane keys Tab` flips listing to pseudocode on screen, and `pane stop` leaves an empty registry and no husk. Env inheritance is unchanged from zellij (a pane gets the session server's environment, not the caller's) — the probe printed PROBE_VAR=[].
* reformat: ruff format + import sort, mechanically (see ruff.toml)blasty2026-08-21
| | | | No behavior. Listed in .git-blame-ignore-revs (next commit).
* tests: one front doorblasty2026-08-06
| | | | | | | | | | | | | | | | Fourteen test files, each its own __main__, and no way to run them but from memory -- so in practice you ran the one you were working on and hoped. Worse, nothing said which files need a licensed IDA and a real worker (minutes) and which are pure stdlib (milliseconds), so the cheap ones nobody ran either. tests/run.py runs the lot and prints one table. --fast selects only the suites that need nothing, which is 257 checks in half a second under any python3 -- that's the one you run between edits. The classification lives in the test files, not in a table here that would rot the first time someone adds a test: each declares NEEDS_IDA at module scope and run.py reads it with ast (it can't import them -- they run their suite at import). A file without the marker is a hard error rather than a silent guess.
* pane: drive panes under zellij as well as tmuxblasty2026-08-06
| | | | | | | | | The multiplexer is auto-detected ($ZELLIJ then $TMUX) and every pane command works the same under both. Pane ids are self-identifying, so a mixed set of tmux and zellij panes can be tracked at once. zellij has no -l, so --size is ignored there, it always focuses a new pane (--detached is emulated), and it leaves an EXITED husk behind that stop/reap now clear. The pane tests skip on neither multiplexer rather than on no TMUX.
* tests: trace integration over the RPC socket (45 checks)blasty2026-08-01
The existing trace suites (test_trace.py, test_trace_ui.py, test_trace_vs_tenet.py) cover the model layer, the UI via the Textual pilot, and differential correctness against Tenet's reference. None of them exercise the path an agent actually takes: the trace RPC verb driven over the unix socket through rpcclient. This one spawns a real tmux pane with --trace, records a trace with the QEMU tracer (falling back to /tmp/echotrace.0.log if the tracer isn't built), and drives every trace operation through the RPC socket, validating the JSON responses: seek (absolute, percentage, string, edge-clamping) step (forward, backward, multi-step, clamp at bounds) step over (finds a call via SP drop, verifies it lands after the return) goto (by name, by hex address, error on unexecuted) changed registers in the response cursor tracking (ea follows the trace pc) response shape (trace key is a superset of snapshot) interaction with non-trace verbs (pseudocode, state, view, goto) trace position independence from navigation All 45 checks pass against the echo binary with a 226-instruction trace.