@techspokes/typescript-wsdl-client 1.1.4 → 1.1.8
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/README.md +81 -35
- package/dist/app/generateApp.d.ts +0 -1
- package/dist/app/generateApp.js +8 -6
- package/dist/app/generateCheckedApp.d.ts +38 -0
- package/dist/app/generateCheckedApp.js +108 -0
- package/dist/checkedPipeline.d.ts +155 -0
- package/dist/checkedPipeline.js +448 -0
- package/dist/checkedPlanning.d.ts +123 -0
- package/dist/checkedPlanning.js +245 -0
- package/dist/cli.d.ts +0 -1
- package/dist/cli.js +123 -5
- package/dist/client/checkedDirectRuntime.d.ts +96 -0
- package/dist/client/checkedDirectRuntime.js +43 -0
- package/dist/client/directClientRuntime.d.ts +74 -0
- package/dist/client/directClientRuntime.js +165 -0
- package/dist/client/directClientVersion.d.ts +6 -0
- package/dist/client/directClientVersion.js +6 -0
- package/dist/client/generateClient.d.ts +0 -1
- package/dist/client/generateClient.js +26 -12
- package/dist/client/generateDirectClient.d.ts +32 -0
- package/dist/client/generateDirectClient.js +268 -0
- package/dist/client/generateOperations.d.ts +0 -1
- package/dist/client/generateTypes.d.ts +0 -1
- package/dist/client/generateUtils.d.ts +0 -1
- package/dist/client/generateUtils.js +3 -1
- package/dist/compiler/applicationGroups.d.ts +53 -0
- package/dist/compiler/applicationGroups.js +403 -0
- package/dist/compiler/buildCanonicalGraph.d.ts +6 -0
- package/dist/compiler/buildCanonicalGraph.js +381 -0
- package/dist/compiler/canonicalGraph.d.ts +197 -0
- package/dist/compiler/canonicalGraph.js +37 -0
- package/dist/compiler/catalogErrors.d.ts +17 -0
- package/dist/compiler/catalogErrors.js +86 -0
- package/dist/compiler/catalogProvenance.d.ts +14 -0
- package/dist/compiler/catalogProvenance.js +229 -0
- package/dist/compiler/checkedAssessment.d.ts +90 -0
- package/dist/compiler/checkedAssessment.js +300 -0
- package/dist/compiler/checkedComponentSource.d.ts +16 -0
- package/dist/compiler/checkedComponentSource.js +31 -0
- package/dist/compiler/checkedSourcePreparation.d.ts +72 -0
- package/dist/compiler/checkedSourcePreparation.js +202 -0
- package/dist/compiler/complexTypeContent.d.ts +58 -0
- package/dist/compiler/complexTypeContent.js +558 -0
- package/dist/compiler/componentCorrespondence.d.ts +32 -0
- package/dist/compiler/componentCorrespondence.js +140 -0
- package/dist/compiler/componentRecordProjection.d.ts +109 -0
- package/dist/compiler/componentRecordProjection.js +319 -0
- package/dist/compiler/componentSoapPreparation.d.ts +20 -0
- package/dist/compiler/componentSoapPreparation.js +36 -0
- package/dist/compiler/composeCanonicalGraph.d.ts +68 -0
- package/dist/compiler/composeCanonicalGraph.js +252 -0
- package/dist/compiler/dataOwnership.d.ts +21 -0
- package/dist/compiler/dataOwnership.js +167 -0
- package/dist/compiler/datatypeValues.d.ts +46 -0
- package/dist/compiler/datatypeValues.js +275 -0
- package/dist/compiler/directCodec.d.ts +116 -0
- package/dist/compiler/directCodec.js +377 -0
- package/dist/compiler/directExecutionPolicy.d.ts +9 -0
- package/dist/compiler/directExecutionPolicy.js +17 -0
- package/dist/compiler/directOperation.d.ts +114 -0
- package/dist/compiler/directOperation.js +373 -0
- package/dist/compiler/directSoap.d.ts +66 -0
- package/dist/compiler/directSoap.js +391 -0
- package/dist/compiler/directSoapSource.d.ts +38 -0
- package/dist/compiler/directSoapSource.js +233 -0
- package/dist/compiler/directSourceCapsule.d.ts +169 -0
- package/dist/compiler/directSourceCapsule.js +727 -0
- package/dist/compiler/directStructure.d.ts +128 -0
- package/dist/compiler/directStructure.js +543 -0
- package/dist/compiler/directStructurePlan.d.ts +149 -0
- package/dist/compiler/directStructurePlan.js +623 -0
- package/dist/compiler/directValues.d.ts +128 -0
- package/dist/compiler/directValues.js +1116 -0
- package/dist/compiler/finiteRe01Construction.d.ts +69 -0
- package/dist/compiler/finiteRe01Construction.js +422 -0
- package/dist/compiler/finiteRe01Verification.d.ts +218 -0
- package/dist/compiler/finiteRe01Verification.js +1217 -0
- package/dist/compiler/generateCatalog.d.ts +0 -1
- package/dist/compiler/graphTraversal.d.ts +10 -0
- package/dist/compiler/graphTraversal.js +37 -0
- package/dist/compiler/hypotheticalScopedIdentity.d.ts +22 -0
- package/dist/compiler/hypotheticalScopedIdentity.js +81 -0
- package/dist/compiler/occurrenceAnalysis.d.ts +66 -0
- package/dist/compiler/occurrenceAnalysis.js +316 -0
- package/dist/compiler/originalSourceMembership.d.ts +5 -0
- package/dist/compiler/originalSourceMembership.js +31 -0
- package/dist/compiler/particleAttribution.d.ts +16 -0
- package/dist/compiler/particleAttribution.js +494 -0
- package/dist/compiler/particleDeclarationConsistency.d.ts +23 -0
- package/dist/compiler/particleDeclarationConsistency.js +206 -0
- package/dist/compiler/particleExtension.d.ts +21 -0
- package/dist/compiler/particleExtension.js +123 -0
- package/dist/compiler/particleLocalAssessment.d.ts +19 -0
- package/dist/compiler/particleLocalAssessment.js +92 -0
- package/dist/compiler/particleRestriction.d.ts +23 -0
- package/dist/compiler/particleRestriction.js +494 -0
- package/dist/compiler/particleSemanticView.d.ts +51 -0
- package/dist/compiler/particleSemanticView.js +310 -0
- package/dist/compiler/particleWildcardRelation.d.ts +87 -0
- package/dist/compiler/particleWildcardRelation.js +143 -0
- package/dist/compiler/projectionScalar.d.ts +32 -0
- package/dist/compiler/projectionScalar.js +184 -0
- package/dist/compiler/re01CandidateAssignments.d.ts +95 -0
- package/dist/compiler/re01CandidateAssignments.js +341 -0
- package/dist/compiler/re01CandidateCorrespondence.d.ts +85 -0
- package/dist/compiler/re01CandidateCorrespondence.js +701 -0
- package/dist/compiler/re01TypeProperties.d.ts +70 -0
- package/dist/compiler/re01TypeProperties.js +120 -0
- package/dist/compiler/re01TypePropertyValidation.d.ts +22 -0
- package/dist/compiler/re01TypePropertyValidation.js +161 -0
- package/dist/compiler/resolveCanonicalGraph.d.ts +41 -0
- package/dist/compiler/resolveCanonicalGraph.js +240 -0
- package/dist/compiler/scalarSchemaAssessment.d.ts +424 -0
- package/dist/compiler/scalarSchemaAssessment.js +5198 -0
- package/dist/compiler/schemaAttributeGroupProperties.d.ts +16 -0
- package/dist/compiler/schemaAttributeGroupProperties.js +53 -0
- package/dist/compiler/schemaAttributeProperties.d.ts +9 -0
- package/dist/compiler/schemaAttributeProperties.js +11 -0
- package/dist/compiler/schemaAttributeUses.d.ts +110 -0
- package/dist/compiler/schemaAttributeUses.js +798 -0
- package/dist/compiler/schemaBinaryWordReconstruction.d.ts +9 -0
- package/dist/compiler/schemaBinaryWordReconstruction.js +33 -0
- package/dist/compiler/schemaBuiltinFacets.d.ts +13 -0
- package/dist/compiler/schemaBuiltinFacets.js +51 -0
- package/dist/compiler/schemaCalendarImages.d.ts +7 -0
- package/dist/compiler/schemaCalendarImages.js +204 -0
- package/dist/compiler/schemaCalendarLanguage.d.ts +10 -0
- package/dist/compiler/schemaCalendarLanguage.js +227 -0
- package/dist/compiler/schemaCompiler.d.ts +0 -1
- package/dist/compiler/schemaComponentEquality.d.ts +27 -0
- package/dist/compiler/schemaComponentEquality.js +446 -0
- package/dist/compiler/schemaConstructionAssessment.d.ts +79 -0
- package/dist/compiler/schemaConstructionAssessment.js +745 -0
- package/dist/compiler/schemaDatatypeValues.d.ts +3 -0
- package/dist/compiler/schemaDatatypeValues.js +2 -0
- package/dist/compiler/schemaDecimalLanguage.d.ts +6 -0
- package/dist/compiler/schemaDecimalLanguage.js +102 -0
- package/dist/compiler/schemaDeclarationPrimitives.d.ts +39 -0
- package/dist/compiler/schemaDeclarationPrimitives.js +211 -0
- package/dist/compiler/schemaDocumentSyntax.d.ts +54 -0
- package/dist/compiler/schemaDocumentSyntax.js +294 -0
- package/dist/compiler/schemaDurationLanguage.d.ts +10 -0
- package/dist/compiler/schemaDurationLanguage.js +170 -0
- package/dist/compiler/schemaElementInstance.d.ts +30 -0
- package/dist/compiler/schemaElementInstance.js +45 -0
- package/dist/compiler/schemaElementProperties.d.ts +15 -0
- package/dist/compiler/schemaElementProperties.js +23 -0
- package/dist/compiler/schemaEndpointWordCapacity.d.ts +35 -0
- package/dist/compiler/schemaEndpointWordCapacity.js +39 -0
- package/dist/compiler/schemaExactCalendar.d.ts +72 -0
- package/dist/compiler/schemaExactCalendar.js +264 -0
- package/dist/compiler/schemaFacetAnnotation.d.ts +31 -0
- package/dist/compiler/schemaFacetAnnotation.js +199 -0
- package/dist/compiler/schemaGeneratedScalarShape.d.ts +34 -0
- package/dist/compiler/schemaGeneratedScalarShape.js +178 -0
- package/dist/compiler/schemaIdentityConstraints.d.ts +72 -0
- package/dist/compiler/schemaIdentityConstraints.js +362 -0
- package/dist/compiler/schemaIeeeLanguage.d.ts +42 -0
- package/dist/compiler/schemaIeeeLanguage.js +759 -0
- package/dist/compiler/schemaIntegerImages.d.ts +10 -0
- package/dist/compiler/schemaIntegerImages.js +113 -0
- package/dist/compiler/schemaLexicalPredicates.d.ts +28 -0
- package/dist/compiler/schemaLexicalPredicates.js +63 -0
- package/dist/compiler/schemaNotationProperties.d.ts +31 -0
- package/dist/compiler/schemaNotationProperties.js +84 -0
- package/dist/compiler/schemaNumericImageConditions.d.ts +23 -0
- package/dist/compiler/schemaNumericImageConditions.js +66 -0
- package/dist/compiler/schemaParticleWildcardProperties.d.ts +19 -0
- package/dist/compiler/schemaParticleWildcardProperties.js +43 -0
- package/dist/compiler/schemaPattern.d.ts +1061 -0
- package/dist/compiler/schemaPattern.js +581 -0
- package/dist/compiler/schemaRegularLanguage.d.ts +66 -0
- package/dist/compiler/schemaRegularLanguage.js +1166 -0
- package/dist/compiler/schemaScalarContext.d.ts +85 -0
- package/dist/compiler/schemaScalarContext.js +78 -0
- package/dist/compiler/schemaScalarKernel.d.ts +181 -0
- package/dist/compiler/schemaScalarKernel.js +391 -0
- package/dist/compiler/schemaScalarWitnesses.d.ts +5 -0
- package/dist/compiler/schemaScalarWitnesses.js +118 -0
- package/dist/compiler/schemaSimpleTypeProperties.d.ts +94 -0
- package/dist/compiler/schemaSimpleTypeProperties.js +103 -0
- package/dist/compiler/schemaSourceGrammar.d.ts +26 -0
- package/dist/compiler/schemaSourceGrammar.js +290 -0
- package/dist/compiler/schemaSourceLexical.d.ts +3 -0
- package/dist/compiler/schemaSourceLexical.js +12 -0
- package/dist/compiler/schemaSourceValues.d.ts +50 -0
- package/dist/compiler/schemaSourceValues.js +225 -0
- package/dist/compiler/schemaSourceWildcards.d.ts +27 -0
- package/dist/compiler/schemaSourceWildcards.js +249 -0
- package/dist/compiler/schemaSymbolicSequences.d.ts +15 -0
- package/dist/compiler/schemaSymbolicSequences.js +99 -0
- package/dist/compiler/schemaSymbolicValueSets.d.ts +31 -0
- package/dist/compiler/schemaSymbolicValueSets.js +149 -0
- package/dist/compiler/schemaSyntaxAssessment.d.ts +24 -0
- package/dist/compiler/schemaSyntaxAssessment.js +361 -0
- package/dist/compiler/schemaTemporalAliases.d.ts +5 -0
- package/dist/compiler/schemaTemporalAliases.js +195 -0
- package/dist/compiler/schemaTokenImages.d.ts +8 -0
- package/dist/compiler/schemaTokenImages.js +142 -0
- package/dist/compiler/schemaTypeIdentity.d.ts +38 -0
- package/dist/compiler/schemaTypeIdentity.js +80 -0
- package/dist/compiler/schemaTypeRelations.d.ts +37 -0
- package/dist/compiler/schemaTypeRelations.js +576 -0
- package/dist/compiler/schemaUri.d.ts +12 -0
- package/dist/compiler/schemaUri.js +103 -0
- package/dist/compiler/schemaValueContext.d.ts +25 -0
- package/dist/compiler/schemaValueContext.js +1 -0
- package/dist/compiler/schemaValueImages.d.ts +9 -0
- package/dist/compiler/schemaValueImages.js +142 -0
- package/dist/compiler/schemaValueSequences.d.ts +14 -0
- package/dist/compiler/schemaValueSequences.js +19 -0
- package/dist/compiler/semanticBudget.d.ts +67 -0
- package/dist/compiler/semanticBudget.js +193 -0
- package/dist/compiler/semanticCatalog.d.ts +121 -0
- package/dist/compiler/semanticCatalog.js +160 -0
- package/dist/compiler/semanticContext.d.ts +183 -0
- package/dist/compiler/semanticContext.js +1207 -0
- package/dist/compiler/semanticTypeDependencies.d.ts +7 -0
- package/dist/compiler/semanticTypeDependencies.js +64 -0
- package/dist/compiler/semanticTypeReference.d.ts +23 -0
- package/dist/compiler/semanticTypeReference.js +36 -0
- package/dist/compiler/shapeResolver.d.ts +1 -1
- package/dist/compiler/shapeResolver.js +7 -9
- package/dist/compiler/soapHeaders.d.ts +16 -0
- package/dist/compiler/soapHeaders.js +42 -0
- package/dist/compiler/sourceSchemaBinding.d.ts +25 -0
- package/dist/compiler/sourceSchemaBinding.js +39 -0
- package/dist/compiler/standardSchemaComponents.d.ts +71 -0
- package/dist/compiler/standardSchemaComponents.js +74 -0
- package/dist/compiler/standardSchemaConstruction.d.ts +20 -0
- package/dist/compiler/standardSchemaConstruction.js +34 -0
- package/dist/compiler/structuralCompanions.d.ts +15 -0
- package/dist/compiler/structuralCompanions.js +232 -0
- package/dist/compiler/validateSemanticGraph.d.ts +4 -0
- package/dist/compiler/validateSemanticGraph.js +376 -0
- package/dist/compiler/wildcardAlgebra.d.ts +25 -0
- package/dist/compiler/wildcardAlgebra.js +155 -0
- package/dist/compiler/wsdlPolicyRequirements.d.ts +43 -0
- package/dist/compiler/wsdlPolicyRequirements.js +239 -0
- package/dist/config.d.ts +0 -1
- package/dist/gateway/generateCheckedGateway.d.ts +32 -0
- package/dist/gateway/generateCheckedGateway.js +293 -0
- package/dist/gateway/generateGateway.d.ts +0 -1
- package/dist/gateway/generateGateway.js +2 -2
- package/dist/gateway/generators.d.ts +0 -1
- package/dist/gateway/helpers.d.ts +0 -1
- package/dist/generation/componentShape.d.ts +14 -0
- package/dist/generation/componentShape.js +269 -0
- package/dist/generation/preamble.d.ts +0 -1
- package/dist/generation/sourceLayout.d.ts +13 -0
- package/dist/generation/sourceLayout.js +40 -0
- package/dist/generation/writeGeneratedSource.d.ts +0 -1
- package/dist/index.d.ts +9 -1
- package/dist/index.js +3 -0
- package/dist/loader/fetch.d.ts +0 -1
- package/dist/loader/orderedSyntax.d.ts +84 -0
- package/dist/loader/orderedSyntax.js +222 -0
- package/dist/loader/resolutionDepth.d.ts +6 -0
- package/dist/loader/resolutionDepth.js +65 -0
- package/dist/loader/schemaInput.d.ts +80 -0
- package/dist/loader/schemaInput.js +249 -0
- package/dist/loader/schemaResources.d.ts +60 -0
- package/dist/loader/schemaResources.js +333 -0
- package/dist/loader/wsdlLoader.d.ts +0 -1
- package/dist/openapi/casing.d.ts +0 -1
- package/dist/openapi/generateOpenAPI.d.ts +0 -1
- package/dist/openapi/generateOpenAPI.js +2 -2
- package/dist/openapi/generatePaths.d.ts +0 -1
- package/dist/openapi/generateSchemas.d.ts +0 -1
- package/dist/openapi/security.d.ts +0 -1
- package/dist/pipeline.d.ts +6 -2
- package/dist/pipeline.js +13 -0
- package/dist/test/generateCheckedTests.d.ts +17 -0
- package/dist/test/generateCheckedTests.js +60 -0
- package/dist/test/generateTests.d.ts +0 -1
- package/dist/test/generateTests.js +2 -2
- package/dist/test/generators.d.ts +0 -1
- package/dist/test/mockData.d.ts +0 -1
- package/dist/test/mockData.js +20 -14
- package/dist/util/attributeWildcards.d.ts +0 -1
- package/dist/util/builder.d.ts +0 -1
- package/dist/util/catalogMeta.d.ts +0 -1
- package/dist/util/checkedCliDiagnostics.d.ts +11 -0
- package/dist/util/checkedCliDiagnostics.js +22 -0
- package/dist/util/cli.d.ts +0 -1
- package/dist/util/errors.d.ts +0 -1
- package/dist/util/imports.d.ts +0 -1
- package/dist/util/runtimeSource.d.ts +0 -1
- package/dist/util/runtimeSource.js +3 -5
- package/dist/util/securityConfig.d.ts +0 -1
- package/dist/util/streamConfig.d.ts +0 -1
- package/dist/util/tools.d.ts +0 -1
- package/dist/util/xmlWhitespace.d.ts +2 -0
- package/dist/util/xmlWhitespace.js +4 -0
- package/dist/xsd/primitives.d.ts +0 -1
- package/docs/agent-skill.md +2 -0
- package/docs/api-reference.md +1 -1
- package/docs/checked-gateway.md +210 -0
- package/docs/checked-generation.md +161 -0
- package/docs/cli-reference.md +43 -1
- package/docs/concepts.md +136 -1
- package/docs/configuration.md +5 -1
- package/docs/corpus.md +33 -0
- package/docs/direct-values.md +311 -0
- package/docs/examples/checked-forecast.wsdl +19 -0
- package/docs/gateway-guide.md +1 -1
- package/docs/generated-code.md +10 -5
- package/docs/mapping-contract.md +114 -0
- package/docs/migration-playbook.md +1 -1
- package/docs/output-anatomy.md +1 -1
- package/docs/start-here.md +8 -2
- package/docs/supported-patterns.md +17 -5
- package/docs/testing.md +117 -31
- package/llms.txt +7 -7
- package/package.json +79 -25
- package/src/generation/preambles/direct-client/typescript.preamble +3 -0
- package/src/runtime/checkedGatewayHost.tpl.txt +157 -0
- package/src/runtime/streamXml.ts +1 -1
- package/dist/app/generateApp.d.ts.map +0 -1
- package/dist/cli.d.ts.map +0 -1
- package/dist/client/generateClient.d.ts.map +0 -1
- package/dist/client/generateOperations.d.ts.map +0 -1
- package/dist/client/generateTypes.d.ts.map +0 -1
- package/dist/client/generateUtils.d.ts.map +0 -1
- package/dist/compiler/generateCatalog.d.ts.map +0 -1
- package/dist/compiler/schemaCompiler.d.ts.map +0 -1
- package/dist/compiler/shapeResolver.d.ts.map +0 -1
- package/dist/config.d.ts.map +0 -1
- package/dist/gateway/generateGateway.d.ts.map +0 -1
- package/dist/gateway/generators.d.ts.map +0 -1
- package/dist/gateway/helpers.d.ts.map +0 -1
- package/dist/generation/preamble.d.ts.map +0 -1
- package/dist/generation/writeGeneratedSource.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/loader/fetch.d.ts.map +0 -1
- package/dist/loader/wsdlLoader.d.ts.map +0 -1
- package/dist/openapi/casing.d.ts.map +0 -1
- package/dist/openapi/generateOpenAPI.d.ts.map +0 -1
- package/dist/openapi/generatePaths.d.ts.map +0 -1
- package/dist/openapi/generateSchemas.d.ts.map +0 -1
- package/dist/openapi/security.d.ts.map +0 -1
- package/dist/pipeline.d.ts.map +0 -1
- package/dist/runtime/jsonArray.d.ts +0 -24
- package/dist/runtime/jsonArray.d.ts.map +0 -1
- package/dist/runtime/jsonArray.js +0 -52
- package/dist/runtime/ndjson.d.ts +0 -24
- package/dist/runtime/ndjson.d.ts.map +0 -1
- package/dist/runtime/ndjson.js +0 -30
- package/dist/runtime/streamXml.d.ts +0 -45
- package/dist/runtime/streamXml.d.ts.map +0 -1
- package/dist/runtime/streamXml.js +0 -212
- package/dist/test/generateTests.d.ts.map +0 -1
- package/dist/test/generators.d.ts.map +0 -1
- package/dist/test/mockData.d.ts.map +0 -1
- package/dist/util/attributeWildcards.d.ts.map +0 -1
- package/dist/util/builder.d.ts.map +0 -1
- package/dist/util/catalogMeta.d.ts.map +0 -1
- package/dist/util/cli.d.ts.map +0 -1
- package/dist/util/errors.d.ts.map +0 -1
- package/dist/util/imports.d.ts.map +0 -1
- package/dist/util/runtimeSource.d.ts.map +0 -1
- package/dist/util/securityConfig.d.ts.map +0 -1
- package/dist/util/streamConfig.d.ts.map +0 -1
- package/dist/util/tools.d.ts.map +0 -1
- package/dist/xsd/primitives.d.ts.map +0 -1
- package/docs/AGENTS.md +0 -47
- package/docs/README.md +0 -56
- package/docs/architecture.md +0 -149
- package/docs/decisions/001-test-generation.md +0 -36
- package/docs/decisions/002-streamable-responses.md +0 -330
- package/docs/file-naming-and-path-organization.md +0 -213
- package/docs/releases/README.md +0 -94
- package/docs/releases/v0.20.0.md +0 -22
- package/docs/releases/v0.21.0.md +0 -30
- package/docs/releases/v0.22.0.md +0 -30
- package/docs/releases/v0.23.0.md +0 -31
- package/docs/releases/v0.24.0.md +0 -38
- package/docs/releases/v0.25.0.md +0 -31
- package/docs/releases/v0.25.2.md +0 -32
- package/docs/releases/v0.26.0.md +0 -32
- package/docs/releases/v0.27.0.md +0 -31
- package/docs/releases/v0.28.0.md +0 -32
- package/docs/releases/v0.29.0.md +0 -32
- package/docs/releases/v0.30.0.md +0 -30
- package/docs/releases/v0.30.1.md +0 -31
- package/docs/releases/v0.30.2.md +0 -30
- package/docs/releases/v0.30.3.md +0 -33
- package/docs/releases/v0.31.0.md +0 -33
- package/docs/releases/v0.32.0.md +0 -33
- package/docs/releases/v0.33.0.md +0 -34
- package/docs/releases/v0.34.0.md +0 -30
- package/docs/releases/v0.35.0.md +0 -33
- package/docs/releases/v0.36.0.md +0 -32
- package/docs/releases/v0.37.0.md +0 -33
- package/docs/releases/v0.38.0.md +0 -35
- package/docs/releases/v0.39.0.md +0 -35
- package/docs/releases/v0.40.0.md +0 -45
- package/docs/releases/v0.40.1.md +0 -34
- package/docs/releases/v1.0.0.md +0 -42
- package/docs/releases/v1.0.1.md +0 -38
- package/docs/releases/v1.0.2.md +0 -51
- package/docs/releases/v1.0.3.md +0 -37
- package/docs/releases/v1.0.4.md +0 -45
- package/docs/releases/v1.0.5.md +0 -41
- package/docs/releases/v1.0.6.md +0 -35
- package/docs/releases/v1.0.7.md +0 -36
- package/docs/releases/v1.1.0.md +0 -42
- package/docs/releases/v1.1.1.md +0 -44
- package/docs/releases/v1.1.2.md +0 -42
- package/docs/releases/v1.1.3.md +0 -36
- package/docs/releases/v1.1.4.md +0 -36
- package/docs/roadmap/README.md +0 -107
- package/docs/roadmap/v1.0-capability-conformance-framework.md +0 -582
- package/docs/roadmap/v1.0-choice-union-mode.md +0 -90
- package/docs/roadmap/v1.0-contract-audit.md +0 -75
- package/docs/roadmap/v1.0-json-array-streaming.md +0 -101
- package/docs/roadmap/v1.0-openapi-fastify-compatibility.md +0 -99
- package/docs/roadmap/v1.0-release-candidate-gates.md +0 -92
- package/docs/roadmap/v1.0-wsdl-coverage-matrix.md +0 -200
- package/docs/roadmap/v1.0-xs-anyattribute-wildcard-bag.md +0 -932
- package/src/runtime/jsonArray.ts +0 -55
- package/src/runtime/ndjson.ts +0 -32
|
@@ -0,0 +1,1217 @@
|
|
|
1
|
+
import { assertSemanticContext, contextsShareRequest, isSemanticCandidateOf, SemanticContextAccessError } from './semanticContext.js';
|
|
2
|
+
import { checkSchemaDocumentSyntax } from './schemaDocumentSyntax.js';
|
|
3
|
+
import { checkComponentConstruction, assertComponentConstruction, checkSimpleRestrictionPredicate, assertSimpleRestrictionPredicate } from './schemaConstructionAssessment.js';
|
|
4
|
+
import { assertStandardElementConstruction } from './standardSchemaConstruction.js';
|
|
5
|
+
import { checkCandidateCorrespondence, assertCandidateCorrespondence, re01Ancestor, checkAdditiveSimpleProperties, assertAdditiveSimpleProperties } from './re01CandidateCorrespondence.js';
|
|
6
|
+
import { immediateTypeBase } from './schemaTypeRelations.js';
|
|
7
|
+
import { XSD_NAMESPACE } from '../loader/orderedSyntax.js';
|
|
8
|
+
import { RE01_DERIVATION_DOMAIN } from './re01TypeProperties.js';
|
|
9
|
+
import { checkNotationProperties } from './schemaNotationProperties.js';
|
|
10
|
+
import { checkOriginalGeneratedScalar, assertOriginalGeneratedScalarReceipt } from './schemaScalarKernel.js';
|
|
11
|
+
import { resolveSemanticType, semanticTypeKey } from './schemaTypeIdentity.js';
|
|
12
|
+
import { checkIdentityConstraintFormation } from './schemaIdentityConstraints.js';
|
|
13
|
+
import { deriveActualComplexContent, deriveOriginalComplexPropertyContent } from './complexTypeContent.js';
|
|
14
|
+
import { assertSemanticParticleView, prepareSemanticParticleView } from './particleSemanticView.js';
|
|
15
|
+
import { prepareAdditiveRestrictionRepresentative, prepareAdditiveExtensionMiddle } from './re01CandidateAssignments.js';
|
|
16
|
+
const issued = new WeakMap();
|
|
17
|
+
const issuedPrimitive = new WeakMap();
|
|
18
|
+
const proofContexts = new WeakMap();
|
|
19
|
+
class VerificationAbort extends Error {
|
|
20
|
+
result;
|
|
21
|
+
constructor(result) {
|
|
22
|
+
super(result.kind);
|
|
23
|
+
this.result = result;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
const inspectedFrontiers = new WeakMap();
|
|
27
|
+
export function assertFiniteRe01Frontier(context, frontier) {
|
|
28
|
+
assertSemanticContext(context);
|
|
29
|
+
if (inspectedFrontiers.get(frontier) !== context)
|
|
30
|
+
throw new TypeError('Unauthenticated native frontier');
|
|
31
|
+
}
|
|
32
|
+
function createNativeFrontierOwner(actual) {
|
|
33
|
+
const b = actual.budget, charge = b.chargeWork;
|
|
34
|
+
const fail = (rule, message, kind = 'invalid-evidence', context = actual, component) => {
|
|
35
|
+
charge(16 + rule.length + message.length + (component?.length ?? 0));
|
|
36
|
+
throw new VerificationAbort(Object.freeze({ kind, rule, message, contextId: context.contextId, component }));
|
|
37
|
+
};
|
|
38
|
+
const refKey = (context, reference) => {
|
|
39
|
+
const found = resolveSemanticType(context, reference);
|
|
40
|
+
if (found.kind === 'component' || found.kind === 'builtin' || found.kind === 'original-generated')
|
|
41
|
+
return semanticTypeKey(context, found.identity);
|
|
42
|
+
return fail('evidence-reference', 'Proof reference is unavailable', 'unresolved', context);
|
|
43
|
+
};
|
|
44
|
+
charge(2);
|
|
45
|
+
const deferred = [];
|
|
46
|
+
if (actual.kind !== 'actual' || actual.membership !== 'complete-actual-plus-additions')
|
|
47
|
+
return fail('actual-environment', 'A complete immutable original context is required');
|
|
48
|
+
const source = checkSchemaDocumentSyntax(actual);
|
|
49
|
+
if (source.kind !== 'checked')
|
|
50
|
+
throw new VerificationAbort(source.kind === 'resource-limit' ? source : {
|
|
51
|
+
...source, message: 'Original schema-document qualification did not pass', contextId: actual.contextId
|
|
52
|
+
});
|
|
53
|
+
for (const remaining of source.remaining) {
|
|
54
|
+
charge();
|
|
55
|
+
if (remaining !== 'child-component-syntax' && remaining !== 'semantic-construction')
|
|
56
|
+
return fail(remaining, 'Original source document has an outstanding assessment obligation', 'unresolved');
|
|
57
|
+
}
|
|
58
|
+
// Notations have a private component table rather than a persisted graph
|
|
59
|
+
// role. Its own source and active-universe dimensions must both pass;
|
|
60
|
+
// neither GraphNode membership nor scalar use inventories cover unused
|
|
61
|
+
// fresh declarations. Source representation checks above remain separate.
|
|
62
|
+
charge(4);
|
|
63
|
+
const notationReceipts = new Map();
|
|
64
|
+
const checkedNotationProperties = new WeakSet();
|
|
65
|
+
const checkNotations = (context) => {
|
|
66
|
+
charge(3);
|
|
67
|
+
const prior = notationReceipts.get(context);
|
|
68
|
+
if (prior)
|
|
69
|
+
return prior;
|
|
70
|
+
if (context.notationUniverse !== 'source-bound')
|
|
71
|
+
return fail('notation-source-universe', 'Complete original notation availability is required', 'unresolved', context);
|
|
72
|
+
if (context.notationMembership !== 'complete-original-plus-additions')
|
|
73
|
+
return fail('notation-active-membership', 'The notation table must include every original and fresh declaration', 'unresolved', context);
|
|
74
|
+
charge(2);
|
|
75
|
+
const receipts = [];
|
|
76
|
+
for (const name of context.notationMembers) {
|
|
77
|
+
charge();
|
|
78
|
+
const found = context.lookupNotation(name);
|
|
79
|
+
if (found.kind !== 'found')
|
|
80
|
+
return fail(found.kind === 'unresolved' ? found.rule : 'notation-context-membership', 'A generated notation obligation is unavailable in its context', 'unresolved', context);
|
|
81
|
+
// This pure property rule depends only on the authenticated immutable
|
|
82
|
+
// tuple. Reuse it by exact object identity; source syntax and active
|
|
83
|
+
// membership are independently checked in their own contexts.
|
|
84
|
+
charge();
|
|
85
|
+
if (!checkedNotationProperties.has(found.properties)) {
|
|
86
|
+
const result = checkNotationProperties(found.properties, b);
|
|
87
|
+
if (result.kind !== 'checked')
|
|
88
|
+
return fail(result.rule, result.message, context.kind === 'actual' ? 'invalid-schema' : 'candidate-rejected', context);
|
|
89
|
+
charge();
|
|
90
|
+
checkedNotationProperties.add(found.properties);
|
|
91
|
+
}
|
|
92
|
+
charge(8 + context.contextId.length);
|
|
93
|
+
receipts.push(Object.freeze({ contextId: context.contextId, properties: found.properties, origin: found.origin }));
|
|
94
|
+
}
|
|
95
|
+
charge(2 + receipts.length);
|
|
96
|
+
const frozen = Object.freeze(receipts);
|
|
97
|
+
notationReceipts.set(context, frozen);
|
|
98
|
+
return frozen;
|
|
99
|
+
};
|
|
100
|
+
const actualNotations = checkNotations(actual);
|
|
101
|
+
charge(4);
|
|
102
|
+
const closures = new Map();
|
|
103
|
+
charge();
|
|
104
|
+
const typedDependencies = [];
|
|
105
|
+
charge();
|
|
106
|
+
const mixedFacts = new Map();
|
|
107
|
+
const mixedRule = 'simple-content-base-mixed-emptiable';
|
|
108
|
+
const mixedFact = (context, component) => {
|
|
109
|
+
charge(5 + component.length);
|
|
110
|
+
let facts = mixedFacts.get(context), view = facts?.get(component);
|
|
111
|
+
if (!view) {
|
|
112
|
+
const found = context.lookup(component);
|
|
113
|
+
if (found.kind !== 'found' || found.node.kind !== 'complexType')
|
|
114
|
+
return fail(mixedRule, 'Mixed base properties are unavailable', 'unresolved', context, component);
|
|
115
|
+
const mapped = context.kind === 'actual' ? deriveActualComplexContent(context, component)
|
|
116
|
+
: deriveOriginalComplexPropertyContent(context, component);
|
|
117
|
+
if (mapped.kind !== 'checked') {
|
|
118
|
+
if (mapped.kind === 'resource-limit')
|
|
119
|
+
throw new VerificationAbort(mapped);
|
|
120
|
+
return fail(mapped.rule, mapped.message, mapped.kind === 'unresolved' ? 'unresolved'
|
|
121
|
+
: context.kind === 'actual' ? 'invalid-schema' : 'candidate-rejected', context, mapped.component ?? component);
|
|
122
|
+
}
|
|
123
|
+
if (mapped.view.content.kind !== 'mixed')
|
|
124
|
+
return fail(mixedRule, 'Simple-content base must have mixed content', context.kind === 'actual' ? 'invalid-schema' : 'candidate-rejected', context, component);
|
|
125
|
+
const prepared = prepareSemanticParticleView(context, mapped.view, 'restriction');
|
|
126
|
+
if (prepared.kind !== 'checked') {
|
|
127
|
+
if (prepared.kind === 'resource-limit')
|
|
128
|
+
throw new VerificationAbort(prepared);
|
|
129
|
+
return fail(prepared.rule, prepared.message, prepared.kind === 'unresolved' ? 'unresolved'
|
|
130
|
+
: context.kind === 'actual' ? 'invalid-schema' : 'candidate-rejected', context, prepared.component ?? component);
|
|
131
|
+
}
|
|
132
|
+
view = prepared.view;
|
|
133
|
+
}
|
|
134
|
+
assertSemanticParticleView(context, view);
|
|
135
|
+
if (view.content.type !== component || view.content.content.kind !== 'mixed' || view.purpose !== 'restriction')
|
|
136
|
+
return fail(mixedRule, 'Mixed base fact has another semantic subject', 'invalid-evidence', context, component);
|
|
137
|
+
if (!view.root.summary.schemaEmptiable)
|
|
138
|
+
return fail(mixedRule, 'Mixed simple-content base is not formally emptiable', context.kind === 'actual' ? 'invalid-schema' : 'candidate-rejected', context, component);
|
|
139
|
+
if (!facts) {
|
|
140
|
+
charge(2);
|
|
141
|
+
facts = new Map();
|
|
142
|
+
mixedFacts.set(context, facts);
|
|
143
|
+
}
|
|
144
|
+
charge(2);
|
|
145
|
+
facts.set(component, view);
|
|
146
|
+
return view;
|
|
147
|
+
};
|
|
148
|
+
const rejectPending = (context, pending, requireTypes) => {
|
|
149
|
+
if (pending.contextId !== context.contextId) {
|
|
150
|
+
charge(8);
|
|
151
|
+
deferred.push(Object.freeze({ context, obligation: Object.freeze({ ...pending }) }));
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
if (pending.rule === mixedRule) {
|
|
155
|
+
requireTypes(mixedFact(context, pending.component).typeDependencies);
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
if (pending.rule === 'complete-substitution-universe' && context.membership === 'complete-actual-plus-additions')
|
|
159
|
+
return;
|
|
160
|
+
fail(pending.rule, 'A generated local semantic prerequisite remains undischarged', 'unresolved', context, pending.component);
|
|
161
|
+
};
|
|
162
|
+
const close = (context, roots, correspondence) => {
|
|
163
|
+
charge(8);
|
|
164
|
+
const identityConstraints = [], checkedICs = new Set();
|
|
165
|
+
const requireIdentityConstraints = (required) => {
|
|
166
|
+
charge(3 + required.length);
|
|
167
|
+
const pending = [...required];
|
|
168
|
+
while (pending.length) {
|
|
169
|
+
const dependency = pending.pop();
|
|
170
|
+
charge(6 + dependency.identity.length);
|
|
171
|
+
if (dependency.contextId !== context.contextId)
|
|
172
|
+
return fail('identity-constraint-context', 'Identity constraint dependency does not belong to this current context', 'unresolved', context);
|
|
173
|
+
if (checkedICs.has(dependency.identity))
|
|
174
|
+
continue;
|
|
175
|
+
const receipt = checkIdentityConstraintFormation(context, dependency.identity);
|
|
176
|
+
if (receipt.kind !== 'checked')
|
|
177
|
+
throw new VerificationAbort(receipt.kind === 'resource-limit' ? receipt : {
|
|
178
|
+
...receipt, contextId: receipt.contextId ?? context.contextId,
|
|
179
|
+
kind: receipt.kind === 'invalid-schema' && context.kind === 'candidate' && receipt.contextId === context.contextId ? 'candidate-rejected' : receipt.kind
|
|
180
|
+
});
|
|
181
|
+
charge(5 + receipt.identityConstraintDependencies.length);
|
|
182
|
+
checkedICs.add(dependency.identity);
|
|
183
|
+
identityConstraints.push(receipt);
|
|
184
|
+
pending.push(...receipt.identityConstraintDependencies);
|
|
185
|
+
}
|
|
186
|
+
};
|
|
187
|
+
if (context.kind === 'actual') {
|
|
188
|
+
const registry = context.originalIdentityConstraints();
|
|
189
|
+
charge(3 + registry.identities.length * 4);
|
|
190
|
+
requireIdentityConstraints(registry.identities.map(identity => ({ contextId: context.contextId, identity })));
|
|
191
|
+
}
|
|
192
|
+
if (context.scalarSlotMembership !== 'complete-original')
|
|
193
|
+
return fail('scalar-slot-active-membership', 'Finite evidence requires every original generated scalar slot', 'unresolved', context);
|
|
194
|
+
charge(12 + roots.length + (context.kind === 'actual' ? context.scalarSlots.length : 0));
|
|
195
|
+
const queue = [...roots], byComponent = new Map();
|
|
196
|
+
// Availability is complete in H, but its legality roots are E, D′,
|
|
197
|
+
// fresh components and consumed dependencies. Only Γ checks every
|
|
198
|
+
// original scalar merely because it is part of the actual schema.
|
|
199
|
+
const slotQueue = context.kind === 'actual' ? [...context.scalarSlots] : [];
|
|
200
|
+
const byScalarSlot = new Map(), scalarSlots = [];
|
|
201
|
+
const components = [], requirements = [];
|
|
202
|
+
const requireTypes = (required) => {
|
|
203
|
+
for (const dependency of required) {
|
|
204
|
+
charge(4);
|
|
205
|
+
typedDependencies.push(Object.freeze({ from: context, dependency }));
|
|
206
|
+
if (dependency.contextId !== context.contextId)
|
|
207
|
+
continue;
|
|
208
|
+
const type = dependency.type;
|
|
209
|
+
if (type.kind === 'component') {
|
|
210
|
+
charge(2);
|
|
211
|
+
if (!byComponent.has(type.id))
|
|
212
|
+
queue.push(type.id);
|
|
213
|
+
}
|
|
214
|
+
else if (type.kind === 'original-generated') {
|
|
215
|
+
charge(2);
|
|
216
|
+
if (!byScalarSlot.has(type.owner))
|
|
217
|
+
slotQueue.push(type);
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
};
|
|
221
|
+
if (correspondence)
|
|
222
|
+
requireTypes(correspondence.typeDependencies);
|
|
223
|
+
while (queue.length || slotQueue.length) {
|
|
224
|
+
if (!queue.length) {
|
|
225
|
+
charge(3);
|
|
226
|
+
const slot = slotQueue.pop();
|
|
227
|
+
if (byScalarSlot.has(slot.owner))
|
|
228
|
+
continue;
|
|
229
|
+
const result = checkOriginalGeneratedScalar(context, slot);
|
|
230
|
+
if (result.kind !== 'checked')
|
|
231
|
+
throw new VerificationAbort(result.kind === 'resource-limit' ? result : {
|
|
232
|
+
...result, contextId: result.contextId ?? context.contextId,
|
|
233
|
+
kind: result.kind === 'invalid-schema' && context.kind === 'candidate'
|
|
234
|
+
&& (!result.contextId || result.contextId === context.contextId) ? 'candidate-rejected' : result.kind
|
|
235
|
+
});
|
|
236
|
+
assertOriginalGeneratedScalarReceipt(context, result);
|
|
237
|
+
if (semanticTypeKey(context, result.slot) !== semanticTypeKey(context, slot))
|
|
238
|
+
return fail('scalar-slot-receipt', 'Scalar construction receipt identifies another slot', 'invalid-evidence', context);
|
|
239
|
+
// Dedicated slot checking must finish its own scalar rules. Only
|
|
240
|
+
// genuine GraphNode-owned source premises can remain as debts;
|
|
241
|
+
// the complex provenance owner cannot certify the scalar slot.
|
|
242
|
+
for (const pending of result.obligations) {
|
|
243
|
+
charge(4);
|
|
244
|
+
rejectPending(context, { ...pending, contextId: pending.contextId ?? context.contextId }, requireTypes);
|
|
245
|
+
}
|
|
246
|
+
charge(4 + slot.owner.length);
|
|
247
|
+
byScalarSlot.set(slot.owner, result);
|
|
248
|
+
scalarSlots.push(result);
|
|
249
|
+
requireTypes(result.typeDependencies);
|
|
250
|
+
continue;
|
|
251
|
+
}
|
|
252
|
+
charge(3);
|
|
253
|
+
const id = queue.pop();
|
|
254
|
+
if (byComponent.has(id))
|
|
255
|
+
continue;
|
|
256
|
+
const found = context.lookup(id);
|
|
257
|
+
if (found.kind !== 'found')
|
|
258
|
+
return fail('obligation-membership', 'A generated obligation is outside its context', 'unresolved', context, id);
|
|
259
|
+
// WSDL transport/capability interpretation remains at its existing
|
|
260
|
+
// boundary; all XSD nodes in the actual input are still scheduled.
|
|
261
|
+
if (found.node.kind === 'wsdl') {
|
|
262
|
+
if (context.kind === 'actual')
|
|
263
|
+
continue;
|
|
264
|
+
return fail('hypothetical-component-domain', 'A hypothetical obligation is not an XSD component', 'invalid-evidence', context, id);
|
|
265
|
+
}
|
|
266
|
+
const result = checkComponentConstruction(context, id, { correspondence });
|
|
267
|
+
if (result.kind !== 'checked')
|
|
268
|
+
throw new VerificationAbort(result.kind === 'resource-limit' ? result
|
|
269
|
+
: { ...result, contextId: result.contextId ?? context.contextId });
|
|
270
|
+
assertComponentConstruction(context, result);
|
|
271
|
+
for (const standard of result.standardDependencies) {
|
|
272
|
+
charge();
|
|
273
|
+
assertStandardElementConstruction(context, standard);
|
|
274
|
+
}
|
|
275
|
+
for (const pending of result.obligations)
|
|
276
|
+
rejectPending(context, pending, requireTypes);
|
|
277
|
+
charge(4 + id.length);
|
|
278
|
+
byComponent.set(id, result);
|
|
279
|
+
components.push(result);
|
|
280
|
+
requireTypes(result.typeDependencies);
|
|
281
|
+
requireIdentityConstraints(result.identityConstraintDependencies);
|
|
282
|
+
if (result.re01) {
|
|
283
|
+
charge();
|
|
284
|
+
requirements.push(result.re01);
|
|
285
|
+
}
|
|
286
|
+
for (const dependency of result.dependencies) {
|
|
287
|
+
charge(2);
|
|
288
|
+
if (!byComponent.has(dependency))
|
|
289
|
+
queue.push(dependency);
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
charge(10 + components.length + requirements.length + scalarSlots.length);
|
|
293
|
+
const closure = Object.freeze({ context, components: Object.freeze(components), requirements: Object.freeze(requirements), byComponent,
|
|
294
|
+
scalarSlots: Object.freeze(scalarSlots), byScalarSlot, identityConstraints: Object.freeze(identityConstraints) });
|
|
295
|
+
charge(context.contextId.length + 1);
|
|
296
|
+
closures.set(context.contextId, closure);
|
|
297
|
+
return closure;
|
|
298
|
+
};
|
|
299
|
+
const actualClosure = close(actual, actual.members);
|
|
300
|
+
const primitiveFacts = new Map();
|
|
301
|
+
const primitive = (context, requirement) => {
|
|
302
|
+
if (!requirement.primitive)
|
|
303
|
+
return false;
|
|
304
|
+
charge(2);
|
|
305
|
+
if (primitiveFacts.get(context)?.has(requirement.target))
|
|
306
|
+
return true;
|
|
307
|
+
const first = immediateTypeBase(context, { kind: 'local', target: requirement.target });
|
|
308
|
+
const designated = re01Ancestor(context, requirement.target);
|
|
309
|
+
if (first.kind === 'resource-limit')
|
|
310
|
+
throw new VerificationAbort(first);
|
|
311
|
+
if (designated.kind === 'resource-limit')
|
|
312
|
+
throw new VerificationAbort(designated);
|
|
313
|
+
if (first.kind !== 'checked' || !first.value || designated.kind !== 'checked')
|
|
314
|
+
return fail('primitive-no-change', 'Primitive ancestry premises are missing', 'unresolved', context, requirement.target);
|
|
315
|
+
for (const dependency of first.typeDependencies) {
|
|
316
|
+
charge(4);
|
|
317
|
+
typedDependencies.push(Object.freeze({ from: context, dependency }));
|
|
318
|
+
}
|
|
319
|
+
for (const dependency of designated.typeDependencies) {
|
|
320
|
+
charge(4);
|
|
321
|
+
typedDependencies.push(Object.freeze({ from: context, dependency }));
|
|
322
|
+
}
|
|
323
|
+
if (refKey(context, first.value) !== refKey(context, designated.ancestor) || refKey(context, requirement.ancestor) !== refKey(context, designated.ancestor))
|
|
324
|
+
return fail('primitive-no-change', 'Primitive proof is not a direct extension of the designated ancestor');
|
|
325
|
+
const base = resolveSemanticType(context, designated.ancestor);
|
|
326
|
+
if (!(base.kind === 'builtin' && base.name.namespace === XSD_NAMESPACE && base.name.local === 'anyType')) {
|
|
327
|
+
const next = immediateTypeBase(context, designated.ancestor);
|
|
328
|
+
if (next.kind === 'resource-limit')
|
|
329
|
+
throw new VerificationAbort(next);
|
|
330
|
+
if (next.kind !== 'checked' || !next.value || refKey(context, next.value) !== refKey(context, { kind: 'builtin', name: { namespace: XSD_NAMESPACE, local: 'anyType' } }))
|
|
331
|
+
return fail('primitive-no-change', 'Primitive ancestor lacks the ur-type base');
|
|
332
|
+
for (const dependency of next.typeDependencies) {
|
|
333
|
+
charge(4);
|
|
334
|
+
typedDependencies.push(Object.freeze({ from: context, dependency }));
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
// All independently generated local/component premises were checked
|
|
338
|
+
// by close(). This epsilon comparison creates no type or base edge.
|
|
339
|
+
charge(4);
|
|
340
|
+
let facts = primitiveFacts.get(context);
|
|
341
|
+
if (!facts) {
|
|
342
|
+
facts = new Set();
|
|
343
|
+
primitiveFacts.set(context, facts);
|
|
344
|
+
}
|
|
345
|
+
facts.add(requirement.target);
|
|
346
|
+
return true;
|
|
347
|
+
};
|
|
348
|
+
const publish = (closure, correspondence, deferredStart = 0, typedStart = 0) => {
|
|
349
|
+
charge(14 + closure.requirements.length * 5);
|
|
350
|
+
const requirements = closure.requirements.map(requirement => Object.freeze({ target: requirement.target,
|
|
351
|
+
ancestor: requirement.ancestor, primitive: primitive(closure.context, requirement) }));
|
|
352
|
+
charge(3 + deferred.length - deferredStart + typedDependencies.length - typedStart);
|
|
353
|
+
const frontier = Object.freeze({ kind: 'inspected-frontier', context: closure.context,
|
|
354
|
+
requirements: Object.freeze(requirements), components: closure.components, scalarSlots: closure.scalarSlots,
|
|
355
|
+
notations: notationReceipts.get(closure.context), identityConstraints: closure.identityConstraints,
|
|
356
|
+
correspondence, deferred: Object.freeze(deferred.slice(deferredStart)), typeDependencies: Object.freeze(typedDependencies.slice(typedStart)) });
|
|
357
|
+
inspectedFrontiers.set(frontier, closure.context);
|
|
358
|
+
return frontier;
|
|
359
|
+
};
|
|
360
|
+
const actualFrontier = publish(actualClosure);
|
|
361
|
+
const inspect = (item) => {
|
|
362
|
+
try {
|
|
363
|
+
assertSemanticContext(item.parent);
|
|
364
|
+
assertSemanticContext(item.context);
|
|
365
|
+
}
|
|
366
|
+
catch {
|
|
367
|
+
return fail('evidence-context', 'Candidate contains an unauthenticated context');
|
|
368
|
+
}
|
|
369
|
+
const deferredStart = deferred.length, typedStart = typedDependencies.length;
|
|
370
|
+
const previousClosure = closures.get(item.context.contextId);
|
|
371
|
+
try {
|
|
372
|
+
if (!contextsShareRequest(actual, item.parent) || !contextsShareRequest(actual, item.context)
|
|
373
|
+
|| !isSemanticCandidateOf(item.parent, item.context))
|
|
374
|
+
return fail('evidence-context', 'Candidate must be an authenticated direct child in this semantic request');
|
|
375
|
+
checkNotations(item.context);
|
|
376
|
+
const correspondence = checkCandidateCorrespondence(actual, item.parent, item.context, item.target, item.intermediate, item.ancestor);
|
|
377
|
+
if (correspondence.kind !== 'checked')
|
|
378
|
+
throw new VerificationAbort(correspondence);
|
|
379
|
+
assertCandidateCorrespondence(item.context, correspondence);
|
|
380
|
+
// Every Gamma-fresh inherited record remains a legality root. Storage of
|
|
381
|
+
// original components alone does not make all of them hypothetical roots.
|
|
382
|
+
charge(3);
|
|
383
|
+
const roots = [item.target, item.intermediate];
|
|
384
|
+
for (const id of item.context.members) {
|
|
385
|
+
charge();
|
|
386
|
+
if (actual.lookup(id).kind !== 'found') {
|
|
387
|
+
charge(2);
|
|
388
|
+
roots.push(id);
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
return publish(close(item.context, roots, correspondence), correspondence, deferredStart, typedStart);
|
|
392
|
+
}
|
|
393
|
+
catch (error) {
|
|
394
|
+
charge(4);
|
|
395
|
+
deferred.length = deferredStart;
|
|
396
|
+
typedDependencies.length = typedStart;
|
|
397
|
+
primitiveFacts.delete(item.context);
|
|
398
|
+
if (previousClosure)
|
|
399
|
+
closures.set(item.context.contextId, previousClosure);
|
|
400
|
+
else
|
|
401
|
+
closures.delete(item.context.contextId);
|
|
402
|
+
throw error;
|
|
403
|
+
}
|
|
404
|
+
};
|
|
405
|
+
const inspectAdditive = (context) => {
|
|
406
|
+
assertSemanticContext(context);
|
|
407
|
+
if (!contextsShareRequest(actual, context) || !isSemanticCandidateOf(actual, context))
|
|
408
|
+
return fail('additive-context', 'An authenticated direct child of the actual request is required');
|
|
409
|
+
const deferredStart = deferred.length, typedStart = typedDependencies.length;
|
|
410
|
+
for (const id of actual.members) {
|
|
411
|
+
charge(16 + id.length);
|
|
412
|
+
const before = actual.lookup(id), after = context.lookup(id);
|
|
413
|
+
if (before.kind !== 'found' || after.kind !== 'found' || before.node !== after.node
|
|
414
|
+
|| actual.rawTypeProperties(id) !== context.rawTypeProperties(id)
|
|
415
|
+
|| actual.rawSimpleTypeProperties(id) !== context.rawSimpleTypeProperties(id)
|
|
416
|
+
|| actual.rawElementProperties(id) !== context.rawElementProperties(id)
|
|
417
|
+
|| actual.rawAttributeProperties(id) !== context.rawAttributeProperties(id)
|
|
418
|
+
|| actual.rawAttributeGroupProperties(id) !== context.rawAttributeGroupProperties(id)
|
|
419
|
+
|| actual.rawParticleWildcardProperties(id) !== context.rawParticleWildcardProperties(id)
|
|
420
|
+
|| actual.owner(id) !== context.owner(id))
|
|
421
|
+
return fail('additive-original-preservation', 'An additive construction changed an original component or scope', 'invalid-evidence', context, id);
|
|
422
|
+
}
|
|
423
|
+
checkNotations(context);
|
|
424
|
+
charge(4);
|
|
425
|
+
const roots = [];
|
|
426
|
+
for (const id of context.members) {
|
|
427
|
+
charge(2 + id.length);
|
|
428
|
+
if (actual.lookup(id).kind !== 'found') {
|
|
429
|
+
charge();
|
|
430
|
+
roots.push(id);
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
return publish(close(context, roots), undefined, deferredStart, typedStart);
|
|
434
|
+
};
|
|
435
|
+
const validateAggregate = (proof, additive = []) => {
|
|
436
|
+
// A research session can inspect rejected alternatives. Only the selected
|
|
437
|
+
// forest contributes aggregate debts; context handles remain exact.
|
|
438
|
+
charge(4 + proof.length * 3);
|
|
439
|
+
const selected = new Set([actual.contextId]);
|
|
440
|
+
for (const step of proof)
|
|
441
|
+
selected.add(step.contextId);
|
|
442
|
+
for (const context of additive) {
|
|
443
|
+
charge(4 + context.contextId.length);
|
|
444
|
+
if (closures.get(context.contextId)?.context !== context)
|
|
445
|
+
return fail('additive-closure', 'Selected additive context lacks its native checked closure');
|
|
446
|
+
selected.add(context.contextId);
|
|
447
|
+
}
|
|
448
|
+
const selectedClosure = (contextId) => selected.has(contextId) ? closures.get(contextId) : undefined;
|
|
449
|
+
// A late property-only fact cannot reopen a closed FULL frontier. Its
|
|
450
|
+
// actual typed support must already be present in that exact context.
|
|
451
|
+
const lateMixedFact = (contextId, component, from) => {
|
|
452
|
+
charge(4 + contextId.length);
|
|
453
|
+
const closure = selectedClosure(contextId);
|
|
454
|
+
if (!closure)
|
|
455
|
+
return fail(mixedRule, 'Mixed base fact has no checked originating context', 'unresolved', from, component);
|
|
456
|
+
const view = mixedFact(closure.context, component);
|
|
457
|
+
for (const dependency of view.typeDependencies) {
|
|
458
|
+
charge(5);
|
|
459
|
+
if (dependency.contextId === contextId) {
|
|
460
|
+
const type = dependency.type;
|
|
461
|
+
if (type.kind === 'component' && !closure.byComponent.has(type.id)
|
|
462
|
+
|| type.kind === 'original-generated' && !closure.byScalarSlot.has(type.owner))
|
|
463
|
+
return fail(mixedRule, 'Late mixed base fact lacks checked type support', 'unresolved', closure.context, component);
|
|
464
|
+
}
|
|
465
|
+
typedDependencies.push(Object.freeze({ from: closure.context, dependency }));
|
|
466
|
+
}
|
|
467
|
+
};
|
|
468
|
+
for (const pending of deferred)
|
|
469
|
+
if (selected.has(pending.context.contextId) && pending.obligation.rule === mixedRule)
|
|
470
|
+
lateMixedFact(pending.obligation.contextId, pending.obligation.component, pending.context);
|
|
471
|
+
for (const step of proof)
|
|
472
|
+
for (const pending of step.correspondence.scalarObligations)
|
|
473
|
+
if (pending.obligation.rule === mixedRule)
|
|
474
|
+
lateMixedFact(pending.contextId, pending.obligation.component, actual);
|
|
475
|
+
// Dependency facts in checked component/slot/correspondence receipts are
|
|
476
|
+
// privately owned and frozen. Resolve each exact builtin tuple once per
|
|
477
|
+
// context; repeated uses still pay for the lookup and remain represented
|
|
478
|
+
// in their originating receipts.
|
|
479
|
+
charge(2);
|
|
480
|
+
const checkedBuiltins = new Map();
|
|
481
|
+
for (const { from, dependency } of typedDependencies) {
|
|
482
|
+
charge(4 + dependency.contextId.length);
|
|
483
|
+
if (!selected.has(from.contextId))
|
|
484
|
+
continue;
|
|
485
|
+
const closure = selectedClosure(dependency.contextId), type = dependency.type;
|
|
486
|
+
if (!closure)
|
|
487
|
+
return fail('type-dependency-context', 'A semantic type dependency has no checked context closure', 'unresolved', from);
|
|
488
|
+
if (type.kind === 'component') {
|
|
489
|
+
const receipt = closure.byComponent.get(type.id), node = closure.context.lookup(type.id);
|
|
490
|
+
if (!receipt || receipt.scope !== 'local-component-premises' || node.kind !== 'found'
|
|
491
|
+
|| node.node.kind !== 'simpleType' && node.node.kind !== 'complexType')
|
|
492
|
+
return fail('type-component-validity', 'A type dependency lacks matching semantic component construction', 'unresolved', closure.context, type.id);
|
|
493
|
+
}
|
|
494
|
+
else if (type.kind === 'original-generated') {
|
|
495
|
+
const receipt = closure.byScalarSlot.get(type.owner);
|
|
496
|
+
if (!receipt)
|
|
497
|
+
return fail('scalar-slot-validity', 'A type dependency lacks matching scalar-slot construction', 'unresolved', closure.context, type.owner);
|
|
498
|
+
assertOriginalGeneratedScalarReceipt(closure.context, receipt);
|
|
499
|
+
}
|
|
500
|
+
else {
|
|
501
|
+
const namespace = type.name.namespace, local = type.name.local;
|
|
502
|
+
charge(4);
|
|
503
|
+
let namespaces = checkedBuiltins.get(closure.context);
|
|
504
|
+
if (!namespaces) {
|
|
505
|
+
charge(4);
|
|
506
|
+
namespaces = new Map();
|
|
507
|
+
checkedBuiltins.set(closure.context, namespaces);
|
|
508
|
+
}
|
|
509
|
+
charge(4 + namespace.length);
|
|
510
|
+
let known = namespaces.get(namespace);
|
|
511
|
+
if (!known) {
|
|
512
|
+
charge(4);
|
|
513
|
+
known = new Set();
|
|
514
|
+
namespaces.set(namespace, known);
|
|
515
|
+
}
|
|
516
|
+
charge(4 + local.length);
|
|
517
|
+
if (!known.has(local)) {
|
|
518
|
+
if (resolveSemanticType(closure.context, type).kind !== 'builtin')
|
|
519
|
+
return fail('builtin-type-dependency', 'A builtin dependency lacks its exact builtin identity', 'unresolved', closure.context);
|
|
520
|
+
charge(2 + local.length);
|
|
521
|
+
known.add(local);
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
// Correspondence computations retain exact scalar premises too. A local
|
|
526
|
+
// type owner must have checked that same property in that same context.
|
|
527
|
+
const discharged = (contextId, rule, component) => {
|
|
528
|
+
charge(4 + contextId.length);
|
|
529
|
+
const closure = selectedClosure(contextId);
|
|
530
|
+
if (rule === mixedRule)
|
|
531
|
+
return closure !== undefined && mixedFacts.get(closure.context)?.has(component) === true;
|
|
532
|
+
const owner = closure?.byComponent.get(component);
|
|
533
|
+
for (const checked of owner?.discharged ?? []) {
|
|
534
|
+
charge(3 + checked.rule.length + checked.component.length + checked.contextId.length);
|
|
535
|
+
if (checked.rule === rule && checked.component === component && checked.contextId === contextId)
|
|
536
|
+
return true;
|
|
537
|
+
}
|
|
538
|
+
return false;
|
|
539
|
+
};
|
|
540
|
+
for (const pending of deferred) {
|
|
541
|
+
charge();
|
|
542
|
+
if (!selected.has(pending.context.contextId))
|
|
543
|
+
continue;
|
|
544
|
+
const obligation = pending.obligation;
|
|
545
|
+
if (!discharged(obligation.contextId, obligation.rule, obligation.component))
|
|
546
|
+
return fail(obligation.rule, 'An original-context scalar prerequisite lacks concrete aggregate discharge', 'unresolved', pending.context, obligation.component);
|
|
547
|
+
}
|
|
548
|
+
for (const step of proof)
|
|
549
|
+
for (const pending of step.correspondence.scalarObligations) {
|
|
550
|
+
if (!discharged(pending.contextId, pending.obligation.rule, pending.obligation.component))
|
|
551
|
+
return fail(pending.obligation.rule, 'A correspondence scalar premise lacks concrete aggregate discharge', 'unresolved', actual, pending.obligation.component);
|
|
552
|
+
}
|
|
553
|
+
};
|
|
554
|
+
const retainActualDependencies = (dependencies) => {
|
|
555
|
+
for (const dependency of dependencies) {
|
|
556
|
+
charge(4 + dependency.contextId.length);
|
|
557
|
+
typedDependencies.push(Object.freeze({ from: actual, dependency }));
|
|
558
|
+
}
|
|
559
|
+
};
|
|
560
|
+
return { actualClosure, actualNotations, actualFrontier, inspect, inspectAdditive, primitive, closures, notationReceipts, validateAggregate, retainActualDependencies };
|
|
561
|
+
}
|
|
562
|
+
const frontierOwners = new WeakMap();
|
|
563
|
+
/** Internal native collection authority shared by supplied verification and research construction. */
|
|
564
|
+
export function prepareFiniteRe01Frontier(actual) {
|
|
565
|
+
assertSemanticContext(actual);
|
|
566
|
+
const b = actual.budget;
|
|
567
|
+
return b.guard(() => {
|
|
568
|
+
try {
|
|
569
|
+
const owner = createNativeFrontierOwner(actual);
|
|
570
|
+
b.chargeWork(6);
|
|
571
|
+
const session = Object.freeze({ kind: 'native-frontier-session', actual: owner.actualFrontier,
|
|
572
|
+
inspectCandidate: (hypothesis) => b.guard(() => {
|
|
573
|
+
try {
|
|
574
|
+
return owner.inspect(hypothesis);
|
|
575
|
+
}
|
|
576
|
+
catch (error) {
|
|
577
|
+
if (error instanceof VerificationAbort)
|
|
578
|
+
return error.result;
|
|
579
|
+
throw error;
|
|
580
|
+
}
|
|
581
|
+
}) });
|
|
582
|
+
frontierOwners.set(session, owner);
|
|
583
|
+
return session;
|
|
584
|
+
}
|
|
585
|
+
catch (error) {
|
|
586
|
+
if (error instanceof VerificationAbort)
|
|
587
|
+
return error.result;
|
|
588
|
+
throw error;
|
|
589
|
+
}
|
|
590
|
+
});
|
|
591
|
+
}
|
|
592
|
+
export function assertFiniteCandidateReceipt(actual, receipt) {
|
|
593
|
+
assertSemanticContext(actual);
|
|
594
|
+
if (issued.get(receipt) !== actual)
|
|
595
|
+
throw new TypeError('Unauthenticated finite candidate receipt');
|
|
596
|
+
}
|
|
597
|
+
export function assertFinitePrimitiveReceipt(actual, receipt) {
|
|
598
|
+
assertSemanticContext(actual);
|
|
599
|
+
if (issuedPrimitive.get(receipt) !== actual)
|
|
600
|
+
throw new TypeError('Unauthenticated finite primitive receipt');
|
|
601
|
+
}
|
|
602
|
+
/** Inspect the exact checked contexts in proof order; diagnostic context IDs never reconstruct authority. */
|
|
603
|
+
export function inspectFiniteProofContexts(actual, receipt) {
|
|
604
|
+
assertSemanticContext(actual);
|
|
605
|
+
if (issued.get(receipt) !== actual && issuedPrimitive.get(receipt) !== actual)
|
|
606
|
+
throw new TypeError('Unauthenticated finite proof contexts');
|
|
607
|
+
const contexts = proofContexts.get(receipt);
|
|
608
|
+
if (!contexts)
|
|
609
|
+
throw new TypeError('Checked finite proof contexts unavailable');
|
|
610
|
+
return contexts;
|
|
611
|
+
}
|
|
612
|
+
export function verifyFiniteRe01Evidence(actual, target, supplied) {
|
|
613
|
+
return verifyFiniteRe01EvidenceWithFrontier(actual, target, supplied);
|
|
614
|
+
}
|
|
615
|
+
/** Reuse native actual preparation within one authenticated research request. */
|
|
616
|
+
export function verifyFiniteRe01EvidenceWithFrontier(actual, target, supplied, prepared) {
|
|
617
|
+
assertSemanticContext(actual);
|
|
618
|
+
const b = actual.budget, charge = b.chargeWork;
|
|
619
|
+
return b.guard(() => {
|
|
620
|
+
const fail = (rule, message, kind = 'invalid-evidence', context = actual, component) => {
|
|
621
|
+
charge(16 + rule.length + message.length + (component?.length ?? 0));
|
|
622
|
+
throw new VerificationAbort(Object.freeze({ kind, rule, message, contextId: context.contextId, component }));
|
|
623
|
+
};
|
|
624
|
+
const record = (value, field) => {
|
|
625
|
+
charge(50 + field.length);
|
|
626
|
+
if (!value || typeof value !== 'object')
|
|
627
|
+
return fail('evidence-syntax', 'Expected a finite data record');
|
|
628
|
+
const property = Object.getOwnPropertyDescriptor(value, field);
|
|
629
|
+
if (!property || !('value' in property))
|
|
630
|
+
return fail('evidence-syntax', 'Evidence fields must be own data properties');
|
|
631
|
+
return property.value;
|
|
632
|
+
};
|
|
633
|
+
try {
|
|
634
|
+
if (actual.kind !== 'actual' || actual.membership !== 'complete-actual-plus-additions')
|
|
635
|
+
return fail('actual-environment', 'A complete immutable original context is required');
|
|
636
|
+
const rootId = record(supplied, 'root'), sourceNodes = record(supplied, 'nodes');
|
|
637
|
+
const primitiveRoot = rootId !== null && typeof rootId === 'object' && record(rootId, 'kind') === 'primitive-no-change';
|
|
638
|
+
if ((!primitiveRoot && (typeof rootId !== 'string' || !rootId)) || !Array.isArray(sourceNodes))
|
|
639
|
+
return fail('evidence-syntax', 'Evidence requires a root ID or primitive marker and finite node array');
|
|
640
|
+
b.reserveNodes(sourceNodes.length);
|
|
641
|
+
charge(6 + (typeof rootId === 'string' ? rootId.length : 19));
|
|
642
|
+
const nodes = new Map();
|
|
643
|
+
const subjects = new Map();
|
|
644
|
+
for (let index = 0; index < sourceNodes.length; index++) {
|
|
645
|
+
// Read the caller's array as bounded own data, never through its
|
|
646
|
+
// iterator or an indexed getter. Context handles are authenticated
|
|
647
|
+
// below and intentionally are not cloned as ordinary data.
|
|
648
|
+
charge(24);
|
|
649
|
+
const raw = record(sourceNodes, String(index));
|
|
650
|
+
const parent = record(raw, 'parent'), context = record(raw, 'context');
|
|
651
|
+
try {
|
|
652
|
+
assertSemanticContext(parent);
|
|
653
|
+
assertSemanticContext(context);
|
|
654
|
+
}
|
|
655
|
+
catch {
|
|
656
|
+
return fail('evidence-context', 'Evidence contains an unauthenticated context');
|
|
657
|
+
}
|
|
658
|
+
if (!contextsShareRequest(actual, parent) || !contextsShareRequest(actual, context))
|
|
659
|
+
return fail('evidence-context', 'Evidence belongs to another semantic request');
|
|
660
|
+
const readData = () => {
|
|
661
|
+
try {
|
|
662
|
+
charge(12);
|
|
663
|
+
return b.freeze(b.snapshot({ id: record(raw, 'id'), target: record(raw, 'target'), intermediate: record(raw, 'intermediate'),
|
|
664
|
+
ancestor: record(raw, 'ancestor'), premises: record(raw, 'premises') }));
|
|
665
|
+
}
|
|
666
|
+
catch (error) {
|
|
667
|
+
if (error instanceof TypeError)
|
|
668
|
+
return fail('evidence-syntax', 'Evidence must contain finite immutable data');
|
|
669
|
+
throw error;
|
|
670
|
+
}
|
|
671
|
+
};
|
|
672
|
+
const data = readData();
|
|
673
|
+
if (typeof data.id !== 'string' || !data.id || typeof data.target !== 'string' || typeof data.intermediate !== 'string'
|
|
674
|
+
|| !data.ancestor || typeof data.ancestor !== 'object' || !Array.isArray(data.premises))
|
|
675
|
+
return fail('evidence-syntax', 'Malformed proof subject or premises');
|
|
676
|
+
try {
|
|
677
|
+
resolveSemanticType(parent, data.ancestor);
|
|
678
|
+
}
|
|
679
|
+
catch (error) {
|
|
680
|
+
if (error instanceof SemanticContextAccessError || error instanceof TypeError)
|
|
681
|
+
return fail('evidence-syntax', 'Malformed evidence ancestor reference');
|
|
682
|
+
throw error;
|
|
683
|
+
}
|
|
684
|
+
for (const premise of data.premises) {
|
|
685
|
+
charge();
|
|
686
|
+
if (typeof premise !== 'string')
|
|
687
|
+
return fail('evidence-syntax', 'Proof references must be evidence IDs');
|
|
688
|
+
}
|
|
689
|
+
charge(6 + data.id.length + data.target.length);
|
|
690
|
+
if (nodes.has(data.id))
|
|
691
|
+
return fail('duplicate-evidence-id', 'Evidence IDs must be unique');
|
|
692
|
+
const claims = subjects.get(parent) ?? new Set();
|
|
693
|
+
if (claims.has(data.target))
|
|
694
|
+
return fail('duplicate-proof-subject', 'A proof subject has multiple supplied certificates');
|
|
695
|
+
claims.add(data.target);
|
|
696
|
+
subjects.set(parent, claims);
|
|
697
|
+
const item = Object.freeze({ ...data, parent, context });
|
|
698
|
+
nodes.set(item.id, item);
|
|
699
|
+
}
|
|
700
|
+
const root = typeof rootId === 'string' ? nodes.get(rootId) : undefined;
|
|
701
|
+
if (!primitiveRoot && (!root || root.parent !== actual || root.target !== target))
|
|
702
|
+
return fail('evidence-root', 'Root must prove the requested original target');
|
|
703
|
+
for (const item of nodes.values()) {
|
|
704
|
+
charge();
|
|
705
|
+
if (!isSemanticCandidateOf(item.parent, item.context))
|
|
706
|
+
return fail('evidence-context', 'Candidate must be an authenticated direct child of its declared parent');
|
|
707
|
+
}
|
|
708
|
+
// Declared proof dependencies are a finite DAG; component recursion is
|
|
709
|
+
// scheduled below and never substitutes for this proof check.
|
|
710
|
+
charge(3);
|
|
711
|
+
const colors = new Map();
|
|
712
|
+
for (const entry of nodes.values()) {
|
|
713
|
+
if (colors.has(entry.id))
|
|
714
|
+
continue;
|
|
715
|
+
charge(4);
|
|
716
|
+
const stack = [{ id: entry.id, index: 0 }];
|
|
717
|
+
while (stack.length) {
|
|
718
|
+
charge(3);
|
|
719
|
+
const frame = stack[stack.length - 1], item = nodes.get(frame.id);
|
|
720
|
+
colors.set(frame.id, 'active');
|
|
721
|
+
if (frame.index === item.premises.length) {
|
|
722
|
+
colors.set(frame.id, 'done');
|
|
723
|
+
stack.pop();
|
|
724
|
+
continue;
|
|
725
|
+
}
|
|
726
|
+
const next = item.premises[frame.index++];
|
|
727
|
+
if (!nodes.has(next))
|
|
728
|
+
return fail('missing-proof-reference', 'A declared proof reference has no evidence node');
|
|
729
|
+
if (colors.get(next) === 'active')
|
|
730
|
+
return fail('proof-cycle', 'An active proof node cannot justify its own premise', 'unresolved', item.context, item.target);
|
|
731
|
+
if (!colors.has(next)) {
|
|
732
|
+
charge(3);
|
|
733
|
+
stack.push({ id: next, index: 0 });
|
|
734
|
+
}
|
|
735
|
+
}
|
|
736
|
+
}
|
|
737
|
+
const session = prepared ?? prepareFiniteRe01Frontier(actual);
|
|
738
|
+
if (session.kind !== 'native-frontier-session')
|
|
739
|
+
throw new VerificationAbort(session);
|
|
740
|
+
const owner = frontierOwners.get(session);
|
|
741
|
+
if (!owner || session.actual.context !== actual)
|
|
742
|
+
return fail('evidence-context', 'Frontier session belongs to another actual context');
|
|
743
|
+
const { actualClosure, actualNotations, primitive, notationReceipts } = owner;
|
|
744
|
+
let targetRequirement;
|
|
745
|
+
for (const requirement of actualClosure.requirements) {
|
|
746
|
+
charge(2 + requirement.target.length + target.length);
|
|
747
|
+
if (requirement.target === target)
|
|
748
|
+
targetRequirement = requirement;
|
|
749
|
+
}
|
|
750
|
+
if (!targetRequirement)
|
|
751
|
+
return fail('target-rule', 'The selected original target has no RE01 extension obligation');
|
|
752
|
+
charge(5);
|
|
753
|
+
const completed = new Set(), active = new Set(), proof = [];
|
|
754
|
+
const execute = (start) => {
|
|
755
|
+
charge(6);
|
|
756
|
+
const stack = [{ node: start, index: 0, used: [], primitive: [] }];
|
|
757
|
+
while (stack.length) {
|
|
758
|
+
charge(3);
|
|
759
|
+
const frame = stack[stack.length - 1], item = frame.node;
|
|
760
|
+
if (completed.has(item.id)) {
|
|
761
|
+
stack.pop();
|
|
762
|
+
continue;
|
|
763
|
+
}
|
|
764
|
+
if (!frame.closure) {
|
|
765
|
+
if (active.has(item.id))
|
|
766
|
+
return fail('proof-cycle', 'An active proof premise cannot count as checked', 'unresolved', item.parent, item.target);
|
|
767
|
+
charge();
|
|
768
|
+
active.add(item.id);
|
|
769
|
+
const frontier = session.inspectCandidate(item);
|
|
770
|
+
if (frontier.kind !== 'inspected-frontier')
|
|
771
|
+
throw new VerificationAbort(frontier);
|
|
772
|
+
frame.correspondence = frontier.correspondence;
|
|
773
|
+
frame.closure = owner.closures.get(item.context.contextId);
|
|
774
|
+
}
|
|
775
|
+
if (frame.index < frame.closure.requirements.length) {
|
|
776
|
+
const requirement = frame.closure.requirements[frame.index++];
|
|
777
|
+
if (primitive(item.context, requirement)) {
|
|
778
|
+
charge();
|
|
779
|
+
frame.primitive.push(requirement.target);
|
|
780
|
+
continue;
|
|
781
|
+
}
|
|
782
|
+
let child;
|
|
783
|
+
for (const id of item.premises) {
|
|
784
|
+
charge();
|
|
785
|
+
const offered = nodes.get(id);
|
|
786
|
+
if (offered.parent === item.context && offered.target === requirement.target)
|
|
787
|
+
child = offered;
|
|
788
|
+
}
|
|
789
|
+
if (!child)
|
|
790
|
+
return fail('missing-nested-evidence', 'A generated RE01 obligation lacks matching finite evidence', 'unresolved', item.context, requirement.target);
|
|
791
|
+
charge();
|
|
792
|
+
frame.used.push(child.id);
|
|
793
|
+
if (!completed.has(child.id)) {
|
|
794
|
+
charge(6);
|
|
795
|
+
stack.push({ node: child, index: 0, used: [], primitive: [] });
|
|
796
|
+
}
|
|
797
|
+
continue;
|
|
798
|
+
}
|
|
799
|
+
for (const id of item.premises) {
|
|
800
|
+
charge(1 + frame.used.length * (1 + id.length));
|
|
801
|
+
if (!frame.used.includes(id))
|
|
802
|
+
return fail('unused-proof-premise', 'A supplied premise does not match a generated nested obligation');
|
|
803
|
+
}
|
|
804
|
+
charge(12 + frame.used.length + frame.primitive.length);
|
|
805
|
+
proof.push(Object.freeze({ evidence: item.id, parentContext: item.parent.contextId, contextId: item.context.contextId, target: item.target,
|
|
806
|
+
correspondence: frame.correspondence, components: frame.closure.components,
|
|
807
|
+
scalarSlots: frame.closure.scalarSlots,
|
|
808
|
+
notations: notationReceipts.get(item.context),
|
|
809
|
+
identityConstraints: frame.closure.identityConstraints,
|
|
810
|
+
premises: Object.freeze(frame.used), primitiveNoChange: Object.freeze(frame.primitive) }));
|
|
811
|
+
completed.add(item.id);
|
|
812
|
+
active.delete(item.id);
|
|
813
|
+
stack.pop();
|
|
814
|
+
}
|
|
815
|
+
};
|
|
816
|
+
if (primitiveRoot && !primitive(actual, targetRequirement))
|
|
817
|
+
return fail('primitive-no-change', 'The requested target is not a qualified primitive extension');
|
|
818
|
+
if (root)
|
|
819
|
+
execute(root);
|
|
820
|
+
charge();
|
|
821
|
+
const actualPrimitiveNoChange = [];
|
|
822
|
+
for (const requirement of actualClosure.requirements) {
|
|
823
|
+
if (primitive(actual, requirement)) {
|
|
824
|
+
charge();
|
|
825
|
+
actualPrimitiveNoChange.push(requirement.target);
|
|
826
|
+
continue;
|
|
827
|
+
}
|
|
828
|
+
let evidence;
|
|
829
|
+
for (const item of nodes.values()) {
|
|
830
|
+
charge();
|
|
831
|
+
if (item.parent === actual && item.target === requirement.target)
|
|
832
|
+
evidence = item;
|
|
833
|
+
}
|
|
834
|
+
if (!evidence)
|
|
835
|
+
return fail('missing-actual-evidence', 'An original actual RE01 obligation lacks finite evidence', 'unresolved', actual, requirement.target);
|
|
836
|
+
execute(evidence);
|
|
837
|
+
}
|
|
838
|
+
if (completed.size !== nodes.size)
|
|
839
|
+
return fail('unused-proof-node', 'Every supplied proof node must match a required obligation');
|
|
840
|
+
owner.validateAggregate(proof);
|
|
841
|
+
charge(20 + proof.length + actualPrimitiveNoChange.length);
|
|
842
|
+
charge(12);
|
|
843
|
+
const common = { authority: 'RE01-finite-evidence-v1', domain: RE01_DERIVATION_DOMAIN,
|
|
844
|
+
actualContextId: actual.contextId, target,
|
|
845
|
+
actualComponents: actualClosure.components, actualPrimitiveNoChange: Object.freeze(actualPrimitiveNoChange), proof: Object.freeze(proof),
|
|
846
|
+
actualScalarSlots: actualClosure.scalarSlots,
|
|
847
|
+
actualNotations, actualIdentityConstraints: actualClosure.identityConstraints };
|
|
848
|
+
charge(32 + proof.length * 8);
|
|
849
|
+
const contexts = Object.freeze(proof.map(step => { charge(8); return nodes.get(step.evidence).context; }));
|
|
850
|
+
if (primitiveRoot) {
|
|
851
|
+
charge(12);
|
|
852
|
+
const result = Object.freeze({ ...common, kind: 'checked-primitive',
|
|
853
|
+
scope: 'primitive-no-change-and-finite-evidence', root: 'primitive-no-change',
|
|
854
|
+
claims: Object.freeze({ actualObligations: 'checked', primitiveTarget: 'checked', universalCoverage: false,
|
|
855
|
+
completeNegativeAnswer: false, searchTermination: false }) });
|
|
856
|
+
issuedPrimitive.set(result, actual);
|
|
857
|
+
proofContexts.set(result, contexts);
|
|
858
|
+
return result;
|
|
859
|
+
}
|
|
860
|
+
const result = Object.freeze({ ...common, kind: 'checked-candidate',
|
|
861
|
+
scope: 'supplied-construction-and-finite-evidence', root: root.id,
|
|
862
|
+
claims: Object.freeze({ actualObligations: 'checked', suppliedCandidate: 'checked', universalCoverage: false, completeNegativeAnswer: false, searchTermination: false }) });
|
|
863
|
+
issued.set(result, actual);
|
|
864
|
+
proofContexts.set(result, contexts);
|
|
865
|
+
return result;
|
|
866
|
+
}
|
|
867
|
+
catch (error) {
|
|
868
|
+
if (error instanceof VerificationAbort)
|
|
869
|
+
return error.result;
|
|
870
|
+
throw error;
|
|
871
|
+
}
|
|
872
|
+
});
|
|
873
|
+
}
|
|
874
|
+
/** Product direct strategy: no hypothetical candidates and no search-negative claim. */
|
|
875
|
+
export function verifyDirectActualSchema(actual) {
|
|
876
|
+
assertSemanticContext(actual);
|
|
877
|
+
return actual.budget.guard(() => {
|
|
878
|
+
try {
|
|
879
|
+
const owner = createNativeFrontierOwner(actual);
|
|
880
|
+
actual.budget.chargeWork(8 + owner.actualFrontier.requirements.length * 2);
|
|
881
|
+
const unresolved = owner.actualFrontier.requirements.filter(item => !item.primitive).map(item => item.target);
|
|
882
|
+
// Aggregate discharge is mandatory even when this strategy cannot prove RE01.
|
|
883
|
+
owner.validateAggregate([]);
|
|
884
|
+
return Object.freeze({ kind: unresolved.length ? 'inconclusive-direct' : 'checked-direct',
|
|
885
|
+
frontier: owner.actualFrontier, unresolved: Object.freeze(unresolved) });
|
|
886
|
+
}
|
|
887
|
+
catch (error) {
|
|
888
|
+
if (error instanceof VerificationAbort)
|
|
889
|
+
return error.result;
|
|
890
|
+
throw error;
|
|
891
|
+
}
|
|
892
|
+
});
|
|
893
|
+
}
|
|
894
|
+
const extensionChains = new WeakMap();
|
|
895
|
+
/** Authenticate actual-only extension ancestry; saved or copied receipt fields grant no authority. */
|
|
896
|
+
export function assertExtensionChainReceipt(actual, receipt) {
|
|
897
|
+
assertSemanticContext(actual);
|
|
898
|
+
if (extensionChains.get(receipt) !== actual)
|
|
899
|
+
throw new TypeError('Fresh matching extension-chain receipt required');
|
|
900
|
+
}
|
|
901
|
+
/** Close actual RE01 duties whose ancestry has no restriction after the designated ancestor.
|
|
902
|
+
* @remarks The 2004 Structures cos-ct-extends.1.5 note identifies this sufficient case as trivial.
|
|
903
|
+
* All component premises and aggregate dependencies are still checked by the existing native owner.
|
|
904
|
+
* No candidate context, endpoint replacement or primitive relabelling is used. The existing direct preview is unchanged.
|
|
905
|
+
* @returns Authenticated actual-only closure, an unresolved duty inventory, or the native failure.
|
|
906
|
+
* @throws TypeError For a non-actual context. Explicit request exhaustion remains sticky.
|
|
907
|
+
* @see https://www.w3.org/TR/2004/REC-xmlschema-1-20041028/#cos-ct-extends
|
|
908
|
+
*/
|
|
909
|
+
export function verifyExtensionChainActualSchema(actual) {
|
|
910
|
+
assertSemanticContext(actual);
|
|
911
|
+
if (actual.kind !== 'actual')
|
|
912
|
+
throw new TypeError('Actual source context required');
|
|
913
|
+
const { budget } = actual;
|
|
914
|
+
return budget.guard(() => {
|
|
915
|
+
try {
|
|
916
|
+
const owner = createNativeFrontierOwner(actual);
|
|
917
|
+
const extensionOnly = [], unresolved = [];
|
|
918
|
+
for (const requirement of owner.actualFrontier.requirements) {
|
|
919
|
+
budget.chargeWork(8);
|
|
920
|
+
if (requirement.primitive)
|
|
921
|
+
continue;
|
|
922
|
+
let reference = { kind: 'local', target: requirement.target };
|
|
923
|
+
const seen = new Set();
|
|
924
|
+
let established = false;
|
|
925
|
+
while (true) {
|
|
926
|
+
budget.chargeWork(8);
|
|
927
|
+
const resolved = resolveSemanticType(actual, reference);
|
|
928
|
+
if (resolved.kind !== 'component' || resolved.node.kind !== 'complexType')
|
|
929
|
+
break;
|
|
930
|
+
const node = resolved.node;
|
|
931
|
+
budget.chargeWork(4 + node.id.length);
|
|
932
|
+
if (seen.has(node.id))
|
|
933
|
+
break;
|
|
934
|
+
seen.add(node.id);
|
|
935
|
+
const next = immediateTypeBase(actual, reference);
|
|
936
|
+
if (next.kind === 'resource-limit')
|
|
937
|
+
throw new VerificationAbort(next);
|
|
938
|
+
if (next.kind !== 'checked' || !next.value)
|
|
939
|
+
break;
|
|
940
|
+
const base = resolveSemanticType(actual, next.value);
|
|
941
|
+
// @why The first derivation from anyType may be a restriction; every later edge must extend.
|
|
942
|
+
if (base.kind === 'builtin' && base.name.namespace === XSD_NAMESPACE && base.name.local === 'anyType') {
|
|
943
|
+
const designated = resolveSemanticType(actual, requirement.ancestor);
|
|
944
|
+
established = designated.kind === 'component' && designated.node === node;
|
|
945
|
+
break;
|
|
946
|
+
}
|
|
947
|
+
if (node.derivation?.kind !== 'extension')
|
|
948
|
+
break;
|
|
949
|
+
reference = next.value;
|
|
950
|
+
}
|
|
951
|
+
budget.chargeWork(2 + requirement.target.length);
|
|
952
|
+
(established ? extensionOnly : unresolved).push(requirement.target);
|
|
953
|
+
}
|
|
954
|
+
owner.validateAggregate([]);
|
|
955
|
+
budget.chargeWork(64 + extensionOnly.length + unresolved.length);
|
|
956
|
+
const result = Object.freeze({ kind: unresolved.length ? 'inconclusive-extension-chain' : 'checked-extension-chain',
|
|
957
|
+
basis: 'XSD-2004-extension-only-ancestry', frontier: owner.actualFrontier,
|
|
958
|
+
extensionOnly: Object.freeze(extensionOnly), unresolved: Object.freeze(unresolved) });
|
|
959
|
+
extensionChains.set(result, actual);
|
|
960
|
+
return result;
|
|
961
|
+
}
|
|
962
|
+
catch (error) {
|
|
963
|
+
if (error instanceof VerificationAbort)
|
|
964
|
+
return error.result;
|
|
965
|
+
throw error;
|
|
966
|
+
}
|
|
967
|
+
});
|
|
968
|
+
}
|
|
969
|
+
const additiveLocalClosures = new WeakMap();
|
|
970
|
+
/** Authenticate the exact native local closure; neither target correspondence nor actual RE01 is asserted. */
|
|
971
|
+
export function assertAdditiveLocalClosure(actual, receipt) {
|
|
972
|
+
assertSemanticContext(actual);
|
|
973
|
+
if (additiveLocalClosures.get(receipt) !== actual)
|
|
974
|
+
throw new TypeError('Fresh matching additive local closure required');
|
|
975
|
+
if (receipt.nativeProperties)
|
|
976
|
+
assertAdditiveSimpleProperties(actual, receipt.frontier.context, receipt.nativeProperties);
|
|
977
|
+
}
|
|
978
|
+
/** Check fresh extension/restriction representatives and their complete native dependencies without endpoint shadowing.
|
|
979
|
+
* @remarks Every original component and scope owner remains unchanged. This establishes local construction and
|
|
980
|
+
* aggregate discharge only; the representative-to-target correspondence and actual RE01 remain unassessed.
|
|
981
|
+
* @returns An authenticated local closure or explicit native unavailability/resource failure; never admission.
|
|
982
|
+
*/
|
|
983
|
+
export function verifyAdditiveRestrictionLocalClosure(actual, target) {
|
|
984
|
+
assertSemanticContext(actual);
|
|
985
|
+
const b = actual.budget;
|
|
986
|
+
return b.guard(() => {
|
|
987
|
+
try {
|
|
988
|
+
const owner = createNativeFrontierOwner(actual);
|
|
989
|
+
const prepared = prepareAdditiveRestrictionRepresentative(actual, target);
|
|
990
|
+
if (prepared.kind === 'resource-limit')
|
|
991
|
+
return prepared;
|
|
992
|
+
if (prepared.kind !== 'prepared-additive-restriction')
|
|
993
|
+
return Object.freeze({ kind: 'unresolved', rule: 'additive-preparation',
|
|
994
|
+
component: target, contextId: actual.contextId, message: 'The limited additive construction was unavailable' });
|
|
995
|
+
const frontier = owner.inspectAdditive(prepared.context);
|
|
996
|
+
if (frontier.requirements.some(requirement => !requirement.primitive))
|
|
997
|
+
return Object.freeze({ kind: 'unresolved',
|
|
998
|
+
rule: 'additive-nonprimitive-dependency', component: target, contextId: prepared.context.contextId,
|
|
999
|
+
message: 'The additive local closure still requires a nonprimitive derivation proof' });
|
|
1000
|
+
// Preparation debts are additional obligations, never successful producer annotations.
|
|
1001
|
+
if (prepared.scalarObligations.length)
|
|
1002
|
+
return Object.freeze({ kind: 'unresolved', rule: 'additive-preparation-scalar-obligations',
|
|
1003
|
+
component: target, contextId: actual.contextId, message: 'The proposal has scalar preparation obligations outside this local route' });
|
|
1004
|
+
owner.retainActualDependencies(prepared.typeDependencies);
|
|
1005
|
+
let nativeProperties;
|
|
1006
|
+
if (prepared.context.rawTypeProperties(prepared.representative)?.content.kind === 'simple') {
|
|
1007
|
+
const properties = checkAdditiveSimpleProperties(actual, prepared.context, target, prepared.intermediate, prepared.representative);
|
|
1008
|
+
if (properties.kind !== 'checked-additive-simple-properties')
|
|
1009
|
+
return properties;
|
|
1010
|
+
assertAdditiveSimpleProperties(actual, prepared.context, properties);
|
|
1011
|
+
if (properties.scalarObligations.length)
|
|
1012
|
+
return Object.freeze({ kind: 'unresolved', rule: 'additive-property-scalar-obligations',
|
|
1013
|
+
component: target, contextId: actual.contextId, message: 'Native property correspondence retains scalar obligations' });
|
|
1014
|
+
owner.retainActualDependencies(properties.typeDependencies);
|
|
1015
|
+
nativeProperties = properties;
|
|
1016
|
+
}
|
|
1017
|
+
owner.validateAggregate([], [prepared.context]);
|
|
1018
|
+
b.chargeWork(128);
|
|
1019
|
+
const result = Object.freeze({ kind: 'checked-additive-local-closure',
|
|
1020
|
+
actual: owner.actualFrontier, frontier, target, intermediate: prepared.intermediate, representative: prepared.representative,
|
|
1021
|
+
...(nativeProperties ? { nativeProperties } : {}),
|
|
1022
|
+
targetCorrespondence: 'unassessed', actualRe01: 'unassessed', admitted: false });
|
|
1023
|
+
additiveLocalClosures.set(result, actual);
|
|
1024
|
+
return result;
|
|
1025
|
+
}
|
|
1026
|
+
catch (error) {
|
|
1027
|
+
if (error instanceof VerificationAbort)
|
|
1028
|
+
return error.result;
|
|
1029
|
+
throw error;
|
|
1030
|
+
}
|
|
1031
|
+
});
|
|
1032
|
+
}
|
|
1033
|
+
const additiveSimplePredicates = new WeakMap();
|
|
1034
|
+
const simpleExtensionConstructions = new WeakMap();
|
|
1035
|
+
/** Authenticate the complete native premises; saved fields grant neither source nor runtime admission. */
|
|
1036
|
+
export function assertSimpleExtensionConstruction(actual, receipt) {
|
|
1037
|
+
assertSemanticContext(actual);
|
|
1038
|
+
if (simpleExtensionConstructions.get(receipt) !== actual)
|
|
1039
|
+
throw new TypeError('Fresh matching simple-extension construction required');
|
|
1040
|
+
assertExtensionChainReceipt(actual, receipt.complex);
|
|
1041
|
+
for (const predicate of receipt.simple)
|
|
1042
|
+
assertAdditiveSimplePredicate(actual, predicate);
|
|
1043
|
+
}
|
|
1044
|
+
/** Check the sufficient simple-content extension spine and its original-target alternative restriction.
|
|
1045
|
+
* @remarks Complex ancestry must consist solely of simple-content extensions and terminate at a simple type.
|
|
1046
|
+
* The designated ancestor is exactly anySimpleType; its fresh extension is independently constructed and
|
|
1047
|
+
* all original target restriction predicates and aggregate dependencies pass without replacing original bindings.
|
|
1048
|
+
* This collects native premises; the dated in-principle interpretation remains a separate qualification duty.
|
|
1049
|
+
* @returns Authenticated premises or unresolved targets/native failure, never admission or a general negative answer.
|
|
1050
|
+
* @see https://www.w3.org/TR/2004/REC-xmlschema-1-20041028/#cos-ct-extends
|
|
1051
|
+
*/
|
|
1052
|
+
export function verifySimpleExtensionConstruction(actual) {
|
|
1053
|
+
assertSemanticContext(actual);
|
|
1054
|
+
const b = actual.budget;
|
|
1055
|
+
return b.guard(() => {
|
|
1056
|
+
const complex = verifyExtensionChainActualSchema(actual);
|
|
1057
|
+
if (!('frontier' in complex))
|
|
1058
|
+
return complex;
|
|
1059
|
+
const simple = [], unresolved = [];
|
|
1060
|
+
for (const target of complex.unresolved) {
|
|
1061
|
+
b.chargeWork(16 + target.length);
|
|
1062
|
+
const designated = re01Ancestor(actual, target);
|
|
1063
|
+
if (designated.kind === 'resource-limit')
|
|
1064
|
+
return designated;
|
|
1065
|
+
const ancestor = designated.kind === 'checked' ? resolveSemanticType(actual, designated.ancestor) : undefined;
|
|
1066
|
+
let supported = ancestor?.kind === 'builtin' && ancestor.name.namespace === XSD_NAMESPACE && ancestor.name.local === 'anySimpleType';
|
|
1067
|
+
let reference = { kind: 'local', target };
|
|
1068
|
+
const seen = new Set();
|
|
1069
|
+
while (supported) {
|
|
1070
|
+
b.chargeWork(16);
|
|
1071
|
+
const selected = resolveSemanticType(actual, reference);
|
|
1072
|
+
if (selected.kind === 'builtin') {
|
|
1073
|
+
supported = selected.name.namespace === XSD_NAMESPACE && selected.name.local !== 'anyType';
|
|
1074
|
+
break;
|
|
1075
|
+
}
|
|
1076
|
+
if (selected.kind !== 'component') {
|
|
1077
|
+
supported = false;
|
|
1078
|
+
break;
|
|
1079
|
+
}
|
|
1080
|
+
if (selected.node.kind === 'simpleType')
|
|
1081
|
+
break;
|
|
1082
|
+
if (selected.node.kind !== 'complexType' || seen.has(selected.node.id)
|
|
1083
|
+
|| selected.node.derivation?.kind !== 'extension') {
|
|
1084
|
+
supported = false;
|
|
1085
|
+
break;
|
|
1086
|
+
}
|
|
1087
|
+
b.chargeWork(4 + selected.node.id.length);
|
|
1088
|
+
seen.add(selected.node.id);
|
|
1089
|
+
const content = deriveActualComplexContent(actual, selected.node.id);
|
|
1090
|
+
if (content.kind === 'resource-limit')
|
|
1091
|
+
return content;
|
|
1092
|
+
if (content.kind !== 'checked' || content.view.content.kind !== 'simple') {
|
|
1093
|
+
supported = false;
|
|
1094
|
+
break;
|
|
1095
|
+
}
|
|
1096
|
+
const next = immediateTypeBase(actual, reference);
|
|
1097
|
+
if (next.kind === 'resource-limit')
|
|
1098
|
+
return next;
|
|
1099
|
+
if (next.kind !== 'checked' || !next.value) {
|
|
1100
|
+
supported = false;
|
|
1101
|
+
break;
|
|
1102
|
+
}
|
|
1103
|
+
reference = next.value;
|
|
1104
|
+
}
|
|
1105
|
+
if (!supported) {
|
|
1106
|
+
unresolved.push(target);
|
|
1107
|
+
continue;
|
|
1108
|
+
}
|
|
1109
|
+
const paired = verifyAdditiveSimplePredicate(actual, target);
|
|
1110
|
+
if (paired.kind === 'resource-limit')
|
|
1111
|
+
return paired;
|
|
1112
|
+
if (paired.kind !== 'checked-additive-simple-predicate') {
|
|
1113
|
+
unresolved.push(target);
|
|
1114
|
+
continue;
|
|
1115
|
+
}
|
|
1116
|
+
assertAdditiveSimplePredicate(actual, paired);
|
|
1117
|
+
const middle = paired.frontier.context.rawTypeProperties(paired.intermediate);
|
|
1118
|
+
const base = middle ? resolveSemanticType(paired.frontier.context, middle.derivation.base) : undefined;
|
|
1119
|
+
if (middle?.derivation.method !== 'extension' || base?.kind !== 'builtin'
|
|
1120
|
+
|| base.name.namespace !== XSD_NAMESPACE || base.name.local !== 'anySimpleType') {
|
|
1121
|
+
unresolved.push(target);
|
|
1122
|
+
continue;
|
|
1123
|
+
}
|
|
1124
|
+
b.chargeWork(4);
|
|
1125
|
+
simple.push(paired);
|
|
1126
|
+
}
|
|
1127
|
+
b.chargeWork(64 + unresolved.length + simple.length);
|
|
1128
|
+
const result = Object.freeze({
|
|
1129
|
+
kind: unresolved.length ? 'inconclusive-simple-extension-construction' : 'checked-simple-extension-construction',
|
|
1130
|
+
basis: 'XSD-2004-simple-extension-spine', complex, simple: Object.freeze(simple), unresolved: Object.freeze(unresolved),
|
|
1131
|
+
datedInterpretation: 'unassessed', admitted: false
|
|
1132
|
+
});
|
|
1133
|
+
simpleExtensionConstructions.set(result, actual);
|
|
1134
|
+
return result;
|
|
1135
|
+
});
|
|
1136
|
+
}
|
|
1137
|
+
/** Authenticate the actual-target predicate and fresh-middle closure; this grants no dated or runtime admission. */
|
|
1138
|
+
export function assertAdditiveSimplePredicate(actual, receipt) {
|
|
1139
|
+
assertSemanticContext(actual);
|
|
1140
|
+
if (additiveSimplePredicates.get(receipt) !== actual)
|
|
1141
|
+
throw new TypeError('Fresh matching additive simple predicate required');
|
|
1142
|
+
assertSimpleRestrictionPredicate(receipt.frontier.context, receipt.predicate);
|
|
1143
|
+
}
|
|
1144
|
+
/** Close a fresh middle and evaluate the original target's simple restriction predicate without a renamed representative.
|
|
1145
|
+
* @remarks All original bindings are preserved and all consumed native dependencies are aggregated. The standards
|
|
1146
|
+
* interpretation of the alternative derivation remains unassessed; this is not actual RE01 or source eligibility.
|
|
1147
|
+
* @returns A fresh native paired predicate/closure or explicit unavailability/resource failure.
|
|
1148
|
+
*/
|
|
1149
|
+
export function verifyAdditiveSimplePredicate(actual, target) {
|
|
1150
|
+
assertSemanticContext(actual);
|
|
1151
|
+
const b = actual.budget;
|
|
1152
|
+
return b.guard(() => {
|
|
1153
|
+
try {
|
|
1154
|
+
const owner = createNativeFrontierOwner(actual);
|
|
1155
|
+
const prepared = prepareAdditiveExtensionMiddle(actual, target);
|
|
1156
|
+
if (prepared.kind === 'resource-limit')
|
|
1157
|
+
return prepared;
|
|
1158
|
+
if (prepared.kind !== 'prepared-additive-middle')
|
|
1159
|
+
return Object.freeze({ kind: 'unresolved', rule: 'additive-middle-preparation',
|
|
1160
|
+
component: target, contextId: actual.contextId, message: 'The limited additive middle was unavailable' });
|
|
1161
|
+
for (const id of prepared.context.members) {
|
|
1162
|
+
b.chargeWork(4 + id.length);
|
|
1163
|
+
if (actual.lookup(id).kind === 'found')
|
|
1164
|
+
continue;
|
|
1165
|
+
const found = prepared.context.lookup(id);
|
|
1166
|
+
let valid = found.kind === 'found';
|
|
1167
|
+
if (found.kind === 'found' && id === prepared.intermediate)
|
|
1168
|
+
valid = found.node.kind === 'complexType';
|
|
1169
|
+
else if (found.kind === 'found' && (found.node.kind === 'attribute' || found.node.kind === 'attributeUse')) {
|
|
1170
|
+
valid = prepared.context.owner(id) === prepared.intermediate;
|
|
1171
|
+
if (found.node.kind === 'attribute')
|
|
1172
|
+
valid &&= found.node.value === undefined;
|
|
1173
|
+
else {
|
|
1174
|
+
const declaration = prepared.context.resolve(found.node.declaration);
|
|
1175
|
+
valid &&= declaration.kind === 'found' && declaration.node.kind === 'attribute'
|
|
1176
|
+
&& (declaration.node.identity.kind === 'global' || prepared.context.owner(declaration.node.id) === prepared.intermediate);
|
|
1177
|
+
}
|
|
1178
|
+
}
|
|
1179
|
+
else
|
|
1180
|
+
valid = false;
|
|
1181
|
+
if (!valid)
|
|
1182
|
+
return Object.freeze({ kind: 'unresolved', rule: 'additive-owned-attribute-scope', component: id,
|
|
1183
|
+
contextId: prepared.context.contextId, message: 'The simple middle family requires fresh-owned local declarations and uses' });
|
|
1184
|
+
}
|
|
1185
|
+
const frontier = owner.inspectAdditive(prepared.context);
|
|
1186
|
+
if (frontier.requirements.some(requirement => !requirement.primitive))
|
|
1187
|
+
return Object.freeze({ kind: 'unresolved',
|
|
1188
|
+
rule: 'additive-middle-nonprimitive-dependency', component: target, contextId: prepared.context.contextId,
|
|
1189
|
+
message: 'The additive middle has an unresolved nonprimitive dependency' });
|
|
1190
|
+
const predicate = checkSimpleRestrictionPredicate(prepared.context, target, prepared.intermediate);
|
|
1191
|
+
if (predicate.kind === 'resource-limit')
|
|
1192
|
+
return predicate;
|
|
1193
|
+
if (predicate.kind !== 'checked-simple-restriction-predicate')
|
|
1194
|
+
return Object.freeze({ kind: 'unresolved', rule: predicate.rule,
|
|
1195
|
+
component: target, contextId: prepared.context.contextId, message: 'The actual-target simple restriction predicate was unavailable' });
|
|
1196
|
+
assertSimpleRestrictionPredicate(prepared.context, predicate);
|
|
1197
|
+
if (prepared.scalarObligations.length || predicate.scalarObligations.length)
|
|
1198
|
+
return Object.freeze({ kind: 'unresolved',
|
|
1199
|
+
rule: 'additive-predicate-scalar-obligations', component: target, contextId: prepared.context.contextId,
|
|
1200
|
+
message: 'The additive predicate retains scalar obligations outside this local strategy' });
|
|
1201
|
+
owner.retainActualDependencies(prepared.typeDependencies);
|
|
1202
|
+
owner.retainActualDependencies(predicate.typeDependencies);
|
|
1203
|
+
owner.validateAggregate([], [prepared.context]);
|
|
1204
|
+
b.chargeWork(128);
|
|
1205
|
+
const result = Object.freeze({ kind: 'checked-additive-simple-predicate',
|
|
1206
|
+
actual: owner.actualFrontier, frontier, target, intermediate: prepared.intermediate, predicate,
|
|
1207
|
+
actualRe01: 'unassessed', datedInterpretation: 'unassessed', admitted: false });
|
|
1208
|
+
additiveSimplePredicates.set(result, actual);
|
|
1209
|
+
return result;
|
|
1210
|
+
}
|
|
1211
|
+
catch (error) {
|
|
1212
|
+
if (error instanceof VerificationAbort)
|
|
1213
|
+
return error.result;
|
|
1214
|
+
throw error;
|
|
1215
|
+
}
|
|
1216
|
+
});
|
|
1217
|
+
}
|