Files
reverse-engineering-anything/src/domain/native/nativeCallPartialObservation.ts
T
郭立 Guo Li 7590b50801 perf(schema): reduce retained integer validator allocations (#4360)
Construct integer formats directly while preserving bounds, refinements, metadata and current shared schema owners. Keep Incur-dependent CLI numeric coercion declarations unchanged.

Verify canonical advertisements, 126 numeric boundary cases, 974 actual CLI parser cases, broad source tests and real public-artifact SDK workflows. Record 72 normal tasks and 12 separate owned-inspector heap diagnostics with whole-family resource bounds; distinguish SDK spans and asymmetric audit overhead. Generate numerical report sections from receipts and reject stale tables through documentation conformance checks.

Closes #6236. Current-head CI and Greptile pass; actionable review findings are addressed. Codex review was unavailable due repository usage limits.
2026-10-22 05:11:08 +00:00

46 lines
1.4 KiB
TypeScript

import { z } from "zod";
import {
nativeCallEventSchema,
nativeCapturedOutputSchema,
nativeCallObservationResultSchema,
} from "./nativeCallObservation.js";
const completed = nativeCallObservationResultSchema.shape;
/** Native facts retained on failure, including completed facts before finalization. */
export const nativeCallPartialObservationSchema = z.strictObject({
kind: z.literal("native-call-observation"),
target: completed.target.omit({ launch_identity: true }).extend({
launch_identity: completed.target.shape.launch_identity.optional(),
}),
process: completed.process.partial().extend({
pid: z.int().positive().nullable(),
stdout: nativeCapturedOutputSchema.nullable(),
stderr: nativeCapturedOutputSchema.nullable(),
other_stops: z.array(z.string()),
}),
debugger: completed.debugger
.partial()
.extend({ version: z.string().nullable() }),
breakpoints: completed.breakpoints.optional(),
events: z.array(nativeCallEventSchema),
coverage: completed.coverage
.omit({ status: true })
.partial()
.extend({
status: z.literal("partial"),
reason: z.enum([
"cancelled",
"timeout",
"tracer-failure",
"capture-failure",
"cleanup-failure",
]),
}),
limitations: z.array(z.string()),
});
export type NativeCallPartialObservation = z.infer<
typeof nativeCallPartialObservationSchema
>;