Repository: colinhacks/zod
Pull request #4388 (2025-05-17 06:52:13)

Improve min/max in JSON Schema

coderabbitai[bot]: <!-- This is an auto-generated comment: summarize by coderabbit.ai -->
<!-- This is an auto-generated comment: skip review by coderabbit.ai -->

> [!IMPORTANT]
> ## Review skipped
> 
> Auto reviews are disabled on base/target branches other than the default branch.
> 
> 
> 
> Please check the settings in the CodeRabbit UI or the `.coderabbit.yaml` file in this repository. To trigger a single review, invoke the `@coderabbitai review` command.
> 
> You can disable this status message by setting the `reviews.review_status` to `false` in the CodeRabbit configuration file.

<!-- end of auto-generated comment: skip review by coderabbit.ai -->
<!-- finishing_touch_checkbox_start -->

<details open="true">
<summary>✨ Finishing Touches</summary>

<details open="true">
<summary>🧪 Generate Unit Tests</summary>

- [ ] <!-- {"checkboxId": "f47ac10b-58cc-4372-a567-0e02b2c3d479", "radioGroupId": "utg-output-choice-group-unknown_comment_id"} -->   Create PR with Unit Tests
- [ ] <!-- {"checkboxId": "6ba7b810-9dad-11d1-80b4-00c04fd430c8", "radioGroupId": "utg-output-choice-group-unknown_comment_id"} -->   Commit Unit Tests in branch `v4-fix-minmax-json-schema`
- [ ] <!-- {"checkboxId": "07f1e7d6-8a8e-4e23-9900-8731c2c87f58", "radioGroupId": "utg-output-choice-group-unknown_comment_id"} -->   Post Copyable Unit Tests in Comment

</details>

</details>

<!-- finishing_touch_checkbox_end -->
<!-- tips_start -->

---

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

<details>
<summary>❤️ Share</summary>

- [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai)
- [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai)
- [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai)
- [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)

</details>

<details>
<summary>🪧 Tips</summary>

### Chat

There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=colinhacks/zod&utm_content=4388):

- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
  - `I pushed a fix in commit <commit_id>, please review it.`
  - `Explain this complex logic.`
  - `Open a follow-up GitHub issue for this discussion.`
- Files and specific lines of code (under the "Files changed" tab): Tag `@coderabbitai` in a new review comment at the desired location with your query. Examples:
  - `@coderabbitai explain this code block.`
  -	`@coderabbitai modularize this function.`
- PR comments: Tag `@coderabbitai` in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
  - `@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.`
  - `@coderabbitai read src/utils.ts and explain its main purpose.`
  - `@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.`
  - `@coderabbitai help me debug CodeRabbit configuration file.`

### Support

Need help? Create a ticket on our [support page](https://www.coderabbit.ai/contact-us/support) for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

### CodeRabbit Commands (Invoked using PR comments)

- `@coderabbitai pause` to pause the reviews on a PR.
- `@coderabbitai resume` to resume the paused reviews.
- `@coderabbitai review` to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
- `@coderabbitai full review` to do a full review from scratch and review all the files again.
- `@coderabbitai summary` to regenerate the summary of the PR.
- `@coderabbitai generate docstrings` to [generate docstrings](https://docs.coderabbit.ai/finishing-touches/docstrings) for this PR.
- `@coderabbitai generate sequence diagram` to generate a sequence diagram of the changes in this PR.
- `@coderabbitai generate unit tests` to generate unit tests for this PR.
- `@coderabbitai resolve` resolve all the CodeRabbit review comments.
- `@coderabbitai configuration` to show the current CodeRabbit configuration for the repository.
- `@coderabbitai help` to get help.

### Other keywords and placeholders

- Add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed.
- Add `@coderabbitai summary` to generate the high-level summary at a specific location in the PR description.
- Add `@coderabbitai` anywhere in the PR title to generate the title automatically.

### CodeRabbit Configuration File (`.coderabbit.yaml`)

- You can programmatically configure CodeRabbit by adding a `.coderabbit.yaml` file to the root of your repository.
- Please see the [configuration documentation](https://docs.coderabbit.ai/guides/configure-coderabbit) for more information.
- If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: `# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json`

### Documentation and Community

- Visit our [Documentation](https://docs.coderabbit.ai) for detailed information on how to use CodeRabbit.
- Join our [Discord Community](http://discord.gg/coderabbit) to get help, request features, and share feedback.
- Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.

</details>

<!-- tips_end -->

Patch:
diff --git a/packages/zod/src/v4/classic/schemas.ts b/packages/zod/src/v4/classic/schemas.ts
index a1a0d001..21e0fadd 100644
--- a/packages/zod/src/v4/classic/schemas.ts
+++ b/packages/zod/src/v4/classic/schemas.ts
@@ -251,9 +251,10 @@ export const _ZodString: core.$constructor<_ZodString> = /*@__PURE__*/ core.$con
   core.$ZodString.init(inst, def);
   ZodType.init(inst, def);
 
-  inst.format = inst._zod.computed.format ?? null;
-  inst.minLength = inst._zod.computed.minimum ?? null;
-  inst.maxLength = inst._zod.computed.maximum ?? null;
+  const bag = inst._zod.bag;
+  inst.format = bag.format ?? null;
+  inst.minLength = bag.minimum ?? null;
+  inst.maxLength = bag.maximum ?? null;
 
   // validations
   inst.regex = (...args) => inst.check(checks.regex(...args));
@@ -719,7 +720,7 @@ export interface _ZodNumber<Input = unknown> extends ZodType {
   step(value: number, params?: string | core.$ZodCheckMultipleOfParams): this;
 
   /** @deprecated In v4 and later, z.number() does not allow infinite values by default. This is a no-op. */
-  finite(params?: any): this;
+  finite(params?: unknown): this;
 
   minValue: number | null;
   maxValue: number | null;
@@ -754,12 +755,14 @@ export const ZodNumber: core.$constructor<ZodNumber> = /*@__PURE__*/ core.$const
   // inst.finite = (params) => inst.check(core.finite(params));
   inst.finite = () => inst;
 
-  inst.minValue = inst._zod.computed.minimum ?? null;
-  inst.maxValue = inst._zod.computed.maximum ?? null;
-  inst.isInt =
-    (inst._zod.computed.format ?? "").includes("int") || Number.isSafeInteger(inst._zod.computed.multipleOf ?? 0.5);
+  const bag = inst._zod.bag;
+  inst.minValue =
+    Math.max(bag.minimum ?? Number.NEGATIVE_INFINITY, bag.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null;
+  inst.maxValue =
+    Math.min(bag.maximum ?? Number.POSITIVE_INFINITY, bag.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null;
+  inst.isInt = (bag.format ?? "").includes("int") || Number.isSafeInteger(bag.multipleOf ?? 0.5);
   inst.isFinite = true;
-  inst.format = inst._zod.computed.format ?? null;
+  inst.format = bag.format ?? null;
 });
 
 export function number(params?: string | core.$ZodNumberParams): ZodNumber {
@@ -864,9 +867,10 @@ export const ZodBigInt: core.$constructor<ZodBigInt> = /*@__PURE__*/ core.$const
   inst.nonnegative = (params) => inst.check(checks.gte(BigInt(0), params));
   inst.multipleOf = (value, params) => inst.check(checks.multipleOf(value, params));
 
-  inst.minValue = inst._zod.computed.minimum ?? null;
-  inst.maxValue = inst._zod.computed.maximum ?? null;
-  inst.format = inst._zod.computed.format ?? null;
+  const bag = inst._zod.bag;
+  inst.minValue = bag.minimum ?? null;
+  inst.maxValue = bag.maximum ?? null;
+  inst.format = bag.format ?? null;
 });
 
 export function bigint(params?: string | core.$ZodBigIntParams): ZodBigInt {
@@ -1014,7 +1018,7 @@ export const ZodDate: core.$constructor<ZodDate> = /*@__PURE__*/ core.$construct
   inst.min = (value, params) => inst.check(checks.gte(value, params));
   inst.max = (value, params) => inst.check(checks.lte(value, params));
 
-  const c = inst._zod.computed;
+  const c = inst._zod.bag;
   inst.minDate = c.minimum ? new Date(c.minimum) : null;
   inst.maxDate = c.maximum ? new Date(c.maximum) : null;
 });
diff --git a/packages/zod/src/v4/core/checks.ts b/packages/zod/src/v4/core/checks.ts
index 3ede95dd..5202d58e 100644
--- a/packages/zod/src/v4/core/checks.ts
+++ b/packages/zod/src/v4/core/checks.ts
@@ -70,10 +70,11 @@ export const $ZodCheckLessThan: core.$constructor<$ZodCheckLessThan> = /*@__PURE
     const origin = numericOriginMap[typeof def.value as "number" | "bigint" | "object"];
 
     inst._zod.onattach.push((inst) => {
-      const curr = inst._zod.computed.maximum ?? Number.POSITIVE_INFINITY;
+      const bag = inst._zod.bag;
+      const curr = (def.inclusive ? bag.maximum : bag.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;
       if (def.value < curr) {
-        inst._zod.computed.maximum = def.value;
-        inst._zod.computed.inclusive = def.inclusive;
+        if (def.inclusive) bag.maximum = def.value;
+        else bag.exclusiveMaximum = def.value;
       }
     });
 
@@ -120,10 +121,11 @@ export const $ZodCheckGreaterThan: core.$constructor<$ZodCheckGreaterThan> = /*@
     const origin = numericOriginMap[typeof def.value as "number" | "bigint" | "object"];
 
     inst._zod.onattach.push((inst) => {
-      const curr = inst._zod.computed.minimum ?? Number.NEGATIVE_INFINITY;
+      const bag = inst._zod.bag;
+      const curr = (def.inclusive ? bag.minimum : bag.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;
       if (def.value > curr) {
-        inst._zod.computed.minimum = def.value;
-        inst._zod.computed.inclusive = def.inclusive;
+        if (def.inclusive) bag.minimum = def.value;
+        else bag.exclusiveMinimum = def.value;
       }
     });
 
@@ -170,7 +172,7 @@ export const $ZodCheckMultipleOf: core.$constructor<$ZodCheckMultipleOf<number |
     $ZodCheck.init(inst, def);
 
     inst._zod.onattach.push((inst) => {
-      inst._zod.computed.multipleOf ??= def.value;
+      inst._zod.bag.multipleOf ??= def.value;
     });
 
     inst._zod.check = (payload) => {
@@ -212,7 +214,7 @@ export const $ZodCheckMultipleOf: core.$constructor<$ZodCheckMultipleOf<number |
 //     $ZodCheck.init(inst, def);
 
 //     inst._zod.onattach = (inst) => {
-//       inst["_computed"].finite = true;
+//       inst["_bag"].finite = true;
 //     };
 
 //     inst._zod.check = (payload) => {
@@ -252,6 +254,9 @@ export interface $ZodCheckNumberFormatDef extends $ZodCheckDef {
 export interface $ZodCheckNumberFormatInternals extends $ZodCheckInternals<number> {
   def: $ZodCheckNumberFormatDef;
   issc: errors.$ZodIssueInvalidType | errors.$ZodIssueTooBig<"number"> | errors.$ZodIssueTooSmall<"number">;
+  // bag: util.LoosePartial<{
+  //   minimum?: number | undefined;
+  // }>;
 }
 
 export interface $ZodCheckNumberFormat extends $ZodCheck<number> {
@@ -269,11 +274,11 @@ export const $ZodCheckNumberFormat: core.$constructor<$ZodCheckNumberFormat> = /
     const [minimum, maximum] = util.NUMBER_FORMAT_RANGES[def.format];
 
     inst._zod.onattach.push((inst) => {
-      inst._zod.computed.format = def.format;
-      inst._zod.computed.minimum = minimum;
-      inst._zod.computed.maximum = maximum;
-      inst._zod.computed.inclusive = true;
-      if (isInt) inst._zod.computed.pattern = regexes.integer;
+      const bag = inst._zod.bag;
+      bag.format = def.format;
+      bag.minimum = minimum;
+      bag.maximum = maximum;
+      if (isInt) bag.pattern = regexes.integer;
     });
 
     inst._zod.check = (payload) => {
@@ -383,9 +388,10 @@ export const $ZodCheckBigIntFormat: core.$constructor<$ZodCheckBigIntFormat> = /
     const [minimum, maximum] = util.BIGINT_FORMAT_RANGES[def.format!];
 
     inst._zod.onattach.push((inst) => {
-      inst._zod.computed.format = def.format;
-      inst._zod.computed.minimum = minimum;
-      inst._zod.computed.maximum = maximum;
+      const bag = inst._zod.bag;
+      bag.format = def.format;
+      bag.minimum = minimum;
+      bag.maximum = maximum;
     });
 
     inst._zod.check = (payload) => {
@@ -444,8 +450,8 @@ export const $ZodCheckMaxSize: core.$constructor<$ZodCheckMaxSize> = /*@__PURE__
     };
 
     inst._zod.onattach.push((inst) => {
-      const curr = (inst._zod.computed.maximum ?? Number.POSITIVE_INFINITY) as number;
-      if (def.maximum < curr) inst._zod.computed.maximum = def.maximum;
+      const curr = (inst._zod.bag.maximum ?? Number.POSITIVE_INFINITY) as number;
+      if (def.maximum < curr) inst._zod.bag.maximum = def.maximum;
     });
 
     inst._zod.check = (payload) => {
@@ -493,8 +499,8 @@ export const $ZodCheckMinSize: core.$constructor<$ZodCheckMinSize> = /*@__PURE__
     };
 
     inst._zod.onattach.push((inst) => {
-      const curr = (inst._zod.computed.minimum ?? Number.NEGATIVE_INFINITY) as number;
-      if (def.minimum > curr) inst._zod.computed.minimum = def.minimum;
+      const curr = (inst._zod.bag.minimum ?? Number.NEGATIVE_INFINITY) as number;
+      if (def.minimum > curr) inst._zod.bag.minimum = def.minimum;
     });
 
     inst._zod.check = (payload) => {
@@ -542,9 +548,10 @@ export const $ZodCheckSizeEquals: core.$constructor<$ZodCheckSizeEquals> = /*@__
     };
 
     inst._zod.onattach.push((inst) => {
-      inst._zod.computed.minimum = def.size;
-      inst._zod.computed.maximum = def.size;
-      inst._zod.computed.size = def.size;
+      const bag = inst._zod.bag;
+      bag.minimum = def.size;
+      bag.maximum = def.size;
+      bag.size = def.size;
     });
 
     inst._zod.check = (payload) => {
@@ -593,8 +600,8 @@ export const $ZodCheckMaxLength: core.$constructor<$ZodCheckMaxLength> = /*@__PU
     };
 
     inst._zod.onattach.push((inst) => {
-      const curr = (inst._zod.computed.maximum ?? Number.POSITIVE_INFINITY) as number;
-      if (def.maximum < curr) inst._zod.computed.maximum = def.maximum;
+      const curr = (inst._zod.bag.maximum ?? Number.POSITIVE_INFINITY) as number;
+      if (def.maximum < curr) inst._zod.bag.maximum = def.maximum;
     });
 
     inst._zod.check = (payload) => {
@@ -643,8 +650,8 @@ export const $ZodCheckMinLength: core.$constructor<$ZodCheckMinLength> = /*@__PU
     };
 
     inst._zod.onattach.push((inst) => {
-      const curr = (inst._zod.computed.minimum ?? Number.NEGATIVE_INFINITY) as number;
-      if (def.minimum > curr) inst._zod.computed.minimum = def.minimum;
+      const curr = (inst._zod.bag.minimum ?? Number.NEGATIVE_INFINITY) as number;
+      if (def.minimum > curr) inst._zod.bag.minimum = def.minimum;
     });
 
     inst._zod.check = (payload) => {
@@ -694,9 +701,10 @@ export const $ZodCheckLengthEquals: core.$constructor<$ZodCheckLengthEquals> = /
     };
 
     inst._zod.onattach.push((inst) => {
-      inst._zod.computed.minimum = def.length;
-      inst._zod.computed.maximum = def.length;
-      inst._zod.computed.length = def.length;
+      const bag = inst._zod.bag;
+      bag.minimum = def.length;
+      bag.maximum = def.length;
+      bag.length = def.length;
     });
 
     inst._zod.check = (payload) => {
@@ -771,8 +779,8 @@ export const $ZodCheckStringFormat: core.$constructor<$ZodCheckStringFormat> = /
     $ZodCheck.init(inst, def);
 
     inst._zod.onattach.push((inst) => {
-      inst._zod.computed.format = def.format;
-      if (def.pattern) inst._zod.computed.pattern = def.pattern;
+      inst._zod.bag.format = def.format;
+      if (def.pattern) inst._zod.bag.pattern = def.pattern;
     });
 
     inst._zod.check ??= (payload) => {
@@ -935,7 +943,7 @@ export const $ZodCheckIncludes: core.$constructor<$ZodCheckIncludes> = /*@__PURE
     const pattern = new RegExp(util.escapeRegex(def.includes));
     def.pattern = pattern;
     inst._zod.onattach.push((inst) => {
-      inst._zod.computed.pattern = pattern;
+      inst._zod.bag.pattern = pattern;
     });
 
     inst._zod.check = (payload) => {
@@ -977,7 +985,7 @@ export const $ZodCheckStartsWith: core.$constructor<$ZodCheckStartsWith> = /*@__
     const pattern = new RegExp(`^${util.escapeRegex(def.prefix)}.*`);
     def.pattern ??= pattern;
     inst._zod.onattach.push((inst) => {
-      inst._zod.computed.pattern = pattern;
+      inst._zod.bag.pattern = pattern;
     });
 
     inst._zod.check = (payload) => {
@@ -1019,7 +1027,7 @@ export const $ZodCheckEndsWith: core.$constructor<$ZodCheckEndsWith> = /*@__PURE
     const pattern = new RegExp(`.*${util.escapeRegex(def.suffix)}$`);
     def.pattern ??= pattern;
     inst._zod.onattach.push((inst) => {
-      inst._zod.computed.pattern = new RegExp(`.*${util.escapeRegex(def.suffix)}$`);
+      inst._zod.bag.pattern = new RegExp(`.*${util.escapeRegex(def.suffix)}$`);
     });
 
     inst._zod.check = (payload) => {
@@ -1111,7 +1119,7 @@ export const $ZodCheckMimeType: core.$constructor<$ZodCheckMimeType> = /*@__PURE
     $ZodCheck.init(inst, def);
     const mimeSet = new Set(def.mime);
     inst._zod.onattach.push((inst) => {
-      inst._zod.computed.mime = def.mime;
+      inst._zod.bag.mime = def.mime;
     });
     inst._zod.check = (payload) => {
       if (mimeSet.has(payload.value.type)) return;
diff --git a/packages/zod/src/v4/core/regexes.ts b/packages/zod/src/v4/core/regexes.ts
index e6a37994..62490d7f 100644
--- a/packages/zod/src/v4/core/regexes.ts
+++ b/packages/zod/src/v4/core/regexes.ts
@@ -113,7 +113,7 @@ export function datetime(args: {
   return new RegExp(`^${regex}$`);
 }
 
-export const string = (params?: { minimum?: number; maximum?: number }): RegExp => {
+export const string = (params?: { minimum?: number | undefined; maximum?: number | undefined }): RegExp => {
   const regex = params ? `[\\s\\S]{${params?.minimum ?? 0},${params?.maximum ?? ""}}` : `[\\s\\S]*`;
   return new RegExp(`^${regex}$`);
 };
diff --git a/packages/zod/src/v4/core/schemas.ts b/packages/zod/src/v4/core/schemas.ts
index 34acf032..d98e0dff 100644
--- a/packages/zod/src/v4/core/schemas.ts
+++ b/packages/zod/src/v4/core/schemas.ts
@@ -82,47 +82,44 @@ export interface $ZodTypeDef {
 }
 
 // @ts-ignore
+/** @internal */
 export interface $ZodTypeInternals<out O = unknown, out I = unknown> {
   /** The `@zod/core` version of this schema */
   version: typeof version;
 
-  /** Schema internals. */
+  /** Schema definition. */
   def: $ZodTypeDef;
   // types: Types;
 
-  /** Randomly generated ID for this schema. */
+  /** @internal Randomly generated ID for this schema. */
   id: string;
 
-  /** The inferred output type */
-  // "
-  // "?: any;
-  // "~input"?: any;
-  // "~types"?: any;
+  /** @internal The inferred output type */
   output: O; //extends { $out: infer O } ? O : Out;
-  /** The inferred input type */
+  /** @internal The inferred input type */
   input: I; //extends { $in: infer I } ? I : In;
 
-  /** List of deferred initializers. */
+  /** @internal List of deferred initializers. */
   deferred: util.AnyFunc[] | undefined;
 
-  /** Parses input and runs all checks (refinements). */
+  /** @internal Parses input and runs all checks (refinements). */
   run(payload: ParsePayload<any>, ctx: ParseContextInternal): util.MaybeAsync<ParsePayload>;
 
-  /** Parses input, doesn't run checks. */
+  /** @internal Parses input, doesn't run checks. */
   parse(payload: ParsePayload<any>, ctx: ParseContextInternal): util.MaybeAsync<ParsePayload>;
 
-  /** Stores identifiers for the set of traits implemented by this schema. */
+  /** @internal  Stores identifiers for the set of traits implemented by this schema. */
   traits: Set<string>;
 
-  /** Indicates that a schema output type should be considered optional inside objects.
+  /** @internal Indicates that a schema output type should be considered optional inside objects.
    * @default Required
    */
   optionality?: "optional" | "defaulted" | undefined;
 
-  /** A set of literal discriminators used for the fast path in discriminated unions. */
+  /** @internal A set of literal discriminators used for the fast path in discriminated unions. */
   disc: util.DiscriminatorMap | undefined;
 
-  /** The set of literal values that will pass validation. Must be an exhaustive set. Used to determine optionality in z.record().
+  /** @internal The set of literal values that will pass validation. Must be an exhaustive set. Used to determine optionality in z.record().
    *
    * Defined on: enum, const, literal, null, undefined
    * Passthrough: optional, nullable, branded, default, catch, pipe
@@ -130,24 +127,24 @@ export interface $ZodTypeInternals<out O = unknown, out I = unknown> {
    */
   values: util.PrimitiveSet | undefined;
 
-  /** This flag indicates that a schema validation can be represented with a regular expression. Used to determine allowable schemas in z.templateLiteral(). */
+  /** @internal This flag indicates that a schema validation can be represented with a regular expression. Used to determine allowable schemas in z.templateLiteral(). */
   pattern: RegExp | undefined;
 
-  /** The constructor function of this schema. */
+  /** @internal The constructor function of this schema. */
   constr: new (
     def: any
   ) => $ZodType;
 
-  /** A catchall object for computed metadata related to this schema. Commonly modified by checks using `onattach`. */
-  computed: Record<string, any>;
+  /** @internal A catchall object for bag metadata related to this schema. Commonly modified by checks using `onattach`. */
+  bag: Record<string, unknown>;
 
-  /** The set of issues this schema might throw during type checking. */
+  /** @internal The set of issues this schema might throw during type checking. */
   isst: errors.$ZodIssueBase;
 
   /** An optional method used to override `toJSONSchema` logic. */
   toJSONSchema?: () => object;
 
-  /** The parent of this schema. Only set during certain clone operations. */
+  /** @internal The parent of this schema. Only set during certain clone operations. */
   parent?: $ZodType | undefined;
 }
 
@@ -171,7 +168,7 @@ export const $ZodType: core.$constructor<$ZodType> = /*@__PURE__*/ core.$constru
   inst ??= {} as any;
   inst._zod.id = def.type + "_" + util.randomString(10);
   inst._zod.def = def; // set _def property
-  inst._zod.computed = inst._zod.computed || {}; // initialize _computed object
+  inst._zod.bag = inst._zod.bag || {}; // initialize _bag object
   inst._zod.version = version;
 
   const checks = [...(inst._zod.def.checks ?? [])];
@@ -289,6 +286,12 @@ export interface $ZodStringInternals<Input> extends $ZodTypeInternals<string, In
 
   /** @deprecated Internal API, use with caution (not deprecated) */
   isst: errors.$ZodIssueInvalidType;
+  bag: util.LoosePartial<{
+    minimum: number;
+    maximum: number;
+    pattern: RegExp;
+    format: string;
+  }>;
 }
 
 export interface $ZodString<Input = unknown> extends $ZodType {
@@ -297,7 +300,7 @@ export interface $ZodString<Input = unknown> extends $ZodType {
 
 export const $ZodString: core.$constructor<$ZodString> = /*@__PURE__*/ core.$constructor("$ZodString", (inst, def) => {
   $ZodType.init(inst, def);
-  inst._zod.pattern = inst?._zod.computed?.pattern ?? regexes.string(inst._zod.computed);
+  inst._zod.pattern = inst?._zod.bag?.pattern ?? regexes.string(inst._zod.bag);
   inst._zod.parse = (payload, _) => {
     if (def.coerce)
       try {
@@ -684,7 +687,7 @@ export const $ZodIPv4: core.$constructor<$ZodIPv4> = /*@__PURE__*/ core.$constru
   def.pattern ??= regexes.ipv4;
   $ZodStringFormat.init(inst, def);
   inst._zod.onattach.push((inst) => {
-    inst._zod.computed.format = `ipv4`;
+    inst._zod.bag.format = `ipv4`;
   });
 });
 
@@ -707,7 +710,7 @@ export const $ZodIPv6: core.$constructor<$ZodIPv6> = /*@__PURE__*/ core.$constru
   $ZodStringFormat.init(inst, def);
 
   inst._zod.onattach.push((inst) => {
-    inst._zod.computed.format = `ipv6`;
+    inst._zod.bag.format = `ipv6`;
   });
 
   inst._zod.check = (payload) => {
@@ -835,7 +838,7 @@ export const $ZodBase64: core.$constructor<$ZodBase64> = /*@__PURE__*/ core.$con
     $ZodStringFormat.init(inst, def);
 
     inst._zod.onattach.push((inst) => {
-      inst._zod.computed.contentEncoding = "base64";
+      inst._zod.bag.contentEncoding = "base64";
     });
 
     inst._zod.check = (payload) => {
@@ -873,7 +876,7 @@ export const $ZodBase64URL: core.$constructor<$ZodBase64URL> = /*@__PURE__*/ cor
     $ZodStringFormat.init(inst, def);
 
     inst._zod.onattach.push((inst) => {
-      inst._zod.computed.contentEncoding = "base64url";
+      inst._zod.bag.contentEncoding = "base64url";
     });
 
     inst._zod.check = (payload) => {
@@ -993,6 +996,14 @@ export interface $ZodNumberInternals<Input = unknown> extends $ZodTypeInternals<
   pattern: RegExp;
   /** @deprecated Internal API, use with caution (not deprecated) */
   isst: errors.$ZodIssueInvalidType;
+  bag: util.LoosePartial<{
+    minimum: number;
+    maximum: number;
+    exclusiveMinimum: number;
+    exclusiveMaximum: number;
+    format: string;
+    pattern: RegExp;
+  }>;
 }
 
 export interface $ZodNumber<Input = unknown> extends $ZodType {
@@ -1001,7 +1012,7 @@ export interface $ZodNumber<Input = unknown> extends $ZodType {
 
 export const $ZodNumber: core.$constructor<$ZodNumber> = /*@__PURE__*/ core.$constructor("$ZodNumber", (inst, def) => {
   $ZodType.init(inst, def);
-  inst._zod.pattern = inst._zod.computed.pattern ?? regexes.number;
+  inst._zod.pattern = inst._zod.bag.pattern ?? regexes.number;
 
   inst._zod.parse = (payload, _ctx) => {
     if (def.coerce)
@@ -1122,6 +1133,11 @@ export interface $ZodBigIntInternals<T = unknown> extends $ZodTypeInternals<bigi
   /** @internal Internal API, use with caution */
   def: $ZodBigIntDef;
   isst: errors.$ZodIssueInvalidType;
+  bag: util.LoosePartial<{
+    minimum: bigint;
+    maximum: bigint;
+    format: string;
+  }>;
 }
 
 export interface $ZodBigInt<T = unknown> extends $ZodType {
@@ -1436,6 +1452,11 @@ export interface $ZodDateDef extends $ZodTypeDef {
 export interface $ZodDateInternals<T = unknown> extends $ZodTypeInternals<Date, T> {
   def: $ZodDateDef;
   isst: errors.$ZodIssueInvalidType; // | errors.$ZodIssueInvalidDate;
+  bag: util.LoosePartial<{
+    minimum: Date;
+    maximum: Date;
+    format: string;
+  }>;
 }
 
 export interface $ZodDate<T = unknown> extends $ZodType {
@@ -1939,7 +1960,7 @@ export const $ZodUnion: core.$constructor<$ZodUnion> = /*@__PURE__*/ core.$const
     inst._zod.values = values;
   }
 
-  // computed union regex for pattern if all options have pattern
+  // bag union regex for pattern if all options have pattern
   if (def.options.every((o) => o._zod.pattern)) {
     const patterns = def.options.map((o) => o._zod.pattern);
     inst._zod.pattern = new RegExp(`^(${patterns.map((p) => util.cleanRegex(p!.source)).join("|")})$`);
@@ -3286,7 +3307,7 @@ export interface $ZodCatchDef extends $ZodTypeDef {
 }
 
 export interface $ZodCatchInternals<T extends $ZodType = $ZodType>
-  extends $ZodTypeInternals<core.output<T>, util.Loose<core.input<T>>> {
+  extends $ZodTypeInternals<core.output<T>, core.input<T> | util.Whatever> {
   def: $ZodCatchDef;
   // qin: T["_zod"]["qin"];
   // qout: T["_zod"]["qout"];
@@ -3674,6 +3695,9 @@ export interface $ZodCustomInternals<O = unknown, I = unknown>
   def: $ZodCustomDef;
   issc: errors.$ZodIssue;
   isst: never;
+  bag: util.LoosePartial<{
+    Class: typeof util.Class;
+  }>;
 }
 
 export interface $ZodCustom<O = unknown, I = unknown> extends $ZodType {
diff --git a/packages/zod/src/v4/core/to-json-schema.ts b/packages/zod/src/v4/core/to-json-schema.ts
index 97482c99..44a18be8 100644
--- a/packages/zod/src/v4/core/to-json-schema.ts
+++ b/packages/zod/src/v4/core/to-json-schema.ts
@@ -141,7 +141,7 @@ export class JSONSchemaGenerator {
         case "string": {
           const json: JSONSchema.StringSchema = _json as any;
           json.type = "string";
-          const { minimum, maximum, format, pattern, contentEncoding } = schema._zod.computed as {
+          const { minimum, maximum, format, pattern, contentEncoding } = schema._zod.bag as {
             minimum?: number;
             maximum?: number;
             format?: checks.$ZodStringFormats;
@@ -163,24 +163,28 @@ export class JSONSchemaGenerator {
         }
         case "number": {
           const json: JSONSchema.NumberSchema | JSONSchema.IntegerSchema = _json as any;
-          const { minimum, maximum, format, multipleOf, inclusive } = schema._zod.computed as {
-            minimum?: number;
-            maximum?: number;
-            format?: checks.$ZodNumberFormats;
-            multipleOf?: number;
-            inclusive?: boolean;
-          };
-          if (format?.includes("int")) json.type = "integer";
+          const { minimum, maximum, format, multipleOf, exclusiveMaximum, exclusiveMinimum } = schema._zod.bag;
+          if (typeof format === "string" && format.includes("int")) json.type = "integer";
           else json.type = "number";
 
+          if (typeof exclusiveMinimum === "number") json.exclusiveMinimum = exclusiveMinimum;
           if (typeof minimum === "number") {
-            if (inclusive) json.minimum = minimum;
-            else json.exclusiveMinimum = minimum;
+            json.minimum = minimum;
+            if (typeof exclusiveMinimum === "number") {
+              if (exclusiveMinimum >= minimum) delete json.minimum;
+              else delete json.exclusiveMinimum;
+            }
           }
+
+          if (typeof exclusiveMaximum === "number") json.exclusiveMaximum = exclusiveMaximum;
           if (typeof maximum === "number") {
-            if (inclusive) json.maximum = maximum;
-            else json.exclusiveMaximum = maximum;
+            json.maximum = maximum;
+            if (typeof exclusiveMaximum === "number") {
+              if (exclusiveMaximum <= maximum) delete json.maximum;
+              else delete json.exclusiveMaximum;
+            }
           }
+
           if (typeof multipleOf === "number") json.multipleOf = multipleOf;
 
           break;
@@ -235,12 +239,10 @@ export class JSONSchemaGenerator {
         }
         case "array": {
           const json: JSONSchema.ArraySchema = _json as any;
-          const { minimum, maximum } = schema._zod.computed as {
-            minimum?: number;
-            maximum?: number;
-          };
+          const { minimum, maximum } = schema._zod.bag;
           if (typeof minimum === "number") json.minItems = minimum;
           if (typeof maximum === "number") json.maxItems = maximum;
+
           json.type = "array";
           json.items = this.process(def.element, { ...params, path: [...params.path, "items"] });
           break;
@@ -342,7 +344,7 @@ export class JSONSchemaGenerator {
           }
 
           // length
-          const { minimum, maximum } = schema._zod.computed as {
+          const { minimum, maximum } = schema._zod.bag as {
             minimum?: number;
             maximum?: number;
           };
diff --git a/packages/zod/src/v4/core/util.ts b/packages/zod/src/v4/core/util.ts
index affb0cd1..1cbcc53d 100644
--- a/packages/zod/src/v4/core/util.ts
+++ b/packages/zod/src/v4/core/util.ts
@@ -87,7 +87,10 @@ export type MakeRequired<T, K extends keyof T> = Omit<T, K> & Required<Pick<T, K
 
 export type Exactly<T, X> = T & Record<Exclude<keyof X, keyof T>, never>;
 export type NoUndefined<T> = T extends undefined ? never : T;
-export type Loose<T> = T | {} | undefined | null;
+export type Whatever = {} | undefined | null;
+export type LoosePartial<T extends object> = InexactPartial<T> & {
+  [k: string]: unknown;
+};
 export type Mask<Keys extends PropertyKey> = { [K in Keys]?: true };
 export type Writeable<T> = { -readonly [P in keyof T]: T[P] } & {};
 export type InexactPartial<T> = {
diff --git a/play.ts b/play.ts
index 1263049d..6ccefc1b 100644
--- a/play.ts
+++ b/play.ts
@@ -2,11 +2,10 @@ import { z } from "zod/v4";
 
 z;
 
-const stringWithDefault = z
-  .pipe(
-    z.transform((v) => (v === "none" ? undefined : v)),
-    z.string()
-  )
-  .catch("default");
+const schemas = [z.number().int(), z.int(), z.int().positive(), z.int().nonnegative(), z.int().gt(0), z.int().gte(0)];
 
-stringWithDefault.parse(undefined);
+const a = z.int();
+console.dir(z.toJSONSchema(a), { depth: null });
+const b = z.int().positive();
+console.dir(b._zod.bag, { depth: null });
+console.dir(z.toJSONSchema(b), { depth: null });


Test patch:
diff --git a/packages/zod/src/v3/tests/number.test.ts b/packages/zod/src/v3/tests/number.test.ts
index 1fd9be66..db3f73b2 100644
--- a/packages/zod/src/v3/tests/number.test.ts
+++ b/packages/zod/src/v3/tests/number.test.ts
@@ -4,11 +4,11 @@ import { expect, test } from "vitest";
 import * as z from "zod/v3";
 
 const gtFive = z.number().gt(5);
-const gteFive = z.number().gte(5);
-const minFive = z.number().min(5);
-const ltFive = z.number().lt(5);
+const gteFive = z.number().gte(-5).gte(5);
+const minFive = z.number().min(0).min(5);
+const ltFive = z.number().lte(10).lt(5);
 const lteFive = z.number().lte(5);
-const maxFive = z.number().max(5);
+const maxFive = z.number().max(10).max(5);
 const intNum = z.number().int();
 const positive = z.number().positive();
 const negative = z.number().negative();
diff --git a/packages/zod/src/v4/classic/tests/catch.test.ts b/packages/zod/src/v4/classic/tests/catch.test.ts
index efcfd3fc..f613d4cd 100644
--- a/packages/zod/src/v4/classic/tests/catch.test.ts
+++ b/packages/zod/src/v4/classic/tests/catch.test.ts
@@ -45,7 +45,7 @@ test("catch with transform", () => {
   expect(stringWithDefault.unwrap().out).toBeInstanceOf(z.ZodTransform);
 
   type inp = z.input<typeof stringWithDefault>;
-  expectTypeOf<inp>().toEqualTypeOf<util.Loose<string>>();
+  expectTypeOf<inp>().toEqualTypeOf<string | util.Whatever>();
   type out = z.output<typeof stringWithDefault>;
   expectTypeOf<out>().toEqualTypeOf<string>();
 });
@@ -59,7 +59,7 @@ test("catch on existing optional", () => {
   expect(stringWithDefault.unwrap().unwrap()).toBeInstanceOf(z.ZodString);
 
   type inp = z.input<typeof stringWithDefault>;
-  expectTypeOf<inp>().toEqualTypeOf<util.Loose<string | undefined>>();
+  expectTypeOf<inp>().toEqualTypeOf<string | undefined | util.Whatever>();
   type out = z.output<typeof stringWithDefault>;
   expectTypeOf<out>().toEqualTypeOf<string | undefined>();
 });
@@ -68,7 +68,7 @@ test("optional on catch", () => {
   const stringWithDefault = z.string().catch("asdf").optional();
 
   type inp = z.input<typeof stringWithDefault>;
-  expectTypeOf<inp>().toEqualTypeOf<util.Loose<string | undefined>>();
+  expectTypeOf<inp>().toEqualTypeOf<string | util.Whatever>();
   type out = z.output<typeof stringWithDefault>;
   expectTypeOf<out>().toEqualTypeOf<string | undefined>();
 });
@@ -102,7 +102,7 @@ test("nested", () => {
     inner: "asdf",
   });
   type input = z.input<typeof outer>;
-  expectTypeOf<input>().toEqualTypeOf<util.Loose<{ inner: util.Loose<string> }>>();
+  expectTypeOf<input>().toEqualTypeOf<{ inner: string | util.Whatever } | util.Whatever>();
   type out = z.output<typeof outer>;
 
   expectTypeOf<out>().toEqualTypeOf<{ inner: string }>();
diff --git a/packages/zod/src/v4/classic/tests/json-schema.test.ts b/packages/zod/src/v4/classic/tests/json-schema.test.ts
index 9786d948..9d01baef 100644
--- a/packages/zod/src/v4/classic/tests/json-schema.test.ts
+++ b/packages/zod/src/v4/classic/tests/json-schema.test.ts
@@ -329,6 +329,80 @@ describe("toJSONSchema", () => {
       }
     `
     );
+
+    expect(toJSONSchema(z.number().gt(5).gt(10))).toMatchInlineSnapshot(`
+      {
+        "exclusiveMinimum": 10,
+        "type": "number",
+      }
+    `);
+
+    expect(toJSONSchema(z.number().gt(5).gte(10))).toMatchInlineSnapshot(`
+      {
+        "minimum": 10,
+        "type": "number",
+      }
+    `);
+
+    expect(toJSONSchema(z.number().lt(5).lt(3))).toMatchInlineSnapshot(`
+      {
+        "exclusiveMaximum": 3,
+        "type": "number",
+      }
+    `);
+
+    expect(toJSONSchema(z.number().lt(5).lt(3).lte(2))).toMatchInlineSnapshot(`
+      {
+        "maximum": 2,
+        "type": "number",
+      }
+    `);
+
+    expect(toJSONSchema(z.number().lt(5).lte(3))).toMatchInlineSnapshot(`
+      {
+        "maximum": 3,
+        "type": "number",
+      }
+    `);
+
+    expect(toJSONSchema(z.number().gt(5).lt(10))).toMatchInlineSnapshot(`
+      {
+        "exclusiveMaximum": 10,
+        "exclusiveMinimum": 5,
+        "type": "number",
+      }
+    `);
+    expect(toJSONSchema(z.number().gte(5).lte(10))).toMatchInlineSnapshot(`
+      {
+        "maximum": 10,
+        "minimum": 5,
+        "type": "number",
+      }
+    `);
+    expect(toJSONSchema(z.number().positive())).toMatchInlineSnapshot(`
+      {
+        "exclusiveMinimum": 0,
+        "type": "number",
+      }
+    `);
+    expect(toJSONSchema(z.number().negative())).toMatchInlineSnapshot(`
+      {
+        "exclusiveMaximum": 0,
+        "type": "number",
+      }
+    `);
+    expect(toJSONSchema(z.number().nonpositive())).toMatchInlineSnapshot(`
+      {
+        "maximum": 0,
+        "type": "number",
+      }
+    `);
+    expect(toJSONSchema(z.number().nonnegative())).toMatchInlineSnapshot(`
+      {
+        "minimum": 0,
+        "type": "number",
+      }
+    `);
   });
 
   test("arrays", () => {
@@ -1544,3 +1618,51 @@ test("override with refs", () => {
     }
   `);
 });
+
+// test("number checks", () => {
+//   expect(z.toJSONSchema(z.number().int())).toMatchInlineSnapshot(`
+//     {
+//       "maximum": 9007199254740991,
+//       "minimum": -9007199254740991,
+//       "type": "integer",
+//     }
+//   `);
+//   expect(z.toJSONSchema(z.int())).toMatchInlineSnapshot(`
+//     {
+//       "maximum": 9007199254740991,
+//       "minimum": -9007199254740991,
+//       "type": "integer",
+//     }
+//   `);
+//   expect(z.toJSONSchema(z.int().positive())).toMatchInlineSnapshot(`
+//     {
+//       "exclusiveMinimum": 0,
+//       "maximum": 9007199254740991,
+//       "minimum": -9007199254740991,
+//       "type": "integer",
+//     }
+//   `);
+//   expect(z.toJSONSchema(z.int().nonnegative())).toMatchInlineSnapshot(`
+//     {
+//       "maximum": 9007199254740991,
+//       "minimum": 0,
+//       "type": "integer",
+//     }
+//   `);
+//   expect(z.toJSONSchema(z.int().gt(0))).toMatchInlineSnapshot(`
+//     {
+//       "exclusiveMinimum": 0,
+//       "maximum": 9007199254740991,
+//       "minimum": -9007199254740991,
+//       "type": "integer",
+//     }
+//   `);
+//   expect(z.toJSONSchema(z.int().gte(0))).toMatchInlineSnapshot(`
+//     {
+//       "maximum": 9007199254740991,
+//       "minimum": 0,
+//       "type": "integer",
+//     }
+//   `);
+
+// });
diff --git a/packages/zod/src/v4/classic/tests/number.test.ts b/packages/zod/src/v4/classic/tests/number.test.ts
index 51262a7d..1e9fda71 100644
--- a/packages/zod/src/v4/classic/tests/number.test.ts
+++ b/packages/zod/src/v4/classic/tests/number.test.ts
@@ -49,37 +49,37 @@ test("Infinity validation", () => {
 });
 
 test(".gt() validation", () => {
-  const schema = z.number().gt(5);
+  const schema = z.number().gt(0).gt(5);
   expect(schema.parse(6)).toEqual(6);
   expect(() => schema.parse(5)).toThrow();
 });
 
 test(".gte() validation", () => {
-  const schema = z.number().gte(5);
+  const schema = z.number().gt(0).gte(1).gte(5);
   expect(schema.parse(5)).toEqual(5);
   expect(() => schema.parse(4)).toThrow();
 });
 
 test(".min() validation", () => {
-  const schema = z.number().min(5);
+  const schema = z.number().min(0).min(5);
   expect(schema.parse(5)).toEqual(5);
   expect(() => schema.parse(4)).toThrow();
 });
 
 test(".lt() validation", () => {
-  const schema = z.number().lt(5);
+  const schema = z.number().lte(10).lt(5);
   expect(schema.parse(4)).toEqual(4);
   expect(() => schema.parse(5)).toThrow();
 });
 
 test(".lte() validation", () => {
-  const schema = z.number().lte(5);
+  const schema = z.number().lte(10).lte(5);
   expect(schema.parse(5)).toEqual(5);
   expect(() => schema.parse(6)).toThrow();
 });
 
 test(".max() validation", () => {
-  const schema = z.number().max(5);
+  const schema = z.number().max(10).max(5);
   expect(schema.parse(5)).toEqual(5);
   expect(() => schema.parse(6)).toThrow();
 });
diff --git a/packages/zod/src/v4/mini/tests/computed.test.ts b/packages/zod/src/v4/mini/tests/computed.test.ts
index f58aec46..fed0c3a6 100644
--- a/packages/zod/src/v4/mini/tests/computed.test.ts
+++ b/packages/zod/src/v4/mini/tests/computed.test.ts
@@ -5,32 +5,32 @@ import { util as zc } from "zod/v4/core";
 test("min/max", () => {
   const a = z.number().check(z.minimum(5), z.minimum(6), z.minimum(7), z.maximum(10), z.maximum(11), z.maximum(12));
 
-  expect(a._zod.computed.minimum).toEqual(7);
-  expect(a._zod.computed.maximum).toEqual(10);
+  expect(a._zod.bag.minimum).toEqual(7);
+  expect(a._zod.bag.maximum).toEqual(10);
 });
 
 test("multipleOf", () => {
   const b = z.number().check(z.multipleOf(5));
-  expect(b._zod.computed.multipleOf).toEqual(5);
+  expect(b._zod.bag.multipleOf).toEqual(5);
 });
 
 test("int64 format", () => {
   const c = z.int64();
-  expect(c._zod.computed.format).toEqual("int64");
-  expect(c._zod.computed.minimum).toEqual(zc.BIGINT_FORMAT_RANGES.int64[0]);
-  expect(c._zod.computed.maximum).toEqual(zc.BIGINT_FORMAT_RANGES.int64[1]);
+  expect(c._zod.bag.format).toEqual("int64");
+  expect(c._zod.bag.minimum).toEqual(zc.BIGINT_FORMAT_RANGES.int64[0]);
+  expect(c._zod.bag.maximum).toEqual(zc.BIGINT_FORMAT_RANGES.int64[1]);
 });
 
 test("int32 format", () => {
   const d = z.int32();
-  expect(d._zod.computed.format).toEqual("int32");
-  expect(d._zod.computed.minimum).toEqual(zc.NUMBER_FORMAT_RANGES.int32[0]);
-  expect(d._zod.computed.maximum).toEqual(zc.NUMBER_FORMAT_RANGES.int32[1]);
+  expect(d._zod.bag.format).toEqual("int32");
+  expect(d._zod.bag.minimum).toEqual(zc.NUMBER_FORMAT_RANGES.int32[0]);
+  expect(d._zod.bag.maximum).toEqual(zc.NUMBER_FORMAT_RANGES.int32[1]);
 });
 
 test("array size", () => {
   const e = z.array(z.string()).check(z.length(5));
-  expect(e._zod.computed.length).toEqual(5);
-  expect(e._zod.computed.minimum).toEqual(5);
-  expect(e._zod.computed.maximum).toEqual(5);
+  expect(e._zod.bag.length).toEqual(5);
+  expect(e._zod.bag.minimum).toEqual(5);
+  expect(e._zod.bag.maximum).toEqual(5);
 });