fix(process): preserve numeric output and original PTY evidence

This commit is contained in:
N0zoM1z0
2026-10-09 17:55:28 +08:00
parent aa5750c263
commit 00d8e44cbf
10 changed files with 168 additions and 7 deletions
+16 -3
View File
@@ -1,7 +1,17 @@
import { z } from "zod";
import { jsonValueSchema, type JsonValue } from "../jsonValue.js";
import type { UnverifiedProcessCapture } from "./processCapture.js";
import type {
TerminalFrame,
UnverifiedProcessCapture,
} from "./processCapture.js";
/** Project normalized PTY facts without source text used only for audit. */
export const comparableTerminalFrame = (frame: TerminalFrame) => ({
sequence: frame.sequence,
at_ms: frame.at_ms,
data: frame.data,
});
/** Process-capture observation families shared by live drivers and trace assertions. */
export const processObservationSourceSchema = z.enum([
@@ -126,11 +136,14 @@ const projectedRecord = (
): ProjectedRecord | null => {
const projected = (() => {
switch (location.collection) {
case "frames":
case "frames": {
const frame = capture.frames[location.index];
return {
source: "terminal_raw" as const,
value: capture.frames[location.index],
value:
frame === undefined ? undefined : comparableTerminalFrame(frame),
};
}
case "rendered_frames":
return {
source: "terminal_rendered" as const,