/* Checklist complete schema+semantic validator v1.4.22. */

// web/checklist-schema-validators.js
var __getOwnPropNames = Object.getOwnPropertyNames;
var __commonJS = (cb, mod) => function __require() {
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
};
var require_ucs2length = __commonJS({
  "tests/node_modules/ajv/dist/runtime/ucs2length.js"(exports) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    function ucs2length(str) {
      const len = str.length;
      let length = 0;
      let pos = 0;
      let value;
      while (pos < len) {
        length++;
        value = str.charCodeAt(pos++);
        if (value >= 55296 && value <= 56319 && pos < len) {
          value = str.charCodeAt(pos);
          if ((value & 64512) === 56320)
            pos++;
        }
      }
      return length;
    }
    exports.default = ucs2length;
    ucs2length.code = 'require("ajv/dist/runtime/ucs2length").default';
  }
});
var require_formats = __commonJS({
  "tests/node_modules/ajv-formats/dist/formats.js"(exports) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    exports.formatNames = exports.fastFormats = exports.fullFormats = void 0;
    function fmtDef(validate, compare) {
      return { validate, compare };
    }
    exports.fullFormats = {
      // date: http://tools.ietf.org/html/rfc3339#section-5.6
      date: fmtDef(date, compareDate),
      // date-time: http://tools.ietf.org/html/rfc3339#section-5.6
      time: fmtDef(getTime(true), compareTime),
      "date-time": fmtDef(getDateTime(true), compareDateTime),
      "iso-time": fmtDef(getTime(), compareIsoTime),
      "iso-date-time": fmtDef(getDateTime(), compareIsoDateTime),
      // duration: https://tools.ietf.org/html/rfc3339#appendix-A
      duration: /^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,
      uri,
      "uri-reference": /^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,
      // uri-template: https://tools.ietf.org/html/rfc6570
      "uri-template": /^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,
      // For the source: https://gist.github.com/dperini/729294
      // For test cases: https://mathiasbynens.be/demo/url-regex
      url: /^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,
      email: /^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,
      hostname: /^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,
      // optimized https://www.safaribooksonline.com/library/view/regular-expressions-cookbook/9780596802837/ch07s16.html
      ipv4: /^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,
      ipv6: /^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,
      regex,
      // uuid: http://tools.ietf.org/html/rfc4122
      uuid: /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,
      // JSON-pointer: https://tools.ietf.org/html/rfc6901
      // uri fragment: https://tools.ietf.org/html/rfc3986#appendix-A
      "json-pointer": /^(?:\/(?:[^~/]|~0|~1)*)*$/,
      "json-pointer-uri-fragment": /^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,
      // relative JSON-pointer: http://tools.ietf.org/html/draft-luff-relative-json-pointer-00
      "relative-json-pointer": /^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,
      // the following formats are used by the openapi specification: https://spec.openapis.org/oas/v3.0.0#data-types
      // byte: https://github.com/miguelmota/is-base64
      byte,
      // signed 32 bit integer
      int32: { type: "number", validate: validateInt32 },
      // signed 64 bit integer
      int64: { type: "number", validate: validateInt64 },
      // C-type float
      float: { type: "number", validate: validateNumber },
      // C-type double
      double: { type: "number", validate: validateNumber },
      // hint to the UI to hide input strings
      password: true,
      // unchecked string payload
      binary: true
    };
    exports.fastFormats = {
      ...exports.fullFormats,
      date: fmtDef(/^\d\d\d\d-[0-1]\d-[0-3]\d$/, compareDate),
      time: fmtDef(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i, compareTime),
      "date-time": fmtDef(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i, compareDateTime),
      "iso-time": fmtDef(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i, compareIsoTime),
      "iso-date-time": fmtDef(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i, compareIsoDateTime),
      // uri: https://github.com/mafintosh/is-my-json-valid/blob/master/formats.js
      uri: /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,
      "uri-reference": /^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,
      // email (sources from jsen validator):
      // http://stackoverflow.com/questions/201323/using-a-regular-expression-to-validate-an-email-address#answer-8829363
      // http://www.w3.org/TR/html5/forms.html#valid-e-mail-address (search for 'wilful violation')
      email: /^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i
    };
    exports.formatNames = Object.keys(exports.fullFormats);
    function isLeapYear(year) {
      return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);
    }
    var DATE = /^(\d\d\d\d)-(\d\d)-(\d\d)$/;
    var DAYS = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
    function date(str) {
      const matches = DATE.exec(str);
      if (!matches)
        return false;
      const year = +matches[1];
      const month = +matches[2];
      const day = +matches[3];
      return month >= 1 && month <= 12 && day >= 1 && day <= (month === 2 && isLeapYear(year) ? 29 : DAYS[month]);
    }
    function compareDate(d1, d2) {
      if (!(d1 && d2))
        return void 0;
      if (d1 > d2)
        return 1;
      if (d1 < d2)
        return -1;
      return 0;
    }
    var TIME = /^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;
    function getTime(strictTimeZone) {
      return function time(str) {
        const matches = TIME.exec(str);
        if (!matches)
          return false;
        const hr = +matches[1];
        const min = +matches[2];
        const sec = +matches[3];
        const tz = matches[4];
        const tzSign = matches[5] === "-" ? -1 : 1;
        const tzH = +(matches[6] || 0);
        const tzM = +(matches[7] || 0);
        if (tzH > 23 || tzM > 59 || strictTimeZone && !tz)
          return false;
        if (hr <= 23 && min <= 59 && sec < 60)
          return true;
        const utcMin = min - tzM * tzSign;
        const utcHr = hr - tzH * tzSign - (utcMin < 0 ? 1 : 0);
        return (utcHr === 23 || utcHr === -1) && (utcMin === 59 || utcMin === -1) && sec < 61;
      };
    }
    function compareTime(s1, s2) {
      if (!(s1 && s2))
        return void 0;
      const t1 = (/* @__PURE__ */ new Date("2020-01-01T" + s1)).valueOf();
      const t2 = (/* @__PURE__ */ new Date("2020-01-01T" + s2)).valueOf();
      if (!(t1 && t2))
        return void 0;
      return t1 - t2;
    }
    function compareIsoTime(t1, t2) {
      if (!(t1 && t2))
        return void 0;
      const a1 = TIME.exec(t1);
      const a2 = TIME.exec(t2);
      if (!(a1 && a2))
        return void 0;
      t1 = a1[1] + a1[2] + a1[3];
      t2 = a2[1] + a2[2] + a2[3];
      if (t1 > t2)
        return 1;
      if (t1 < t2)
        return -1;
      return 0;
    }
    var DATE_TIME_SEPARATOR = /t|\s/i;
    function getDateTime(strictTimeZone) {
      const time = getTime(strictTimeZone);
      return function date_time(str) {
        const dateTime = str.split(DATE_TIME_SEPARATOR);
        return dateTime.length === 2 && date(dateTime[0]) && time(dateTime[1]);
      };
    }
    function compareDateTime(dt1, dt2) {
      if (!(dt1 && dt2))
        return void 0;
      const d1 = new Date(dt1).valueOf();
      const d2 = new Date(dt2).valueOf();
      if (!(d1 && d2))
        return void 0;
      return d1 - d2;
    }
    function compareIsoDateTime(dt1, dt2) {
      if (!(dt1 && dt2))
        return void 0;
      const [d1, t1] = dt1.split(DATE_TIME_SEPARATOR);
      const [d2, t2] = dt2.split(DATE_TIME_SEPARATOR);
      const res = compareDate(d1, d2);
      if (res === void 0)
        return void 0;
      return res || compareTime(t1, t2);
    }
    var NOT_URI_FRAGMENT = /\/|:/;
    var URI = /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;
    function uri(str) {
      return NOT_URI_FRAGMENT.test(str) && URI.test(str);
    }
    var BYTE = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;
    function byte(str) {
      BYTE.lastIndex = 0;
      return BYTE.test(str);
    }
    var MIN_INT32 = -(2 ** 31);
    var MAX_INT32 = 2 ** 31 - 1;
    function validateInt32(value) {
      return Number.isInteger(value) && value <= MAX_INT32 && value >= MIN_INT32;
    }
    function validateInt64(value) {
      return Number.isInteger(value);
    }
    function validateNumber() {
      return true;
    }
    var Z_ANCHOR = /[^\\]\\Z/;
    function regex(str) {
      if (Z_ANCHOR.test(str))
        return false;
      try {
        new RegExp(str);
        return true;
      } catch (e) {
        return false;
      }
    }
  }
});
var checklistRequestValidator = validate20;
var schema31 = { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "ARTIFACT-CHECKLIST-REQUEST-v1", "title": "Artifact Checklist Request v1", "type": "object", "additionalProperties": false, "required": ["request_protocol_version", "request_id", "created_at", "mode", "artifact_type", "academic_stage", "checkpoint", "output_language", "checklist", "artifact", "execution_contract"], "properties": { "request_protocol_version": { "const": "ARTIFACT-CHECKLIST-REQUEST-v1" }, "request_id": { "type": "string", "minLength": 1 }, "created_at": { "type": "string", "format": "date-time" }, "mode": { "const": "CHECKLIST_COMPLIANCE" }, "artifact_type": { "type": "string", "minLength": 1 }, "academic_stage": { "type": "string", "minLength": 1 }, "checkpoint": { "type": "string", "minLength": 1 }, "output_language": { "enum": ["th-TH", "en-US"] }, "checklist": { "type": "object", "additionalProperties": false, "required": ["checklist_id", "checklist_version", "definition_protocol_version", "definition_sha256", "source_pdf_sha256", "sections_snapshot", "criteria_snapshot"], "properties": { "checklist_id": { "type": "string", "minLength": 1 }, "checklist_version": { "type": "string", "minLength": 1 }, "definition_protocol_version": { "const": "ARTIFACT-CHECKLIST-DEFINITION-v1" }, "definition_sha256": { "type": "string", "pattern": "^[a-f0-9]{64}$" }, "source_pdf_sha256": { "type": "string", "pattern": "^[a-f0-9]{64}$" }, "sections_snapshot": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["section_id", "title_th"], "properties": { "section_id": { "type": "string", "minLength": 1 }, "title_th": { "type": "string", "minLength": 1 } } } }, "criteria_snapshot": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["criterion_id", "section_id", "official_text", "source_page", "entry_type", "gradable", "applicability_mode", "external_reference_dependency"], "properties": { "criterion_id": { "type": "string", "minLength": 1 }, "section_id": { "type": "string", "minLength": 1 }, "official_text": { "type": "string", "minLength": 1 }, "source_page": { "type": "integer", "minimum": 1 }, "entry_type": { "enum": ["CRITERION", "OPEN_OTHER"] }, "gradable": { "type": "boolean" }, "applicability_mode": { "enum": ["STANDARD", "CONTEXT_SENSITIVE", "OPTIONAL_EXTENSION"] }, "external_reference_dependency": { "enum": ["NONE", "PARTIAL", "FULL"] } } } } } }, "artifact": { "type": "object", "additionalProperties": false, "required": ["file_name", "mime_type", "size_bytes", "sha256", "page_count"], "properties": { "file_name": { "type": "string", "pattern": "\\.[pP][dD][fF]$" }, "mime_type": { "const": "application/pdf" }, "size_bytes": { "type": "integer", "minimum": 1 }, "sha256": { "type": "string", "pattern": "^[A-Fa-f0-9]{64}$" }, "page_count": { "type": "integer", "minimum": 1 } } }, "execution_contract": { "type": "object", "additionalProperties": false, "required": ["treat_request_as_frozen", "original_pdf_must_be_attached_separately", "artifact_identity_check", "checklist_snapshot_is_authoritative", "evaluate_every_gradable_criterion_exactly_once", "project_context_is_inferred", "no_artifact_repair"], "properties": { "treat_request_as_frozen": { "const": true }, "original_pdf_must_be_attached_separately": { "const": true }, "artifact_identity_check": { "const": "SHA256_EXACT_MATCH" }, "checklist_snapshot_is_authoritative": { "const": true }, "evaluate_every_gradable_criterion_exactly_once": { "const": true }, "project_context_is_inferred": { "const": true }, "no_artifact_repair": { "const": true }, "common_review_policy_version": { "const": "PROJECT-CHECK-COMMON-REVIEW-v1.1-20261026" } } } } };
var func1 = Object.prototype.hasOwnProperty;
var func2 = require_ucs2length().default;
var formats0 = require_formats().fullFormats["date-time"];
var pattern4 = new RegExp("^[a-f0-9]{64}$", "u");
var pattern6 = new RegExp("\\.[pP][dD][fF]$", "u");
var pattern7 = new RegExp("^[A-Fa-f0-9]{64}$", "u");
function validate20(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) {
  ;
  let vErrors = null;
  let errors = 0;
  const evaluated0 = validate20.evaluated;
  if (evaluated0.dynamicProps) {
    evaluated0.props = void 0;
  }
  if (evaluated0.dynamicItems) {
    evaluated0.items = void 0;
  }
  if (data && typeof data == "object" && !Array.isArray(data)) {
    if (data.request_protocol_version === void 0) {
      const err0 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "request_protocol_version" }, message: "must have required property 'request_protocol_version'" };
      if (vErrors === null) {
        vErrors = [err0];
      } else {
        vErrors.push(err0);
      }
      errors++;
    }
    if (data.request_id === void 0) {
      const err1 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "request_id" }, message: "must have required property 'request_id'" };
      if (vErrors === null) {
        vErrors = [err1];
      } else {
        vErrors.push(err1);
      }
      errors++;
    }
    if (data.created_at === void 0) {
      const err2 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "created_at" }, message: "must have required property 'created_at'" };
      if (vErrors === null) {
        vErrors = [err2];
      } else {
        vErrors.push(err2);
      }
      errors++;
    }
    if (data.mode === void 0) {
      const err3 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "mode" }, message: "must have required property 'mode'" };
      if (vErrors === null) {
        vErrors = [err3];
      } else {
        vErrors.push(err3);
      }
      errors++;
    }
    if (data.artifact_type === void 0) {
      const err4 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "artifact_type" }, message: "must have required property 'artifact_type'" };
      if (vErrors === null) {
        vErrors = [err4];
      } else {
        vErrors.push(err4);
      }
      errors++;
    }
    if (data.academic_stage === void 0) {
      const err5 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "academic_stage" }, message: "must have required property 'academic_stage'" };
      if (vErrors === null) {
        vErrors = [err5];
      } else {
        vErrors.push(err5);
      }
      errors++;
    }
    if (data.checkpoint === void 0) {
      const err6 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "checkpoint" }, message: "must have required property 'checkpoint'" };
      if (vErrors === null) {
        vErrors = [err6];
      } else {
        vErrors.push(err6);
      }
      errors++;
    }
    if (data.output_language === void 0) {
      const err7 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "output_language" }, message: "must have required property 'output_language'" };
      if (vErrors === null) {
        vErrors = [err7];
      } else {
        vErrors.push(err7);
      }
      errors++;
    }
    if (data.checklist === void 0) {
      const err8 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "checklist" }, message: "must have required property 'checklist'" };
      if (vErrors === null) {
        vErrors = [err8];
      } else {
        vErrors.push(err8);
      }
      errors++;
    }
    if (data.artifact === void 0) {
      const err9 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "artifact" }, message: "must have required property 'artifact'" };
      if (vErrors === null) {
        vErrors = [err9];
      } else {
        vErrors.push(err9);
      }
      errors++;
    }
    if (data.execution_contract === void 0) {
      const err10 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "execution_contract" }, message: "must have required property 'execution_contract'" };
      if (vErrors === null) {
        vErrors = [err10];
      } else {
        vErrors.push(err10);
      }
      errors++;
    }
    for (const key0 in data) {
      if (!func1.call(schema31.properties, key0)) {
        const err11 = { instancePath, schemaPath: "#/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key0 }, message: "must NOT have additional properties" };
        if (vErrors === null) {
          vErrors = [err11];
        } else {
          vErrors.push(err11);
        }
        errors++;
      }
    }
    if (data.request_protocol_version !== void 0) {
      if ("ARTIFACT-CHECKLIST-REQUEST-v1" !== data.request_protocol_version) {
        const err12 = { instancePath: instancePath + "/request_protocol_version", schemaPath: "#/properties/request_protocol_version/const", keyword: "const", params: { allowedValue: "ARTIFACT-CHECKLIST-REQUEST-v1" }, message: "must be equal to constant" };
        if (vErrors === null) {
          vErrors = [err12];
        } else {
          vErrors.push(err12);
        }
        errors++;
      }
    }
    if (data.request_id !== void 0) {
      let data1 = data.request_id;
      if (typeof data1 === "string") {
        if (func2(data1) < 1) {
          const err13 = { instancePath: instancePath + "/request_id", schemaPath: "#/properties/request_id/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" };
          if (vErrors === null) {
            vErrors = [err13];
          } else {
            vErrors.push(err13);
          }
          errors++;
        }
      } else {
        const err14 = { instancePath: instancePath + "/request_id", schemaPath: "#/properties/request_id/type", keyword: "type", params: { type: "string" }, message: "must be string" };
        if (vErrors === null) {
          vErrors = [err14];
        } else {
          vErrors.push(err14);
        }
        errors++;
      }
    }
    if (data.created_at !== void 0) {
      let data2 = data.created_at;
      if (typeof data2 === "string") {
        if (!formats0.validate(data2)) {
          const err15 = { instancePath: instancePath + "/created_at", schemaPath: "#/properties/created_at/format", keyword: "format", params: { format: "date-time" }, message: 'must match format "date-time"' };
          if (vErrors === null) {
            vErrors = [err15];
          } else {
            vErrors.push(err15);
          }
          errors++;
        }
      } else {
        const err16 = { instancePath: instancePath + "/created_at", schemaPath: "#/properties/created_at/type", keyword: "type", params: { type: "string" }, message: "must be string" };
        if (vErrors === null) {
          vErrors = [err16];
        } else {
          vErrors.push(err16);
        }
        errors++;
      }
    }
    if (data.mode !== void 0) {
      if ("CHECKLIST_COMPLIANCE" !== data.mode) {
        const err17 = { instancePath: instancePath + "/mode", schemaPath: "#/properties/mode/const", keyword: "const", params: { allowedValue: "CHECKLIST_COMPLIANCE" }, message: "must be equal to constant" };
        if (vErrors === null) {
          vErrors = [err17];
        } else {
          vErrors.push(err17);
        }
        errors++;
      }
    }
    if (data.artifact_type !== void 0) {
      let data4 = data.artifact_type;
      if (typeof data4 === "string") {
        if (func2(data4) < 1) {
          const err18 = { instancePath: instancePath + "/artifact_type", schemaPath: "#/properties/artifact_type/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" };
          if (vErrors === null) {
            vErrors = [err18];
          } else {
            vErrors.push(err18);
          }
          errors++;
        }
      } else {
        const err19 = { instancePath: instancePath + "/artifact_type", schemaPath: "#/properties/artifact_type/type", keyword: "type", params: { type: "string" }, message: "must be string" };
        if (vErrors === null) {
          vErrors = [err19];
        } else {
          vErrors.push(err19);
        }
        errors++;
      }
    }
    if (data.academic_stage !== void 0) {
      let data5 = data.academic_stage;
      if (typeof data5 === "string") {
        if (func2(data5) < 1) {
          const err20 = { instancePath: instancePath + "/academic_stage", schemaPath: "#/properties/academic_stage/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" };
          if (vErrors === null) {
            vErrors = [err20];
          } else {
            vErrors.push(err20);
          }
          errors++;
        }
      } else {
        const err21 = { instancePath: instancePath + "/academic_stage", schemaPath: "#/properties/academic_stage/type", keyword: "type", params: { type: "string" }, message: "must be string" };
        if (vErrors === null) {
          vErrors = [err21];
        } else {
          vErrors.push(err21);
        }
        errors++;
      }
    }
    if (data.checkpoint !== void 0) {
      let data6 = data.checkpoint;
      if (typeof data6 === "string") {
        if (func2(data6) < 1) {
          const err22 = { instancePath: instancePath + "/checkpoint", schemaPath: "#/properties/checkpoint/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" };
          if (vErrors === null) {
            vErrors = [err22];
          } else {
            vErrors.push(err22);
          }
          errors++;
        }
      } else {
        const err23 = { instancePath: instancePath + "/checkpoint", schemaPath: "#/properties/checkpoint/type", keyword: "type", params: { type: "string" }, message: "must be string" };
        if (vErrors === null) {
          vErrors = [err23];
        } else {
          vErrors.push(err23);
        }
        errors++;
      }
    }
    if (data.output_language !== void 0) {
      let data7 = data.output_language;
      if (!(data7 === "th-TH" || data7 === "en-US")) {
        const err24 = { instancePath: instancePath + "/output_language", schemaPath: "#/properties/output_language/enum", keyword: "enum", params: { allowedValues: schema31.properties.output_language.enum }, message: "must be equal to one of the allowed values" };
        if (vErrors === null) {
          vErrors = [err24];
        } else {
          vErrors.push(err24);
        }
        errors++;
      }
    }
    if (data.checklist !== void 0) {
      let data8 = data.checklist;
      if (data8 && typeof data8 == "object" && !Array.isArray(data8)) {
        if (data8.checklist_id === void 0) {
          const err25 = { instancePath: instancePath + "/checklist", schemaPath: "#/properties/checklist/required", keyword: "required", params: { missingProperty: "checklist_id" }, message: "must have required property 'checklist_id'" };
          if (vErrors === null) {
            vErrors = [err25];
          } else {
            vErrors.push(err25);
          }
          errors++;
        }
        if (data8.checklist_version === void 0) {
          const err26 = { instancePath: instancePath + "/checklist", schemaPath: "#/properties/checklist/required", keyword: "required", params: { missingProperty: "checklist_version" }, message: "must have required property 'checklist_version'" };
          if (vErrors === null) {
            vErrors = [err26];
          } else {
            vErrors.push(err26);
          }
          errors++;
        }
        if (data8.definition_protocol_version === void 0) {
          const err27 = { instancePath: instancePath + "/checklist", schemaPath: "#/properties/checklist/required", keyword: "required", params: { missingProperty: "definition_protocol_version" }, message: "must have required property 'definition_protocol_version'" };
          if (vErrors === null) {
            vErrors = [err27];
          } else {
            vErrors.push(err27);
          }
          errors++;
        }
        if (data8.definition_sha256 === void 0) {
          const err28 = { instancePath: instancePath + "/checklist", schemaPath: "#/properties/checklist/required", keyword: "required", params: { missingProperty: "definition_sha256" }, message: "must have required property 'definition_sha256'" };
          if (vErrors === null) {
            vErrors = [err28];
          } else {
            vErrors.push(err28);
          }
          errors++;
        }
        if (data8.source_pdf_sha256 === void 0) {
          const err29 = { instancePath: instancePath + "/checklist", schemaPath: "#/properties/checklist/required", keyword: "required", params: { missingProperty: "source_pdf_sha256" }, message: "must have required property 'source_pdf_sha256'" };
          if (vErrors === null) {
            vErrors = [err29];
          } else {
            vErrors.push(err29);
          }
          errors++;
        }
        if (data8.sections_snapshot === void 0) {
          const err30 = { instancePath: instancePath + "/checklist", schemaPath: "#/properties/checklist/required", keyword: "required", params: { missingProperty: "sections_snapshot" }, message: "must have required property 'sections_snapshot'" };
          if (vErrors === null) {
            vErrors = [err30];
          } else {
            vErrors.push(err30);
          }
          errors++;
        }
        if (data8.criteria_snapshot === void 0) {
          const err31 = { instancePath: instancePath + "/checklist", schemaPath: "#/properties/checklist/required", keyword: "required", params: { missingProperty: "criteria_snapshot" }, message: "must have required property 'criteria_snapshot'" };
          if (vErrors === null) {
            vErrors = [err31];
          } else {
            vErrors.push(err31);
          }
          errors++;
        }
        for (const key1 in data8) {
          if (!(key1 === "checklist_id" || key1 === "checklist_version" || key1 === "definition_protocol_version" || key1 === "definition_sha256" || key1 === "source_pdf_sha256" || key1 === "sections_snapshot" || key1 === "criteria_snapshot")) {
            const err32 = { instancePath: instancePath + "/checklist", schemaPath: "#/properties/checklist/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key1 }, message: "must NOT have additional properties" };
            if (vErrors === null) {
              vErrors = [err32];
            } else {
              vErrors.push(err32);
            }
            errors++;
          }
        }
        if (data8.checklist_id !== void 0) {
          let data9 = data8.checklist_id;
          if (typeof data9 === "string") {
            if (func2(data9) < 1) {
              const err33 = { instancePath: instancePath + "/checklist/checklist_id", schemaPath: "#/properties/checklist/properties/checklist_id/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" };
              if (vErrors === null) {
                vErrors = [err33];
              } else {
                vErrors.push(err33);
              }
              errors++;
            }
          } else {
            const err34 = { instancePath: instancePath + "/checklist/checklist_id", schemaPath: "#/properties/checklist/properties/checklist_id/type", keyword: "type", params: { type: "string" }, message: "must be string" };
            if (vErrors === null) {
              vErrors = [err34];
            } else {
              vErrors.push(err34);
            }
            errors++;
          }
        }
        if (data8.checklist_version !== void 0) {
          let data10 = data8.checklist_version;
          if (typeof data10 === "string") {
            if (func2(data10) < 1) {
              const err35 = { instancePath: instancePath + "/checklist/checklist_version", schemaPath: "#/properties/checklist/properties/checklist_version/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" };
              if (vErrors === null) {
                vErrors = [err35];
              } else {
                vErrors.push(err35);
              }
              errors++;
            }
          } else {
            const err36 = { instancePath: instancePath + "/checklist/checklist_version", schemaPath: "#/properties/checklist/properties/checklist_version/type", keyword: "type", params: { type: "string" }, message: "must be string" };
            if (vErrors === null) {
              vErrors = [err36];
            } else {
              vErrors.push(err36);
            }
            errors++;
          }
        }
        if (data8.definition_protocol_version !== void 0) {
          if ("ARTIFACT-CHECKLIST-DEFINITION-v1" !== data8.definition_protocol_version) {
            const err37 = { instancePath: instancePath + "/checklist/definition_protocol_version", schemaPath: "#/properties/checklist/properties/definition_protocol_version/const", keyword: "const", params: { allowedValue: "ARTIFACT-CHECKLIST-DEFINITION-v1" }, message: "must be equal to constant" };
            if (vErrors === null) {
              vErrors = [err37];
            } else {
              vErrors.push(err37);
            }
            errors++;
          }
        }
        if (data8.definition_sha256 !== void 0) {
          let data12 = data8.definition_sha256;
          if (typeof data12 === "string") {
            if (!pattern4.test(data12)) {
              const err38 = { instancePath: instancePath + "/checklist/definition_sha256", schemaPath: "#/properties/checklist/properties/definition_sha256/pattern", keyword: "pattern", params: { pattern: "^[a-f0-9]{64}$" }, message: 'must match pattern "^[a-f0-9]{64}$"' };
              if (vErrors === null) {
                vErrors = [err38];
              } else {
                vErrors.push(err38);
              }
              errors++;
            }
          } else {
            const err39 = { instancePath: instancePath + "/checklist/definition_sha256", schemaPath: "#/properties/checklist/properties/definition_sha256/type", keyword: "type", params: { type: "string" }, message: "must be string" };
            if (vErrors === null) {
              vErrors = [err39];
            } else {
              vErrors.push(err39);
            }
            errors++;
          }
        }
        if (data8.source_pdf_sha256 !== void 0) {
          let data13 = data8.source_pdf_sha256;
          if (typeof data13 === "string") {
            if (!pattern4.test(data13)) {
              const err40 = { instancePath: instancePath + "/checklist/source_pdf_sha256", schemaPath: "#/properties/checklist/properties/source_pdf_sha256/pattern", keyword: "pattern", params: { pattern: "^[a-f0-9]{64}$" }, message: 'must match pattern "^[a-f0-9]{64}$"' };
              if (vErrors === null) {
                vErrors = [err40];
              } else {
                vErrors.push(err40);
              }
              errors++;
            }
          } else {
            const err41 = { instancePath: instancePath + "/checklist/source_pdf_sha256", schemaPath: "#/properties/checklist/properties/source_pdf_sha256/type", keyword: "type", params: { type: "string" }, message: "must be string" };
            if (vErrors === null) {
              vErrors = [err41];
            } else {
              vErrors.push(err41);
            }
            errors++;
          }
        }
        if (data8.sections_snapshot !== void 0) {
          let data14 = data8.sections_snapshot;
          if (Array.isArray(data14)) {
            if (data14.length < 1) {
              const err42 = { instancePath: instancePath + "/checklist/sections_snapshot", schemaPath: "#/properties/checklist/properties/sections_snapshot/minItems", keyword: "minItems", params: { limit: 1 }, message: "must NOT have fewer than 1 items" };
              if (vErrors === null) {
                vErrors = [err42];
              } else {
                vErrors.push(err42);
              }
              errors++;
            }
            const len0 = data14.length;
            for (let i0 = 0; i0 < len0; i0++) {
              let data15 = data14[i0];
              if (data15 && typeof data15 == "object" && !Array.isArray(data15)) {
                if (data15.section_id === void 0) {
                  const err43 = { instancePath: instancePath + "/checklist/sections_snapshot/" + i0, schemaPath: "#/properties/checklist/properties/sections_snapshot/items/required", keyword: "required", params: { missingProperty: "section_id" }, message: "must have required property 'section_id'" };
                  if (vErrors === null) {
                    vErrors = [err43];
                  } else {
                    vErrors.push(err43);
                  }
                  errors++;
                }
                if (data15.title_th === void 0) {
                  const err44 = { instancePath: instancePath + "/checklist/sections_snapshot/" + i0, schemaPath: "#/properties/checklist/properties/sections_snapshot/items/required", keyword: "required", params: { missingProperty: "title_th" }, message: "must have required property 'title_th'" };
                  if (vErrors === null) {
                    vErrors = [err44];
                  } else {
                    vErrors.push(err44);
                  }
                  errors++;
                }
                for (const key2 in data15) {
                  if (!(key2 === "section_id" || key2 === "title_th")) {
                    const err45 = { instancePath: instancePath + "/checklist/sections_snapshot/" + i0, schemaPath: "#/properties/checklist/properties/sections_snapshot/items/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key2 }, message: "must NOT have additional properties" };
                    if (vErrors === null) {
                      vErrors = [err45];
                    } else {
                      vErrors.push(err45);
                    }
                    errors++;
                  }
                }
                if (data15.section_id !== void 0) {
                  let data16 = data15.section_id;
                  if (typeof data16 === "string") {
                    if (func2(data16) < 1) {
                      const err46 = { instancePath: instancePath + "/checklist/sections_snapshot/" + i0 + "/section_id", schemaPath: "#/properties/checklist/properties/sections_snapshot/items/properties/section_id/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" };
                      if (vErrors === null) {
                        vErrors = [err46];
                      } else {
                        vErrors.push(err46);
                      }
                      errors++;
                    }
                  } else {
                    const err47 = { instancePath: instancePath + "/checklist/sections_snapshot/" + i0 + "/section_id", schemaPath: "#/properties/checklist/properties/sections_snapshot/items/properties/section_id/type", keyword: "type", params: { type: "string" }, message: "must be string" };
                    if (vErrors === null) {
                      vErrors = [err47];
                    } else {
                      vErrors.push(err47);
                    }
                    errors++;
                  }
                }
                if (data15.title_th !== void 0) {
                  let data17 = data15.title_th;
                  if (typeof data17 === "string") {
                    if (func2(data17) < 1) {
                      const err48 = { instancePath: instancePath + "/checklist/sections_snapshot/" + i0 + "/title_th", schemaPath: "#/properties/checklist/properties/sections_snapshot/items/properties/title_th/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" };
                      if (vErrors === null) {
                        vErrors = [err48];
                      } else {
                        vErrors.push(err48);
                      }
                      errors++;
                    }
                  } else {
                    const err49 = { instancePath: instancePath + "/checklist/sections_snapshot/" + i0 + "/title_th", schemaPath: "#/properties/checklist/properties/sections_snapshot/items/properties/title_th/type", keyword: "type", params: { type: "string" }, message: "must be string" };
                    if (vErrors === null) {
                      vErrors = [err49];
                    } else {
                      vErrors.push(err49);
                    }
                    errors++;
                  }
                }
              } else {
                const err50 = { instancePath: instancePath + "/checklist/sections_snapshot/" + i0, schemaPath: "#/properties/checklist/properties/sections_snapshot/items/type", keyword: "type", params: { type: "object" }, message: "must be object" };
                if (vErrors === null) {
                  vErrors = [err50];
                } else {
                  vErrors.push(err50);
                }
                errors++;
              }
            }
          } else {
            const err51 = { instancePath: instancePath + "/checklist/sections_snapshot", schemaPath: "#/properties/checklist/properties/sections_snapshot/type", keyword: "type", params: { type: "array" }, message: "must be array" };
            if (vErrors === null) {
              vErrors = [err51];
            } else {
              vErrors.push(err51);
            }
            errors++;
          }
        }
        if (data8.criteria_snapshot !== void 0) {
          let data18 = data8.criteria_snapshot;
          if (Array.isArray(data18)) {
            if (data18.length < 1) {
              const err52 = { instancePath: instancePath + "/checklist/criteria_snapshot", schemaPath: "#/properties/checklist/properties/criteria_snapshot/minItems", keyword: "minItems", params: { limit: 1 }, message: "must NOT have fewer than 1 items" };
              if (vErrors === null) {
                vErrors = [err52];
              } else {
                vErrors.push(err52);
              }
              errors++;
            }
            const len1 = data18.length;
            for (let i1 = 0; i1 < len1; i1++) {
              let data19 = data18[i1];
              if (data19 && typeof data19 == "object" && !Array.isArray(data19)) {
                if (data19.criterion_id === void 0) {
                  const err53 = { instancePath: instancePath + "/checklist/criteria_snapshot/" + i1, schemaPath: "#/properties/checklist/properties/criteria_snapshot/items/required", keyword: "required", params: { missingProperty: "criterion_id" }, message: "must have required property 'criterion_id'" };
                  if (vErrors === null) {
                    vErrors = [err53];
                  } else {
                    vErrors.push(err53);
                  }
                  errors++;
                }
                if (data19.section_id === void 0) {
                  const err54 = { instancePath: instancePath + "/checklist/criteria_snapshot/" + i1, schemaPath: "#/properties/checklist/properties/criteria_snapshot/items/required", keyword: "required", params: { missingProperty: "section_id" }, message: "must have required property 'section_id'" };
                  if (vErrors === null) {
                    vErrors = [err54];
                  } else {
                    vErrors.push(err54);
                  }
                  errors++;
                }
                if (data19.official_text === void 0) {
                  const err55 = { instancePath: instancePath + "/checklist/criteria_snapshot/" + i1, schemaPath: "#/properties/checklist/properties/criteria_snapshot/items/required", keyword: "required", params: { missingProperty: "official_text" }, message: "must have required property 'official_text'" };
                  if (vErrors === null) {
                    vErrors = [err55];
                  } else {
                    vErrors.push(err55);
                  }
                  errors++;
                }
                if (data19.source_page === void 0) {
                  const err56 = { instancePath: instancePath + "/checklist/criteria_snapshot/" + i1, schemaPath: "#/properties/checklist/properties/criteria_snapshot/items/required", keyword: "required", params: { missingProperty: "source_page" }, message: "must have required property 'source_page'" };
                  if (vErrors === null) {
                    vErrors = [err56];
                  } else {
                    vErrors.push(err56);
                  }
                  errors++;
                }
                if (data19.entry_type === void 0) {
                  const err57 = { instancePath: instancePath + "/checklist/criteria_snapshot/" + i1, schemaPath: "#/properties/checklist/properties/criteria_snapshot/items/required", keyword: "required", params: { missingProperty: "entry_type" }, message: "must have required property 'entry_type'" };
                  if (vErrors === null) {
                    vErrors = [err57];
                  } else {
                    vErrors.push(err57);
                  }
                  errors++;
                }
                if (data19.gradable === void 0) {
                  const err58 = { instancePath: instancePath + "/checklist/criteria_snapshot/" + i1, schemaPath: "#/properties/checklist/properties/criteria_snapshot/items/required", keyword: "required", params: { missingProperty: "gradable" }, message: "must have required property 'gradable'" };
                  if (vErrors === null) {
                    vErrors = [err58];
                  } else {
                    vErrors.push(err58);
                  }
                  errors++;
                }
                if (data19.applicability_mode === void 0) {
                  const err59 = { instancePath: instancePath + "/checklist/criteria_snapshot/" + i1, schemaPath: "#/properties/checklist/properties/criteria_snapshot/items/required", keyword: "required", params: { missingProperty: "applicability_mode" }, message: "must have required property 'applicability_mode'" };
                  if (vErrors === null) {
                    vErrors = [err59];
                  } else {
                    vErrors.push(err59);
                  }
                  errors++;
                }
                if (data19.external_reference_dependency === void 0) {
                  const err60 = { instancePath: instancePath + "/checklist/criteria_snapshot/" + i1, schemaPath: "#/properties/checklist/properties/criteria_snapshot/items/required", keyword: "required", params: { missingProperty: "external_reference_dependency" }, message: "must have required property 'external_reference_dependency'" };
                  if (vErrors === null) {
                    vErrors = [err60];
                  } else {
                    vErrors.push(err60);
                  }
                  errors++;
                }
                for (const key3 in data19) {
                  if (!(key3 === "criterion_id" || key3 === "section_id" || key3 === "official_text" || key3 === "source_page" || key3 === "entry_type" || key3 === "gradable" || key3 === "applicability_mode" || key3 === "external_reference_dependency")) {
                    const err61 = { instancePath: instancePath + "/checklist/criteria_snapshot/" + i1, schemaPath: "#/properties/checklist/properties/criteria_snapshot/items/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key3 }, message: "must NOT have additional properties" };
                    if (vErrors === null) {
                      vErrors = [err61];
                    } else {
                      vErrors.push(err61);
                    }
                    errors++;
                  }
                }
                if (data19.criterion_id !== void 0) {
                  let data20 = data19.criterion_id;
                  if (typeof data20 === "string") {
                    if (func2(data20) < 1) {
                      const err62 = { instancePath: instancePath + "/checklist/criteria_snapshot/" + i1 + "/criterion_id", schemaPath: "#/properties/checklist/properties/criteria_snapshot/items/properties/criterion_id/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" };
                      if (vErrors === null) {
                        vErrors = [err62];
                      } else {
                        vErrors.push(err62);
                      }
                      errors++;
                    }
                  } else {
                    const err63 = { instancePath: instancePath + "/checklist/criteria_snapshot/" + i1 + "/criterion_id", schemaPath: "#/properties/checklist/properties/criteria_snapshot/items/properties/criterion_id/type", keyword: "type", params: { type: "string" }, message: "must be string" };
                    if (vErrors === null) {
                      vErrors = [err63];
                    } else {
                      vErrors.push(err63);
                    }
                    errors++;
                  }
                }
                if (data19.section_id !== void 0) {
                  let data21 = data19.section_id;
                  if (typeof data21 === "string") {
                    if (func2(data21) < 1) {
                      const err64 = { instancePath: instancePath + "/checklist/criteria_snapshot/" + i1 + "/section_id", schemaPath: "#/properties/checklist/properties/criteria_snapshot/items/properties/section_id/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" };
                      if (vErrors === null) {
                        vErrors = [err64];
                      } else {
                        vErrors.push(err64);
                      }
                      errors++;
                    }
                  } else {
                    const err65 = { instancePath: instancePath + "/checklist/criteria_snapshot/" + i1 + "/section_id", schemaPath: "#/properties/checklist/properties/criteria_snapshot/items/properties/section_id/type", keyword: "type", params: { type: "string" }, message: "must be string" };
                    if (vErrors === null) {
                      vErrors = [err65];
                    } else {
                      vErrors.push(err65);
                    }
                    errors++;
                  }
                }
                if (data19.official_text !== void 0) {
                  let data22 = data19.official_text;
                  if (typeof data22 === "string") {
                    if (func2(data22) < 1) {
                      const err66 = { instancePath: instancePath + "/checklist/criteria_snapshot/" + i1 + "/official_text", schemaPath: "#/properties/checklist/properties/criteria_snapshot/items/properties/official_text/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" };
                      if (vErrors === null) {
                        vErrors = [err66];
                      } else {
                        vErrors.push(err66);
                      }
                      errors++;
                    }
                  } else {
                    const err67 = { instancePath: instancePath + "/checklist/criteria_snapshot/" + i1 + "/official_text", schemaPath: "#/properties/checklist/properties/criteria_snapshot/items/properties/official_text/type", keyword: "type", params: { type: "string" }, message: "must be string" };
                    if (vErrors === null) {
                      vErrors = [err67];
                    } else {
                      vErrors.push(err67);
                    }
                    errors++;
                  }
                }
                if (data19.source_page !== void 0) {
                  let data23 = data19.source_page;
                  if (!(typeof data23 == "number" && (!(data23 % 1) && !isNaN(data23)))) {
                    const err68 = { instancePath: instancePath + "/checklist/criteria_snapshot/" + i1 + "/source_page", schemaPath: "#/properties/checklist/properties/criteria_snapshot/items/properties/source_page/type", keyword: "type", params: { type: "integer" }, message: "must be integer" };
                    if (vErrors === null) {
                      vErrors = [err68];
                    } else {
                      vErrors.push(err68);
                    }
                    errors++;
                  }
                  if (typeof data23 == "number") {
                    if (data23 < 1 || isNaN(data23)) {
                      const err69 = { instancePath: instancePath + "/checklist/criteria_snapshot/" + i1 + "/source_page", schemaPath: "#/properties/checklist/properties/criteria_snapshot/items/properties/source_page/minimum", keyword: "minimum", params: { comparison: ">=", limit: 1 }, message: "must be >= 1" };
                      if (vErrors === null) {
                        vErrors = [err69];
                      } else {
                        vErrors.push(err69);
                      }
                      errors++;
                    }
                  }
                }
                if (data19.entry_type !== void 0) {
                  let data24 = data19.entry_type;
                  if (!(data24 === "CRITERION" || data24 === "OPEN_OTHER")) {
                    const err70 = { instancePath: instancePath + "/checklist/criteria_snapshot/" + i1 + "/entry_type", schemaPath: "#/properties/checklist/properties/criteria_snapshot/items/properties/entry_type/enum", keyword: "enum", params: { allowedValues: schema31.properties.checklist.properties.criteria_snapshot.items.properties.entry_type.enum }, message: "must be equal to one of the allowed values" };
                    if (vErrors === null) {
                      vErrors = [err70];
                    } else {
                      vErrors.push(err70);
                    }
                    errors++;
                  }
                }
                if (data19.gradable !== void 0) {
                  if (typeof data19.gradable !== "boolean") {
                    const err71 = { instancePath: instancePath + "/checklist/criteria_snapshot/" + i1 + "/gradable", schemaPath: "#/properties/checklist/properties/criteria_snapshot/items/properties/gradable/type", keyword: "type", params: { type: "boolean" }, message: "must be boolean" };
                    if (vErrors === null) {
                      vErrors = [err71];
                    } else {
                      vErrors.push(err71);
                    }
                    errors++;
                  }
                }
                if (data19.applicability_mode !== void 0) {
                  let data26 = data19.applicability_mode;
                  if (!(data26 === "STANDARD" || data26 === "CONTEXT_SENSITIVE" || data26 === "OPTIONAL_EXTENSION")) {
                    const err72 = { instancePath: instancePath + "/checklist/criteria_snapshot/" + i1 + "/applicability_mode", schemaPath: "#/properties/checklist/properties/criteria_snapshot/items/properties/applicability_mode/enum", keyword: "enum", params: { allowedValues: schema31.properties.checklist.properties.criteria_snapshot.items.properties.applicability_mode.enum }, message: "must be equal to one of the allowed values" };
                    if (vErrors === null) {
                      vErrors = [err72];
                    } else {
                      vErrors.push(err72);
                    }
                    errors++;
                  }
                }
                if (data19.external_reference_dependency !== void 0) {
                  let data27 = data19.external_reference_dependency;
                  if (!(data27 === "NONE" || data27 === "PARTIAL" || data27 === "FULL")) {
                    const err73 = { instancePath: instancePath + "/checklist/criteria_snapshot/" + i1 + "/external_reference_dependency", schemaPath: "#/properties/checklist/properties/criteria_snapshot/items/properties/external_reference_dependency/enum", keyword: "enum", params: { allowedValues: schema31.properties.checklist.properties.criteria_snapshot.items.properties.external_reference_dependency.enum }, message: "must be equal to one of the allowed values" };
                    if (vErrors === null) {
                      vErrors = [err73];
                    } else {
                      vErrors.push(err73);
                    }
                    errors++;
                  }
                }
              } else {
                const err74 = { instancePath: instancePath + "/checklist/criteria_snapshot/" + i1, schemaPath: "#/properties/checklist/properties/criteria_snapshot/items/type", keyword: "type", params: { type: "object" }, message: "must be object" };
                if (vErrors === null) {
                  vErrors = [err74];
                } else {
                  vErrors.push(err74);
                }
                errors++;
              }
            }
          } else {
            const err75 = { instancePath: instancePath + "/checklist/criteria_snapshot", schemaPath: "#/properties/checklist/properties/criteria_snapshot/type", keyword: "type", params: { type: "array" }, message: "must be array" };
            if (vErrors === null) {
              vErrors = [err75];
            } else {
              vErrors.push(err75);
            }
            errors++;
          }
        }
      } else {
        const err76 = { instancePath: instancePath + "/checklist", schemaPath: "#/properties/checklist/type", keyword: "type", params: { type: "object" }, message: "must be object" };
        if (vErrors === null) {
          vErrors = [err76];
        } else {
          vErrors.push(err76);
        }
        errors++;
      }
    }
    if (data.artifact !== void 0) {
      let data28 = data.artifact;
      if (data28 && typeof data28 == "object" && !Array.isArray(data28)) {
        if (data28.file_name === void 0) {
          const err77 = { instancePath: instancePath + "/artifact", schemaPath: "#/properties/artifact/required", keyword: "required", params: { missingProperty: "file_name" }, message: "must have required property 'file_name'" };
          if (vErrors === null) {
            vErrors = [err77];
          } else {
            vErrors.push(err77);
          }
          errors++;
        }
        if (data28.mime_type === void 0) {
          const err78 = { instancePath: instancePath + "/artifact", schemaPath: "#/properties/artifact/required", keyword: "required", params: { missingProperty: "mime_type" }, message: "must have required property 'mime_type'" };
          if (vErrors === null) {
            vErrors = [err78];
          } else {
            vErrors.push(err78);
          }
          errors++;
        }
        if (data28.size_bytes === void 0) {
          const err79 = { instancePath: instancePath + "/artifact", schemaPath: "#/properties/artifact/required", keyword: "required", params: { missingProperty: "size_bytes" }, message: "must have required property 'size_bytes'" };
          if (vErrors === null) {
            vErrors = [err79];
          } else {
            vErrors.push(err79);
          }
          errors++;
        }
        if (data28.sha256 === void 0) {
          const err80 = { instancePath: instancePath + "/artifact", schemaPath: "#/properties/artifact/required", keyword: "required", params: { missingProperty: "sha256" }, message: "must have required property 'sha256'" };
          if (vErrors === null) {
            vErrors = [err80];
          } else {
            vErrors.push(err80);
          }
          errors++;
        }
        if (data28.page_count === void 0) {
          const err81 = { instancePath: instancePath + "/artifact", schemaPath: "#/properties/artifact/required", keyword: "required", params: { missingProperty: "page_count" }, message: "must have required property 'page_count'" };
          if (vErrors === null) {
            vErrors = [err81];
          } else {
            vErrors.push(err81);
          }
          errors++;
        }
        for (const key4 in data28) {
          if (!(key4 === "file_name" || key4 === "mime_type" || key4 === "size_bytes" || key4 === "sha256" || key4 === "page_count")) {
            const err82 = { instancePath: instancePath + "/artifact", schemaPath: "#/properties/artifact/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key4 }, message: "must NOT have additional properties" };
            if (vErrors === null) {
              vErrors = [err82];
            } else {
              vErrors.push(err82);
            }
            errors++;
          }
        }
        if (data28.file_name !== void 0) {
          let data29 = data28.file_name;
          if (typeof data29 === "string") {
            if (!pattern6.test(data29)) {
              const err83 = { instancePath: instancePath + "/artifact/file_name", schemaPath: "#/properties/artifact/properties/file_name/pattern", keyword: "pattern", params: { pattern: "\\.[pP][dD][fF]$" }, message: 'must match pattern "\\.[pP][dD][fF]$"' };
              if (vErrors === null) {
                vErrors = [err83];
              } else {
                vErrors.push(err83);
              }
              errors++;
            }
          } else {
            const err84 = { instancePath: instancePath + "/artifact/file_name", schemaPath: "#/properties/artifact/properties/file_name/type", keyword: "type", params: { type: "string" }, message: "must be string" };
            if (vErrors === null) {
              vErrors = [err84];
            } else {
              vErrors.push(err84);
            }
            errors++;
          }
        }
        if (data28.mime_type !== void 0) {
          if ("application/pdf" !== data28.mime_type) {
            const err85 = { instancePath: instancePath + "/artifact/mime_type", schemaPath: "#/properties/artifact/properties/mime_type/const", keyword: "const", params: { allowedValue: "application/pdf" }, message: "must be equal to constant" };
            if (vErrors === null) {
              vErrors = [err85];
            } else {
              vErrors.push(err85);
            }
            errors++;
          }
        }
        if (data28.size_bytes !== void 0) {
          let data31 = data28.size_bytes;
          if (!(typeof data31 == "number" && (!(data31 % 1) && !isNaN(data31)))) {
            const err86 = { instancePath: instancePath + "/artifact/size_bytes", schemaPath: "#/properties/artifact/properties/size_bytes/type", keyword: "type", params: { type: "integer" }, message: "must be integer" };
            if (vErrors === null) {
              vErrors = [err86];
            } else {
              vErrors.push(err86);
            }
            errors++;
          }
          if (typeof data31 == "number") {
            if (data31 < 1 || isNaN(data31)) {
              const err87 = { instancePath: instancePath + "/artifact/size_bytes", schemaPath: "#/properties/artifact/properties/size_bytes/minimum", keyword: "minimum", params: { comparison: ">=", limit: 1 }, message: "must be >= 1" };
              if (vErrors === null) {
                vErrors = [err87];
              } else {
                vErrors.push(err87);
              }
              errors++;
            }
          }
        }
        if (data28.sha256 !== void 0) {
          let data32 = data28.sha256;
          if (typeof data32 === "string") {
            if (!pattern7.test(data32)) {
              const err88 = { instancePath: instancePath + "/artifact/sha256", schemaPath: "#/properties/artifact/properties/sha256/pattern", keyword: "pattern", params: { pattern: "^[A-Fa-f0-9]{64}$" }, message: 'must match pattern "^[A-Fa-f0-9]{64}$"' };
              if (vErrors === null) {
                vErrors = [err88];
              } else {
                vErrors.push(err88);
              }
              errors++;
            }
          } else {
            const err89 = { instancePath: instancePath + "/artifact/sha256", schemaPath: "#/properties/artifact/properties/sha256/type", keyword: "type", params: { type: "string" }, message: "must be string" };
            if (vErrors === null) {
              vErrors = [err89];
            } else {
              vErrors.push(err89);
            }
            errors++;
          }
        }
        if (data28.page_count !== void 0) {
          let data33 = data28.page_count;
          if (!(typeof data33 == "number" && (!(data33 % 1) && !isNaN(data33)))) {
            const err90 = { instancePath: instancePath + "/artifact/page_count", schemaPath: "#/properties/artifact/properties/page_count/type", keyword: "type", params: { type: "integer" }, message: "must be integer" };
            if (vErrors === null) {
              vErrors = [err90];
            } else {
              vErrors.push(err90);
            }
            errors++;
          }
          if (typeof data33 == "number") {
            if (data33 < 1 || isNaN(data33)) {
              const err91 = { instancePath: instancePath + "/artifact/page_count", schemaPath: "#/properties/artifact/properties/page_count/minimum", keyword: "minimum", params: { comparison: ">=", limit: 1 }, message: "must be >= 1" };
              if (vErrors === null) {
                vErrors = [err91];
              } else {
                vErrors.push(err91);
              }
              errors++;
            }
          }
        }
      } else {
        const err92 = { instancePath: instancePath + "/artifact", schemaPath: "#/properties/artifact/type", keyword: "type", params: { type: "object" }, message: "must be object" };
        if (vErrors === null) {
          vErrors = [err92];
        } else {
          vErrors.push(err92);
        }
        errors++;
      }
    }
    if (data.execution_contract !== void 0) {
      let data34 = data.execution_contract;
      if (data34 && typeof data34 == "object" && !Array.isArray(data34)) {
        if (data34.treat_request_as_frozen === void 0) {
          const err93 = { instancePath: instancePath + "/execution_contract", schemaPath: "#/properties/execution_contract/required", keyword: "required", params: { missingProperty: "treat_request_as_frozen" }, message: "must have required property 'treat_request_as_frozen'" };
          if (vErrors === null) {
            vErrors = [err93];
          } else {
            vErrors.push(err93);
          }
          errors++;
        }
        if (data34.original_pdf_must_be_attached_separately === void 0) {
          const err94 = { instancePath: instancePath + "/execution_contract", schemaPath: "#/properties/execution_contract/required", keyword: "required", params: { missingProperty: "original_pdf_must_be_attached_separately" }, message: "must have required property 'original_pdf_must_be_attached_separately'" };
          if (vErrors === null) {
            vErrors = [err94];
          } else {
            vErrors.push(err94);
          }
          errors++;
        }
        if (data34.artifact_identity_check === void 0) {
          const err95 = { instancePath: instancePath + "/execution_contract", schemaPath: "#/properties/execution_contract/required", keyword: "required", params: { missingProperty: "artifact_identity_check" }, message: "must have required property 'artifact_identity_check'" };
          if (vErrors === null) {
            vErrors = [err95];
          } else {
            vErrors.push(err95);
          }
          errors++;
        }
        if (data34.checklist_snapshot_is_authoritative === void 0) {
          const err96 = { instancePath: instancePath + "/execution_contract", schemaPath: "#/properties/execution_contract/required", keyword: "required", params: { missingProperty: "checklist_snapshot_is_authoritative" }, message: "must have required property 'checklist_snapshot_is_authoritative'" };
          if (vErrors === null) {
            vErrors = [err96];
          } else {
            vErrors.push(err96);
          }
          errors++;
        }
        if (data34.evaluate_every_gradable_criterion_exactly_once === void 0) {
          const err97 = { instancePath: instancePath + "/execution_contract", schemaPath: "#/properties/execution_contract/required", keyword: "required", params: { missingProperty: "evaluate_every_gradable_criterion_exactly_once" }, message: "must have required property 'evaluate_every_gradable_criterion_exactly_once'" };
          if (vErrors === null) {
            vErrors = [err97];
          } else {
            vErrors.push(err97);
          }
          errors++;
        }
        if (data34.project_context_is_inferred === void 0) {
          const err98 = { instancePath: instancePath + "/execution_contract", schemaPath: "#/properties/execution_contract/required", keyword: "required", params: { missingProperty: "project_context_is_inferred" }, message: "must have required property 'project_context_is_inferred'" };
          if (vErrors === null) {
            vErrors = [err98];
          } else {
            vErrors.push(err98);
          }
          errors++;
        }
        if (data34.no_artifact_repair === void 0) {
          const err99 = { instancePath: instancePath + "/execution_contract", schemaPath: "#/properties/execution_contract/required", keyword: "required", params: { missingProperty: "no_artifact_repair" }, message: "must have required property 'no_artifact_repair'" };
          if (vErrors === null) {
            vErrors = [err99];
          } else {
            vErrors.push(err99);
          }
          errors++;
        }
        for (const key5 in data34) {
          if (!(key5 === "treat_request_as_frozen" || key5 === "original_pdf_must_be_attached_separately" || key5 === "artifact_identity_check" || key5 === "checklist_snapshot_is_authoritative" || key5 === "evaluate_every_gradable_criterion_exactly_once" || key5 === "project_context_is_inferred" || key5 === "no_artifact_repair" || key5 === "common_review_policy_version")) {
            const err100 = { instancePath: instancePath + "/execution_contract", schemaPath: "#/properties/execution_contract/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key5 }, message: "must NOT have additional properties" };
            if (vErrors === null) {
              vErrors = [err100];
            } else {
              vErrors.push(err100);
            }
            errors++;
          }
        }
        if (data34.treat_request_as_frozen !== void 0) {
          if (true !== data34.treat_request_as_frozen) {
            const err101 = { instancePath: instancePath + "/execution_contract/treat_request_as_frozen", schemaPath: "#/properties/execution_contract/properties/treat_request_as_frozen/const", keyword: "const", params: { allowedValue: true }, message: "must be equal to constant" };
            if (vErrors === null) {
              vErrors = [err101];
            } else {
              vErrors.push(err101);
            }
            errors++;
          }
        }
        if (data34.original_pdf_must_be_attached_separately !== void 0) {
          if (true !== data34.original_pdf_must_be_attached_separately) {
            const err102 = { instancePath: instancePath + "/execution_contract/original_pdf_must_be_attached_separately", schemaPath: "#/properties/execution_contract/properties/original_pdf_must_be_attached_separately/const", keyword: "const", params: { allowedValue: true }, message: "must be equal to constant" };
            if (vErrors === null) {
              vErrors = [err102];
            } else {
              vErrors.push(err102);
            }
            errors++;
          }
        }
        if (data34.artifact_identity_check !== void 0) {
          if ("SHA256_EXACT_MATCH" !== data34.artifact_identity_check) {
            const err103 = { instancePath: instancePath + "/execution_contract/artifact_identity_check", schemaPath: "#/properties/execution_contract/properties/artifact_identity_check/const", keyword: "const", params: { allowedValue: "SHA256_EXACT_MATCH" }, message: "must be equal to constant" };
            if (vErrors === null) {
              vErrors = [err103];
            } else {
              vErrors.push(err103);
            }
            errors++;
          }
        }
        if (data34.checklist_snapshot_is_authoritative !== void 0) {
          if (true !== data34.checklist_snapshot_is_authoritative) {
            const err104 = { instancePath: instancePath + "/execution_contract/checklist_snapshot_is_authoritative", schemaPath: "#/properties/execution_contract/properties/checklist_snapshot_is_authoritative/const", keyword: "const", params: { allowedValue: true }, message: "must be equal to constant" };
            if (vErrors === null) {
              vErrors = [err104];
            } else {
              vErrors.push(err104);
            }
            errors++;
          }
        }
        if (data34.evaluate_every_gradable_criterion_exactly_once !== void 0) {
          if (true !== data34.evaluate_every_gradable_criterion_exactly_once) {
            const err105 = { instancePath: instancePath + "/execution_contract/evaluate_every_gradable_criterion_exactly_once", schemaPath: "#/properties/execution_contract/properties/evaluate_every_gradable_criterion_exactly_once/const", keyword: "const", params: { allowedValue: true }, message: "must be equal to constant" };
            if (vErrors === null) {
              vErrors = [err105];
            } else {
              vErrors.push(err105);
            }
            errors++;
          }
        }
        if (data34.project_context_is_inferred !== void 0) {
          if (true !== data34.project_context_is_inferred) {
            const err106 = { instancePath: instancePath + "/execution_contract/project_context_is_inferred", schemaPath: "#/properties/execution_contract/properties/project_context_is_inferred/const", keyword: "const", params: { allowedValue: true }, message: "must be equal to constant" };
            if (vErrors === null) {
              vErrors = [err106];
            } else {
              vErrors.push(err106);
            }
            errors++;
          }
        }
        if (data34.no_artifact_repair !== void 0) {
          if (true !== data34.no_artifact_repair) {
            const err107 = { instancePath: instancePath + "/execution_contract/no_artifact_repair", schemaPath: "#/properties/execution_contract/properties/no_artifact_repair/const", keyword: "const", params: { allowedValue: true }, message: "must be equal to constant" };
            if (vErrors === null) {
              vErrors = [err107];
            } else {
              vErrors.push(err107);
            }
            errors++;
          }
        }
        if (data34.common_review_policy_version !== void 0) {
          if ("PROJECT-CHECK-COMMON-REVIEW-v1.1-20261026" !== data34.common_review_policy_version) {
            const err108 = { instancePath: instancePath + "/execution_contract/common_review_policy_version", schemaPath: "#/properties/execution_contract/properties/common_review_policy_version/const", keyword: "const", params: { allowedValue: "PROJECT-CHECK-COMMON-REVIEW-v1.1-20261026" }, message: "must be equal to constant" };
            if (vErrors === null) {
              vErrors = [err108];
            } else {
              vErrors.push(err108);
            }
            errors++;
          }
        }
      } else {
        const err109 = { instancePath: instancePath + "/execution_contract", schemaPath: "#/properties/execution_contract/type", keyword: "type", params: { type: "object" }, message: "must be object" };
        if (vErrors === null) {
          vErrors = [err109];
        } else {
          vErrors.push(err109);
        }
        errors++;
      }
    }
  } else {
    const err110 = { instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" };
    if (vErrors === null) {
      vErrors = [err110];
    } else {
      vErrors.push(err110);
    }
    errors++;
  }
  validate20.errors = vErrors;
  return errors === 0;
}
validate20.evaluated = { "props": true, "dynamicProps": false, "dynamicItems": false };
var checklistResultValidator = validate21;
var schema32 = { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "ARTIFACT-CHECKLIST-RESULT-v1", "title": "Artifact Checklist Result v1", "type": "object", "additionalProperties": false, "required": ["result_protocol_version", "request_id", "run_status", "artifact_type", "output_language", "artifact_identity", "checklist_identity", "blocking", "project_context", "criteria_results", "verification_limitations"], "properties": { "result_protocol_version": { "const": "ARTIFACT-CHECKLIST-RESULT-v1" }, "request_id": { "type": "string", "minLength": 1 }, "run_status": { "enum": ["COMPLETED", "IDENTITY_BLOCKED", "CONFIG_BLOCKED"] }, "artifact_type": { "type": "string", "minLength": 1 }, "output_language": { "enum": ["th-TH", "en-US"] }, "artifact_identity": { "type": "object", "additionalProperties": false, "required": ["expected_sha256", "computed_sha256", "match"], "properties": { "expected_sha256": { "type": "string", "pattern": "^[A-Fa-f0-9]{64}$" }, "computed_sha256": { "type": ["string", "null"], "pattern": "^[A-Fa-f0-9]{64}$" }, "match": { "type": ["boolean", "null"] } } }, "checklist_identity": { "type": "object", "additionalProperties": false, "required": ["checklist_id", "checklist_version", "definition_sha256", "source_pdf_sha256"], "properties": { "checklist_id": { "type": "string" }, "checklist_version": { "type": "string" }, "definition_sha256": { "type": "string", "pattern": "^[a-f0-9]{64}$" }, "source_pdf_sha256": { "type": "string", "pattern": "^[a-f0-9]{64}$" } } }, "blocking": { "oneOf": [{ "type": "null" }, { "type": "object", "additionalProperties": false, "required": ["code", "message"], "properties": { "code": { "enum": ["ARTIFACT_UNAVAILABLE", "HASH_UNAVAILABLE", "HASH_MISMATCH", "CHECKLIST_CONFIG_INVALID"] }, "message": { "type": "string", "minLength": 1 } } }] }, "project_context": { "oneOf": [{ "type": "null" }, { "$ref": "#/$defs/projectContext" }] }, "criteria_results": { "type": "array", "items": { "$ref": "#/$defs/criterionResult" } }, "verification_limitations": { "type": "array", "items": { "type": "string" } }, "supplemental_quality_review": { "type": "object", "additionalProperties": false, "required": ["policy_version", "checks", "findings", "follow_up_checks"], "properties": { "policy_version": { "const": "PROJECT-CHECK-COMMON-REVIEW-v1.1-20261026" }, "checks": { "type": "array", "minItems": 5, "maxItems": 5, "items": { "type": "object", "additionalProperties": false, "required": ["domain", "review_status", "inspected_pages", "summary"], "properties": { "domain": { "enum": ["LAYOUT", "REFERENCES", "CAPTIONS", "MATHEMATICS", "EXPERT_SOUNDNESS"] }, "review_status": { "enum": ["INSPECTED", "PARTIAL", "NOT_PRESENT", "NOT_CHECKABLE"] }, "inspected_pages": { "type": "array", "uniqueItems": true, "items": { "type": "integer", "minimum": 1 } }, "summary": { "type": "string", "minLength": 1 } } } }, "findings": { "type": "array", "items": { "type": "object", "additionalProperties": false, "required": ["finding_id", "domain", "priority", "location", "issue", "reason", "recommendation", "evidence"], "properties": { "finding_id": { "type": "string", "pattern": "^Q[0-9]{3,}$" }, "domain": { "enum": ["LAYOUT", "REFERENCES", "CAPTIONS", "MATHEMATICS", "EXPERT_SOUNDNESS"] }, "priority": { "enum": ["CRITICAL", "MAJOR", "MINOR", "EDITORIAL"] }, "location": { "type": "string", "minLength": 1 }, "issue": { "type": "string", "minLength": 1 }, "reason": { "type": "string", "minLength": 1 }, "recommendation": { "type": "string", "minLength": 1 }, "evidence": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["page", "observation"], "properties": { "page": { "type": "integer", "minimum": 1 }, "observation": { "type": "string", "minLength": 1 } } } } } } }, "follow_up_checks": { "type": "array", "items": { "type": "object", "additionalProperties": false, "required": ["domain", "question", "reason", "required_evidence", "page", "criterion_refs"], "properties": { "domain": { "enum": ["LAYOUT", "REFERENCES", "CAPTIONS", "MATHEMATICS", "EXPERT_SOUNDNESS"] }, "question": { "type": "string", "minLength": 1 }, "reason": { "type": "string", "minLength": 1 }, "required_evidence": { "type": "string", "minLength": 1 }, "page": { "type": ["integer", "null"], "minimum": 1 }, "criterion_refs": { "type": "array", "uniqueItems": true, "items": { "type": "string", "minLength": 1 } } } } } } } }, "$defs": { "evidence": { "type": "object", "additionalProperties": false, "required": ["page", "location", "observation"], "properties": { "page": { "type": ["integer", "null"], "minimum": 1 }, "location": { "type": "string" }, "observation": { "type": "string" } } }, "projectContext": { "type": "object", "additionalProperties": false, "required": ["primary_category", "secondary_categories", "summary", "confidence", "evidence"], "properties": { "primary_category": { "enum": ["SOFTWARE_SYSTEM", "AI_ML_DATA", "NETWORK_SECURITY", "IOT_HARDWARE_EMBEDDED", "ALGORITHM_RESEARCH", "HCI_USER_STUDY", "DATABASE_INFORMATION_SYSTEM", "HYBRID", "OTHER", "UNCERTAIN"] }, "secondary_categories": { "type": "array", "uniqueItems": true, "items": { "type": "string" } }, "summary": { "type": "string" }, "confidence": { "enum": ["HIGH", "MEDIUM", "LOW"] }, "evidence": { "type": "array", "items": { "$ref": "#/$defs/evidence" } } } }, "criterionResult": { "type": "object", "additionalProperties": false, "required": ["criterion_id", "criterion_text", "applicability", "status", "evidence", "rationale", "problem", "required_fix", "fix_location", "confidence"], "properties": { "criterion_id": { "type": "string", "minLength": 1 }, "criterion_text": { "type": "string", "minLength": 1 }, "applicability": { "enum": ["APPLICABLE", "NOT_APPLICABLE", "UNCERTAIN"] }, "status": { "enum": ["PASS", "FAIL", "NOT_CHECKABLE", "N_A"] }, "evidence": { "type": "array", "items": { "$ref": "#/$defs/evidence" } }, "rationale": { "type": "string" }, "problem": { "type": ["string", "null"] }, "required_fix": { "type": ["string", "null"] }, "fix_location": { "type": ["string", "null"] }, "confidence": { "enum": ["HIGH", "MEDIUM", "LOW"] } } } }, "allOf": [{ "if": { "properties": { "run_status": { "const": "COMPLETED" } } }, "then": { "properties": { "artifact_identity": { "properties": { "match": { "const": true }, "computed_sha256": { "type": "string" } } }, "blocking": { "type": "null" }, "project_context": { "$ref": "#/$defs/projectContext" }, "criteria_results": { "minItems": 1 } } } }, { "if": { "properties": { "run_status": { "enum": ["IDENTITY_BLOCKED", "CONFIG_BLOCKED"] } } }, "then": { "properties": { "blocking": { "type": "object" }, "project_context": { "type": "null" }, "criteria_results": { "maxItems": 0 } } } }] };
var schema33 = { "type": "object", "additionalProperties": false, "required": ["primary_category", "secondary_categories", "summary", "confidence", "evidence"], "properties": { "primary_category": { "enum": ["SOFTWARE_SYSTEM", "AI_ML_DATA", "NETWORK_SECURITY", "IOT_HARDWARE_EMBEDDED", "ALGORITHM_RESEARCH", "HCI_USER_STUDY", "DATABASE_INFORMATION_SYSTEM", "HYBRID", "OTHER", "UNCERTAIN"] }, "secondary_categories": { "type": "array", "uniqueItems": true, "items": { "type": "string" } }, "summary": { "type": "string" }, "confidence": { "enum": ["HIGH", "MEDIUM", "LOW"] }, "evidence": { "type": "array", "items": { "$ref": "#/$defs/evidence" } } } };
var schema34 = { "type": "object", "additionalProperties": false, "required": ["page", "location", "observation"], "properties": { "page": { "type": ["integer", "null"], "minimum": 1 }, "location": { "type": "string" }, "observation": { "type": "string" } } };
function validate22(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) {
  let vErrors = null;
  let errors = 0;
  const evaluated0 = validate22.evaluated;
  if (evaluated0.dynamicProps) {
    evaluated0.props = void 0;
  }
  if (evaluated0.dynamicItems) {
    evaluated0.items = void 0;
  }
  if (data && typeof data == "object" && !Array.isArray(data)) {
    if (data.primary_category === void 0) {
      const err0 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "primary_category" }, message: "must have required property 'primary_category'" };
      if (vErrors === null) {
        vErrors = [err0];
      } else {
        vErrors.push(err0);
      }
      errors++;
    }
    if (data.secondary_categories === void 0) {
      const err1 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "secondary_categories" }, message: "must have required property 'secondary_categories'" };
      if (vErrors === null) {
        vErrors = [err1];
      } else {
        vErrors.push(err1);
      }
      errors++;
    }
    if (data.summary === void 0) {
      const err2 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "summary" }, message: "must have required property 'summary'" };
      if (vErrors === null) {
        vErrors = [err2];
      } else {
        vErrors.push(err2);
      }
      errors++;
    }
    if (data.confidence === void 0) {
      const err3 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "confidence" }, message: "must have required property 'confidence'" };
      if (vErrors === null) {
        vErrors = [err3];
      } else {
        vErrors.push(err3);
      }
      errors++;
    }
    if (data.evidence === void 0) {
      const err4 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "evidence" }, message: "must have required property 'evidence'" };
      if (vErrors === null) {
        vErrors = [err4];
      } else {
        vErrors.push(err4);
      }
      errors++;
    }
    for (const key0 in data) {
      if (!(key0 === "primary_category" || key0 === "secondary_categories" || key0 === "summary" || key0 === "confidence" || key0 === "evidence")) {
        const err5 = { instancePath, schemaPath: "#/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key0 }, message: "must NOT have additional properties" };
        if (vErrors === null) {
          vErrors = [err5];
        } else {
          vErrors.push(err5);
        }
        errors++;
      }
    }
    if (data.primary_category !== void 0) {
      let data0 = data.primary_category;
      if (!(data0 === "SOFTWARE_SYSTEM" || data0 === "AI_ML_DATA" || data0 === "NETWORK_SECURITY" || data0 === "IOT_HARDWARE_EMBEDDED" || data0 === "ALGORITHM_RESEARCH" || data0 === "HCI_USER_STUDY" || data0 === "DATABASE_INFORMATION_SYSTEM" || data0 === "HYBRID" || data0 === "OTHER" || data0 === "UNCERTAIN")) {
        const err6 = { instancePath: instancePath + "/primary_category", schemaPath: "#/properties/primary_category/enum", keyword: "enum", params: { allowedValues: schema33.properties.primary_category.enum }, message: "must be equal to one of the allowed values" };
        if (vErrors === null) {
          vErrors = [err6];
        } else {
          vErrors.push(err6);
        }
        errors++;
      }
    }
    if (data.secondary_categories !== void 0) {
      let data1 = data.secondary_categories;
      if (Array.isArray(data1)) {
        const len0 = data1.length;
        for (let i0 = 0; i0 < len0; i0++) {
          if (typeof data1[i0] !== "string") {
            const err7 = { instancePath: instancePath + "/secondary_categories/" + i0, schemaPath: "#/properties/secondary_categories/items/type", keyword: "type", params: { type: "string" }, message: "must be string" };
            if (vErrors === null) {
              vErrors = [err7];
            } else {
              vErrors.push(err7);
            }
            errors++;
          }
        }
        let i1 = data1.length;
        let j0;
        if (i1 > 1) {
          const indices0 = {};
          for (; i1--; ) {
            let item0 = data1[i1];
            if (typeof item0 !== "string") {
              continue;
            }
            if (typeof indices0[item0] == "number") {
              j0 = indices0[item0];
              const err8 = { instancePath: instancePath + "/secondary_categories", schemaPath: "#/properties/secondary_categories/uniqueItems", keyword: "uniqueItems", params: { i: i1, j: j0 }, message: "must NOT have duplicate items (items ## " + j0 + " and " + i1 + " are identical)" };
              if (vErrors === null) {
                vErrors = [err8];
              } else {
                vErrors.push(err8);
              }
              errors++;
              break;
            }
            indices0[item0] = i1;
          }
        }
      } else {
        const err9 = { instancePath: instancePath + "/secondary_categories", schemaPath: "#/properties/secondary_categories/type", keyword: "type", params: { type: "array" }, message: "must be array" };
        if (vErrors === null) {
          vErrors = [err9];
        } else {
          vErrors.push(err9);
        }
        errors++;
      }
    }
    if (data.summary !== void 0) {
      if (typeof data.summary !== "string") {
        const err10 = { instancePath: instancePath + "/summary", schemaPath: "#/properties/summary/type", keyword: "type", params: { type: "string" }, message: "must be string" };
        if (vErrors === null) {
          vErrors = [err10];
        } else {
          vErrors.push(err10);
        }
        errors++;
      }
    }
    if (data.confidence !== void 0) {
      let data4 = data.confidence;
      if (!(data4 === "HIGH" || data4 === "MEDIUM" || data4 === "LOW")) {
        const err11 = { instancePath: instancePath + "/confidence", schemaPath: "#/properties/confidence/enum", keyword: "enum", params: { allowedValues: schema33.properties.confidence.enum }, message: "must be equal to one of the allowed values" };
        if (vErrors === null) {
          vErrors = [err11];
        } else {
          vErrors.push(err11);
        }
        errors++;
      }
    }
    if (data.evidence !== void 0) {
      let data5 = data.evidence;
      if (Array.isArray(data5)) {
        const len1 = data5.length;
        for (let i2 = 0; i2 < len1; i2++) {
          let data6 = data5[i2];
          if (data6 && typeof data6 == "object" && !Array.isArray(data6)) {
            if (data6.page === void 0) {
              const err12 = { instancePath: instancePath + "/evidence/" + i2, schemaPath: "#/$defs/evidence/required", keyword: "required", params: { missingProperty: "page" }, message: "must have required property 'page'" };
              if (vErrors === null) {
                vErrors = [err12];
              } else {
                vErrors.push(err12);
              }
              errors++;
            }
            if (data6.location === void 0) {
              const err13 = { instancePath: instancePath + "/evidence/" + i2, schemaPath: "#/$defs/evidence/required", keyword: "required", params: { missingProperty: "location" }, message: "must have required property 'location'" };
              if (vErrors === null) {
                vErrors = [err13];
              } else {
                vErrors.push(err13);
              }
              errors++;
            }
            if (data6.observation === void 0) {
              const err14 = { instancePath: instancePath + "/evidence/" + i2, schemaPath: "#/$defs/evidence/required", keyword: "required", params: { missingProperty: "observation" }, message: "must have required property 'observation'" };
              if (vErrors === null) {
                vErrors = [err14];
              } else {
                vErrors.push(err14);
              }
              errors++;
            }
            for (const key1 in data6) {
              if (!(key1 === "page" || key1 === "location" || key1 === "observation")) {
                const err15 = { instancePath: instancePath + "/evidence/" + i2, schemaPath: "#/$defs/evidence/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key1 }, message: "must NOT have additional properties" };
                if (vErrors === null) {
                  vErrors = [err15];
                } else {
                  vErrors.push(err15);
                }
                errors++;
              }
            }
            if (data6.page !== void 0) {
              let data7 = data6.page;
              if (!(typeof data7 == "number" && (!(data7 % 1) && !isNaN(data7))) && data7 !== null) {
                const err16 = { instancePath: instancePath + "/evidence/" + i2 + "/page", schemaPath: "#/$defs/evidence/properties/page/type", keyword: "type", params: { type: schema34.properties.page.type }, message: "must be integer,null" };
                if (vErrors === null) {
                  vErrors = [err16];
                } else {
                  vErrors.push(err16);
                }
                errors++;
              }
              if (typeof data7 == "number") {
                if (data7 < 1 || isNaN(data7)) {
                  const err17 = { instancePath: instancePath + "/evidence/" + i2 + "/page", schemaPath: "#/$defs/evidence/properties/page/minimum", keyword: "minimum", params: { comparison: ">=", limit: 1 }, message: "must be >= 1" };
                  if (vErrors === null) {
                    vErrors = [err17];
                  } else {
                    vErrors.push(err17);
                  }
                  errors++;
                }
              }
            }
            if (data6.location !== void 0) {
              if (typeof data6.location !== "string") {
                const err18 = { instancePath: instancePath + "/evidence/" + i2 + "/location", schemaPath: "#/$defs/evidence/properties/location/type", keyword: "type", params: { type: "string" }, message: "must be string" };
                if (vErrors === null) {
                  vErrors = [err18];
                } else {
                  vErrors.push(err18);
                }
                errors++;
              }
            }
            if (data6.observation !== void 0) {
              if (typeof data6.observation !== "string") {
                const err19 = { instancePath: instancePath + "/evidence/" + i2 + "/observation", schemaPath: "#/$defs/evidence/properties/observation/type", keyword: "type", params: { type: "string" }, message: "must be string" };
                if (vErrors === null) {
                  vErrors = [err19];
                } else {
                  vErrors.push(err19);
                }
                errors++;
              }
            }
          } else {
            const err20 = { instancePath: instancePath + "/evidence/" + i2, schemaPath: "#/$defs/evidence/type", keyword: "type", params: { type: "object" }, message: "must be object" };
            if (vErrors === null) {
              vErrors = [err20];
            } else {
              vErrors.push(err20);
            }
            errors++;
          }
        }
      } else {
        const err21 = { instancePath: instancePath + "/evidence", schemaPath: "#/properties/evidence/type", keyword: "type", params: { type: "array" }, message: "must be array" };
        if (vErrors === null) {
          vErrors = [err21];
        } else {
          vErrors.push(err21);
        }
        errors++;
      }
    }
  } else {
    const err22 = { instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" };
    if (vErrors === null) {
      vErrors = [err22];
    } else {
      vErrors.push(err22);
    }
    errors++;
  }
  validate22.errors = vErrors;
  return errors === 0;
}
validate22.evaluated = { "props": true, "dynamicProps": false, "dynamicItems": false };
var schema35 = { "type": "object", "additionalProperties": false, "required": ["criterion_id", "criterion_text", "applicability", "status", "evidence", "rationale", "problem", "required_fix", "fix_location", "confidence"], "properties": { "criterion_id": { "type": "string", "minLength": 1 }, "criterion_text": { "type": "string", "minLength": 1 }, "applicability": { "enum": ["APPLICABLE", "NOT_APPLICABLE", "UNCERTAIN"] }, "status": { "enum": ["PASS", "FAIL", "NOT_CHECKABLE", "N_A"] }, "evidence": { "type": "array", "items": { "$ref": "#/$defs/evidence" } }, "rationale": { "type": "string" }, "problem": { "type": ["string", "null"] }, "required_fix": { "type": ["string", "null"] }, "fix_location": { "type": ["string", "null"] }, "confidence": { "enum": ["HIGH", "MEDIUM", "LOW"] } } };
function validate25(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) {
  let vErrors = null;
  let errors = 0;
  const evaluated0 = validate25.evaluated;
  if (evaluated0.dynamicProps) {
    evaluated0.props = void 0;
  }
  if (evaluated0.dynamicItems) {
    evaluated0.items = void 0;
  }
  if (data && typeof data == "object" && !Array.isArray(data)) {
    if (data.criterion_id === void 0) {
      const err0 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "criterion_id" }, message: "must have required property 'criterion_id'" };
      if (vErrors === null) {
        vErrors = [err0];
      } else {
        vErrors.push(err0);
      }
      errors++;
    }
    if (data.criterion_text === void 0) {
      const err1 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "criterion_text" }, message: "must have required property 'criterion_text'" };
      if (vErrors === null) {
        vErrors = [err1];
      } else {
        vErrors.push(err1);
      }
      errors++;
    }
    if (data.applicability === void 0) {
      const err2 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "applicability" }, message: "must have required property 'applicability'" };
      if (vErrors === null) {
        vErrors = [err2];
      } else {
        vErrors.push(err2);
      }
      errors++;
    }
    if (data.status === void 0) {
      const err3 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "status" }, message: "must have required property 'status'" };
      if (vErrors === null) {
        vErrors = [err3];
      } else {
        vErrors.push(err3);
      }
      errors++;
    }
    if (data.evidence === void 0) {
      const err4 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "evidence" }, message: "must have required property 'evidence'" };
      if (vErrors === null) {
        vErrors = [err4];
      } else {
        vErrors.push(err4);
      }
      errors++;
    }
    if (data.rationale === void 0) {
      const err5 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "rationale" }, message: "must have required property 'rationale'" };
      if (vErrors === null) {
        vErrors = [err5];
      } else {
        vErrors.push(err5);
      }
      errors++;
    }
    if (data.problem === void 0) {
      const err6 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "problem" }, message: "must have required property 'problem'" };
      if (vErrors === null) {
        vErrors = [err6];
      } else {
        vErrors.push(err6);
      }
      errors++;
    }
    if (data.required_fix === void 0) {
      const err7 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "required_fix" }, message: "must have required property 'required_fix'" };
      if (vErrors === null) {
        vErrors = [err7];
      } else {
        vErrors.push(err7);
      }
      errors++;
    }
    if (data.fix_location === void 0) {
      const err8 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "fix_location" }, message: "must have required property 'fix_location'" };
      if (vErrors === null) {
        vErrors = [err8];
      } else {
        vErrors.push(err8);
      }
      errors++;
    }
    if (data.confidence === void 0) {
      const err9 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "confidence" }, message: "must have required property 'confidence'" };
      if (vErrors === null) {
        vErrors = [err9];
      } else {
        vErrors.push(err9);
      }
      errors++;
    }
    for (const key0 in data) {
      if (!func1.call(schema35.properties, key0)) {
        const err10 = { instancePath, schemaPath: "#/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key0 }, message: "must NOT have additional properties" };
        if (vErrors === null) {
          vErrors = [err10];
        } else {
          vErrors.push(err10);
        }
        errors++;
      }
    }
    if (data.criterion_id !== void 0) {
      let data0 = data.criterion_id;
      if (typeof data0 === "string") {
        if (func2(data0) < 1) {
          const err11 = { instancePath: instancePath + "/criterion_id", schemaPath: "#/properties/criterion_id/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" };
          if (vErrors === null) {
            vErrors = [err11];
          } else {
            vErrors.push(err11);
          }
          errors++;
        }
      } else {
        const err12 = { instancePath: instancePath + "/criterion_id", schemaPath: "#/properties/criterion_id/type", keyword: "type", params: { type: "string" }, message: "must be string" };
        if (vErrors === null) {
          vErrors = [err12];
        } else {
          vErrors.push(err12);
        }
        errors++;
      }
    }
    if (data.criterion_text !== void 0) {
      let data1 = data.criterion_text;
      if (typeof data1 === "string") {
        if (func2(data1) < 1) {
          const err13 = { instancePath: instancePath + "/criterion_text", schemaPath: "#/properties/criterion_text/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" };
          if (vErrors === null) {
            vErrors = [err13];
          } else {
            vErrors.push(err13);
          }
          errors++;
        }
      } else {
        const err14 = { instancePath: instancePath + "/criterion_text", schemaPath: "#/properties/criterion_text/type", keyword: "type", params: { type: "string" }, message: "must be string" };
        if (vErrors === null) {
          vErrors = [err14];
        } else {
          vErrors.push(err14);
        }
        errors++;
      }
    }
    if (data.applicability !== void 0) {
      let data2 = data.applicability;
      if (!(data2 === "APPLICABLE" || data2 === "NOT_APPLICABLE" || data2 === "UNCERTAIN")) {
        const err15 = { instancePath: instancePath + "/applicability", schemaPath: "#/properties/applicability/enum", keyword: "enum", params: { allowedValues: schema35.properties.applicability.enum }, message: "must be equal to one of the allowed values" };
        if (vErrors === null) {
          vErrors = [err15];
        } else {
          vErrors.push(err15);
        }
        errors++;
      }
    }
    if (data.status !== void 0) {
      let data3 = data.status;
      if (!(data3 === "PASS" || data3 === "FAIL" || data3 === "NOT_CHECKABLE" || data3 === "N_A")) {
        const err16 = { instancePath: instancePath + "/status", schemaPath: "#/properties/status/enum", keyword: "enum", params: { allowedValues: schema35.properties.status.enum }, message: "must be equal to one of the allowed values" };
        if (vErrors === null) {
          vErrors = [err16];
        } else {
          vErrors.push(err16);
        }
        errors++;
      }
    }
    if (data.evidence !== void 0) {
      let data4 = data.evidence;
      if (Array.isArray(data4)) {
        const len0 = data4.length;
        for (let i0 = 0; i0 < len0; i0++) {
          let data5 = data4[i0];
          if (data5 && typeof data5 == "object" && !Array.isArray(data5)) {
            if (data5.page === void 0) {
              const err17 = { instancePath: instancePath + "/evidence/" + i0, schemaPath: "#/$defs/evidence/required", keyword: "required", params: { missingProperty: "page" }, message: "must have required property 'page'" };
              if (vErrors === null) {
                vErrors = [err17];
              } else {
                vErrors.push(err17);
              }
              errors++;
            }
            if (data5.location === void 0) {
              const err18 = { instancePath: instancePath + "/evidence/" + i0, schemaPath: "#/$defs/evidence/required", keyword: "required", params: { missingProperty: "location" }, message: "must have required property 'location'" };
              if (vErrors === null) {
                vErrors = [err18];
              } else {
                vErrors.push(err18);
              }
              errors++;
            }
            if (data5.observation === void 0) {
              const err19 = { instancePath: instancePath + "/evidence/" + i0, schemaPath: "#/$defs/evidence/required", keyword: "required", params: { missingProperty: "observation" }, message: "must have required property 'observation'" };
              if (vErrors === null) {
                vErrors = [err19];
              } else {
                vErrors.push(err19);
              }
              errors++;
            }
            for (const key1 in data5) {
              if (!(key1 === "page" || key1 === "location" || key1 === "observation")) {
                const err20 = { instancePath: instancePath + "/evidence/" + i0, schemaPath: "#/$defs/evidence/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key1 }, message: "must NOT have additional properties" };
                if (vErrors === null) {
                  vErrors = [err20];
                } else {
                  vErrors.push(err20);
                }
                errors++;
              }
            }
            if (data5.page !== void 0) {
              let data6 = data5.page;
              if (!(typeof data6 == "number" && (!(data6 % 1) && !isNaN(data6))) && data6 !== null) {
                const err21 = { instancePath: instancePath + "/evidence/" + i0 + "/page", schemaPath: "#/$defs/evidence/properties/page/type", keyword: "type", params: { type: schema34.properties.page.type }, message: "must be integer,null" };
                if (vErrors === null) {
                  vErrors = [err21];
                } else {
                  vErrors.push(err21);
                }
                errors++;
              }
              if (typeof data6 == "number") {
                if (data6 < 1 || isNaN(data6)) {
                  const err22 = { instancePath: instancePath + "/evidence/" + i0 + "/page", schemaPath: "#/$defs/evidence/properties/page/minimum", keyword: "minimum", params: { comparison: ">=", limit: 1 }, message: "must be >= 1" };
                  if (vErrors === null) {
                    vErrors = [err22];
                  } else {
                    vErrors.push(err22);
                  }
                  errors++;
                }
              }
            }
            if (data5.location !== void 0) {
              if (typeof data5.location !== "string") {
                const err23 = { instancePath: instancePath + "/evidence/" + i0 + "/location", schemaPath: "#/$defs/evidence/properties/location/type", keyword: "type", params: { type: "string" }, message: "must be string" };
                if (vErrors === null) {
                  vErrors = [err23];
                } else {
                  vErrors.push(err23);
                }
                errors++;
              }
            }
            if (data5.observation !== void 0) {
              if (typeof data5.observation !== "string") {
                const err24 = { instancePath: instancePath + "/evidence/" + i0 + "/observation", schemaPath: "#/$defs/evidence/properties/observation/type", keyword: "type", params: { type: "string" }, message: "must be string" };
                if (vErrors === null) {
                  vErrors = [err24];
                } else {
                  vErrors.push(err24);
                }
                errors++;
              }
            }
          } else {
            const err25 = { instancePath: instancePath + "/evidence/" + i0, schemaPath: "#/$defs/evidence/type", keyword: "type", params: { type: "object" }, message: "must be object" };
            if (vErrors === null) {
              vErrors = [err25];
            } else {
              vErrors.push(err25);
            }
            errors++;
          }
        }
      } else {
        const err26 = { instancePath: instancePath + "/evidence", schemaPath: "#/properties/evidence/type", keyword: "type", params: { type: "array" }, message: "must be array" };
        if (vErrors === null) {
          vErrors = [err26];
        } else {
          vErrors.push(err26);
        }
        errors++;
      }
    }
    if (data.rationale !== void 0) {
      if (typeof data.rationale !== "string") {
        const err27 = { instancePath: instancePath + "/rationale", schemaPath: "#/properties/rationale/type", keyword: "type", params: { type: "string" }, message: "must be string" };
        if (vErrors === null) {
          vErrors = [err27];
        } else {
          vErrors.push(err27);
        }
        errors++;
      }
    }
    if (data.problem !== void 0) {
      let data10 = data.problem;
      if (typeof data10 !== "string" && data10 !== null) {
        const err28 = { instancePath: instancePath + "/problem", schemaPath: "#/properties/problem/type", keyword: "type", params: { type: schema35.properties.problem.type }, message: "must be string,null" };
        if (vErrors === null) {
          vErrors = [err28];
        } else {
          vErrors.push(err28);
        }
        errors++;
      }
    }
    if (data.required_fix !== void 0) {
      let data11 = data.required_fix;
      if (typeof data11 !== "string" && data11 !== null) {
        const err29 = { instancePath: instancePath + "/required_fix", schemaPath: "#/properties/required_fix/type", keyword: "type", params: { type: schema35.properties.required_fix.type }, message: "must be string,null" };
        if (vErrors === null) {
          vErrors = [err29];
        } else {
          vErrors.push(err29);
        }
        errors++;
      }
    }
    if (data.fix_location !== void 0) {
      let data12 = data.fix_location;
      if (typeof data12 !== "string" && data12 !== null) {
        const err30 = { instancePath: instancePath + "/fix_location", schemaPath: "#/properties/fix_location/type", keyword: "type", params: { type: schema35.properties.fix_location.type }, message: "must be string,null" };
        if (vErrors === null) {
          vErrors = [err30];
        } else {
          vErrors.push(err30);
        }
        errors++;
      }
    }
    if (data.confidence !== void 0) {
      let data13 = data.confidence;
      if (!(data13 === "HIGH" || data13 === "MEDIUM" || data13 === "LOW")) {
        const err31 = { instancePath: instancePath + "/confidence", schemaPath: "#/properties/confidence/enum", keyword: "enum", params: { allowedValues: schema35.properties.confidence.enum }, message: "must be equal to one of the allowed values" };
        if (vErrors === null) {
          vErrors = [err31];
        } else {
          vErrors.push(err31);
        }
        errors++;
      }
    }
  } else {
    const err32 = { instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" };
    if (vErrors === null) {
      vErrors = [err32];
    } else {
      vErrors.push(err32);
    }
    errors++;
  }
  validate25.errors = vErrors;
  return errors === 0;
}
validate25.evaluated = { "props": true, "dynamicProps": false, "dynamicItems": false };
var pattern12 = new RegExp("^Q[0-9]{3,}$", "u");
function validate21(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) {
  ;
  let vErrors = null;
  let errors = 0;
  const evaluated0 = validate21.evaluated;
  if (evaluated0.dynamicProps) {
    evaluated0.props = void 0;
  }
  if (evaluated0.dynamicItems) {
    evaluated0.items = void 0;
  }
  const _errs2 = errors;
  let valid1 = true;
  const _errs3 = errors;
  if (data && typeof data == "object" && !Array.isArray(data)) {
    if (data.run_status !== void 0) {
      if ("COMPLETED" !== data.run_status) {
        const err0 = {};
        if (vErrors === null) {
          vErrors = [err0];
        } else {
          vErrors.push(err0);
        }
        errors++;
      }
    }
  }
  var _valid0 = _errs3 === errors;
  errors = _errs2;
  if (vErrors !== null) {
    if (_errs2) {
      vErrors.length = _errs2;
    } else {
      vErrors = null;
    }
  }
  if (_valid0) {
    const _errs5 = errors;
    if (data && typeof data == "object" && !Array.isArray(data)) {
      if (data.artifact_identity !== void 0) {
        let data1 = data.artifact_identity;
        if (data1 && typeof data1 == "object" && !Array.isArray(data1)) {
          if (data1.match !== void 0) {
            if (true !== data1.match) {
              const err1 = { instancePath: instancePath + "/artifact_identity/match", schemaPath: "#/allOf/0/then/properties/artifact_identity/properties/match/const", keyword: "const", params: { allowedValue: true }, message: "must be equal to constant" };
              if (vErrors === null) {
                vErrors = [err1];
              } else {
                vErrors.push(err1);
              }
              errors++;
            }
          }
          if (data1.computed_sha256 !== void 0) {
            if (typeof data1.computed_sha256 !== "string") {
              const err2 = { instancePath: instancePath + "/artifact_identity/computed_sha256", schemaPath: "#/allOf/0/then/properties/artifact_identity/properties/computed_sha256/type", keyword: "type", params: { type: "string" }, message: "must be string" };
              if (vErrors === null) {
                vErrors = [err2];
              } else {
                vErrors.push(err2);
              }
              errors++;
            }
          }
        }
      }
      if (data.blocking !== void 0) {
        if (data.blocking !== null) {
          const err3 = { instancePath: instancePath + "/blocking", schemaPath: "#/allOf/0/then/properties/blocking/type", keyword: "type", params: { type: "null" }, message: "must be null" };
          if (vErrors === null) {
            vErrors = [err3];
          } else {
            vErrors.push(err3);
          }
          errors++;
        }
      }
      if (data.project_context !== void 0) {
        if (!validate22(data.project_context, { instancePath: instancePath + "/project_context", parentData: data, parentDataProperty: "project_context", rootData, dynamicAnchors })) {
          vErrors = vErrors === null ? validate22.errors : vErrors.concat(validate22.errors);
          errors = vErrors.length;
        }
      }
      if (data.criteria_results !== void 0) {
        let data6 = data.criteria_results;
        if (Array.isArray(data6)) {
          if (data6.length < 1) {
            const err4 = { instancePath: instancePath + "/criteria_results", schemaPath: "#/allOf/0/then/properties/criteria_results/minItems", keyword: "minItems", params: { limit: 1 }, message: "must NOT have fewer than 1 items" };
            if (vErrors === null) {
              vErrors = [err4];
            } else {
              vErrors.push(err4);
            }
            errors++;
          }
        }
      }
    }
    var _valid0 = _errs5 === errors;
    valid1 = _valid0;
    if (valid1) {
      var props0 = {};
      props0.artifact_identity = true;
      props0.blocking = true;
      props0.project_context = true;
      props0.criteria_results = true;
      props0.run_status = true;
    }
  }
  if (!valid1) {
    const err5 = { instancePath, schemaPath: "#/allOf/0/if", keyword: "if", params: { failingKeyword: "then" }, message: 'must match "then" schema' };
    if (vErrors === null) {
      vErrors = [err5];
    } else {
      vErrors.push(err5);
    }
    errors++;
  }
  const _errs15 = errors;
  let valid5 = true;
  const _errs16 = errors;
  if (data && typeof data == "object" && !Array.isArray(data)) {
    if (data.run_status !== void 0) {
      let data7 = data.run_status;
      if (!(data7 === "IDENTITY_BLOCKED" || data7 === "CONFIG_BLOCKED")) {
        const err6 = {};
        if (vErrors === null) {
          vErrors = [err6];
        } else {
          vErrors.push(err6);
        }
        errors++;
      }
    }
  }
  var _valid1 = _errs16 === errors;
  errors = _errs15;
  if (vErrors !== null) {
    if (_errs15) {
      vErrors.length = _errs15;
    } else {
      vErrors = null;
    }
  }
  if (_valid1) {
    const _errs18 = errors;
    if (data && typeof data == "object" && !Array.isArray(data)) {
      if (data.blocking !== void 0) {
        let data8 = data.blocking;
        if (!(data8 && typeof data8 == "object" && !Array.isArray(data8))) {
          const err7 = { instancePath: instancePath + "/blocking", schemaPath: "#/allOf/1/then/properties/blocking/type", keyword: "type", params: { type: "object" }, message: "must be object" };
          if (vErrors === null) {
            vErrors = [err7];
          } else {
            vErrors.push(err7);
          }
          errors++;
        }
      }
      if (data.project_context !== void 0) {
        if (data.project_context !== null) {
          const err8 = { instancePath: instancePath + "/project_context", schemaPath: "#/allOf/1/then/properties/project_context/type", keyword: "type", params: { type: "null" }, message: "must be null" };
          if (vErrors === null) {
            vErrors = [err8];
          } else {
            vErrors.push(err8);
          }
          errors++;
        }
      }
      if (data.criteria_results !== void 0) {
        let data10 = data.criteria_results;
        if (Array.isArray(data10)) {
          if (data10.length > 0) {
            const err9 = { instancePath: instancePath + "/criteria_results", schemaPath: "#/allOf/1/then/properties/criteria_results/maxItems", keyword: "maxItems", params: { limit: 0 }, message: "must NOT have more than 0 items" };
            if (vErrors === null) {
              vErrors = [err9];
            } else {
              vErrors.push(err9);
            }
            errors++;
          }
        }
      }
    }
    var _valid1 = _errs18 === errors;
    valid5 = _valid1;
    if (valid5) {
      var props1 = {};
      props1.blocking = true;
      props1.project_context = true;
      props1.criteria_results = true;
      props1.run_status = true;
    }
  }
  if (!valid5) {
    const err10 = { instancePath, schemaPath: "#/allOf/1/if", keyword: "if", params: { failingKeyword: "then" }, message: 'must match "then" schema' };
    if (vErrors === null) {
      vErrors = [err10];
    } else {
      vErrors.push(err10);
    }
    errors++;
  }
  if (props0 !== true && props1 !== void 0) {
    if (props1 === true) {
      props0 = true;
    } else {
      props0 = props0 || {};
      Object.assign(props0, props1);
    }
  }
  if (data && typeof data == "object" && !Array.isArray(data)) {
    if (data.result_protocol_version === void 0) {
      const err11 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "result_protocol_version" }, message: "must have required property 'result_protocol_version'" };
      if (vErrors === null) {
        vErrors = [err11];
      } else {
        vErrors.push(err11);
      }
      errors++;
    }
    if (data.request_id === void 0) {
      const err12 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "request_id" }, message: "must have required property 'request_id'" };
      if (vErrors === null) {
        vErrors = [err12];
      } else {
        vErrors.push(err12);
      }
      errors++;
    }
    if (data.run_status === void 0) {
      const err13 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "run_status" }, message: "must have required property 'run_status'" };
      if (vErrors === null) {
        vErrors = [err13];
      } else {
        vErrors.push(err13);
      }
      errors++;
    }
    if (data.artifact_type === void 0) {
      const err14 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "artifact_type" }, message: "must have required property 'artifact_type'" };
      if (vErrors === null) {
        vErrors = [err14];
      } else {
        vErrors.push(err14);
      }
      errors++;
    }
    if (data.output_language === void 0) {
      const err15 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "output_language" }, message: "must have required property 'output_language'" };
      if (vErrors === null) {
        vErrors = [err15];
      } else {
        vErrors.push(err15);
      }
      errors++;
    }
    if (data.artifact_identity === void 0) {
      const err16 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "artifact_identity" }, message: "must have required property 'artifact_identity'" };
      if (vErrors === null) {
        vErrors = [err16];
      } else {
        vErrors.push(err16);
      }
      errors++;
    }
    if (data.checklist_identity === void 0) {
      const err17 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "checklist_identity" }, message: "must have required property 'checklist_identity'" };
      if (vErrors === null) {
        vErrors = [err17];
      } else {
        vErrors.push(err17);
      }
      errors++;
    }
    if (data.blocking === void 0) {
      const err18 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "blocking" }, message: "must have required property 'blocking'" };
      if (vErrors === null) {
        vErrors = [err18];
      } else {
        vErrors.push(err18);
      }
      errors++;
    }
    if (data.project_context === void 0) {
      const err19 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "project_context" }, message: "must have required property 'project_context'" };
      if (vErrors === null) {
        vErrors = [err19];
      } else {
        vErrors.push(err19);
      }
      errors++;
    }
    if (data.criteria_results === void 0) {
      const err20 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "criteria_results" }, message: "must have required property 'criteria_results'" };
      if (vErrors === null) {
        vErrors = [err20];
      } else {
        vErrors.push(err20);
      }
      errors++;
    }
    if (data.verification_limitations === void 0) {
      const err21 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "verification_limitations" }, message: "must have required property 'verification_limitations'" };
      if (vErrors === null) {
        vErrors = [err21];
      } else {
        vErrors.push(err21);
      }
      errors++;
    }
    for (const key0 in data) {
      if (!func1.call(schema32.properties, key0)) {
        const err22 = { instancePath, schemaPath: "#/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key0 }, message: "must NOT have additional properties" };
        if (vErrors === null) {
          vErrors = [err22];
        } else {
          vErrors.push(err22);
        }
        errors++;
      }
    }
    if (data.result_protocol_version !== void 0) {
      if ("ARTIFACT-CHECKLIST-RESULT-v1" !== data.result_protocol_version) {
        const err23 = { instancePath: instancePath + "/result_protocol_version", schemaPath: "#/properties/result_protocol_version/const", keyword: "const", params: { allowedValue: "ARTIFACT-CHECKLIST-RESULT-v1" }, message: "must be equal to constant" };
        if (vErrors === null) {
          vErrors = [err23];
        } else {
          vErrors.push(err23);
        }
        errors++;
      }
    }
    if (data.request_id !== void 0) {
      let data12 = data.request_id;
      if (typeof data12 === "string") {
        if (func2(data12) < 1) {
          const err24 = { instancePath: instancePath + "/request_id", schemaPath: "#/properties/request_id/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" };
          if (vErrors === null) {
            vErrors = [err24];
          } else {
            vErrors.push(err24);
          }
          errors++;
        }
      } else {
        const err25 = { instancePath: instancePath + "/request_id", schemaPath: "#/properties/request_id/type", keyword: "type", params: { type: "string" }, message: "must be string" };
        if (vErrors === null) {
          vErrors = [err25];
        } else {
          vErrors.push(err25);
        }
        errors++;
      }
    }
    if (data.run_status !== void 0) {
      let data13 = data.run_status;
      if (!(data13 === "COMPLETED" || data13 === "IDENTITY_BLOCKED" || data13 === "CONFIG_BLOCKED")) {
        const err26 = { instancePath: instancePath + "/run_status", schemaPath: "#/properties/run_status/enum", keyword: "enum", params: { allowedValues: schema32.properties.run_status.enum }, message: "must be equal to one of the allowed values" };
        if (vErrors === null) {
          vErrors = [err26];
        } else {
          vErrors.push(err26);
        }
        errors++;
      }
    }
    if (data.artifact_type !== void 0) {
      let data14 = data.artifact_type;
      if (typeof data14 === "string") {
        if (func2(data14) < 1) {
          const err27 = { instancePath: instancePath + "/artifact_type", schemaPath: "#/properties/artifact_type/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" };
          if (vErrors === null) {
            vErrors = [err27];
          } else {
            vErrors.push(err27);
          }
          errors++;
        }
      } else {
        const err28 = { instancePath: instancePath + "/artifact_type", schemaPath: "#/properties/artifact_type/type", keyword: "type", params: { type: "string" }, message: "must be string" };
        if (vErrors === null) {
          vErrors = [err28];
        } else {
          vErrors.push(err28);
        }
        errors++;
      }
    }
    if (data.output_language !== void 0) {
      let data15 = data.output_language;
      if (!(data15 === "th-TH" || data15 === "en-US")) {
        const err29 = { instancePath: instancePath + "/output_language", schemaPath: "#/properties/output_language/enum", keyword: "enum", params: { allowedValues: schema32.properties.output_language.enum }, message: "must be equal to one of the allowed values" };
        if (vErrors === null) {
          vErrors = [err29];
        } else {
          vErrors.push(err29);
        }
        errors++;
      }
    }
    if (data.artifact_identity !== void 0) {
      let data16 = data.artifact_identity;
      if (data16 && typeof data16 == "object" && !Array.isArray(data16)) {
        if (data16.expected_sha256 === void 0) {
          const err30 = { instancePath: instancePath + "/artifact_identity", schemaPath: "#/properties/artifact_identity/required", keyword: "required", params: { missingProperty: "expected_sha256" }, message: "must have required property 'expected_sha256'" };
          if (vErrors === null) {
            vErrors = [err30];
          } else {
            vErrors.push(err30);
          }
          errors++;
        }
        if (data16.computed_sha256 === void 0) {
          const err31 = { instancePath: instancePath + "/artifact_identity", schemaPath: "#/properties/artifact_identity/required", keyword: "required", params: { missingProperty: "computed_sha256" }, message: "must have required property 'computed_sha256'" };
          if (vErrors === null) {
            vErrors = [err31];
          } else {
            vErrors.push(err31);
          }
          errors++;
        }
        if (data16.match === void 0) {
          const err32 = { instancePath: instancePath + "/artifact_identity", schemaPath: "#/properties/artifact_identity/required", keyword: "required", params: { missingProperty: "match" }, message: "must have required property 'match'" };
          if (vErrors === null) {
            vErrors = [err32];
          } else {
            vErrors.push(err32);
          }
          errors++;
        }
        for (const key1 in data16) {
          if (!(key1 === "expected_sha256" || key1 === "computed_sha256" || key1 === "match")) {
            const err33 = { instancePath: instancePath + "/artifact_identity", schemaPath: "#/properties/artifact_identity/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key1 }, message: "must NOT have additional properties" };
            if (vErrors === null) {
              vErrors = [err33];
            } else {
              vErrors.push(err33);
            }
            errors++;
          }
        }
        if (data16.expected_sha256 !== void 0) {
          let data17 = data16.expected_sha256;
          if (typeof data17 === "string") {
            if (!pattern7.test(data17)) {
              const err34 = { instancePath: instancePath + "/artifact_identity/expected_sha256", schemaPath: "#/properties/artifact_identity/properties/expected_sha256/pattern", keyword: "pattern", params: { pattern: "^[A-Fa-f0-9]{64}$" }, message: 'must match pattern "^[A-Fa-f0-9]{64}$"' };
              if (vErrors === null) {
                vErrors = [err34];
              } else {
                vErrors.push(err34);
              }
              errors++;
            }
          } else {
            const err35 = { instancePath: instancePath + "/artifact_identity/expected_sha256", schemaPath: "#/properties/artifact_identity/properties/expected_sha256/type", keyword: "type", params: { type: "string" }, message: "must be string" };
            if (vErrors === null) {
              vErrors = [err35];
            } else {
              vErrors.push(err35);
            }
            errors++;
          }
        }
        if (data16.computed_sha256 !== void 0) {
          let data18 = data16.computed_sha256;
          if (typeof data18 !== "string" && data18 !== null) {
            const err36 = { instancePath: instancePath + "/artifact_identity/computed_sha256", schemaPath: "#/properties/artifact_identity/properties/computed_sha256/type", keyword: "type", params: { type: schema32.properties.artifact_identity.properties.computed_sha256.type }, message: "must be string,null" };
            if (vErrors === null) {
              vErrors = [err36];
            } else {
              vErrors.push(err36);
            }
            errors++;
          }
          if (typeof data18 === "string") {
            if (!pattern7.test(data18)) {
              const err37 = { instancePath: instancePath + "/artifact_identity/computed_sha256", schemaPath: "#/properties/artifact_identity/properties/computed_sha256/pattern", keyword: "pattern", params: { pattern: "^[A-Fa-f0-9]{64}$" }, message: 'must match pattern "^[A-Fa-f0-9]{64}$"' };
              if (vErrors === null) {
                vErrors = [err37];
              } else {
                vErrors.push(err37);
              }
              errors++;
            }
          }
        }
        if (data16.match !== void 0) {
          let data19 = data16.match;
          if (typeof data19 !== "boolean" && data19 !== null) {
            const err38 = { instancePath: instancePath + "/artifact_identity/match", schemaPath: "#/properties/artifact_identity/properties/match/type", keyword: "type", params: { type: schema32.properties.artifact_identity.properties.match.type }, message: "must be boolean,null" };
            if (vErrors === null) {
              vErrors = [err38];
            } else {
              vErrors.push(err38);
            }
            errors++;
          }
        }
      } else {
        const err39 = { instancePath: instancePath + "/artifact_identity", schemaPath: "#/properties/artifact_identity/type", keyword: "type", params: { type: "object" }, message: "must be object" };
        if (vErrors === null) {
          vErrors = [err39];
        } else {
          vErrors.push(err39);
        }
        errors++;
      }
    }
    if (data.checklist_identity !== void 0) {
      let data20 = data.checklist_identity;
      if (data20 && typeof data20 == "object" && !Array.isArray(data20)) {
        if (data20.checklist_id === void 0) {
          const err40 = { instancePath: instancePath + "/checklist_identity", schemaPath: "#/properties/checklist_identity/required", keyword: "required", params: { missingProperty: "checklist_id" }, message: "must have required property 'checklist_id'" };
          if (vErrors === null) {
            vErrors = [err40];
          } else {
            vErrors.push(err40);
          }
          errors++;
        }
        if (data20.checklist_version === void 0) {
          const err41 = { instancePath: instancePath + "/checklist_identity", schemaPath: "#/properties/checklist_identity/required", keyword: "required", params: { missingProperty: "checklist_version" }, message: "must have required property 'checklist_version'" };
          if (vErrors === null) {
            vErrors = [err41];
          } else {
            vErrors.push(err41);
          }
          errors++;
        }
        if (data20.definition_sha256 === void 0) {
          const err42 = { instancePath: instancePath + "/checklist_identity", schemaPath: "#/properties/checklist_identity/required", keyword: "required", params: { missingProperty: "definition_sha256" }, message: "must have required property 'definition_sha256'" };
          if (vErrors === null) {
            vErrors = [err42];
          } else {
            vErrors.push(err42);
          }
          errors++;
        }
        if (data20.source_pdf_sha256 === void 0) {
          const err43 = { instancePath: instancePath + "/checklist_identity", schemaPath: "#/properties/checklist_identity/required", keyword: "required", params: { missingProperty: "source_pdf_sha256" }, message: "must have required property 'source_pdf_sha256'" };
          if (vErrors === null) {
            vErrors = [err43];
          } else {
            vErrors.push(err43);
          }
          errors++;
        }
        for (const key2 in data20) {
          if (!(key2 === "checklist_id" || key2 === "checklist_version" || key2 === "definition_sha256" || key2 === "source_pdf_sha256")) {
            const err44 = { instancePath: instancePath + "/checklist_identity", schemaPath: "#/properties/checklist_identity/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key2 }, message: "must NOT have additional properties" };
            if (vErrors === null) {
              vErrors = [err44];
            } else {
              vErrors.push(err44);
            }
            errors++;
          }
        }
        if (data20.checklist_id !== void 0) {
          if (typeof data20.checklist_id !== "string") {
            const err45 = { instancePath: instancePath + "/checklist_identity/checklist_id", schemaPath: "#/properties/checklist_identity/properties/checklist_id/type", keyword: "type", params: { type: "string" }, message: "must be string" };
            if (vErrors === null) {
              vErrors = [err45];
            } else {
              vErrors.push(err45);
            }
            errors++;
          }
        }
        if (data20.checklist_version !== void 0) {
          if (typeof data20.checklist_version !== "string") {
            const err46 = { instancePath: instancePath + "/checklist_identity/checklist_version", schemaPath: "#/properties/checklist_identity/properties/checklist_version/type", keyword: "type", params: { type: "string" }, message: "must be string" };
            if (vErrors === null) {
              vErrors = [err46];
            } else {
              vErrors.push(err46);
            }
            errors++;
          }
        }
        if (data20.definition_sha256 !== void 0) {
          let data23 = data20.definition_sha256;
          if (typeof data23 === "string") {
            if (!pattern4.test(data23)) {
              const err47 = { instancePath: instancePath + "/checklist_identity/definition_sha256", schemaPath: "#/properties/checklist_identity/properties/definition_sha256/pattern", keyword: "pattern", params: { pattern: "^[a-f0-9]{64}$" }, message: 'must match pattern "^[a-f0-9]{64}$"' };
              if (vErrors === null) {
                vErrors = [err47];
              } else {
                vErrors.push(err47);
              }
              errors++;
            }
          } else {
            const err48 = { instancePath: instancePath + "/checklist_identity/definition_sha256", schemaPath: "#/properties/checklist_identity/properties/definition_sha256/type", keyword: "type", params: { type: "string" }, message: "must be string" };
            if (vErrors === null) {
              vErrors = [err48];
            } else {
              vErrors.push(err48);
            }
            errors++;
          }
        }
        if (data20.source_pdf_sha256 !== void 0) {
          let data24 = data20.source_pdf_sha256;
          if (typeof data24 === "string") {
            if (!pattern4.test(data24)) {
              const err49 = { instancePath: instancePath + "/checklist_identity/source_pdf_sha256", schemaPath: "#/properties/checklist_identity/properties/source_pdf_sha256/pattern", keyword: "pattern", params: { pattern: "^[a-f0-9]{64}$" }, message: 'must match pattern "^[a-f0-9]{64}$"' };
              if (vErrors === null) {
                vErrors = [err49];
              } else {
                vErrors.push(err49);
              }
              errors++;
            }
          } else {
            const err50 = { instancePath: instancePath + "/checklist_identity/source_pdf_sha256", schemaPath: "#/properties/checklist_identity/properties/source_pdf_sha256/type", keyword: "type", params: { type: "string" }, message: "must be string" };
            if (vErrors === null) {
              vErrors = [err50];
            } else {
              vErrors.push(err50);
            }
            errors++;
          }
        }
      } else {
        const err51 = { instancePath: instancePath + "/checklist_identity", schemaPath: "#/properties/checklist_identity/type", keyword: "type", params: { type: "object" }, message: "must be object" };
        if (vErrors === null) {
          vErrors = [err51];
        } else {
          vErrors.push(err51);
        }
        errors++;
      }
    }
    if (data.blocking !== void 0) {
      let data25 = data.blocking;
      const _errs53 = errors;
      let valid11 = false;
      let passing0 = null;
      const _errs54 = errors;
      if (data25 !== null) {
        const err52 = { instancePath: instancePath + "/blocking", schemaPath: "#/properties/blocking/oneOf/0/type", keyword: "type", params: { type: "null" }, message: "must be null" };
        if (vErrors === null) {
          vErrors = [err52];
        } else {
          vErrors.push(err52);
        }
        errors++;
      }
      var _valid2 = _errs54 === errors;
      if (_valid2) {
        valid11 = true;
        passing0 = 0;
      }
      const _errs56 = errors;
      if (data25 && typeof data25 == "object" && !Array.isArray(data25)) {
        if (data25.code === void 0) {
          const err53 = { instancePath: instancePath + "/blocking", schemaPath: "#/properties/blocking/oneOf/1/required", keyword: "required", params: { missingProperty: "code" }, message: "must have required property 'code'" };
          if (vErrors === null) {
            vErrors = [err53];
          } else {
            vErrors.push(err53);
          }
          errors++;
        }
        if (data25.message === void 0) {
          const err54 = { instancePath: instancePath + "/blocking", schemaPath: "#/properties/blocking/oneOf/1/required", keyword: "required", params: { missingProperty: "message" }, message: "must have required property 'message'" };
          if (vErrors === null) {
            vErrors = [err54];
          } else {
            vErrors.push(err54);
          }
          errors++;
        }
        for (const key3 in data25) {
          if (!(key3 === "code" || key3 === "message")) {
            const err55 = { instancePath: instancePath + "/blocking", schemaPath: "#/properties/blocking/oneOf/1/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key3 }, message: "must NOT have additional properties" };
            if (vErrors === null) {
              vErrors = [err55];
            } else {
              vErrors.push(err55);
            }
            errors++;
          }
        }
        if (data25.code !== void 0) {
          let data26 = data25.code;
          if (!(data26 === "ARTIFACT_UNAVAILABLE" || data26 === "HASH_UNAVAILABLE" || data26 === "HASH_MISMATCH" || data26 === "CHECKLIST_CONFIG_INVALID")) {
            const err56 = { instancePath: instancePath + "/blocking/code", schemaPath: "#/properties/blocking/oneOf/1/properties/code/enum", keyword: "enum", params: { allowedValues: schema32.properties.blocking.oneOf[1].properties.code.enum }, message: "must be equal to one of the allowed values" };
            if (vErrors === null) {
              vErrors = [err56];
            } else {
              vErrors.push(err56);
            }
            errors++;
          }
        }
        if (data25.message !== void 0) {
          let data27 = data25.message;
          if (typeof data27 === "string") {
            if (func2(data27) < 1) {
              const err57 = { instancePath: instancePath + "/blocking/message", schemaPath: "#/properties/blocking/oneOf/1/properties/message/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" };
              if (vErrors === null) {
                vErrors = [err57];
              } else {
                vErrors.push(err57);
              }
              errors++;
            }
          } else {
            const err58 = { instancePath: instancePath + "/blocking/message", schemaPath: "#/properties/blocking/oneOf/1/properties/message/type", keyword: "type", params: { type: "string" }, message: "must be string" };
            if (vErrors === null) {
              vErrors = [err58];
            } else {
              vErrors.push(err58);
            }
            errors++;
          }
        }
      } else {
        const err59 = { instancePath: instancePath + "/blocking", schemaPath: "#/properties/blocking/oneOf/1/type", keyword: "type", params: { type: "object" }, message: "must be object" };
        if (vErrors === null) {
          vErrors = [err59];
        } else {
          vErrors.push(err59);
        }
        errors++;
      }
      var _valid2 = _errs56 === errors;
      if (_valid2 && valid11) {
        valid11 = false;
        passing0 = [passing0, 1];
      } else {
        if (_valid2) {
          valid11 = true;
          passing0 = 1;
        }
      }
      if (!valid11) {
        const err60 = { instancePath: instancePath + "/blocking", schemaPath: "#/properties/blocking/oneOf", keyword: "oneOf", params: { passingSchemas: passing0 }, message: "must match exactly one schema in oneOf" };
        if (vErrors === null) {
          vErrors = [err60];
        } else {
          vErrors.push(err60);
        }
        errors++;
      } else {
        errors = _errs53;
        if (vErrors !== null) {
          if (_errs53) {
            vErrors.length = _errs53;
          } else {
            vErrors = null;
          }
        }
      }
    }
    if (data.project_context !== void 0) {
      let data28 = data.project_context;
      const _errs63 = errors;
      let valid13 = false;
      let passing1 = null;
      const _errs64 = errors;
      if (data28 !== null) {
        const err61 = { instancePath: instancePath + "/project_context", schemaPath: "#/properties/project_context/oneOf/0/type", keyword: "type", params: { type: "null" }, message: "must be null" };
        if (vErrors === null) {
          vErrors = [err61];
        } else {
          vErrors.push(err61);
        }
        errors++;
      }
      var _valid3 = _errs64 === errors;
      if (_valid3) {
        valid13 = true;
        passing1 = 0;
      }
      const _errs66 = errors;
      if (!validate22(data28, { instancePath: instancePath + "/project_context", parentData: data, parentDataProperty: "project_context", rootData, dynamicAnchors })) {
        vErrors = vErrors === null ? validate22.errors : vErrors.concat(validate22.errors);
        errors = vErrors.length;
      }
      var _valid3 = _errs66 === errors;
      if (_valid3 && valid13) {
        valid13 = false;
        passing1 = [passing1, 1];
      } else {
        if (_valid3) {
          valid13 = true;
          passing1 = 1;
        }
      }
      if (!valid13) {
        const err62 = { instancePath: instancePath + "/project_context", schemaPath: "#/properties/project_context/oneOf", keyword: "oneOf", params: { passingSchemas: passing1 }, message: "must match exactly one schema in oneOf" };
        if (vErrors === null) {
          vErrors = [err62];
        } else {
          vErrors.push(err62);
        }
        errors++;
      } else {
        errors = _errs63;
        if (vErrors !== null) {
          if (_errs63) {
            vErrors.length = _errs63;
          } else {
            vErrors = null;
          }
        }
      }
    }
    if (data.criteria_results !== void 0) {
      let data29 = data.criteria_results;
      if (Array.isArray(data29)) {
        const len0 = data29.length;
        for (let i0 = 0; i0 < len0; i0++) {
          if (!validate25(data29[i0], { instancePath: instancePath + "/criteria_results/" + i0, parentData: data29, parentDataProperty: i0, rootData, dynamicAnchors })) {
            vErrors = vErrors === null ? validate25.errors : vErrors.concat(validate25.errors);
            errors = vErrors.length;
          }
        }
      } else {
        const err63 = { instancePath: instancePath + "/criteria_results", schemaPath: "#/properties/criteria_results/type", keyword: "type", params: { type: "array" }, message: "must be array" };
        if (vErrors === null) {
          vErrors = [err63];
        } else {
          vErrors.push(err63);
        }
        errors++;
      }
    }
    if (data.verification_limitations !== void 0) {
      let data31 = data.verification_limitations;
      if (Array.isArray(data31)) {
        const len1 = data31.length;
        for (let i1 = 0; i1 < len1; i1++) {
          if (typeof data31[i1] !== "string") {
            const err64 = { instancePath: instancePath + "/verification_limitations/" + i1, schemaPath: "#/properties/verification_limitations/items/type", keyword: "type", params: { type: "string" }, message: "must be string" };
            if (vErrors === null) {
              vErrors = [err64];
            } else {
              vErrors.push(err64);
            }
            errors++;
          }
        }
      } else {
        const err65 = { instancePath: instancePath + "/verification_limitations", schemaPath: "#/properties/verification_limitations/type", keyword: "type", params: { type: "array" }, message: "must be array" };
        if (vErrors === null) {
          vErrors = [err65];
        } else {
          vErrors.push(err65);
        }
        errors++;
      }
    }
    if (data.supplemental_quality_review !== void 0) {
      let data33 = data.supplemental_quality_review;
      if (data33 && typeof data33 == "object" && !Array.isArray(data33)) {
        if (data33.policy_version === void 0) {
          const err66 = { instancePath: instancePath + "/supplemental_quality_review", schemaPath: "#/properties/supplemental_quality_review/required", keyword: "required", params: { missingProperty: "policy_version" }, message: "must have required property 'policy_version'" };
          if (vErrors === null) {
            vErrors = [err66];
          } else {
            vErrors.push(err66);
          }
          errors++;
        }
        if (data33.checks === void 0) {
          const err67 = { instancePath: instancePath + "/supplemental_quality_review", schemaPath: "#/properties/supplemental_quality_review/required", keyword: "required", params: { missingProperty: "checks" }, message: "must have required property 'checks'" };
          if (vErrors === null) {
            vErrors = [err67];
          } else {
            vErrors.push(err67);
          }
          errors++;
        }
        if (data33.findings === void 0) {
          const err68 = { instancePath: instancePath + "/supplemental_quality_review", schemaPath: "#/properties/supplemental_quality_review/required", keyword: "required", params: { missingProperty: "findings" }, message: "must have required property 'findings'" };
          if (vErrors === null) {
            vErrors = [err68];
          } else {
            vErrors.push(err68);
          }
          errors++;
        }
        if (data33.follow_up_checks === void 0) {
          const err69 = { instancePath: instancePath + "/supplemental_quality_review", schemaPath: "#/properties/supplemental_quality_review/required", keyword: "required", params: { missingProperty: "follow_up_checks" }, message: "must have required property 'follow_up_checks'" };
          if (vErrors === null) {
            vErrors = [err69];
          } else {
            vErrors.push(err69);
          }
          errors++;
        }
        for (const key4 in data33) {
          if (!(key4 === "policy_version" || key4 === "checks" || key4 === "findings" || key4 === "follow_up_checks")) {
            const err70 = { instancePath: instancePath + "/supplemental_quality_review", schemaPath: "#/properties/supplemental_quality_review/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key4 }, message: "must NOT have additional properties" };
            if (vErrors === null) {
              vErrors = [err70];
            } else {
              vErrors.push(err70);
            }
            errors++;
          }
        }
        if (data33.policy_version !== void 0) {
          if ("PROJECT-CHECK-COMMON-REVIEW-v1.1-20261026" !== data33.policy_version) {
            const err71 = { instancePath: instancePath + "/supplemental_quality_review/policy_version", schemaPath: "#/properties/supplemental_quality_review/properties/policy_version/const", keyword: "const", params: { allowedValue: "PROJECT-CHECK-COMMON-REVIEW-v1.1-20261026" }, message: "must be equal to constant" };
            if (vErrors === null) {
              vErrors = [err71];
            } else {
              vErrors.push(err71);
            }
            errors++;
          }
        }
        if (data33.checks !== void 0) {
          let data35 = data33.checks;
          if (Array.isArray(data35)) {
            if (data35.length > 5) {
              const err72 = { instancePath: instancePath + "/supplemental_quality_review/checks", schemaPath: "#/properties/supplemental_quality_review/properties/checks/maxItems", keyword: "maxItems", params: { limit: 5 }, message: "must NOT have more than 5 items" };
              if (vErrors === null) {
                vErrors = [err72];
              } else {
                vErrors.push(err72);
              }
              errors++;
            }
            if (data35.length < 5) {
              const err73 = { instancePath: instancePath + "/supplemental_quality_review/checks", schemaPath: "#/properties/supplemental_quality_review/properties/checks/minItems", keyword: "minItems", params: { limit: 5 }, message: "must NOT have fewer than 5 items" };
              if (vErrors === null) {
                vErrors = [err73];
              } else {
                vErrors.push(err73);
              }
              errors++;
            }
            const len2 = data35.length;
            for (let i2 = 0; i2 < len2; i2++) {
              let data36 = data35[i2];
              if (data36 && typeof data36 == "object" && !Array.isArray(data36)) {
                if (data36.domain === void 0) {
                  const err74 = { instancePath: instancePath + "/supplemental_quality_review/checks/" + i2, schemaPath: "#/properties/supplemental_quality_review/properties/checks/items/required", keyword: "required", params: { missingProperty: "domain" }, message: "must have required property 'domain'" };
                  if (vErrors === null) {
                    vErrors = [err74];
                  } else {
                    vErrors.push(err74);
                  }
                  errors++;
                }
                if (data36.review_status === void 0) {
                  const err75 = { instancePath: instancePath + "/supplemental_quality_review/checks/" + i2, schemaPath: "#/properties/supplemental_quality_review/properties/checks/items/required", keyword: "required", params: { missingProperty: "review_status" }, message: "must have required property 'review_status'" };
                  if (vErrors === null) {
                    vErrors = [err75];
                  } else {
                    vErrors.push(err75);
                  }
                  errors++;
                }
                if (data36.inspected_pages === void 0) {
                  const err76 = { instancePath: instancePath + "/supplemental_quality_review/checks/" + i2, schemaPath: "#/properties/supplemental_quality_review/properties/checks/items/required", keyword: "required", params: { missingProperty: "inspected_pages" }, message: "must have required property 'inspected_pages'" };
                  if (vErrors === null) {
                    vErrors = [err76];
                  } else {
                    vErrors.push(err76);
                  }
                  errors++;
                }
                if (data36.summary === void 0) {
                  const err77 = { instancePath: instancePath + "/supplemental_quality_review/checks/" + i2, schemaPath: "#/properties/supplemental_quality_review/properties/checks/items/required", keyword: "required", params: { missingProperty: "summary" }, message: "must have required property 'summary'" };
                  if (vErrors === null) {
                    vErrors = [err77];
                  } else {
                    vErrors.push(err77);
                  }
                  errors++;
                }
                for (const key5 in data36) {
                  if (!(key5 === "domain" || key5 === "review_status" || key5 === "inspected_pages" || key5 === "summary")) {
                    const err78 = { instancePath: instancePath + "/supplemental_quality_review/checks/" + i2, schemaPath: "#/properties/supplemental_quality_review/properties/checks/items/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key5 }, message: "must NOT have additional properties" };
                    if (vErrors === null) {
                      vErrors = [err78];
                    } else {
                      vErrors.push(err78);
                    }
                    errors++;
                  }
                }
                if (data36.domain !== void 0) {
                  let data37 = data36.domain;
                  if (!(data37 === "LAYOUT" || data37 === "REFERENCES" || data37 === "CAPTIONS" || data37 === "MATHEMATICS" || data37 === "EXPERT_SOUNDNESS")) {
                    const err79 = { instancePath: instancePath + "/supplemental_quality_review/checks/" + i2 + "/domain", schemaPath: "#/properties/supplemental_quality_review/properties/checks/items/properties/domain/enum", keyword: "enum", params: { allowedValues: schema32.properties.supplemental_quality_review.properties.checks.items.properties.domain.enum }, message: "must be equal to one of the allowed values" };
                    if (vErrors === null) {
                      vErrors = [err79];
                    } else {
                      vErrors.push(err79);
                    }
                    errors++;
                  }
                }
                if (data36.review_status !== void 0) {
                  let data38 = data36.review_status;
                  if (!(data38 === "INSPECTED" || data38 === "PARTIAL" || data38 === "NOT_PRESENT" || data38 === "NOT_CHECKABLE")) {
                    const err80 = { instancePath: instancePath + "/supplemental_quality_review/checks/" + i2 + "/review_status", schemaPath: "#/properties/supplemental_quality_review/properties/checks/items/properties/review_status/enum", keyword: "enum", params: { allowedValues: schema32.properties.supplemental_quality_review.properties.checks.items.properties.review_status.enum }, message: "must be equal to one of the allowed values" };
                    if (vErrors === null) {
                      vErrors = [err80];
                    } else {
                      vErrors.push(err80);
                    }
                    errors++;
                  }
                }
                if (data36.inspected_pages !== void 0) {
                  let data39 = data36.inspected_pages;
                  if (Array.isArray(data39)) {
                    const len3 = data39.length;
                    for (let i3 = 0; i3 < len3; i3++) {
                      let data40 = data39[i3];
                      if (!(typeof data40 == "number" && (!(data40 % 1) && !isNaN(data40)))) {
                        const err81 = { instancePath: instancePath + "/supplemental_quality_review/checks/" + i2 + "/inspected_pages/" + i3, schemaPath: "#/properties/supplemental_quality_review/properties/checks/items/properties/inspected_pages/items/type", keyword: "type", params: { type: "integer" }, message: "must be integer" };
                        if (vErrors === null) {
                          vErrors = [err81];
                        } else {
                          vErrors.push(err81);
                        }
                        errors++;
                      }
                      if (typeof data40 == "number") {
                        if (data40 < 1 || isNaN(data40)) {
                          const err82 = { instancePath: instancePath + "/supplemental_quality_review/checks/" + i2 + "/inspected_pages/" + i3, schemaPath: "#/properties/supplemental_quality_review/properties/checks/items/properties/inspected_pages/items/minimum", keyword: "minimum", params: { comparison: ">=", limit: 1 }, message: "must be >= 1" };
                          if (vErrors === null) {
                            vErrors = [err82];
                          } else {
                            vErrors.push(err82);
                          }
                          errors++;
                        }
                      }
                    }
                    let i4 = data39.length;
                    let j0;
                    if (i4 > 1) {
                      const indices0 = {};
                      for (; i4--; ) {
                        let item0 = data39[i4];
                        if (!(typeof item0 == "number" && (!(item0 % 1) && !isNaN(item0)))) {
                          continue;
                        }
                        if (typeof indices0[item0] == "number") {
                          j0 = indices0[item0];
                          const err83 = { instancePath: instancePath + "/supplemental_quality_review/checks/" + i2 + "/inspected_pages", schemaPath: "#/properties/supplemental_quality_review/properties/checks/items/properties/inspected_pages/uniqueItems", keyword: "uniqueItems", params: { i: i4, j: j0 }, message: "must NOT have duplicate items (items ## " + j0 + " and " + i4 + " are identical)" };
                          if (vErrors === null) {
                            vErrors = [err83];
                          } else {
                            vErrors.push(err83);
                          }
                          errors++;
                          break;
                        }
                        indices0[item0] = i4;
                      }
                    }
                  } else {
                    const err84 = { instancePath: instancePath + "/supplemental_quality_review/checks/" + i2 + "/inspected_pages", schemaPath: "#/properties/supplemental_quality_review/properties/checks/items/properties/inspected_pages/type", keyword: "type", params: { type: "array" }, message: "must be array" };
                    if (vErrors === null) {
                      vErrors = [err84];
                    } else {
                      vErrors.push(err84);
                    }
                    errors++;
                  }
                }
                if (data36.summary !== void 0) {
                  let data41 = data36.summary;
                  if (typeof data41 === "string") {
                    if (func2(data41) < 1) {
                      const err85 = { instancePath: instancePath + "/supplemental_quality_review/checks/" + i2 + "/summary", schemaPath: "#/properties/supplemental_quality_review/properties/checks/items/properties/summary/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" };
                      if (vErrors === null) {
                        vErrors = [err85];
                      } else {
                        vErrors.push(err85);
                      }
                      errors++;
                    }
                  } else {
                    const err86 = { instancePath: instancePath + "/supplemental_quality_review/checks/" + i2 + "/summary", schemaPath: "#/properties/supplemental_quality_review/properties/checks/items/properties/summary/type", keyword: "type", params: { type: "string" }, message: "must be string" };
                    if (vErrors === null) {
                      vErrors = [err86];
                    } else {
                      vErrors.push(err86);
                    }
                    errors++;
                  }
                }
              } else {
                const err87 = { instancePath: instancePath + "/supplemental_quality_review/checks/" + i2, schemaPath: "#/properties/supplemental_quality_review/properties/checks/items/type", keyword: "type", params: { type: "object" }, message: "must be object" };
                if (vErrors === null) {
                  vErrors = [err87];
                } else {
                  vErrors.push(err87);
                }
                errors++;
              }
            }
          } else {
            const err88 = { instancePath: instancePath + "/supplemental_quality_review/checks", schemaPath: "#/properties/supplemental_quality_review/properties/checks/type", keyword: "type", params: { type: "array" }, message: "must be array" };
            if (vErrors === null) {
              vErrors = [err88];
            } else {
              vErrors.push(err88);
            }
            errors++;
          }
        }
        if (data33.findings !== void 0) {
          let data42 = data33.findings;
          if (Array.isArray(data42)) {
            const len4 = data42.length;
            for (let i5 = 0; i5 < len4; i5++) {
              let data43 = data42[i5];
              if (data43 && typeof data43 == "object" && !Array.isArray(data43)) {
                if (data43.finding_id === void 0) {
                  const err89 = { instancePath: instancePath + "/supplemental_quality_review/findings/" + i5, schemaPath: "#/properties/supplemental_quality_review/properties/findings/items/required", keyword: "required", params: { missingProperty: "finding_id" }, message: "must have required property 'finding_id'" };
                  if (vErrors === null) {
                    vErrors = [err89];
                  } else {
                    vErrors.push(err89);
                  }
                  errors++;
                }
                if (data43.domain === void 0) {
                  const err90 = { instancePath: instancePath + "/supplemental_quality_review/findings/" + i5, schemaPath: "#/properties/supplemental_quality_review/properties/findings/items/required", keyword: "required", params: { missingProperty: "domain" }, message: "must have required property 'domain'" };
                  if (vErrors === null) {
                    vErrors = [err90];
                  } else {
                    vErrors.push(err90);
                  }
                  errors++;
                }
                if (data43.priority === void 0) {
                  const err91 = { instancePath: instancePath + "/supplemental_quality_review/findings/" + i5, schemaPath: "#/properties/supplemental_quality_review/properties/findings/items/required", keyword: "required", params: { missingProperty: "priority" }, message: "must have required property 'priority'" };
                  if (vErrors === null) {
                    vErrors = [err91];
                  } else {
                    vErrors.push(err91);
                  }
                  errors++;
                }
                if (data43.location === void 0) {
                  const err92 = { instancePath: instancePath + "/supplemental_quality_review/findings/" + i5, schemaPath: "#/properties/supplemental_quality_review/properties/findings/items/required", keyword: "required", params: { missingProperty: "location" }, message: "must have required property 'location'" };
                  if (vErrors === null) {
                    vErrors = [err92];
                  } else {
                    vErrors.push(err92);
                  }
                  errors++;
                }
                if (data43.issue === void 0) {
                  const err93 = { instancePath: instancePath + "/supplemental_quality_review/findings/" + i5, schemaPath: "#/properties/supplemental_quality_review/properties/findings/items/required", keyword: "required", params: { missingProperty: "issue" }, message: "must have required property 'issue'" };
                  if (vErrors === null) {
                    vErrors = [err93];
                  } else {
                    vErrors.push(err93);
                  }
                  errors++;
                }
                if (data43.reason === void 0) {
                  const err94 = { instancePath: instancePath + "/supplemental_quality_review/findings/" + i5, schemaPath: "#/properties/supplemental_quality_review/properties/findings/items/required", keyword: "required", params: { missingProperty: "reason" }, message: "must have required property 'reason'" };
                  if (vErrors === null) {
                    vErrors = [err94];
                  } else {
                    vErrors.push(err94);
                  }
                  errors++;
                }
                if (data43.recommendation === void 0) {
                  const err95 = { instancePath: instancePath + "/supplemental_quality_review/findings/" + i5, schemaPath: "#/properties/supplemental_quality_review/properties/findings/items/required", keyword: "required", params: { missingProperty: "recommendation" }, message: "must have required property 'recommendation'" };
                  if (vErrors === null) {
                    vErrors = [err95];
                  } else {
                    vErrors.push(err95);
                  }
                  errors++;
                }
                if (data43.evidence === void 0) {
                  const err96 = { instancePath: instancePath + "/supplemental_quality_review/findings/" + i5, schemaPath: "#/properties/supplemental_quality_review/properties/findings/items/required", keyword: "required", params: { missingProperty: "evidence" }, message: "must have required property 'evidence'" };
                  if (vErrors === null) {
                    vErrors = [err96];
                  } else {
                    vErrors.push(err96);
                  }
                  errors++;
                }
                for (const key6 in data43) {
                  if (!(key6 === "finding_id" || key6 === "domain" || key6 === "priority" || key6 === "location" || key6 === "issue" || key6 === "reason" || key6 === "recommendation" || key6 === "evidence")) {
                    const err97 = { instancePath: instancePath + "/supplemental_quality_review/findings/" + i5, schemaPath: "#/properties/supplemental_quality_review/properties/findings/items/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key6 }, message: "must NOT have additional properties" };
                    if (vErrors === null) {
                      vErrors = [err97];
                    } else {
                      vErrors.push(err97);
                    }
                    errors++;
                  }
                }
                if (data43.finding_id !== void 0) {
                  let data44 = data43.finding_id;
                  if (typeof data44 === "string") {
                    if (!pattern12.test(data44)) {
                      const err98 = { instancePath: instancePath + "/supplemental_quality_review/findings/" + i5 + "/finding_id", schemaPath: "#/properties/supplemental_quality_review/properties/findings/items/properties/finding_id/pattern", keyword: "pattern", params: { pattern: "^Q[0-9]{3,}$" }, message: 'must match pattern "^Q[0-9]{3,}$"' };
                      if (vErrors === null) {
                        vErrors = [err98];
                      } else {
                        vErrors.push(err98);
                      }
                      errors++;
                    }
                  } else {
                    const err99 = { instancePath: instancePath + "/supplemental_quality_review/findings/" + i5 + "/finding_id", schemaPath: "#/properties/supplemental_quality_review/properties/findings/items/properties/finding_id/type", keyword: "type", params: { type: "string" }, message: "must be string" };
                    if (vErrors === null) {
                      vErrors = [err99];
                    } else {
                      vErrors.push(err99);
                    }
                    errors++;
                  }
                }
                if (data43.domain !== void 0) {
                  let data45 = data43.domain;
                  if (!(data45 === "LAYOUT" || data45 === "REFERENCES" || data45 === "CAPTIONS" || data45 === "MATHEMATICS" || data45 === "EXPERT_SOUNDNESS")) {
                    const err100 = { instancePath: instancePath + "/supplemental_quality_review/findings/" + i5 + "/domain", schemaPath: "#/properties/supplemental_quality_review/properties/findings/items/properties/domain/enum", keyword: "enum", params: { allowedValues: schema32.properties.supplemental_quality_review.properties.findings.items.properties.domain.enum }, message: "must be equal to one of the allowed values" };
                    if (vErrors === null) {
                      vErrors = [err100];
                    } else {
                      vErrors.push(err100);
                    }
                    errors++;
                  }
                }
                if (data43.priority !== void 0) {
                  let data46 = data43.priority;
                  if (!(data46 === "CRITICAL" || data46 === "MAJOR" || data46 === "MINOR" || data46 === "EDITORIAL")) {
                    const err101 = { instancePath: instancePath + "/supplemental_quality_review/findings/" + i5 + "/priority", schemaPath: "#/properties/supplemental_quality_review/properties/findings/items/properties/priority/enum", keyword: "enum", params: { allowedValues: schema32.properties.supplemental_quality_review.properties.findings.items.properties.priority.enum }, message: "must be equal to one of the allowed values" };
                    if (vErrors === null) {
                      vErrors = [err101];
                    } else {
                      vErrors.push(err101);
                    }
                    errors++;
                  }
                }
                if (data43.location !== void 0) {
                  let data47 = data43.location;
                  if (typeof data47 === "string") {
                    if (func2(data47) < 1) {
                      const err102 = { instancePath: instancePath + "/supplemental_quality_review/findings/" + i5 + "/location", schemaPath: "#/properties/supplemental_quality_review/properties/findings/items/properties/location/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" };
                      if (vErrors === null) {
                        vErrors = [err102];
                      } else {
                        vErrors.push(err102);
                      }
                      errors++;
                    }
                  } else {
                    const err103 = { instancePath: instancePath + "/supplemental_quality_review/findings/" + i5 + "/location", schemaPath: "#/properties/supplemental_quality_review/properties/findings/items/properties/location/type", keyword: "type", params: { type: "string" }, message: "must be string" };
                    if (vErrors === null) {
                      vErrors = [err103];
                    } else {
                      vErrors.push(err103);
                    }
                    errors++;
                  }
                }
                if (data43.issue !== void 0) {
                  let data48 = data43.issue;
                  if (typeof data48 === "string") {
                    if (func2(data48) < 1) {
                      const err104 = { instancePath: instancePath + "/supplemental_quality_review/findings/" + i5 + "/issue", schemaPath: "#/properties/supplemental_quality_review/properties/findings/items/properties/issue/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" };
                      if (vErrors === null) {
                        vErrors = [err104];
                      } else {
                        vErrors.push(err104);
                      }
                      errors++;
                    }
                  } else {
                    const err105 = { instancePath: instancePath + "/supplemental_quality_review/findings/" + i5 + "/issue", schemaPath: "#/properties/supplemental_quality_review/properties/findings/items/properties/issue/type", keyword: "type", params: { type: "string" }, message: "must be string" };
                    if (vErrors === null) {
                      vErrors = [err105];
                    } else {
                      vErrors.push(err105);
                    }
                    errors++;
                  }
                }
                if (data43.reason !== void 0) {
                  let data49 = data43.reason;
                  if (typeof data49 === "string") {
                    if (func2(data49) < 1) {
                      const err106 = { instancePath: instancePath + "/supplemental_quality_review/findings/" + i5 + "/reason", schemaPath: "#/properties/supplemental_quality_review/properties/findings/items/properties/reason/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" };
                      if (vErrors === null) {
                        vErrors = [err106];
                      } else {
                        vErrors.push(err106);
                      }
                      errors++;
                    }
                  } else {
                    const err107 = { instancePath: instancePath + "/supplemental_quality_review/findings/" + i5 + "/reason", schemaPath: "#/properties/supplemental_quality_review/properties/findings/items/properties/reason/type", keyword: "type", params: { type: "string" }, message: "must be string" };
                    if (vErrors === null) {
                      vErrors = [err107];
                    } else {
                      vErrors.push(err107);
                    }
                    errors++;
                  }
                }
                if (data43.recommendation !== void 0) {
                  let data50 = data43.recommendation;
                  if (typeof data50 === "string") {
                    if (func2(data50) < 1) {
                      const err108 = { instancePath: instancePath + "/supplemental_quality_review/findings/" + i5 + "/recommendation", schemaPath: "#/properties/supplemental_quality_review/properties/findings/items/properties/recommendation/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" };
                      if (vErrors === null) {
                        vErrors = [err108];
                      } else {
                        vErrors.push(err108);
                      }
                      errors++;
                    }
                  } else {
                    const err109 = { instancePath: instancePath + "/supplemental_quality_review/findings/" + i5 + "/recommendation", schemaPath: "#/properties/supplemental_quality_review/properties/findings/items/properties/recommendation/type", keyword: "type", params: { type: "string" }, message: "must be string" };
                    if (vErrors === null) {
                      vErrors = [err109];
                    } else {
                      vErrors.push(err109);
                    }
                    errors++;
                  }
                }
                if (data43.evidence !== void 0) {
                  let data51 = data43.evidence;
                  if (Array.isArray(data51)) {
                    if (data51.length < 1) {
                      const err110 = { instancePath: instancePath + "/supplemental_quality_review/findings/" + i5 + "/evidence", schemaPath: "#/properties/supplemental_quality_review/properties/findings/items/properties/evidence/minItems", keyword: "minItems", params: { limit: 1 }, message: "must NOT have fewer than 1 items" };
                      if (vErrors === null) {
                        vErrors = [err110];
                      } else {
                        vErrors.push(err110);
                      }
                      errors++;
                    }
                    const len5 = data51.length;
                    for (let i6 = 0; i6 < len5; i6++) {
                      let data52 = data51[i6];
                      if (data52 && typeof data52 == "object" && !Array.isArray(data52)) {
                        if (data52.page === void 0) {
                          const err111 = { instancePath: instancePath + "/supplemental_quality_review/findings/" + i5 + "/evidence/" + i6, schemaPath: "#/properties/supplemental_quality_review/properties/findings/items/properties/evidence/items/required", keyword: "required", params: { missingProperty: "page" }, message: "must have required property 'page'" };
                          if (vErrors === null) {
                            vErrors = [err111];
                          } else {
                            vErrors.push(err111);
                          }
                          errors++;
                        }
                        if (data52.observation === void 0) {
                          const err112 = { instancePath: instancePath + "/supplemental_quality_review/findings/" + i5 + "/evidence/" + i6, schemaPath: "#/properties/supplemental_quality_review/properties/findings/items/properties/evidence/items/required", keyword: "required", params: { missingProperty: "observation" }, message: "must have required property 'observation'" };
                          if (vErrors === null) {
                            vErrors = [err112];
                          } else {
                            vErrors.push(err112);
                          }
                          errors++;
                        }
                        for (const key7 in data52) {
                          if (!(key7 === "page" || key7 === "observation")) {
                            const err113 = { instancePath: instancePath + "/supplemental_quality_review/findings/" + i5 + "/evidence/" + i6, schemaPath: "#/properties/supplemental_quality_review/properties/findings/items/properties/evidence/items/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key7 }, message: "must NOT have additional properties" };
                            if (vErrors === null) {
                              vErrors = [err113];
                            } else {
                              vErrors.push(err113);
                            }
                            errors++;
                          }
                        }
                        if (data52.page !== void 0) {
                          let data53 = data52.page;
                          if (!(typeof data53 == "number" && (!(data53 % 1) && !isNaN(data53)))) {
                            const err114 = { instancePath: instancePath + "/supplemental_quality_review/findings/" + i5 + "/evidence/" + i6 + "/page", schemaPath: "#/properties/supplemental_quality_review/properties/findings/items/properties/evidence/items/properties/page/type", keyword: "type", params: { type: "integer" }, message: "must be integer" };
                            if (vErrors === null) {
                              vErrors = [err114];
                            } else {
                              vErrors.push(err114);
                            }
                            errors++;
                          }
                          if (typeof data53 == "number") {
                            if (data53 < 1 || isNaN(data53)) {
                              const err115 = { instancePath: instancePath + "/supplemental_quality_review/findings/" + i5 + "/evidence/" + i6 + "/page", schemaPath: "#/properties/supplemental_quality_review/properties/findings/items/properties/evidence/items/properties/page/minimum", keyword: "minimum", params: { comparison: ">=", limit: 1 }, message: "must be >= 1" };
                              if (vErrors === null) {
                                vErrors = [err115];
                              } else {
                                vErrors.push(err115);
                              }
                              errors++;
                            }
                          }
                        }
                        if (data52.observation !== void 0) {
                          let data54 = data52.observation;
                          if (typeof data54 === "string") {
                            if (func2(data54) < 1) {
                              const err116 = { instancePath: instancePath + "/supplemental_quality_review/findings/" + i5 + "/evidence/" + i6 + "/observation", schemaPath: "#/properties/supplemental_quality_review/properties/findings/items/properties/evidence/items/properties/observation/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" };
                              if (vErrors === null) {
                                vErrors = [err116];
                              } else {
                                vErrors.push(err116);
                              }
                              errors++;
                            }
                          } else {
                            const err117 = { instancePath: instancePath + "/supplemental_quality_review/findings/" + i5 + "/evidence/" + i6 + "/observation", schemaPath: "#/properties/supplemental_quality_review/properties/findings/items/properties/evidence/items/properties/observation/type", keyword: "type", params: { type: "string" }, message: "must be string" };
                            if (vErrors === null) {
                              vErrors = [err117];
                            } else {
                              vErrors.push(err117);
                            }
                            errors++;
                          }
                        }
                      } else {
                        const err118 = { instancePath: instancePath + "/supplemental_quality_review/findings/" + i5 + "/evidence/" + i6, schemaPath: "#/properties/supplemental_quality_review/properties/findings/items/properties/evidence/items/type", keyword: "type", params: { type: "object" }, message: "must be object" };
                        if (vErrors === null) {
                          vErrors = [err118];
                        } else {
                          vErrors.push(err118);
                        }
                        errors++;
                      }
                    }
                  } else {
                    const err119 = { instancePath: instancePath + "/supplemental_quality_review/findings/" + i5 + "/evidence", schemaPath: "#/properties/supplemental_quality_review/properties/findings/items/properties/evidence/type", keyword: "type", params: { type: "array" }, message: "must be array" };
                    if (vErrors === null) {
                      vErrors = [err119];
                    } else {
                      vErrors.push(err119);
                    }
                    errors++;
                  }
                }
              } else {
                const err120 = { instancePath: instancePath + "/supplemental_quality_review/findings/" + i5, schemaPath: "#/properties/supplemental_quality_review/properties/findings/items/type", keyword: "type", params: { type: "object" }, message: "must be object" };
                if (vErrors === null) {
                  vErrors = [err120];
                } else {
                  vErrors.push(err120);
                }
                errors++;
              }
            }
          } else {
            const err121 = { instancePath: instancePath + "/supplemental_quality_review/findings", schemaPath: "#/properties/supplemental_quality_review/properties/findings/type", keyword: "type", params: { type: "array" }, message: "must be array" };
            if (vErrors === null) {
              vErrors = [err121];
            } else {
              vErrors.push(err121);
            }
            errors++;
          }
        }
        if (data33.follow_up_checks !== void 0) {
          let data55 = data33.follow_up_checks;
          if (Array.isArray(data55)) {
            const len6 = data55.length;
            for (let i7 = 0; i7 < len6; i7++) {
              let data56 = data55[i7];
              if (data56 && typeof data56 == "object" && !Array.isArray(data56)) {
                if (data56.domain === void 0) {
                  const err122 = { instancePath: instancePath + "/supplemental_quality_review/follow_up_checks/" + i7, schemaPath: "#/properties/supplemental_quality_review/properties/follow_up_checks/items/required", keyword: "required", params: { missingProperty: "domain" }, message: "must have required property 'domain'" };
                  if (vErrors === null) {
                    vErrors = [err122];
                  } else {
                    vErrors.push(err122);
                  }
                  errors++;
                }
                if (data56.question === void 0) {
                  const err123 = { instancePath: instancePath + "/supplemental_quality_review/follow_up_checks/" + i7, schemaPath: "#/properties/supplemental_quality_review/properties/follow_up_checks/items/required", keyword: "required", params: { missingProperty: "question" }, message: "must have required property 'question'" };
                  if (vErrors === null) {
                    vErrors = [err123];
                  } else {
                    vErrors.push(err123);
                  }
                  errors++;
                }
                if (data56.reason === void 0) {
                  const err124 = { instancePath: instancePath + "/supplemental_quality_review/follow_up_checks/" + i7, schemaPath: "#/properties/supplemental_quality_review/properties/follow_up_checks/items/required", keyword: "required", params: { missingProperty: "reason" }, message: "must have required property 'reason'" };
                  if (vErrors === null) {
                    vErrors = [err124];
                  } else {
                    vErrors.push(err124);
                  }
                  errors++;
                }
                if (data56.required_evidence === void 0) {
                  const err125 = { instancePath: instancePath + "/supplemental_quality_review/follow_up_checks/" + i7, schemaPath: "#/properties/supplemental_quality_review/properties/follow_up_checks/items/required", keyword: "required", params: { missingProperty: "required_evidence" }, message: "must have required property 'required_evidence'" };
                  if (vErrors === null) {
                    vErrors = [err125];
                  } else {
                    vErrors.push(err125);
                  }
                  errors++;
                }
                if (data56.page === void 0) {
                  const err126 = { instancePath: instancePath + "/supplemental_quality_review/follow_up_checks/" + i7, schemaPath: "#/properties/supplemental_quality_review/properties/follow_up_checks/items/required", keyword: "required", params: { missingProperty: "page" }, message: "must have required property 'page'" };
                  if (vErrors === null) {
                    vErrors = [err126];
                  } else {
                    vErrors.push(err126);
                  }
                  errors++;
                }
                if (data56.criterion_refs === void 0) {
                  const err127 = { instancePath: instancePath + "/supplemental_quality_review/follow_up_checks/" + i7, schemaPath: "#/properties/supplemental_quality_review/properties/follow_up_checks/items/required", keyword: "required", params: { missingProperty: "criterion_refs" }, message: "must have required property 'criterion_refs'" };
                  if (vErrors === null) {
                    vErrors = [err127];
                  } else {
                    vErrors.push(err127);
                  }
                  errors++;
                }
                for (const key8 in data56) {
                  if (!(key8 === "domain" || key8 === "question" || key8 === "reason" || key8 === "required_evidence" || key8 === "page" || key8 === "criterion_refs")) {
                    const err128 = { instancePath: instancePath + "/supplemental_quality_review/follow_up_checks/" + i7, schemaPath: "#/properties/supplemental_quality_review/properties/follow_up_checks/items/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key8 }, message: "must NOT have additional properties" };
                    if (vErrors === null) {
                      vErrors = [err128];
                    } else {
                      vErrors.push(err128);
                    }
                    errors++;
                  }
                }
                if (data56.domain !== void 0) {
                  let data57 = data56.domain;
                  if (!(data57 === "LAYOUT" || data57 === "REFERENCES" || data57 === "CAPTIONS" || data57 === "MATHEMATICS" || data57 === "EXPERT_SOUNDNESS")) {
                    const err129 = { instancePath: instancePath + "/supplemental_quality_review/follow_up_checks/" + i7 + "/domain", schemaPath: "#/properties/supplemental_quality_review/properties/follow_up_checks/items/properties/domain/enum", keyword: "enum", params: { allowedValues: schema32.properties.supplemental_quality_review.properties.follow_up_checks.items.properties.domain.enum }, message: "must be equal to one of the allowed values" };
                    if (vErrors === null) {
                      vErrors = [err129];
                    } else {
                      vErrors.push(err129);
                    }
                    errors++;
                  }
                }
                if (data56.question !== void 0) {
                  let data58 = data56.question;
                  if (typeof data58 === "string") {
                    if (func2(data58) < 1) {
                      const err130 = { instancePath: instancePath + "/supplemental_quality_review/follow_up_checks/" + i7 + "/question", schemaPath: "#/properties/supplemental_quality_review/properties/follow_up_checks/items/properties/question/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" };
                      if (vErrors === null) {
                        vErrors = [err130];
                      } else {
                        vErrors.push(err130);
                      }
                      errors++;
                    }
                  } else {
                    const err131 = { instancePath: instancePath + "/supplemental_quality_review/follow_up_checks/" + i7 + "/question", schemaPath: "#/properties/supplemental_quality_review/properties/follow_up_checks/items/properties/question/type", keyword: "type", params: { type: "string" }, message: "must be string" };
                    if (vErrors === null) {
                      vErrors = [err131];
                    } else {
                      vErrors.push(err131);
                    }
                    errors++;
                  }
                }
                if (data56.reason !== void 0) {
                  let data59 = data56.reason;
                  if (typeof data59 === "string") {
                    if (func2(data59) < 1) {
                      const err132 = { instancePath: instancePath + "/supplemental_quality_review/follow_up_checks/" + i7 + "/reason", schemaPath: "#/properties/supplemental_quality_review/properties/follow_up_checks/items/properties/reason/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" };
                      if (vErrors === null) {
                        vErrors = [err132];
                      } else {
                        vErrors.push(err132);
                      }
                      errors++;
                    }
                  } else {
                    const err133 = { instancePath: instancePath + "/supplemental_quality_review/follow_up_checks/" + i7 + "/reason", schemaPath: "#/properties/supplemental_quality_review/properties/follow_up_checks/items/properties/reason/type", keyword: "type", params: { type: "string" }, message: "must be string" };
                    if (vErrors === null) {
                      vErrors = [err133];
                    } else {
                      vErrors.push(err133);
                    }
                    errors++;
                  }
                }
                if (data56.required_evidence !== void 0) {
                  let data60 = data56.required_evidence;
                  if (typeof data60 === "string") {
                    if (func2(data60) < 1) {
                      const err134 = { instancePath: instancePath + "/supplemental_quality_review/follow_up_checks/" + i7 + "/required_evidence", schemaPath: "#/properties/supplemental_quality_review/properties/follow_up_checks/items/properties/required_evidence/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" };
                      if (vErrors === null) {
                        vErrors = [err134];
                      } else {
                        vErrors.push(err134);
                      }
                      errors++;
                    }
                  } else {
                    const err135 = { instancePath: instancePath + "/supplemental_quality_review/follow_up_checks/" + i7 + "/required_evidence", schemaPath: "#/properties/supplemental_quality_review/properties/follow_up_checks/items/properties/required_evidence/type", keyword: "type", params: { type: "string" }, message: "must be string" };
                    if (vErrors === null) {
                      vErrors = [err135];
                    } else {
                      vErrors.push(err135);
                    }
                    errors++;
                  }
                }
                if (data56.page !== void 0) {
                  let data61 = data56.page;
                  if (!(typeof data61 == "number" && (!(data61 % 1) && !isNaN(data61))) && data61 !== null) {
                    const err136 = { instancePath: instancePath + "/supplemental_quality_review/follow_up_checks/" + i7 + "/page", schemaPath: "#/properties/supplemental_quality_review/properties/follow_up_checks/items/properties/page/type", keyword: "type", params: { type: schema32.properties.supplemental_quality_review.properties.follow_up_checks.items.properties.page.type }, message: "must be integer,null" };
                    if (vErrors === null) {
                      vErrors = [err136];
                    } else {
                      vErrors.push(err136);
                    }
                    errors++;
                  }
                  if (typeof data61 == "number") {
                    if (data61 < 1 || isNaN(data61)) {
                      const err137 = { instancePath: instancePath + "/supplemental_quality_review/follow_up_checks/" + i7 + "/page", schemaPath: "#/properties/supplemental_quality_review/properties/follow_up_checks/items/properties/page/minimum", keyword: "minimum", params: { comparison: ">=", limit: 1 }, message: "must be >= 1" };
                      if (vErrors === null) {
                        vErrors = [err137];
                      } else {
                        vErrors.push(err137);
                      }
                      errors++;
                    }
                  }
                }
                if (data56.criterion_refs !== void 0) {
                  let data62 = data56.criterion_refs;
                  if (Array.isArray(data62)) {
                    const len7 = data62.length;
                    for (let i8 = 0; i8 < len7; i8++) {
                      let data63 = data62[i8];
                      if (typeof data63 === "string") {
                        if (func2(data63) < 1) {
                          const err138 = { instancePath: instancePath + "/supplemental_quality_review/follow_up_checks/" + i7 + "/criterion_refs/" + i8, schemaPath: "#/properties/supplemental_quality_review/properties/follow_up_checks/items/properties/criterion_refs/items/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" };
                          if (vErrors === null) {
                            vErrors = [err138];
                          } else {
                            vErrors.push(err138);
                          }
                          errors++;
                        }
                      } else {
                        const err139 = { instancePath: instancePath + "/supplemental_quality_review/follow_up_checks/" + i7 + "/criterion_refs/" + i8, schemaPath: "#/properties/supplemental_quality_review/properties/follow_up_checks/items/properties/criterion_refs/items/type", keyword: "type", params: { type: "string" }, message: "must be string" };
                        if (vErrors === null) {
                          vErrors = [err139];
                        } else {
                          vErrors.push(err139);
                        }
                        errors++;
                      }
                    }
                    let i9 = data62.length;
                    let j1;
                    if (i9 > 1) {
                      const indices1 = {};
                      for (; i9--; ) {
                        let item1 = data62[i9];
                        if (typeof item1 !== "string") {
                          continue;
                        }
                        if (typeof indices1[item1] == "number") {
                          j1 = indices1[item1];
                          const err140 = { instancePath: instancePath + "/supplemental_quality_review/follow_up_checks/" + i7 + "/criterion_refs", schemaPath: "#/properties/supplemental_quality_review/properties/follow_up_checks/items/properties/criterion_refs/uniqueItems", keyword: "uniqueItems", params: { i: i9, j: j1 }, message: "must NOT have duplicate items (items ## " + j1 + " and " + i9 + " are identical)" };
                          if (vErrors === null) {
                            vErrors = [err140];
                          } else {
                            vErrors.push(err140);
                          }
                          errors++;
                          break;
                        }
                        indices1[item1] = i9;
                      }
                    }
                  } else {
                    const err141 = { instancePath: instancePath + "/supplemental_quality_review/follow_up_checks/" + i7 + "/criterion_refs", schemaPath: "#/properties/supplemental_quality_review/properties/follow_up_checks/items/properties/criterion_refs/type", keyword: "type", params: { type: "array" }, message: "must be array" };
                    if (vErrors === null) {
                      vErrors = [err141];
                    } else {
                      vErrors.push(err141);
                    }
                    errors++;
                  }
                }
              } else {
                const err142 = { instancePath: instancePath + "/supplemental_quality_review/follow_up_checks/" + i7, schemaPath: "#/properties/supplemental_quality_review/properties/follow_up_checks/items/type", keyword: "type", params: { type: "object" }, message: "must be object" };
                if (vErrors === null) {
                  vErrors = [err142];
                } else {
                  vErrors.push(err142);
                }
                errors++;
              }
            }
          } else {
            const err143 = { instancePath: instancePath + "/supplemental_quality_review/follow_up_checks", schemaPath: "#/properties/supplemental_quality_review/properties/follow_up_checks/type", keyword: "type", params: { type: "array" }, message: "must be array" };
            if (vErrors === null) {
              vErrors = [err143];
            } else {
              vErrors.push(err143);
            }
            errors++;
          }
        }
      } else {
        const err144 = { instancePath: instancePath + "/supplemental_quality_review", schemaPath: "#/properties/supplemental_quality_review/type", keyword: "type", params: { type: "object" }, message: "must be object" };
        if (vErrors === null) {
          vErrors = [err144];
        } else {
          vErrors.push(err144);
        }
        errors++;
      }
    }
  } else {
    const err145 = { instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" };
    if (vErrors === null) {
      vErrors = [err145];
    } else {
      vErrors.push(err145);
    }
    errors++;
  }
  validate21.errors = vErrors;
  return errors === 0;
}
validate21.evaluated = { "props": true, "dynamicProps": false, "dynamicItems": false };

// web/checklist-core/common-review-validator.js
var COMMON_REVIEW_VERSION = "PROJECT-CHECK-COMMON-REVIEW-v1.1-20261026";
var REVIEW_DOMAINS = ["LAYOUT", "REFERENCES", "CAPTIONS", "MATHEMATICS", "EXPERT_SOUNDNESS"];
function validateCommonReviewChecks(checks, pageCount) {
  const errors = [], add = (m) => errors.push({ code: "COMMON_REVIEW_COVERAGE", message: m });
  if (!Array.isArray(checks) || checks.length !== REVIEW_DOMAINS.length) {
    add("Five explicit common-review domain checks are required");
    return errors;
  }
  for (let i = 0; i < REVIEW_DOMAINS.length; i++) {
    const c = checks[i];
    if (c.domain !== REVIEW_DOMAINS[i]) add("Review domains must occur exactly once in the required order");
    if (c.inspected_pages.some((p) => p > pageCount)) add("Inspected page exceeds original PDF page count");
    if (["INSPECTED", "NOT_PRESENT"].includes(c.review_status) && !c.inspected_pages.length) add("Inspection or domain absence requires inspected pages");
    if (c.domain === "LAYOUT" && c.review_status === "NOT_PRESENT") add("A PDF always has a layout to inspect");
    if (c.domain === "LAYOUT" && c.review_status === "INSPECTED" && c.inspected_pages.length !== pageCount) add("Full layout inspection requires every physical page");
  }
  return errors;
}
function validateSupplementalReview(request, result) {
  const required = request.execution_contract?.common_review_policy_version === COMMON_REVIEW_VERSION, s = result.supplemental_quality_review;
  if (result.run_status !== "COMPLETED") return s ? [{ code: "BLOCKED_SUPPLEMENTAL_REVIEW", message: "Blocked runs must omit substantive supplemental review" }] : [];
  if (!s) return required ? [{ code: "COMMON_REVIEW_REQUIRED", message: "This request requires supplemental quality review; use the complete current prompt and updated result contract" }] : [];
  const errors = validateCommonReviewChecks(s.checks, request.artifact.page_count), seen = /* @__PURE__ */ new Set();
  for (const f of s.findings) {
    if (seen.has(f.finding_id)) errors.push({ code: "DUPLICATE_SUPPLEMENTAL_FINDING", message: f.finding_id });
    seen.add(f.finding_id);
    const c = s.checks.find((c2) => c2.domain === f.domain);
    for (const e of f.evidence) if (e.page > request.artifact.page_count || !c?.inspected_pages.includes(e.page)) errors.push({ code: "SUPPLEMENTAL_EVIDENCE_RANGE", message: "Finding evidence must refer to a page actually inspected in its domain" });
    if (c?.review_status === "NOT_PRESENT" || c?.review_status === "NOT_CHECKABLE") errors.push({ code: "SUPPLEMENTAL_STATUS_CONTRADICTION", message: "A finding cannot claim inspection in an absent or wholly uncheckable domain" });
  }
  const official = new Set(result.criteria_results.map((r) => r.criterion_id));
  for (const q of s.follow_up_checks || []) for (const ref of q.criterion_refs) if (!official.has(ref)) errors.push({ code: "UNKNOWN_FOLLOW_UP_CRITERION", message: ref });
  if (required) {
    for (const row of result.criteria_results) if (row.status === "NOT_CHECKABLE" && !s.follow_up_checks.some((q) => q.criterion_refs.includes(row.criterion_id))) errors.push({ code: "UNRESOLVED_WITHOUT_NEXT_STEP", message: "Explain evidence or verification needed for " + row.criterion_id });
  }
  for (const q of s.follow_up_checks || []) if (q.page !== null && q.page > request.artifact.page_count) errors.push({ code: "FOLLOW_UP_PAGE_RANGE", message: "Follow-up page exceeds original PDF page count" });
  return errors;
}

// web/checklist-core/validate-artifact-checklist-result-v1.js
function validateArtifactChecklistResult(request, result) {
  const errors = [];
  const push = (code, message) => errors.push({ code, message });
  if (!request || !result) return [{ code: "NULL_INPUT", message: "request and result are required" }];
  errors.push(...validateSupplementalReview(request, result));
  if (result.request_id !== request.request_id) push("REQUEST_ID_MISMATCH", "request_id does not match frozen request");
  if (result.artifact_type !== request.artifact_type) push("ARTIFACT_TYPE_MISMATCH", "artifact_type does not match frozen request");
  if (result.output_language !== request.output_language) push("LANGUAGE_MISMATCH", "output_language does not match frozen request");
  const ai = result.artifact_identity || {};
  if ((ai.expected_sha256 || "").toLowerCase() !== (request.artifact?.sha256 || "").toLowerCase()) {
    push("EXPECTED_ARTIFACT_HASH_MISMATCH", "artifact_identity.expected_sha256 must equal frozen request artifact.sha256");
  }
  const rc = result.checklist_identity || {};
  const qc = request.checklist || {};
  for (const k of ["checklist_id", "checklist_version", "definition_sha256", "source_pdf_sha256"]) {
    if (rc[k] !== qc[k]) push("CHECKLIST_IDENTITY_MISMATCH", `${k} does not match frozen checklist`);
  }
  if (result.run_status === "IDENTITY_BLOCKED") {
    if (!result.blocking) push("BLOCKING_REQUIRED", "IDENTITY_BLOCKED requires blocking");
    if ((result.criteria_results || []).length !== 0) push("BLOCKED_WITH_RESULTS", "blocked run must not contain criterion results");
    if (result.project_context !== null) push("BLOCKED_WITH_CONTEXT", "blocked run must not infer project context");
    if (result.blocking?.code === "HASH_MISMATCH" && ai.match !== false) push("HASH_MISMATCH_FLAG", "HASH_MISMATCH requires artifact_identity.match=false");
    return errors;
  }
  if (result.run_status === "CONFIG_BLOCKED") {
    if (result.blocking?.code !== "CHECKLIST_CONFIG_INVALID") push("CONFIG_BLOCK_CODE", "CONFIG_BLOCKED requires CHECKLIST_CONFIG_INVALID");
    if ((result.criteria_results || []).length !== 0) push("BLOCKED_WITH_RESULTS", "blocked run must not contain criterion results");
    if (result.project_context !== null) push("BLOCKED_WITH_CONTEXT", "blocked run must not infer project context");
    return errors;
  }
  if (result.run_status !== "COMPLETED") {
    push("UNKNOWN_RUN_STATUS", "run_status must be COMPLETED, IDENTITY_BLOCKED, or CONFIG_BLOCKED");
    return errors;
  }
  if (result.blocking !== null) push("COMPLETED_WITH_BLOCKING", "COMPLETED requires blocking=null");
  if (ai.match !== true) push("ARTIFACT_IDENTITY_NOT_CONFIRMED", "COMPLETED requires artifact_identity.match=true");
  if (!ai.computed_sha256 || ai.computed_sha256.toLowerCase() !== request.artifact.sha256.toLowerCase()) {
    push("COMPUTED_ARTIFACT_HASH_MISMATCH", "computed SHA-256 must equal frozen artifact SHA-256");
  }
  if (!result.project_context) push("PROJECT_CONTEXT_REQUIRED", "COMPLETED requires inferred project_context");
  const expected = (qc.criteria_snapshot || []).filter((x) => x.gradable === true);
  const got = result.criteria_results || [];
  if (got.length !== expected.length) push("CRITERION_COUNT_MISMATCH", `expected ${expected.length}, got ${got.length}`);
  const expectedMap = new Map(expected.map((x) => [x.criterion_id, x]));
  const seen = /* @__PURE__ */ new Set();
  for (let i = 0; i < got.length; i++) {
    const r = got[i];
    if (seen.has(r.criterion_id)) push("DUPLICATE_CRITERION", `duplicate criterion ${r.criterion_id}`);
    seen.add(r.criterion_id);
    const e = expectedMap.get(r.criterion_id);
    if (!e) {
      push("UNKNOWN_CRITERION", `unknown criterion ${r.criterion_id}`);
      continue;
    }
    if (r.criterion_text !== e.official_text) push("CRITERION_TEXT_MISMATCH", `criterion_text mismatch for ${r.criterion_id}`);
    if (expected[i]?.criterion_id !== r.criterion_id) push("CRITERION_ORDER_MISMATCH", `criterion order mismatch at index ${i}`);
    if (r.status === "PASS") {
      if (r.applicability !== "APPLICABLE") push("PASS_APPLICABILITY_MISMATCH", `${r.criterion_id} PASS requires APPLICABLE`);
      if (!Array.isArray(r.evidence) || r.evidence.length === 0) push("PASS_WITHOUT_EVIDENCE", `${r.criterion_id} PASS requires evidence`);
    }
    if (r.status === "FAIL") {
      if (r.applicability !== "APPLICABLE") push("FAIL_APPLICABILITY_MISMATCH", `${r.criterion_id} FAIL requires APPLICABLE`);
      if (!r.problem?.trim()) push("FAIL_WITHOUT_PROBLEM", `${r.criterion_id} FAIL requires problem`);
      if (!r.required_fix?.trim()) push("FAIL_WITHOUT_FIX", `${r.criterion_id} FAIL requires minimum required_fix`);
      if (!r.fix_location?.trim()) push("FAIL_WITHOUT_FIX_LOCATION", `${r.criterion_id} FAIL requires fix_location`);
    }
    if (r.status === "N_A") {
      if (r.applicability !== "NOT_APPLICABLE") push("NA_APPLICABILITY_MISMATCH", `${r.criterion_id} N_A requires NOT_APPLICABLE`);
      if (!r.rationale?.trim()) push("NA_WITHOUT_RATIONALE", `${r.criterion_id} N_A requires applicability rationale`);
    }
    if (r.status === "NOT_CHECKABLE") {
      if (!r.rationale?.trim()) push("NOT_CHECKABLE_WITHOUT_REASON", `${r.criterion_id} NOT_CHECKABLE requires reason`);
    }
  }
  for (const e of expected) if (!seen.has(e.criterion_id)) push("MISSING_CRITERION", `missing criterion ${e.criterion_id}`);
  return errors;
}

// web/checklist-engine.js
var schemaErrors = (fn, obj) => fn(obj) ? [] : (fn.errors || []).map((x) => ({ code: "JSON_SCHEMA", message: `${x.instancePath || "/"}: ${x.message}` }));
function validateChecklistImport(request, result) {
  if (result?.result_protocol_version !== "ARTIFACT-CHECKLIST-RESULT-v1") return [{ code: "WRONG_PROTOCOL", message: "Expected ARTIFACT-CHECKLIST-RESULT-v1, not a quality-review result." }];
  const errors = [...schemaErrors(checklistRequestValidator, request), ...schemaErrors(checklistResultValidator, result)];
  if (errors.length) return errors;
  errors.push(...validateArtifactChecklistResult(request, result));
  const evidence = [...result.project_context?.evidence || [], ...result.criteria_results.flatMap((x) => x.evidence)];
  for (const e of evidence) if (e.page !== null && e.page > request.artifact.page_count) errors.push({ code: "EVIDENCE_PAGE_RANGE", message: "Evidence page exceeds physical PDF page count" });
  return errors;
}

// web/checklist-validator-entry.js
function validateArtifactChecklistResult2(request, result) {
  return validateChecklistImport(request, result);
}
export {
  validateArtifactChecklistResult2 as validateArtifactChecklistResult
};
