{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/antfly/json-schema/antfly-resolver-namespace-request-schema.json",
  "title": "ResolverNamespaceRequest",
  "description": "Explicit namespace migration. Choose reset_merges=true or a complete key_map. Runtime suppressions and distinct pins must be remapped too, or explicitly reset with reset_curation=true.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/antfly-resolver-curation-api-openapi.yml#/components/schemas/ResolverNamespaceRequest",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "table",
    "key_template"
  ],
  "properties": {
    "table": {
      "type": "string"
    },
    "key_template": {
      "type": "string"
    },
    "reset_merges": {
      "type": "boolean",
      "default": false
    },
    "reset_curation": {
      "type": "boolean",
      "default": false
    },
    "key_map": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ResolverRedirect"
      }
    },
    "aliases": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ResolverRedirect"
      }
    },
    "expected_revision": {
      "type": "integer",
      "format": "uint64",
      "minimum": 0,
      "x-go-type-skip-optional-pointer": false,
      "description": "Optional revision fence. Explicit zero fences the first edit; omission disables the fence."
    },
    "wait": {
      "$ref": "#/$defs/ResolverWait"
    }
  },
  "$defs": {
    "CurationOrigin": {
      "type": "object",
      "description": "Server-owned provenance. Clients supply actor and reason on writes. Zero time/revision denote legacy records whose creation is unknown.",
      "properties": {
        "origin": {
          "type": "string",
          "enum": [
            "manual",
            "adjudicator",
            "review",
            "cascade",
            "config"
          ]
        },
        "actor": {
          "type": "string",
          "maxLength": 256,
          "description": "UTF-8 client attribution, limited to 256 bytes."
        },
        "reason": {
          "type": "string",
          "maxLength": 4096,
          "description": "UTF-8 explanation, limited to 4096 bytes."
        },
        "created_at_ms": {
          "type": "integer",
          "format": "uint64"
        },
        "revision": {
          "type": "integer",
          "format": "uint64"
        },
        "proposal_id": {
          "type": [
            "string",
            "null"
          ]
        },
        "cascade_from": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "ResolverRedirect": {
      "type": "object",
      "required": [
        "key",
        "target"
      ],
      "properties": {
        "key": {
          "type": "string"
        },
        "target": {
          "type": "string"
        },
        "origin": {
          "$ref": "#/$defs/CurationOrigin"
        }
      }
    },
    "ResolverWait": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "timeout_ms": {
          "type": "integer",
          "format": "uint32",
          "minimum": 1,
          "maximum": 300000,
          "default": 1000
        }
      },
      "description": "Wait for observed replay completion up to this timeout. A timeout returns accepted state with applied=false; it does not undo the mutation."
    }
  }
}