STET

agent_patch

runs/2026-02-27__21-30-28__gpt-5-3-codex/flux-pr-3850/flux-pr-3850.1-of-1.2026-02-27__21-30-28__gpt-5-3-codex/agent-logs/agent.patch

9607 bytes

Back to adjudication
diff --git a/tmp/agent-patch-flux-pr-3850.1-of-1.2026-02-27__21-30-28__gpt-5-3-codex/app/deno/lib/external.ts b/app/deno/lib/external.ts
index b2070f8..c44c2b7 100644
--- a/tmp/agent-patch-flux-pr-3850.1-of-1.2026-02-27__21-30-28__gpt-5-3-codex/app/deno/lib/external.ts
+++ b/app/deno/lib/external.ts
@@ -2,5 +2,6 @@ export * from "./errors.ts";
 export * from "./helpers/parseUtil.ts";
 export * from "./helpers/typeAliases.ts";
 export * from "./helpers/util.ts";
+export * from "./standard-schema.ts";
 export * from "./types.ts";
 export * from "./ZodError.ts";
diff --git a/app/deno/lib/standard-schema.ts b/app/deno/lib/standard-schema.ts
new file mode 100644
index 0000000..2beab83
--- /dev/null
+++ b/app/deno/lib/standard-schema.ts
@@ -0,0 +1,37 @@
+export type StandardSchemaV1<Input = unknown, Output = Input> = {
+  readonly "~standard": StandardSchemaV1.Props<Input, Output>;
+};
+
+export declare namespace StandardSchemaV1 {
+  export interface Props<Input = unknown, Output = Input> {
+    readonly version: 1;
+    readonly vendor: string;
+    readonly validate: (
+      value: unknown
+    ) => Result<Output> | Promise<Result<Output>>;
+    readonly types?: Types<Input, Output> | undefined;
+    readonly async?: true | undefined;
+  }
+
+  export interface Types<Input = unknown, Output = Input> {
+    readonly input: Input;
+    readonly output: Output;
+  }
+
+  export type Result<Output> = SuccessResult<Output> | FailureResult;
+
+  export interface SuccessResult<Output> {
+    readonly value: Output;
+    readonly issues?: undefined;
+  }
+
+  export interface FailureResult {
+    readonly issues: ReadonlyArray<Issue>;
+    readonly value?: undefined;
+  }
+
+  export interface Issue {
+    readonly message: string;
+    readonly path?: ReadonlyArray<PropertyKey> | undefined;
+  }
+}
diff --git a/tmp/agent-patch-flux-pr-3850.1-of-1.2026-02-27__21-30-28__gpt-5-3-codex/app/deno/lib/types.ts b/app/deno/lib/types.ts
index 3bb8b65..9a15938 100644
--- a/tmp/agent-patch-flux-pr-3850.1-of-1.2026-02-27__21-30-28__gpt-5-3-codex/app/deno/lib/types.ts
+++ b/app/deno/lib/types.ts
@@ -21,6 +21,7 @@ import {
   SyncParseReturnType,
 } from "./helpers/parseUtil.ts";
 import { partialUtil } from "./helpers/partialUtil.ts";
+import { StandardSchemaV1 } from "./standard-schema.ts";
 import { Primitive } from "./helpers/typeAliases.ts";
 import { getParsedType, objectUtil, util, ZodParsedType } from "./helpers/util.ts";
 import {
@@ -169,11 +170,12 @@ export abstract class ZodType<
   Output = any,
   Def extends ZodTypeDef = ZodTypeDef,
   Input = Output
-> {
+> implements StandardSchemaV1<Input, Output> {
   readonly _type!: Output;
   readonly _output!: Output;
   readonly _input!: Input;
   readonly _def!: Def;
+  "~standard": StandardSchemaV1.Props<Input, Output>;
 
   get description() {
     return this._def.description;
@@ -298,6 +300,56 @@ export abstract class ZodType<
   /** Alias of safeParseAsync */
   spa = this.safeParseAsync;
 
+  "~validate"(
+    data: unknown
+  ): StandardSchemaV1.Result<Output> | Promise<StandardSchemaV1.Result<Output>> {
+    const ctx: ParseContext = {
+      common: {
+        issues: [],
+        async: false,
+      },
+      path: [],
+      schemaErrorMap: this._def.errorMap,
+      parent: null,
+      data,
+      parsedType: getParsedType(data),
+    };
+
+    try {
+      const result = this._parseSync({ data, path: ctx.path, parent: ctx });
+      return isValid(result)
+        ? { value: result.value }
+        : { issues: ctx.common.issues };
+    } catch (err) {
+      if ((err as Error)?.message?.toLowerCase()?.includes("encountered")) {
+        (this["~standard"] as any).async = true;
+        const asyncCtx: ParseContext = {
+          common: {
+            issues: [],
+            async: true,
+          },
+          path: [],
+          schemaErrorMap: this._def.errorMap,
+          parent: null,
+          data,
+          parsedType: getParsedType(data),
+        };
+
+        return this._parseAsync({
+          data,
+          path: asyncCtx.path,
+          parent: asyncCtx,
+        }).then((result) =>
+          isValid(result)
+            ? { value: result.value }
+            : { issues: asyncCtx.common.issues }
+        );
+      }
+
+      throw err;
+    }
+  }
+
   refine<RefinedOutput extends Output>(
     check: (arg: Output) => arg is RefinedOutput,
     message?: string | CustomErrorParams | ((arg: Output) => CustomErrorParams)
@@ -398,6 +450,11 @@ export abstract class ZodType<
 
   constructor(def: Def) {
     this._def = def;
+    this["~standard"] = {
+      version: 1,
+      vendor: "zod",
+      validate: (data) => this["~validate"](data),
+    };
     this.parse = this.parse.bind(this);
     this.safeParse = this.safeParse.bind(this);
     this.parseAsync = this.parseAsync.bind(this);
diff --git a/tmp/agent-patch-flux-pr-3850.1-of-1.2026-02-27__21-30-28__gpt-5-3-codex/app/src/external.ts b/app/src/external.ts
index 002e17d..1e918b8 100644
--- a/tmp/agent-patch-flux-pr-3850.1-of-1.2026-02-27__21-30-28__gpt-5-3-codex/app/src/external.ts
+++ b/app/src/external.ts
@@ -2,5 +2,6 @@ export * from "./errors";
 export * from "./helpers/parseUtil";
 export * from "./helpers/typeAliases";
 export * from "./helpers/util";
+export * from "./standard-schema";
 export * from "./types";
 export * from "./ZodError";
diff --git a/app/src/standard-schema.ts b/app/src/standard-schema.ts
new file mode 100644
index 0000000..2beab83
--- /dev/null
+++ b/app/src/standard-schema.ts
@@ -0,0 +1,37 @@
+export type StandardSchemaV1<Input = unknown, Output = Input> = {
+  readonly "~standard": StandardSchemaV1.Props<Input, Output>;
+};
+
+export declare namespace StandardSchemaV1 {
+  export interface Props<Input = unknown, Output = Input> {
+    readonly version: 1;
+    readonly vendor: string;
+    readonly validate: (
+      value: unknown
+    ) => Result<Output> | Promise<Result<Output>>;
+    readonly types?: Types<Input, Output> | undefined;
+    readonly async?: true | undefined;
+  }
+
+  export interface Types<Input = unknown, Output = Input> {
+    readonly input: Input;
+    readonly output: Output;
+  }
+
+  export type Result<Output> = SuccessResult<Output> | FailureResult;
+
+  export interface SuccessResult<Output> {
+    readonly value: Output;
+    readonly issues?: undefined;
+  }
+
+  export interface FailureResult {
+    readonly issues: ReadonlyArray<Issue>;
+    readonly value?: undefined;
+  }
+
+  export interface Issue {
+    readonly message: string;
+    readonly path?: ReadonlyArray<PropertyKey> | undefined;
+  }
+}
diff --git a/tmp/agent-patch-flux-pr-3850.1-of-1.2026-02-27__21-30-28__gpt-5-3-codex/app/src/types.ts b/app/src/types.ts
index 5f8c65d..4eb211a 100644
--- a/tmp/agent-patch-flux-pr-3850.1-of-1.2026-02-27__21-30-28__gpt-5-3-codex/app/src/types.ts
+++ b/app/src/types.ts
@@ -21,6 +21,7 @@ import {
   SyncParseReturnType,
 } from "./helpers/parseUtil";
 import { partialUtil } from "./helpers/partialUtil";
+import { StandardSchemaV1 } from "./standard-schema";
 import { Primitive } from "./helpers/typeAliases";
 import { getParsedType, objectUtil, util, ZodParsedType } from "./helpers/util";
 import {
@@ -169,11 +170,12 @@ export abstract class ZodType<
   Output = any,
   Def extends ZodTypeDef = ZodTypeDef,
   Input = Output
-> {
+> implements StandardSchemaV1<Input, Output> {
   readonly _type!: Output;
   readonly _output!: Output;
   readonly _input!: Input;
   readonly _def!: Def;
+  "~standard": StandardSchemaV1.Props<Input, Output>;
 
   get description() {
     return this._def.description;
@@ -298,6 +300,56 @@ export abstract class ZodType<
   /** Alias of safeParseAsync */
   spa = this.safeParseAsync;
 
+  "~validate"(
+    data: unknown
+  ): StandardSchemaV1.Result<Output> | Promise<StandardSchemaV1.Result<Output>> {
+    const ctx: ParseContext = {
+      common: {
+        issues: [],
+        async: false,
+      },
+      path: [],
+      schemaErrorMap: this._def.errorMap,
+      parent: null,
+      data,
+      parsedType: getParsedType(data),
+    };
+
+    try {
+      const result = this._parseSync({ data, path: ctx.path, parent: ctx });
+      return isValid(result)
+        ? { value: result.value }
+        : { issues: ctx.common.issues };
+    } catch (err) {
+      if ((err as Error)?.message?.toLowerCase()?.includes("encountered")) {
+        (this["~standard"] as any).async = true;
+        const asyncCtx: ParseContext = {
+          common: {
+            issues: [],
+            async: true,
+          },
+          path: [],
+          schemaErrorMap: this._def.errorMap,
+          parent: null,
+          data,
+          parsedType: getParsedType(data),
+        };
+
+        return this._parseAsync({
+          data,
+          path: asyncCtx.path,
+          parent: asyncCtx,
+        }).then((result) =>
+          isValid(result)
+            ? { value: result.value }
+            : { issues: asyncCtx.common.issues }
+        );
+      }
+
+      throw err;
+    }
+  }
+
   refine<RefinedOutput extends Output>(
     check: (arg: Output) => arg is RefinedOutput,
     message?: string | CustomErrorParams | ((arg: Output) => CustomErrorParams)
@@ -398,6 +450,11 @@ export abstract class ZodType<
 
   constructor(def: Def) {
     this._def = def;
+    this["~standard"] = {
+      version: 1,
+      vendor: "zod",
+      validate: (data) => this["~validate"](data),
+    };
     this.parse = this.parse.bind(this);
     this.safeParse = this.safeParse.bind(this);
     this.parseAsync = this.parseAsync.bind(this);