mirror of
https://github.com/morluto/rea.git
synced 2026-10-26 17:35:11 +00:00
Retain received complete and unfinished Rizin command bytes with bounded UTF-8 capture, truthful completion uncertainty and exact launch provenance. Keep captures independent of cancellation, protocol and cleanup precedence; wait for bounded output settlement on exit and preserve active bytes across stdin failures. Validated353 focused tests (one existing skip), full CI static/docs checks, real official Linux Rizin0.9.1 interruption probes, paired completed public CLI/stdio MCP tasks, and focused mutation checks. Required CI passed; exact-head Codex review reported no findings and Greptile5/5. Fault cleanup uncertainty and partial-marker ambiguity remain explicit. Fixes #4015. Follow-up to #4227.
47 lines
1.8 KiB
TypeScript
47 lines
1.8 KiB
TypeScript
import { expect, it } from "vitest";
|
|
|
|
import { createRizinCommandTimeoutEvidence } from "../../../src/rizin/RizinDebugSessionManager.js";
|
|
|
|
it("preserves every field of partial Rizin timeout Evidence", () => {
|
|
const result = {
|
|
command: "dr",
|
|
output: "partial register output",
|
|
output_scope: "command_and_interleaved_session_output" as const,
|
|
output_truncated: true,
|
|
completion_status: "unknown" as const,
|
|
backend: null,
|
|
};
|
|
|
|
const evidence = createRizinCommandTimeoutEvidence({
|
|
sessionId: "session-123",
|
|
command: "dr",
|
|
result,
|
|
inferiorTty: "/dev/pts/7",
|
|
cleanupFailure: undefined,
|
|
launchProvenance: {
|
|
caller_selected_path: "./sample/../program",
|
|
resolved_path: "/workspace/program",
|
|
},
|
|
});
|
|
|
|
expect(evidence.parameters).toEqual({
|
|
session_id: "session-123",
|
|
command: "dr",
|
|
inferior_tty: "/dev/pts/7",
|
|
launch_provenance: {
|
|
caller_selected_path: "./sample/../program",
|
|
resolved_path: "/workspace/program",
|
|
},
|
|
});
|
|
expect(evidence.raw_result).toEqual(result);
|
|
expect(evidence.normalized_result).toEqual(result);
|
|
expect(evidence.limitations).toEqual([
|
|
"The current debugger target identity is not established by the Rizin session identifier.",
|
|
"The command timed out before its completion marker; retained output is partial and completion is unknown.",
|
|
"The owned debugger session was stopped because output correlation could no longer be guaranteed.",
|
|
"The command is unrestricted and may access local files, the shell, network, or mutate the target.",
|
|
"Interrupted output may include an incomplete completion-marker prefix; it is retained because it cannot be distinguished from command diagnostics.",
|
|
"Launch provenance records the original and resolved startup paths; it does not establish the current target after unrestricted debugger commands.",
|
|
]);
|
|
});
|