ContractCases: contract

Created by: AgentToolbox (first-party).
Version: 0.1.1. Beta.

Generate checked boundary and negative cases for supported JSON Schemas.

Scope: Accepted JSON Schema subset · valid seed required · bounded coverage

Cost: from $0.01 USDC per published success; buyer-chosen amount, USDC on Base.
Success: At least one valid boundary case and one negative case failing exactly its intended keyword and instance; every case revalidated against the complete accepted schema. Coverage gaps explicit; not certification.
Failure policy: Invalid input, failed criterion or unavailable decisive evidence never settles. Uncertain settlement requires reconciliation; never issue a replacement authorization.

Canonical contract JSON · Buyer guide

Input schema

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "schema": {
      "type": "object",
      "propertyNames": {
        "type": "string"
      },
      "additionalProperties": {},
      "description": "Explicit $schema=https://json-schema.org/draft/2020-12/schema required. Bounded subset; every schema node needs a single type. No references, patterns, formats or composition."
    },
    "valid_example": {},
    "max_cases": {
      "default": 12,
      "type": "integer",
      "minimum": 2,
      "maximum": 24
    }
  },
  "required": [
    "schema",
    "valid_example",
    "max_cases"
  ],
  "additionalProperties": false
}
```

Output schema

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "tool": {
      "type": "string",
      "const": "contract-cases"
    },
    "version": {
      "type": "string",
      "const": "0.1.1"
    },
    "schema_sha256": {
      "type": "string",
      "pattern": "^[a-f0-9]{64}$"
    },
    "seed_valid": {
      "type": "boolean",
      "const": true
    },
    "validator": {
      "type": "string",
      "const": "AgentToolbox bounded JSON Schema 2020-12 subset"
    },
    "source_content": {
      "type": "string",
      "const": "untrusted_data"
    },
    "cases": {
      "minItems": 2,
      "maxItems": 24,
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "maxLength": 12
          },
          "kind": {
            "type": "string",
            "enum": [
              "positive_boundary",
              "negative_mutation"
            ]
          },
          "instance_pointer": {
            "type": "string",
            "maxLength": 2048
          },
          "schema_pointer": {
            "type": "string",
            "maxLength": 2048
          },
          "keyword": {
            "type": "string",
            "maxLength": 32
          },
          "value": {},
          "expected_verdict": {
            "type": "string",
            "enum": [
              "valid",
              "invalid"
            ]
          },
          "validation": {
            "type": "object",
            "properties": {
              "valid": {
                "type": "boolean"
              },
              "checked_assertions": {
                "type": "integer",
                "exclusiveMinimum": 0,
                "maximum": 9007199254740991
              },
              "errors": {
                "maxItems": 1,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "instance_pointer": {
                      "type": "string",
                      "maxLength": 2048
                    },
                    "schema_pointer": {
                      "type": "string",
                      "maxLength": 2048
                    },
                    "keyword": {
                      "type": "string",
                      "maxLength": 32
                    }
                  },
                  "required": [
                    "instance_pointer",
                    "schema_pointer",
                    "keyword"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "required": [
              "valid",
              "checked_assertions",
              "errors"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "id",
          "kind",
          "instance_pointer",
          "schema_pointer",
          "keyword",
          "value",
          "expected_verdict",
          "validation"
        ],
        "additionalProperties": false
      }
    },
    "summary": {
      "type": "object",
      "properties": {
        "positive_cases": {
          "type": "integer",
          "exclusiveMinimum": 0,
          "maximum": 9007199254740991
        },
        "negative_cases": {
          "type": "integer",
          "exclusiveMinimum": 0,
          "maximum": 9007199254740991
        },
        "candidates_checked": {
          "type": "integer",
          "minimum": 1,
          "maximum": 160
        },
        "omitted_candidates": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "generation_capped": {
          "type": "boolean"
        },
        "coverage_gaps": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        }
      },
      "required": [
        "positive_cases",
        "negative_cases",
        "candidates_checked",
        "omitted_candidates",
        "generation_capped",
        "coverage_gaps"
      ],
      "additionalProperties": false
    },
    "coverage_gaps": {
      "maxItems": 12,
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "instance_pointer": {
            "type": "string"
          },
          "schema_pointer": {
            "type": "string"
          },
          "keyword": {
            "type": "string"
          },
          "reason": {
            "type": "string",
            "enum": [
              "coupled_constraints",
              "no_isolated_candidate",
              "case_or_byte_budget",
              "optional_property_not_in_example",
              "candidate_budget"
            ]
          }
        },
        "required": [
          "instance_pointer",
          "schema_pointer",
          "keyword",
          "reason"
        ],
        "additionalProperties": false
      }
    },
    "coverage_gaps_omitted": {
      "type": "integer",
      "minimum": 0,
      "maximum": 9007199254740991
    },
    "coverage": {
      "type": "string",
      "const": "Selected boundary witnesses only; not exhaustive, not a proof of schema or implementation correctness."
    }
  },
  "required": [
    "tool",
    "version",
    "schema_sha256",
    "seed_valid",
    "validator",
    "source_content",
    "cases",
    "summary",
    "coverage_gaps",
    "coverage_gaps_omitted",
    "coverage"
  ],
  "additionalProperties": false
}
```

Limits

```json
{
  "schema_bytes": 8192,
  "seed_bytes": 2048,
  "schema_nodes": 64,
  "schema_depth": 3,
  "properties_per_object": 25,
  "total_properties": 25,
  "array_items": 16,
  "string_length": 128,
  "instance_nodes": 128,
  "instance_depth": 8,
  "number_magnitude": 1000000000,
  "candidates": 160,
  "cases": 24,
  "output_bytes": 14000,
  "subset": {
    "dialect": "2020-12 bounded subset",
    "types": [
      "object",
      "array",
      "string",
      "number",
      "integer",
      "boolean",
      "null"
    ],
    "keywords": [
      "type",
      "enum",
      "const",
      "properties",
      "required",
      "additionalProperties",
      "items",
      "minItems",
      "maxItems",
      "minLength",
      "maxLength",
      "minimum",
      "maximum",
      "exclusiveMinimum",
      "exclusiveMaximum"
    ],
    "annotations": [
      "$schema",
      "title",
      "description"
    ],
    "unsupported": [
      "references",
      "composition",
      "type unions",
      "boolean schemas",
      "pattern",
      "format",
      "multipleOf",
      "unevaluated keywords",
      "remote resources"
    ]
  }
}
```