@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.
Files changed (422) hide show
  1. package/README.md +81 -35
  2. package/dist/app/generateApp.d.ts +0 -1
  3. package/dist/app/generateApp.js +8 -6
  4. package/dist/app/generateCheckedApp.d.ts +38 -0
  5. package/dist/app/generateCheckedApp.js +108 -0
  6. package/dist/checkedPipeline.d.ts +155 -0
  7. package/dist/checkedPipeline.js +448 -0
  8. package/dist/checkedPlanning.d.ts +123 -0
  9. package/dist/checkedPlanning.js +245 -0
  10. package/dist/cli.d.ts +0 -1
  11. package/dist/cli.js +123 -5
  12. package/dist/client/checkedDirectRuntime.d.ts +96 -0
  13. package/dist/client/checkedDirectRuntime.js +43 -0
  14. package/dist/client/directClientRuntime.d.ts +74 -0
  15. package/dist/client/directClientRuntime.js +165 -0
  16. package/dist/client/directClientVersion.d.ts +6 -0
  17. package/dist/client/directClientVersion.js +6 -0
  18. package/dist/client/generateClient.d.ts +0 -1
  19. package/dist/client/generateClient.js +26 -12
  20. package/dist/client/generateDirectClient.d.ts +32 -0
  21. package/dist/client/generateDirectClient.js +268 -0
  22. package/dist/client/generateOperations.d.ts +0 -1
  23. package/dist/client/generateTypes.d.ts +0 -1
  24. package/dist/client/generateUtils.d.ts +0 -1
  25. package/dist/client/generateUtils.js +3 -1
  26. package/dist/compiler/applicationGroups.d.ts +53 -0
  27. package/dist/compiler/applicationGroups.js +403 -0
  28. package/dist/compiler/buildCanonicalGraph.d.ts +6 -0
  29. package/dist/compiler/buildCanonicalGraph.js +381 -0
  30. package/dist/compiler/canonicalGraph.d.ts +197 -0
  31. package/dist/compiler/canonicalGraph.js +37 -0
  32. package/dist/compiler/catalogErrors.d.ts +17 -0
  33. package/dist/compiler/catalogErrors.js +86 -0
  34. package/dist/compiler/catalogProvenance.d.ts +14 -0
  35. package/dist/compiler/catalogProvenance.js +229 -0
  36. package/dist/compiler/checkedAssessment.d.ts +90 -0
  37. package/dist/compiler/checkedAssessment.js +300 -0
  38. package/dist/compiler/checkedComponentSource.d.ts +16 -0
  39. package/dist/compiler/checkedComponentSource.js +31 -0
  40. package/dist/compiler/checkedSourcePreparation.d.ts +72 -0
  41. package/dist/compiler/checkedSourcePreparation.js +202 -0
  42. package/dist/compiler/complexTypeContent.d.ts +58 -0
  43. package/dist/compiler/complexTypeContent.js +558 -0
  44. package/dist/compiler/componentCorrespondence.d.ts +32 -0
  45. package/dist/compiler/componentCorrespondence.js +140 -0
  46. package/dist/compiler/componentRecordProjection.d.ts +109 -0
  47. package/dist/compiler/componentRecordProjection.js +319 -0
  48. package/dist/compiler/componentSoapPreparation.d.ts +20 -0
  49. package/dist/compiler/componentSoapPreparation.js +36 -0
  50. package/dist/compiler/composeCanonicalGraph.d.ts +68 -0
  51. package/dist/compiler/composeCanonicalGraph.js +252 -0
  52. package/dist/compiler/dataOwnership.d.ts +21 -0
  53. package/dist/compiler/dataOwnership.js +167 -0
  54. package/dist/compiler/datatypeValues.d.ts +46 -0
  55. package/dist/compiler/datatypeValues.js +275 -0
  56. package/dist/compiler/directCodec.d.ts +116 -0
  57. package/dist/compiler/directCodec.js +377 -0
  58. package/dist/compiler/directExecutionPolicy.d.ts +9 -0
  59. package/dist/compiler/directExecutionPolicy.js +17 -0
  60. package/dist/compiler/directOperation.d.ts +114 -0
  61. package/dist/compiler/directOperation.js +373 -0
  62. package/dist/compiler/directSoap.d.ts +66 -0
  63. package/dist/compiler/directSoap.js +391 -0
  64. package/dist/compiler/directSoapSource.d.ts +38 -0
  65. package/dist/compiler/directSoapSource.js +233 -0
  66. package/dist/compiler/directSourceCapsule.d.ts +169 -0
  67. package/dist/compiler/directSourceCapsule.js +727 -0
  68. package/dist/compiler/directStructure.d.ts +128 -0
  69. package/dist/compiler/directStructure.js +543 -0
  70. package/dist/compiler/directStructurePlan.d.ts +149 -0
  71. package/dist/compiler/directStructurePlan.js +623 -0
  72. package/dist/compiler/directValues.d.ts +128 -0
  73. package/dist/compiler/directValues.js +1116 -0
  74. package/dist/compiler/finiteRe01Construction.d.ts +69 -0
  75. package/dist/compiler/finiteRe01Construction.js +422 -0
  76. package/dist/compiler/finiteRe01Verification.d.ts +218 -0
  77. package/dist/compiler/finiteRe01Verification.js +1217 -0
  78. package/dist/compiler/generateCatalog.d.ts +0 -1
  79. package/dist/compiler/graphTraversal.d.ts +10 -0
  80. package/dist/compiler/graphTraversal.js +37 -0
  81. package/dist/compiler/hypotheticalScopedIdentity.d.ts +22 -0
  82. package/dist/compiler/hypotheticalScopedIdentity.js +81 -0
  83. package/dist/compiler/occurrenceAnalysis.d.ts +66 -0
  84. package/dist/compiler/occurrenceAnalysis.js +316 -0
  85. package/dist/compiler/originalSourceMembership.d.ts +5 -0
  86. package/dist/compiler/originalSourceMembership.js +31 -0
  87. package/dist/compiler/particleAttribution.d.ts +16 -0
  88. package/dist/compiler/particleAttribution.js +494 -0
  89. package/dist/compiler/particleDeclarationConsistency.d.ts +23 -0
  90. package/dist/compiler/particleDeclarationConsistency.js +206 -0
  91. package/dist/compiler/particleExtension.d.ts +21 -0
  92. package/dist/compiler/particleExtension.js +123 -0
  93. package/dist/compiler/particleLocalAssessment.d.ts +19 -0
  94. package/dist/compiler/particleLocalAssessment.js +92 -0
  95. package/dist/compiler/particleRestriction.d.ts +23 -0
  96. package/dist/compiler/particleRestriction.js +494 -0
  97. package/dist/compiler/particleSemanticView.d.ts +51 -0
  98. package/dist/compiler/particleSemanticView.js +310 -0
  99. package/dist/compiler/particleWildcardRelation.d.ts +87 -0
  100. package/dist/compiler/particleWildcardRelation.js +143 -0
  101. package/dist/compiler/projectionScalar.d.ts +32 -0
  102. package/dist/compiler/projectionScalar.js +184 -0
  103. package/dist/compiler/re01CandidateAssignments.d.ts +95 -0
  104. package/dist/compiler/re01CandidateAssignments.js +341 -0
  105. package/dist/compiler/re01CandidateCorrespondence.d.ts +85 -0
  106. package/dist/compiler/re01CandidateCorrespondence.js +701 -0
  107. package/dist/compiler/re01TypeProperties.d.ts +70 -0
  108. package/dist/compiler/re01TypeProperties.js +120 -0
  109. package/dist/compiler/re01TypePropertyValidation.d.ts +22 -0
  110. package/dist/compiler/re01TypePropertyValidation.js +161 -0
  111. package/dist/compiler/resolveCanonicalGraph.d.ts +41 -0
  112. package/dist/compiler/resolveCanonicalGraph.js +240 -0
  113. package/dist/compiler/scalarSchemaAssessment.d.ts +424 -0
  114. package/dist/compiler/scalarSchemaAssessment.js +5198 -0
  115. package/dist/compiler/schemaAttributeGroupProperties.d.ts +16 -0
  116. package/dist/compiler/schemaAttributeGroupProperties.js +53 -0
  117. package/dist/compiler/schemaAttributeProperties.d.ts +9 -0
  118. package/dist/compiler/schemaAttributeProperties.js +11 -0
  119. package/dist/compiler/schemaAttributeUses.d.ts +110 -0
  120. package/dist/compiler/schemaAttributeUses.js +798 -0
  121. package/dist/compiler/schemaBinaryWordReconstruction.d.ts +9 -0
  122. package/dist/compiler/schemaBinaryWordReconstruction.js +33 -0
  123. package/dist/compiler/schemaBuiltinFacets.d.ts +13 -0
  124. package/dist/compiler/schemaBuiltinFacets.js +51 -0
  125. package/dist/compiler/schemaCalendarImages.d.ts +7 -0
  126. package/dist/compiler/schemaCalendarImages.js +204 -0
  127. package/dist/compiler/schemaCalendarLanguage.d.ts +10 -0
  128. package/dist/compiler/schemaCalendarLanguage.js +227 -0
  129. package/dist/compiler/schemaCompiler.d.ts +0 -1
  130. package/dist/compiler/schemaComponentEquality.d.ts +27 -0
  131. package/dist/compiler/schemaComponentEquality.js +446 -0
  132. package/dist/compiler/schemaConstructionAssessment.d.ts +79 -0
  133. package/dist/compiler/schemaConstructionAssessment.js +745 -0
  134. package/dist/compiler/schemaDatatypeValues.d.ts +3 -0
  135. package/dist/compiler/schemaDatatypeValues.js +2 -0
  136. package/dist/compiler/schemaDecimalLanguage.d.ts +6 -0
  137. package/dist/compiler/schemaDecimalLanguage.js +102 -0
  138. package/dist/compiler/schemaDeclarationPrimitives.d.ts +39 -0
  139. package/dist/compiler/schemaDeclarationPrimitives.js +211 -0
  140. package/dist/compiler/schemaDocumentSyntax.d.ts +54 -0
  141. package/dist/compiler/schemaDocumentSyntax.js +294 -0
  142. package/dist/compiler/schemaDurationLanguage.d.ts +10 -0
  143. package/dist/compiler/schemaDurationLanguage.js +170 -0
  144. package/dist/compiler/schemaElementInstance.d.ts +30 -0
  145. package/dist/compiler/schemaElementInstance.js +45 -0
  146. package/dist/compiler/schemaElementProperties.d.ts +15 -0
  147. package/dist/compiler/schemaElementProperties.js +23 -0
  148. package/dist/compiler/schemaEndpointWordCapacity.d.ts +35 -0
  149. package/dist/compiler/schemaEndpointWordCapacity.js +39 -0
  150. package/dist/compiler/schemaExactCalendar.d.ts +72 -0
  151. package/dist/compiler/schemaExactCalendar.js +264 -0
  152. package/dist/compiler/schemaFacetAnnotation.d.ts +31 -0
  153. package/dist/compiler/schemaFacetAnnotation.js +199 -0
  154. package/dist/compiler/schemaGeneratedScalarShape.d.ts +34 -0
  155. package/dist/compiler/schemaGeneratedScalarShape.js +178 -0
  156. package/dist/compiler/schemaIdentityConstraints.d.ts +72 -0
  157. package/dist/compiler/schemaIdentityConstraints.js +362 -0
  158. package/dist/compiler/schemaIeeeLanguage.d.ts +42 -0
  159. package/dist/compiler/schemaIeeeLanguage.js +759 -0
  160. package/dist/compiler/schemaIntegerImages.d.ts +10 -0
  161. package/dist/compiler/schemaIntegerImages.js +113 -0
  162. package/dist/compiler/schemaLexicalPredicates.d.ts +28 -0
  163. package/dist/compiler/schemaLexicalPredicates.js +63 -0
  164. package/dist/compiler/schemaNotationProperties.d.ts +31 -0
  165. package/dist/compiler/schemaNotationProperties.js +84 -0
  166. package/dist/compiler/schemaNumericImageConditions.d.ts +23 -0
  167. package/dist/compiler/schemaNumericImageConditions.js +66 -0
  168. package/dist/compiler/schemaParticleWildcardProperties.d.ts +19 -0
  169. package/dist/compiler/schemaParticleWildcardProperties.js +43 -0
  170. package/dist/compiler/schemaPattern.d.ts +1061 -0
  171. package/dist/compiler/schemaPattern.js +581 -0
  172. package/dist/compiler/schemaRegularLanguage.d.ts +66 -0
  173. package/dist/compiler/schemaRegularLanguage.js +1166 -0
  174. package/dist/compiler/schemaScalarContext.d.ts +85 -0
  175. package/dist/compiler/schemaScalarContext.js +78 -0
  176. package/dist/compiler/schemaScalarKernel.d.ts +181 -0
  177. package/dist/compiler/schemaScalarKernel.js +391 -0
  178. package/dist/compiler/schemaScalarWitnesses.d.ts +5 -0
  179. package/dist/compiler/schemaScalarWitnesses.js +118 -0
  180. package/dist/compiler/schemaSimpleTypeProperties.d.ts +94 -0
  181. package/dist/compiler/schemaSimpleTypeProperties.js +103 -0
  182. package/dist/compiler/schemaSourceGrammar.d.ts +26 -0
  183. package/dist/compiler/schemaSourceGrammar.js +290 -0
  184. package/dist/compiler/schemaSourceLexical.d.ts +3 -0
  185. package/dist/compiler/schemaSourceLexical.js +12 -0
  186. package/dist/compiler/schemaSourceValues.d.ts +50 -0
  187. package/dist/compiler/schemaSourceValues.js +225 -0
  188. package/dist/compiler/schemaSourceWildcards.d.ts +27 -0
  189. package/dist/compiler/schemaSourceWildcards.js +249 -0
  190. package/dist/compiler/schemaSymbolicSequences.d.ts +15 -0
  191. package/dist/compiler/schemaSymbolicSequences.js +99 -0
  192. package/dist/compiler/schemaSymbolicValueSets.d.ts +31 -0
  193. package/dist/compiler/schemaSymbolicValueSets.js +149 -0
  194. package/dist/compiler/schemaSyntaxAssessment.d.ts +24 -0
  195. package/dist/compiler/schemaSyntaxAssessment.js +361 -0
  196. package/dist/compiler/schemaTemporalAliases.d.ts +5 -0
  197. package/dist/compiler/schemaTemporalAliases.js +195 -0
  198. package/dist/compiler/schemaTokenImages.d.ts +8 -0
  199. package/dist/compiler/schemaTokenImages.js +142 -0
  200. package/dist/compiler/schemaTypeIdentity.d.ts +38 -0
  201. package/dist/compiler/schemaTypeIdentity.js +80 -0
  202. package/dist/compiler/schemaTypeRelations.d.ts +37 -0
  203. package/dist/compiler/schemaTypeRelations.js +576 -0
  204. package/dist/compiler/schemaUri.d.ts +12 -0
  205. package/dist/compiler/schemaUri.js +103 -0
  206. package/dist/compiler/schemaValueContext.d.ts +25 -0
  207. package/dist/compiler/schemaValueContext.js +1 -0
  208. package/dist/compiler/schemaValueImages.d.ts +9 -0
  209. package/dist/compiler/schemaValueImages.js +142 -0
  210. package/dist/compiler/schemaValueSequences.d.ts +14 -0
  211. package/dist/compiler/schemaValueSequences.js +19 -0
  212. package/dist/compiler/semanticBudget.d.ts +67 -0
  213. package/dist/compiler/semanticBudget.js +193 -0
  214. package/dist/compiler/semanticCatalog.d.ts +121 -0
  215. package/dist/compiler/semanticCatalog.js +160 -0
  216. package/dist/compiler/semanticContext.d.ts +183 -0
  217. package/dist/compiler/semanticContext.js +1207 -0
  218. package/dist/compiler/semanticTypeDependencies.d.ts +7 -0
  219. package/dist/compiler/semanticTypeDependencies.js +64 -0
  220. package/dist/compiler/semanticTypeReference.d.ts +23 -0
  221. package/dist/compiler/semanticTypeReference.js +36 -0
  222. package/dist/compiler/shapeResolver.d.ts +1 -1
  223. package/dist/compiler/shapeResolver.js +7 -9
  224. package/dist/compiler/soapHeaders.d.ts +16 -0
  225. package/dist/compiler/soapHeaders.js +42 -0
  226. package/dist/compiler/sourceSchemaBinding.d.ts +25 -0
  227. package/dist/compiler/sourceSchemaBinding.js +39 -0
  228. package/dist/compiler/standardSchemaComponents.d.ts +71 -0
  229. package/dist/compiler/standardSchemaComponents.js +74 -0
  230. package/dist/compiler/standardSchemaConstruction.d.ts +20 -0
  231. package/dist/compiler/standardSchemaConstruction.js +34 -0
  232. package/dist/compiler/structuralCompanions.d.ts +15 -0
  233. package/dist/compiler/structuralCompanions.js +232 -0
  234. package/dist/compiler/validateSemanticGraph.d.ts +4 -0
  235. package/dist/compiler/validateSemanticGraph.js +376 -0
  236. package/dist/compiler/wildcardAlgebra.d.ts +25 -0
  237. package/dist/compiler/wildcardAlgebra.js +155 -0
  238. package/dist/compiler/wsdlPolicyRequirements.d.ts +43 -0
  239. package/dist/compiler/wsdlPolicyRequirements.js +239 -0
  240. package/dist/config.d.ts +0 -1
  241. package/dist/gateway/generateCheckedGateway.d.ts +32 -0
  242. package/dist/gateway/generateCheckedGateway.js +293 -0
  243. package/dist/gateway/generateGateway.d.ts +0 -1
  244. package/dist/gateway/generateGateway.js +2 -2
  245. package/dist/gateway/generators.d.ts +0 -1
  246. package/dist/gateway/helpers.d.ts +0 -1
  247. package/dist/generation/componentShape.d.ts +14 -0
  248. package/dist/generation/componentShape.js +269 -0
  249. package/dist/generation/preamble.d.ts +0 -1
  250. package/dist/generation/sourceLayout.d.ts +13 -0
  251. package/dist/generation/sourceLayout.js +40 -0
  252. package/dist/generation/writeGeneratedSource.d.ts +0 -1
  253. package/dist/index.d.ts +9 -1
  254. package/dist/index.js +3 -0
  255. package/dist/loader/fetch.d.ts +0 -1
  256. package/dist/loader/orderedSyntax.d.ts +84 -0
  257. package/dist/loader/orderedSyntax.js +222 -0
  258. package/dist/loader/resolutionDepth.d.ts +6 -0
  259. package/dist/loader/resolutionDepth.js +65 -0
  260. package/dist/loader/schemaInput.d.ts +80 -0
  261. package/dist/loader/schemaInput.js +249 -0
  262. package/dist/loader/schemaResources.d.ts +60 -0
  263. package/dist/loader/schemaResources.js +333 -0
  264. package/dist/loader/wsdlLoader.d.ts +0 -1
  265. package/dist/openapi/casing.d.ts +0 -1
  266. package/dist/openapi/generateOpenAPI.d.ts +0 -1
  267. package/dist/openapi/generateOpenAPI.js +2 -2
  268. package/dist/openapi/generatePaths.d.ts +0 -1
  269. package/dist/openapi/generateSchemas.d.ts +0 -1
  270. package/dist/openapi/security.d.ts +0 -1
  271. package/dist/pipeline.d.ts +6 -2
  272. package/dist/pipeline.js +13 -0
  273. package/dist/test/generateCheckedTests.d.ts +17 -0
  274. package/dist/test/generateCheckedTests.js +60 -0
  275. package/dist/test/generateTests.d.ts +0 -1
  276. package/dist/test/generateTests.js +2 -2
  277. package/dist/test/generators.d.ts +0 -1
  278. package/dist/test/mockData.d.ts +0 -1
  279. package/dist/test/mockData.js +20 -14
  280. package/dist/util/attributeWildcards.d.ts +0 -1
  281. package/dist/util/builder.d.ts +0 -1
  282. package/dist/util/catalogMeta.d.ts +0 -1
  283. package/dist/util/checkedCliDiagnostics.d.ts +11 -0
  284. package/dist/util/checkedCliDiagnostics.js +22 -0
  285. package/dist/util/cli.d.ts +0 -1
  286. package/dist/util/errors.d.ts +0 -1
  287. package/dist/util/imports.d.ts +0 -1
  288. package/dist/util/runtimeSource.d.ts +0 -1
  289. package/dist/util/runtimeSource.js +3 -5
  290. package/dist/util/securityConfig.d.ts +0 -1
  291. package/dist/util/streamConfig.d.ts +0 -1
  292. package/dist/util/tools.d.ts +0 -1
  293. package/dist/util/xmlWhitespace.d.ts +2 -0
  294. package/dist/util/xmlWhitespace.js +4 -0
  295. package/dist/xsd/primitives.d.ts +0 -1
  296. package/docs/agent-skill.md +2 -0
  297. package/docs/api-reference.md +1 -1
  298. package/docs/checked-gateway.md +210 -0
  299. package/docs/checked-generation.md +161 -0
  300. package/docs/cli-reference.md +43 -1
  301. package/docs/concepts.md +136 -1
  302. package/docs/configuration.md +5 -1
  303. package/docs/corpus.md +33 -0
  304. package/docs/direct-values.md +311 -0
  305. package/docs/examples/checked-forecast.wsdl +19 -0
  306. package/docs/gateway-guide.md +1 -1
  307. package/docs/generated-code.md +10 -5
  308. package/docs/mapping-contract.md +114 -0
  309. package/docs/migration-playbook.md +1 -1
  310. package/docs/output-anatomy.md +1 -1
  311. package/docs/start-here.md +8 -2
  312. package/docs/supported-patterns.md +17 -5
  313. package/docs/testing.md +117 -31
  314. package/llms.txt +7 -7
  315. package/package.json +79 -25
  316. package/src/generation/preambles/direct-client/typescript.preamble +3 -0
  317. package/src/runtime/checkedGatewayHost.tpl.txt +157 -0
  318. package/src/runtime/streamXml.ts +1 -1
  319. package/dist/app/generateApp.d.ts.map +0 -1
  320. package/dist/cli.d.ts.map +0 -1
  321. package/dist/client/generateClient.d.ts.map +0 -1
  322. package/dist/client/generateOperations.d.ts.map +0 -1
  323. package/dist/client/generateTypes.d.ts.map +0 -1
  324. package/dist/client/generateUtils.d.ts.map +0 -1
  325. package/dist/compiler/generateCatalog.d.ts.map +0 -1
  326. package/dist/compiler/schemaCompiler.d.ts.map +0 -1
  327. package/dist/compiler/shapeResolver.d.ts.map +0 -1
  328. package/dist/config.d.ts.map +0 -1
  329. package/dist/gateway/generateGateway.d.ts.map +0 -1
  330. package/dist/gateway/generators.d.ts.map +0 -1
  331. package/dist/gateway/helpers.d.ts.map +0 -1
  332. package/dist/generation/preamble.d.ts.map +0 -1
  333. package/dist/generation/writeGeneratedSource.d.ts.map +0 -1
  334. package/dist/index.d.ts.map +0 -1
  335. package/dist/loader/fetch.d.ts.map +0 -1
  336. package/dist/loader/wsdlLoader.d.ts.map +0 -1
  337. package/dist/openapi/casing.d.ts.map +0 -1
  338. package/dist/openapi/generateOpenAPI.d.ts.map +0 -1
  339. package/dist/openapi/generatePaths.d.ts.map +0 -1
  340. package/dist/openapi/generateSchemas.d.ts.map +0 -1
  341. package/dist/openapi/security.d.ts.map +0 -1
  342. package/dist/pipeline.d.ts.map +0 -1
  343. package/dist/runtime/jsonArray.d.ts +0 -24
  344. package/dist/runtime/jsonArray.d.ts.map +0 -1
  345. package/dist/runtime/jsonArray.js +0 -52
  346. package/dist/runtime/ndjson.d.ts +0 -24
  347. package/dist/runtime/ndjson.d.ts.map +0 -1
  348. package/dist/runtime/ndjson.js +0 -30
  349. package/dist/runtime/streamXml.d.ts +0 -45
  350. package/dist/runtime/streamXml.d.ts.map +0 -1
  351. package/dist/runtime/streamXml.js +0 -212
  352. package/dist/test/generateTests.d.ts.map +0 -1
  353. package/dist/test/generators.d.ts.map +0 -1
  354. package/dist/test/mockData.d.ts.map +0 -1
  355. package/dist/util/attributeWildcards.d.ts.map +0 -1
  356. package/dist/util/builder.d.ts.map +0 -1
  357. package/dist/util/catalogMeta.d.ts.map +0 -1
  358. package/dist/util/cli.d.ts.map +0 -1
  359. package/dist/util/errors.d.ts.map +0 -1
  360. package/dist/util/imports.d.ts.map +0 -1
  361. package/dist/util/runtimeSource.d.ts.map +0 -1
  362. package/dist/util/securityConfig.d.ts.map +0 -1
  363. package/dist/util/streamConfig.d.ts.map +0 -1
  364. package/dist/util/tools.d.ts.map +0 -1
  365. package/dist/xsd/primitives.d.ts.map +0 -1
  366. package/docs/AGENTS.md +0 -47
  367. package/docs/README.md +0 -56
  368. package/docs/architecture.md +0 -149
  369. package/docs/decisions/001-test-generation.md +0 -36
  370. package/docs/decisions/002-streamable-responses.md +0 -330
  371. package/docs/file-naming-and-path-organization.md +0 -213
  372. package/docs/releases/README.md +0 -94
  373. package/docs/releases/v0.20.0.md +0 -22
  374. package/docs/releases/v0.21.0.md +0 -30
  375. package/docs/releases/v0.22.0.md +0 -30
  376. package/docs/releases/v0.23.0.md +0 -31
  377. package/docs/releases/v0.24.0.md +0 -38
  378. package/docs/releases/v0.25.0.md +0 -31
  379. package/docs/releases/v0.25.2.md +0 -32
  380. package/docs/releases/v0.26.0.md +0 -32
  381. package/docs/releases/v0.27.0.md +0 -31
  382. package/docs/releases/v0.28.0.md +0 -32
  383. package/docs/releases/v0.29.0.md +0 -32
  384. package/docs/releases/v0.30.0.md +0 -30
  385. package/docs/releases/v0.30.1.md +0 -31
  386. package/docs/releases/v0.30.2.md +0 -30
  387. package/docs/releases/v0.30.3.md +0 -33
  388. package/docs/releases/v0.31.0.md +0 -33
  389. package/docs/releases/v0.32.0.md +0 -33
  390. package/docs/releases/v0.33.0.md +0 -34
  391. package/docs/releases/v0.34.0.md +0 -30
  392. package/docs/releases/v0.35.0.md +0 -33
  393. package/docs/releases/v0.36.0.md +0 -32
  394. package/docs/releases/v0.37.0.md +0 -33
  395. package/docs/releases/v0.38.0.md +0 -35
  396. package/docs/releases/v0.39.0.md +0 -35
  397. package/docs/releases/v0.40.0.md +0 -45
  398. package/docs/releases/v0.40.1.md +0 -34
  399. package/docs/releases/v1.0.0.md +0 -42
  400. package/docs/releases/v1.0.1.md +0 -38
  401. package/docs/releases/v1.0.2.md +0 -51
  402. package/docs/releases/v1.0.3.md +0 -37
  403. package/docs/releases/v1.0.4.md +0 -45
  404. package/docs/releases/v1.0.5.md +0 -41
  405. package/docs/releases/v1.0.6.md +0 -35
  406. package/docs/releases/v1.0.7.md +0 -36
  407. package/docs/releases/v1.1.0.md +0 -42
  408. package/docs/releases/v1.1.1.md +0 -44
  409. package/docs/releases/v1.1.2.md +0 -42
  410. package/docs/releases/v1.1.3.md +0 -36
  411. package/docs/releases/v1.1.4.md +0 -36
  412. package/docs/roadmap/README.md +0 -107
  413. package/docs/roadmap/v1.0-capability-conformance-framework.md +0 -582
  414. package/docs/roadmap/v1.0-choice-union-mode.md +0 -90
  415. package/docs/roadmap/v1.0-contract-audit.md +0 -75
  416. package/docs/roadmap/v1.0-json-array-streaming.md +0 -101
  417. package/docs/roadmap/v1.0-openapi-fastify-compatibility.md +0 -99
  418. package/docs/roadmap/v1.0-release-candidate-gates.md +0 -92
  419. package/docs/roadmap/v1.0-wsdl-coverage-matrix.md +0 -200
  420. package/docs/roadmap/v1.0-xs-anyattribute-wildcard-bag.md +0 -932
  421. package/src/runtime/jsonArray.ts +0 -55
  422. package/src/runtime/ndjson.ts +0 -32
@@ -0,0 +1,701 @@
1
+ import { XSD_NAMESPACE } from '../loader/orderedSyntax.js';
2
+ import { assertSemanticContext, contextsShareRequest, isSemanticCandidateOf } from './semanticContext.js';
3
+ import { RE01_DERIVATION_DOMAIN } from './re01TypeProperties.js';
4
+ import { deriveActualComplexContent, deriveRawComplexContent, particleContentNode } from './complexTypeContent.js';
5
+ import { assessSourceAttributeUses } from './schemaAttributeUses.js';
6
+ import { compareSchemaFacetProperties, createSchemaScalarKernel } from './schemaScalarKernel.js';
7
+ import { checkTypeDerivation, declarationMethods, immediateTypeBase, RelationProblem } from './schemaTypeRelations.js';
8
+ import { namespaceSetSubset } from './wildcardAlgebra.js';
9
+ import { readParticleWildcard } from './schemaParticleWildcardProperties.js';
10
+ import { declaredType, resolveSemanticType, semanticTypeKey } from './schemaTypeIdentity.js';
11
+ import { collectSemanticTypeDependencies } from './semanticTypeDependencies.js';
12
+ const issued = new WeakMap();
13
+ const actualMappings = new WeakMap();
14
+ const actualGroupMappings = new WeakMap();
15
+ const ANY_TYPE = Object.freeze({ kind: 'builtin', name: Object.freeze({ namespace: XSD_NAMESPACE, local: 'anyType' }) });
16
+ class CorrespondenceAbort extends Error {
17
+ result;
18
+ constructor(result) {
19
+ super(result.kind);
20
+ this.result = result;
21
+ }
22
+ }
23
+ /** Read effective original properties through the existing native source owners; cached data grants no validity. */
24
+ function mapActualComplexProperties(actual, id) {
25
+ const b = actual.budget, charge = b.chargeWork;
26
+ let cache = actualMappings.get(actual);
27
+ if (!cache) {
28
+ charge(2);
29
+ cache = new Map();
30
+ actualMappings.set(actual, cache);
31
+ }
32
+ const cached = cache.get(id);
33
+ if (cached)
34
+ return cached;
35
+ const found = actual.lookup(id);
36
+ if (found.kind !== 'found' || found.node.kind !== 'complexType')
37
+ throw new CorrespondenceAbort(Object.freeze({ kind: 'invalid-evidence',
38
+ rule: 'original-property-correspondence', component: id, message: 'Expected an original complex type' }));
39
+ const original = found.node;
40
+ const content = deriveActualComplexContent(actual, id), attrs = assessSourceAttributeUses(actual, id);
41
+ if (content.kind !== 'checked')
42
+ throw new CorrespondenceAbort(content.kind === 'resource-limit' ? content
43
+ : { ...content, kind: content.kind === 'invalid-input' ? 'invalid-evidence' : 'unresolved' });
44
+ if (attrs.kind !== 'checked')
45
+ throw new CorrespondenceAbort(attrs);
46
+ charge(20 + attrs.value.uses.length);
47
+ const properties = {
48
+ type: id, derivation: { method: original.derivation?.kind ?? 'restriction', base: original.derivation?.base ?? ANY_TYPE },
49
+ targetNamespace: original.context.effectiveNamespace,
50
+ abstract: original.abstract, final: declarationMethods(actual, original, 'final'),
51
+ block: declarationMethods(actual, original, 'block'), content: content.view.content,
52
+ attributeUses: attrs.value.uses.map(use => use.id), wildcard: attrs.value.wildcard, provenance: { kind: 'actual-mapped', original: id },
53
+ };
54
+ charge(9);
55
+ const result = Object.freeze({ properties: b.freeze(b.snapshot(properties)), context: actual,
56
+ view: content.view, synthetic: content.view.synthetic, scalarObligations: attrs.scalarObligations, typeDependencies: attrs.typeDependencies });
57
+ cache.set(id, result);
58
+ return result;
59
+ }
60
+ export function assertCandidateCorrespondence(context, receipt) {
61
+ assertSemanticContext(context);
62
+ if (issued.get(receipt) !== context)
63
+ throw new TypeError('Unauthenticated candidate correspondence');
64
+ }
65
+ /** The selected ancestor is computed from the complete context, never selected by a caller label. */
66
+ export function re01Ancestor(context, target) {
67
+ assertSemanticContext(context);
68
+ const result = context.budget.guard(() => {
69
+ const b = context.budget;
70
+ b.chargeWork(4);
71
+ const dependencies = collectSemanticTypeDependencies(context);
72
+ const first = immediateTypeBase(context, { kind: 'local', target });
73
+ if (first.kind === 'resource-limit')
74
+ return first;
75
+ if (first.kind !== 'checked' || !first.value)
76
+ return { kind: 'unresolved', rule: 'ancestor-domain', component: target, message: 'Original immediate base is unavailable' };
77
+ dependencies.add(first.typeDependencies);
78
+ const seen = new Set();
79
+ let current = first.value;
80
+ for (;;) {
81
+ const resolved = resolveSemanticType(context, current);
82
+ if (!('identity' in resolved))
83
+ return { kind: 'unresolved', rule: 'ancestor-domain', component: target, message: 'Ancestor is unavailable' };
84
+ // The ur-type's actual base property is itself; the general ancestry
85
+ // accessor stops there to avoid treating ordinary cycles as legal.
86
+ if (resolved.kind === 'builtin' && resolved.name.local === 'anyType')
87
+ return { kind: 'checked', ancestor: current, typeDependencies: dependencies.snapshot() };
88
+ const key = semanticTypeKey(context, resolved.identity);
89
+ b.chargeWork(4 + key.length);
90
+ if (seen.has(key))
91
+ return { kind: 'invalid-evidence', rule: 'ancestor-cycle', component: target, message: 'Ancestor chain is cyclic' };
92
+ seen.add(key);
93
+ const parent = immediateTypeBase(context, current);
94
+ if (parent.kind !== 'checked')
95
+ return parent.kind === 'resource-limit' ? parent : { kind: 'unresolved', rule: parent.rule, component: target, message: parent.message };
96
+ dependencies.add(parent.typeDependencies);
97
+ if (!parent.value)
98
+ return { kind: 'unresolved', rule: 'ancestor-domain', component: target, message: 'No proper ancestor with ur-type base' };
99
+ const next = resolveSemanticType(context, parent.value);
100
+ if (next.kind === 'builtin' && next.name.namespace === XSD_NAMESPACE && next.name.local === 'anyType') {
101
+ b.chargeWork(4);
102
+ return Object.freeze({ kind: 'checked', ancestor: current, typeDependencies: dependencies.snapshot() });
103
+ }
104
+ current = parent.value;
105
+ }
106
+ });
107
+ return result.kind === 'resource-limit' ? result : context.budget.guard(() => context.budget.freeze(context.budget.snapshot(result)));
108
+ }
109
+ /** A sufficient contextual contradiction, not a complete RE01 decision.
110
+ * Every fresh affiliate remains a child legality root in domain B. A complex
111
+ * head outside X -> E -> A's fixed chain cannot satisfy e-props-correct.4.
112
+ */
113
+ export function proveRe01FreshAffiliationObstruction(actual, parent, target) {
114
+ assertSemanticContext(actual);
115
+ assertSemanticContext(parent);
116
+ const b = parent.budget;
117
+ return b.guard(() => {
118
+ if (!contextsShareRequest(parent, actual))
119
+ throw new TypeError('Contexts belong to different requests');
120
+ b.chargeWork(8);
121
+ const publish = (result) => b.freeze(b.snapshot(result));
122
+ const unresolved = (rule, message) => {
123
+ b.chargeWork(8);
124
+ return publish({ kind: 'unresolved', rule, message, contextId: parent.contextId, component: target });
125
+ };
126
+ const unknown = (message) => {
127
+ b.chargeWork(6);
128
+ return publish({ kind: 'not-established', contextId: parent.contextId, target, message });
129
+ };
130
+ const key = (reference) => {
131
+ const found = resolveSemanticType(parent, reference);
132
+ return 'identity' in found ? semanticTypeKey(parent, found.identity) : undefined;
133
+ };
134
+ try {
135
+ if (actual.kind !== 'actual' || actual.membership !== 'complete-actual-plus-additions'
136
+ || parent.membership !== 'complete-actual-plus-additions')
137
+ return unresolved('complete-domain-membership', 'The contradiction requires the complete immutable actual and parent environments');
138
+ if (typeof target !== 'string' || !target)
139
+ throw new TypeError('Expected a target component ID');
140
+ const selected = parent.lookup(target);
141
+ if (selected.kind !== 'found' || selected.node.kind !== 'complexType')
142
+ return unknown('The target is not an available complex extension');
143
+ const raw = parent.rawTypeProperties(target);
144
+ if (!raw && !parent.sourceNode(target) || parent.rawSimpleTypeProperties(target))
145
+ return unresolved('missing-type-component-properties', 'The complex target requires its exact derivation properties');
146
+ if ((raw?.derivation.method ?? selected.node.derivation?.kind ?? 'restriction') !== 'extension')
147
+ return unknown('Only nonprimitive complex extensions require this two-step construction');
148
+ const first = immediateTypeBase(parent, { kind: 'local', target });
149
+ if (first.kind === 'resource-limit')
150
+ return first;
151
+ if (first.kind !== 'checked' || !first.value)
152
+ return unresolved('ancestor-domain', 'The target immediate base is unavailable');
153
+ const base = resolveSemanticType(parent, first.value);
154
+ if (base.kind !== 'component' || base.node.kind !== 'complexType')
155
+ return unknown('Simple-base and ur-type extensions are outside this obstruction');
156
+ const designated = re01Ancestor(parent, target);
157
+ if (designated.kind !== 'checked')
158
+ return designated;
159
+ const ancestorKey = key(designated.ancestor), firstKey = key(first.value);
160
+ if (!ancestorKey || !firstKey)
161
+ return unresolved('ancestor-domain', 'Exact ancestor identity is unavailable');
162
+ if (b.compareText(firstKey, ancestorKey) === 0)
163
+ return unknown('Primitive no-change does not introduce a restriction edge');
164
+ for (const id of parent.members) {
165
+ b.chargeWork();
166
+ // Original declarations available in H are not necessarily legality
167
+ // roots. Fresh declarations, including inherited ones, always are.
168
+ if (actual.lookup(id).kind === 'found')
169
+ continue;
170
+ const found = parent.lookup(id);
171
+ if (found.kind !== 'found' || found.node.kind !== 'element' || found.node.identity.kind !== 'global'
172
+ || !found.node.substitutionGroup)
173
+ continue;
174
+ const memberType = resolveSemanticType(parent, declaredType(parent, found.node));
175
+ if (memberType.kind !== 'component' || b.compareText(memberType.node.id, target) !== 0)
176
+ continue;
177
+ const head = parent.resolve(found.node.substitutionGroup);
178
+ if (head.kind !== 'found' || head.node.kind !== 'element' || head.node.identity.kind !== 'global')
179
+ return unresolved('e-props-correct.4', 'The mandatory affiliate lacks its exact global head');
180
+ const headReference = declaredType(parent, head.node), headType = resolveSemanticType(parent, headReference);
181
+ if (headType.kind !== 'component' || headType.node.kind !== 'complexType')
182
+ continue;
183
+ if (b.compareText(headType.node.id, target) === 0)
184
+ continue; // Identity precedes derivation exclusions.
185
+ if (parent.rawSimpleTypeProperties(headType.node.id))
186
+ return unresolved('missing-type-component-properties', 'The head requires unambiguous complex type properties');
187
+ const path = checkTypeDerivation(parent, designated.ancestor, headReference, []);
188
+ if (path.kind === 'resource-limit')
189
+ return path;
190
+ if (path.kind !== 'checked')
191
+ return unresolved(path.rule, path.message);
192
+ if (path.value)
193
+ continue; // B can already be on the fixed A ancestry.
194
+ const headBase = immediateTypeBase(parent, headReference);
195
+ if (headBase.kind === 'resource-limit')
196
+ return headBase;
197
+ if (headBase.kind !== 'checked' || !headBase.value)
198
+ return unresolved('ancestor-domain', 'The head type immediate base is unavailable');
199
+ const headRaw = parent.rawTypeProperties(headType.node.id);
200
+ if (!headRaw && !parent.sourceNode(headType.node.id))
201
+ return unresolved('missing-type-component-properties', 'The head type requires its exact immediate derivation');
202
+ const headBaseKey = key(headBase.value);
203
+ if (!headBaseKey)
204
+ return unresolved('ancestor-domain', 'The head type base identity is unavailable');
205
+ if ((headRaw?.derivation.method ?? headType.node.derivation?.kind ?? 'restriction') === 'extension'
206
+ && b.compareText(headBaseKey, ancestorKey) === 0)
207
+ continue; // Existing B may itself be E.
208
+ b.chargeWork(14);
209
+ return publish({ kind: 'proved-no-construction', domain: RE01_DERIVATION_DOMAIN,
210
+ scope: 'contextual-nonprimitive-two-step', criterion: 'mandatory-fresh-affiliate-fixed-complex-ancestry',
211
+ actualContextId: actual.contextId, contextId: parent.contextId, target, ancestor: designated.ancestor,
212
+ affiliate: id, head: head.node.id, headType: headType.node.id });
213
+ }
214
+ return unknown('No mandatory fresh affiliate satisfies the fixed complex ancestry contradiction');
215
+ }
216
+ catch (error) {
217
+ if (error instanceof RelationProblem)
218
+ return unresolved(error.result.rule, error.message);
219
+ throw error;
220
+ }
221
+ });
222
+ }
223
+ export function checkCandidateCorrespondence(actual, parent, candidate, target, intermediate, ancestor) {
224
+ assertSemanticContext(actual);
225
+ assertSemanticContext(parent);
226
+ assertSemanticContext(candidate);
227
+ const b = candidate.budget, charge = b.chargeWork;
228
+ return b.guard(() => {
229
+ const typeDependencies = collectSemanticTypeDependencies(candidate);
230
+ if (!contextsShareRequest(actual, parent) || !isSemanticCandidateOf(parent, candidate))
231
+ throw new TypeError('Candidate is not an authenticated direct child of this request');
232
+ const suppliedAncestor = b.freeze(b.snapshot(ancestor));
233
+ const fail = (rule, component, message, kind = 'candidate-rejected') => {
234
+ charge(12 + rule.length + message.length + (component?.length ?? 0));
235
+ throw new CorrespondenceAbort(Object.freeze({ kind, rule, component, message }));
236
+ };
237
+ const node = (context, id) => {
238
+ const found = context.lookup(id);
239
+ return found.kind === 'found' ? found.node : fail('complete-domain-membership', id, 'Required component is unavailable', 'unresolved');
240
+ };
241
+ const refKey = (context, reference) => {
242
+ const found = resolveSemanticType(context, reference);
243
+ // Preservation compares an available type's identity. Full validity is
244
+ // owed through its semantic owners, not through an unrelated raw read.
245
+ if ('identity' in found)
246
+ return semanticTypeKey(context, found.identity);
247
+ return fail('reference-correspondence', undefined, 'Correspondence reference is unavailable', 'unresolved');
248
+ };
249
+ const sameSet = (a, c) => {
250
+ charge(4);
251
+ const x = new Set(), y = new Set();
252
+ for (const id of a) {
253
+ charge(2 + id.length);
254
+ x.add(id);
255
+ }
256
+ for (const id of c) {
257
+ charge(2 + id.length);
258
+ y.add(id);
259
+ }
260
+ if (x.size !== y.size)
261
+ return false;
262
+ for (const id of x) {
263
+ charge(1 + id.length);
264
+ if (!y.has(id))
265
+ return false;
266
+ }
267
+ return true;
268
+ };
269
+ charge(4);
270
+ const scalarObligations = [];
271
+ const scalarValue = (context, result) => {
272
+ if (result.kind !== 'checked') {
273
+ if (result.kind === 'resource-limit')
274
+ throw new CorrespondenceAbort(result);
275
+ const origin = result.contextId ?? context.contextId;
276
+ charge(5);
277
+ throw new CorrespondenceAbort(Object.freeze({ ...result, contextId: origin,
278
+ kind: result.kind === 'invalid-schema' && origin !== actual.contextId ? 'candidate-rejected' : result.kind }));
279
+ }
280
+ typeDependencies.add(result.typeDependencies);
281
+ for (const obligation of result.obligations) {
282
+ charge(3);
283
+ scalarObligations.push({ contextId: obligation.contextId ?? context.contextId, obligation });
284
+ }
285
+ return result.value;
286
+ };
287
+ const compareSimple = (id) => {
288
+ charge(4);
289
+ const reference = { kind: 'local', target: id };
290
+ const left = scalarValue(parent, createSchemaScalarKernel(parent).contentProperties(reference, id));
291
+ const right = scalarValue(candidate, createSchemaScalarKernel(candidate).contentProperties(reference, id));
292
+ const text = (a, c) => a === undefined || c === undefined
293
+ ? a === c : b.compareText(a, c) === 0;
294
+ // Equal definition IDs across two contexts do not prove equal properties.
295
+ // These references retain component identity; structural substitution is
296
+ // the separate cos-particle-extend equality owner's task.
297
+ if (!text(left.definition, right.definition) || !text(left.name?.namespace, right.name?.namespace)
298
+ || !text(left.name?.local, right.name?.local) || !text(left.targetNamespace, right.targetNamespace)
299
+ || !sameSet(left.final, right.final) || left.variety !== right.variety || !text(left.primitive, right.primitive)
300
+ || Boolean(left.base) !== Boolean(right.base) || Boolean(left.item) !== Boolean(right.item)
301
+ || (left.members?.length ?? 0) !== (right.members?.length ?? 0))
302
+ return fail('original-simple-property-correspondence', id, 'Original simple type metadata changed');
303
+ if (left.base && right.base && refKey(parent, left.base) !== refKey(candidate, right.base)
304
+ || left.item && right.item && refKey(parent, left.item) !== refKey(candidate, right.item))
305
+ return fail('original-simple-property-correspondence', id, 'Original scalar base or item identity changed');
306
+ for (let index = 0; index < (left.members?.length ?? 0); index++) {
307
+ charge();
308
+ if (refKey(parent, left.members[index]) !== refKey(candidate, right.members[index]))
309
+ return fail('original-simple-property-correspondence', id, 'Original ordered scalar member identity changed');
310
+ }
311
+ const facets = compareSchemaFacetProperties(parent, reference, id, candidate, reference, id);
312
+ if (facets.kind === 'resource-limit')
313
+ throw new CorrespondenceAbort(facets);
314
+ if (facets.kind !== 'checked') {
315
+ if (facets.side === 'comparison')
316
+ return fail(facets.rule, id, facets.message, 'unresolved');
317
+ charge(8);
318
+ throw new CorrespondenceAbort(Object.freeze({ kind: facets.kind === 'invalid-schema' && facets.contextId !== actual.contextId
319
+ ? 'candidate-rejected' : facets.kind, rule: facets.rule, component: facets.component, contextId: facets.contextId, message: facets.message }));
320
+ }
321
+ typeDependencies.add(facets.typeDependencies);
322
+ for (const obligation of facets.obligations) {
323
+ charge(3);
324
+ if (!obligation.contextId)
325
+ return fail('scalar-obligation-context', id, 'Cross-context scalar obligation lacks its originating context', 'unresolved');
326
+ scalarObligations.push({ contextId: obligation.contextId, obligation });
327
+ }
328
+ if (!facets.value)
329
+ return fail('original-simple-property-correspondence', id, 'Original simple type facet properties changed');
330
+ // Only the shared private facet owner can compare complete annotation
331
+ // data or the identity of an originally bound facet component. Aggregate
332
+ // presence alone cannot establish full annotation correspondence.
333
+ if (facets.annotationCorrespondence === 'different')
334
+ return fail('original-facet-annotation-correspondence', id, 'Original facet annotation properties changed');
335
+ if (facets.annotationCorrespondence !== 'equal')
336
+ return fail('original-facet-annotation-correspondence', id, 'Original facet annotations require exact supplied data or original component binding', 'unresolved');
337
+ };
338
+ const mapped = (id) => {
339
+ const prior = parent.rawTypeProperties(id);
340
+ if (prior) {
341
+ charge(8);
342
+ if ('particle' in prior.content && prior.content.original) {
343
+ const content = deriveRawComplexContent(parent, id);
344
+ if (content.kind !== 'checked')
345
+ throw new CorrespondenceAbort(content.kind === 'resource-limit' ? content
346
+ : { ...content, kind: content.kind === 'invalid-input' ? 'invalid-evidence' : 'unresolved' });
347
+ return { properties: prior, context: parent, view: content.view, synthetic: content.view.synthetic, scalarObligations: [], typeDependencies: [] };
348
+ }
349
+ return { properties: prior, context: parent, synthetic: [], scalarObligations: [], typeDependencies: [] };
350
+ }
351
+ const result = mapActualComplexProperties(actual, id);
352
+ typeDependencies.add(result.typeDependencies);
353
+ for (const obligation of result.scalarObligations) {
354
+ charge(3);
355
+ scalarObligations.push({ contextId: obligation.contextId ?? actual.contextId, obligation });
356
+ }
357
+ return result;
358
+ };
359
+ const typeNamespace = (context, id, properties) => {
360
+ const definition = node(context, id);
361
+ if (properties.targetNamespace !== undefined)
362
+ return properties.targetNamespace;
363
+ if (definition.identity.kind === 'global')
364
+ return definition.identity.name.namespace;
365
+ const original = actual.sourceNode(id);
366
+ if (original)
367
+ return original.context.effectiveNamespace;
368
+ return fail('original-type-target-namespace', id, 'An abstract scoped type lacks its namespace property', 'unresolved');
369
+ };
370
+ const mappedGroup = (id) => {
371
+ const prior = parent.rawAttributeGroupProperties(id);
372
+ if (prior)
373
+ return prior;
374
+ let cache = actualGroupMappings.get(actual);
375
+ if (!cache) {
376
+ charge(2);
377
+ cache = new Map();
378
+ actualGroupMappings.set(actual, cache);
379
+ }
380
+ const cached = cache.get(id);
381
+ if (cached) {
382
+ typeDependencies.add(cached.typeDependencies);
383
+ for (const obligation of cached.scalarObligations) {
384
+ charge(3);
385
+ scalarObligations.push({ contextId: obligation.contextId ?? actual.contextId, obligation });
386
+ }
387
+ return cached.properties;
388
+ }
389
+ const attrs = assessSourceAttributeUses(actual, id);
390
+ if (attrs.kind !== 'checked')
391
+ throw new CorrespondenceAbort(attrs);
392
+ typeDependencies.add(attrs.typeDependencies);
393
+ for (const obligation of attrs.scalarObligations) {
394
+ charge(3);
395
+ scalarObligations.push({ contextId: obligation.contextId ?? actual.contextId, obligation });
396
+ }
397
+ charge(6 + attrs.value.uses.length);
398
+ const properties = b.freeze(b.snapshot({ group: id, attributeUses: attrs.value.uses.map(use => use.id), wildcard: attrs.value.wildcard }));
399
+ cache.set(id, { properties, scalarObligations: attrs.scalarObligations, typeDependencies: attrs.typeDependencies });
400
+ return properties;
401
+ };
402
+ const compareContent = (left, right) => {
403
+ const a = left.properties.content, c = right.content;
404
+ if (a.kind !== c.kind)
405
+ return fail('endpoint-content-variety', right.type, 'Original effective content variety changed');
406
+ if (a.kind === 'empty')
407
+ return;
408
+ if (a.kind === 'simple' && c.kind === 'simple') {
409
+ // Source complex facade describes the exact content definition, even
410
+ // when a mapped anonymous simple type is not in the canonical graph.
411
+ const sourceRef = left.context.kind === 'actual' ? { kind: 'local', target: right.type } : a.type;
412
+ const x = scalarValue(left.context, createSchemaScalarKernel(left.context).contentIdentity(sourceRef, right.type));
413
+ const y = scalarValue(candidate, createSchemaScalarKernel(candidate).contentIdentity(c.type, right.type));
414
+ charge(x.definition.length + y.definition.length + 2);
415
+ if (x.definition !== y.definition)
416
+ return fail('endpoint-scalar-identity', right.type, 'Original effective simple type identity was not retained');
417
+ return;
418
+ }
419
+ if (a.kind === 'opaque-builtin' && c.kind === 'opaque-builtin') {
420
+ if (refKey(left.context, a.type) !== refKey(candidate, c.type))
421
+ return fail('endpoint-builtin-identity', right.type, 'Opaque builtin identity changed');
422
+ return;
423
+ }
424
+ if (!('particle' in a) || !('particle' in c))
425
+ return fail('endpoint-content-variety', right.type, 'Content property mismatch');
426
+ const rightContent = deriveRawComplexContent(candidate, right.type);
427
+ if (rightContent.kind !== 'checked')
428
+ throw new CorrespondenceAbort(rightContent.kind === 'resource-limit' ? rightContent
429
+ : { ...rightContent, kind: rightContent.kind === 'invalid-input' ? 'invalid-evidence' : 'unresolved' });
430
+ charge(6 + left.synthetic.length);
431
+ const synthetic = new Set(left.synthetic), forward = new Map(), reverse = new Map();
432
+ charge(3);
433
+ const pairs = [[a.particle, c.particle]];
434
+ while (pairs.length) {
435
+ charge(3);
436
+ const [xid, yid] = pairs.pop();
437
+ if (!synthetic.has(xid)) {
438
+ if (xid !== yid)
439
+ return fail('endpoint-original-particle', right.type, 'Original declared particle identity changed');
440
+ continue;
441
+ }
442
+ if (forward.has(xid)) {
443
+ if (forward.get(xid) !== yid)
444
+ return fail('endpoint-particle-sharing', right.type, 'Shared generated particle was split');
445
+ continue;
446
+ }
447
+ if (reverse.has(yid))
448
+ return fail('endpoint-particle-sharing', right.type, 'Distinct generated particles were merged');
449
+ charge(4);
450
+ forward.set(xid, yid);
451
+ reverse.set(yid, xid);
452
+ const x = left.view && particleContentNode(left.context, left.view, xid), y = particleContentNode(candidate, rightContent.view, yid);
453
+ if (x?.kind === 'particle' && y?.kind === 'particle')
454
+ charge(4 + x.occurs.min.length + x.occurs.max.length + y.occurs.min.length + y.occurs.max.length);
455
+ if (x?.kind !== 'particle' || y?.kind !== 'particle' || x.term.kind !== y.term.kind || x.occurs.min !== y.occurs.min || x.occurs.max !== y.occurs.max)
456
+ return fail('endpoint-raw-particle', right.type, 'Generated raw particle structure changed');
457
+ if ('children' in x.term && 'children' in y.term) {
458
+ if (x.term.children.length !== y.term.children.length)
459
+ return fail('endpoint-raw-particle', right.type, 'Generated compositor child count changed');
460
+ for (let i = 0; i < x.term.children.length; i++) {
461
+ charge(3);
462
+ pairs.push([x.term.children[i], y.term.children[i]]);
463
+ }
464
+ }
465
+ else if (x.term.kind === 'any' && y.term.kind === 'any') {
466
+ const xs = readParticleWildcard(left.context, x), ys = readParticleWildcard(candidate, y);
467
+ if (xs.processContents !== ys.processContents || !namespaceSetSubset(xs.namespace, ys.namespace, charge)
468
+ || !namespaceSetSubset(ys.namespace, xs.namespace, charge))
469
+ return fail('endpoint-raw-wildcard', right.type, 'Generated wildcard properties changed');
470
+ }
471
+ else
472
+ return fail('endpoint-generated-kind', right.type, 'Unqualified generated content component', 'unresolved');
473
+ }
474
+ };
475
+ try {
476
+ if (actual.kind !== 'actual')
477
+ return fail('actual-context', target, 'Original source context is required', 'invalid-evidence');
478
+ if (parent.membership !== 'complete-actual-plus-additions' || candidate.membership !== 'complete-actual-plus-additions')
479
+ return fail('complete-domain-membership', target, 'Semantic candidate must retain the complete available environment', 'unresolved');
480
+ if (parent.scalarSlotMembership !== 'complete-original' || candidate.scalarSlotMembership !== 'complete-original')
481
+ return fail('complete-scalar-slot-membership', target, 'Semantic candidate must retain every original scalar component', 'unresolved');
482
+ const before = node(parent, target), endpoint = node(candidate, target), e = node(candidate, intermediate);
483
+ if (before.kind !== 'complexType' || endpoint.kind !== 'complexType' || e.kind !== 'complexType')
484
+ return fail('two-step-types', target, 'Endpoint and intermediate must be complex types', 'invalid-evidence');
485
+ const computed = re01Ancestor(parent, target);
486
+ if (computed.kind !== 'checked')
487
+ throw new CorrespondenceAbort(computed);
488
+ typeDependencies.add(computed.typeDependencies);
489
+ if (refKey(parent, computed.ancestor) !== refKey(parent, suppliedAncestor))
490
+ return fail('ancestor-correspondence', target, 'Supplied ancestor differs from the original chain', 'invalid-evidence');
491
+ const endProps = candidate.rawTypeProperties(target), middleProps = candidate.rawTypeProperties(intermediate);
492
+ if (!endProps || !middleProps)
493
+ return fail('raw-type-properties', target, 'Endpoint and intermediate need complete raw properties', 'unresolved');
494
+ if (endProps.derivation.method !== 'restriction' || refKey(candidate, endProps.derivation.base) !== refKey(candidate, { kind: 'local', target: intermediate })
495
+ || middleProps.derivation.method !== 'extension' || refKey(candidate, middleProps.derivation.base) !== refKey(candidate, suppliedAncestor))
496
+ return fail('two-step-construction', target, 'Expected extension from the designated ancestor then endpoint restriction');
497
+ charge(4);
498
+ const originalProperties = [], fresh = [];
499
+ for (const id of candidate.members) {
500
+ const original = parent.lookup(id);
501
+ if (original.kind !== 'found') {
502
+ charge();
503
+ fresh.push(id);
504
+ continue;
505
+ }
506
+ const group = candidate.rawAttributeGroupProperties(id);
507
+ const rawSimple = candidate.rawSimpleTypeProperties(id);
508
+ const element = candidate.rawElementProperties(id);
509
+ const attribute = candidate.rawAttributeProperties(id);
510
+ const properties = candidate.rawTypeProperties(id);
511
+ if ((group || rawSimple || element || attribute || properties) && candidate.originalSourceComponentAbsent(id))
512
+ return fail('source-only-property-overlay', id, 'A source-only diagnostic node cannot receive component properties');
513
+ if (group) {
514
+ const prior = mappedGroup(id);
515
+ if (!sameSet(group.attributeUses, prior.attributeUses) || Boolean(group.wildcard) !== Boolean(prior.wildcard))
516
+ return fail('original-group-property-correspondence', id, 'Original effective attribute group properties changed');
517
+ if (group.wildcard && prior.wildcard && (group.wildcard.processContents !== prior.wildcard.processContents
518
+ || !namespaceSetSubset(group.wildcard.namespace, prior.wildcard.namespace, charge) || !namespaceSetSubset(prior.wildcard.namespace, group.wildcard.namespace, charge)))
519
+ return fail('original-group-property-correspondence', id, 'Original effective group wildcard changed');
520
+ charge();
521
+ originalProperties.push(id);
522
+ }
523
+ if (rawSimple) {
524
+ compareSimple(id);
525
+ charge();
526
+ originalProperties.push(id);
527
+ }
528
+ if (element) {
529
+ if (!sameSet(element.final, declarationMethods(parent, original.node, 'final')) || !sameSet(element.block, declarationMethods(parent, original.node, 'block')))
530
+ return fail('original-element-property-correspondence', id, 'Original declaration flags changed');
531
+ }
532
+ if (element?.type !== undefined || attribute) {
533
+ const current = node(candidate, id);
534
+ if (original.node.kind !== 'element' && original.node.kind !== 'attribute' || current.kind !== 'element' && current.kind !== 'attribute')
535
+ return fail('original-declaration-type-correspondence', id, 'Explicit type requires a declaration');
536
+ if (refKey(parent, declaredType(parent, original.node)) !== refKey(candidate, declaredType(candidate, current)))
537
+ return fail('original-declaration-type-correspondence', id, 'Original declaration type identity changed');
538
+ charge();
539
+ originalProperties.push(id);
540
+ }
541
+ if (!properties)
542
+ continue;
543
+ const left = mapped(id), prior = left.properties;
544
+ if (typeNamespace(candidate, id, properties) !== typeNamespace(left.context, id, prior)
545
+ || properties.abstract !== prior.abstract || !sameSet(properties.final, prior.final) || !sameSet(properties.block, prior.block)
546
+ || !sameSet(properties.attributeUses, prior.attributeUses))
547
+ return fail('original-type-property-correspondence', id, 'Original flags or attribute-use identities changed');
548
+ if (id !== target && (properties.derivation.method !== prior.derivation.method || refKey(candidate, properties.derivation.base) !== refKey(left.context, prior.derivation.base)))
549
+ return fail('original-base-correspondence', id, 'A nonendpoint derivation changed');
550
+ if (Boolean(properties.wildcard) !== Boolean(prior.wildcard))
551
+ return fail('original-wildcard-correspondence', id, 'Original wildcard presence changed');
552
+ if (properties.wildcard && prior.wildcard && (properties.wildcard.processContents !== prior.wildcard.processContents
553
+ || !namespaceSetSubset(properties.wildcard.namespace, prior.wildcard.namespace, charge) || !namespaceSetSubset(prior.wildcard.namespace, properties.wildcard.namespace, charge)))
554
+ return fail('original-wildcard-correspondence', id, 'Original wildcard properties changed');
555
+ compareContent(left, properties);
556
+ charge();
557
+ originalProperties.push(id);
558
+ }
559
+ charge(16 + originalProperties.length + fresh.length + scalarObligations.length);
560
+ const receipt = b.freeze(b.snapshot({ kind: 'checked', authority: RE01_DERIVATION_DOMAIN,
561
+ parentContext: parent.contextId, contextId: candidate.contextId, target, intermediate, ancestor: computed.ancestor,
562
+ originalProperties: Object.freeze(originalProperties), fresh: Object.freeze(fresh), scalarObligations: Object.freeze(scalarObligations), typeDependencies: typeDependencies.snapshot() }));
563
+ issued.set(receipt, candidate);
564
+ return receipt;
565
+ }
566
+ catch (error) {
567
+ if (error instanceof CorrespondenceAbort)
568
+ return error.result;
569
+ if (error instanceof RelationProblem)
570
+ return Object.freeze({ kind: 'unresolved', rule: error.result.rule, component: error.result.component, message: error.message });
571
+ throw error;
572
+ }
573
+ });
574
+ }
575
+ const additiveProperties = new WeakMap();
576
+ /** Authenticate simple-content property correspondence independently of construction and dated interpretation. */
577
+ export function assertAdditiveSimpleProperties(actual, context, receipt) {
578
+ assertSemanticContext(actual);
579
+ assertSemanticContext(context);
580
+ const issued = additiveProperties.get(receipt);
581
+ if (!issued || issued.actual !== actual || issued.context !== context)
582
+ throw new TypeError('Fresh matching additive property correspondence required');
583
+ }
584
+ /** Compare fresh simple-content representatives with native effective source properties, preserving every original binding.
585
+ * @remarks Identity/name and derivation are deliberately distinct for the fresh restriction representative.
586
+ * Its other effective complex properties must match the original target. The middle carries the same attributes
587
+ * and extends the exact designated simple ancestor. Local legality, aggregate closure and dated interpretation
588
+ * remain separate obligations; producer provenance labels grant none of them.
589
+ * @returns Authenticated native property correspondence or an explicit mismatch/unavailable/resource result.
590
+ * @throws TypeError For unauthenticated or unrelated contexts.
591
+ */
592
+ export function checkAdditiveSimpleProperties(actual, candidate, target, intermediate, representative) {
593
+ assertSemanticContext(actual);
594
+ assertSemanticContext(candidate);
595
+ if (!contextsShareRequest(actual, candidate) || !isSemanticCandidateOf(actual, candidate))
596
+ throw new TypeError('Expected a direct child of this actual request');
597
+ const b = actual.budget, charge = b.chargeWork;
598
+ return b.guard(() => {
599
+ const fail = (rule, message, kind = 'candidate-rejected') => {
600
+ charge(32 + rule.length + message.length + target.length);
601
+ throw new CorrespondenceAbort(Object.freeze({ kind, rule, component: target, contextId: candidate.contextId, message }));
602
+ };
603
+ try {
604
+ if (actual.kind !== 'actual' || actual.membership !== 'complete-actual-plus-additions' || candidate.membership !== 'complete-actual-plus-additions')
605
+ return fail('additive-source-context', 'Complete actual source membership is required', 'unresolved');
606
+ if (intermediate === representative || actual.lookup(intermediate).kind !== 'missing' || actual.lookup(representative).kind !== 'missing'
607
+ || candidate.members.length !== actual.members.length + 2)
608
+ return fail('additive-fresh-types', 'Exactly two fresh type components are required');
609
+ for (const id of actual.members) {
610
+ charge(16 + id.length);
611
+ const before = actual.lookup(id), after = candidate.lookup(id);
612
+ if (before.kind !== 'found' || after.kind !== 'found' || before.node !== after.node
613
+ || actual.rawTypeProperties(id) !== candidate.rawTypeProperties(id)
614
+ || actual.rawSimpleTypeProperties(id) !== candidate.rawSimpleTypeProperties(id)
615
+ || actual.rawElementProperties(id) !== candidate.rawElementProperties(id)
616
+ || actual.rawAttributeProperties(id) !== candidate.rawAttributeProperties(id)
617
+ || actual.rawAttributeGroupProperties(id) !== candidate.rawAttributeGroupProperties(id)
618
+ || actual.rawParticleWildcardProperties(id) !== candidate.rawParticleWildcardProperties(id)
619
+ || actual.owner(id) !== candidate.owner(id))
620
+ return fail('additive-original-preservation', 'An original component or scope binding changed');
621
+ }
622
+ const e = candidate.lookup(intermediate), c = candidate.lookup(representative);
623
+ if (e.kind !== 'found' || c.kind !== 'found' || e.node.kind !== 'complexType' || c.node.kind !== 'complexType')
624
+ return fail('additive-fresh-types', 'Fresh extension and restriction complex types are required');
625
+ const original = mapActualComplexProperties(actual, target), middle = candidate.rawTypeProperties(intermediate), end = candidate.rawTypeProperties(representative);
626
+ if (!middle || !end)
627
+ return fail('additive-raw-properties', 'Complete fresh complex properties are required', 'unresolved');
628
+ if (original.properties.content.kind !== 'simple' || middle.content.kind !== 'simple' || end.content.kind !== 'simple')
629
+ return fail('additive-simple-content-family', 'This property route supports only simple content', 'unresolved');
630
+ const designated = re01Ancestor(actual, target);
631
+ if (designated.kind !== 'checked')
632
+ throw new CorrespondenceAbort(designated);
633
+ const typeDependencies = collectSemanticTypeDependencies(candidate);
634
+ typeDependencies.add(original.typeDependencies);
635
+ typeDependencies.add(designated.typeDependencies);
636
+ const key = (context, reference) => {
637
+ const resolved = resolveSemanticType(context, reference);
638
+ if (!('identity' in resolved))
639
+ return fail('additive-type-reference', 'A property type is unavailable', 'unresolved');
640
+ typeDependencies.add([{ contextId: context.contextId, type: resolved.identity }]);
641
+ return semanticTypeKey(context, resolved.identity);
642
+ };
643
+ const sameSet = (left, right) => {
644
+ charge(4);
645
+ const a = new Set(), z = new Set();
646
+ for (const value of left) {
647
+ charge(2 + value.length);
648
+ a.add(value);
649
+ }
650
+ for (const value of right) {
651
+ charge(2 + value.length);
652
+ z.add(value);
653
+ }
654
+ if (a.size !== z.size)
655
+ return false;
656
+ for (const value of a) {
657
+ charge(2 + value.length);
658
+ if (!z.has(value))
659
+ return false;
660
+ }
661
+ return true;
662
+ };
663
+ const sameWildcard = (left, right) => {
664
+ charge(4);
665
+ if (!left.wildcard || !right.wildcard)
666
+ return left.wildcard === right.wildcard;
667
+ return left.wildcard.processContents === right.wildcard.processContents
668
+ && namespaceSetSubset(left.wildcard.namespace, right.wildcard.namespace, charge)
669
+ && namespaceSetSubset(right.wildcard.namespace, left.wildcard.namespace, charge);
670
+ };
671
+ if (middle.derivation.method !== 'extension' || end.derivation.method !== 'restriction'
672
+ || key(candidate, middle.derivation.base) !== key(actual, designated.ancestor)
673
+ || key(candidate, end.derivation.base) !== key(candidate, { kind: 'local', target: intermediate }))
674
+ return fail('additive-derivation-chain', 'The representatives do not have the required extension/restriction chain');
675
+ if (key(candidate, middle.content.type) !== key(actual, designated.ancestor)
676
+ || key(candidate, end.content.type) !== key(actual, original.properties.content.type))
677
+ return fail('additive-content-correspondence', 'Representative scalar content differs from its native source property');
678
+ const prior = original.properties;
679
+ if (end.targetNamespace !== prior.targetNamespace || end.abstract !== prior.abstract
680
+ || !sameSet(end.final, prior.final) || !sameSet(end.block, prior.block)
681
+ || !sameSet(end.attributeUses, prior.attributeUses) || !sameWildcard(end, prior))
682
+ return fail('additive-target-properties', 'The restriction representative changed an effective target property');
683
+ if (middle.targetNamespace !== prior.targetNamespace || middle.abstract || middle.final.length || middle.block.length
684
+ || !sameSet(middle.attributeUses, prior.attributeUses) || !sameWildcard(middle, prior))
685
+ return fail('additive-middle-properties', 'The extension representative changed the selected middle properties');
686
+ charge(128);
687
+ const result = Object.freeze({ kind: 'checked-additive-simple-properties', actualContextId: actual.contextId,
688
+ contextId: candidate.contextId, target, intermediate, representative, scalarObligations: original.scalarObligations,
689
+ typeDependencies: typeDependencies.snapshot(), datedInterpretation: 'unassessed' });
690
+ additiveProperties.set(result, Object.freeze({ actual, context: candidate }));
691
+ return result;
692
+ }
693
+ catch (error) {
694
+ if (error instanceof CorrespondenceAbort)
695
+ return error.result;
696
+ if (error instanceof RelationProblem)
697
+ return Object.freeze({ kind: 'unresolved', rule: error.result.rule, component: error.result.component, message: error.message });
698
+ throw error;
699
+ }
700
+ });
701
+ }