fix(rizin): mark a version probe whose completion is unknown

When the owned runner reported a collection failure with completed
cleanup and the partial streams fit the 2,048-byte cut, the probe's
diagnostics showed output_truncated false and no completeness field;
only the nulled exit code hinted that bytes were missing. The probe's
diagnostics now carry completion_status with the command's own rule:
unknown when output was not fully collected or the probe was killed,
signalled or left no exit code, and complete otherwise.
This commit is contained in:
Entrpi committed 2026-11-01 17:07:01 +11:00
1 parent 4b86c6bff8
commit 162fcd0800
3 files changed
+16 -1

No files matched your search

+3 -1
View File
@@ -113,7 +113,9 @@ has `provider_identity: "banner"`. The
probe's exit status and output, each stream cut to 2,048 UTF-8 bytes in the
same way, are recorded in `provider_version_probe`,
where `stdout_invalid_utf8` and `stderr_invalid_utf8` mark output that was not
valid UTF-8 and so holds replacement characters.
valid UTF-8 and so holds replacement characters, and `completion_status` is
`unknown`, as for the command, when the probe's output was not fully collected
or the probe was killed, signalled or left no exit code.
Each call's lookup, hash and probe use that call's `command_timeout_ms` budget
and cancellation; a lookup or hash that reaches the deadline ends the call
without running the command. A hash that fails for another reason, for example
@@ -1203,6 +1203,7 @@ const versionProbeDiagnostics = (
readonly stdout: string;
readonly stderr: string;
readonly signal?: string | null;
readonly killed?: boolean;
readonly outputTruncated?: boolean;
readonly collectionFailure?: boolean;
readonly stdoutInvalidUtf8?: boolean;
@@ -1230,6 +1231,15 @@ const versionProbeDiagnostics = (
stderr: stderr.text,
output_truncated:
output?.outputTruncated === true || stdout.truncated || stderr.truncated,
// As for the command: output that was not fully collected, or a probe that
// was killed, signalled or left no exit code, did not observably complete.
completion_status:
output?.collectionFailure !== true &&
output?.killed !== true &&
(output?.signal ?? null) === null &&
typeof code === "number"
? "complete"
: "unknown",
// Invalid UTF-8 is decoded as replacement characters; these mark it.
stdout_invalid_utf8: output?.stdoutInvalidUtf8 === true,
stderr_invalid_utf8: output?.stderrInvalidUtf8 === true,
@@ -281,6 +281,7 @@ posix(
stdout: "usage: tool [options]\n",
stderr: "unknown option -v\n",
output_truncated: false,
completion_status: "complete",
},
});
expect(result.value.parameters).not.toHaveProperty(
@@ -907,6 +908,7 @@ posix(
expect(first.value.provider.version).toBeNull();
expect(first.value.parameters.provider_version_probe).toMatchObject({
exit_code: null,
completion_status: "unknown",
});
},
);
@@ -955,6 +957,7 @@ posix.each([
expect(result.value.parameters.provider_version_probe).toMatchObject({
exit_code: outcome === "failed" ? 2 : null,
error_code: outcome === "timed-out" ? "ETIMEDOUT" : null,
completion_status: outcome === "failed" ? "complete" : "unknown",
stdout_invalid_utf8: invalid.stdout,
stderr_invalid_utf8: invalid.stderr,
});