{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/antfly/json-schema/antfly-entity-curation-result-schema.json",
  "title": "EntityCurationResult",
  "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/EntityCurationResult",
  "type": "object",
  "required": [
    "entity_table",
    "key",
    "complete",
    "atomicity",
    "results"
  ],
  "properties": {
    "entity_table": {
      "type": "string"
    },
    "key": {
      "type": "string"
    },
    "complete": {
      "type": "boolean"
    },
    "atomicity": {
      "type": "string",
      "enum": [
        "namespace",
        "source_table",
        "resolver"
      ],
      "description": "Entity corrections commit atomically across matching namespaces on the destination table; replay is asynchronous. Other atomicity values identify the scope guaranteed by the responding adapter."
    },
    "applied": {
      "type": "boolean",
      "description": "True only when replay completion was observed for all consumers, or no consumers exist. Admission without wait is conservative."
    },
    "progress_url": {
      "type": "string",
      "format": "uri-reference",
      "description": "Native HTTP mutations return this progress resource relative to the request URI. Follow its bounded pages for individual consumer proofs."
    },
    "namespaces": {
      "type": "array",
      "description": "Mutation outcomes, stored once per namespace. Read absorbed keys and dispositions here; consumer progress rows reference these by key_template. The results array is reserved for inspection and embedded consumer summaries.",
      "items": {
        "$ref": "#/$defs/EntityNamespaceOutcome"
      }
    },
    "results": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "source_table",
          "resolver"
        ],
        "properties": {
          "source_table": {
            "type": "string"
          },
          "resolver": {
            "type": "string"
          },
          "key_template": {
            "type": "string"
          },
          "canonical_key": {
            "type": "string"
          },
          "curation": {
            "type": "object",
            "additionalProperties": true
          },
          "revision": {
            "type": "integer",
            "format": "uint64"
          },
          "changed": {
            "type": "boolean"
          },
          "replay_sequence": {
            "type": "integer",
            "format": "uint64"
          },
          "applied": {
            "type": "boolean"
          },
          "retired": {
            "type": "boolean"
          },
          "error": {
            "type": "string"
          },
          "redirects": {
            "type": "array",
            "items": {
              "$ref": "#/$defs/ResolverRedirect"
            }
          },
          "distinct": {
            "type": "array",
            "items": {
              "$ref": "#/$defs/ResolverDistinctPair"
            }
          },
          "configured_suppressed": {
            "type": "boolean"
          },
          "runtime_suppressed": {
            "type": "boolean"
          }
        }
      }
    }
  },
  "$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"
          ]
        }
      }
    },
    "EntityNamespaceOutcome": {
      "type": "object",
      "required": [
        "key_template",
        "revision",
        "changed",
        "absorbed"
      ],
      "properties": {
        "key_template": {
          "type": "string"
        },
        "revision": {
          "type": "integer",
          "format": "uint64"
        },
        "changed": {
          "type": "boolean"
        },
        "absorbed": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "key",
              "disposition"
            ],
            "properties": {
              "key": {
                "type": "string"
              },
              "disposition": {
                "type": "string",
                "enum": [
                  "release",
                  "suppress"
                ]
              }
            }
          }
        }
      }
    },
    "ResolverDistinctPair": {
      "type": "object",
      "required": [
        "from",
        "to"
      ],
      "properties": {
        "from": {
          "type": "string"
        },
        "to": {
          "type": "string"
        },
        "origin": {
          "$ref": "#/$defs/CurationOrigin"
        }
      }
    },
    "ResolverRedirect": {
      "type": "object",
      "required": [
        "key",
        "target"
      ],
      "properties": {
        "key": {
          "type": "string"
        },
        "target": {
          "type": "string"
        },
        "origin": {
          "$ref": "#/$defs/CurationOrigin"
        }
      }
    }
  }
}