{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/agenticfabricationnetwork-ai/json-schema/agenticfabricationnetwork-ai-constraints-schema.json",
  "title": "Constraints",
  "x-generated": "2026-11-01",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/agenticfabricationnetwork-ai-openapi.json#/components/schemas/Constraints",
  "type": "object",
  "properties": {
    "ship_to_zip": {
      "type": "string",
      "description": "Destination US ZIP code. Omit if the buyer never stated one — the network stamps its assumed central-US destination (prices stay all-in with shipping) and declares it (routing.ship_to_zip + routing.ship_to { zip, assumed: true })"
    },
    "ship_to_country": {
      "type": "string",
      "default": "US"
    },
    "deadline": {
      "type": [
        "string",
        "null"
      ],
      "format": "date",
      "description": "Latest acceptable delivery date; offers that miss it (and nothing else) move to near_misses with their real ETA — never into offers[]. On refine, explicit null CLEARS an inherited deadline (near-misses convert back); omission inherits it"
    },
    "processes": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "string",
        "enum": [
          "fdm_print",
          "resin_print",
          "powder_print",
          "metal_print",
          "elastomer_print",
          "cnc",
          "sheetmetal",
          "laser_cut",
          "decal",
          "print",
          "apparel"
        ]
      },
      "minItems": 1,
      "description": "Process-lane filter: quote ONLY these processes (intersected with routing candidates). Absent = no filter; on refine the child inherits the parent's filter, and an explicit null CLEARS an inherited filter (\"show everything again\"). Narrowing by process is a constraint, never a fresh quote — warm vendor sessions survive it."
    },
    "outdoor_rated": {
      "type": [
        "boolean",
        "null"
      ]
    },
    "submersible": {
      "type": [
        "boolean",
        "null"
      ]
    },
    "high_temp": {
      "type": [
        "boolean",
        "null"
      ],
      "description": "Must tolerate sustained heat (vendor heat-resistance claim)"
    },
    "food_safe": {
      "type": [
        "boolean",
        "null"
      ],
      "description": "Must be vendor-certified food safe"
    },
    "max_budget_cents": {
      "type": [
        "integer",
        "null"
      ],
      "description": "All-in budget cap, USD cents. On refine, explicit null CLEARS an inherited cap"
    },
    "requirements": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 120
      },
      "maxItems": 20,
      "description": "Catch-all requirements channel: verbatim terms from the buyer's conversation (\"UV resistant\", \"anodized: red\", \"iso 13485\", \"tolerance: 0.1mm\"). Each term resolves deterministically — applied terms affect offers, unresolved terms come back in the quote's notes and are logged as demand for vendor sourcing. Terms never override explicit spec/constraint fields and are never an error; there is no wrong place to put a term."
    },
    "callouts": {
      "type": "array",
      "maxItems": 50,
      "items": {
        "type": "object",
        "required": [
          "name",
          "value",
          "unit"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "What the dimension is, in the agent's words (\"hole_diameter\")"
          },
          "value": {
            "type": "number"
          },
          "unit": {
            "type": "string",
            "enum": [
              "mm",
              "in"
            ]
          },
          "tolerance_mm": {
            "type": "number",
            "description": "Required tolerance for this dimension, in mm (±)"
          },
          "critical": {
            "type": "boolean",
            "description": "Marked critical on the drawing (inspection-worthy)"
          },
          "note": {
            "type": "string",
            "maxLength": 200
          }
        }
      },
      "description": "Drawing callouts the buyer's agent extracted — dimensions that matter. The tightest tolerance_mm prunes vendors whose published tolerance claim cannot hold it; vendors with no tolerance claim on record are excluded when a tolerance is demanded."
    },
    "reliability": {
      "type": [
        "object",
        "null"
      ],
      "description": "Vendor-reliability floor — narrows to vendors with a demonstrated track record. Like every constraint it narrows, never widens — except explicit null on a refine, which CLEARS the whole inherited floor.",
      "properties": {
        "min_stars": {
          "type": "number",
          "minimum": 1,
          "maximum": 5,
          "description": "Only vendors whose displayed rating is at least this — vendors with no reviews yet are excluded"
        },
        "min_reviews": {
          "type": "integer",
          "minimum": 1,
          "description": "Only vendors with at least this many verified-purchase reviews"
        },
        "proven_spec_orders": {
          "type": "integer",
          "minimum": 1,
          "description": "Only vendors with at least N completed orders for this exact process+material — \"a vendor that prints PC reliably\""
        }
      }
    }
  }
}