{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/agentstack-tech/json-schema/agentstack-tech-content-metadata-patch-schema.json",
  "title": "ContentMetadataPatch",
  "x-generated": "2026-11-01",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/agentstack-tech-openapi.json#/components/schemas/ContentMetadataPatch",
  "properties": {
    "access_tier": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Access Tier"
    },
    "title": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Title"
    },
    "content_type": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Content Type"
    },
    "source_url": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Source Url"
    },
    "status": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Status"
    },
    "product_ids": {
      "anyOf": [
        {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Product Ids"
    },
    "audience": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Audience"
    },
    "contraindications": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Contraindications"
    },
    "text": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 200000,
          "minLength": 1
        },
        {
          "type": "null"
        }
      ],
      "title": "Text"
    },
    "gene_stems": {
      "anyOf": [
        {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Gene Stems"
    },
    "write_mode": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Write Mode",
      "description": "search_replace|unified_diff preferred for a known phrase; append|prepend add; replace|write is the full body; patch/merge is metadata-only"
    },
    "replacements": {
      "anyOf": [
        {
          "items": {
            "additionalProperties": true,
            "type": "object"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Replacements",
      "description": "search_replace pairs [{\"find\",\"replace\"}]. No prior GET."
    },
    "unified_diff": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Unified Diff",
      "description": "Unified diff against the stored body. Fuzzy unless strict_diff."
    },
    "strict_diff": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "title": "Strict Diff"
    },
    "allow_shrink": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "title": "Allow Shrink",
      "description": "Required when replacing a long document with a much shorter body"
    },
    "dry_run": {
      "type": "boolean",
      "title": "Dry Run",
      "description": "Preview body edit without re-embed; returns previous_sha256 + leaf_sha256.",
      "default": false
    },
    "expected_sha256": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Expected Sha256",
      "description": "CAS on joined document body; use previous_sha256 from dry_run on commit."
    }
  },
  "type": "object"
}