@tiangong-lca/pcr 0.0.0-stage → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/NOTICE.md +5 -0
- package/README.md +107 -2
- package/node_modules/ajv/.runkit_example.js +23 -0
- package/node_modules/ajv/LICENSE +22 -0
- package/node_modules/ajv/README.md +207 -0
- package/node_modules/ajv/dist/2019.d.ts +19 -0
- package/node_modules/ajv/dist/2019.js +61 -0
- package/node_modules/ajv/dist/2019.js.map +1 -0
- package/node_modules/ajv/dist/2020.d.ts +19 -0
- package/node_modules/ajv/dist/2020.js +55 -0
- package/node_modules/ajv/dist/2020.js.map +1 -0
- package/node_modules/ajv/dist/ajv.d.ts +18 -0
- package/node_modules/ajv/dist/ajv.js +50 -0
- package/node_modules/ajv/dist/ajv.js.map +1 -0
- package/node_modules/ajv/dist/compile/codegen/code.d.ts +40 -0
- package/node_modules/ajv/dist/compile/codegen/code.js +156 -0
- package/node_modules/ajv/dist/compile/codegen/code.js.map +1 -0
- package/node_modules/ajv/dist/compile/codegen/index.d.ts +79 -0
- package/node_modules/ajv/dist/compile/codegen/index.js +697 -0
- package/node_modules/ajv/dist/compile/codegen/index.js.map +1 -0
- package/node_modules/ajv/dist/compile/codegen/scope.d.ts +79 -0
- package/node_modules/ajv/dist/compile/codegen/scope.js +143 -0
- package/node_modules/ajv/dist/compile/codegen/scope.js.map +1 -0
- package/node_modules/ajv/dist/compile/errors.d.ts +13 -0
- package/node_modules/ajv/dist/compile/errors.js +123 -0
- package/node_modules/ajv/dist/compile/errors.js.map +1 -0
- package/node_modules/ajv/dist/compile/index.d.ts +80 -0
- package/node_modules/ajv/dist/compile/index.js +242 -0
- package/node_modules/ajv/dist/compile/index.js.map +1 -0
- package/node_modules/ajv/dist/compile/jtd/parse.d.ts +4 -0
- package/node_modules/ajv/dist/compile/jtd/parse.js +350 -0
- package/node_modules/ajv/dist/compile/jtd/parse.js.map +1 -0
- package/node_modules/ajv/dist/compile/jtd/serialize.d.ts +4 -0
- package/node_modules/ajv/dist/compile/jtd/serialize.js +236 -0
- package/node_modules/ajv/dist/compile/jtd/serialize.js.map +1 -0
- package/node_modules/ajv/dist/compile/jtd/types.d.ts +6 -0
- package/node_modules/ajv/dist/compile/jtd/types.js +14 -0
- package/node_modules/ajv/dist/compile/jtd/types.js.map +1 -0
- package/node_modules/ajv/dist/compile/names.d.ts +20 -0
- package/node_modules/ajv/dist/compile/names.js +28 -0
- package/node_modules/ajv/dist/compile/names.js.map +1 -0
- package/node_modules/ajv/dist/compile/ref_error.d.ts +6 -0
- package/node_modules/ajv/dist/compile/ref_error.js +12 -0
- package/node_modules/ajv/dist/compile/ref_error.js.map +1 -0
- package/node_modules/ajv/dist/compile/resolve.d.ts +12 -0
- package/node_modules/ajv/dist/compile/resolve.js +155 -0
- package/node_modules/ajv/dist/compile/resolve.js.map +1 -0
- package/node_modules/ajv/dist/compile/rules.d.ts +28 -0
- package/node_modules/ajv/dist/compile/rules.js +26 -0
- package/node_modules/ajv/dist/compile/rules.js.map +1 -0
- package/node_modules/ajv/dist/compile/util.d.ts +40 -0
- package/node_modules/ajv/dist/compile/util.js +178 -0
- package/node_modules/ajv/dist/compile/util.js.map +1 -0
- package/node_modules/ajv/dist/compile/validate/applicability.d.ts +6 -0
- package/node_modules/ajv/dist/compile/validate/applicability.js +19 -0
- package/node_modules/ajv/dist/compile/validate/applicability.js.map +1 -0
- package/node_modules/ajv/dist/compile/validate/boolSchema.d.ts +4 -0
- package/node_modules/ajv/dist/compile/validate/boolSchema.js +50 -0
- package/node_modules/ajv/dist/compile/validate/boolSchema.js.map +1 -0
- package/node_modules/ajv/dist/compile/validate/dataType.d.ts +17 -0
- package/node_modules/ajv/dist/compile/validate/dataType.js +203 -0
- package/node_modules/ajv/dist/compile/validate/dataType.js.map +1 -0
- package/node_modules/ajv/dist/compile/validate/defaults.d.ts +2 -0
- package/node_modules/ajv/dist/compile/validate/defaults.js +35 -0
- package/node_modules/ajv/dist/compile/validate/defaults.js.map +1 -0
- package/node_modules/ajv/dist/compile/validate/index.d.ts +42 -0
- package/node_modules/ajv/dist/compile/validate/index.js +520 -0
- package/node_modules/ajv/dist/compile/validate/index.js.map +1 -0
- package/node_modules/ajv/dist/compile/validate/keyword.d.ts +8 -0
- package/node_modules/ajv/dist/compile/validate/keyword.js +124 -0
- package/node_modules/ajv/dist/compile/validate/keyword.js.map +1 -0
- package/node_modules/ajv/dist/compile/validate/subschema.d.ts +47 -0
- package/node_modules/ajv/dist/compile/validate/subschema.js +81 -0
- package/node_modules/ajv/dist/compile/validate/subschema.js.map +1 -0
- package/node_modules/ajv/dist/core.d.ts +174 -0
- package/node_modules/ajv/dist/core.js +618 -0
- package/node_modules/ajv/dist/core.js.map +1 -0
- package/node_modules/ajv/dist/jtd.d.ts +47 -0
- package/node_modules/ajv/dist/jtd.js +72 -0
- package/node_modules/ajv/dist/jtd.js.map +1 -0
- package/node_modules/ajv/dist/refs/data.json +13 -0
- package/node_modules/ajv/dist/refs/json-schema-2019-09/index.d.ts +2 -0
- package/node_modules/ajv/dist/refs/json-schema-2019-09/index.js +28 -0
- package/node_modules/ajv/dist/refs/json-schema-2019-09/index.js.map +1 -0
- package/node_modules/ajv/dist/refs/json-schema-2019-09/meta/applicator.json +53 -0
- package/node_modules/ajv/dist/refs/json-schema-2019-09/meta/content.json +17 -0
- package/node_modules/ajv/dist/refs/json-schema-2019-09/meta/core.json +57 -0
- package/node_modules/ajv/dist/refs/json-schema-2019-09/meta/format.json +14 -0
- package/node_modules/ajv/dist/refs/json-schema-2019-09/meta/meta-data.json +37 -0
- package/node_modules/ajv/dist/refs/json-schema-2019-09/meta/validation.json +90 -0
- package/node_modules/ajv/dist/refs/json-schema-2019-09/schema.json +39 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/index.d.ts +2 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/index.js +30 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/index.js.map +1 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/meta/applicator.json +48 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/meta/content.json +17 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/meta/core.json +51 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/meta/format-annotation.json +14 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/meta/meta-data.json +37 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/meta/unevaluated.json +15 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/meta/validation.json +90 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/schema.json +55 -0
- package/node_modules/ajv/dist/refs/json-schema-draft-06.json +137 -0
- package/node_modules/ajv/dist/refs/json-schema-draft-07.json +151 -0
- package/node_modules/ajv/dist/refs/json-schema-secure.json +88 -0
- package/node_modules/ajv/dist/refs/jtd-schema.d.ts +3 -0
- package/node_modules/ajv/dist/refs/jtd-schema.js +118 -0
- package/node_modules/ajv/dist/refs/jtd-schema.js.map +1 -0
- package/node_modules/ajv/dist/runtime/equal.d.ts +6 -0
- package/node_modules/ajv/dist/runtime/equal.js +7 -0
- package/node_modules/ajv/dist/runtime/equal.js.map +1 -0
- package/node_modules/ajv/dist/runtime/parseJson.d.ts +18 -0
- package/node_modules/ajv/dist/runtime/parseJson.js +185 -0
- package/node_modules/ajv/dist/runtime/parseJson.js.map +1 -0
- package/node_modules/ajv/dist/runtime/quote.d.ts +5 -0
- package/node_modules/ajv/dist/runtime/quote.js +30 -0
- package/node_modules/ajv/dist/runtime/quote.js.map +1 -0
- package/node_modules/ajv/dist/runtime/re2.d.ts +6 -0
- package/node_modules/ajv/dist/runtime/re2.js +6 -0
- package/node_modules/ajv/dist/runtime/re2.js.map +1 -0
- package/node_modules/ajv/dist/runtime/timestamp.d.ts +5 -0
- package/node_modules/ajv/dist/runtime/timestamp.js +42 -0
- package/node_modules/ajv/dist/runtime/timestamp.js.map +1 -0
- package/node_modules/ajv/dist/runtime/ucs2length.d.ts +5 -0
- package/node_modules/ajv/dist/runtime/ucs2length.js +24 -0
- package/node_modules/ajv/dist/runtime/ucs2length.js.map +1 -0
- package/node_modules/ajv/dist/runtime/uri.d.ts +6 -0
- package/node_modules/ajv/dist/runtime/uri.js +6 -0
- package/node_modules/ajv/dist/runtime/uri.js.map +1 -0
- package/node_modules/ajv/dist/runtime/validation_error.d.ts +7 -0
- package/node_modules/ajv/dist/runtime/validation_error.js +11 -0
- package/node_modules/ajv/dist/runtime/validation_error.js.map +1 -0
- package/node_modules/ajv/dist/standalone/index.d.ts +6 -0
- package/node_modules/ajv/dist/standalone/index.js +90 -0
- package/node_modules/ajv/dist/standalone/index.js.map +1 -0
- package/node_modules/ajv/dist/standalone/instance.d.ts +12 -0
- package/node_modules/ajv/dist/standalone/instance.js +35 -0
- package/node_modules/ajv/dist/standalone/instance.js.map +1 -0
- package/node_modules/ajv/dist/types/index.d.ts +183 -0
- package/node_modules/ajv/dist/types/index.js +3 -0
- package/node_modules/ajv/dist/types/index.js.map +1 -0
- package/node_modules/ajv/dist/types/json-schema.d.ts +125 -0
- package/node_modules/ajv/dist/types/json-schema.js +3 -0
- package/node_modules/ajv/dist/types/json-schema.js.map +1 -0
- package/node_modules/ajv/dist/types/jtd-schema.d.ts +174 -0
- package/node_modules/ajv/dist/types/jtd-schema.js +3 -0
- package/node_modules/ajv/dist/types/jtd-schema.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/additionalItems.d.ts +8 -0
- package/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js +49 -0
- package/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.d.ts +6 -0
- package/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js +106 -0
- package/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/allOf.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/applicator/allOf.js +23 -0
- package/node_modules/ajv/dist/vocabularies/applicator/allOf.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/anyOf.d.ts +4 -0
- package/node_modules/ajv/dist/vocabularies/applicator/anyOf.js +12 -0
- package/node_modules/ajv/dist/vocabularies/applicator/anyOf.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/contains.d.ts +7 -0
- package/node_modules/ajv/dist/vocabularies/applicator/contains.js +95 -0
- package/node_modules/ajv/dist/vocabularies/applicator/contains.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/dependencies.d.ts +21 -0
- package/node_modules/ajv/dist/vocabularies/applicator/dependencies.js +85 -0
- package/node_modules/ajv/dist/vocabularies/applicator/dependencies.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.js +11 -0
- package/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/if.d.ts +6 -0
- package/node_modules/ajv/dist/vocabularies/applicator/if.js +66 -0
- package/node_modules/ajv/dist/vocabularies/applicator/if.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/index.d.ts +13 -0
- package/node_modules/ajv/dist/vocabularies/applicator/index.js +44 -0
- package/node_modules/ajv/dist/vocabularies/applicator/index.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/items.d.ts +5 -0
- package/node_modules/ajv/dist/vocabularies/applicator/items.js +52 -0
- package/node_modules/ajv/dist/vocabularies/applicator/items.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/items2020.d.ts +6 -0
- package/node_modules/ajv/dist/vocabularies/applicator/items2020.js +30 -0
- package/node_modules/ajv/dist/vocabularies/applicator/items2020.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/not.d.ts +4 -0
- package/node_modules/ajv/dist/vocabularies/applicator/not.js +26 -0
- package/node_modules/ajv/dist/vocabularies/applicator/not.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/oneOf.d.ts +6 -0
- package/node_modules/ajv/dist/vocabularies/applicator/oneOf.js +60 -0
- package/node_modules/ajv/dist/vocabularies/applicator/oneOf.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/patternProperties.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js +75 -0
- package/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/prefixItems.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js +12 -0
- package/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/properties.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/applicator/properties.js +54 -0
- package/node_modules/ajv/dist/vocabularies/applicator/properties.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/propertyNames.d.ts +6 -0
- package/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js +38 -0
- package/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/thenElse.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/applicator/thenElse.js +13 -0
- package/node_modules/ajv/dist/vocabularies/applicator/thenElse.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/code.d.ts +17 -0
- package/node_modules/ajv/dist/vocabularies/code.js +131 -0
- package/node_modules/ajv/dist/vocabularies/code.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/core/id.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/core/id.js +10 -0
- package/node_modules/ajv/dist/vocabularies/core/id.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/core/index.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/core/index.js +16 -0
- package/node_modules/ajv/dist/vocabularies/core/index.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/core/ref.d.ts +8 -0
- package/node_modules/ajv/dist/vocabularies/core/ref.js +122 -0
- package/node_modules/ajv/dist/vocabularies/core/ref.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/discriminator/index.d.ts +5 -0
- package/node_modules/ajv/dist/vocabularies/discriminator/index.js +104 -0
- package/node_modules/ajv/dist/vocabularies/discriminator/index.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/discriminator/types.d.ts +10 -0
- package/node_modules/ajv/dist/vocabularies/discriminator/types.js +9 -0
- package/node_modules/ajv/dist/vocabularies/discriminator/types.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/draft2020.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/draft2020.js +23 -0
- package/node_modules/ajv/dist/vocabularies/draft2020.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/draft7.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/draft7.js +17 -0
- package/node_modules/ajv/dist/vocabularies/draft7.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.d.ts +5 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.js +30 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.d.ts +5 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.js +51 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/index.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/index.js +9 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/index.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.js +16 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.js +10 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/errors.d.ts +9 -0
- package/node_modules/ajv/dist/vocabularies/errors.js +3 -0
- package/node_modules/ajv/dist/vocabularies/errors.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/format/format.d.ts +8 -0
- package/node_modules/ajv/dist/vocabularies/format/format.js +92 -0
- package/node_modules/ajv/dist/vocabularies/format/format.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/format/index.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/format/index.js +6 -0
- package/node_modules/ajv/dist/vocabularies/format/index.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/discriminator.d.ts +6 -0
- package/node_modules/ajv/dist/vocabularies/jtd/discriminator.js +71 -0
- package/node_modules/ajv/dist/vocabularies/jtd/discriminator.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/elements.d.ts +5 -0
- package/node_modules/ajv/dist/vocabularies/jtd/elements.js +24 -0
- package/node_modules/ajv/dist/vocabularies/jtd/elements.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/enum.d.ts +6 -0
- package/node_modules/ajv/dist/vocabularies/jtd/enum.js +43 -0
- package/node_modules/ajv/dist/vocabularies/jtd/enum.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/error.d.ts +9 -0
- package/node_modules/ajv/dist/vocabularies/jtd/error.js +20 -0
- package/node_modules/ajv/dist/vocabularies/jtd/error.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/index.d.ts +10 -0
- package/node_modules/ajv/dist/vocabularies/jtd/index.js +29 -0
- package/node_modules/ajv/dist/vocabularies/jtd/index.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/metadata.d.ts +5 -0
- package/node_modules/ajv/dist/vocabularies/jtd/metadata.js +25 -0
- package/node_modules/ajv/dist/vocabularies/jtd/metadata.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/nullable.d.ts +4 -0
- package/node_modules/ajv/dist/vocabularies/jtd/nullable.js +22 -0
- package/node_modules/ajv/dist/vocabularies/jtd/nullable.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/optionalProperties.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/jtd/optionalProperties.js +15 -0
- package/node_modules/ajv/dist/vocabularies/jtd/optionalProperties.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/properties.d.ts +22 -0
- package/node_modules/ajv/dist/vocabularies/jtd/properties.js +149 -0
- package/node_modules/ajv/dist/vocabularies/jtd/properties.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/ref.d.ts +4 -0
- package/node_modules/ajv/dist/vocabularies/jtd/ref.js +67 -0
- package/node_modules/ajv/dist/vocabularies/jtd/ref.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/type.d.ts +10 -0
- package/node_modules/ajv/dist/vocabularies/jtd/type.js +69 -0
- package/node_modules/ajv/dist/vocabularies/jtd/type.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/union.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/jtd/union.js +12 -0
- package/node_modules/ajv/dist/vocabularies/jtd/union.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/values.d.ts +5 -0
- package/node_modules/ajv/dist/vocabularies/jtd/values.js +51 -0
- package/node_modules/ajv/dist/vocabularies/jtd/values.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/metadata.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/metadata.js +18 -0
- package/node_modules/ajv/dist/vocabularies/metadata.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/next.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/next.js +8 -0
- package/node_modules/ajv/dist/vocabularies/next.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/unevaluated/index.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/unevaluated/index.js +7 -0
- package/node_modules/ajv/dist/vocabularies/unevaluated/index.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.d.ts +6 -0
- package/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js +40 -0
- package/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.d.ts +6 -0
- package/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js +65 -0
- package/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/const.d.ts +6 -0
- package/node_modules/ajv/dist/vocabularies/validation/const.js +25 -0
- package/node_modules/ajv/dist/vocabularies/validation/const.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/dependentRequired.d.ts +5 -0
- package/node_modules/ajv/dist/vocabularies/validation/dependentRequired.js +12 -0
- package/node_modules/ajv/dist/vocabularies/validation/dependentRequired.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/enum.d.ts +8 -0
- package/node_modules/ajv/dist/vocabularies/validation/enum.js +48 -0
- package/node_modules/ajv/dist/vocabularies/validation/enum.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/index.d.ts +16 -0
- package/node_modules/ajv/dist/vocabularies/validation/index.js +33 -0
- package/node_modules/ajv/dist/vocabularies/validation/index.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitContains.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitContains.js +15 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitContains.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitItems.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitItems.js +24 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitItems.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitLength.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitLength.js +27 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitLength.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitNumber.d.ts +11 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitNumber.js +27 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitNumber.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitProperties.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitProperties.js +24 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitProperties.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/multipleOf.d.ts +8 -0
- package/node_modules/ajv/dist/vocabularies/validation/multipleOf.js +26 -0
- package/node_modules/ajv/dist/vocabularies/validation/multipleOf.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/pattern.d.ts +8 -0
- package/node_modules/ajv/dist/vocabularies/validation/pattern.js +33 -0
- package/node_modules/ajv/dist/vocabularies/validation/pattern.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/required.d.ts +8 -0
- package/node_modules/ajv/dist/vocabularies/validation/required.js +79 -0
- package/node_modules/ajv/dist/vocabularies/validation/required.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/uniqueItems.d.ts +9 -0
- package/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js +64 -0
- package/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js.map +1 -0
- package/node_modules/ajv/lib/2019.ts +81 -0
- package/node_modules/ajv/lib/2020.ts +75 -0
- package/node_modules/ajv/lib/ajv.ts +70 -0
- package/node_modules/ajv/lib/compile/codegen/code.ts +169 -0
- package/node_modules/ajv/lib/compile/codegen/index.ts +852 -0
- package/node_modules/ajv/lib/compile/codegen/scope.ts +215 -0
- package/node_modules/ajv/lib/compile/errors.ts +184 -0
- package/node_modules/ajv/lib/compile/index.ts +324 -0
- package/node_modules/ajv/lib/compile/jtd/parse.ts +411 -0
- package/node_modules/ajv/lib/compile/jtd/serialize.ts +277 -0
- package/node_modules/ajv/lib/compile/jtd/types.ts +16 -0
- package/node_modules/ajv/lib/compile/names.ts +27 -0
- package/node_modules/ajv/lib/compile/ref_error.ts +13 -0
- package/node_modules/ajv/lib/compile/resolve.ts +149 -0
- package/node_modules/ajv/lib/compile/rules.ts +50 -0
- package/node_modules/ajv/lib/compile/util.ts +213 -0
- package/node_modules/ajv/lib/compile/validate/applicability.ts +22 -0
- package/node_modules/ajv/lib/compile/validate/boolSchema.ts +47 -0
- package/node_modules/ajv/lib/compile/validate/dataType.ts +230 -0
- package/node_modules/ajv/lib/compile/validate/defaults.ts +32 -0
- package/node_modules/ajv/lib/compile/validate/index.ts +582 -0
- package/node_modules/ajv/lib/compile/validate/keyword.ts +171 -0
- package/node_modules/ajv/lib/compile/validate/subschema.ts +135 -0
- package/node_modules/ajv/lib/core.ts +892 -0
- package/node_modules/ajv/lib/jtd.ts +132 -0
- package/node_modules/ajv/lib/refs/data.json +13 -0
- package/node_modules/ajv/lib/refs/json-schema-2019-09/index.ts +28 -0
- package/node_modules/ajv/lib/refs/json-schema-2019-09/meta/applicator.json +53 -0
- package/node_modules/ajv/lib/refs/json-schema-2019-09/meta/content.json +17 -0
- package/node_modules/ajv/lib/refs/json-schema-2019-09/meta/core.json +57 -0
- package/node_modules/ajv/lib/refs/json-schema-2019-09/meta/format.json +14 -0
- package/node_modules/ajv/lib/refs/json-schema-2019-09/meta/meta-data.json +37 -0
- package/node_modules/ajv/lib/refs/json-schema-2019-09/meta/validation.json +90 -0
- package/node_modules/ajv/lib/refs/json-schema-2019-09/schema.json +39 -0
- package/node_modules/ajv/lib/refs/json-schema-2020-12/index.ts +30 -0
- package/node_modules/ajv/lib/refs/json-schema-2020-12/meta/applicator.json +48 -0
- package/node_modules/ajv/lib/refs/json-schema-2020-12/meta/content.json +17 -0
- package/node_modules/ajv/lib/refs/json-schema-2020-12/meta/core.json +51 -0
- package/node_modules/ajv/lib/refs/json-schema-2020-12/meta/format-annotation.json +14 -0
- package/node_modules/ajv/lib/refs/json-schema-2020-12/meta/meta-data.json +37 -0
- package/node_modules/ajv/lib/refs/json-schema-2020-12/meta/unevaluated.json +15 -0
- package/node_modules/ajv/lib/refs/json-schema-2020-12/meta/validation.json +90 -0
- package/node_modules/ajv/lib/refs/json-schema-2020-12/schema.json +55 -0
- package/node_modules/ajv/lib/refs/json-schema-draft-06.json +137 -0
- package/node_modules/ajv/lib/refs/json-schema-draft-07.json +151 -0
- package/node_modules/ajv/lib/refs/json-schema-secure.json +88 -0
- package/node_modules/ajv/lib/refs/jtd-schema.ts +130 -0
- package/node_modules/ajv/lib/runtime/equal.ts +7 -0
- package/node_modules/ajv/lib/runtime/parseJson.ts +177 -0
- package/node_modules/ajv/lib/runtime/quote.ts +31 -0
- package/node_modules/ajv/lib/runtime/re2.ts +6 -0
- package/node_modules/ajv/lib/runtime/timestamp.ts +46 -0
- package/node_modules/ajv/lib/runtime/ucs2length.ts +20 -0
- package/node_modules/ajv/lib/runtime/uri.ts +6 -0
- package/node_modules/ajv/lib/runtime/validation_error.ts +13 -0
- package/node_modules/ajv/lib/standalone/index.ts +100 -0
- package/node_modules/ajv/lib/standalone/instance.ts +36 -0
- package/node_modules/ajv/lib/types/index.ts +244 -0
- package/node_modules/ajv/lib/types/json-schema.ts +187 -0
- package/node_modules/ajv/lib/types/jtd-schema.ts +273 -0
- package/node_modules/ajv/lib/vocabularies/applicator/additionalItems.ts +56 -0
- package/node_modules/ajv/lib/vocabularies/applicator/additionalProperties.ts +118 -0
- package/node_modules/ajv/lib/vocabularies/applicator/allOf.ts +22 -0
- package/node_modules/ajv/lib/vocabularies/applicator/anyOf.ts +14 -0
- package/node_modules/ajv/lib/vocabularies/applicator/contains.ts +109 -0
- package/node_modules/ajv/lib/vocabularies/applicator/dependencies.ts +112 -0
- package/node_modules/ajv/lib/vocabularies/applicator/dependentSchemas.ts +11 -0
- package/node_modules/ajv/lib/vocabularies/applicator/if.ts +80 -0
- package/node_modules/ajv/lib/vocabularies/applicator/index.ts +53 -0
- package/node_modules/ajv/lib/vocabularies/applicator/items.ts +59 -0
- package/node_modules/ajv/lib/vocabularies/applicator/items2020.ts +36 -0
- package/node_modules/ajv/lib/vocabularies/applicator/not.ts +38 -0
- package/node_modules/ajv/lib/vocabularies/applicator/oneOf.ts +82 -0
- package/node_modules/ajv/lib/vocabularies/applicator/patternProperties.ts +91 -0
- package/node_modules/ajv/lib/vocabularies/applicator/prefixItems.ts +12 -0
- package/node_modules/ajv/lib/vocabularies/applicator/properties.ts +57 -0
- package/node_modules/ajv/lib/vocabularies/applicator/propertyNames.ts +50 -0
- package/node_modules/ajv/lib/vocabularies/applicator/thenElse.ts +13 -0
- package/node_modules/ajv/lib/vocabularies/code.ts +168 -0
- package/node_modules/ajv/lib/vocabularies/core/id.ts +10 -0
- package/node_modules/ajv/lib/vocabularies/core/index.ts +16 -0
- package/node_modules/ajv/lib/vocabularies/core/ref.ts +129 -0
- package/node_modules/ajv/lib/vocabularies/discriminator/index.ts +113 -0
- package/node_modules/ajv/lib/vocabularies/discriminator/types.ts +12 -0
- package/node_modules/ajv/lib/vocabularies/draft2020.ts +23 -0
- package/node_modules/ajv/lib/vocabularies/draft7.ts +17 -0
- package/node_modules/ajv/lib/vocabularies/dynamic/dynamicAnchor.ts +31 -0
- package/node_modules/ajv/lib/vocabularies/dynamic/dynamicRef.ts +51 -0
- package/node_modules/ajv/lib/vocabularies/dynamic/index.ts +9 -0
- package/node_modules/ajv/lib/vocabularies/dynamic/recursiveAnchor.ts +14 -0
- package/node_modules/ajv/lib/vocabularies/dynamic/recursiveRef.ts +10 -0
- package/node_modules/ajv/lib/vocabularies/errors.ts +18 -0
- package/node_modules/ajv/lib/vocabularies/format/format.ts +120 -0
- package/node_modules/ajv/lib/vocabularies/format/index.ts +6 -0
- package/node_modules/ajv/lib/vocabularies/jtd/discriminator.ts +89 -0
- package/node_modules/ajv/lib/vocabularies/jtd/elements.ts +32 -0
- package/node_modules/ajv/lib/vocabularies/jtd/enum.ts +45 -0
- package/node_modules/ajv/lib/vocabularies/jtd/error.ts +23 -0
- package/node_modules/ajv/lib/vocabularies/jtd/index.ts +37 -0
- package/node_modules/ajv/lib/vocabularies/jtd/metadata.ts +24 -0
- package/node_modules/ajv/lib/vocabularies/jtd/nullable.ts +21 -0
- package/node_modules/ajv/lib/vocabularies/jtd/optionalProperties.ts +15 -0
- package/node_modules/ajv/lib/vocabularies/jtd/properties.ts +184 -0
- package/node_modules/ajv/lib/vocabularies/jtd/ref.ts +76 -0
- package/node_modules/ajv/lib/vocabularies/jtd/type.ts +75 -0
- package/node_modules/ajv/lib/vocabularies/jtd/union.ts +12 -0
- package/node_modules/ajv/lib/vocabularies/jtd/values.ts +58 -0
- package/node_modules/ajv/lib/vocabularies/metadata.ts +17 -0
- package/node_modules/ajv/lib/vocabularies/next.ts +8 -0
- package/node_modules/ajv/lib/vocabularies/unevaluated/index.ts +7 -0
- package/node_modules/ajv/lib/vocabularies/unevaluated/unevaluatedItems.ts +47 -0
- package/node_modules/ajv/lib/vocabularies/unevaluated/unevaluatedProperties.ts +85 -0
- package/node_modules/ajv/lib/vocabularies/validation/const.ts +28 -0
- package/node_modules/ajv/lib/vocabularies/validation/dependentRequired.ts +23 -0
- package/node_modules/ajv/lib/vocabularies/validation/enum.ts +54 -0
- package/node_modules/ajv/lib/vocabularies/validation/index.ts +49 -0
- package/node_modules/ajv/lib/vocabularies/validation/limitContains.ts +16 -0
- package/node_modules/ajv/lib/vocabularies/validation/limitItems.ts +26 -0
- package/node_modules/ajv/lib/vocabularies/validation/limitLength.ts +30 -0
- package/node_modules/ajv/lib/vocabularies/validation/limitNumber.ts +42 -0
- package/node_modules/ajv/lib/vocabularies/validation/limitProperties.ts +26 -0
- package/node_modules/ajv/lib/vocabularies/validation/multipleOf.ts +34 -0
- package/node_modules/ajv/lib/vocabularies/validation/pattern.ts +39 -0
- package/node_modules/ajv/lib/vocabularies/validation/required.ts +98 -0
- package/node_modules/ajv/lib/vocabularies/validation/uniqueItems.ts +79 -0
- package/node_modules/ajv/package.json +126 -0
- package/node_modules/fast-deep-equal/LICENSE +21 -0
- package/node_modules/fast-deep-equal/README.md +96 -0
- package/node_modules/fast-deep-equal/es6/index.d.ts +2 -0
- package/node_modules/fast-deep-equal/es6/index.js +72 -0
- package/node_modules/fast-deep-equal/es6/react.d.ts +2 -0
- package/node_modules/fast-deep-equal/es6/react.js +79 -0
- package/node_modules/fast-deep-equal/index.d.ts +4 -0
- package/node_modules/fast-deep-equal/index.js +46 -0
- package/node_modules/fast-deep-equal/package.json +61 -0
- package/node_modules/fast-deep-equal/react.d.ts +2 -0
- package/node_modules/fast-deep-equal/react.js +53 -0
- package/node_modules/fast-uri/.gitattributes +2 -0
- package/node_modules/fast-uri/.github/dependabot.yml +13 -0
- package/node_modules/fast-uri/.github/workflows/ci.yml +106 -0
- package/node_modules/fast-uri/.github/workflows/lock-threads.yml +19 -0
- package/node_modules/fast-uri/.github/workflows/package-manager-ci.yml +24 -0
- package/node_modules/fast-uri/LICENSE +30 -0
- package/node_modules/fast-uri/README.md +152 -0
- package/node_modules/fast-uri/benchmark/benchmark.mjs +159 -0
- package/node_modules/fast-uri/benchmark/equal.mjs +51 -0
- package/node_modules/fast-uri/benchmark/non-simple-domain.mjs +22 -0
- package/node_modules/fast-uri/benchmark/package.json +17 -0
- package/node_modules/fast-uri/benchmark/string-array-to-hex-stripped.mjs +24 -0
- package/node_modules/fast-uri/benchmark/ws-is-secure.mjs +65 -0
- package/node_modules/fast-uri/eslint.config.js +6 -0
- package/node_modules/fast-uri/index.js +627 -0
- package/node_modules/fast-uri/lib/schemes.js +272 -0
- package/node_modules/fast-uri/lib/utils.js +747 -0
- package/node_modules/fast-uri/package.json +68 -0
- package/node_modules/fast-uri/test/ajv.test.js +43 -0
- package/node_modules/fast-uri/test/component-safe-serialization.test.js +163 -0
- package/node_modules/fast-uri/test/equal.test.js +145 -0
- package/node_modules/fast-uri/test/fixtures/uri-js-parse.json +503 -0
- package/node_modules/fast-uri/test/fixtures/uri-js-serialize.json +120 -0
- package/node_modules/fast-uri/test/ipv6-canonical.test.js +34 -0
- package/node_modules/fast-uri/test/ipv6-validation.test.js +124 -0
- package/node_modules/fast-uri/test/malformed-percent.test.js +77 -0
- package/node_modules/fast-uri/test/malformed-urn.test.js +61 -0
- package/node_modules/fast-uri/test/parse.test.js +327 -0
- package/node_modules/fast-uri/test/query-fragment-normalization.test.js +33 -0
- package/node_modules/fast-uri/test/reserved-path-normalization.test.js +109 -0
- package/node_modules/fast-uri/test/resolve.test.js +87 -0
- package/node_modules/fast-uri/test/rfc-3986.test.js +90 -0
- package/node_modules/fast-uri/test/scheme-validation.test.js +124 -0
- package/node_modules/fast-uri/test/security-normalization.test.js +140 -0
- package/node_modules/fast-uri/test/security.test.js +431 -0
- package/node_modules/fast-uri/test/serialize.test.js +151 -0
- package/node_modules/fast-uri/test/uri-js-compatibility.test.js +33 -0
- package/node_modules/fast-uri/test/uri-js.test.js +912 -0
- package/node_modules/fast-uri/test/urn-full-input.test.js +29 -0
- package/node_modules/fast-uri/test/util.test.js +38 -0
- package/node_modules/fast-uri/test/websocket-query-preservation.test.js +24 -0
- package/node_modules/fast-uri/tsconfig.json +9 -0
- package/node_modules/fast-uri/types/index.d.ts +60 -0
- package/node_modules/fast-uri/types/index.test-d.ts +17 -0
- package/node_modules/json-schema-traverse/.eslintrc.yml +27 -0
- package/node_modules/json-schema-traverse/.github/FUNDING.yml +2 -0
- package/node_modules/json-schema-traverse/.github/workflows/build.yml +28 -0
- package/node_modules/json-schema-traverse/.github/workflows/publish.yml +27 -0
- package/node_modules/json-schema-traverse/LICENSE +21 -0
- package/node_modules/json-schema-traverse/README.md +95 -0
- package/node_modules/json-schema-traverse/index.d.ts +40 -0
- package/node_modules/json-schema-traverse/index.js +93 -0
- package/node_modules/json-schema-traverse/package.json +43 -0
- package/node_modules/json-schema-traverse/spec/.eslintrc.yml +6 -0
- package/node_modules/json-schema-traverse/spec/fixtures/schema.js +125 -0
- package/node_modules/json-schema-traverse/spec/index.spec.js +171 -0
- package/node_modules/require-from-string/index.js +34 -0
- package/node_modules/require-from-string/license +21 -0
- package/node_modules/require-from-string/package.json +28 -0
- package/node_modules/require-from-string/readme.md +56 -0
- package/package.json +33 -4
- package/packages/pcr-core/schemas/agent-review.schema.json +69 -0
- package/packages/pcr-core/schemas/classification-coverage.schema.json +187 -0
- package/packages/pcr-core/schemas/controlled-vocabulary.schema.json +189 -0
- package/packages/pcr-core/schemas/dataset-validation-input.schema.json +7 -0
- package/packages/pcr-core/schemas/feedback-draft-output.schema.json +12 -0
- package/packages/pcr-core/schemas/feedback.schema.json +27 -0
- package/packages/pcr-core/schemas/guidance-output.schema.json +97 -0
- package/packages/pcr-core/schemas/model-validation-input.schema.json +10 -0
- package/packages/pcr-core/schemas/pcr-id-aliases.schema.json +120 -0
- package/packages/pcr-core/schemas/readiness.schema.json +100 -0
- package/packages/pcr-core/schemas/structured-projection.schema.json +269 -0
- package/packages/pcr-core/schemas/validation-output.schema.json +117 -0
- package/packages/pcr-core/src/classification-coverage.mjs +732 -0
- package/packages/pcr-core/src/consumption-calculation.mjs +53 -0
- package/packages/pcr-core/src/consumption-data.mjs +88 -0
- package/packages/pcr-core/src/consumption-guidance.mjs +62 -0
- package/packages/pcr-core/src/consumption-review.mjs +83 -0
- package/packages/pcr-core/src/contracts.mjs +195 -0
- package/packages/pcr-core/src/generated/controlled-vocabulary.mjs +41 -0
- package/packages/pcr-core/src/index.mjs +2101 -0
- package/packages/pcr-core/src/languages.mjs +86 -0
- package/packages/pcr-core/src/offline-library.mjs +121 -0
- package/packages/pcr-core/src/output-semantics.mjs +228 -0
- package/packages/pcr-core/src/pcr-id-aliases.mjs +949 -0
- package/packages/pcr-core/src/projection-completeness.mjs +284 -0
- package/packages/pcr-core/src/projection-integrity.mjs +208 -0
- package/packages/pcr-core/src/read-context.mjs +505 -0
- package/packages/pcr-core/src/schema-validation.mjs +142 -0
- package/packages/pcr-core/src/source-context.mjs +13 -0
- package/packages/pcr-core/src/tidas-inspection.mjs +177 -0
- package/packages/pcr-core/src/yaml-lite.mjs +261 -0
- package/packages/tiangong-pcr-cli/bin/tiangong-pcr.mjs +12 -0
- package/packages/tiangong-pcr-cli/src/commands.mjs +1691 -0
- package/skills/tiangong-pcr/SKILL.md +90 -0
- package/skills/tiangong-pcr/references/cli-usage.md +66 -0
- package/skills/tiangong-pcr/references/feedback-loop.md +16 -0
- package/skills/tiangong-pcr/references/lca-authoring.md +30 -0
- package/skills/tiangong-pcr/references/model-authoring-loop.md +6 -0
- package/skills/tiangong-pcr/references/reviewing-tidas.md +71 -0
- package/skills/tiangong-pcr/references/tidas-authoring.md +45 -0
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/** Shared language identities. Website route aliases never become PCR identities. */
|
|
2
|
+
export const CANONICAL_PCR_LANGUAGE = "en-US";
|
|
3
|
+
export const REQUIRED_PCR_LANGUAGES = Object.freeze(["en-US", "zh-CN"]);
|
|
4
|
+
export const LEGACY_PCR_ARTIFACT_HASH_FIELDS = Object.freeze({
|
|
5
|
+
pcr_en_us_sha256: "pcr.en-US.md",
|
|
6
|
+
pcr_zh_cn_sha256: "pcr.zh-CN.md",
|
|
7
|
+
structured_sha256: "structured.yaml",
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
export function assertPcrLanguageCode(language) {
|
|
11
|
+
if (typeof language !== "string" || !/^[a-z]{2,3}(?:-[A-Za-z0-9]{2,8})*$/u.test(language)) {
|
|
12
|
+
throw new Error(`Invalid PCR language code: ${String(language)}`);
|
|
13
|
+
}
|
|
14
|
+
let canonical;
|
|
15
|
+
try {
|
|
16
|
+
canonical = Intl.getCanonicalLocales(language)[0];
|
|
17
|
+
} catch {
|
|
18
|
+
throw new Error(`Invalid PCR language code: ${language}`);
|
|
19
|
+
}
|
|
20
|
+
if (canonical !== language || language === "und") {
|
|
21
|
+
throw new Error(`PCR language code must use its canonical BCP 47 spelling: ${language}`);
|
|
22
|
+
}
|
|
23
|
+
return language;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function pcrMarkdownFile(language) {
|
|
27
|
+
return `pcr.${assertPcrLanguageCode(language)}.md`;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export function declaredPcrLanguages(manifest, { strict = true } = {}) {
|
|
31
|
+
const available = manifest?.languages?.available;
|
|
32
|
+
// Preserve the legacy reader's fixed-file inspection of incomplete metadata.
|
|
33
|
+
// Authoring and documentation export always use the strict contract.
|
|
34
|
+
if (!strict && available === undefined) return [...REQUIRED_PCR_LANGUAGES];
|
|
35
|
+
if (!Array.isArray(available) || available.length === 0) {
|
|
36
|
+
throw new Error("PCR manifest requires languages.available.");
|
|
37
|
+
}
|
|
38
|
+
const languages = available.map(assertPcrLanguageCode);
|
|
39
|
+
if (new Set(languages).size !== languages.length) {
|
|
40
|
+
throw new Error("PCR manifest languages.available must be unique.");
|
|
41
|
+
}
|
|
42
|
+
if (strict) {
|
|
43
|
+
if (manifest.languages.canonical !== CANONICAL_PCR_LANGUAGE) {
|
|
44
|
+
throw new Error(`PCR canonical language must be ${CANONICAL_PCR_LANGUAGE}.`);
|
|
45
|
+
}
|
|
46
|
+
for (const required of REQUIRED_PCR_LANGUAGES) {
|
|
47
|
+
if (!languages.includes(required)) throw new Error(`PCR requires language ${required}.`);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return languages;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export function pcrArtifactFiles(manifest, options = {}) {
|
|
54
|
+
return [...declaredPcrLanguages(manifest, options).map(pcrMarkdownFile), "structured.yaml"];
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/** Current release artifacts, with v1 fixed hashes and v2 per-language hashes. */
|
|
58
|
+
export function expectedPcrArtifactHashes(manifest) {
|
|
59
|
+
const artifacts = manifest?.release_artifacts;
|
|
60
|
+
if (!artifacts || typeof artifacts !== "object" || Array.isArray(artifacts)) {
|
|
61
|
+
throw new Error("Managed PCR requires release_artifacts.");
|
|
62
|
+
}
|
|
63
|
+
const languages = declaredPcrLanguages(manifest);
|
|
64
|
+
if (manifest.schema_version === 2) {
|
|
65
|
+
const hashes = artifacts.markdown_sha256;
|
|
66
|
+
if (!hashes || typeof hashes !== "object" || Array.isArray(hashes)) {
|
|
67
|
+
throw new Error("PCR schema v2 requires release_artifacts.markdown_sha256.");
|
|
68
|
+
}
|
|
69
|
+
if (Object.keys(hashes).sort().join("\n") !== [...languages].sort().join("\n")) {
|
|
70
|
+
throw new Error("Release Markdown hashes must match the declared languages exactly.");
|
|
71
|
+
}
|
|
72
|
+
return {
|
|
73
|
+
...Object.fromEntries(languages.map((language) => [pcrMarkdownFile(language), hashes[language]])),
|
|
74
|
+
"structured.yaml": artifacts.structured_sha256,
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
if (manifest.schema_version !== undefined && manifest.schema_version !== 1) {
|
|
78
|
+
throw new Error(`Unsupported PCR manifest schema version: ${manifest.schema_version}`);
|
|
79
|
+
}
|
|
80
|
+
if (languages.some((language) => !REQUIRED_PCR_LANGUAGES.includes(language))) {
|
|
81
|
+
throw new Error("A released PCR with optional languages requires schema v2 artifact hashes.");
|
|
82
|
+
}
|
|
83
|
+
return Object.fromEntries(
|
|
84
|
+
Object.entries(LEGACY_PCR_ARTIFACT_HASH_FIELDS).map(([field, file]) => [file, artifacts[field]]),
|
|
85
|
+
);
|
|
86
|
+
}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import { createRequire } from "node:module";
|
|
3
|
+
import { closeSync, openSync, readSync, readFileSync, statSync } from "node:fs";
|
|
4
|
+
import path from "node:path";
|
|
5
|
+
import { inflateRawSync } from "node:zlib";
|
|
6
|
+
import { parseYaml } from "./yaml-lite.mjs";
|
|
7
|
+
import { expectedPcrArtifactHashes } from "./languages.mjs";
|
|
8
|
+
import { PcrClassificationCoverageNotFoundError } from "./classification-coverage.mjs";
|
|
9
|
+
|
|
10
|
+
export const LIBRARY_FORMAT_VERSION = 1;
|
|
11
|
+
export const sha256 = (bytes) => `sha256:${createHash("sha256").update(bytes).digest("hex")}`;
|
|
12
|
+
export function libraryError(code, message) {
|
|
13
|
+
return Object.assign(new Error(message), { code });
|
|
14
|
+
}
|
|
15
|
+
export function sqliteDatabase() {
|
|
16
|
+
const [major, minor] = process.versions.node.split(".").map(Number);
|
|
17
|
+
if (major < 24 || (major === 24 && minor < 19)) {
|
|
18
|
+
throw libraryError("PCR_LIBRARY_RUNTIME_UNSUPPORTED", "Offline libraries require Node.js 24.19 or newer.");
|
|
19
|
+
}
|
|
20
|
+
return createRequire(import.meta.url)("node:sqlite").DatabaseSync;
|
|
21
|
+
}
|
|
22
|
+
export function hashFile(filename) {
|
|
23
|
+
const hash = createHash("sha256");
|
|
24
|
+
const fd = openSync(filename, "r");
|
|
25
|
+
const buffer = Buffer.alloc(1024 * 1024);
|
|
26
|
+
try {
|
|
27
|
+
let count;
|
|
28
|
+
while ((count = readSync(fd, buffer, 0, buffer.length, null))) hash.update(buffer.subarray(0, count));
|
|
29
|
+
return `sha256:${hash.digest("hex")}`;
|
|
30
|
+
} finally { closeSync(fd); }
|
|
31
|
+
}
|
|
32
|
+
export function metadataDigest(db, table) {
|
|
33
|
+
if (!["records", "aliases", "coverage", "files"].includes(table)) throw new Error("Unknown snapshot table.");
|
|
34
|
+
const hash = createHash("sha256");
|
|
35
|
+
const columns = table === "files" ? "key, size, sha256" : "key, value, sha256";
|
|
36
|
+
for (const row of db.prepare(`SELECT ${columns} FROM ${table} ORDER BY key`).iterate()) {
|
|
37
|
+
hash.update(JSON.stringify(row)); hash.update("\n");
|
|
38
|
+
}
|
|
39
|
+
return `sha256:${hash.digest("hex")}`;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/** Read-only adapter; all original content remains compressed until selected. */
|
|
43
|
+
export class OfflineLibrary {
|
|
44
|
+
constructor(filename, { expectedSha256 = null, verify = false, onArtifactRead = null } = {}) {
|
|
45
|
+
this.filename = path.resolve(filename);
|
|
46
|
+
this.root = path.dirname(this.filename);
|
|
47
|
+
this.onArtifactRead = onArtifactRead;
|
|
48
|
+
this.languages = ["en-US"];
|
|
49
|
+
try {
|
|
50
|
+
this.manifest = JSON.parse(readFileSync(`${this.filename}.json`, "utf8"));
|
|
51
|
+
if (this.manifest.format_version !== LIBRARY_FORMAT_VERSION) {
|
|
52
|
+
throw libraryError("PCR_LIBRARY_FORMAT_UNSUPPORTED", `Unsupported library format ${this.manifest.format_version}; supported: ${LIBRARY_FORMAT_VERSION}.`);
|
|
53
|
+
}
|
|
54
|
+
if (JSON.stringify(this.manifest.snapshot?.available_languages) !== JSON.stringify(this.languages)) throw new Error("Unsupported library language policy; expected English only.");
|
|
55
|
+
if (this.manifest.kind !== "tiangong-pcr-library" || !/^sha256:[a-f0-9]{64}$/u.test(this.manifest.sha256 ?? "")) throw new Error("Invalid library manifest.");
|
|
56
|
+
if (statSync(this.filename).size !== this.manifest.bytes) throw new Error("Library byte length differs from manifest.");
|
|
57
|
+
if (expectedSha256 !== null && !/^sha256:[a-f0-9]{64}$/u.test(expectedSha256)) throw new Error("Expected SHA-256 must use sha256:<64 lowercase hex digits>.");
|
|
58
|
+
if (verify || expectedSha256 !== null) {
|
|
59
|
+
const digest = hashFile(this.filename);
|
|
60
|
+
if (digest !== this.manifest.sha256 || (expectedSha256 !== null && digest !== expectedSha256)) throw new Error("Library SHA-256 mismatch.");
|
|
61
|
+
}
|
|
62
|
+
const DatabaseSync = sqliteDatabase();
|
|
63
|
+
this.db = new DatabaseSync(this.filename, { readOnly: true, allowExtension: false, defensive: true });
|
|
64
|
+
this.db.exec("PRAGMA query_only = ON; PRAGMA trusted_schema = OFF; BEGIN;");
|
|
65
|
+
if (this.db.prepare("PRAGMA user_version").get().user_version !== LIBRARY_FORMAT_VERSION) throw libraryError("PCR_LIBRARY_FORMAT_UNSUPPORTED", "SQLite format version does not match the reader.");
|
|
66
|
+
const metadata = JSON.parse(this.db.prepare("SELECT value FROM metadata WHERE key = 'snapshot'").get()?.value ?? "null");
|
|
67
|
+
if (JSON.stringify(metadata) !== JSON.stringify(this.manifest.snapshot)) throw new Error("Snapshot identity differs from manifest.");
|
|
68
|
+
for (const table of ["records", "aliases", "coverage", "files"]) {
|
|
69
|
+
if (metadataDigest(this.db, table) !== this.manifest.index_sha256?.[table]) throw new Error(`Library ${table} index checksum mismatch.`);
|
|
70
|
+
}
|
|
71
|
+
if (verify && this.db.prepare("PRAGMA integrity_check").get().integrity_check !== "ok") throw new Error("SQLite integrity check failed.");
|
|
72
|
+
} catch (error) {
|
|
73
|
+
this.close();
|
|
74
|
+
if (error.code?.startsWith("PCR_LIBRARY_")) throw error;
|
|
75
|
+
throw libraryError("PCR_LIBRARY_INVALID", `Cannot open offline library ${this.filename}: ${error.message}`);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
close() { this.db?.close(); this.db = null; }
|
|
79
|
+
row(table, key) {
|
|
80
|
+
const row = this.db.prepare(`SELECT value, sha256 FROM ${table} WHERE key = ?`).get(key);
|
|
81
|
+
if (!row) return null;
|
|
82
|
+
if (sha256(row.value) !== row.sha256) throw libraryError("PCR_LIBRARY_INVALID", `Invalid ${table} row: ${key}`);
|
|
83
|
+
return JSON.parse(row.value);
|
|
84
|
+
}
|
|
85
|
+
listPcrs(scope) {
|
|
86
|
+
const where = scope === "all" ? "" : scope === "material" ? " WHERE kind = 'methodology'" : " WHERE kind = 'legacy_scaffold_reference'";
|
|
87
|
+
return this.db.prepare(`SELECT value FROM records${where} ORDER BY position`).all().map((row) => JSON.parse(row.value));
|
|
88
|
+
}
|
|
89
|
+
entry(id) {
|
|
90
|
+
const record = this.row("records", String(id));
|
|
91
|
+
return record ? { id: record.id, path: record.path, manifestPath: path.join(this.root, record.path, "manifest.yaml") } : null;
|
|
92
|
+
}
|
|
93
|
+
findAlias(id) { return this.row("aliases", String(id)); }
|
|
94
|
+
readFile(key) {
|
|
95
|
+
const row = this.db.prepare("SELECT data, size, sha256 FROM files WHERE key = ?").get(key);
|
|
96
|
+
if (!row) throw libraryError("PCR_LIBRARY_ARTIFACT_MISSING", `Missing library artifact: ${key}`);
|
|
97
|
+
try {
|
|
98
|
+
const bytes = inflateRawSync(row.data, { maxOutputLength: Math.max(1, row.size) });
|
|
99
|
+
if (bytes.length !== row.size || sha256(bytes) !== row.sha256) throw new Error("checksum mismatch");
|
|
100
|
+
this.onArtifactRead?.(key);
|
|
101
|
+
return bytes;
|
|
102
|
+
} catch (error) { throw libraryError("PCR_LIBRARY_ARTIFACT_INVALID", `Invalid library artifact ${key}: ${error.message}`); }
|
|
103
|
+
}
|
|
104
|
+
snapshotFiles(entry) {
|
|
105
|
+
const manifestBytes = this.readFile(`${entry.path}/manifest.yaml`);
|
|
106
|
+
const manifest = parseYaml(manifestBytes.toString("utf8"));
|
|
107
|
+
if (manifest.id !== entry.id) throw libraryError("PCR_LIBRARY_INVALID", "PCR manifest identity mismatch.");
|
|
108
|
+
const artifacts = Object.fromEntries(["pcr.en-US.md", "structured.yaml"].map((name) => [name, { bytes: this.readFile(`${entry.path}/${name}`) }]));
|
|
109
|
+
for (const [name, expected] of Object.entries(manifest.release_artifacts ? expectedPcrArtifactHashes(manifest) : {})) {
|
|
110
|
+
if (!Object.hasOwn(artifacts, name)) continue;
|
|
111
|
+
if (manifest.release_artifacts && sha256(artifacts[name]?.bytes ?? Buffer.alloc(0)) !== expected) throw libraryError("PCR_LIBRARY_ARTIFACT_INVALID", `Release artifact hash mismatch: ${entry.path}/${name}`);
|
|
112
|
+
}
|
|
113
|
+
return { manifest, manifestBytes, artifacts };
|
|
114
|
+
}
|
|
115
|
+
coverageSnapshot(system, version) {
|
|
116
|
+
const key = `${String(system).toLowerCase()}:${version}`;
|
|
117
|
+
const snapshot = this.row("coverage", key);
|
|
118
|
+
if (!snapshot) throw new PcrClassificationCoverageNotFoundError({ system, version, relativePath: `classifications/indexes/${system}-${version}-coverage.json` });
|
|
119
|
+
return snapshot;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
function semanticIssue(code, instancePath, message, params = {}) {
|
|
2
|
+
return {
|
|
3
|
+
code: `semantic.${code}`,
|
|
4
|
+
instance_path: instancePath,
|
|
5
|
+
schema_path: `#/x-semantic/${code.replaceAll(".", "/")}`,
|
|
6
|
+
keyword: "semantic",
|
|
7
|
+
message,
|
|
8
|
+
params,
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function readinessSemanticIssues(readiness) {
|
|
13
|
+
const issues = [];
|
|
14
|
+
const blockers = readiness.blockers;
|
|
15
|
+
const fingerprint = readiness.projection_fingerprint;
|
|
16
|
+
const usable = readiness.usable_for_guidance && readiness.usable_for_validation;
|
|
17
|
+
|
|
18
|
+
if (readiness.usable_for_guidance !== readiness.usable_for_validation) {
|
|
19
|
+
issues.push(semanticIssue(
|
|
20
|
+
"readiness.usability_alignment",
|
|
21
|
+
"/usable_for_validation",
|
|
22
|
+
"guidance and validation usability must have the same value.",
|
|
23
|
+
));
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
if (blockers.length > 0) {
|
|
27
|
+
if (readiness.status !== "unavailable") {
|
|
28
|
+
issues.push(semanticIssue(
|
|
29
|
+
"readiness.blocked_status",
|
|
30
|
+
"/status",
|
|
31
|
+
"readiness with blockers must be unavailable.",
|
|
32
|
+
{ blocker_count: blockers.length },
|
|
33
|
+
));
|
|
34
|
+
}
|
|
35
|
+
if (usable || readiness.usable_for_guidance || readiness.usable_for_validation) {
|
|
36
|
+
issues.push(semanticIssue(
|
|
37
|
+
"readiness.blocked_usability",
|
|
38
|
+
"/usable_for_guidance",
|
|
39
|
+
"readiness with blockers must not be usable for guidance or validation.",
|
|
40
|
+
{ blocker_count: blockers.length },
|
|
41
|
+
));
|
|
42
|
+
}
|
|
43
|
+
} else {
|
|
44
|
+
if (readiness.status === "unavailable") {
|
|
45
|
+
issues.push(semanticIssue(
|
|
46
|
+
"readiness.unavailable_without_blocker",
|
|
47
|
+
"/status",
|
|
48
|
+
"unavailable readiness must include at least one blocker.",
|
|
49
|
+
));
|
|
50
|
+
}
|
|
51
|
+
if (!usable) {
|
|
52
|
+
issues.push(semanticIssue(
|
|
53
|
+
"readiness.unblocked_usability",
|
|
54
|
+
"/usable_for_guidance",
|
|
55
|
+
"readiness without blockers must be usable for guidance and validation.",
|
|
56
|
+
));
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
if (!fingerprint.required) {
|
|
61
|
+
if (
|
|
62
|
+
fingerprint.status !== "not_required" ||
|
|
63
|
+
fingerprint.schema_valid !== null ||
|
|
64
|
+
fingerprint.issues.length > 0
|
|
65
|
+
) {
|
|
66
|
+
issues.push(semanticIssue(
|
|
67
|
+
"readiness.fingerprint_not_required",
|
|
68
|
+
"/projection_fingerprint/status",
|
|
69
|
+
"a non-required projection fingerprint must be not_required with no schema result or issues.",
|
|
70
|
+
));
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
if (fingerprint.status === "current") {
|
|
75
|
+
if (
|
|
76
|
+
fingerprint.schema_valid !== true ||
|
|
77
|
+
fingerprint.source_hash_valid !== true ||
|
|
78
|
+
fingerprint.content_hash_valid !== true ||
|
|
79
|
+
fingerprint.issues.length > 0
|
|
80
|
+
) {
|
|
81
|
+
issues.push(semanticIssue(
|
|
82
|
+
"readiness.current_fingerprint",
|
|
83
|
+
"/projection_fingerprint/status",
|
|
84
|
+
"a current projection fingerprint requires valid schema, source hash, content hash, and no issues.",
|
|
85
|
+
));
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
if (fingerprint.required && usable && fingerprint.status !== "current") {
|
|
90
|
+
issues.push(semanticIssue(
|
|
91
|
+
"readiness.usable_fingerprint",
|
|
92
|
+
"/projection_fingerprint/status",
|
|
93
|
+
"usable material PCR readiness requires a current projection fingerprint.",
|
|
94
|
+
));
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
return issues.sort(compareIssues);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export function validationReportSemanticIssues(report) {
|
|
101
|
+
const issues = [];
|
|
102
|
+
const summary = countFindings(report.findings);
|
|
103
|
+
const performed = report.check_coverage.checks_performed;
|
|
104
|
+
const skipped = report.check_coverage.checks_skipped;
|
|
105
|
+
const checkedRequirementCount = performed.reduce(
|
|
106
|
+
(total, check) => total + check.requirement_count,
|
|
107
|
+
0,
|
|
108
|
+
);
|
|
109
|
+
const skippedRequirementCount = skipped.reduce(
|
|
110
|
+
(total, check) => total + check.requirement_count,
|
|
111
|
+
0,
|
|
112
|
+
);
|
|
113
|
+
|
|
114
|
+
if (report.finding_count !== report.findings.length) {
|
|
115
|
+
issues.push(semanticIssue(
|
|
116
|
+
"validation.finding_count",
|
|
117
|
+
"/finding_count",
|
|
118
|
+
"finding_count must equal findings.length.",
|
|
119
|
+
{ expected: report.findings.length, actual: report.finding_count },
|
|
120
|
+
));
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
for (const severity of ["error", "warning", "info"]) {
|
|
124
|
+
if (report.finding_summary[severity] !== summary[severity]) {
|
|
125
|
+
issues.push(semanticIssue(
|
|
126
|
+
`validation.finding_summary.${severity}`,
|
|
127
|
+
`/finding_summary/${severity}`,
|
|
128
|
+
`${severity} finding summary must equal the findings array count.`,
|
|
129
|
+
{ expected: summary[severity], actual: report.finding_summary[severity] },
|
|
130
|
+
));
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
for (const [index, check] of performed.entries()) {
|
|
135
|
+
if (check.evaluated_requirement_count !== check.requirement_count) {
|
|
136
|
+
issues.push(semanticIssue(
|
|
137
|
+
"validation.performed_check_coverage",
|
|
138
|
+
`/check_coverage/checks_performed/${index}/evaluated_requirement_count`,
|
|
139
|
+
"a performed check must evaluate every requirement it declares.",
|
|
140
|
+
{
|
|
141
|
+
requirement_count: check.requirement_count,
|
|
142
|
+
evaluated_requirement_count: check.evaluated_requirement_count,
|
|
143
|
+
},
|
|
144
|
+
));
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
const coverage = report.check_coverage;
|
|
149
|
+
if (coverage.checked_requirement_count !== checkedRequirementCount) {
|
|
150
|
+
issues.push(semanticIssue(
|
|
151
|
+
"validation.checked_requirement_count",
|
|
152
|
+
"/check_coverage/checked_requirement_count",
|
|
153
|
+
"checked_requirement_count must equal the sum of performed requirement counts.",
|
|
154
|
+
{ expected: checkedRequirementCount, actual: coverage.checked_requirement_count },
|
|
155
|
+
));
|
|
156
|
+
}
|
|
157
|
+
if (coverage.skipped_requirement_count !== skippedRequirementCount) {
|
|
158
|
+
issues.push(semanticIssue(
|
|
159
|
+
"validation.skipped_requirement_count",
|
|
160
|
+
"/check_coverage/skipped_requirement_count",
|
|
161
|
+
"skipped_requirement_count must equal the sum of skipped requirement counts.",
|
|
162
|
+
{ expected: skippedRequirementCount, actual: coverage.skipped_requirement_count },
|
|
163
|
+
));
|
|
164
|
+
}
|
|
165
|
+
const totalRequirementCount = checkedRequirementCount + skippedRequirementCount;
|
|
166
|
+
if (coverage.total_requirement_count !== totalRequirementCount) {
|
|
167
|
+
issues.push(semanticIssue(
|
|
168
|
+
"validation.total_requirement_count",
|
|
169
|
+
"/check_coverage/total_requirement_count",
|
|
170
|
+
"total_requirement_count must equal checked plus skipped requirements.",
|
|
171
|
+
{ expected: totalRequirementCount, actual: coverage.total_requirement_count },
|
|
172
|
+
));
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
const expectedCompleteness = performed.length === 0
|
|
176
|
+
? "none"
|
|
177
|
+
: skipped.length > 0
|
|
178
|
+
? "partial"
|
|
179
|
+
: "complete";
|
|
180
|
+
if (report.completeness !== expectedCompleteness) {
|
|
181
|
+
issues.push(semanticIssue(
|
|
182
|
+
"validation.completeness",
|
|
183
|
+
"/completeness",
|
|
184
|
+
"completeness must reflect performed and skipped checks.",
|
|
185
|
+
{ expected: expectedCompleteness, actual: report.completeness },
|
|
186
|
+
));
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
const expectedStatus = summary.error > 0
|
|
190
|
+
? "failed"
|
|
191
|
+
: performed.length === 0
|
|
192
|
+
? "inconclusive"
|
|
193
|
+
: "passed";
|
|
194
|
+
if (report.validation_status !== expectedStatus) {
|
|
195
|
+
issues.push(semanticIssue(
|
|
196
|
+
"validation.status",
|
|
197
|
+
"/validation_status",
|
|
198
|
+
"validation_status must reflect error findings and performed coverage.",
|
|
199
|
+
{ expected: expectedStatus, actual: report.validation_status },
|
|
200
|
+
));
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
if (!report.input.accepted && performed.length > 0) {
|
|
204
|
+
issues.push(semanticIssue(
|
|
205
|
+
"validation.rejected_input_coverage",
|
|
206
|
+
"/check_coverage/checks_performed",
|
|
207
|
+
"rejected input must not report performed checks.",
|
|
208
|
+
));
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
return issues.sort(compareIssues);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
function countFindings(findings) {
|
|
215
|
+
const summary = { error: 0, warning: 0, info: 0 };
|
|
216
|
+
for (const finding of findings) {
|
|
217
|
+
summary[finding.severity] += 1;
|
|
218
|
+
}
|
|
219
|
+
return summary;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
function compareIssues(left, right) {
|
|
223
|
+
return (
|
|
224
|
+
left.instance_path.localeCompare(right.instance_path) ||
|
|
225
|
+
left.code.localeCompare(right.code) ||
|
|
226
|
+
left.message.localeCompare(right.message)
|
|
227
|
+
);
|
|
228
|
+
}
|