{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/zero-slop-ai/json-schema/zero-slop-ai-deslop-result-schema.json",
  "title": "DeslopResult",
  "x-generated": "2026-11-29",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/zero-slop-ai-openapi.json#/components/schemas/DeslopResult",
  "type": "object",
  "properties": {
    "text": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "rewritten",
        "rewritten_with_warnings",
        "already_clear",
        "unchanged_no_better_version",
        "unchanged_verification_failed",
        "unchanged_service_unavailable"
      ]
    },
    "before": {
      "type": "object",
      "properties": {
        "score": {
          "type": "number",
          "minimum": 0,
          "maximum": 100
        },
        "band": {
          "type": "string",
          "minLength": 1,
          "maxLength": 80
        },
        "words": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "sentences": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "flaggedPhrases": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "sentenceVariety": {
          "type": "string",
          "enum": [
            "natural",
            "too even"
          ]
        },
        "readability": {
          "type": "string",
          "enum": [
            "clear",
            "needs work"
          ]
        },
        "punctuation": {
          "type": "object",
          "properties": {
            "dashes": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "emoji": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "hashtags": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            }
          },
          "required": [
            "dashes",
            "emoji",
            "hashtags"
          ],
          "additionalProperties": false
        },
        "highWeightFlags": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "shape": {
          "type": "object",
          "properties": {
            "measured": {
              "type": "boolean"
            },
            "broetry": {
              "type": "boolean"
            },
            "oneSentenceParagraphShare": {
              "anyOf": [
                {
                  "type": "number",
                  "minimum": 0,
                  "maximum": 1
                },
                {
                  "type": "null"
                }
              ]
            },
            "longestFragmentRun": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "required": [
            "measured",
            "broetry",
            "oneSentenceParagraphShare",
            "longestFragmentRun"
          ],
          "additionalProperties": false
        },
        "register": {
          "type": "object",
          "properties": {
            "measured": {
              "type": "boolean"
            },
            "words": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "checked": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "findings": {
              "maxItems": 1000,
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "maxLength": 160
                  },
                  "rate": {
                    "type": "number",
                    "minimum": 0
                  },
                  "budget": {
                    "type": "number",
                    "minimum": 0
                  },
                  "found": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "quote": {
                    "type": "string",
                    "maxLength": 1000
                  }
                },
                "required": [
                  "name",
                  "rate",
                  "budget",
                  "found",
                  "quote"
                ],
                "additionalProperties": false
              }
            },
            "twoPartContrasts": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "announcements": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            }
          },
          "required": [
            "measured",
            "words",
            "checked",
            "findings",
            "twoPartContrasts",
            "announcements"
          ],
          "additionalProperties": false
        },
        "flags": {
          "maxItems": 5000,
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "phrase": {
                "type": "string",
                "maxLength": 1000
              },
              "strength": {
                "type": "number",
                "minimum": 0
              },
              "issue": {
                "type": "string",
                "maxLength": 2000
              },
              "direction": {
                "type": "string",
                "maxLength": 2000
              }
            },
            "required": [
              "phrase",
              "strength",
              "issue",
              "direction"
            ],
            "additionalProperties": false
          }
        }
      },
      "required": [
        "score",
        "band",
        "words",
        "sentences",
        "flaggedPhrases",
        "sentenceVariety",
        "readability",
        "punctuation",
        "highWeightFlags",
        "shape",
        "register",
        "flags"
      ],
      "additionalProperties": {}
    },
    "after": {
      "type": "object",
      "properties": {
        "score": {
          "type": "number",
          "minimum": 0,
          "maximum": 100
        },
        "band": {
          "type": "string",
          "minLength": 1,
          "maxLength": 80
        },
        "words": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "sentences": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "flaggedPhrases": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "sentenceVariety": {
          "type": "string",
          "enum": [
            "natural",
            "too even"
          ]
        },
        "readability": {
          "type": "string",
          "enum": [
            "clear",
            "needs work"
          ]
        },
        "punctuation": {
          "type": "object",
          "properties": {
            "dashes": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "emoji": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "hashtags": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            }
          },
          "required": [
            "dashes",
            "emoji",
            "hashtags"
          ],
          "additionalProperties": false
        },
        "highWeightFlags": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "shape": {
          "type": "object",
          "properties": {
            "measured": {
              "type": "boolean"
            },
            "broetry": {
              "type": "boolean"
            },
            "oneSentenceParagraphShare": {
              "anyOf": [
                {
                  "type": "number",
                  "minimum": 0,
                  "maximum": 1
                },
                {
                  "type": "null"
                }
              ]
            },
            "longestFragmentRun": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "required": [
            "measured",
            "broetry",
            "oneSentenceParagraphShare",
            "longestFragmentRun"
          ],
          "additionalProperties": false
        },
        "register": {
          "type": "object",
          "properties": {
            "measured": {
              "type": "boolean"
            },
            "words": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "checked": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "findings": {
              "maxItems": 1000,
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "maxLength": 160
                  },
                  "rate": {
                    "type": "number",
                    "minimum": 0
                  },
                  "budget": {
                    "type": "number",
                    "minimum": 0
                  },
                  "found": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "quote": {
                    "type": "string",
                    "maxLength": 1000
                  }
                },
                "required": [
                  "name",
                  "rate",
                  "budget",
                  "found",
                  "quote"
                ],
                "additionalProperties": false
              }
            },
            "twoPartContrasts": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "announcements": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            }
          },
          "required": [
            "measured",
            "words",
            "checked",
            "findings",
            "twoPartContrasts",
            "announcements"
          ],
          "additionalProperties": false
        },
        "flags": {
          "maxItems": 5000,
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "phrase": {
                "type": "string",
                "maxLength": 1000
              },
              "strength": {
                "type": "number",
                "minimum": 0
              },
              "issue": {
                "type": "string",
                "maxLength": 2000
              },
              "direction": {
                "type": "string",
                "maxLength": 2000
              }
            },
            "required": [
              "phrase",
              "strength",
              "issue",
              "direction"
            ],
            "additionalProperties": false
          }
        }
      },
      "required": [
        "score",
        "band",
        "words",
        "sentences",
        "flaggedPhrases",
        "sentenceVariety",
        "readability",
        "punctuation",
        "highWeightFlags",
        "shape",
        "register",
        "flags"
      ],
      "additionalProperties": {}
    },
    "scoreChange": {
      "type": "number",
      "minimum": -100,
      "maximum": 100
    },
    "factsPreserved": {
      "type": "boolean"
    },
    "passedFinalChecks": {
      "type": "boolean"
    },
    "independentModelChecks": {
      "type": "integer",
      "minimum": 0,
      "maximum": 9007199254740991
    },
    "modelRequests": {
      "type": "integer",
      "minimum": 0,
      "maximum": 2
    },
    "rolesCompleted": {
      "type": "integer",
      "minimum": 0,
      "maximum": 9007199254740991
    },
    "finishingRounds": {
      "type": "integer",
      "minimum": 0,
      "maximum": 9007199254740991
    },
    "scorerVersion": {
      "type": "string"
    },
    "durationMs": {
      "type": "integer",
      "minimum": 0,
      "maximum": 9007199254740991
    },
    "note": {
      "type": "string"
    },
    "editorDiagnostics": {
      "type": "object",
      "properties": {
        "endpointHttpStatus": {
          "type": "integer",
          "minimum": 100,
          "maximum": 599
        },
        "failureReason": {
          "type": "string",
          "enum": [
            "deadline",
            "timeout",
            "cancelled",
            "configuration",
            "unavailable",
            "invalid_output",
            "unchanged_output",
            "transport"
          ]
        },
        "providerAttempts": {
          "maxItems": 2,
          "type": "array",
          "items": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "provider": {
                    "type": "string",
                    "enum": [
                      "workers-ai",
                      "openrouter"
                    ]
                  },
                  "outcome": {
                    "type": "string",
                    "const": "success"
                  },
                  "failureStage": {
                    "not": {}
                  },
                  "httpStatus": {
                    "not": {}
                  },
                  "outputStage": {
                    "not": {}
                  }
                },
                "required": [
                  "provider",
                  "outcome"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "provider": {
                    "type": "string",
                    "enum": [
                      "workers-ai",
                      "openrouter"
                    ]
                  },
                  "outcome": {
                    "type": "string",
                    "enum": [
                      "timeout",
                      "cancelled",
                      "capacity",
                      "invalid_output",
                      "configuration",
                      "unavailable"
                    ]
                  },
                  "failureStage": {
                    "type": "string",
                    "enum": [
                      "invoke",
                      "fetch"
                    ]
                  },
                  "httpStatus": {
                    "not": {}
                  },
                  "outputStage": {
                    "not": {}
                  }
                },
                "required": [
                  "provider",
                  "outcome"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "provider": {
                    "type": "string",
                    "enum": [
                      "workers-ai",
                      "openrouter"
                    ]
                  },
                  "outcome": {
                    "type": "string",
                    "enum": [
                      "timeout",
                      "cancelled",
                      "capacity",
                      "invalid_output",
                      "configuration",
                      "unavailable"
                    ]
                  },
                  "failureStage": {
                    "type": "string",
                    "enum": [
                      "http",
                      "body"
                    ]
                  },
                  "httpStatus": {
                    "type": "integer",
                    "minimum": 100,
                    "maximum": 599
                  },
                  "outputStage": {
                    "not": {}
                  }
                },
                "required": [
                  "provider",
                  "outcome",
                  "failureStage"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "provider": {
                    "type": "string",
                    "enum": [
                      "workers-ai",
                      "openrouter"
                    ]
                  },
                  "outcome": {
                    "type": "string",
                    "const": "invalid_output"
                  },
                  "failureStage": {
                    "not": {}
                  },
                  "httpStatus": {
                    "not": {}
                  },
                  "outputStage": {
                    "type": "string",
                    "enum": [
                      "response_shape",
                      "empty_output",
                      "source_preservation",
                      "implausible_edit"
                    ]
                  }
                },
                "required": [
                  "provider",
                  "outcome",
                  "outputStage"
                ],
                "additionalProperties": false
              }
            ]
          }
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "text",
    "status",
    "before",
    "after",
    "scoreChange",
    "factsPreserved",
    "passedFinalChecks",
    "independentModelChecks",
    "modelRequests",
    "rolesCompleted",
    "finishingRounds",
    "scorerVersion",
    "durationMs",
    "note"
  ],
  "additionalProperties": false
}