@techspokes/typescript-wsdl-client 1.1.4 → 1.1.5
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 +49 -1
- package/dist/app/generateApp.d.ts.map +1 -1
- package/dist/app/generateApp.js +8 -6
- package/dist/cli.js +49 -5
- package/dist/client/checkedDirectRuntime.d.ts +59 -0
- package/dist/client/checkedDirectRuntime.d.ts.map +1 -0
- package/dist/client/checkedDirectRuntime.js +23 -0
- package/dist/client/directClientRuntime.d.ts +49 -0
- package/dist/client/directClientRuntime.d.ts.map +1 -0
- package/dist/client/directClientRuntime.js +112 -0
- package/dist/client/directClientVersion.d.ts +4 -0
- package/dist/client/directClientVersion.d.ts.map +1 -0
- package/dist/client/directClientVersion.js +3 -0
- package/dist/client/generateDirectClient.d.ts +14 -0
- package/dist/client/generateDirectClient.d.ts.map +1 -0
- package/dist/client/generateDirectClient.js +136 -0
- package/dist/compiler/buildCanonicalGraph.d.ts +7 -0
- package/dist/compiler/buildCanonicalGraph.d.ts.map +1 -0
- package/dist/compiler/buildCanonicalGraph.js +381 -0
- package/dist/compiler/canonicalGraph.d.ts +198 -0
- package/dist/compiler/canonicalGraph.d.ts.map +1 -0
- package/dist/compiler/canonicalGraph.js +37 -0
- package/dist/compiler/catalogErrors.d.ts +18 -0
- package/dist/compiler/catalogErrors.d.ts.map +1 -0
- package/dist/compiler/catalogErrors.js +86 -0
- package/dist/compiler/catalogProvenance.d.ts +15 -0
- package/dist/compiler/catalogProvenance.d.ts.map +1 -0
- package/dist/compiler/catalogProvenance.js +229 -0
- package/dist/compiler/checkedAssessment.d.ts +91 -0
- package/dist/compiler/checkedAssessment.d.ts.map +1 -0
- package/dist/compiler/checkedAssessment.js +300 -0
- package/dist/compiler/checkedSourcePreparation.d.ts +35 -0
- package/dist/compiler/checkedSourcePreparation.d.ts.map +1 -0
- package/dist/compiler/checkedSourcePreparation.js +131 -0
- package/dist/compiler/complexTypeContent.d.ts +59 -0
- package/dist/compiler/complexTypeContent.d.ts.map +1 -0
- package/dist/compiler/complexTypeContent.js +558 -0
- package/dist/compiler/composeCanonicalGraph.d.ts +69 -0
- package/dist/compiler/composeCanonicalGraph.d.ts.map +1 -0
- package/dist/compiler/composeCanonicalGraph.js +252 -0
- package/dist/compiler/dataOwnership.d.ts +22 -0
- package/dist/compiler/dataOwnership.d.ts.map +1 -0
- package/dist/compiler/dataOwnership.js +157 -0
- package/dist/compiler/datatypeValues.d.ts +47 -0
- package/dist/compiler/datatypeValues.d.ts.map +1 -0
- package/dist/compiler/datatypeValues.js +275 -0
- package/dist/compiler/directCodec.d.ts +59 -0
- package/dist/compiler/directCodec.d.ts.map +1 -0
- package/dist/compiler/directCodec.js +192 -0
- package/dist/compiler/directExecutionPolicy.d.ts +10 -0
- package/dist/compiler/directExecutionPolicy.d.ts.map +1 -0
- package/dist/compiler/directExecutionPolicy.js +17 -0
- package/dist/compiler/directOperation.d.ts +72 -0
- package/dist/compiler/directOperation.d.ts.map +1 -0
- package/dist/compiler/directOperation.js +282 -0
- package/dist/compiler/directSoap.d.ts +42 -0
- package/dist/compiler/directSoap.d.ts.map +1 -0
- package/dist/compiler/directSoap.js +298 -0
- package/dist/compiler/directSoapSource.d.ts +15 -0
- package/dist/compiler/directSoapSource.d.ts.map +1 -0
- package/dist/compiler/directSoapSource.js +86 -0
- package/dist/compiler/directSourceCapsule.d.ts +97 -0
- package/dist/compiler/directSourceCapsule.d.ts.map +1 -0
- package/dist/compiler/directSourceCapsule.js +305 -0
- package/dist/compiler/directStructure.d.ts +51 -0
- package/dist/compiler/directStructure.d.ts.map +1 -0
- package/dist/compiler/directStructure.js +252 -0
- package/dist/compiler/directStructurePlan.d.ts +16 -0
- package/dist/compiler/directStructurePlan.d.ts.map +1 -0
- package/dist/compiler/directStructurePlan.js +58 -0
- package/dist/compiler/directValues.d.ts +69 -0
- package/dist/compiler/directValues.d.ts.map +1 -0
- package/dist/compiler/directValues.js +282 -0
- package/dist/compiler/finiteRe01Verification.d.ts +140 -0
- package/dist/compiler/finiteRe01Verification.d.ts.map +1 -0
- package/dist/compiler/finiteRe01Verification.js +830 -0
- package/dist/compiler/graphTraversal.d.ts +11 -0
- package/dist/compiler/graphTraversal.d.ts.map +1 -0
- package/dist/compiler/graphTraversal.js +37 -0
- package/dist/compiler/hypotheticalScopedIdentity.d.ts +23 -0
- package/dist/compiler/hypotheticalScopedIdentity.d.ts.map +1 -0
- package/dist/compiler/hypotheticalScopedIdentity.js +81 -0
- package/dist/compiler/occurrenceAnalysis.d.ts +65 -0
- package/dist/compiler/occurrenceAnalysis.d.ts.map +1 -0
- package/dist/compiler/occurrenceAnalysis.js +300 -0
- package/dist/compiler/originalSourceMembership.d.ts +6 -0
- package/dist/compiler/originalSourceMembership.d.ts.map +1 -0
- package/dist/compiler/originalSourceMembership.js +31 -0
- package/dist/compiler/particleAttribution.d.ts +17 -0
- package/dist/compiler/particleAttribution.d.ts.map +1 -0
- package/dist/compiler/particleAttribution.js +474 -0
- package/dist/compiler/particleDeclarationConsistency.d.ts +24 -0
- package/dist/compiler/particleDeclarationConsistency.d.ts.map +1 -0
- package/dist/compiler/particleDeclarationConsistency.js +197 -0
- package/dist/compiler/particleExtension.d.ts +22 -0
- package/dist/compiler/particleExtension.d.ts.map +1 -0
- package/dist/compiler/particleExtension.js +119 -0
- package/dist/compiler/particleLocalAssessment.d.ts +20 -0
- package/dist/compiler/particleLocalAssessment.d.ts.map +1 -0
- package/dist/compiler/particleLocalAssessment.js +92 -0
- package/dist/compiler/particleRestriction.d.ts +24 -0
- package/dist/compiler/particleRestriction.d.ts.map +1 -0
- package/dist/compiler/particleRestriction.js +489 -0
- package/dist/compiler/particleSemanticView.d.ts +50 -0
- package/dist/compiler/particleSemanticView.d.ts.map +1 -0
- package/dist/compiler/particleSemanticView.js +297 -0
- package/dist/compiler/particleWildcardRelation.d.ts +88 -0
- package/dist/compiler/particleWildcardRelation.d.ts.map +1 -0
- package/dist/compiler/particleWildcardRelation.js +143 -0
- package/dist/compiler/re01CandidateCorrespondence.d.ts +64 -0
- package/dist/compiler/re01CandidateCorrespondence.d.ts.map +1 -0
- package/dist/compiler/re01CandidateCorrespondence.js +572 -0
- package/dist/compiler/re01TypeProperties.d.ts +71 -0
- package/dist/compiler/re01TypeProperties.d.ts.map +1 -0
- package/dist/compiler/re01TypeProperties.js +120 -0
- package/dist/compiler/re01TypePropertyValidation.d.ts +23 -0
- package/dist/compiler/re01TypePropertyValidation.d.ts.map +1 -0
- package/dist/compiler/re01TypePropertyValidation.js +161 -0
- package/dist/compiler/resolveCanonicalGraph.d.ts +38 -0
- package/dist/compiler/resolveCanonicalGraph.d.ts.map +1 -0
- package/dist/compiler/resolveCanonicalGraph.js +170 -0
- package/dist/compiler/scalarSchemaAssessment.d.ts +425 -0
- package/dist/compiler/scalarSchemaAssessment.d.ts.map +1 -0
- package/dist/compiler/scalarSchemaAssessment.js +5198 -0
- package/dist/compiler/schemaAttributeGroupProperties.d.ts +17 -0
- package/dist/compiler/schemaAttributeGroupProperties.d.ts.map +1 -0
- package/dist/compiler/schemaAttributeGroupProperties.js +53 -0
- package/dist/compiler/schemaAttributeProperties.d.ts +10 -0
- package/dist/compiler/schemaAttributeProperties.d.ts.map +1 -0
- package/dist/compiler/schemaAttributeProperties.js +11 -0
- package/dist/compiler/schemaAttributeUses.d.ts +90 -0
- package/dist/compiler/schemaAttributeUses.d.ts.map +1 -0
- package/dist/compiler/schemaAttributeUses.js +725 -0
- package/dist/compiler/schemaBinaryWordReconstruction.d.ts +10 -0
- package/dist/compiler/schemaBinaryWordReconstruction.d.ts.map +1 -0
- package/dist/compiler/schemaBinaryWordReconstruction.js +33 -0
- package/dist/compiler/schemaBuiltinFacets.d.ts +14 -0
- package/dist/compiler/schemaBuiltinFacets.d.ts.map +1 -0
- package/dist/compiler/schemaBuiltinFacets.js +51 -0
- package/dist/compiler/schemaCalendarImages.d.ts +8 -0
- package/dist/compiler/schemaCalendarImages.d.ts.map +1 -0
- package/dist/compiler/schemaCalendarImages.js +204 -0
- package/dist/compiler/schemaCalendarLanguage.d.ts +11 -0
- package/dist/compiler/schemaCalendarLanguage.d.ts.map +1 -0
- package/dist/compiler/schemaCalendarLanguage.js +227 -0
- package/dist/compiler/schemaComponentEquality.d.ts +28 -0
- package/dist/compiler/schemaComponentEquality.d.ts.map +1 -0
- package/dist/compiler/schemaComponentEquality.js +446 -0
- package/dist/compiler/schemaConstructionAssessment.d.ts +46 -0
- package/dist/compiler/schemaConstructionAssessment.d.ts.map +1 -0
- package/dist/compiler/schemaConstructionAssessment.js +663 -0
- package/dist/compiler/schemaDatatypeValues.d.ts +4 -0
- package/dist/compiler/schemaDatatypeValues.d.ts.map +1 -0
- package/dist/compiler/schemaDatatypeValues.js +2 -0
- package/dist/compiler/schemaDecimalLanguage.d.ts +7 -0
- package/dist/compiler/schemaDecimalLanguage.d.ts.map +1 -0
- package/dist/compiler/schemaDecimalLanguage.js +102 -0
- package/dist/compiler/schemaDeclarationPrimitives.d.ts +34 -0
- package/dist/compiler/schemaDeclarationPrimitives.d.ts.map +1 -0
- package/dist/compiler/schemaDeclarationPrimitives.js +194 -0
- package/dist/compiler/schemaDocumentSyntax.d.ts +55 -0
- package/dist/compiler/schemaDocumentSyntax.d.ts.map +1 -0
- package/dist/compiler/schemaDocumentSyntax.js +294 -0
- package/dist/compiler/schemaDurationLanguage.d.ts +11 -0
- package/dist/compiler/schemaDurationLanguage.d.ts.map +1 -0
- package/dist/compiler/schemaDurationLanguage.js +170 -0
- package/dist/compiler/schemaElementProperties.d.ts +16 -0
- package/dist/compiler/schemaElementProperties.d.ts.map +1 -0
- package/dist/compiler/schemaElementProperties.js +23 -0
- package/dist/compiler/schemaEndpointWordCapacity.d.ts +36 -0
- package/dist/compiler/schemaEndpointWordCapacity.d.ts.map +1 -0
- package/dist/compiler/schemaEndpointWordCapacity.js +39 -0
- package/dist/compiler/schemaExactCalendar.d.ts +73 -0
- package/dist/compiler/schemaExactCalendar.d.ts.map +1 -0
- package/dist/compiler/schemaExactCalendar.js +264 -0
- package/dist/compiler/schemaFacetAnnotation.d.ts +32 -0
- package/dist/compiler/schemaFacetAnnotation.d.ts.map +1 -0
- package/dist/compiler/schemaFacetAnnotation.js +199 -0
- package/dist/compiler/schemaGeneratedScalarShape.d.ts +35 -0
- package/dist/compiler/schemaGeneratedScalarShape.d.ts.map +1 -0
- package/dist/compiler/schemaGeneratedScalarShape.js +176 -0
- package/dist/compiler/schemaIdentityConstraints.d.ts +73 -0
- package/dist/compiler/schemaIdentityConstraints.d.ts.map +1 -0
- package/dist/compiler/schemaIdentityConstraints.js +362 -0
- package/dist/compiler/schemaIeeeLanguage.d.ts +43 -0
- package/dist/compiler/schemaIeeeLanguage.d.ts.map +1 -0
- package/dist/compiler/schemaIeeeLanguage.js +759 -0
- package/dist/compiler/schemaIntegerImages.d.ts +11 -0
- package/dist/compiler/schemaIntegerImages.d.ts.map +1 -0
- package/dist/compiler/schemaIntegerImages.js +113 -0
- package/dist/compiler/schemaLexicalPredicates.d.ts +29 -0
- package/dist/compiler/schemaLexicalPredicates.d.ts.map +1 -0
- package/dist/compiler/schemaLexicalPredicates.js +63 -0
- package/dist/compiler/schemaNotationProperties.d.ts +32 -0
- package/dist/compiler/schemaNotationProperties.d.ts.map +1 -0
- package/dist/compiler/schemaNotationProperties.js +84 -0
- package/dist/compiler/schemaNumericImageConditions.d.ts +24 -0
- package/dist/compiler/schemaNumericImageConditions.d.ts.map +1 -0
- package/dist/compiler/schemaNumericImageConditions.js +66 -0
- package/dist/compiler/schemaParticleWildcardProperties.d.ts +20 -0
- package/dist/compiler/schemaParticleWildcardProperties.d.ts.map +1 -0
- package/dist/compiler/schemaParticleWildcardProperties.js +43 -0
- package/dist/compiler/schemaPattern.d.ts +1062 -0
- package/dist/compiler/schemaPattern.d.ts.map +1 -0
- package/dist/compiler/schemaPattern.js +581 -0
- package/dist/compiler/schemaRegularLanguage.d.ts +67 -0
- package/dist/compiler/schemaRegularLanguage.d.ts.map +1 -0
- package/dist/compiler/schemaRegularLanguage.js +1166 -0
- package/dist/compiler/schemaScalarContext.d.ts +81 -0
- package/dist/compiler/schemaScalarContext.d.ts.map +1 -0
- package/dist/compiler/schemaScalarContext.js +78 -0
- package/dist/compiler/schemaScalarKernel.d.ts +182 -0
- package/dist/compiler/schemaScalarKernel.d.ts.map +1 -0
- package/dist/compiler/schemaScalarKernel.js +391 -0
- package/dist/compiler/schemaScalarWitnesses.d.ts +6 -0
- package/dist/compiler/schemaScalarWitnesses.d.ts.map +1 -0
- package/dist/compiler/schemaScalarWitnesses.js +118 -0
- package/dist/compiler/schemaSimpleTypeProperties.d.ts +95 -0
- package/dist/compiler/schemaSimpleTypeProperties.d.ts.map +1 -0
- package/dist/compiler/schemaSimpleTypeProperties.js +103 -0
- package/dist/compiler/schemaSourceGrammar.d.ts +27 -0
- package/dist/compiler/schemaSourceGrammar.d.ts.map +1 -0
- package/dist/compiler/schemaSourceGrammar.js +290 -0
- package/dist/compiler/schemaSourceLexical.d.ts +4 -0
- package/dist/compiler/schemaSourceLexical.d.ts.map +1 -0
- package/dist/compiler/schemaSourceLexical.js +12 -0
- package/dist/compiler/schemaSourceValues.d.ts +51 -0
- package/dist/compiler/schemaSourceValues.d.ts.map +1 -0
- package/dist/compiler/schemaSourceValues.js +225 -0
- package/dist/compiler/schemaSourceWildcards.d.ts +28 -0
- package/dist/compiler/schemaSourceWildcards.d.ts.map +1 -0
- package/dist/compiler/schemaSourceWildcards.js +247 -0
- package/dist/compiler/schemaSymbolicSequences.d.ts +16 -0
- package/dist/compiler/schemaSymbolicSequences.d.ts.map +1 -0
- package/dist/compiler/schemaSymbolicSequences.js +99 -0
- package/dist/compiler/schemaSymbolicValueSets.d.ts +32 -0
- package/dist/compiler/schemaSymbolicValueSets.d.ts.map +1 -0
- package/dist/compiler/schemaSymbolicValueSets.js +149 -0
- package/dist/compiler/schemaSyntaxAssessment.d.ts +25 -0
- package/dist/compiler/schemaSyntaxAssessment.d.ts.map +1 -0
- package/dist/compiler/schemaSyntaxAssessment.js +361 -0
- package/dist/compiler/schemaTemporalAliases.d.ts +6 -0
- package/dist/compiler/schemaTemporalAliases.d.ts.map +1 -0
- package/dist/compiler/schemaTemporalAliases.js +195 -0
- package/dist/compiler/schemaTokenImages.d.ts +9 -0
- package/dist/compiler/schemaTokenImages.d.ts.map +1 -0
- package/dist/compiler/schemaTokenImages.js +142 -0
- package/dist/compiler/schemaTypeIdentity.d.ts +39 -0
- package/dist/compiler/schemaTypeIdentity.d.ts.map +1 -0
- package/dist/compiler/schemaTypeIdentity.js +78 -0
- package/dist/compiler/schemaTypeRelations.d.ts +38 -0
- package/dist/compiler/schemaTypeRelations.d.ts.map +1 -0
- package/dist/compiler/schemaTypeRelations.js +576 -0
- package/dist/compiler/schemaUri.d.ts +13 -0
- package/dist/compiler/schemaUri.d.ts.map +1 -0
- package/dist/compiler/schemaUri.js +103 -0
- package/dist/compiler/schemaValueContext.d.ts +26 -0
- package/dist/compiler/schemaValueContext.d.ts.map +1 -0
- package/dist/compiler/schemaValueContext.js +1 -0
- package/dist/compiler/schemaValueImages.d.ts +10 -0
- package/dist/compiler/schemaValueImages.d.ts.map +1 -0
- package/dist/compiler/schemaValueImages.js +142 -0
- package/dist/compiler/schemaValueSequences.d.ts +15 -0
- package/dist/compiler/schemaValueSequences.d.ts.map +1 -0
- package/dist/compiler/schemaValueSequences.js +19 -0
- package/dist/compiler/semanticBudget.d.ts +50 -0
- package/dist/compiler/semanticBudget.d.ts.map +1 -0
- package/dist/compiler/semanticBudget.js +178 -0
- package/dist/compiler/semanticCatalog.d.ts +122 -0
- package/dist/compiler/semanticCatalog.d.ts.map +1 -0
- package/dist/compiler/semanticCatalog.js +160 -0
- package/dist/compiler/semanticContext.d.ts +172 -0
- package/dist/compiler/semanticContext.d.ts.map +1 -0
- package/dist/compiler/semanticContext.js +1168 -0
- package/dist/compiler/semanticTypeDependencies.d.ts +8 -0
- package/dist/compiler/semanticTypeDependencies.d.ts.map +1 -0
- package/dist/compiler/semanticTypeDependencies.js +64 -0
- package/dist/compiler/semanticTypeReference.d.ts +24 -0
- package/dist/compiler/semanticTypeReference.d.ts.map +1 -0
- package/dist/compiler/semanticTypeReference.js +36 -0
- package/dist/compiler/shapeResolver.d.ts +1 -0
- package/dist/compiler/shapeResolver.d.ts.map +1 -1
- package/dist/compiler/shapeResolver.js +7 -9
- package/dist/compiler/sourceSchemaBinding.d.ts +26 -0
- package/dist/compiler/sourceSchemaBinding.d.ts.map +1 -0
- package/dist/compiler/sourceSchemaBinding.js +39 -0
- package/dist/compiler/structuralCompanions.d.ts +16 -0
- package/dist/compiler/structuralCompanions.d.ts.map +1 -0
- package/dist/compiler/structuralCompanions.js +232 -0
- package/dist/compiler/validateSemanticGraph.d.ts +5 -0
- package/dist/compiler/validateSemanticGraph.d.ts.map +1 -0
- package/dist/compiler/validateSemanticGraph.js +376 -0
- package/dist/compiler/wildcardAlgebra.d.ts +26 -0
- package/dist/compiler/wildcardAlgebra.d.ts.map +1 -0
- package/dist/compiler/wildcardAlgebra.js +155 -0
- package/dist/gateway/generateGateway.d.ts.map +1 -1
- package/dist/gateway/generateGateway.js +2 -2
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/loader/orderedSyntax.d.ts +77 -0
- package/dist/loader/orderedSyntax.d.ts.map +1 -0
- package/dist/loader/orderedSyntax.js +202 -0
- package/dist/loader/resolutionDepth.d.ts +7 -0
- package/dist/loader/resolutionDepth.d.ts.map +1 -0
- package/dist/loader/resolutionDepth.js +65 -0
- package/dist/loader/schemaInput.d.ts +53 -0
- package/dist/loader/schemaInput.d.ts.map +1 -0
- package/dist/loader/schemaInput.js +212 -0
- package/dist/loader/schemaResources.d.ts +59 -0
- package/dist/loader/schemaResources.d.ts.map +1 -0
- package/dist/loader/schemaResources.js +292 -0
- package/dist/openapi/generateOpenAPI.d.ts.map +1 -1
- package/dist/openapi/generateOpenAPI.js +2 -2
- package/dist/test/generateTests.d.ts.map +1 -1
- package/dist/test/generateTests.js +2 -2
- package/dist/util/xmlWhitespace.d.ts +3 -0
- package/dist/util/xmlWhitespace.d.ts.map +1 -0
- package/dist/util/xmlWhitespace.js +4 -0
- package/docs/README.md +14 -1
- package/docs/architecture.md +9 -0
- package/docs/cli-reference.md +21 -1
- package/docs/content-model-analysis.md +92 -0
- package/docs/content-model-baseline.md +121 -0
- package/docs/content-model-catalog.md +116 -0
- package/docs/content-model-companions.md +90 -0
- package/docs/content-model-composition.md +103 -0
- package/docs/content-model-decisions.md +79 -0
- package/docs/content-model-gateway-feasibility.md +169 -0
- package/docs/content-model-graph.md +121 -0
- package/docs/content-model-loading.md +163 -0
- package/docs/content-model-matching.md +85 -0
- package/docs/content-model-readiness.md +144 -0
- package/docs/content-model-resolution.md +81 -0
- package/docs/content-model-s02-handoff.md +98 -0
- package/docs/content-model-s06-au-01.md +425 -0
- package/docs/content-model-s06-dt-01.md +386 -0
- package/docs/content-model-s06-pw-01.md +350 -0
- package/docs/content-model-s06-re-01-resolver-implementation.md +869 -0
- package/docs/content-model-s06-re-01-resolver.md +513 -0
- package/docs/content-model-s06-re-01-scalar-witnesses.md +1423 -0
- package/docs/content-model-s06-re-01-support-reconstruction.md +6337 -0
- package/docs/content-model-s06-re-01.md +7477 -0
- package/docs/content-model-s06-research-handoff.md +909 -0
- package/docs/content-model-shipped-fix.md +83 -0
- package/docs/content-model-soap-feasibility.md +165 -0
- package/docs/decisions/002-streamable-responses.md +2 -0
- package/docs/decisions/003-content-model-contracts.md +280 -0
- package/docs/direct-values.md +311 -0
- package/docs/reference-validation.md +243 -0
- package/docs/releases/v1.1.5.md +38 -0
- package/docs/roadmap/README.md +2 -2
- package/docs/supported-patterns.md +13 -5
- package/package.json +26 -13
- package/src/generation/preambles/direct-client/typescript.preamble +3 -0
|
@@ -0,0 +1,830 @@
|
|
|
1
|
+
import { assertSemanticContext, contextsShareRequest, isSemanticCandidateOf, SemanticContextAccessError } from './semanticContext.js';
|
|
2
|
+
import { checkSchemaDocumentSyntax } from './schemaDocumentSyntax.js';
|
|
3
|
+
import { checkComponentConstruction, assertComponentConstruction } from './schemaConstructionAssessment.js';
|
|
4
|
+
import { checkCandidateCorrespondence, assertCandidateCorrespondence, re01Ancestor } from './re01CandidateCorrespondence.js';
|
|
5
|
+
import { immediateTypeBase } from './schemaTypeRelations.js';
|
|
6
|
+
import { XSD_NAMESPACE } from '../loader/orderedSyntax.js';
|
|
7
|
+
import { RE01_DERIVATION_DOMAIN } from './re01TypeProperties.js';
|
|
8
|
+
import { checkNotationProperties } from './schemaNotationProperties.js';
|
|
9
|
+
import { checkOriginalGeneratedScalar, assertOriginalGeneratedScalarReceipt } from './schemaScalarKernel.js';
|
|
10
|
+
import { resolveSemanticType, semanticTypeKey } from './schemaTypeIdentity.js';
|
|
11
|
+
import { checkIdentityConstraintFormation } from './schemaIdentityConstraints.js';
|
|
12
|
+
import { deriveActualComplexContent, deriveOriginalComplexPropertyContent } from './complexTypeContent.js';
|
|
13
|
+
import { assertSemanticParticleView, prepareSemanticParticleView } from './particleSemanticView.js';
|
|
14
|
+
const issued = new WeakMap();
|
|
15
|
+
const issuedPrimitive = new WeakMap();
|
|
16
|
+
class VerificationAbort extends Error {
|
|
17
|
+
result;
|
|
18
|
+
constructor(result) {
|
|
19
|
+
super(result.kind);
|
|
20
|
+
this.result = result;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
const inspectedFrontiers = new WeakMap();
|
|
24
|
+
export function assertFiniteRe01Frontier(context, frontier) {
|
|
25
|
+
assertSemanticContext(context);
|
|
26
|
+
if (inspectedFrontiers.get(frontier) !== context)
|
|
27
|
+
throw new TypeError('Unauthenticated native frontier');
|
|
28
|
+
}
|
|
29
|
+
function createNativeFrontierOwner(actual) {
|
|
30
|
+
const b = actual.budget, charge = b.chargeWork;
|
|
31
|
+
const fail = (rule, message, kind = 'invalid-evidence', context = actual, component) => {
|
|
32
|
+
charge(16 + rule.length + message.length + (component?.length ?? 0));
|
|
33
|
+
throw new VerificationAbort(Object.freeze({ kind, rule, message, contextId: context.contextId, component }));
|
|
34
|
+
};
|
|
35
|
+
const refKey = (context, reference) => {
|
|
36
|
+
const found = resolveSemanticType(context, reference);
|
|
37
|
+
if (found.kind === 'component' || found.kind === 'builtin' || found.kind === 'original-generated')
|
|
38
|
+
return semanticTypeKey(context, found.identity);
|
|
39
|
+
return fail('evidence-reference', 'Proof reference is unavailable', 'unresolved', context);
|
|
40
|
+
};
|
|
41
|
+
charge(2);
|
|
42
|
+
const deferred = [];
|
|
43
|
+
if (actual.kind !== 'actual' || actual.membership !== 'complete-actual-plus-additions')
|
|
44
|
+
return fail('actual-environment', 'A complete immutable original context is required');
|
|
45
|
+
const source = checkSchemaDocumentSyntax(actual);
|
|
46
|
+
if (source.kind !== 'checked')
|
|
47
|
+
throw new VerificationAbort(source.kind === 'resource-limit' ? source : {
|
|
48
|
+
...source, message: 'Original schema-document qualification did not pass', contextId: actual.contextId
|
|
49
|
+
});
|
|
50
|
+
for (const remaining of source.remaining) {
|
|
51
|
+
charge();
|
|
52
|
+
if (remaining !== 'child-component-syntax' && remaining !== 'semantic-construction')
|
|
53
|
+
return fail(remaining, 'Original source document has an outstanding assessment obligation', 'unresolved');
|
|
54
|
+
}
|
|
55
|
+
// Notations have a private component table rather than a persisted graph
|
|
56
|
+
// role. Its own source and active-universe dimensions must both pass;
|
|
57
|
+
// neither GraphNode membership nor scalar use inventories cover unused
|
|
58
|
+
// fresh declarations. Source representation checks above remain separate.
|
|
59
|
+
charge(4);
|
|
60
|
+
const notationReceipts = new Map();
|
|
61
|
+
const checkedNotationProperties = new WeakSet();
|
|
62
|
+
const checkNotations = (context) => {
|
|
63
|
+
charge(3);
|
|
64
|
+
const prior = notationReceipts.get(context);
|
|
65
|
+
if (prior)
|
|
66
|
+
return prior;
|
|
67
|
+
if (context.notationUniverse !== 'source-bound')
|
|
68
|
+
return fail('notation-source-universe', 'Complete original notation availability is required', 'unresolved', context);
|
|
69
|
+
if (context.notationMembership !== 'complete-original-plus-additions')
|
|
70
|
+
return fail('notation-active-membership', 'The notation table must include every original and fresh declaration', 'unresolved', context);
|
|
71
|
+
charge(2);
|
|
72
|
+
const receipts = [];
|
|
73
|
+
for (const name of context.notationMembers) {
|
|
74
|
+
charge();
|
|
75
|
+
const found = context.lookupNotation(name);
|
|
76
|
+
if (found.kind !== 'found')
|
|
77
|
+
return fail(found.kind === 'unresolved' ? found.rule : 'notation-context-membership', 'A generated notation obligation is unavailable in its context', 'unresolved', context);
|
|
78
|
+
// This pure property rule depends only on the authenticated immutable
|
|
79
|
+
// tuple. Reuse it by exact object identity; source syntax and active
|
|
80
|
+
// membership are independently checked in their own contexts.
|
|
81
|
+
charge();
|
|
82
|
+
if (!checkedNotationProperties.has(found.properties)) {
|
|
83
|
+
const result = checkNotationProperties(found.properties, b);
|
|
84
|
+
if (result.kind !== 'checked')
|
|
85
|
+
return fail(result.rule, result.message, context.kind === 'actual' ? 'invalid-schema' : 'candidate-rejected', context);
|
|
86
|
+
charge();
|
|
87
|
+
checkedNotationProperties.add(found.properties);
|
|
88
|
+
}
|
|
89
|
+
charge(8 + context.contextId.length);
|
|
90
|
+
receipts.push(Object.freeze({ contextId: context.contextId, properties: found.properties, origin: found.origin }));
|
|
91
|
+
}
|
|
92
|
+
charge(2 + receipts.length);
|
|
93
|
+
const frozen = Object.freeze(receipts);
|
|
94
|
+
notationReceipts.set(context, frozen);
|
|
95
|
+
return frozen;
|
|
96
|
+
};
|
|
97
|
+
const actualNotations = checkNotations(actual);
|
|
98
|
+
charge(4);
|
|
99
|
+
const closures = new Map();
|
|
100
|
+
charge();
|
|
101
|
+
const typedDependencies = [];
|
|
102
|
+
charge();
|
|
103
|
+
const mixedFacts = new Map();
|
|
104
|
+
const mixedRule = 'simple-content-base-mixed-emptiable';
|
|
105
|
+
const mixedFact = (context, component) => {
|
|
106
|
+
charge(5 + component.length);
|
|
107
|
+
let facts = mixedFacts.get(context), view = facts?.get(component);
|
|
108
|
+
if (!view) {
|
|
109
|
+
const found = context.lookup(component);
|
|
110
|
+
if (found.kind !== 'found' || found.node.kind !== 'complexType')
|
|
111
|
+
return fail(mixedRule, 'Mixed base properties are unavailable', 'unresolved', context, component);
|
|
112
|
+
const mapped = context.kind === 'actual' ? deriveActualComplexContent(context, component)
|
|
113
|
+
: deriveOriginalComplexPropertyContent(context, component);
|
|
114
|
+
if (mapped.kind !== 'checked') {
|
|
115
|
+
if (mapped.kind === 'resource-limit')
|
|
116
|
+
throw new VerificationAbort(mapped);
|
|
117
|
+
return fail(mapped.rule, mapped.message, mapped.kind === 'unresolved' ? 'unresolved'
|
|
118
|
+
: context.kind === 'actual' ? 'invalid-schema' : 'candidate-rejected', context, mapped.component ?? component);
|
|
119
|
+
}
|
|
120
|
+
if (mapped.view.content.kind !== 'mixed')
|
|
121
|
+
return fail(mixedRule, 'Simple-content base must have mixed content', context.kind === 'actual' ? 'invalid-schema' : 'candidate-rejected', context, component);
|
|
122
|
+
const prepared = prepareSemanticParticleView(context, mapped.view, 'restriction');
|
|
123
|
+
if (prepared.kind !== 'checked') {
|
|
124
|
+
if (prepared.kind === 'resource-limit')
|
|
125
|
+
throw new VerificationAbort(prepared);
|
|
126
|
+
return fail(prepared.rule, prepared.message, prepared.kind === 'unresolved' ? 'unresolved'
|
|
127
|
+
: context.kind === 'actual' ? 'invalid-schema' : 'candidate-rejected', context, prepared.component ?? component);
|
|
128
|
+
}
|
|
129
|
+
view = prepared.view;
|
|
130
|
+
}
|
|
131
|
+
assertSemanticParticleView(context, view);
|
|
132
|
+
if (view.content.type !== component || view.content.content.kind !== 'mixed' || view.purpose !== 'restriction')
|
|
133
|
+
return fail(mixedRule, 'Mixed base fact has another semantic subject', 'invalid-evidence', context, component);
|
|
134
|
+
if (!view.root.summary.schemaEmptiable)
|
|
135
|
+
return fail(mixedRule, 'Mixed simple-content base is not formally emptiable', context.kind === 'actual' ? 'invalid-schema' : 'candidate-rejected', context, component);
|
|
136
|
+
if (!facts) {
|
|
137
|
+
charge(2);
|
|
138
|
+
facts = new Map();
|
|
139
|
+
mixedFacts.set(context, facts);
|
|
140
|
+
}
|
|
141
|
+
charge(2);
|
|
142
|
+
facts.set(component, view);
|
|
143
|
+
return view;
|
|
144
|
+
};
|
|
145
|
+
const rejectPending = (context, pending, requireTypes) => {
|
|
146
|
+
if (pending.contextId !== context.contextId) {
|
|
147
|
+
charge(8);
|
|
148
|
+
deferred.push(Object.freeze({ context, obligation: Object.freeze({ ...pending }) }));
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
if (pending.rule === mixedRule) {
|
|
152
|
+
requireTypes(mixedFact(context, pending.component).typeDependencies);
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
if (pending.rule === 'complete-substitution-universe' && context.membership === 'complete-actual-plus-additions')
|
|
156
|
+
return;
|
|
157
|
+
fail(pending.rule, 'A generated local semantic prerequisite remains undischarged', 'unresolved', context, pending.component);
|
|
158
|
+
};
|
|
159
|
+
const close = (context, roots, correspondence) => {
|
|
160
|
+
charge(8);
|
|
161
|
+
const identityConstraints = [], checkedICs = new Set();
|
|
162
|
+
const requireIdentityConstraints = (required) => {
|
|
163
|
+
charge(3 + required.length);
|
|
164
|
+
const pending = [...required];
|
|
165
|
+
while (pending.length) {
|
|
166
|
+
const dependency = pending.pop();
|
|
167
|
+
charge(6 + dependency.identity.length);
|
|
168
|
+
if (dependency.contextId !== context.contextId)
|
|
169
|
+
return fail('identity-constraint-context', 'Identity constraint dependency does not belong to this current context', 'unresolved', context);
|
|
170
|
+
if (checkedICs.has(dependency.identity))
|
|
171
|
+
continue;
|
|
172
|
+
const receipt = checkIdentityConstraintFormation(context, dependency.identity);
|
|
173
|
+
if (receipt.kind !== 'checked')
|
|
174
|
+
throw new VerificationAbort(receipt.kind === 'resource-limit' ? receipt : {
|
|
175
|
+
...receipt, contextId: receipt.contextId ?? context.contextId,
|
|
176
|
+
kind: receipt.kind === 'invalid-schema' && context.kind === 'candidate' && receipt.contextId === context.contextId ? 'candidate-rejected' : receipt.kind
|
|
177
|
+
});
|
|
178
|
+
charge(5 + receipt.identityConstraintDependencies.length);
|
|
179
|
+
checkedICs.add(dependency.identity);
|
|
180
|
+
identityConstraints.push(receipt);
|
|
181
|
+
pending.push(...receipt.identityConstraintDependencies);
|
|
182
|
+
}
|
|
183
|
+
};
|
|
184
|
+
if (context.kind === 'actual') {
|
|
185
|
+
const registry = context.originalIdentityConstraints();
|
|
186
|
+
charge(3 + registry.identities.length * 4);
|
|
187
|
+
requireIdentityConstraints(registry.identities.map(identity => ({ contextId: context.contextId, identity })));
|
|
188
|
+
}
|
|
189
|
+
if (context.scalarSlotMembership !== 'complete-original')
|
|
190
|
+
return fail('scalar-slot-active-membership', 'Finite evidence requires every original generated scalar slot', 'unresolved', context);
|
|
191
|
+
charge(12 + roots.length + (context.kind === 'actual' ? context.scalarSlots.length : 0));
|
|
192
|
+
const queue = [...roots], byComponent = new Map();
|
|
193
|
+
// Availability is complete in H, but its legality roots are E, D′,
|
|
194
|
+
// fresh components and consumed dependencies. Only Γ checks every
|
|
195
|
+
// original scalar merely because it is part of the actual schema.
|
|
196
|
+
const slotQueue = context.kind === 'actual' ? [...context.scalarSlots] : [];
|
|
197
|
+
const byScalarSlot = new Map(), scalarSlots = [];
|
|
198
|
+
const components = [], requirements = [];
|
|
199
|
+
const requireTypes = (required) => {
|
|
200
|
+
for (const dependency of required) {
|
|
201
|
+
charge(4);
|
|
202
|
+
typedDependencies.push(Object.freeze({ from: context, dependency }));
|
|
203
|
+
if (dependency.contextId !== context.contextId)
|
|
204
|
+
continue;
|
|
205
|
+
const type = dependency.type;
|
|
206
|
+
if (type.kind === 'component') {
|
|
207
|
+
charge(2);
|
|
208
|
+
if (!byComponent.has(type.id))
|
|
209
|
+
queue.push(type.id);
|
|
210
|
+
}
|
|
211
|
+
else if (type.kind === 'original-generated') {
|
|
212
|
+
charge(2);
|
|
213
|
+
if (!byScalarSlot.has(type.owner))
|
|
214
|
+
slotQueue.push(type);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
};
|
|
218
|
+
if (correspondence)
|
|
219
|
+
requireTypes(correspondence.typeDependencies);
|
|
220
|
+
while (queue.length || slotQueue.length) {
|
|
221
|
+
if (!queue.length) {
|
|
222
|
+
charge(3);
|
|
223
|
+
const slot = slotQueue.pop();
|
|
224
|
+
if (byScalarSlot.has(slot.owner))
|
|
225
|
+
continue;
|
|
226
|
+
const result = checkOriginalGeneratedScalar(context, slot);
|
|
227
|
+
if (result.kind !== 'checked')
|
|
228
|
+
throw new VerificationAbort(result.kind === 'resource-limit' ? result : {
|
|
229
|
+
...result, contextId: result.contextId ?? context.contextId,
|
|
230
|
+
kind: result.kind === 'invalid-schema' && context.kind === 'candidate'
|
|
231
|
+
&& (!result.contextId || result.contextId === context.contextId) ? 'candidate-rejected' : result.kind
|
|
232
|
+
});
|
|
233
|
+
assertOriginalGeneratedScalarReceipt(context, result);
|
|
234
|
+
if (semanticTypeKey(context, result.slot) !== semanticTypeKey(context, slot))
|
|
235
|
+
return fail('scalar-slot-receipt', 'Scalar construction receipt identifies another slot', 'invalid-evidence', context);
|
|
236
|
+
// Dedicated slot checking must finish its own scalar rules. Only
|
|
237
|
+
// genuine GraphNode-owned source premises can remain as debts;
|
|
238
|
+
// the complex provenance owner cannot certify the scalar slot.
|
|
239
|
+
for (const pending of result.obligations) {
|
|
240
|
+
charge(4);
|
|
241
|
+
rejectPending(context, { ...pending, contextId: pending.contextId ?? context.contextId }, requireTypes);
|
|
242
|
+
}
|
|
243
|
+
charge(4 + slot.owner.length);
|
|
244
|
+
byScalarSlot.set(slot.owner, result);
|
|
245
|
+
scalarSlots.push(result);
|
|
246
|
+
requireTypes(result.typeDependencies);
|
|
247
|
+
continue;
|
|
248
|
+
}
|
|
249
|
+
charge(3);
|
|
250
|
+
const id = queue.pop();
|
|
251
|
+
if (byComponent.has(id))
|
|
252
|
+
continue;
|
|
253
|
+
const found = context.lookup(id);
|
|
254
|
+
if (found.kind !== 'found')
|
|
255
|
+
return fail('obligation-membership', 'A generated obligation is outside its context', 'unresolved', context, id);
|
|
256
|
+
// WSDL transport/capability interpretation remains at its existing
|
|
257
|
+
// boundary; all XSD nodes in the actual input are still scheduled.
|
|
258
|
+
if (found.node.kind === 'wsdl') {
|
|
259
|
+
if (context.kind === 'actual')
|
|
260
|
+
continue;
|
|
261
|
+
return fail('hypothetical-component-domain', 'A hypothetical obligation is not an XSD component', 'invalid-evidence', context, id);
|
|
262
|
+
}
|
|
263
|
+
const result = checkComponentConstruction(context, id, { correspondence });
|
|
264
|
+
if (result.kind !== 'checked')
|
|
265
|
+
throw new VerificationAbort(result.kind === 'resource-limit' ? result
|
|
266
|
+
: { ...result, contextId: result.contextId ?? context.contextId });
|
|
267
|
+
assertComponentConstruction(context, result);
|
|
268
|
+
for (const pending of result.obligations)
|
|
269
|
+
rejectPending(context, pending, requireTypes);
|
|
270
|
+
charge(4 + id.length);
|
|
271
|
+
byComponent.set(id, result);
|
|
272
|
+
components.push(result);
|
|
273
|
+
requireTypes(result.typeDependencies);
|
|
274
|
+
requireIdentityConstraints(result.identityConstraintDependencies);
|
|
275
|
+
if (result.re01) {
|
|
276
|
+
charge();
|
|
277
|
+
requirements.push(result.re01);
|
|
278
|
+
}
|
|
279
|
+
for (const dependency of result.dependencies) {
|
|
280
|
+
charge(2);
|
|
281
|
+
if (!byComponent.has(dependency))
|
|
282
|
+
queue.push(dependency);
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
charge(10 + components.length + requirements.length + scalarSlots.length);
|
|
286
|
+
const closure = Object.freeze({ context, components: Object.freeze(components), requirements: Object.freeze(requirements), byComponent,
|
|
287
|
+
scalarSlots: Object.freeze(scalarSlots), byScalarSlot, identityConstraints: Object.freeze(identityConstraints) });
|
|
288
|
+
charge(context.contextId.length + 1);
|
|
289
|
+
closures.set(context.contextId, closure);
|
|
290
|
+
return closure;
|
|
291
|
+
};
|
|
292
|
+
const actualClosure = close(actual, actual.members);
|
|
293
|
+
const primitiveFacts = new Map();
|
|
294
|
+
const primitive = (context, requirement) => {
|
|
295
|
+
if (!requirement.primitive)
|
|
296
|
+
return false;
|
|
297
|
+
charge(2);
|
|
298
|
+
if (primitiveFacts.get(context)?.has(requirement.target))
|
|
299
|
+
return true;
|
|
300
|
+
const first = immediateTypeBase(context, { kind: 'local', target: requirement.target });
|
|
301
|
+
const designated = re01Ancestor(context, requirement.target);
|
|
302
|
+
if (first.kind === 'resource-limit')
|
|
303
|
+
throw new VerificationAbort(first);
|
|
304
|
+
if (designated.kind === 'resource-limit')
|
|
305
|
+
throw new VerificationAbort(designated);
|
|
306
|
+
if (first.kind !== 'checked' || !first.value || designated.kind !== 'checked')
|
|
307
|
+
return fail('primitive-no-change', 'Primitive ancestry premises are missing', 'unresolved', context, requirement.target);
|
|
308
|
+
for (const dependency of first.typeDependencies) {
|
|
309
|
+
charge(4);
|
|
310
|
+
typedDependencies.push(Object.freeze({ from: context, dependency }));
|
|
311
|
+
}
|
|
312
|
+
for (const dependency of designated.typeDependencies) {
|
|
313
|
+
charge(4);
|
|
314
|
+
typedDependencies.push(Object.freeze({ from: context, dependency }));
|
|
315
|
+
}
|
|
316
|
+
if (refKey(context, first.value) !== refKey(context, designated.ancestor) || refKey(context, requirement.ancestor) !== refKey(context, designated.ancestor))
|
|
317
|
+
return fail('primitive-no-change', 'Primitive proof is not a direct extension of the designated ancestor');
|
|
318
|
+
const base = resolveSemanticType(context, designated.ancestor);
|
|
319
|
+
if (!(base.kind === 'builtin' && base.name.namespace === XSD_NAMESPACE && base.name.local === 'anyType')) {
|
|
320
|
+
const next = immediateTypeBase(context, designated.ancestor);
|
|
321
|
+
if (next.kind === 'resource-limit')
|
|
322
|
+
throw new VerificationAbort(next);
|
|
323
|
+
if (next.kind !== 'checked' || !next.value || refKey(context, next.value) !== refKey(context, { kind: 'builtin', name: { namespace: XSD_NAMESPACE, local: 'anyType' } }))
|
|
324
|
+
return fail('primitive-no-change', 'Primitive ancestor lacks the ur-type base');
|
|
325
|
+
for (const dependency of next.typeDependencies) {
|
|
326
|
+
charge(4);
|
|
327
|
+
typedDependencies.push(Object.freeze({ from: context, dependency }));
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
// All independently generated local/component premises were checked
|
|
331
|
+
// by close(). This epsilon comparison creates no type or base edge.
|
|
332
|
+
charge(4);
|
|
333
|
+
let facts = primitiveFacts.get(context);
|
|
334
|
+
if (!facts) {
|
|
335
|
+
facts = new Set();
|
|
336
|
+
primitiveFacts.set(context, facts);
|
|
337
|
+
}
|
|
338
|
+
facts.add(requirement.target);
|
|
339
|
+
return true;
|
|
340
|
+
};
|
|
341
|
+
const publish = (closure, correspondence, deferredStart = 0, typedStart = 0) => {
|
|
342
|
+
charge(14 + closure.requirements.length * 5);
|
|
343
|
+
const requirements = closure.requirements.map(requirement => Object.freeze({ target: requirement.target,
|
|
344
|
+
ancestor: requirement.ancestor, primitive: primitive(closure.context, requirement) }));
|
|
345
|
+
charge(3 + deferred.length - deferredStart + typedDependencies.length - typedStart);
|
|
346
|
+
const frontier = Object.freeze({ kind: 'inspected-frontier', context: closure.context,
|
|
347
|
+
requirements: Object.freeze(requirements), components: closure.components, scalarSlots: closure.scalarSlots,
|
|
348
|
+
notations: notationReceipts.get(closure.context), identityConstraints: closure.identityConstraints,
|
|
349
|
+
correspondence, deferred: Object.freeze(deferred.slice(deferredStart)), typeDependencies: Object.freeze(typedDependencies.slice(typedStart)) });
|
|
350
|
+
inspectedFrontiers.set(frontier, closure.context);
|
|
351
|
+
return frontier;
|
|
352
|
+
};
|
|
353
|
+
const actualFrontier = publish(actualClosure);
|
|
354
|
+
const inspect = (item) => {
|
|
355
|
+
try {
|
|
356
|
+
assertSemanticContext(item.parent);
|
|
357
|
+
assertSemanticContext(item.context);
|
|
358
|
+
}
|
|
359
|
+
catch {
|
|
360
|
+
return fail('evidence-context', 'Candidate contains an unauthenticated context');
|
|
361
|
+
}
|
|
362
|
+
const deferredStart = deferred.length, typedStart = typedDependencies.length;
|
|
363
|
+
const previousClosure = closures.get(item.context.contextId);
|
|
364
|
+
try {
|
|
365
|
+
if (!contextsShareRequest(actual, item.parent) || !contextsShareRequest(actual, item.context)
|
|
366
|
+
|| !isSemanticCandidateOf(item.parent, item.context))
|
|
367
|
+
return fail('evidence-context', 'Candidate must be an authenticated direct child in this semantic request');
|
|
368
|
+
checkNotations(item.context);
|
|
369
|
+
const correspondence = checkCandidateCorrespondence(actual, item.parent, item.context, item.target, item.intermediate, item.ancestor);
|
|
370
|
+
if (correspondence.kind !== 'checked')
|
|
371
|
+
throw new VerificationAbort(correspondence);
|
|
372
|
+
assertCandidateCorrespondence(item.context, correspondence);
|
|
373
|
+
// Every Gamma-fresh inherited record remains a legality root. Storage of
|
|
374
|
+
// original components alone does not make all of them hypothetical roots.
|
|
375
|
+
charge(3);
|
|
376
|
+
const roots = [item.target, item.intermediate];
|
|
377
|
+
for (const id of item.context.members) {
|
|
378
|
+
charge();
|
|
379
|
+
if (actual.lookup(id).kind !== 'found') {
|
|
380
|
+
charge(2);
|
|
381
|
+
roots.push(id);
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
return publish(close(item.context, roots, correspondence), correspondence, deferredStart, typedStart);
|
|
385
|
+
}
|
|
386
|
+
catch (error) {
|
|
387
|
+
charge(4);
|
|
388
|
+
deferred.length = deferredStart;
|
|
389
|
+
typedDependencies.length = typedStart;
|
|
390
|
+
primitiveFacts.delete(item.context);
|
|
391
|
+
if (previousClosure)
|
|
392
|
+
closures.set(item.context.contextId, previousClosure);
|
|
393
|
+
else
|
|
394
|
+
closures.delete(item.context.contextId);
|
|
395
|
+
throw error;
|
|
396
|
+
}
|
|
397
|
+
};
|
|
398
|
+
const validateAggregate = (proof) => {
|
|
399
|
+
// A research session can inspect rejected alternatives. Only the selected
|
|
400
|
+
// forest contributes aggregate debts; context handles remain exact.
|
|
401
|
+
charge(4 + proof.length * 3);
|
|
402
|
+
const selected = new Set([actual.contextId]);
|
|
403
|
+
for (const step of proof)
|
|
404
|
+
selected.add(step.contextId);
|
|
405
|
+
const selectedClosure = (contextId) => selected.has(contextId) ? closures.get(contextId) : undefined;
|
|
406
|
+
// A late property-only fact cannot reopen a closed FULL frontier. Its
|
|
407
|
+
// actual typed support must already be present in that exact context.
|
|
408
|
+
const lateMixedFact = (contextId, component, from) => {
|
|
409
|
+
charge(4 + contextId.length);
|
|
410
|
+
const closure = selectedClosure(contextId);
|
|
411
|
+
if (!closure)
|
|
412
|
+
return fail(mixedRule, 'Mixed base fact has no checked originating context', 'unresolved', from, component);
|
|
413
|
+
const view = mixedFact(closure.context, component);
|
|
414
|
+
for (const dependency of view.typeDependencies) {
|
|
415
|
+
charge(5);
|
|
416
|
+
if (dependency.contextId === contextId) {
|
|
417
|
+
const type = dependency.type;
|
|
418
|
+
if (type.kind === 'component' && !closure.byComponent.has(type.id)
|
|
419
|
+
|| type.kind === 'original-generated' && !closure.byScalarSlot.has(type.owner))
|
|
420
|
+
return fail(mixedRule, 'Late mixed base fact lacks checked type support', 'unresolved', closure.context, component);
|
|
421
|
+
}
|
|
422
|
+
typedDependencies.push(Object.freeze({ from: closure.context, dependency }));
|
|
423
|
+
}
|
|
424
|
+
};
|
|
425
|
+
for (const pending of deferred)
|
|
426
|
+
if (selected.has(pending.context.contextId) && pending.obligation.rule === mixedRule)
|
|
427
|
+
lateMixedFact(pending.obligation.contextId, pending.obligation.component, pending.context);
|
|
428
|
+
for (const step of proof)
|
|
429
|
+
for (const pending of step.correspondence.scalarObligations)
|
|
430
|
+
if (pending.obligation.rule === mixedRule)
|
|
431
|
+
lateMixedFact(pending.contextId, pending.obligation.component, actual);
|
|
432
|
+
// Dependency facts in checked component/slot/correspondence receipts are
|
|
433
|
+
// privately owned and frozen. Resolve each exact builtin tuple once per
|
|
434
|
+
// context; repeated uses still pay for the lookup and remain represented
|
|
435
|
+
// in their originating receipts.
|
|
436
|
+
charge(2);
|
|
437
|
+
const checkedBuiltins = new Map();
|
|
438
|
+
for (const { from, dependency } of typedDependencies) {
|
|
439
|
+
charge(4 + dependency.contextId.length);
|
|
440
|
+
if (!selected.has(from.contextId))
|
|
441
|
+
continue;
|
|
442
|
+
const closure = selectedClosure(dependency.contextId), type = dependency.type;
|
|
443
|
+
if (!closure)
|
|
444
|
+
return fail('type-dependency-context', 'A semantic type dependency has no checked context closure', 'unresolved', from);
|
|
445
|
+
if (type.kind === 'component') {
|
|
446
|
+
const receipt = closure.byComponent.get(type.id), node = closure.context.lookup(type.id);
|
|
447
|
+
if (!receipt || receipt.scope !== 'local-component-premises' || node.kind !== 'found'
|
|
448
|
+
|| node.node.kind !== 'simpleType' && node.node.kind !== 'complexType')
|
|
449
|
+
return fail('type-component-validity', 'A type dependency lacks matching semantic component construction', 'unresolved', closure.context, type.id);
|
|
450
|
+
}
|
|
451
|
+
else if (type.kind === 'original-generated') {
|
|
452
|
+
const receipt = closure.byScalarSlot.get(type.owner);
|
|
453
|
+
if (!receipt)
|
|
454
|
+
return fail('scalar-slot-validity', 'A type dependency lacks matching scalar-slot construction', 'unresolved', closure.context, type.owner);
|
|
455
|
+
assertOriginalGeneratedScalarReceipt(closure.context, receipt);
|
|
456
|
+
}
|
|
457
|
+
else {
|
|
458
|
+
const namespace = type.name.namespace, local = type.name.local;
|
|
459
|
+
charge(4);
|
|
460
|
+
let namespaces = checkedBuiltins.get(closure.context);
|
|
461
|
+
if (!namespaces) {
|
|
462
|
+
charge(4);
|
|
463
|
+
namespaces = new Map();
|
|
464
|
+
checkedBuiltins.set(closure.context, namespaces);
|
|
465
|
+
}
|
|
466
|
+
charge(4 + namespace.length);
|
|
467
|
+
let known = namespaces.get(namespace);
|
|
468
|
+
if (!known) {
|
|
469
|
+
charge(4);
|
|
470
|
+
known = new Set();
|
|
471
|
+
namespaces.set(namespace, known);
|
|
472
|
+
}
|
|
473
|
+
charge(4 + local.length);
|
|
474
|
+
if (!known.has(local)) {
|
|
475
|
+
if (resolveSemanticType(closure.context, type).kind !== 'builtin')
|
|
476
|
+
return fail('builtin-type-dependency', 'A builtin dependency lacks its exact builtin identity', 'unresolved', closure.context);
|
|
477
|
+
charge(2 + local.length);
|
|
478
|
+
known.add(local);
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
// Correspondence computations retain exact scalar premises too. A local
|
|
483
|
+
// type owner must have checked that same property in that same context.
|
|
484
|
+
const discharged = (contextId, rule, component) => {
|
|
485
|
+
charge(4 + contextId.length);
|
|
486
|
+
const closure = selectedClosure(contextId);
|
|
487
|
+
if (rule === mixedRule)
|
|
488
|
+
return closure !== undefined && mixedFacts.get(closure.context)?.has(component) === true;
|
|
489
|
+
const owner = closure?.byComponent.get(component);
|
|
490
|
+
for (const checked of owner?.discharged ?? []) {
|
|
491
|
+
charge(3 + checked.rule.length + checked.component.length + checked.contextId.length);
|
|
492
|
+
if (checked.rule === rule && checked.component === component && checked.contextId === contextId)
|
|
493
|
+
return true;
|
|
494
|
+
}
|
|
495
|
+
return false;
|
|
496
|
+
};
|
|
497
|
+
for (const pending of deferred) {
|
|
498
|
+
charge();
|
|
499
|
+
if (!selected.has(pending.context.contextId))
|
|
500
|
+
continue;
|
|
501
|
+
const obligation = pending.obligation;
|
|
502
|
+
if (!discharged(obligation.contextId, obligation.rule, obligation.component))
|
|
503
|
+
return fail(obligation.rule, 'An original-context scalar prerequisite lacks concrete aggregate discharge', 'unresolved', pending.context, obligation.component);
|
|
504
|
+
}
|
|
505
|
+
for (const step of proof)
|
|
506
|
+
for (const pending of step.correspondence.scalarObligations) {
|
|
507
|
+
if (!discharged(pending.contextId, pending.obligation.rule, pending.obligation.component))
|
|
508
|
+
return fail(pending.obligation.rule, 'A correspondence scalar premise lacks concrete aggregate discharge', 'unresolved', actual, pending.obligation.component);
|
|
509
|
+
}
|
|
510
|
+
};
|
|
511
|
+
return { actualClosure, actualNotations, actualFrontier, inspect, primitive, closures, notationReceipts, validateAggregate };
|
|
512
|
+
}
|
|
513
|
+
const frontierOwners = new WeakMap();
|
|
514
|
+
/** Internal native collection authority shared by supplied verification and research construction. */
|
|
515
|
+
export function prepareFiniteRe01Frontier(actual) {
|
|
516
|
+
assertSemanticContext(actual);
|
|
517
|
+
const b = actual.budget;
|
|
518
|
+
return b.guard(() => {
|
|
519
|
+
try {
|
|
520
|
+
const owner = createNativeFrontierOwner(actual);
|
|
521
|
+
b.chargeWork(6);
|
|
522
|
+
const session = Object.freeze({ kind: 'native-frontier-session', actual: owner.actualFrontier,
|
|
523
|
+
inspectCandidate: (hypothesis) => b.guard(() => {
|
|
524
|
+
try {
|
|
525
|
+
return owner.inspect(hypothesis);
|
|
526
|
+
}
|
|
527
|
+
catch (error) {
|
|
528
|
+
if (error instanceof VerificationAbort)
|
|
529
|
+
return error.result;
|
|
530
|
+
throw error;
|
|
531
|
+
}
|
|
532
|
+
}) });
|
|
533
|
+
frontierOwners.set(session, owner);
|
|
534
|
+
return session;
|
|
535
|
+
}
|
|
536
|
+
catch (error) {
|
|
537
|
+
if (error instanceof VerificationAbort)
|
|
538
|
+
return error.result;
|
|
539
|
+
throw error;
|
|
540
|
+
}
|
|
541
|
+
});
|
|
542
|
+
}
|
|
543
|
+
export function assertFiniteCandidateReceipt(actual, receipt) {
|
|
544
|
+
assertSemanticContext(actual);
|
|
545
|
+
if (issued.get(receipt) !== actual)
|
|
546
|
+
throw new TypeError('Unauthenticated finite candidate receipt');
|
|
547
|
+
}
|
|
548
|
+
export function assertFinitePrimitiveReceipt(actual, receipt) {
|
|
549
|
+
assertSemanticContext(actual);
|
|
550
|
+
if (issuedPrimitive.get(receipt) !== actual)
|
|
551
|
+
throw new TypeError('Unauthenticated finite primitive receipt');
|
|
552
|
+
}
|
|
553
|
+
export function verifyFiniteRe01Evidence(actual, target, supplied) {
|
|
554
|
+
return verifyFiniteRe01EvidenceWithFrontier(actual, target, supplied);
|
|
555
|
+
}
|
|
556
|
+
/** Reuse native actual preparation within one authenticated research request. */
|
|
557
|
+
export function verifyFiniteRe01EvidenceWithFrontier(actual, target, supplied, prepared) {
|
|
558
|
+
assertSemanticContext(actual);
|
|
559
|
+
const b = actual.budget, charge = b.chargeWork;
|
|
560
|
+
return b.guard(() => {
|
|
561
|
+
const fail = (rule, message, kind = 'invalid-evidence', context = actual, component) => {
|
|
562
|
+
charge(16 + rule.length + message.length + (component?.length ?? 0));
|
|
563
|
+
throw new VerificationAbort(Object.freeze({ kind, rule, message, contextId: context.contextId, component }));
|
|
564
|
+
};
|
|
565
|
+
const record = (value, field) => {
|
|
566
|
+
charge(50 + field.length);
|
|
567
|
+
if (!value || typeof value !== 'object')
|
|
568
|
+
return fail('evidence-syntax', 'Expected a finite data record');
|
|
569
|
+
const property = Object.getOwnPropertyDescriptor(value, field);
|
|
570
|
+
if (!property || !('value' in property))
|
|
571
|
+
return fail('evidence-syntax', 'Evidence fields must be own data properties');
|
|
572
|
+
return property.value;
|
|
573
|
+
};
|
|
574
|
+
try {
|
|
575
|
+
if (actual.kind !== 'actual' || actual.membership !== 'complete-actual-plus-additions')
|
|
576
|
+
return fail('actual-environment', 'A complete immutable original context is required');
|
|
577
|
+
const rootId = record(supplied, 'root'), sourceNodes = record(supplied, 'nodes');
|
|
578
|
+
const primitiveRoot = rootId !== null && typeof rootId === 'object' && record(rootId, 'kind') === 'primitive-no-change';
|
|
579
|
+
if ((!primitiveRoot && (typeof rootId !== 'string' || !rootId)) || !Array.isArray(sourceNodes))
|
|
580
|
+
return fail('evidence-syntax', 'Evidence requires a root ID or primitive marker and finite node array');
|
|
581
|
+
b.reserveNodes(sourceNodes.length);
|
|
582
|
+
charge(6 + (typeof rootId === 'string' ? rootId.length : 19));
|
|
583
|
+
const nodes = new Map();
|
|
584
|
+
const subjects = new Map();
|
|
585
|
+
for (let index = 0; index < sourceNodes.length; index++) {
|
|
586
|
+
// Read the caller's array as bounded own data, never through its
|
|
587
|
+
// iterator or an indexed getter. Context handles are authenticated
|
|
588
|
+
// below and intentionally are not cloned as ordinary data.
|
|
589
|
+
charge(24);
|
|
590
|
+
const raw = record(sourceNodes, String(index));
|
|
591
|
+
const parent = record(raw, 'parent'), context = record(raw, 'context');
|
|
592
|
+
try {
|
|
593
|
+
assertSemanticContext(parent);
|
|
594
|
+
assertSemanticContext(context);
|
|
595
|
+
}
|
|
596
|
+
catch {
|
|
597
|
+
return fail('evidence-context', 'Evidence contains an unauthenticated context');
|
|
598
|
+
}
|
|
599
|
+
if (!contextsShareRequest(actual, parent) || !contextsShareRequest(actual, context))
|
|
600
|
+
return fail('evidence-context', 'Evidence belongs to another semantic request');
|
|
601
|
+
const readData = () => {
|
|
602
|
+
try {
|
|
603
|
+
charge(12);
|
|
604
|
+
return b.freeze(b.snapshot({ id: record(raw, 'id'), target: record(raw, 'target'), intermediate: record(raw, 'intermediate'),
|
|
605
|
+
ancestor: record(raw, 'ancestor'), premises: record(raw, 'premises') }));
|
|
606
|
+
}
|
|
607
|
+
catch (error) {
|
|
608
|
+
if (error instanceof TypeError)
|
|
609
|
+
return fail('evidence-syntax', 'Evidence must contain finite immutable data');
|
|
610
|
+
throw error;
|
|
611
|
+
}
|
|
612
|
+
};
|
|
613
|
+
const data = readData();
|
|
614
|
+
if (typeof data.id !== 'string' || !data.id || typeof data.target !== 'string' || typeof data.intermediate !== 'string'
|
|
615
|
+
|| !data.ancestor || typeof data.ancestor !== 'object' || !Array.isArray(data.premises))
|
|
616
|
+
return fail('evidence-syntax', 'Malformed proof subject or premises');
|
|
617
|
+
try {
|
|
618
|
+
resolveSemanticType(parent, data.ancestor);
|
|
619
|
+
}
|
|
620
|
+
catch (error) {
|
|
621
|
+
if (error instanceof SemanticContextAccessError || error instanceof TypeError)
|
|
622
|
+
return fail('evidence-syntax', 'Malformed evidence ancestor reference');
|
|
623
|
+
throw error;
|
|
624
|
+
}
|
|
625
|
+
for (const premise of data.premises) {
|
|
626
|
+
charge();
|
|
627
|
+
if (typeof premise !== 'string')
|
|
628
|
+
return fail('evidence-syntax', 'Proof references must be evidence IDs');
|
|
629
|
+
}
|
|
630
|
+
charge(6 + data.id.length + data.target.length);
|
|
631
|
+
if (nodes.has(data.id))
|
|
632
|
+
return fail('duplicate-evidence-id', 'Evidence IDs must be unique');
|
|
633
|
+
const claims = subjects.get(parent) ?? new Set();
|
|
634
|
+
if (claims.has(data.target))
|
|
635
|
+
return fail('duplicate-proof-subject', 'A proof subject has multiple supplied certificates');
|
|
636
|
+
claims.add(data.target);
|
|
637
|
+
subjects.set(parent, claims);
|
|
638
|
+
const item = Object.freeze({ ...data, parent, context });
|
|
639
|
+
nodes.set(item.id, item);
|
|
640
|
+
}
|
|
641
|
+
const root = typeof rootId === 'string' ? nodes.get(rootId) : undefined;
|
|
642
|
+
if (!primitiveRoot && (!root || root.parent !== actual || root.target !== target))
|
|
643
|
+
return fail('evidence-root', 'Root must prove the requested original target');
|
|
644
|
+
for (const item of nodes.values()) {
|
|
645
|
+
charge();
|
|
646
|
+
if (!isSemanticCandidateOf(item.parent, item.context))
|
|
647
|
+
return fail('evidence-context', 'Candidate must be an authenticated direct child of its declared parent');
|
|
648
|
+
}
|
|
649
|
+
// Declared proof dependencies are a finite DAG; component recursion is
|
|
650
|
+
// scheduled below and never substitutes for this proof check.
|
|
651
|
+
charge(3);
|
|
652
|
+
const colors = new Map();
|
|
653
|
+
for (const entry of nodes.values()) {
|
|
654
|
+
if (colors.has(entry.id))
|
|
655
|
+
continue;
|
|
656
|
+
charge(4);
|
|
657
|
+
const stack = [{ id: entry.id, index: 0 }];
|
|
658
|
+
while (stack.length) {
|
|
659
|
+
charge(3);
|
|
660
|
+
const frame = stack[stack.length - 1], item = nodes.get(frame.id);
|
|
661
|
+
colors.set(frame.id, 'active');
|
|
662
|
+
if (frame.index === item.premises.length) {
|
|
663
|
+
colors.set(frame.id, 'done');
|
|
664
|
+
stack.pop();
|
|
665
|
+
continue;
|
|
666
|
+
}
|
|
667
|
+
const next = item.premises[frame.index++];
|
|
668
|
+
if (!nodes.has(next))
|
|
669
|
+
return fail('missing-proof-reference', 'A declared proof reference has no evidence node');
|
|
670
|
+
if (colors.get(next) === 'active')
|
|
671
|
+
return fail('proof-cycle', 'An active proof node cannot justify its own premise', 'unresolved', item.context, item.target);
|
|
672
|
+
if (!colors.has(next)) {
|
|
673
|
+
charge(3);
|
|
674
|
+
stack.push({ id: next, index: 0 });
|
|
675
|
+
}
|
|
676
|
+
}
|
|
677
|
+
}
|
|
678
|
+
const session = prepared ?? prepareFiniteRe01Frontier(actual);
|
|
679
|
+
if (session.kind !== 'native-frontier-session')
|
|
680
|
+
throw new VerificationAbort(session);
|
|
681
|
+
const owner = frontierOwners.get(session);
|
|
682
|
+
if (!owner || session.actual.context !== actual)
|
|
683
|
+
return fail('evidence-context', 'Frontier session belongs to another actual context');
|
|
684
|
+
const { actualClosure, actualNotations, primitive, notationReceipts } = owner;
|
|
685
|
+
let targetRequirement;
|
|
686
|
+
for (const requirement of actualClosure.requirements) {
|
|
687
|
+
charge(2 + requirement.target.length + target.length);
|
|
688
|
+
if (requirement.target === target)
|
|
689
|
+
targetRequirement = requirement;
|
|
690
|
+
}
|
|
691
|
+
if (!targetRequirement)
|
|
692
|
+
return fail('target-rule', 'The selected original target has no RE01 extension obligation');
|
|
693
|
+
charge(5);
|
|
694
|
+
const completed = new Set(), active = new Set(), proof = [];
|
|
695
|
+
const execute = (start) => {
|
|
696
|
+
charge(6);
|
|
697
|
+
const stack = [{ node: start, index: 0, used: [], primitive: [] }];
|
|
698
|
+
while (stack.length) {
|
|
699
|
+
charge(3);
|
|
700
|
+
const frame = stack[stack.length - 1], item = frame.node;
|
|
701
|
+
if (completed.has(item.id)) {
|
|
702
|
+
stack.pop();
|
|
703
|
+
continue;
|
|
704
|
+
}
|
|
705
|
+
if (!frame.closure) {
|
|
706
|
+
if (active.has(item.id))
|
|
707
|
+
return fail('proof-cycle', 'An active proof premise cannot count as checked', 'unresolved', item.parent, item.target);
|
|
708
|
+
charge();
|
|
709
|
+
active.add(item.id);
|
|
710
|
+
const frontier = session.inspectCandidate(item);
|
|
711
|
+
if (frontier.kind !== 'inspected-frontier')
|
|
712
|
+
throw new VerificationAbort(frontier);
|
|
713
|
+
frame.correspondence = frontier.correspondence;
|
|
714
|
+
frame.closure = owner.closures.get(item.context.contextId);
|
|
715
|
+
}
|
|
716
|
+
if (frame.index < frame.closure.requirements.length) {
|
|
717
|
+
const requirement = frame.closure.requirements[frame.index++];
|
|
718
|
+
if (primitive(item.context, requirement)) {
|
|
719
|
+
charge();
|
|
720
|
+
frame.primitive.push(requirement.target);
|
|
721
|
+
continue;
|
|
722
|
+
}
|
|
723
|
+
let child;
|
|
724
|
+
for (const id of item.premises) {
|
|
725
|
+
charge();
|
|
726
|
+
const offered = nodes.get(id);
|
|
727
|
+
if (offered.parent === item.context && offered.target === requirement.target)
|
|
728
|
+
child = offered;
|
|
729
|
+
}
|
|
730
|
+
if (!child)
|
|
731
|
+
return fail('missing-nested-evidence', 'A generated RE01 obligation lacks matching finite evidence', 'unresolved', item.context, requirement.target);
|
|
732
|
+
charge();
|
|
733
|
+
frame.used.push(child.id);
|
|
734
|
+
if (!completed.has(child.id)) {
|
|
735
|
+
charge(6);
|
|
736
|
+
stack.push({ node: child, index: 0, used: [], primitive: [] });
|
|
737
|
+
}
|
|
738
|
+
continue;
|
|
739
|
+
}
|
|
740
|
+
for (const id of item.premises) {
|
|
741
|
+
charge(1 + frame.used.length * (1 + id.length));
|
|
742
|
+
if (!frame.used.includes(id))
|
|
743
|
+
return fail('unused-proof-premise', 'A supplied premise does not match a generated nested obligation');
|
|
744
|
+
}
|
|
745
|
+
charge(12 + frame.used.length + frame.primitive.length);
|
|
746
|
+
proof.push(Object.freeze({ evidence: item.id, parentContext: item.parent.contextId, contextId: item.context.contextId, target: item.target,
|
|
747
|
+
correspondence: frame.correspondence, components: frame.closure.components,
|
|
748
|
+
scalarSlots: frame.closure.scalarSlots,
|
|
749
|
+
notations: notationReceipts.get(item.context),
|
|
750
|
+
identityConstraints: frame.closure.identityConstraints,
|
|
751
|
+
premises: Object.freeze(frame.used), primitiveNoChange: Object.freeze(frame.primitive) }));
|
|
752
|
+
completed.add(item.id);
|
|
753
|
+
active.delete(item.id);
|
|
754
|
+
stack.pop();
|
|
755
|
+
}
|
|
756
|
+
};
|
|
757
|
+
if (primitiveRoot && !primitive(actual, targetRequirement))
|
|
758
|
+
return fail('primitive-no-change', 'The requested target is not a qualified primitive extension');
|
|
759
|
+
if (root)
|
|
760
|
+
execute(root);
|
|
761
|
+
charge();
|
|
762
|
+
const actualPrimitiveNoChange = [];
|
|
763
|
+
for (const requirement of actualClosure.requirements) {
|
|
764
|
+
if (primitive(actual, requirement)) {
|
|
765
|
+
charge();
|
|
766
|
+
actualPrimitiveNoChange.push(requirement.target);
|
|
767
|
+
continue;
|
|
768
|
+
}
|
|
769
|
+
let evidence;
|
|
770
|
+
for (const item of nodes.values()) {
|
|
771
|
+
charge();
|
|
772
|
+
if (item.parent === actual && item.target === requirement.target)
|
|
773
|
+
evidence = item;
|
|
774
|
+
}
|
|
775
|
+
if (!evidence)
|
|
776
|
+
return fail('missing-actual-evidence', 'An original actual RE01 obligation lacks finite evidence', 'unresolved', actual, requirement.target);
|
|
777
|
+
execute(evidence);
|
|
778
|
+
}
|
|
779
|
+
if (completed.size !== nodes.size)
|
|
780
|
+
return fail('unused-proof-node', 'Every supplied proof node must match a required obligation');
|
|
781
|
+
owner.validateAggregate(proof);
|
|
782
|
+
charge(20 + proof.length + actualPrimitiveNoChange.length);
|
|
783
|
+
charge(12);
|
|
784
|
+
const common = { authority: 'RE01-finite-evidence-v1', domain: RE01_DERIVATION_DOMAIN,
|
|
785
|
+
actualContextId: actual.contextId, target,
|
|
786
|
+
actualComponents: actualClosure.components, actualPrimitiveNoChange: Object.freeze(actualPrimitiveNoChange), proof: Object.freeze(proof),
|
|
787
|
+
actualScalarSlots: actualClosure.scalarSlots,
|
|
788
|
+
actualNotations, actualIdentityConstraints: actualClosure.identityConstraints };
|
|
789
|
+
if (primitiveRoot) {
|
|
790
|
+
charge(12);
|
|
791
|
+
const result = Object.freeze({ ...common, kind: 'checked-primitive',
|
|
792
|
+
scope: 'primitive-no-change-and-finite-evidence', root: 'primitive-no-change',
|
|
793
|
+
claims: Object.freeze({ actualObligations: 'checked', primitiveTarget: 'checked', universalCoverage: false,
|
|
794
|
+
completeNegativeAnswer: false, searchTermination: false }) });
|
|
795
|
+
issuedPrimitive.set(result, actual);
|
|
796
|
+
return result;
|
|
797
|
+
}
|
|
798
|
+
const result = Object.freeze({ ...common, kind: 'checked-candidate',
|
|
799
|
+
scope: 'supplied-construction-and-finite-evidence', root: root.id,
|
|
800
|
+
claims: Object.freeze({ actualObligations: 'checked', suppliedCandidate: 'checked', universalCoverage: false, completeNegativeAnswer: false, searchTermination: false }) });
|
|
801
|
+
issued.set(result, actual);
|
|
802
|
+
return result;
|
|
803
|
+
}
|
|
804
|
+
catch (error) {
|
|
805
|
+
if (error instanceof VerificationAbort)
|
|
806
|
+
return error.result;
|
|
807
|
+
throw error;
|
|
808
|
+
}
|
|
809
|
+
});
|
|
810
|
+
}
|
|
811
|
+
/** Product direct strategy: no hypothetical candidates and no search-negative claim. */
|
|
812
|
+
export function verifyDirectActualSchema(actual) {
|
|
813
|
+
assertSemanticContext(actual);
|
|
814
|
+
return actual.budget.guard(() => {
|
|
815
|
+
try {
|
|
816
|
+
const owner = createNativeFrontierOwner(actual);
|
|
817
|
+
actual.budget.chargeWork(8 + owner.actualFrontier.requirements.length * 2);
|
|
818
|
+
const unresolved = owner.actualFrontier.requirements.filter(item => !item.primitive).map(item => item.target);
|
|
819
|
+
// Aggregate discharge is mandatory even when this strategy cannot prove RE01.
|
|
820
|
+
owner.validateAggregate([]);
|
|
821
|
+
return Object.freeze({ kind: unresolved.length ? 'inconclusive-direct' : 'checked-direct',
|
|
822
|
+
frontier: owner.actualFrontier, unresolved: Object.freeze(unresolved) });
|
|
823
|
+
}
|
|
824
|
+
catch (error) {
|
|
825
|
+
if (error instanceof VerificationAbort)
|
|
826
|
+
return error.result;
|
|
827
|
+
throw error;
|
|
828
|
+
}
|
|
829
|
+
});
|
|
830
|
+
}
|