@shapeshift-labs/frontier-lang-compiler 0.2.150 → 0.2.151

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 (276) hide show
  1. package/README.md +315 -9
  2. package/bench/real-repo-corpus-checkout-identity.mjs +134 -0
  3. package/bench/real-repo-corpus-checkout-proof.mjs +263 -0
  4. package/bench/real-repo-corpus-command-execution.mjs +314 -0
  5. package/bench/real-repo-corpus-evidence.mjs +165 -0
  6. package/bench/real-repo-corpus-suite.mjs +273 -0
  7. package/bench/smoke.mjs +109 -7
  8. package/dist/declarations/import-adapter-core.d.ts +4 -3
  9. package/dist/declarations/import-adapter-options-native.d.ts +21 -0
  10. package/dist/declarations/js-ts-project-merge-admission-routes.d.ts +35 -0
  11. package/dist/declarations/js-ts-project-merge-commonjs-interop.d.ts +29 -0
  12. package/dist/declarations/js-ts-project-merge-confidence.d.ts +64 -0
  13. package/dist/declarations/js-ts-project-merge-declaration-emit-parity.d.ts +37 -0
  14. package/dist/declarations/js-ts-project-merge-declarations.d.ts +65 -0
  15. package/dist/declarations/js-ts-project-merge-diagnostics.d.ts +97 -0
  16. package/dist/declarations/js-ts-project-merge-global-augmentation.d.ts +30 -0
  17. package/dist/declarations/js-ts-project-merge-jsx-render-branch.d.ts +48 -0
  18. package/dist/declarations/js-ts-project-merge-proof-levels.d.ts +109 -0
  19. package/dist/declarations/js-ts-project-merge-quality-gates.d.ts +38 -0
  20. package/dist/declarations/js-ts-project-merge-semantic-equivalence-proof.d.ts +45 -0
  21. package/dist/declarations/js-ts-project-merge-tsconfig.d.ts +43 -0
  22. package/dist/declarations/js-ts-safe-merge.d.ts +47 -0
  23. package/dist/declarations/js-ts-safe-project-merge.d.ts +120 -38
  24. package/dist/declarations/native-project-compiler-assignability-oracle.d.ts +41 -0
  25. package/dist/declarations/native-project-compiler-callable-signatures.d.ts +31 -0
  26. package/dist/declarations/native-project-compiler-class-member-runtime-proof.d.ts +87 -0
  27. package/dist/declarations/native-project-compiler-composite-types.d.ts +23 -0
  28. package/dist/declarations/native-project-compiler-enum-proof.d.ts +58 -0
  29. package/dist/declarations/native-project-compiler-index-signature.d.ts +7 -0
  30. package/dist/declarations/native-project-compiler-public-api-source-binding.d.ts +8 -0
  31. package/dist/declarations/native-project-compiler-scope.d.ts +37 -0
  32. package/dist/declarations/native-project-compiler-type-reference-targets.d.ts +38 -0
  33. package/dist/declarations/native-project-css-modules.d.ts +90 -0
  34. package/dist/declarations/native-project-decorator-metadata.d.ts +126 -0
  35. package/dist/declarations/native-project-jsx-graph.d.ts +313 -0
  36. package/dist/declarations/native-project-module-declarations.d.ts +52 -0
  37. package/dist/declarations/native-project-module-resolution.d.ts +76 -1
  38. package/dist/declarations/native-project-runtime-effect-target.d.ts +29 -0
  39. package/dist/declarations/native-project-runtime-executable-effect-evidence.d.ts +107 -0
  40. package/dist/declarations/native-project-runtime-mutation-target.d.ts +33 -0
  41. package/dist/declarations/native-project-runtime-promise-chain.d.ts +30 -0
  42. package/dist/declarations/native-project-runtime-promise-combinator.d.ts +22 -0
  43. package/dist/declarations/native-project-runtime-reachability.d.ts +30 -0
  44. package/dist/declarations/native-project-runtime-resource-management.d.ts +27 -0
  45. package/dist/declarations/native-project-runtime-yield-delegation.d.ts +10 -0
  46. package/dist/declarations/native-project-scope-template-reference.d.ts +13 -0
  47. package/dist/declarations/native-project-source-evidence.d.ts +8 -0
  48. package/dist/declarations/native-project.d.ts +40 -39
  49. package/dist/declarations/semantic-edit-script.d.ts +10 -8
  50. package/dist/declarations/semantic-graph-layers.d.ts +79 -0
  51. package/dist/declarations/semantic-sidecar.d.ts +3 -2
  52. package/dist/declarations/semantic-structural-diff.d.ts +94 -0
  53. package/dist/declarations/source-preservation.d.ts +32 -1
  54. package/dist/declarations/target-adapters.d.ts +22 -2
  55. package/dist/index.d.ts +31 -0
  56. package/dist/index.js +5 -0
  57. package/dist/internal/index-impl/compileNativeSource.js +53 -5
  58. package/dist/internal/index-impl/createLightweightNativeImport.js +58 -4
  59. package/dist/internal/index-impl/createNativeImportFromSyntaxAst.js +17 -1
  60. package/dist/internal/index-impl/createNativeImportFromTypeScriptAst.js +28 -4
  61. package/dist/internal/index-impl/createNativeProjectImportResult.js +31 -27
  62. package/dist/internal/index-impl/createNativeProjectModuleResolutionFromPackageManifests.js +145 -0
  63. package/dist/internal/index-impl/createNativeSourcePreservation.js +34 -7
  64. package/dist/internal/index-impl/createSemanticImportSidecar.js +27 -1
  65. package/dist/internal/index-impl/createTypeScriptCompilerNativeImporterAdapter.js +16 -5
  66. package/dist/internal/index-impl/dynamicImportExpressionMetadata.js +80 -0
  67. package/dist/internal/index-impl/importMetaUrlDependencyMetadata.js +176 -0
  68. package/dist/internal/index-impl/importNativeSource.js +2 -3
  69. package/dist/internal/index-impl/moduleImportAttributeMetadata.js +232 -0
  70. package/dist/internal/index-impl/projectSemanticEditScriptToSource.js +8 -1
  71. package/dist/internal/index-impl/projectSymbolGraphClassStaticBlocks.js +148 -0
  72. package/dist/internal/index-impl/projectSymbolGraphCompilerAdvancedTypeMetadata.js +45 -0
  73. package/dist/internal/index-impl/projectSymbolGraphCompilerCallableSignatureEquivalence.js +107 -0
  74. package/dist/internal/index-impl/projectSymbolGraphCompilerClassPrivateAccessorRuntimeProof.js +280 -0
  75. package/dist/internal/index-impl/projectSymbolGraphCompilerClassShapeEquivalence.js +103 -0
  76. package/dist/internal/index-impl/projectSymbolGraphCompilerConditionalTypeEquivalence.js +242 -0
  77. package/dist/internal/index-impl/projectSymbolGraphCompilerDecoratorRuntimeProof.js +197 -0
  78. package/dist/internal/index-impl/projectSymbolGraphCompilerEnumEquivalence.js +188 -0
  79. package/dist/internal/index-impl/projectSymbolGraphCompilerFacts.js +244 -0
  80. package/dist/internal/index-impl/projectSymbolGraphCompilerIndexSignatureEquivalence.js +58 -0
  81. package/dist/internal/index-impl/projectSymbolGraphCompilerMetadata.js +168 -0
  82. package/dist/internal/index-impl/projectSymbolGraphCompilerTypeEquivalence.js +199 -0
  83. package/dist/internal/index-impl/projectSymbolGraphCompilerTypeEquivalenceProof.js +204 -0
  84. package/dist/internal/index-impl/projectSymbolGraphCompilerTypeReferenceTargetEquivalence.js +99 -0
  85. package/dist/internal/index-impl/projectSymbolGraphCssModuleRecords.js +264 -0
  86. package/dist/internal/index-impl/projectSymbolGraphCssModuleScanners.js +242 -0
  87. package/dist/internal/index-impl/projectSymbolGraphCssModuleUtils.js +152 -0
  88. package/dist/internal/index-impl/projectSymbolGraphCssModules.js +82 -0
  89. package/dist/internal/index-impl/projectSymbolGraphJsxComponentImports.js +170 -0
  90. package/dist/internal/index-impl/projectSymbolGraphJsxComponentProviderLookup.js +167 -0
  91. package/dist/internal/index-impl/projectSymbolGraphJsxComponentWrappers.js +150 -0
  92. package/dist/internal/index-impl/projectSymbolGraphJsxContextTargets.js +71 -0
  93. package/dist/internal/index-impl/projectSymbolGraphJsxContextValues.js +212 -0
  94. package/dist/internal/index-impl/projectSymbolGraphJsxEventHandlers.js +172 -0
  95. package/dist/internal/index-impl/projectSymbolGraphJsxHookEffects.js +124 -0
  96. package/dist/internal/index-impl/projectSymbolGraphJsxHooks.js +281 -0
  97. package/dist/internal/index-impl/projectSymbolGraphJsxMemberComponents.js +139 -0
  98. package/dist/internal/index-impl/projectSymbolGraphJsxPropFlows.js +320 -0
  99. package/dist/internal/index-impl/projectSymbolGraphJsxPropValues.js +145 -0
  100. package/dist/internal/index-impl/projectSymbolGraphJsxProviderFlows.js +133 -0
  101. package/dist/internal/index-impl/projectSymbolGraphJsxRecords.js +315 -0
  102. package/dist/internal/index-impl/projectSymbolGraphJsxRenderCollections.js +155 -0
  103. package/dist/internal/index-impl/projectSymbolGraphJsxRenderReturns.js +291 -0
  104. package/dist/internal/index-impl/projectSymbolGraphJsxRenderRisk.js +279 -0
  105. package/dist/internal/index-impl/projectSymbolGraphModuleDeclarationShapes.js +138 -0
  106. package/dist/internal/index-impl/projectSymbolGraphModuleResolution.js +89 -87
  107. package/dist/internal/index-impl/projectSymbolGraphPackageConditions.js +314 -0
  108. package/dist/internal/index-impl/projectSymbolGraphReExportImportTargets.js +43 -0
  109. package/dist/internal/index-impl/projectSymbolGraphReExports.js +55 -1
  110. package/dist/internal/index-impl/projectSymbolGraphRuntimeRegions.js +108 -0
  111. package/dist/internal/index-impl/projectSymbolGraphScopeUseDefAliases.js +307 -0
  112. package/dist/internal/index-impl/projectSymbolGraphScopeUseDefLexical.js +320 -0
  113. package/dist/internal/index-impl/projectSymbolGraphScopeUseDefOwners.js +50 -0
  114. package/dist/internal/index-impl/projectSymbolGraphScopeUseDefRecordBuilders.js +112 -0
  115. package/dist/internal/index-impl/projectSymbolGraphScopeUseDefRecords.js +238 -0
  116. package/dist/internal/index-impl/projectSymbolGraphScopeUseDefStructural.js +104 -0
  117. package/dist/internal/index-impl/projectSymbolGraphScopeUseDefStructuralNormalize.js +242 -0
  118. package/dist/internal/index-impl/projectSymbolGraphScopeUseDefUseHashes.js +107 -0
  119. package/dist/internal/index-impl/projectSymbolGraphSourceMapGeneratedBoundary.js +111 -0
  120. package/dist/internal/index-impl/projectSymbolGraphSourceRecords.js +268 -0
  121. package/dist/internal/index-impl/projectSymbolGraphSourceRecordsOwnership.js +309 -0
  122. package/dist/internal/index-impl/replaySemanticEditProjection.js +53 -39
  123. package/dist/internal/index-impl/runtimeOrderEvidenceBinding.js +151 -0
  124. package/dist/internal/index-impl/runtimeOrderProofSurfaces.js +253 -0
  125. package/dist/internal/index-impl/semanticEditCallsiteArgumentMerge.js +319 -0
  126. package/dist/internal/index-impl/semanticEditExplicitSourceReplacement.js +7 -2
  127. package/dist/internal/index-impl/semanticEditProjectionRecord.js +8 -0
  128. package/dist/internal/index-impl/semanticEditReplayDiagnostics.js +7 -2
  129. package/dist/internal/index-impl/semanticEditReplayOutputBinding.js +61 -0
  130. package/dist/internal/index-impl/semanticEditReplayRerunRoute.js +27 -0
  131. package/dist/internal/index-impl/semanticEditReplaySourceReplacement.js +6 -1
  132. package/dist/internal/index-impl/semanticEditRuntimeOrderReasons.js +320 -0
  133. package/dist/internal/index-impl/semanticEditScriptClassification.js +90 -5
  134. package/dist/internal/index-impl/semanticEditScripts.js +42 -5
  135. package/dist/internal/index-impl/semanticEditTypeSyntaxReasons.js +134 -0
  136. package/dist/internal/index-impl/semanticIndexFromNativeDeclarations.js +11 -5
  137. package/dist/internal/index-impl/semanticStructuralDiffRecords.js +150 -0
  138. package/dist/internal/index-impl/sourceMapGeneratedBoundaryGate.js +185 -0
  139. package/dist/internal/index-impl/staticMemberLiteral.js +31 -0
  140. package/dist/internal/index-impl/staticOptionalMemberReference.js +22 -0
  141. package/dist/internal/index-impl/syntaxAstSourcePreservation.js +273 -0
  142. package/dist/internal/index-impl/syntaxCommonJsModuleDeclarationEntries.js +297 -0
  143. package/dist/internal/index-impl/syntaxModuleDeclarationEntries.js +56 -132
  144. package/dist/internal/index-impl/syntaxModuleEntryRecords.js +160 -0
  145. package/dist/internal/index-impl/typeScriptCompilerAdvancedTypeShapes.js +160 -0
  146. package/dist/internal/index-impl/typeScriptCompilerAssignabilityOracle.js +97 -0
  147. package/dist/internal/index-impl/typeScriptCompilerClassApi.js +238 -0
  148. package/dist/internal/index-impl/typeScriptCompilerDecoratorMetadata.js +290 -0
  149. package/dist/internal/index-impl/typeScriptCompilerEnumShape.js +279 -0
  150. package/dist/internal/index-impl/typeScriptCompilerFacts.js +294 -0
  151. package/dist/internal/index-impl/typeScriptCompilerInferenceSyntax.js +170 -0
  152. package/dist/internal/index-impl/typeScriptCompilerReferenceGraph.js +186 -0
  153. package/dist/internal/index-impl/typeScriptCompilerSymbolIdentity.js +294 -0
  154. package/dist/internal/index-impl/typeScriptCompilerTypeReferenceTargets.js +142 -0
  155. package/dist/internal/index-impl/typeScriptDeclaration.js +10 -38
  156. package/dist/internal/index-impl/typeScriptModuleDeclarationEntries.js +52 -15
  157. package/dist/internal/index-impl/typeScriptSourceFilePreservation.js +296 -0
  158. package/dist/js-ts-safe-member-class-invariants.js +247 -0
  159. package/dist/js-ts-safe-member-merge-result.js +23 -3
  160. package/dist/js-ts-safe-member-merge.js +28 -4
  161. package/dist/js-ts-safe-merge-binding-patterns.js +170 -0
  162. package/dist/js-ts-safe-merge-jsx-attribute-fallback.js +151 -157
  163. package/dist/js-ts-safe-merge-jsx-attribute-parser.js +277 -0
  164. package/dist/js-ts-safe-merge-jsx-child-expression-fallback.js +161 -0
  165. package/dist/js-ts-safe-merge-jsx-child-expression-merge.js +319 -0
  166. package/dist/js-ts-safe-merge-jsx-child-expression-parser.js +300 -0
  167. package/dist/js-ts-safe-merge-parse-declarations.js +46 -2
  168. package/dist/js-ts-safe-merge-parse-statements.js +8 -0
  169. package/dist/js-ts-safe-merge-semantic-edit-fallback.js +13 -5
  170. package/dist/js-ts-safe-merge-source-shape-fallbacks.js +3 -1
  171. package/dist/js-ts-safe-merge-top-level-rename-fallback.js +31 -5
  172. package/dist/js-ts-safe-merge-top-level-rename-result.js +7 -2
  173. package/dist/js-ts-safe-merge-variable-declarator-fallback.js +124 -6
  174. package/dist/js-ts-safe-merge-variable-declarator-parser.js +34 -4
  175. package/dist/js-ts-safe-merge.js +136 -0
  176. package/dist/js-ts-safe-project-merge-admission-routes.js +216 -0
  177. package/dist/js-ts-safe-project-merge-admission.js +161 -0
  178. package/dist/js-ts-safe-project-merge-ambient.js +110 -0
  179. package/dist/js-ts-safe-project-merge-core.js +85 -0
  180. package/dist/js-ts-safe-project-merge-css-module-conflicts.js +60 -0
  181. package/dist/js-ts-safe-project-merge-declaration-emit-parity.js +186 -0
  182. package/dist/js-ts-safe-project-merge-declarations.js +227 -0
  183. package/dist/js-ts-safe-project-merge-diagnostics-metadata.js +42 -0
  184. package/dist/js-ts-safe-project-merge-diagnostics-ts.js +73 -0
  185. package/dist/js-ts-safe-project-merge-diagnostics.js +283 -0
  186. package/dist/js-ts-safe-project-merge-evidence-routing.js +38 -0
  187. package/dist/js-ts-safe-project-merge-files.js +70 -0
  188. package/dist/js-ts-safe-project-merge-global-augmentation-compatibility.js +99 -0
  189. package/dist/js-ts-safe-project-merge-graph-conflicts.js +90 -2
  190. package/dist/js-ts-safe-project-merge-graph-delta-commonjs-interop.js +108 -0
  191. package/dist/js-ts-safe-project-merge-graph-delta-compiler-conflicts.js +179 -0
  192. package/dist/js-ts-safe-project-merge-graph-delta-compiler-details.js +189 -0
  193. package/dist/js-ts-safe-project-merge-graph-delta-conflicts.js +51 -184
  194. package/dist/js-ts-safe-project-merge-graph-delta-identity-conflicts.js +202 -0
  195. package/dist/js-ts-safe-project-merge-graph-delta-inference-syntax.js +80 -0
  196. package/dist/js-ts-safe-project-merge-graph-delta-module-declarations.js +155 -0
  197. package/dist/js-ts-safe-project-merge-graph-limits.js +16 -1
  198. package/dist/js-ts-safe-project-merge-graph.js +37 -5
  199. package/dist/js-ts-safe-project-merge-import-removal.js +292 -0
  200. package/dist/js-ts-safe-project-merge-jsx-graph-conflict-details.js +235 -0
  201. package/dist/js-ts-safe-project-merge-jsx-graph-conflicts.js +173 -0
  202. package/dist/js-ts-safe-project-merge-jsx-prop-contracts.js +86 -0
  203. package/dist/js-ts-safe-project-merge-jsx-render-branch-proof.js +189 -0
  204. package/dist/js-ts-safe-project-merge-missing-evidence.js +310 -0
  205. package/dist/js-ts-safe-project-merge-move-rename.js +209 -0
  206. package/dist/js-ts-safe-project-merge-proof-conflicts.js +44 -0
  207. package/dist/js-ts-safe-project-merge-proof-levels.js +320 -0
  208. package/dist/js-ts-safe-project-merge-quality-gates.js +140 -0
  209. package/dist/js-ts-safe-project-merge-routing-calibration.js +125 -0
  210. package/dist/js-ts-safe-project-merge-runtime-region-conflicts.js +156 -0
  211. package/dist/js-ts-safe-project-merge-scope-use-def-conflicts.js +292 -0
  212. package/dist/js-ts-safe-project-merge-semantic-equivalence-proof.js +175 -0
  213. package/dist/js-ts-safe-project-merge-semantic-replay-proof.js +311 -0
  214. package/dist/js-ts-safe-project-merge-semantic-replay-routes.js +179 -0
  215. package/dist/js-ts-safe-project-merge-source-span-conflicts.js +310 -0
  216. package/dist/js-ts-safe-project-merge-source-span-roundtrip-proof.js +172 -0
  217. package/dist/js-ts-safe-project-merge-split-merge-admission.js +96 -0
  218. package/dist/js-ts-safe-project-merge-split-merge-records.js +320 -0
  219. package/dist/js-ts-safe-project-merge-split-merge-shapes.js +234 -0
  220. package/dist/js-ts-safe-project-merge-split-merge.js +218 -0
  221. package/dist/js-ts-safe-project-merge-summary.js +320 -0
  222. package/dist/js-ts-safe-project-merge-symbol-move-admission.js +63 -0
  223. package/dist/js-ts-safe-project-merge-symbol-move-default-admission.js +143 -0
  224. package/dist/js-ts-safe-project-merge-symbol-move-risks.js +213 -0
  225. package/dist/js-ts-safe-project-merge-symbol-move.js +316 -0
  226. package/dist/js-ts-safe-project-merge-symbol-rename-admission.js +59 -0
  227. package/dist/js-ts-safe-project-merge-symbol-rename-default-admission.js +111 -0
  228. package/dist/js-ts-safe-project-merge-symbol-rename.js +319 -0
  229. package/dist/js-ts-safe-project-merge-ts-options.js +205 -0
  230. package/dist/js-ts-safe-project-merge-ts-program.js +268 -0
  231. package/dist/js-ts-safe-project-merge-typed-property-rename-rebase-utils.js +69 -0
  232. package/dist/js-ts-safe-project-merge-typed-property-rename-rebase.js +317 -0
  233. package/dist/js-ts-safe-project-merge-unsupported-surfaces.js +319 -0
  234. package/dist/js-ts-safe-project-merge.js +170 -171
  235. package/dist/js-ts-semantic-scope-use-def-bindings.js +287 -0
  236. package/dist/js-ts-semantic-scope-use-def-scan.js +241 -0
  237. package/dist/js-ts-semantic-scope-use-def-utils.js +132 -0
  238. package/dist/js-ts-semantic-scope-use-def.js +217 -0
  239. package/dist/lightweight-dependency-effects.js +28 -4
  240. package/dist/lightweight-dependency-relations.js +13 -7
  241. package/dist/lightweight-dependency-top-level.js +63 -0
  242. package/dist/native-import-language-profiles.js +27 -1
  243. package/dist/native-js-ts-importers.js +9 -5
  244. package/dist/native-parser-ast-format-profiles.js +12 -0
  245. package/dist/native-parser-html-css-format-profiles.js +85 -0
  246. package/dist/native-region-scanner-core.js +5 -3
  247. package/dist/native-region-scanner-js-commonjs.js +155 -0
  248. package/dist/native-region-scanner-js-imports.js +51 -13
  249. package/dist/native-region-scanner-js-reexports.js +79 -0
  250. package/dist/native-region-scanner-js-ts-helpers.js +23 -0
  251. package/dist/native-source-ledger-helpers.js +1 -1
  252. package/dist/native-source-ledger.js +24 -10
  253. package/dist/native-source-maps-ecma426.js +316 -0
  254. package/dist/native-source-maps.js +36 -6
  255. package/dist/native-source-preservation-ownership.js +292 -0
  256. package/dist/native-source-preservation-scanner.js +63 -25
  257. package/dist/native-source-preservation-types.d.ts +3 -0
  258. package/dist/semantic-import-effect-occurrences.js +242 -0
  259. package/dist/semantic-import-effect-regions.js +95 -58
  260. package/dist/semantic-import-graph-layers.js +224 -0
  261. package/dist/semantic-import-runtime-conditional-evidence.js +135 -0
  262. package/dist/semantic-import-runtime-effect-target-evidence.js +145 -0
  263. package/dist/semantic-import-runtime-exit-evidence.js +32 -0
  264. package/dist/semantic-import-runtime-import-meta-evidence.js +33 -0
  265. package/dist/semantic-import-runtime-mutation-evidence.js +155 -0
  266. package/dist/semantic-import-runtime-order-evidence.js +318 -0
  267. package/dist/semantic-import-runtime-promise-chain-evidence.js +103 -0
  268. package/dist/semantic-import-runtime-promise-combinator-evidence.js +166 -0
  269. package/dist/semantic-import-runtime-reachability-evidence.js +269 -0
  270. package/dist/semantic-import-runtime-resource-management-evidence.js +293 -0
  271. package/dist/semantic-import-runtime-switch-evidence.js +304 -0
  272. package/dist/semantic-import-runtime-throw-evidence.js +44 -0
  273. package/dist/semantic-import-runtime-try-finally-evidence.js +172 -0
  274. package/dist/semantic-import-sidecar-entry.js +4 -0
  275. package/dist/semantic-import-source-preservation.js +6 -2
  276. package/package.json +1 -1
@@ -0,0 +1,202 @@
1
+ import { hashSemanticValue } from '@shapeshift-labs/frontier-lang-kernel';
2
+ import { compactRecord } from './js-ts-safe-merge-context.js';
3
+
4
+ function projectPublicContractDeltaConflicts(baseGraph, workerGraph, headGraph, outputGraph) {
5
+ return changedIdentityConflicts({
6
+ code: 'project-public-contract-delta-conflict',
7
+ label: 'public contract',
8
+ baseRecords: baseGraph.publicContractRegions,
9
+ workerRecords: workerGraph.publicContractRegions,
10
+ headRecords: headGraph.publicContractRegions,
11
+ outputRecords: outputGraph?.publicContractRegions,
12
+ identityKey: publicContractIdentityKey,
13
+ fingerprint: publicContractFingerprint,
14
+ details: publicContractDetails
15
+ });
16
+ }
17
+
18
+ function projectReExportIdentityDeltaConflicts(baseGraph, workerGraph, headGraph, outputGraph) {
19
+ return changedIdentityConflicts({
20
+ code: 'project-re-export-identity-delta-conflict',
21
+ label: 're-export identity',
22
+ baseRecords: baseGraph.reExportIdentities,
23
+ workerRecords: workerGraph.reExportIdentities,
24
+ headRecords: headGraph.reExportIdentities,
25
+ outputRecords: outputGraph?.reExportIdentities,
26
+ identityKey: reExportIdentityKey,
27
+ fingerprint: reExportIdentityFingerprint,
28
+ details: reExportIdentityDetails
29
+ });
30
+ }
31
+
32
+ function projectImportAttributeDeltaConflicts(baseGraph, workerGraph, headGraph, outputGraph) {
33
+ return changedIdentityConflicts({
34
+ code: 'project-import-attribute-delta-conflict',
35
+ label: 'import attributes',
36
+ baseRecords: attributedEdges(baseGraph),
37
+ workerRecords: attributedEdges(workerGraph),
38
+ headRecords: attributedEdges(headGraph),
39
+ outputRecords: attributedEdges(outputGraph),
40
+ identityKey: importAttributeIdentityKey,
41
+ fingerprint: importAttributeFingerprint,
42
+ details: importAttributeDetails
43
+ });
44
+ }
45
+
46
+ function changedIdentityConflicts(input) {
47
+ const base = recordsByIdentityKey(input.baseRecords, input.identityKey);
48
+ const worker = recordsByIdentityKey(input.workerRecords, input.identityKey);
49
+ const head = recordsByIdentityKey(input.headRecords, input.identityKey);
50
+ const output = recordsByIdentityKey(input.outputRecords, input.identityKey);
51
+ const keys = uniqueStrings([...base.keys(), ...worker.keys(), ...head.keys()]);
52
+ return keys.flatMap((identityKey) => {
53
+ const baseRecord = base.get(identityKey);
54
+ const workerRecord = worker.get(identityKey);
55
+ const headRecord = head.get(identityKey);
56
+ const baseFingerprint = optionalFingerprint(baseRecord, input.fingerprint);
57
+ const workerFingerprint = optionalFingerprint(workerRecord, input.fingerprint);
58
+ const headFingerprint = optionalFingerprint(headRecord, input.fingerprint);
59
+ if (baseFingerprint === workerFingerprint || baseFingerprint === headFingerprint || workerFingerprint === headFingerprint) return [];
60
+ return [projectGraphDeltaConflict({
61
+ code: input.code,
62
+ label: input.label,
63
+ identityKey,
64
+ baseRecord,
65
+ workerRecord,
66
+ headRecord,
67
+ outputRecord: output.get(identityKey),
68
+ details: input.details
69
+ })];
70
+ });
71
+ }
72
+
73
+ function projectGraphDeltaConflict(input) {
74
+ const sourcePath = input.workerRecord?.sourcePath ?? input.headRecord?.sourcePath ?? input.baseRecord?.sourcePath;
75
+ const conflictKey = `project-graph-delta#${input.label.replace(/\s+/g, '-')}#${input.identityKey}`;
76
+ return {
77
+ code: input.code,
78
+ gateId: 'project-graph-delta',
79
+ message: `Worker and head both changed ${input.label} ${JSON.stringify(input.identityKey)} in incompatible ways.`,
80
+ sourcePath,
81
+ details: compactRecord({
82
+ reasonCode: input.code,
83
+ conflictKey,
84
+ identityKey: input.identityKey,
85
+ sourcePath,
86
+ base: input.details(input.baseRecord),
87
+ worker: input.details(input.workerRecord),
88
+ head: input.details(input.headRecord),
89
+ output: input.details(input.outputRecord)
90
+ })
91
+ };
92
+ }
93
+
94
+ function recordsByIdentityKey(records, identityKey) {
95
+ const result = new Map();
96
+ for (const record of records ?? []) {
97
+ const key = identityKey(record);
98
+ if (!key || result.has(key)) continue;
99
+ result.set(key, record);
100
+ }
101
+ return result;
102
+ }
103
+
104
+ function publicContractIdentityKey(record) {
105
+ return firstString(
106
+ record?.key,
107
+ stableKey(['public-contract', record?.sourcePath, record?.apiSurfaceKind, record?.edgeKind, record?.moduleSpecifier, record?.exportedName ?? record?.symbolName ?? record?.symbolId])
108
+ );
109
+ }
110
+
111
+ function publicContractFingerprint(record) {
112
+ return hashSemanticValue({
113
+ kind: 'frontier.lang.projectGraphDelta.publicContractFingerprint',
114
+ signatureHash: record.signatureHash,
115
+ symbolName: record.symbolName,
116
+ symbolKind: record.symbolKind,
117
+ apiSurfaceKind: record.apiSurfaceKind,
118
+ exportedName: record.exportedName,
119
+ moduleSpecifier: record.moduleSpecifier,
120
+ edgeKind: record.edgeKind
121
+ });
122
+ }
123
+
124
+ function publicContractDetails(record) {
125
+ if (!record) return undefined;
126
+ return compactRecord({
127
+ sourcePath: record.sourcePath,
128
+ key: publicContractIdentityKey(record),
129
+ symbolName: record.symbolName,
130
+ symbolKind: record.symbolKind,
131
+ apiSurfaceKind: record.apiSurfaceKind,
132
+ exportedName: record.exportedName,
133
+ moduleSpecifier: record.moduleSpecifier,
134
+ edgeKind: record.edgeKind,
135
+ signatureHash: record.signatureHash,
136
+ contractHash: record.contractHash,
137
+ sourceHash: record.sourceHash
138
+ });
139
+ }
140
+
141
+ function reExportIdentityKey(record) {
142
+ return stableKey(['re-export-identity', record?.sourcePath, record?.exportedName ?? record?.localName ?? record?.namespace ?? (record?.exportStar || record?.isExportStar ? '*' : undefined)]);
143
+ }
144
+
145
+ function reExportIdentityFingerprint(record) {
146
+ return hashSemanticValue({
147
+ kind: 'frontier.lang.projectGraphDelta.reExportIdentityFingerprint',
148
+ sourcePath: record.sourcePath,
149
+ moduleSpecifier: record.moduleSpecifier,
150
+ hasImportAttributes: record.hasImportAttributes,
151
+ importAttributeCount: record.importAttributeCount,
152
+ importAttributeKeys: record.importAttributeKeys, importAttributeHash: record.importAttributeHash, importAttributes: record.importAttributes,
153
+ exportedName: record.exportedName,
154
+ importedName: record.importedName,
155
+ localName: record.localName,
156
+ namespace: record.namespace,
157
+ isTypeOnly: record.isTypeOnly,
158
+ exportStar: record.exportStar,
159
+ isExportStar: record.isExportStar,
160
+ originSymbolId: record.originSymbolId,
161
+ exportedSymbolId: record.exportedSymbolId,
162
+ localSymbolId: record.localSymbolId
163
+ });
164
+ }
165
+
166
+ function reExportIdentityDetails(record) {
167
+ if (!record) return undefined;
168
+ return compactRecord({
169
+ sourcePath: record.sourcePath,
170
+ key: reExportIdentityKey(record),
171
+ moduleSpecifier: record.moduleSpecifier,
172
+ hasImportAttributes: record.hasImportAttributes,
173
+ importAttributeCount: record.importAttributeCount,
174
+ importAttributeKeys: record.importAttributeKeys, importAttributeHash: record.importAttributeHash, importAttributes: record.importAttributes,
175
+ exportedName: record.exportedName,
176
+ importedName: record.importedName,
177
+ localName: record.localName,
178
+ namespace: record.namespace,
179
+ isTypeOnly: record.isTypeOnly,
180
+ exportStar: record.exportStar,
181
+ isExportStar: record.isExportStar,
182
+ originSymbolId: record.originSymbolId,
183
+ exportedSymbolId: record.exportedSymbolId,
184
+ localSymbolId: record.localSymbolId,
185
+ sourceHash: record.sourceHash
186
+ });
187
+ }
188
+
189
+ function attributedEdges(graph) { return [...(graph?.importEdges ?? []), ...(graph?.exportEdges ?? [])].filter((edge) => edge?.hasImportAttributes || edge?.importAttributeHash); }
190
+ function importAttributeIdentityKey(edge) { return stableKey(['import-attribute', edge?.predicate, edge?.edgeKind, edge?.sourcePath, edge?.moduleSpecifier, edge?.isTypeOnly]); }
191
+ function importAttributeFingerprint(edge) { return hashSemanticValue({ kind: 'frontier.lang.projectGraphDelta.importAttributeFingerprint', hasImportAttributes: edge.hasImportAttributes, importAttributeCount: edge.importAttributeCount, importAttributeKeys: edge.importAttributeKeys, importAttributeHash: edge.importAttributeHash, importAttributes: edge.importAttributes }); }
192
+ function importAttributeDetails(edge) { if (!edge) return undefined; return compactRecord({ sourcePath: edge.sourcePath, key: importAttributeIdentityKey(edge), predicate: edge.predicate, moduleSpecifier: edge.moduleSpecifier, importedName: edge.importedName, exportedName: edge.exportedName, localName: edge.localName, importKind: edge.importKind, exportKind: edge.exportKind, isTypeOnly: edge.isTypeOnly, hasImportAttributes: edge.hasImportAttributes, importAttributeCount: edge.importAttributeCount, importAttributeKeys: edge.importAttributeKeys, importAttributeHash: edge.importAttributeHash, importAttributes: edge.importAttributes }); }
193
+ function optionalFingerprint(record, fingerprint) { return record ? fingerprint(record) : undefined; }
194
+ function stableKey(parts) { const values = parts.map((part) => part === undefined || part === null ? '' : String(part)); return values.some(Boolean) ? values.join('#') : undefined; }
195
+ function firstString(...values) { for (const value of values) if (value !== undefined && value !== null && String(value)) return String(value); return undefined; }
196
+ function uniqueStrings(values) { return [...new Set(values.filter((value) => typeof value === 'string' && value.length > 0))]; }
197
+
198
+ export {
199
+ projectImportAttributeDeltaConflicts,
200
+ projectPublicContractDeltaConflicts,
201
+ projectReExportIdentityDeltaConflicts
202
+ };
@@ -0,0 +1,80 @@
1
+ import { compactRecord } from './js-ts-safe-merge-context.js';
2
+
3
+ function missingSharedCompilerTypeInferenceSyntaxEvidence(workerRecord, headRecord) {
4
+ const missing = [workerRecord, headRecord].filter((record) => (
5
+ requiresCompilerTypeInferenceSyntaxProof(record) && !hasPassedCompilerTypeInferenceSyntaxProof(record)
6
+ ));
7
+ if (!missing.length) return undefined;
8
+ return {
9
+ reasonCode: 'typescript-public-api-type-inference-syntax-proof-missing',
10
+ requiredEvidence: 'typescript-checker-public-api-type-inference-syntax-evidence',
11
+ semanticEquivalenceClaim: false,
12
+ missingRecords: missing.map(typeInferenceSyntaxMissingProofRecord)
13
+ };
14
+ }
15
+
16
+ function typeInferenceSyntaxMissingProofRecord(record) {
17
+ const proof = record?.typeInferenceSyntaxProof;
18
+ return compactRecord({
19
+ sourcePath: record.sourcePath,
20
+ sourceHash: record.sourceHash,
21
+ symbolId: record.symbolId,
22
+ symbolName: record.symbolName,
23
+ fullyQualifiedName: record.fullyQualifiedName,
24
+ typeInferenceSyntaxHash: record.typeInferenceSyntaxHash,
25
+ typeInferenceSyntaxProofStatus: proof?.status,
26
+ proofTypeInferenceSyntaxHash: proof?.typeInferenceSyntaxHash,
27
+ typeInferenceSyntaxProofSourcePath: proof?.sourcePath,
28
+ typeInferenceSyntaxProofSourceHash: proof?.sourceHash,
29
+ missingSignals: proof?.missingSignals,
30
+ reasonCodes: typeInferenceSyntaxProofReasonCodes(record, proof),
31
+ semanticEquivalenceClaim: proof?.semanticEquivalenceClaim ?? false,
32
+ evidenceIds: record.evidenceIds
33
+ });
34
+ }
35
+
36
+ function requiresCompilerTypeInferenceSyntaxProof(record) {
37
+ return Boolean(record && (
38
+ record.typeInferenceSyntaxCount > 0
39
+ || record.satisfiesExpressionCount > 0
40
+ || record.asConstAssertionCount > 0
41
+ || record.constTypeParameterCount > 0
42
+ || record.typeInferenceSyntaxHash
43
+ || record.typeInferenceSyntaxProof
44
+ ));
45
+ }
46
+
47
+ function hasPassedCompilerTypeInferenceSyntaxProof(record) {
48
+ const proof = record?.typeInferenceSyntaxProof;
49
+ return Boolean(
50
+ record?.typeInferenceSyntaxHash
51
+ && proof?.status === 'passed'
52
+ && proof?.typeInferenceSyntaxHash === record.typeInferenceSyntaxHash
53
+ && record?.sourcePath
54
+ && record?.sourceHash
55
+ && proof?.sourcePath === record.sourcePath
56
+ && proof?.sourceHash === record.sourceHash
57
+ && !arrayValue(proof?.missingSignals).length
58
+ && !arrayValue(proof?.reasonCodes).length
59
+ && proof.autoMergeClaim === false
60
+ && proof.semanticEquivalenceClaim === false
61
+ );
62
+ }
63
+
64
+ function typeInferenceSyntaxProofReasonCodes(record, proof) {
65
+ const reasonCodes = ['typescript-public-api-type-inference-syntax-proof-missing'];
66
+ if (!proof) return reasonCodes;
67
+ if (proof.status !== 'passed') reasonCodes.push('typescript-type-inference-syntax-proof-status-not-passed');
68
+ if (proof.typeInferenceSyntaxHash !== record?.typeInferenceSyntaxHash) reasonCodes.push('typescript-type-inference-syntax-proof-hash-mismatch');
69
+ if (!record?.sourcePath) reasonCodes.push('typescript-type-inference-syntax-record-source-path-missing');
70
+ if (!record?.sourceHash) reasonCodes.push('typescript-type-inference-syntax-record-source-hash-missing');
71
+ if (proof.sourcePath !== record?.sourcePath) reasonCodes.push('typescript-type-inference-syntax-proof-source-path-mismatch');
72
+ if (proof.sourceHash !== record?.sourceHash) reasonCodes.push('typescript-type-inference-syntax-proof-source-hash-mismatch');
73
+ if (proof.autoMergeClaim !== false || proof.semanticEquivalenceClaim !== false) reasonCodes.push('typescript-type-inference-syntax-proof-claim-flags-missing');
74
+ return uniqueStrings([...reasonCodes, ...arrayValue(proof.reasonCodes), ...arrayValue(proof.missingSignals).map((signal) => `typescript-${signal}-missing`)]);
75
+ }
76
+
77
+ function arrayValue(value) { return Array.isArray(value) ? value : []; }
78
+ function uniqueStrings(values) { return [...new Set(values.filter((value) => typeof value === 'string' && value.length > 0))]; }
79
+
80
+ export { missingSharedCompilerTypeInferenceSyntaxEvidence };
@@ -0,0 +1,155 @@
1
+ import { compactRecord } from './js-ts-safe-merge-context.js';
2
+ import { globalAugmentationCompatibilityAssessment, sourceSpanHash } from './js-ts-safe-project-merge-global-augmentation-compatibility.js';
3
+
4
+ function projectModuleDeclarationDeltaConflicts(projectGraphDelta, options = {}) {
5
+ return [
6
+ ...changedShapeConflicts({
7
+ code: 'project-module-declaration-shape-delta-conflict',
8
+ label: 'module declaration shape',
9
+ baseRecords: projectGraphDelta?.stages?.base?.projectSymbolGraph?.moduleDeclarationRecords,
10
+ workerRecords: projectGraphDelta?.stages?.worker?.projectSymbolGraph?.moduleDeclarationRecords,
11
+ headRecords: projectGraphDelta?.stages?.head?.projectSymbolGraph?.moduleDeclarationRecords,
12
+ outputRecords: projectGraphDelta?.stages?.output?.projectSymbolGraph?.moduleDeclarationRecords,
13
+ identityKey: moduleDeclarationIdentityKey,
14
+ details: moduleDeclarationDetails,
15
+ proofAssessment: (identityKey, baseRecord, workerRecord, headRecord, outputRecord) => globalAugmentationDeltaProofAssessment(identityKey, baseRecord, workerRecord, headRecord, outputRecord, options)
16
+ }),
17
+ ...changedShapeConflicts({
18
+ code: 'project-export-assignment-shape-delta-conflict',
19
+ label: 'export assignment shape',
20
+ baseRecords: projectGraphDelta?.stages?.base?.projectSymbolGraph?.exportAssignmentRecords,
21
+ workerRecords: projectGraphDelta?.stages?.worker?.projectSymbolGraph?.exportAssignmentRecords,
22
+ headRecords: projectGraphDelta?.stages?.head?.projectSymbolGraph?.exportAssignmentRecords,
23
+ outputRecords: projectGraphDelta?.stages?.output?.projectSymbolGraph?.exportAssignmentRecords,
24
+ identityKey: exportAssignmentIdentityKey,
25
+ details: exportAssignmentDetails
26
+ })
27
+ ];
28
+ }
29
+
30
+ function changedShapeConflicts(input) {
31
+ const base = recordsByIdentityKey(input.baseRecords, input.identityKey);
32
+ const worker = recordsByIdentityKey(input.workerRecords, input.identityKey);
33
+ const head = recordsByIdentityKey(input.headRecords, input.identityKey);
34
+ const output = recordsByIdentityKey(input.outputRecords, input.identityKey);
35
+ const keys = uniqueStrings([...base.keys(), ...worker.keys(), ...head.keys()]);
36
+ return keys.flatMap((identityKey) => {
37
+ const baseHash = base.get(identityKey)?.shapeHash;
38
+ const workerHash = worker.get(identityKey)?.shapeHash;
39
+ const headHash = head.get(identityKey)?.shapeHash;
40
+ if (baseHash === workerHash || baseHash === headHash || workerHash === headHash) return [];
41
+ const proof = input.proofAssessment?.(identityKey, base.get(identityKey), worker.get(identityKey), head.get(identityKey), output.get(identityKey));
42
+ if (proof?.status === 'passed') return [];
43
+ return [shapeConflict(input, identityKey, base.get(identityKey), worker.get(identityKey), head.get(identityKey), output.get(identityKey), proof)];
44
+ });
45
+ }
46
+
47
+ function shapeConflict(input, identityKey, baseRecord, workerRecord, headRecord, outputRecord, proof = undefined) {
48
+ const sourcePath = workerRecord?.sourcePath ?? headRecord?.sourcePath ?? baseRecord?.sourcePath;
49
+ const conflictKey = `project-graph-delta#${input.label.replace(/\s+/g, '-')}#${identityKey}`;
50
+ return {
51
+ code: input.code,
52
+ gateId: 'project-graph-delta',
53
+ message: `Worker and head both changed ${input.label} ${JSON.stringify(identityKey)} with incompatible static shape evidence.`,
54
+ sourcePath,
55
+ details: compactRecord({
56
+ reasonCode: input.code,
57
+ conflictKey,
58
+ identityKey,
59
+ sourcePath,
60
+ base: input.details(baseRecord),
61
+ worker: input.details(workerRecord),
62
+ head: input.details(headRecord),
63
+ output: input.details(outputRecord),
64
+ requiredProof: 'static-shape-evidence',
65
+ routeId: proof?.routeId,
66
+ routeLane: proof?.routeLane,
67
+ routeNext: proof?.routeNext,
68
+ reasonCodes: proof?.reasonCodes,
69
+ globalAugmentationCompatibilityProof: proof?.record,
70
+ semanticEquivalenceClaim: false
71
+ })
72
+ };
73
+ }
74
+
75
+ function globalAugmentationDeltaProofAssessment(identityKey, baseRecord, workerRecord, headRecord, outputRecord, options) {
76
+ const record = outputRecord ?? workerRecord ?? headRecord ?? baseRecord;
77
+ if (record?.surfaceKind !== 'global-augmentation') return undefined;
78
+ return globalAugmentationCompatibilityAssessment({
79
+ identityKey,
80
+ sourcePath: record.sourcePath,
81
+ sourceHash: record.sourceHash,
82
+ moduleName: record.moduleName,
83
+ surfaceKind: record.surfaceKind,
84
+ moduleDeclarationRecordId: record.id,
85
+ moduleDeclarationShapeHash: record.shapeHash,
86
+ moduleDeclarationSignatureHash: record.signatureHash,
87
+ sourceSpanHash: sourceSpanHash(record.sourceSpan),
88
+ declarationOutputHash: options.declarationEmitParityProof?.outputDeclarationBoundaryHash,
89
+ ...compatibilityGateContext(options)
90
+ }, options);
91
+ }
92
+
93
+ function compatibilityGateContext(options = {}) {
94
+ return compactRecord({
95
+ consumerDiagnosticsPassed: options.outputDiagnosticsGate ? options.outputDiagnosticsGate.status === 'passed' : undefined
96
+ });
97
+ }
98
+
99
+ function moduleDeclarationIdentityKey(record) {
100
+ return stableKey(['module-declaration', record?.sourcePath, record?.surfaceKind, record?.moduleName]);
101
+ }
102
+
103
+ function exportAssignmentIdentityKey(record) {
104
+ return stableKey(['export-assignment', record?.sourcePath, record?.exportKind, record?.exportedName]);
105
+ }
106
+
107
+ function moduleDeclarationDetails(record) {
108
+ if (!record) return undefined;
109
+ return compactRecord({
110
+ sourcePath: record.sourcePath,
111
+ moduleName: record.moduleName,
112
+ surfaceKind: record.surfaceKind,
113
+ declarationOnly: record.declarationOnly,
114
+ runtimeNamespace: record.runtimeNamespace,
115
+ shapeHash: record.shapeHash,
116
+ proofLevel: record.shapeProof?.proofLevel,
117
+ unsupportedSignals: record.shapeProof?.unsupportedSignals,
118
+ semanticEquivalenceClaim: false
119
+ });
120
+ }
121
+
122
+ function exportAssignmentDetails(record) {
123
+ if (!record) return undefined;
124
+ return compactRecord({
125
+ sourcePath: record.sourcePath,
126
+ exportedName: record.exportedName,
127
+ localName: record.localName,
128
+ exportKind: record.exportKind,
129
+ shapeHash: record.shapeHash,
130
+ proofLevel: record.shapeProof?.proofLevel,
131
+ unsupportedSignals: record.shapeProof?.unsupportedSignals,
132
+ semanticEquivalenceClaim: false
133
+ });
134
+ }
135
+
136
+ function recordsByIdentityKey(records, identityKey) {
137
+ const result = new Map();
138
+ for (const record of records ?? []) {
139
+ const key = identityKey(record);
140
+ if (!key || result.has(key)) continue;
141
+ result.set(key, record);
142
+ }
143
+ return result;
144
+ }
145
+
146
+ function stableKey(parts) {
147
+ const values = parts.map((part) => part === undefined || part === null ? '' : String(part));
148
+ return values.some(Boolean) ? values.join('#') : undefined;
149
+ }
150
+
151
+ function uniqueStrings(values) {
152
+ return [...new Set(values.filter((value) => typeof value === 'string' && value.length > 0))];
153
+ }
154
+
155
+ export { projectModuleDeclarationDeltaConflicts };
@@ -6,8 +6,13 @@ const PROJECT_GRAPH_INVALID_LIMIT_CODE = 'project-graph-limit-invalid';
6
6
  const LIMIT_FIELDS = [
7
7
  ['maxFiles', 'source-files'],
8
8
  ['maxSourceBytes', 'source-bytes'],
9
+ ['maxSourceSpans', 'source-spans'],
9
10
  ['maxImportEdges', 'import-edges'],
10
11
  ['maxExportEdges', 'export-edges'],
12
+ ['maxScopeBindings', 'scope-bindings'],
13
+ ['maxScopeReferences', 'scope-references'],
14
+ ['maxJsxElements', 'jsx-elements'],
15
+ ['maxJsxProps', 'jsx-props'],
11
16
  ['maxSerializedBytes', 'serialized-bytes']
12
17
  ];
13
18
 
@@ -58,10 +63,20 @@ function projectGraphInvalidLimitConflicts(limits, stage) {
58
63
 
59
64
  function projectGraphEdgeLimitConflicts(limits, stage, projectSymbolGraph) {
60
65
  const importEdges = Array.isArray(projectSymbolGraph?.importEdges) ? projectSymbolGraph.importEdges.length : 0;
66
+ const sourceSpans = Array.isArray(projectSymbolGraph?.sourceSpanRecords) ? projectSymbolGraph.sourceSpanRecords.length : 0;
61
67
  const exportEdges = Array.isArray(projectSymbolGraph?.exportEdges) ? projectSymbolGraph.exportEdges.length : 0;
68
+ const scopeBindings = Array.isArray(projectSymbolGraph?.scopeBindingRecords) ? projectSymbolGraph.scopeBindingRecords.length : 0;
69
+ const scopeReferences = Array.isArray(projectSymbolGraph?.scopeReferenceRecords) ? projectSymbolGraph.scopeReferenceRecords.length : 0;
70
+ const jsxElements = Array.isArray(projectSymbolGraph?.jsxElementRecords) ? projectSymbolGraph.jsxElementRecords.length : 0;
71
+ const jsxProps = Array.isArray(projectSymbolGraph?.jsxPropRecords) ? projectSymbolGraph.jsxPropRecords.length : 0;
62
72
  return [
63
73
  limitConflict(limits.maxImportEdges, stage, 'import-edges', importEdges),
64
- limitConflict(limits.maxExportEdges, stage, 'export-edges', exportEdges)
74
+ limitConflict(limits.maxSourceSpans, stage, 'source-spans', sourceSpans),
75
+ limitConflict(limits.maxExportEdges, stage, 'export-edges', exportEdges),
76
+ limitConflict(limits.maxScopeBindings, stage, 'scope-bindings', scopeBindings),
77
+ limitConflict(limits.maxScopeReferences, stage, 'scope-references', scopeReferences),
78
+ limitConflict(limits.maxJsxElements, stage, 'jsx-elements', jsxElements),
79
+ limitConflict(limits.maxJsxProps, stage, 'jsx-props', jsxProps)
65
80
  ].filter(Boolean);
66
81
  }
67
82
 
@@ -32,10 +32,21 @@ function createJsTsProjectSafeMergeGraphDelta(input, files, outputFiles, mergeId
32
32
  summary: {
33
33
  stages: Object.keys(stages).length,
34
34
  sourceFiles: sumStageSummary(stageSummaries, 'sourceFiles'),
35
+ sourceFileRecords: sumStageSummary(stageSummaries, 'sourceFileRecords'),
36
+ sourceSpanRecords: sumStageSummary(stageSummaries, 'sourceSpanRecords'),
35
37
  publicContractRegions: sumStageSummary(stageSummaries, 'publicContractRegions'),
36
38
  reExportIdentities: sumStageSummary(stageSummaries, 'reExportIdentities'),
39
+ moduleDeclarationRecords: sumStageSummary(stageSummaries, 'moduleDeclarationRecords'),
40
+ exportAssignmentRecords: sumStageSummary(stageSummaries, 'exportAssignmentRecords'),
37
41
  importEdges: sumStageSummary(stageSummaries, 'importEdges'),
38
42
  exportEdges: sumStageSummary(stageSummaries, 'exportEdges'),
43
+ compilerSymbolRecords: sumStageSummary(stageSummaries, 'compilerSymbolRecords'),
44
+ compilerTypeRecords: sumStageSummary(stageSummaries, 'compilerTypeRecords'),
45
+ runtimeRegionRecords: sumStageSummary(stageSummaries, 'runtimeRegionRecords'),
46
+ scopeBindingRecords: sumStageSummary(stageSummaries, 'scopeBindingRecords'),
47
+ scopeReferenceRecords: sumStageSummary(stageSummaries, 'scopeReferenceRecords'),
48
+ jsxElementRecords: sumStageSummary(stageSummaries, 'jsxElementRecords'),
49
+ jsxPropRecords: sumStageSummary(stageSummaries, 'jsxPropRecords'),
39
50
  unresolvedImportEdges: sumStageSummary(stageSummaries, 'unresolvedImportEdges'),
40
51
  suppliedImports: sumStageSummary(stageSummaries, 'suppliedImports'),
41
52
  matchedSuppliedImports: sumStageSummary(stageSummaries, 'matchedSuppliedImports'),
@@ -68,6 +79,7 @@ function createProjectGraphStageArtifacts(input, files, mergeId, stageName, stag
68
79
  sourcePath: file.sourcePath,
69
80
  sourceText: file.sourceText,
70
81
  sourceHash: file.sourceHash,
82
+ parserTriviaEvidence: file.parserTriviaEvidence,
71
83
  metadata: { semanticImportExpected: true, projectSafeMergeStage: stageName, projectSafeMergeOutput: stageName === 'output' }
72
84
  }));
73
85
  const importSelections = sources.map((source) => {
@@ -164,10 +176,21 @@ function projectGraphStageSummary(stageName, projectSymbolGraph, importSource, s
164
176
  documents: projectSymbolGraph?.documentCount ?? 0,
165
177
  symbols: projectSymbolGraph?.symbolCount ?? 0,
166
178
  fileHashes: projectSymbolGraph?.fileHashes?.length ?? 0,
179
+ sourceFileRecords: projectSymbolGraph?.sourceFileRecords?.length ?? 0,
180
+ sourceSpanRecords: projectSymbolGraph?.sourceSpanRecords?.length ?? 0,
167
181
  importEdges: importEdges.length,
168
182
  exportEdges: projectSymbolGraph?.exportEdges?.length ?? 0,
169
183
  publicContractRegions: projectSymbolGraph?.publicContractRegions?.length ?? 0,
184
+ compilerSymbolRecords: projectSymbolGraph?.compilerSymbolRecords?.length ?? 0,
185
+ compilerTypeRecords: projectSymbolGraph?.compilerTypeRecords?.length ?? 0,
186
+ runtimeRegionRecords: projectSymbolGraph?.runtimeRegionRecords?.length ?? 0,
187
+ scopeBindingRecords: projectSymbolGraph?.scopeBindingRecords?.length ?? 0,
188
+ scopeReferenceRecords: projectSymbolGraph?.scopeReferenceRecords?.length ?? 0,
189
+ jsxElementRecords: projectSymbolGraph?.jsxElementRecords?.length ?? 0,
190
+ jsxPropRecords: projectSymbolGraph?.jsxPropRecords?.length ?? 0,
170
191
  reExportIdentities: projectSymbolGraph?.reExportIdentities?.length ?? 0,
192
+ moduleDeclarationRecords: projectSymbolGraph?.moduleDeclarationRecords?.length ?? 0,
193
+ exportAssignmentRecords: projectSymbolGraph?.exportAssignmentRecords?.length ?? 0,
171
194
  unresolvedImportEdges: importEdges.filter(isMissingProjectImportEdge).length,
172
195
  suppliedImports: importSource.suppliedImports,
173
196
  matchedSuppliedImports: importSource.matchedSuppliedImports,
@@ -188,13 +211,13 @@ function sumStageSummary(stageSummaries, field) {
188
211
  function projectGraphDeltaStageFiles(files, outputFiles, input) {
189
212
  return {
190
213
  base: files
191
- .map((file) => stageFile(file, file.baseSourceText, input))
214
+ .map((file) => stageFile(file, file.baseSourceText, input, 'base'))
192
215
  .filter(Boolean),
193
216
  worker: files
194
- .map((file) => stageFile(file, workerStageSourceText(file), input))
217
+ .map((file) => stageFile(file, workerStageSourceText(file), input, 'worker'))
195
218
  .filter(Boolean),
196
219
  head: files
197
- .map((file) => stageFile(file, headStageSourceText(file), input))
220
+ .map((file) => stageFile(file, headStageSourceText(file), input, 'head'))
198
221
  .filter(Boolean),
199
222
  output: outputFiles
200
223
  };
@@ -210,16 +233,25 @@ function headStageSourceText(file) {
210
233
  return file.headSourceText ?? file.baseSourceText;
211
234
  }
212
235
 
213
- function stageFile(file, sourceText, input) {
236
+ function stageFile(file, sourceText, input, stageName) {
214
237
  if (typeof sourceText !== 'string' || !file.sourcePath) return undefined;
215
238
  return compactRecord({
216
239
  sourcePath: file.sourcePath,
217
240
  language: file.language ?? input.language,
218
241
  sourceText,
219
- sourceHash: hashText(sourceText)
242
+ sourceHash: hashText(sourceText),
243
+ parserTriviaEvidence: parserTriviaEvidenceForStage(file, stageName)
220
244
  });
221
245
  }
222
246
 
247
+ function parserTriviaEvidenceForStage(file, stageName) {
248
+ if (stageName === 'base') return file.baseParserTriviaEvidence ?? file.parserTriviaEvidence;
249
+ if (stageName === 'worker') return file.workerParserTriviaEvidence ?? file.parserTriviaEvidence;
250
+ if (stageName === 'head') return file.headParserTriviaEvidence ?? file.parserTriviaEvidence;
251
+ if (stageName === 'output') return file.outputParserTriviaEvidence ?? file.parserTriviaEvidence;
252
+ return file.parserTriviaEvidence;
253
+ }
254
+
223
255
  function attachProjectSymbolGraph(projectImport, projectSymbolGraph) {
224
256
  return {
225
257
  ...projectImport,