* fix(rizin): terminate the owned debugger when cleanup cannot resynchronize
A Rizin debug command whose deadline expires while the target keeps running
leaves the debugger blocked with unread cleanup commands. Cleanup could not
observe its resynchronization marker, detach was never verified, and the
retained process outlived the MCP server with its target (issue #8779).
Detach results now carry an explicit `unavailable` declaration. Rizin returns
it when a bounded resynchronization probe (500 ms, inside the shared 1000 ms
detach budget) observes no marker. `stopOwnedDebuggerProcess` then terminates
the directly owned process and reports `stopped_inferior_unknown`, leaving the
inferior's disposition unknown instead of inferring it from a PID or path.
An observed marker followed by a refused detach still retains the cleanup
owner for retry, and a session whose output streams have not settled remains
retained. Rizin never signals the inferior, so its target may continue
running; timeout, cancellation and protocol-failure evidence name the
unverified detach and the unknown target state, as do the close contract,
the Rizin guide, and the runtime-observation skill.
Validation (rebased onto upstream/main at cdc4541ef):
- npm run test:focused -- 21 Rizin/GDB boundary and MCP files: 463 passed,
1 skipped (real Rizin 0.7.4 lane; the host runs 0.9.1).
- npm run test:coverage:reverse-tools: passed.
- npm run check:fast, format:check, metadata:check, docs:check,
verify:architecture-guards, knip:production and lint:typed: passed.
The repository-level knip task reports one pre-existing unused type
(src/domain/adb/adbDeviceAnalysis.ts) that reproduces on the clean base.
- Real Rizin 0.9.1 on Linux x64: on the base, a `dc` deadline left the
retained rizin process alive and closeAll raised retainedProcessIds; with
this change the command returns partial output with the new limitation,
the owned debugger is terminated, the target keeps running, and close
returns target_state unknown.
* fix(rizin): address Greptile P1/P2 and Codex review findings
* fix(rizin): address Greptile P1/P2 and Codex review findings
* fix(rizin): address Greptile P1/P2 and Codex review findings
* fix(rizin): keep the unknown target state when cancelled startup cannot detach
A startup that failed its protocol and was cancelled reported only the
cancellation. When cleanup then could not resynchronize and terminated
Rizin without a verified detach, the caller lost the only record that the
target may still be running, because the session is removed after the stop.
Cancellation stays the reported reason and the unverified detach is
retained as a secondary failure, as the protocol-failure branch already
states it. Also route the cleanup probe reason through errorMessage.
* test(rizin): use lifecycle assertions and typed failures
---------
Co-authored-by: Vincent Koc <vincentkoc@ieee.org>