fix(sentinel): harden post-deploy report and ssh summaries

This commit is contained in:
Codex
2026-07-01 08:16:53 +00:00
parent 6906037ba4
commit 6b73dcd0c1
6 changed files with 273 additions and 14 deletions
+16
View File
@@ -9,7 +9,9 @@ import {
createSshStderrForwarder,
createSshStdoutForwarder,
formatSshStdoutTruncationHint,
formatSshTruncationCompletionSummary,
parseSshInvocation,
sshTruncationCompletionSummary,
sshCaptureBackendPlan,
sshStderrStreamMaxBytes,
sshStdoutStreamMaxBytes,
@@ -214,6 +216,20 @@ describe("ssh stdout bounded streaming", () => {
expect(hint).toContain("\"forwardedBytes\":5");
const payload = JSON.parse(hint!.slice("UNIDESK_SSH_STDOUT_TRUNCATED ".length)) as { dumpPath: string };
expect(readFileSync(payload.dumpPath, "utf8")).toBe("abcdefghijkl");
const summary = sshTruncationCompletionSummary({
invocation,
transport: "frontend-websocket",
exitCode: 0,
timedOut: false,
startedAtMs: Date.now() - 1234,
stdout: forwarder.summary(),
stderr: null,
});
const formattedSummary = formatSshTruncationCompletionSummary(summary);
expect(formattedSummary).toContain("UNIDESK_SSH_TRUNCATION_SUMMARY");
expect(formattedSummary).toContain("\"exitCode\":0");
expect(formattedSummary).toContain("\"commandOmitted\":true");
expect(formattedSummary).toContain("\"dumpPath\"");
rmSync(payload.dumpPath, { force: true });
});