@soundscript/soundscript 0.1.13 → 0.1.15

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 (441) hide show
  1. package/package.json +15 -6
  2. package/project-transform/index.js +2 -0
  3. package/project-transform/index.ts +8 -0
  4. package/project-transform/src/annotation_syntax.js +948 -0
  5. package/project-transform/src/annotation_syntax.ts +1217 -0
  6. package/project-transform/src/build_package.js +475 -0
  7. package/project-transform/src/build_package.ts +683 -0
  8. package/project-transform/src/bundled/portable-web-globals.d.ts +153 -0
  9. package/project-transform/src/bundled/runtime_externs.js +220 -0
  10. package/project-transform/src/bundled/runtime_externs.ts +237 -0
  11. package/project-transform/src/bundled/sound-libs/lib.decorators.d.ts +385 -0
  12. package/project-transform/src/bundled/sound-libs/lib.decorators.legacy.d.ts +22 -0
  13. package/project-transform/src/bundled/sound-libs/lib.dom.asynciterable.d.ts +42 -0
  14. package/project-transform/src/bundled/sound-libs/lib.dom.d.ts +39440 -0
  15. package/project-transform/src/bundled/sound-libs/lib.es2015.collection.d.ts +149 -0
  16. package/project-transform/src/bundled/sound-libs/lib.es2015.core.d.ts +657 -0
  17. package/project-transform/src/bundled/sound-libs/lib.es2015.d.ts +28 -0
  18. package/project-transform/src/bundled/sound-libs/lib.es2015.generator.d.ts +77 -0
  19. package/project-transform/src/bundled/sound-libs/lib.es2015.iterable.d.ts +616 -0
  20. package/project-transform/src/bundled/sound-libs/lib.es2015.promise.d.ts +80 -0
  21. package/project-transform/src/bundled/sound-libs/lib.es2015.proxy.d.ts +128 -0
  22. package/project-transform/src/bundled/sound-libs/lib.es2015.reflect.d.ts +144 -0
  23. package/project-transform/src/bundled/sound-libs/lib.es2015.symbol.d.ts +46 -0
  24. package/project-transform/src/bundled/sound-libs/lib.es2015.symbol.wellknown.d.ts +170 -0
  25. package/project-transform/src/bundled/sound-libs/lib.es2016.array.include.d.ts +116 -0
  26. package/project-transform/src/bundled/sound-libs/lib.es2016.d.ts +21 -0
  27. package/project-transform/src/bundled/sound-libs/lib.es2017.arraybuffer.d.ts +21 -0
  28. package/project-transform/src/bundled/sound-libs/lib.es2017.d.ts +26 -0
  29. package/project-transform/src/bundled/sound-libs/lib.es2017.date.d.ts +31 -0
  30. package/project-transform/src/bundled/sound-libs/lib.es2017.object.d.ts +49 -0
  31. package/project-transform/src/bundled/sound-libs/lib.es2017.string.d.ts +45 -0
  32. package/project-transform/src/bundled/sound-libs/lib.es2017.typedarrays.d.ts +53 -0
  33. package/project-transform/src/bundled/sound-libs/lib.es2018.asyncgenerator.d.ts +77 -0
  34. package/project-transform/src/bundled/sound-libs/lib.es2018.asynciterable.d.ts +57 -0
  35. package/project-transform/src/bundled/sound-libs/lib.es2018.d.ts +24 -0
  36. package/project-transform/src/bundled/sound-libs/lib.es2018.promise.d.ts +30 -0
  37. package/project-transform/src/bundled/sound-libs/lib.es2018.regexp.d.ts +37 -0
  38. package/project-transform/src/bundled/sound-libs/lib.es2019.array.d.ts +79 -0
  39. package/project-transform/src/bundled/sound-libs/lib.es2019.d.ts +24 -0
  40. package/project-transform/src/bundled/sound-libs/lib.es2019.object.d.ts +47 -0
  41. package/project-transform/src/bundled/sound-libs/lib.es2019.string.d.ts +37 -0
  42. package/project-transform/src/bundled/sound-libs/lib.es2019.symbol.d.ts +24 -0
  43. package/project-transform/src/bundled/sound-libs/lib.es2020.bigint.d.ts +765 -0
  44. package/project-transform/src/bundled/sound-libs/lib.es2020.d.ts +27 -0
  45. package/project-transform/src/bundled/sound-libs/lib.es2020.date.d.ts +42 -0
  46. package/project-transform/src/bundled/sound-libs/lib.es2020.number.d.ts +28 -0
  47. package/project-transform/src/bundled/sound-libs/lib.es2020.promise.d.ts +49 -0
  48. package/project-transform/src/bundled/sound-libs/lib.es2020.string.d.ts +44 -0
  49. package/project-transform/src/bundled/sound-libs/lib.es2020.symbol.wellknown.d.ts +41 -0
  50. package/project-transform/src/bundled/sound-libs/lib.es2021.d.ts +23 -0
  51. package/project-transform/src/bundled/sound-libs/lib.es2021.promise.d.ts +48 -0
  52. package/project-transform/src/bundled/sound-libs/lib.es2021.string.d.ts +33 -0
  53. package/project-transform/src/bundled/sound-libs/lib.es2021.weakref.d.ts +78 -0
  54. package/project-transform/src/bundled/sound-libs/lib.es2022.array.d.ts +121 -0
  55. package/project-transform/src/bundled/sound-libs/lib.es2022.d.ts +25 -0
  56. package/project-transform/src/bundled/sound-libs/lib.es2022.error.d.ts +75 -0
  57. package/project-transform/src/bundled/sound-libs/lib.es2022.object.d.ts +26 -0
  58. package/project-transform/src/bundled/sound-libs/lib.es2022.regexp.d.ts +39 -0
  59. package/project-transform/src/bundled/sound-libs/lib.es2022.string.d.ts +25 -0
  60. package/project-transform/src/bundled/sound-libs/lib.es2023.array.d.ts +924 -0
  61. package/project-transform/src/bundled/sound-libs/lib.es2023.collection.d.ts +21 -0
  62. package/project-transform/src/bundled/sound-libs/lib.es2023.d.ts +22 -0
  63. package/project-transform/src/bundled/sound-libs/lib.es2024.arraybuffer.d.ts +65 -0
  64. package/project-transform/src/bundled/sound-libs/lib.es2024.collection.d.ts +29 -0
  65. package/project-transform/src/bundled/sound-libs/lib.es2024.d.ts +26 -0
  66. package/project-transform/src/bundled/sound-libs/lib.es2024.object.d.ts +33 -0
  67. package/project-transform/src/bundled/sound-libs/lib.es2024.promise.d.ts +35 -0
  68. package/project-transform/src/bundled/sound-libs/lib.es2024.regexp.d.ts +25 -0
  69. package/project-transform/src/bundled/sound-libs/lib.es2024.string.d.ts +29 -0
  70. package/project-transform/src/bundled/sound-libs/lib.es5.d.ts +4924 -0
  71. package/project-transform/src/bundled/sound_stdlib.js +142 -0
  72. package/project-transform/src/bundled/sound_stdlib.ts +180 -0
  73. package/project-transform/src/checker/analyze_project.js +1361 -0
  74. package/project-transform/src/checker/analyze_project.ts +2246 -0
  75. package/project-transform/src/checker/diagnostics.js +112 -0
  76. package/project-transform/src/checker/diagnostics.ts +222 -0
  77. package/project-transform/src/checker/engine/context.js +235 -0
  78. package/project-transform/src/checker/engine/context.ts +340 -0
  79. package/project-transform/src/checker/engine/diagnostic_codes.js +72 -0
  80. package/project-transform/src/checker/engine/diagnostic_codes.ts +95 -0
  81. package/project-transform/src/checker/engine/facts.js +35 -0
  82. package/project-transform/src/checker/engine/facts.ts +48 -0
  83. package/project-transform/src/checker/engine/types.js +1 -0
  84. package/project-transform/src/checker/engine/types.ts +485 -0
  85. package/project-transform/src/checker/proof_escape_hatch_diagnostics.js +104 -0
  86. package/project-transform/src/checker/proof_escape_hatch_diagnostics.ts +173 -0
  87. package/project-transform/src/checker/rules/async_surface.js +231 -0
  88. package/project-transform/src/checker/rules/async_surface.ts +335 -0
  89. package/project-transform/src/checker/rules/class_lifecycle.js +798 -0
  90. package/project-transform/src/checker/rules/class_lifecycle.ts +1276 -0
  91. package/project-transform/src/checker/rules/directive_validation.js +571 -0
  92. package/project-transform/src/checker/rules/directive_validation.ts +938 -0
  93. package/project-transform/src/checker/rules/directives.js +23 -0
  94. package/project-transform/src/checker/rules/directives.ts +25 -0
  95. package/project-transform/src/checker/rules/flow.js +202 -0
  96. package/project-transform/src/checker/rules/flow.ts +333 -0
  97. package/project-transform/src/checker/rules/flow_facts.js +601 -0
  98. package/project-transform/src/checker/rules/flow_facts.ts +978 -0
  99. package/project-transform/src/checker/rules/flow_invalidation.js +1119 -0
  100. package/project-transform/src/checker/rules/flow_invalidation.ts +2150 -0
  101. package/project-transform/src/checker/rules/flow_shared.js +2822 -0
  102. package/project-transform/src/checker/rules/flow_shared.ts +4383 -0
  103. package/project-transform/src/checker/rules/foreign_boundary.js +120 -0
  104. package/project-transform/src/checker/rules/foreign_boundary.ts +196 -0
  105. package/project-transform/src/checker/rules/foreign_projection.js +279 -0
  106. package/project-transform/src/checker/rules/foreign_projection.ts +425 -0
  107. package/project-transform/src/checker/rules/generated_helpers.js +13 -0
  108. package/project-transform/src/checker/rules/generated_helpers.ts +18 -0
  109. package/project-transform/src/checker/rules/index.js +35 -0
  110. package/project-transform/src/checker/rules/index.ts +49 -0
  111. package/project-transform/src/checker/rules/namespace_object.js +845 -0
  112. package/project-transform/src/checker/rules/namespace_object.ts +1224 -0
  113. package/project-transform/src/checker/rules/non_ordinary_recovery.js +1328 -0
  114. package/project-transform/src/checker/rules/non_ordinary_recovery.ts +2391 -0
  115. package/project-transform/src/checker/rules/null_prototype.js +3 -0
  116. package/project-transform/src/checker/rules/null_prototype.ts +6 -0
  117. package/project-transform/src/checker/rules/overloads.js +181 -0
  118. package/project-transform/src/checker/rules/overloads.ts +317 -0
  119. package/project-transform/src/checker/rules/predicate_verification.js +691 -0
  120. package/project-transform/src/checker/rules/predicate_verification.ts +1088 -0
  121. package/project-transform/src/checker/rules/prototype_hardening.js +237 -0
  122. package/project-transform/src/checker/rules/prototype_hardening.ts +343 -0
  123. package/project-transform/src/checker/rules/receiver_discipline.js +263 -0
  124. package/project-transform/src/checker/rules/receiver_discipline.ts +356 -0
  125. package/project-transform/src/checker/rules/relations.js +6861 -0
  126. package/project-transform/src/checker/rules/relations.ts +12158 -0
  127. package/project-transform/src/checker/rules/resolved_builtins.js +274 -0
  128. package/project-transform/src/checker/rules/resolved_builtins.ts +438 -0
  129. package/project-transform/src/checker/rules/trust.js +217 -0
  130. package/project-transform/src/checker/rules/trust.ts +301 -0
  131. package/project-transform/src/checker/rules/type_guards.js +173 -0
  132. package/project-transform/src/checker/rules/type_guards.ts +257 -0
  133. package/project-transform/src/checker/rules/universal.js +17 -0
  134. package/project-transform/src/checker/rules/universal.ts +22 -0
  135. package/project-transform/src/checker/rules/unsafe_value_origin.js +80 -0
  136. package/project-transform/src/checker/rules/unsafe_value_origin.ts +125 -0
  137. package/project-transform/src/checker/rules/unsound_imports.js +218 -0
  138. package/project-transform/src/checker/rules/unsound_imports.ts +301 -0
  139. package/project-transform/src/checker/rules/unsound_syntax.js +1695 -0
  140. package/project-transform/src/checker/rules/unsound_syntax.ts +2540 -0
  141. package/project-transform/src/checker/rules/value_types.js +206 -0
  142. package/project-transform/src/checker/rules/value_types.ts +407 -0
  143. package/project-transform/src/checker/timing.js +43 -0
  144. package/project-transform/src/checker/timing.ts +78 -0
  145. package/project-transform/src/checker/unsupported_feature_messages.js +337 -0
  146. package/project-transform/src/checker/unsupported_feature_messages.ts +531 -0
  147. package/project-transform/src/cli.js +892 -0
  148. package/project-transform/src/cli.ts +1476 -0
  149. package/project-transform/src/compiler/compile_project.js +319 -0
  150. package/project-transform/src/compiler/compile_project.ts +508 -0
  151. package/project-transform/src/compiler/errors.js +10 -0
  152. package/project-transform/src/compiler/errors.ts +29 -0
  153. package/project-transform/src/compiler/ir.js +1 -0
  154. package/project-transform/src/compiler/ir.ts +1526 -0
  155. package/project-transform/src/compiler/lower.js +30550 -0
  156. package/project-transform/src/compiler/lower.ts +43645 -0
  157. package/project-transform/src/compiler/lower_arrays.js +140 -0
  158. package/project-transform/src/compiler/lower_arrays.ts +190 -0
  159. package/project-transform/src/compiler/lower_strings.js +121 -0
  160. package/project-transform/src/compiler/lower_strings.ts +198 -0
  161. package/project-transform/src/compiler/lower_tagged.js +329 -0
  162. package/project-transform/src/compiler/lower_tagged.ts +427 -0
  163. package/project-transform/src/compiler/lower_views.js +171 -0
  164. package/project-transform/src/compiler/lower_views.ts +251 -0
  165. package/project-transform/src/compiler/object_keys.js +25 -0
  166. package/project-transform/src/compiler/object_keys.ts +35 -0
  167. package/project-transform/src/compiler/runtime_ir.js +30 -0
  168. package/project-transform/src/compiler/runtime_ir.ts +727 -0
  169. package/project-transform/src/compiler/tagged_boundary.js +18 -0
  170. package/project-transform/src/compiler/tagged_boundary.ts +37 -0
  171. package/project-transform/src/compiler/toolchain.js +170 -0
  172. package/project-transform/src/compiler/toolchain.ts +229 -0
  173. package/project-transform/src/compiler/unicode_case_data.js +2102 -0
  174. package/project-transform/src/compiler/unicode_case_data.ts +2112 -0
  175. package/project-transform/src/compiler/wasm_js_host_runtime.js +656 -0
  176. package/project-transform/src/compiler/wasm_js_host_runtime.ts +762 -0
  177. package/project-transform/src/compiler/wat_arrays.js +3132 -0
  178. package/project-transform/src/compiler/wat_arrays.ts +3768 -0
  179. package/project-transform/src/compiler/wat_emitter.js +17952 -0
  180. package/project-transform/src/compiler/wat_emitter.ts +22812 -0
  181. package/project-transform/src/compiler/wat_strings.js +129 -0
  182. package/project-transform/src/compiler/wat_strings.ts +187 -0
  183. package/project-transform/src/compiler/wat_tagged.js +548 -0
  184. package/project-transform/src/compiler/wat_tagged.ts +674 -0
  185. package/project-transform/src/compiler_generator_runner.js +153 -0
  186. package/project-transform/src/compiler_generator_runner.ts +171 -0
  187. package/project-transform/src/compiler_object_test_helpers.js +69 -0
  188. package/project-transform/src/compiler_object_test_helpers.ts +96 -0
  189. package/project-transform/src/compiler_promise_runner.js +2116 -0
  190. package/project-transform/src/compiler_promise_runner.ts +2184 -0
  191. package/project-transform/src/compiler_test_helpers.js +854 -0
  192. package/project-transform/src/compiler_test_helpers.ts +1087 -0
  193. package/project-transform/src/config.js +568 -0
  194. package/project-transform/src/config.ts +892 -0
  195. package/project-transform/src/diagnostic_metadata.js +67 -0
  196. package/project-transform/src/diagnostic_metadata.ts +99 -0
  197. package/project-transform/src/diagnostic_reference.js +1368 -0
  198. package/project-transform/src/diagnostic_reference.ts +1523 -0
  199. package/project-transform/src/editor_diagnostics_worker.js +176 -0
  200. package/project-transform/src/editor_diagnostics_worker.ts +250 -0
  201. package/project-transform/src/editor_projection.js +224 -0
  202. package/project-transform/src/editor_projection.ts +421 -0
  203. package/project-transform/src/frontend/builtin_expanded_program_test_cleanup.js +47 -0
  204. package/project-transform/src/frontend/builtin_expanded_program_test_cleanup.ts +72 -0
  205. package/project-transform/src/frontend/builtin_macro_support.js +842 -0
  206. package/project-transform/src/frontend/builtin_macro_support.ts +1386 -0
  207. package/project-transform/src/frontend/builtin_macros.js +409 -0
  208. package/project-transform/src/frontend/builtin_macros.ts +542 -0
  209. package/project-transform/src/frontend/component_poc_runtime.js +279 -0
  210. package/project-transform/src/frontend/component_poc_runtime.ts +372 -0
  211. package/project-transform/src/frontend/css_macro.js +148 -0
  212. package/project-transform/src/frontend/css_macro.ts +222 -0
  213. package/project-transform/src/frontend/derive_macros.js +2072 -0
  214. package/project-transform/src/frontend/derive_macros.ts +3188 -0
  215. package/project-transform/src/frontend/embedded_fragment_support.js +106 -0
  216. package/project-transform/src/frontend/embedded_fragment_support.ts +172 -0
  217. package/project-transform/src/frontend/error_normalization.js +403 -0
  218. package/project-transform/src/frontend/error_normalization.ts +832 -0
  219. package/project-transform/src/frontend/error_stdlib_support.js +1 -0
  220. package/project-transform/src/frontend/error_stdlib_support.ts +6 -0
  221. package/project-transform/src/frontend/expand_project.js +169 -0
  222. package/project-transform/src/frontend/expand_project.ts +248 -0
  223. package/project-transform/src/frontend/format_soundscript.js +297 -0
  224. package/project-transform/src/frontend/format_soundscript.ts +582 -0
  225. package/project-transform/src/frontend/graphql_macro.js +174 -0
  226. package/project-transform/src/frontend/graphql_macro.ts +253 -0
  227. package/project-transform/src/frontend/hash_context.js +83 -0
  228. package/project-transform/src/frontend/hash_context.ts +113 -0
  229. package/project-transform/src/frontend/hkt_macro.js +448 -0
  230. package/project-transform/src/frontend/hkt_macro.ts +897 -0
  231. package/project-transform/src/frontend/import_binding_usage.js +190 -0
  232. package/project-transform/src/frontend/import_binding_usage.ts +277 -0
  233. package/project-transform/src/frontend/macro_advanced_backend_adapter.js +58 -0
  234. package/project-transform/src/frontend/macro_advanced_backend_adapter.ts +123 -0
  235. package/project-transform/src/frontend/macro_advanced_context.js +826 -0
  236. package/project-transform/src/frontend/macro_advanced_context.ts +1102 -0
  237. package/project-transform/src/frontend/macro_advanced_output.js +21 -0
  238. package/project-transform/src/frontend/macro_advanced_output.ts +41 -0
  239. package/project-transform/src/frontend/macro_api.js +353 -0
  240. package/project-transform/src/frontend/macro_api.ts +1722 -0
  241. package/project-transform/src/frontend/macro_api_internal.js +35 -0
  242. package/project-transform/src/frontend/macro_api_internal.ts +80 -0
  243. package/project-transform/src/frontend/macro_api_module_support.js +39 -0
  244. package/project-transform/src/frontend/macro_api_module_support.ts +65 -0
  245. package/project-transform/src/frontend/macro_backend_adapter.js +272 -0
  246. package/project-transform/src/frontend/macro_backend_adapter.ts +420 -0
  247. package/project-transform/src/frontend/macro_context.js +816 -0
  248. package/project-transform/src/frontend/macro_context.ts +1105 -0
  249. package/project-transform/src/frontend/macro_debug.js +99 -0
  250. package/project-transform/src/frontend/macro_debug.ts +157 -0
  251. package/project-transform/src/frontend/macro_definition_support.js +28 -0
  252. package/project-transform/src/frontend/macro_definition_support.ts +73 -0
  253. package/project-transform/src/frontend/macro_errors.js +40 -0
  254. package/project-transform/src/frontend/macro_errors.ts +70 -0
  255. package/project-transform/src/frontend/macro_expander.js +919 -0
  256. package/project-transform/src/frontend/macro_expander.ts +1611 -0
  257. package/project-transform/src/frontend/macro_factory_support.js +176 -0
  258. package/project-transform/src/frontend/macro_factory_support.ts +263 -0
  259. package/project-transform/src/frontend/macro_host_ast_internal.js +64 -0
  260. package/project-transform/src/frontend/macro_host_ast_internal.ts +109 -0
  261. package/project-transform/src/frontend/macro_index.js +27 -0
  262. package/project-transform/src/frontend/macro_index.ts +50 -0
  263. package/project-transform/src/frontend/macro_loader.js +281 -0
  264. package/project-transform/src/frontend/macro_loader.ts +506 -0
  265. package/project-transform/src/frontend/macro_operand_semantics.js +838 -0
  266. package/project-transform/src/frontend/macro_operand_semantics.ts +1489 -0
  267. package/project-transform/src/frontend/macro_output.js +54 -0
  268. package/project-transform/src/frontend/macro_output.ts +123 -0
  269. package/project-transform/src/frontend/macro_parser.js +611 -0
  270. package/project-transform/src/frontend/macro_parser.ts +832 -0
  271. package/project-transform/src/frontend/macro_resolver.js +69 -0
  272. package/project-transform/src/frontend/macro_resolver.ts +125 -0
  273. package/project-transform/src/frontend/macro_rewrite.js +285 -0
  274. package/project-transform/src/frontend/macro_rewrite.ts +442 -0
  275. package/project-transform/src/frontend/macro_runtime_support.js +232 -0
  276. package/project-transform/src/frontend/macro_runtime_support.ts +324 -0
  277. package/project-transform/src/frontend/macro_scanner.js +393 -0
  278. package/project-transform/src/frontend/macro_scanner.ts +455 -0
  279. package/project-transform/src/frontend/macro_semantic_backend_adapter.js +87 -0
  280. package/project-transform/src/frontend/macro_semantic_backend_adapter.ts +166 -0
  281. package/project-transform/src/frontend/macro_semantic_context.js +5 -0
  282. package/project-transform/src/frontend/macro_semantic_context.ts +12 -0
  283. package/project-transform/src/frontend/macro_semantic_output.js +24 -0
  284. package/project-transform/src/frontend/macro_semantic_output.ts +47 -0
  285. package/project-transform/src/frontend/macro_semantic_types.js +1 -0
  286. package/project-transform/src/frontend/macro_semantic_types.ts +98 -0
  287. package/project-transform/src/frontend/macro_semantics.js +1172 -0
  288. package/project-transform/src/frontend/macro_semantics.ts +1502 -0
  289. package/project-transform/src/frontend/macro_site_kind_support.js +164 -0
  290. package/project-transform/src/frontend/macro_site_kind_support.ts +255 -0
  291. package/project-transform/src/frontend/macro_syntax_internal.js +1950 -0
  292. package/project-transform/src/frontend/macro_syntax_internal.ts +3338 -0
  293. package/project-transform/src/frontend/macro_templates.js +57 -0
  294. package/project-transform/src/frontend/macro_templates.ts +143 -0
  295. package/project-transform/src/frontend/macro_test_helpers.js +82 -0
  296. package/project-transform/src/frontend/macro_test_helpers.ts +136 -0
  297. package/project-transform/src/frontend/macro_types.js +1 -0
  298. package/project-transform/src/frontend/macro_types.ts +103 -0
  299. package/project-transform/src/frontend/macro_vm.js +39 -0
  300. package/project-transform/src/frontend/macro_vm.ts +113 -0
  301. package/project-transform/src/frontend/match_macro.js +885 -0
  302. package/project-transform/src/frontend/match_macro.ts +1220 -0
  303. package/project-transform/src/frontend/numeric_normalization.js +824 -0
  304. package/project-transform/src/frontend/numeric_normalization.ts +1380 -0
  305. package/project-transform/src/frontend/numeric_prelude.js +278 -0
  306. package/project-transform/src/frontend/numeric_prelude.ts +370 -0
  307. package/project-transform/src/frontend/project_frontend.js +2396 -0
  308. package/project-transform/src/frontend/project_frontend.ts +3776 -0
  309. package/project-transform/src/frontend/project_macro_support.js +1401 -0
  310. package/project-transform/src/frontend/project_macro_support.ts +2137 -0
  311. package/project-transform/src/frontend/sql_macro.js +175 -0
  312. package/project-transform/src/frontend/sql_macro.ts +254 -0
  313. package/project-transform/src/frontend/sql_stdlib_support.js +1 -0
  314. package/project-transform/src/frontend/sql_stdlib_support.ts +6 -0
  315. package/project-transform/src/frontend/std_package_support.js +228 -0
  316. package/project-transform/src/frontend/std_package_support.ts +400 -0
  317. package/project-transform/src/frontend/value_normalization.js +306 -0
  318. package/project-transform/src/frontend/value_normalization.ts +599 -0
  319. package/project-transform/src/lsp/project_service.js +4771 -0
  320. package/project-transform/src/lsp/project_service.ts +7580 -0
  321. package/project-transform/src/lsp/protocol.js +9 -0
  322. package/project-transform/src/lsp/protocol.ts +38 -0
  323. package/project-transform/src/lsp/server.js +355 -0
  324. package/project-transform/src/lsp/server.ts +671 -0
  325. package/project-transform/src/lsp/session.js +49 -0
  326. package/project-transform/src/lsp/session.ts +48 -0
  327. package/project-transform/src/lsp/timing.js +43 -0
  328. package/project-transform/src/lsp/timing.ts +76 -0
  329. package/project-transform/src/lsp/transport.js +205 -0
  330. package/project-transform/src/lsp/transport.ts +253 -0
  331. package/project-transform/src/lsp_main.js +5 -0
  332. package/project-transform/src/lsp_main.ts +7 -0
  333. package/project-transform/src/macros.d.ts +1 -0
  334. package/project-transform/src/macros.js +1 -0
  335. package/project-transform/src/macros.ts +1 -0
  336. package/project-transform/src/main.js +24 -0
  337. package/project-transform/src/main.ts +28 -0
  338. package/project-transform/src/platform/host.js +264 -0
  339. package/project-transform/src/platform/host.ts +343 -0
  340. package/project-transform/src/platform/path.js +8 -0
  341. package/project-transform/src/platform/path.ts +20 -0
  342. package/project-transform/src/public_macro_api/macro_api.d.ts +1054 -0
  343. package/project-transform/src/public_macro_api/macro_semantic_types.d.ts +66 -0
  344. package/project-transform/src/public_macro_api/macro_types.d.ts +70 -0
  345. package/project-transform/src/run_program.js +14 -0
  346. package/project-transform/src/run_program.ts +33 -0
  347. package/project-transform/src/runtime/materialize.js +371 -0
  348. package/project-transform/src/runtime/materialize.ts +502 -0
  349. package/project-transform/src/runtime/on_demand.js +203 -0
  350. package/project-transform/src/runtime/on_demand.ts +305 -0
  351. package/project-transform/src/runtime/source_maps.js +205 -0
  352. package/project-transform/src/runtime/source_maps.ts +297 -0
  353. package/project-transform/src/runtime/transform.js +148 -0
  354. package/project-transform/src/runtime/transform.ts +295 -0
  355. package/project-transform/src/service/types.js +1 -0
  356. package/project-transform/src/service/types.ts +22 -0
  357. package/project-transform/src/soundscript_packages.js +477 -0
  358. package/project-transform/src/soundscript_packages.ts +754 -0
  359. package/project-transform/src/soundscript_runtime_specifiers.js +88 -0
  360. package/project-transform/src/soundscript_runtime_specifiers.ts +96 -0
  361. package/project-transform/src/stdlib/async.d.ts +81 -0
  362. package/project-transform/src/stdlib/async.js +213 -0
  363. package/project-transform/src/stdlib/async.ts +315 -0
  364. package/project-transform/src/stdlib/codec.d.ts +32 -0
  365. package/project-transform/src/stdlib/codec.js +30 -0
  366. package/project-transform/src/stdlib/codec.ts +76 -0
  367. package/project-transform/src/stdlib/compare.d.ts +28 -0
  368. package/project-transform/src/stdlib/compare.js +115 -0
  369. package/project-transform/src/stdlib/compare.ts +151 -0
  370. package/project-transform/src/stdlib/css.d.ts +16 -0
  371. package/project-transform/src/stdlib/css.js +9 -0
  372. package/project-transform/src/stdlib/css.ts +28 -0
  373. package/project-transform/src/stdlib/debug.d.ts +2 -0
  374. package/project-transform/src/stdlib/debug.js +9 -0
  375. package/project-transform/src/stdlib/debug.ts +10 -0
  376. package/project-transform/src/stdlib/decode.d.ts +86 -0
  377. package/project-transform/src/stdlib/decode.js +254 -0
  378. package/project-transform/src/stdlib/decode.ts +390 -0
  379. package/project-transform/src/stdlib/derive.d.ts +6 -0
  380. package/project-transform/src/stdlib/derive.js +7 -0
  381. package/project-transform/src/stdlib/derive.ts +7 -0
  382. package/project-transform/src/stdlib/encode.d.ts +100 -0
  383. package/project-transform/src/stdlib/encode.js +130 -0
  384. package/project-transform/src/stdlib/encode.ts +259 -0
  385. package/project-transform/src/stdlib/failures.d.ts +23 -0
  386. package/project-transform/src/stdlib/failures.js +41 -0
  387. package/project-transform/src/stdlib/failures.ts +64 -0
  388. package/project-transform/src/stdlib/fetch.d.ts +67 -0
  389. package/project-transform/src/stdlib/fetch.js +5 -0
  390. package/project-transform/src/stdlib/fetch.ts +11 -0
  391. package/project-transform/src/stdlib/graphql.d.ts +16 -0
  392. package/project-transform/src/stdlib/graphql.js +9 -0
  393. package/project-transform/src/stdlib/graphql.ts +28 -0
  394. package/project-transform/src/stdlib/hash.d.ts +34 -0
  395. package/project-transform/src/stdlib/hash.js +110 -0
  396. package/project-transform/src/stdlib/hash.ts +188 -0
  397. package/project-transform/src/stdlib/hkt.d.ts +40 -0
  398. package/project-transform/src/stdlib/hkt.js +3 -0
  399. package/project-transform/src/stdlib/hkt.ts +41 -0
  400. package/project-transform/src/stdlib/index.d.ts +9 -0
  401. package/project-transform/src/stdlib/index.js +15 -0
  402. package/project-transform/src/stdlib/index.ts +23 -0
  403. package/project-transform/src/stdlib/json.d.ts +125 -0
  404. package/project-transform/src/stdlib/json.js +764 -0
  405. package/project-transform/src/stdlib/json.ts +1034 -0
  406. package/project-transform/src/stdlib/match.d.ts +11 -0
  407. package/project-transform/src/stdlib/match.js +13 -0
  408. package/project-transform/src/stdlib/match.ts +26 -0
  409. package/project-transform/src/stdlib/numerics.d.ts +523 -0
  410. package/project-transform/src/stdlib/numerics.js +1356 -0
  411. package/project-transform/src/stdlib/numerics.ts +1937 -0
  412. package/project-transform/src/stdlib/random.d.ts +19 -0
  413. package/project-transform/src/stdlib/random.js +3 -0
  414. package/project-transform/src/stdlib/random.ts +5 -0
  415. package/project-transform/src/stdlib/result.d.ts +68 -0
  416. package/project-transform/src/stdlib/result.js +139 -0
  417. package/project-transform/src/stdlib/result.ts +248 -0
  418. package/project-transform/src/stdlib/sql.d.ts +22 -0
  419. package/project-transform/src/stdlib/sql.js +23 -0
  420. package/project-transform/src/stdlib/sql.ts +53 -0
  421. package/project-transform/src/stdlib/text.d.ts +24 -0
  422. package/project-transform/src/stdlib/text.js +3 -0
  423. package/project-transform/src/stdlib/text.ts +4 -0
  424. package/project-transform/src/stdlib/thunk.d.ts +2 -0
  425. package/project-transform/src/stdlib/thunk.js +9 -0
  426. package/project-transform/src/stdlib/thunk.ts +15 -0
  427. package/project-transform/src/stdlib/typeclasses.d.ts +57 -0
  428. package/project-transform/src/stdlib/typeclasses.js +78 -0
  429. package/project-transform/src/stdlib/typeclasses.ts +173 -0
  430. package/project-transform/src/stdlib/url.d.ts +37 -0
  431. package/project-transform/src/stdlib/url.js +3 -0
  432. package/project-transform/src/stdlib/url.ts +4 -0
  433. package/project-transform/src/stdlib/value.d.ts +9 -0
  434. package/project-transform/src/stdlib/value.js +104 -0
  435. package/project-transform/src/stdlib/value.ts +133 -0
  436. package/project-transform/src/test_installed_stdlib.js +147 -0
  437. package/project-transform/src/test_installed_stdlib.ts +245 -0
  438. package/project-transform/src/test_macro_package_fixture.js +50 -0
  439. package/project-transform/src/test_macro_package_fixture.ts +68 -0
  440. package/project-transform/src/value_deep_safe.js +191 -0
  441. package/project-transform/src/value_deep_safe.ts +273 -0
@@ -0,0 +1,1523 @@
1
+ export interface DiagnosticSuggestion {
2
+ applicability: 'manual';
3
+ message: string;
4
+ source: 'hint' | 'reference';
5
+ title: string;
6
+ }
7
+
8
+ export interface DiagnosticRepairExample {
9
+ bad: string;
10
+ good: string;
11
+ }
12
+
13
+ export interface DiagnosticReference {
14
+ code: string;
15
+ details: string[];
16
+ examples?: DiagnosticRepairExample[];
17
+ repairHeuristic?: string;
18
+ summary: string;
19
+ suggestions: Array<Omit<DiagnosticSuggestion, 'source'>>;
20
+ title: string;
21
+ }
22
+
23
+ const DIAGNOSTIC_REFERENCES = {
24
+ SOUND1001: {
25
+ code: 'SOUND1001',
26
+ title: 'Type `any` is not allowed',
27
+ summary:
28
+ 'soundscript bans `any` because it erases the information needed to preserve soundness.',
29
+ repairHeuristic:
30
+ 'Replace `any` with the most honest type you can name. Use `unknown` at trust boundaries, then narrow or validate before use; if you already know the shape, spell the exact type directly.',
31
+ details: [
32
+ 'Replace `any` with a concrete type when you know the shape.',
33
+ 'Use `unknown` at trust boundaries, then narrow with runtime checks before use.',
34
+ 'If the value is coming from an interop boundary, keep it as `unknown` until validation proves the precise type.',
35
+ ],
36
+ examples: [
37
+ {
38
+ bad: 'let value: any;',
39
+ good: 'let value: unknown;',
40
+ },
41
+ ],
42
+ suggestions: [
43
+ {
44
+ applicability: 'manual',
45
+ title: 'Use `unknown` at boundaries',
46
+ message: 'Replace `any` with `unknown`, then narrow with runtime checks before use.',
47
+ },
48
+ {
49
+ applicability: 'manual',
50
+ title: 'Write the precise type directly',
51
+ message:
52
+ 'If you already know the allowed shape, replace `any` with the exact interface, union, or generic constraint instead of erasing it.',
53
+ },
54
+ ],
55
+ },
56
+ SOUND1002: {
57
+ code: 'SOUND1002',
58
+ title: 'Unchecked type assertions are banned',
59
+ summary: 'soundscript rejects `as` assertions because they bypass proof of the claimed type.',
60
+ repairHeuristic:
61
+ 'Replace the assertion with a proof step at or before the use site. Use narrowing for local values, and use parsing or validation at boundaries so the precise type is returned honestly.',
62
+ details: [
63
+ 'Prefer control-flow narrowing, parsing helpers, or explicit validation instead of assertions.',
64
+ 'If the value crosses an interop boundary, validate it there and return the precise type honestly rather than asserting later.',
65
+ '`// #[unsafe]` may waive one local proof-override chain, but it still does not legalize bridge casts such as direct `unknown -> T`, `as unknown as T`, or `as any as T`.',
66
+ ],
67
+ examples: [
68
+ {
69
+ bad: [
70
+ 'const user = raw as User;',
71
+ 'useUser(user);',
72
+ ].join('\n'),
73
+ good: [
74
+ 'const user = parseUser(raw);',
75
+ 'useUser(user);',
76
+ ].join('\n'),
77
+ },
78
+ ],
79
+ suggestions: [
80
+ {
81
+ applicability: 'manual',
82
+ title: 'Replace the assertion with validation',
83
+ message: 'Narrow the value with runtime checks or a parser function instead of using `as`.',
84
+ },
85
+ {
86
+ applicability: 'manual',
87
+ title: 'Move proof to the boundary',
88
+ message:
89
+ 'At foreign/module boundaries, add validation or an explicit interop wrapper that returns the target type without a cast.',
90
+ },
91
+ ],
92
+ },
93
+ SOUND1003: {
94
+ code: 'SOUND1003',
95
+ title: 'Non-null assertions are banned',
96
+ summary: 'soundscript rejects `!` because it discards nullability without proof.',
97
+ repairHeuristic:
98
+ 'Prove the value is present before the use site. Add an explicit null/undefined check, or normalize the maybe-null value with a real fallback instead of forcing it with `!`.',
99
+ details: [
100
+ 'Restructure control flow so the value is proven non-null before use.',
101
+ 'Prefer an explicit fallback, early return, or throw path over silently discarding `null`/`undefined` from the type.',
102
+ ],
103
+ examples: [
104
+ {
105
+ bad: 'value!.length',
106
+ good: [
107
+ 'if (value !== null) {',
108
+ ' value.length;',
109
+ '}',
110
+ ].join('\n'),
111
+ },
112
+ ],
113
+ suggestions: [
114
+ {
115
+ applicability: 'manual',
116
+ title: 'Prove non-nullness first',
117
+ message:
118
+ 'Add an explicit null/undefined check before the use site instead of relying on `!`.',
119
+ },
120
+ {
121
+ applicability: 'manual',
122
+ title: 'Normalize with a real fallback',
123
+ message:
124
+ 'If a fallback is valid, use `??`, an early return, or a helper that converts the maybe-null value into a definite one honestly.',
125
+ },
126
+ ],
127
+ },
128
+ SOUND1004: {
129
+ code: 'SOUND1004',
130
+ title: 'Numeric enums are banned',
131
+ summary: 'Numeric enums create broad implicit conversions that conflict with the soundscript subset.',
132
+ repairHeuristic:
133
+ 'Replace numeric enums with string literal unions or explicit tagged objects so the runtime representation stays precise and does not rely on implicit numeric conversion behavior.',
134
+ details: [
135
+ 'Use string literal unions or explicitly tagged objects instead of numeric enums.',
136
+ ],
137
+ examples: [
138
+ {
139
+ bad: [
140
+ 'enum Status {',
141
+ ' Ready,',
142
+ ' Done,',
143
+ '}',
144
+ ].join('\n'),
145
+ good: 'type Status = "ready" | "done";',
146
+ },
147
+ ],
148
+ suggestions: [
149
+ {
150
+ applicability: 'manual',
151
+ title: 'Switch to string literals',
152
+ message:
153
+ 'Replace the numeric enum with string literal unions or an explicit tagged representation.',
154
+ },
155
+ ],
156
+ },
157
+ SOUND1005: {
158
+ code: 'SOUND1005',
159
+ title: 'Unsound imports require an explicit interop boundary',
160
+ summary:
161
+ 'Values coming from ordinary `.ts`, JavaScript, or declaration-only code cannot flow into soundscript implicitly.',
162
+ repairHeuristic:
163
+ 'Mark the smallest import boundary that crosses into foreign code with `// #[interop]`, then validate or normalize the imported value before it flows deeper into checked soundscript code.',
164
+ details: [
165
+ 'Mark the exact import, `require`, or binding that crosses into non-soundscript code with `// #[interop]`.',
166
+ 'Keep the boundary small and validate the imported value before it flows deeper into checked soundscript code.',
167
+ ],
168
+ examples: [
169
+ {
170
+ bad: 'import { value } from "./lib";',
171
+ good: [
172
+ '// #[interop]',
173
+ 'import { value } from "./lib";',
174
+ ].join('\n'),
175
+ },
176
+ ],
177
+ suggestions: [
178
+ {
179
+ applicability: 'manual',
180
+ title: 'Add an interop boundary',
181
+ message:
182
+ 'Insert `// #[interop]` at the import boundary only after you have validated the boundary assumptions.',
183
+ },
184
+ {
185
+ applicability: 'manual',
186
+ title: 'Isolate the foreign surface',
187
+ message:
188
+ 'Wrap the foreign import in a small adapter module so the unchecked assumptions stay local to one boundary.',
189
+ },
190
+ ],
191
+ },
192
+ SOUND1006: {
193
+ code: 'SOUND1006',
194
+ title: 'Malformed annotation comment',
195
+ summary: 'The checker could not parse a `// #[...]` annotation comment.',
196
+ repairHeuristic:
197
+ 'Rewrite malformed annotation comments into a complete builtin form or delete them entirely. Half-written directives attach to nothing.',
198
+ details: [
199
+ 'Malformed annotation comments do not attach to the following node, so the following code stays ordinary checked soundscript.',
200
+ 'The diagnostic metadata includes the raw annotation text and parser failure so tools can rewrite the comment instead of guessing.',
201
+ ],
202
+ examples: [
203
+ {
204
+ bad: '// #[unsafe(',
205
+ good: '// #[unsafe]',
206
+ },
207
+ ],
208
+ suggestions: [
209
+ {
210
+ applicability: 'manual',
211
+ title: 'Fix the annotation syntax',
212
+ message:
213
+ 'Rewrite the comment to a complete `// #[name]` form such as `// #[unsafe]`, or remove it if no directive is intended.',
214
+ },
215
+ ],
216
+ },
217
+ SOUND1007: {
218
+ code: 'SOUND1007',
219
+ title: 'Unknown annotation',
220
+ summary: 'The parsed annotation name is not registered in the current language version.',
221
+ repairHeuristic:
222
+ 'Rename the annotation to a registered builtin if you intended checked semantics; otherwise delete the annotation comment and keep the declaration ordinary checked code.',
223
+ details: [
224
+ 'Builtin v1 annotations are `unsafe`, `interop`, `extern`, `newtype`, `value`, and `variance`.',
225
+ 'Unknown annotations do not carry any checked semantics, even if they look like directives from another tool or an older experiment.',
226
+ ],
227
+ examples: [
228
+ {
229
+ bad: '// #[trusted]',
230
+ good: '// #[extern]',
231
+ },
232
+ ],
233
+ suggestions: [
234
+ {
235
+ applicability: 'manual',
236
+ title: 'Use a registered annotation',
237
+ message:
238
+ 'Replace the annotation with a registered builtin such as `#[extern]`, or remove it until that annotation exists.',
239
+ },
240
+ ],
241
+ },
242
+ SOUND1017: {
243
+ code: 'SOUND1017',
244
+ title: 'Type guard body does not prove its predicate',
245
+ summary:
246
+ 'The checker could not verify that the declared guard body establishes the claimed predicate.',
247
+ repairHeuristic:
248
+ 'Either change the body so it actually proves the declared predicate on every `true` path, or weaken the predicate to match what the body can honestly establish.',
249
+ details: [
250
+ 'The body must honestly prove the declared predicate on every path that returns `true`.',
251
+ 'soundscript only verifies a limited family of predicate targets directly, so some predicate signatures must be rewritten as booleans or redesigned around supported targets.',
252
+ ],
253
+ examples: [
254
+ {
255
+ bad: [
256
+ 'function isString(value: string | number): value is string {',
257
+ ' return typeof value === "number";',
258
+ '}',
259
+ ].join('\n'),
260
+ good: [
261
+ 'function isString(value: string | number): value is string {',
262
+ ' return typeof value === "string";',
263
+ '}',
264
+ ].join('\n'),
265
+ },
266
+ ],
267
+ suggestions: [
268
+ {
269
+ applicability: 'manual',
270
+ title: 'Align the guard with the predicate',
271
+ message:
272
+ 'Change the body so it proves the declared predicate, or weaken the predicate to match what the body actually checks.',
273
+ },
274
+ {
275
+ applicability: 'manual',
276
+ title: 'Use a supported predicate surface',
277
+ message:
278
+ 'If the predicate target is not one soundscript can verify directly, return `boolean` and narrow at the call site, or redesign the API around a supported predicate target.',
279
+ },
280
+ ],
281
+ },
282
+ SOUND1018: {
283
+ code: 'SOUND1018',
284
+ title: 'Overload implementation does not satisfy all overloads',
285
+ summary: 'The implementation signature must be compatible with each declared overload.',
286
+ repairHeuristic:
287
+ 'Make the implementation honestly cover every overload promise. Broaden the implementation signature if needed, then branch inside the body so each overload path returns the result type it promised.',
288
+ details: [
289
+ 'Each declared overload is a promise to callers, and the shared implementation has to honor every one of those promises.',
290
+ 'A common failure mode is returning a value that matches one overload branch but violates another declared overload result.',
291
+ ],
292
+ examples: [
293
+ {
294
+ bad: [
295
+ 'function format(value: string): string;',
296
+ 'function format(value: number): number;',
297
+ 'function format(value: string | number): string {',
298
+ ' return String(value);',
299
+ '}',
300
+ ].join('\n'),
301
+ good: [
302
+ 'function format(value: string): string;',
303
+ 'function format(value: number): number;',
304
+ 'function format(value: string | number): string | number {',
305
+ ' return typeof value === "string" ? value.toUpperCase() : value + 1;',
306
+ '}',
307
+ ].join('\n'),
308
+ },
309
+ ],
310
+ suggestions: [
311
+ {
312
+ applicability: 'manual',
313
+ title: 'Broaden the implementation or narrow the overloads',
314
+ message:
315
+ 'Adjust the implementation signature and body so every overload is honestly supported.',
316
+ },
317
+ {
318
+ applicability: 'manual',
319
+ title: 'Split the behavior by branch',
320
+ message:
321
+ 'When the overloads are all valid, branch inside the implementation so each overload path returns the result type that its signature promises.',
322
+ },
323
+ ],
324
+ },
325
+ SOUND1019: {
326
+ code: 'SOUND1019',
327
+ title: 'Assignment relies on an unsound assignability relation',
328
+ summary: 'A value is being widened across a relation that soundscript does not preserve.',
329
+ repairHeuristic:
330
+ 'Stop widening through a relation soundscript rejects. Keep the precise type, switch to a readonly or structural surface, or redesign the API so the unsafe capability is never promised.',
331
+ details: [
332
+ 'Common examples include mutable array variance, callable parameter variance, and class-to-class widening that only matches structurally.',
333
+ ],
334
+ examples: [
335
+ {
336
+ bad: [
337
+ 'const dogs: Dog[] = [{ name: "Rex", breed: "Lab" }];',
338
+ 'const animals: Animal[] = dogs;',
339
+ ].join('\n'),
340
+ good: [
341
+ 'const dogs: Dog[] = [{ name: "Rex", breed: "Lab" }];',
342
+ 'const animals: readonly Animal[] = dogs;',
343
+ ].join('\n'),
344
+ },
345
+ ],
346
+ suggestions: [
347
+ {
348
+ applicability: 'manual',
349
+ title: 'Preserve the original type or project explicitly',
350
+ message:
351
+ 'Avoid widening through mutable containers or unrelated class targets; keep the exact class type, project to a structural interface, clone, or use a different API boundary instead.',
352
+ },
353
+ ],
354
+ },
355
+ SOUND1020: {
356
+ code: 'SOUND1020',
357
+ title: 'Narrowing was invalidated',
358
+ summary:
359
+ 'A previous narrowing crossed an aliasing, mutation, callback, or suspension boundary that makes it unsafe to reuse.',
360
+ repairHeuristic:
361
+ 'Re-establish the proof after the invalidating boundary, or copy a stable primitive/immutable value into a fresh local before the boundary so later code no longer depends on the invalidated path.',
362
+ details: [
363
+ 'Typical invalidating boundaries include function calls, mutation through aliases, callbacks that may run later, and `await`/suspension points.',
364
+ 'The diagnostic metadata names the narrowed value, the boundary kind, the exact invalidating expression, and the earlier proof site so tooling can explain the hazard concretely.',
365
+ 'Re-establish the narrowing after the boundary instead of assuming the earlier proof still holds.',
366
+ ],
367
+ examples: [
368
+ {
369
+ bad: [
370
+ 'if (box.value !== null) {',
371
+ ' mutate(box);',
372
+ ' use(box.value);',
373
+ '}',
374
+ ].join('\n'),
375
+ good: [
376
+ 'if (box.value !== null) {',
377
+ ' mutate(box);',
378
+ ' if (box.value !== null) {',
379
+ ' use(box.value);',
380
+ ' }',
381
+ '}',
382
+ ].join('\n'),
383
+ },
384
+ {
385
+ bad: [
386
+ 'if (box.value !== null) {',
387
+ ' log(box);',
388
+ ' return box.value.length;',
389
+ '}',
390
+ ].join('\n'),
391
+ good: [
392
+ 'if (box.value !== null) {',
393
+ ' const value = box.value;',
394
+ ' log(box);',
395
+ ' return value.length;',
396
+ '}',
397
+ ].join('\n'),
398
+ },
399
+ ],
400
+ suggestions: [
401
+ {
402
+ applicability: 'manual',
403
+ title: 'Re-check after the boundary',
404
+ message:
405
+ 'Re-establish the narrowing after the invalidating boundary instead of carrying the earlier proof forward.',
406
+ },
407
+ {
408
+ applicability: 'manual',
409
+ title: 'Snapshot a stable value before the boundary',
410
+ message:
411
+ 'When safe, copy the already-proven primitive or immutable value into a fresh local before the invalidating boundary.',
412
+ },
413
+ ],
414
+ },
415
+ SOUND1021: {
416
+ code: 'SOUND1021',
417
+ title: 'Prototype-surgery null-prototype creation is banned',
418
+ summary:
419
+ 'Creating null-prototype objects through prototype mutation is outside the stable soundscript subset.',
420
+ repairHeuristic:
421
+ 'If you need a null-prototype dictionary, construct it directly with `Object.create(null)` and keep it modeled as `BareObject`. Otherwise use an ordinary object or `Map` instead of mutating prototypes after allocation.',
422
+ details: [
423
+ 'Use `Object.create(null)` when you intentionally want a null-prototype value, and keep it modeled as `BareObject` instead of mutating an ordinary object after allocation.',
424
+ 'If you want ordinary object behavior, keep the prototype untouched and use a normal object literal. If you want dictionary-like behavior without prototype tricks, consider `Map`.',
425
+ ],
426
+ examples: [
427
+ {
428
+ bad: [
429
+ 'const dict = {};',
430
+ 'Object.setPrototypeOf(dict, null);',
431
+ ].join('\n'),
432
+ good: 'const dict = Object.create(null);',
433
+ },
434
+ ],
435
+ suggestions: [
436
+ {
437
+ applicability: 'manual',
438
+ title: 'Prefer ordinary objects, Map, or explicit BareObject modeling',
439
+ message:
440
+ 'Replace the prototype-surgery path with an ordinary object or a `Map`, or use the explicit `BareObject` path when a null-prototype value is actually intended.',
441
+ },
442
+ ],
443
+ },
444
+ SOUND1022: {
445
+ code: 'SOUND1022',
446
+ title: 'Unsupported JavaScript feature',
447
+ summary:
448
+ 'The construct uses a JavaScript or TypeScript feature that soundscript intentionally does not model.',
449
+ repairHeuristic:
450
+ 'Replace the unsupported construct with the smaller, explicit pattern soundscript expects. The primary diagnostic message and metadata identify the specific feature so you can pick the matching rewrite instead of guessing.',
451
+ details: [
452
+ 'The primary diagnostic message names the exact unsupported feature and usually includes a hint for a supported alternative.',
453
+ 'Common examples include truthiness-based control flow, reflective APIs, prototype mutation, sparse arrays, or runtime meta-programming surfaces.',
454
+ ],
455
+ examples: [
456
+ {
457
+ bad: 'if (value) { use(value); }',
458
+ good: 'if (value !== null) { use(value); }',
459
+ },
460
+ {
461
+ bad: 'var total = left == right ? 1 : 0;',
462
+ good: 'let total = left === right ? 1 : 0;',
463
+ },
464
+ ],
465
+ suggestions: [
466
+ {
467
+ applicability: 'manual',
468
+ title: 'Refactor to a modeled subset feature',
469
+ message:
470
+ 'Replace the unsupported feature with an equivalent pattern that stays inside the modeled soundscript subset.',
471
+ },
472
+ ],
473
+ },
474
+ SOUND1034: {
475
+ code: 'SOUND1034',
476
+ title: 'Async surface outside the supported Promise model',
477
+ summary:
478
+ 'soundscript only supports compiler-owned Promise semantics, not PromiseLike, structural thenables, or Promise subclassing.',
479
+ repairHeuristic:
480
+ 'Keep checked async APIs on plain `Promise<T>` surfaces. If a thenable or Promise subclass comes from foreign code, normalize it at the boundary and expose an ordinary `Promise<T>` before it reaches checked soundscript code.',
481
+ details: [
482
+ 'Use `Promise<T>` as the async carrier in soundscript source.',
483
+ 'Do not author structural thenables or Promise subclass hierarchies in `.sts`.',
484
+ 'If the thenable comes from foreign code, normalize it at the boundary and expose a plain `Promise<T>` surface to checked soundscript code.',
485
+ ],
486
+ examples: [
487
+ {
488
+ bad: [
489
+ 'interface Thenable<T> {',
490
+ ' then(onfulfilled: (value: T) => unknown): unknown;',
491
+ '}',
492
+ '',
493
+ 'let value: Thenable<number> | null = null;',
494
+ ].join('\n'),
495
+ good: [
496
+ 'let value: Promise<number> | null = null;',
497
+ ].join('\n'),
498
+ },
499
+ {
500
+ bad: [
501
+ 'class MyPromise<T> extends Promise<T> {}',
502
+ '',
503
+ 'let value: MyPromise<number>;',
504
+ ].join('\n'),
505
+ good: [
506
+ 'let value: Promise<number>;',
507
+ ].join('\n'),
508
+ },
509
+ ],
510
+ suggestions: [
511
+ {
512
+ applicability: 'manual',
513
+ title: 'Use plain Promise surfaces',
514
+ message:
515
+ 'Replace `PromiseLike`, structural thenables, and Promise subclasses with ordinary `Promise<T>` surfaces.',
516
+ },
517
+ ],
518
+ },
519
+ SOUND1035: {
520
+ code: 'SOUND1035',
521
+ title: 'Receiver-sensitive callables cannot become first-class values',
522
+ summary:
523
+ 'Instance methods, accessors, object-literal methods, and explicit-`this` callables must stay in receiver-preserving call form.',
524
+ repairHeuristic:
525
+ 'Keep the call in member form when you can. If you need a callback, wrap the call in a lambda that closes over the receiver instead of extracting the method itself.',
526
+ details: [
527
+ 'Do not extract, return, export, store, or pass receiver-sensitive callables as ordinary values.',
528
+ 'Do not use `bind`, `call`, `apply`, or `Reflect.apply` to rebind receiver-sensitive callables.',
529
+ 'If you need a callback, wrap the original call in a lambda that closes over the receiver instead of extracting the method itself.',
530
+ ],
531
+ examples: [
532
+ {
533
+ bad: [
534
+ 'const read = box.read;',
535
+ 'read();',
536
+ ].join('\n'),
537
+ good: [
538
+ 'const read = () => box.read();',
539
+ 'read();',
540
+ ].join('\n'),
541
+ },
542
+ {
543
+ bad: [
544
+ 'register(box.read);',
545
+ ].join('\n'),
546
+ good: [
547
+ 'register(() => box.read());',
548
+ ].join('\n'),
549
+ },
550
+ ],
551
+ suggestions: [
552
+ {
553
+ applicability: 'manual',
554
+ title: 'Keep the call in member form',
555
+ message:
556
+ 'Call the member directly as `obj.method(...)`, or wrap it in a lambda that preserves the original receiver-bearing call expression.',
557
+ },
558
+ {
559
+ applicability: 'manual',
560
+ title: 'Capture the receiver explicitly',
561
+ message:
562
+ 'Rewrite `const f = obj.method;` to `const f = () => obj.method();` or to a lambda that forwards the full argument list while keeping the original receiver.',
563
+ },
564
+ ],
565
+ },
566
+ SOUND1036: {
567
+ code: 'SOUND1036',
568
+ title: 'Construction-time dispatch or `this` escape is banned',
569
+ summary:
570
+ 'Constructors and field initializers may not dispatch through instance members or let `this` escape before construction completes.',
571
+ repairHeuristic:
572
+ 'During construction, write fields directly and keep `this` local. Move method dispatch, callbacks, registration, and escaping behavior into a post-construction step or a factory helper that runs after initialization finishes.',
573
+ details: [
574
+ 'This includes `this.method(...)`, `super.method(...)`, accessor dispatch, passing `this` to helpers, returning `this`, and storing or scheduling aliases that outlive the current construction step.',
575
+ 'The diagnostic metadata identifies the specific hazard kind, such as receiver dispatch, argument escape, or returning a captured `this` alias.',
576
+ ],
577
+ examples: [
578
+ {
579
+ bad: [
580
+ 'class Reader {',
581
+ ' constructor() {',
582
+ ' this.read();',
583
+ ' }',
584
+ ' read() {}',
585
+ '}',
586
+ ].join('\n'),
587
+ good: [
588
+ 'class Reader {',
589
+ ' constructor() {',
590
+ ' this.value = 1;',
591
+ ' }',
592
+ ' finishInit() {',
593
+ ' this.read();',
594
+ ' }',
595
+ ' read() {}',
596
+ '}',
597
+ ].join('\n'),
598
+ },
599
+ {
600
+ bad: [
601
+ 'class Box {',
602
+ ' constructor() {',
603
+ ' register(this);',
604
+ ' }',
605
+ '}',
606
+ ].join('\n'),
607
+ good: [
608
+ 'class Box {',
609
+ ' constructor() {}',
610
+ ' attach() {',
611
+ ' register(this);',
612
+ ' }',
613
+ '}',
614
+ ].join('\n'),
615
+ },
616
+ ],
617
+ suggestions: [
618
+ {
619
+ applicability: 'manual',
620
+ title: 'Finish initialization before exposing the instance',
621
+ message:
622
+ 'Write fields directly during construction, avoid dynamic dispatch there, and move escaping behavior to a post-construction method or factory step.',
623
+ },
624
+ ],
625
+ },
626
+ SOUND1037: {
627
+ code: 'SOUND1037',
628
+ title: 'Instance field read before definite initialization',
629
+ summary:
630
+ 'A field is being read from `this` before the checker can prove it was initialized on every path that reaches the read.',
631
+ repairHeuristic:
632
+ 'Initialize the field on every path before the first read, or move the read to a later point where initialization has already happened. When field order is the problem, reorder the declarations so producers come before consumers.',
633
+ details: [
634
+ 'Field initializers and constructors are checked in JavaScript initialization order, including base/derived sequencing and conservative branch merging.',
635
+ 'The diagnostic metadata names the field and read site shape so tools can show exactly which read must move or which initialization must happen earlier.',
636
+ ],
637
+ examples: [
638
+ {
639
+ bad: [
640
+ 'class Box {',
641
+ ' first = this.second;',
642
+ ' second = 1;',
643
+ '}',
644
+ ].join('\n'),
645
+ good: [
646
+ 'class Box {',
647
+ ' second = 1;',
648
+ ' first = this.second;',
649
+ '}',
650
+ ].join('\n'),
651
+ },
652
+ {
653
+ bad: [
654
+ 'class Box {',
655
+ ' value: number;',
656
+ ' constructor(flag: boolean) {',
657
+ ' if (flag) {',
658
+ ' this.value = 1;',
659
+ ' }',
660
+ ' use(this.value);',
661
+ ' }',
662
+ '}',
663
+ ].join('\n'),
664
+ good: [
665
+ 'class Box {',
666
+ ' value: number;',
667
+ ' constructor(flag: boolean) {',
668
+ ' this.value = flag ? 1 : 0;',
669
+ ' use(this.value);',
670
+ ' }',
671
+ '}',
672
+ ].join('\n'),
673
+ },
674
+ ],
675
+ suggestions: [
676
+ {
677
+ applicability: 'manual',
678
+ title: 'Initialize before reading',
679
+ message:
680
+ 'Reorder field initializers or constructor writes so the field is definitely initialized before any read, or guard the read behind an already-initialized path.',
681
+ },
682
+ ],
683
+ },
684
+ SOUND1038: {
685
+ code: 'SOUND1038',
686
+ title: 'Definite-assignment assertions are restricted proof overrides',
687
+ summary:
688
+ 'soundscript rejects declaration-site `!` unless it is an explicitly trusted local variable site that the backend can still represent honestly.',
689
+ repairHeuristic:
690
+ 'Prefer a real initializer first. If absence is valid, widen the type to include it and prove initialization before reads. Use `// #[unsafe] let x!: T` only for local declarations when you are intentionally overriding proof.',
691
+ details: [
692
+ 'Local variable definite-assignment assertions are proof-override sites and require `// #[unsafe]`.',
693
+ 'Class-field definite-assignment assertions remain rejected in v1 because the compiler subset does not yet lower that unchecked field-initialization promise honestly.',
694
+ ],
695
+ examples: [
696
+ {
697
+ bad: [
698
+ 'class Box {',
699
+ ' value!: string;',
700
+ '}',
701
+ ].join('\n'),
702
+ good: [
703
+ 'class Box {',
704
+ ' value: string;',
705
+ ' constructor() {',
706
+ ' this.value = "ok";',
707
+ ' }',
708
+ '}',
709
+ ].join('\n'),
710
+ },
711
+ {
712
+ bad: 'let cache!: Cache;',
713
+ good: [
714
+ '// #[unsafe]',
715
+ 'let cache!: Cache;',
716
+ ].join('\n'),
717
+ },
718
+ ],
719
+ suggestions: [
720
+ {
721
+ applicability: 'manual',
722
+ title: 'Initialize the value directly',
723
+ message:
724
+ 'Add an initializer or assign on every path before any read instead of relying on declaration-site `!`.',
725
+ },
726
+ {
727
+ applicability: 'manual',
728
+ title: 'Use a local unsafe site only when necessary',
729
+ message:
730
+ 'For local variables only, move the unchecked proof to `// #[unsafe] let x!: T` if you intentionally need a site-local proof override.',
731
+ },
732
+ ],
733
+ },
734
+ SOUND1023: {
735
+ code: 'SOUND1023',
736
+ title: 'TypeScript pragmas are banned',
737
+ summary:
738
+ 'soundscript rejects `@ts-...` pragmas because they suppress or distort the checker contract.',
739
+ repairHeuristic:
740
+ 'Delete the pragma first, then either make the code type-check honestly or move the unchecked assumption to an explicit interop or extern boundary that names the trust boundary directly.',
741
+ details: [
742
+ 'Pragmas such as `@ts-ignore`, `@ts-expect-error`, `@ts-nocheck`, and `@ts-check` hide or mutate upstream evidence instead of expressing a checked soundscript boundary.',
743
+ 'Remove the pragma and either fix the typing issue directly or move the unchecked assumption to an explicit interop or extern boundary.',
744
+ ],
745
+ examples: [
746
+ {
747
+ bad: [
748
+ '// @ts-ignore',
749
+ 'const value: number = "x";',
750
+ ].join('\n'),
751
+ good: [
752
+ 'const value: number = 1;',
753
+ ].join('\n'),
754
+ },
755
+ ],
756
+ suggestions: [
757
+ {
758
+ applicability: 'manual',
759
+ title: 'Remove the pragma and fix the underlying issue',
760
+ message: 'Delete the pragma comment and make the code type-check without suppressions.',
761
+ },
762
+ ],
763
+ },
764
+ SOUND1024: {
765
+ code: 'SOUND1024',
766
+ title: 'Exotic object widened to plain object',
767
+ summary:
768
+ 'A value with runtime behavior outside the ordinary object model is being treated as a plain object.',
769
+ repairHeuristic:
770
+ 'Keep the precise non-ordinary type when you need its semantics, or project immediately to the specific member or wrapper you actually want instead of widening to plain `object`.',
771
+ details: [
772
+ 'This includes null-prototype values, module namespace objects, and modeled non-ordinary builtins such as typed arrays and `DataView`.',
773
+ 'Keep the exact non-ordinary type when you need its behavior, or project to a smaller ordinary surface intentionally.',
774
+ ],
775
+ examples: [
776
+ {
777
+ bad: [
778
+ 'const dict: object = Object.create(null);',
779
+ ].join('\n'),
780
+ good: [
781
+ 'const dict: BareObject = Object.create(null);',
782
+ ].join('\n'),
783
+ },
784
+ {
785
+ bad: [
786
+ 'const ns: object = await import("./lib.ts");',
787
+ ].join('\n'),
788
+ good: [
789
+ 'const { value } = await import("./lib.ts");',
790
+ ].join('\n'),
791
+ },
792
+ ],
793
+ suggestions: [
794
+ {
795
+ applicability: 'manual',
796
+ title: 'Read the needed member directly',
797
+ message:
798
+ 'Avoid storing or forwarding the exotic object; immediately read the specific exported member you need.',
799
+ },
800
+ {
801
+ applicability: 'manual',
802
+ title: 'Keep the precise non-ordinary type',
803
+ message:
804
+ 'Prefer `BareObject`, a namespace member read, or the exact typed-array/DataView type instead of widening to plain `object`.',
805
+ },
806
+ ],
807
+ },
808
+ SOUND1025: {
809
+ code: 'SOUND1025',
810
+ title: 'Only `Error` values may be thrown',
811
+ summary: 'Throwing non-`Error` values is outside the stable soundscript subset.',
812
+ repairHeuristic:
813
+ 'Convert the thrown value into an `Error` before it leaves the site. Use `new Error(...)` for simple cases, or a domain-specific subclass when callers rely on structured error kinds.',
814
+ details: [
815
+ 'Throwing strings, numbers, booleans, plain objects, or arbitrary unions drops the standard `Error` surface that downstream code relies on.',
816
+ 'Prefer `throw new Error(...)` or a concrete `Error` subclass so catch sites can rely on `message`, `name`, stack, and cause information.',
817
+ ],
818
+ examples: [
819
+ {
820
+ bad: [
821
+ 'throw problem;',
822
+ ].join('\n'),
823
+ good: [
824
+ 'throw new Error(String(problem));',
825
+ ].join('\n'),
826
+ },
827
+ ],
828
+ suggestions: [
829
+ {
830
+ applicability: 'manual',
831
+ title: 'Throw an `Error` object',
832
+ message: 'Wrap the payload in an `Error` or a concrete `Error` subclass before throwing.',
833
+ },
834
+ {
835
+ applicability: 'manual',
836
+ title: 'Normalize arbitrary payloads',
837
+ message:
838
+ 'If the failing value is not already an `Error`, convert it with a pattern like `throw new Error(String(problem));`.',
839
+ },
840
+ ],
841
+ },
842
+ SOUND1026: {
843
+ code: 'SOUND1026',
844
+ title: 'Duplicate annotation in one block',
845
+ summary:
846
+ 'The same annotation name appeared more than once in a single attached annotation block.',
847
+ repairHeuristic:
848
+ 'Keep one annotation entry per name in each attached block. Delete the duplicate occurrence and keep the single spelling that matches the intended site-local contract.',
849
+ details: [
850
+ 'Each attached annotation block may mention a given annotation name at most once.',
851
+ 'The diagnostic metadata includes the repeated annotation name and occurrence count so tools can safely remove the duplicate entry.',
852
+ ],
853
+ examples: [
854
+ {
855
+ bad: [
856
+ '// #[extern]',
857
+ '// #[extern]',
858
+ 'declare const envName: string;',
859
+ ].join('\n'),
860
+ good: [
861
+ '// #[extern]',
862
+ 'declare const envName: string;',
863
+ ].join('\n'),
864
+ },
865
+ ],
866
+ suggestions: [
867
+ {
868
+ applicability: 'manual',
869
+ title: 'Keep one annotation per name',
870
+ message:
871
+ 'Remove the duplicate annotation entry so each block contains at most one of a given annotation name.',
872
+ },
873
+ ],
874
+ },
875
+ SOUND1027: {
876
+ code: 'SOUND1027',
877
+ title: 'Annotation is not valid on this target',
878
+ summary:
879
+ 'The annotation was attached to a declaration or statement shape that does not support it.',
880
+ repairHeuristic:
881
+ 'Move the annotation to the syntax shape it actually belongs to. `#[interop]` belongs on import-like boundaries, `#[extern]` on same-file ambient runtime declarations, `#[unsafe]` on local proof overrides, and `#[variance(...)]` on generic interfaces or type aliases.',
882
+ details: [
883
+ '`// #[interop]` is for import-like boundaries. `// #[unsafe]` is for local proof-override sites.',
884
+ '`// #[extern]` is for same-file ambient runtime declarations. `// #[variance(...)]` is only for generic interfaces and type aliases.',
885
+ '`// #[extern]` does not bless ambient predicate or assertion signatures, including extern-backed values whose callable or member surfaces would act as unchecked proof oracles.',
886
+ 'The checker records both the expected target family and the actual syntax node so tools can tell you exactly which annotation to move and where it belongs.',
887
+ ],
888
+ examples: [
889
+ {
890
+ bad: [
891
+ '// #[extern]',
892
+ 'import { value } from "./lib.ts";',
893
+ ].join('\n'),
894
+ good: [
895
+ '// #[interop]',
896
+ 'import { value } from "./lib.ts";',
897
+ ].join('\n'),
898
+ },
899
+ ],
900
+ suggestions: [
901
+ {
902
+ applicability: 'manual',
903
+ title: 'Move the annotation to a supported site',
904
+ message:
905
+ 'Attach `// #[interop]` to the import boundary itself, `// #[unsafe]` to the proof-override site, `// #[extern]` to the local ambient declaration, or `// #[variance(...)]` to the generic interface or type alias.',
906
+ },
907
+ ],
908
+ },
909
+ SOUND1028: {
910
+ code: 'SOUND1028',
911
+ title: 'Annotation arguments are not supported',
912
+ summary:
913
+ 'This annotation form allows arguments syntactically, but the attached v1 annotation does not accept them.',
914
+ repairHeuristic:
915
+ 'Keep the annotation name and strip unsupported arguments unless the builtin explicitly documents an accepted argument form.',
916
+ details: [
917
+ 'In v1, among builtin directives only `// #[variance(...)]` accepts an argument list.',
918
+ '`// #[value]` is the one special-case builtin surface here: it accepts either the bare form or `// #[value(deep: true)]`.',
919
+ ],
920
+ examples: [
921
+ {
922
+ bad: '// #[extern(foo)]',
923
+ good: '// #[extern]',
924
+ },
925
+ ],
926
+ suggestions: [
927
+ {
928
+ applicability: 'manual',
929
+ title: 'Remove the arguments',
930
+ message:
931
+ 'Keep the annotation name and remove the argument list until that annotation defines argument semantics.',
932
+ },
933
+ ],
934
+ },
935
+ SOUND1029: {
936
+ code: 'SOUND1029',
937
+ title: 'Ambient runtime declarations require `#[extern]`',
938
+ summary:
939
+ 'A local ambient runtime declaration in a soundscript file must be explicitly marked as an extern boundary.',
940
+ repairHeuristic:
941
+ 'Mark same-file ambient runtime declarations with `// #[extern]` immediately above the declaration, or replace the declaration with a real implementation.',
942
+ details: [
943
+ 'Use `// #[extern]` only for same-file runtime-provided declarations such as host globals or compiler-injected helpers.',
944
+ 'The marker does not legalize other banned ambient forms such as `declare global`, `declare module`, `declare namespace`, or `declare enum`.',
945
+ 'The diagnostic metadata includes the declaration kind and declared name so tools can point directly at the missing boundary.',
946
+ ],
947
+ examples: [
948
+ {
949
+ bad: 'declare const envName: string;',
950
+ good: [
951
+ '// #[extern]',
952
+ 'declare const envName: string;',
953
+ ].join('\n'),
954
+ },
955
+ ],
956
+ suggestions: [
957
+ {
958
+ applicability: 'manual',
959
+ title: 'Mark the local extern boundary',
960
+ message:
961
+ 'Add `// #[extern]` immediately above the declaration, or replace the declaration with a real implementation.',
962
+ },
963
+ ],
964
+ },
965
+ SOUND1030: {
966
+ code: 'SOUND1030',
967
+ title: 'Ambient runtime declarations may not be exported',
968
+ summary:
969
+ 'Declaration-only runtime values cannot be published from `.sts` files because they invent exports with no implementation.',
970
+ repairHeuristic:
971
+ 'Either remove the export and keep the declaration as a same-file extern, or move the declaration-only surface to `.d.ts`. If the symbol is meant to be exported from `.sts`, replace the declaration with a real implementation.',
972
+ details: [
973
+ 'Move declaration-only exports to `.d.ts`, or provide a real `.sts` or `.ts` implementation instead.',
974
+ 'Keep `// #[extern]` for local same-file runtime names only; it does not turn an exported declaration-only surface into a real module implementation.',
975
+ ],
976
+ examples: [
977
+ {
978
+ bad: [
979
+ 'export declare const envName: string;',
980
+ ].join('\n'),
981
+ good: [
982
+ 'declare const envName: string;',
983
+ ].join('\n'),
984
+ },
985
+ ],
986
+ suggestions: [
987
+ {
988
+ applicability: 'manual',
989
+ title: 'Move the surface to `.d.ts` or implement it',
990
+ message:
991
+ 'Keep `// #[extern]` for local same-file externs only; exported declaration-only surfaces belong in `.d.ts` or in real runtime code.',
992
+ },
993
+ ],
994
+ },
995
+ SOUND1031: {
996
+ code: 'SOUND1031',
997
+ title: 'Variance annotation contract is invalid',
998
+ summary:
999
+ 'The `// #[variance(...)]` contract is malformed, incomplete, duplicated, or otherwise not a valid total declaration contract.',
1000
+ repairHeuristic:
1001
+ 'Rewrite the checked variance comment as a total contract that mentions every type parameter exactly once. Start invariant, then tighten only when the declaration surface proves it.',
1002
+ details: [
1003
+ 'List each declared type parameter exactly once using named arguments such as `T: out`, `U: in`, `R: inout`, or `X: independent`.',
1004
+ 'Only one merged declaration may carry the checked contract, and the metadata records the parse failure or duplicate-contract evidence for tooling.',
1005
+ ],
1006
+ examples: [
1007
+ {
1008
+ bad: [
1009
+ '// #[variance(T: out)]',
1010
+ 'type Pair<T, U> = [T, U];',
1011
+ ].join('\n'),
1012
+ good: [
1013
+ '// #[variance(T: inout, U: inout)]',
1014
+ 'type Pair<T, U> = [T, U];',
1015
+ ].join('\n'),
1016
+ },
1017
+ ],
1018
+ suggestions: [
1019
+ {
1020
+ applicability: 'manual',
1021
+ title: 'Fix the variance contract',
1022
+ message:
1023
+ 'Start with a total contract such as `// #[variance(T: inout, U: inout)]`, then tighten each direction only when the declaration surface proves it.',
1024
+ },
1025
+ ],
1026
+ },
1027
+ SOUND1032: {
1028
+ code: 'SOUND1032',
1029
+ title: 'Variance annotation does not match the proven surface',
1030
+ summary:
1031
+ 'The checked `// #[variance(...)]` contract overclaims or disagrees with the declaration variance the checker can actually prove.',
1032
+ repairHeuristic:
1033
+ 'Replace the checked contract with the variance soundscript can already prove, or change the declaration surface until the stronger contract becomes true.',
1034
+ details: [
1035
+ 'Variance annotations are checked, not trusted. Rewrite the declaration surface if you need a different proven result.',
1036
+ ],
1037
+ examples: [
1038
+ {
1039
+ bad: [
1040
+ '// #[variance(T: out)]',
1041
+ 'interface Sink<T> {',
1042
+ ' push(value: T): void;',
1043
+ '}',
1044
+ ].join('\n'),
1045
+ good: [
1046
+ '// #[variance(T: in)]',
1047
+ 'interface Sink<T> {',
1048
+ ' push(value: T): void;',
1049
+ '}',
1050
+ ].join('\n'),
1051
+ },
1052
+ ],
1053
+ suggestions: [
1054
+ {
1055
+ applicability: 'manual',
1056
+ title: 'Align the declaration and contract',
1057
+ message:
1058
+ 'Change the `// #[variance(...)]` contract to match the proven variance, or rewrite the declaration so the intended variance becomes provable.',
1059
+ },
1060
+ ],
1061
+ },
1062
+ SOUND1033: {
1063
+ code: 'SOUND1033',
1064
+ title: 'Reserved builtin annotation name conflicts with an imported macro',
1065
+ summary:
1066
+ 'Builtin directive names take precedence in annotation position and cannot also name imported declaration macros at the same site.',
1067
+ repairHeuristic:
1068
+ 'If an imported annotation macro collides with a builtin name, alias the import and use that alias in the annotation comment so the site becomes unambiguous.',
1069
+ details: [
1070
+ 'If an imported declaration macro collides with a builtin directive name such as `variance`, alias the import and use the alias in the annotation.',
1071
+ 'The diagnostic metadata records the builtin annotation name, import specifier, and conflicting binding so editor tooling can synthesize a safe alias rewrite.',
1072
+ ],
1073
+ examples: [
1074
+ {
1075
+ bad: [
1076
+ "import { variance } from 'macros/test';",
1077
+ '',
1078
+ '// #[variance]',
1079
+ ].join('\n'),
1080
+ good: [
1081
+ "import { variance as macroVariance } from 'macros/test';",
1082
+ '',
1083
+ '// #[macroVariance]',
1084
+ ].join('\n'),
1085
+ },
1086
+ ],
1087
+ suggestions: [
1088
+ {
1089
+ applicability: 'manual',
1090
+ title: 'Alias the imported macro',
1091
+ message:
1092
+ 'Rename the imported declaration macro binding, then use that alias in the `// #[...]` annotation, for example `import { variance as macroVariance } ...` followed by `// #[macroVariance]`.',
1093
+ },
1094
+ ],
1095
+ },
1096
+ COMPILER2001: {
1097
+ code: 'COMPILER2001',
1098
+ title: 'Construct not yet supported by the compiler backend',
1099
+ summary:
1100
+ 'The checker accepted the program, but the compiler backend cannot lower this construct yet.',
1101
+ details: [],
1102
+ suggestions: [
1103
+ {
1104
+ applicability: 'manual',
1105
+ title: 'Stay within the current compiler subset',
1106
+ message:
1107
+ 'Rewrite the code to use a construct that is already supported by the current compiler backend.',
1108
+ },
1109
+ ],
1110
+ },
1111
+ COMPILER2002: {
1112
+ code: 'COMPILER2002',
1113
+ title: 'Construct needs more heap-runtime generalization',
1114
+ summary:
1115
+ 'The backend would need additional heap-runtime support or fallback lowering to compile this construct honestly.',
1116
+ details: [],
1117
+ suggestions: [
1118
+ {
1119
+ applicability: 'manual',
1120
+ title: 'Use a simpler backend-supported shape',
1121
+ message:
1122
+ 'Refactor the code to avoid the boundary that currently requires deeper heap-runtime support.',
1123
+ },
1124
+ ],
1125
+ },
1126
+ COMPILER2003: {
1127
+ code: 'COMPILER2003',
1128
+ title: '`#[value]` classes require JS emit',
1129
+ summary:
1130
+ 'The current `#[value]` implementation only exists on the JS emit/runtime path and is not available in the compiler backend yet.',
1131
+ details: [
1132
+ 'Use a JS-targeted emit path for `#[value]` classes in v1.',
1133
+ 'The compiler backend currently rejects `#[value]` instead of silently compiling a mismatched representation.',
1134
+ ],
1135
+ suggestions: [
1136
+ {
1137
+ applicability: 'manual',
1138
+ title: 'Use a JS emit path or remove `#[value]`',
1139
+ message:
1140
+ 'Build or run the module through the JS emit pipeline, or rewrite the type without `#[value]` before compiling to Wasm.',
1141
+ },
1142
+ ],
1143
+ },
1144
+ SOUNDSCRIPT_NUMERIC_MIXED_LEAF: {
1145
+ code: 'SOUNDSCRIPT_NUMERIC_MIXED_LEAF',
1146
+ title: 'Mixed machine numeric leaves require explicit coercion',
1147
+ summary:
1148
+ 'soundscript rejects arithmetic that mixes different concrete machine numeric leaves without an explicit coercion.',
1149
+ details: [
1150
+ 'Coerce one side to the intended machine numeric carrier before applying the operator.',
1151
+ ],
1152
+ suggestions: [
1153
+ {
1154
+ applicability: 'manual',
1155
+ title: 'Coerce one side first',
1156
+ message:
1157
+ 'Convert one operand explicitly so both sides use the same machine numeric leaf before applying the operator.',
1158
+ },
1159
+ ],
1160
+ },
1161
+ SOUNDSCRIPT_NUMERIC_ABSTRACT_FAMILY: {
1162
+ code: 'SOUNDSCRIPT_NUMERIC_ABSTRACT_FAMILY',
1163
+ title: 'Abstract numeric families must be narrowed before arithmetic',
1164
+ summary:
1165
+ 'Numeric operators cannot run directly on abstract numeric families until the value is narrowed to a concrete carrier or coerced explicitly.',
1166
+ details: [
1167
+ 'This commonly means narrowing with `typeof` or converting with a machine numeric helper before arithmetic.',
1168
+ ],
1169
+ suggestions: [
1170
+ {
1171
+ applicability: 'manual',
1172
+ title: 'Narrow or coerce to a concrete numeric carrier',
1173
+ message:
1174
+ 'Use `typeof` to narrow to `number` or `bigint`, or coerce explicitly with a machine numeric helper before applying the operator.',
1175
+ },
1176
+ ],
1177
+ },
1178
+ SOUNDSCRIPT_SORT_COMPARE_REQUIRED: {
1179
+ code: 'SOUNDSCRIPT_SORT_COMPARE_REQUIRED',
1180
+ title: 'Sorting in `.sts` requires an explicit comparator',
1181
+ summary:
1182
+ 'soundscript does not allow bare `sort()` or `toSorted()` calls in `.sts` because the default JavaScript comparator is too implicit.',
1183
+ details: [],
1184
+ suggestions: [
1185
+ {
1186
+ applicability: 'manual',
1187
+ title: 'Pass an explicit comparator',
1188
+ message:
1189
+ 'Provide a compare function such as `values.sort(F64.compare)` or another explicit ordering helper.',
1190
+ },
1191
+ ],
1192
+ },
1193
+ SOUNDSCRIPT_EXPANSION_DISABLED: {
1194
+ code: 'SOUNDSCRIPT_EXPANSION_DISABLED',
1195
+ title: 'Expansion-based syntax is disabled for this analysis',
1196
+ summary:
1197
+ 'The current analysis run does not allow expansion-based features, so expansion-only syntax cannot be processed.',
1198
+ details: [],
1199
+ suggestions: [
1200
+ {
1201
+ applicability: 'manual',
1202
+ title: 'Enable expansion or remove the feature use',
1203
+ message:
1204
+ 'Enable expansion-based features for this analysis run, or remove the macro/expansion-only syntax from the source.',
1205
+ },
1206
+ ],
1207
+ },
1208
+ SOUNDSCRIPT_ANALYSIS_ERROR: {
1209
+ code: 'SOUNDSCRIPT_ANALYSIS_ERROR',
1210
+ title: 'soundscript could not analyze the file',
1211
+ summary:
1212
+ 'The language service encountered an unexpected analysis failure while processing the file.',
1213
+ details: [],
1214
+ suggestions: [
1215
+ {
1216
+ applicability: 'manual',
1217
+ title: 'Check config and restart the language server',
1218
+ message:
1219
+ 'Verify the project configuration, then restart the language server if the failure persists.',
1220
+ },
1221
+ ],
1222
+ },
1223
+ SOUNDSCRIPT_BUILD_INVALID_EXPORT: {
1224
+ code: 'SOUNDSCRIPT_BUILD_INVALID_EXPORT',
1225
+ title: 'A `soundscript.exports` entry is invalid',
1226
+ summary:
1227
+ 'A `soundscript.exports[...]` entry is malformed or points to a missing source file, so `soundscript build` cannot package the project honestly.',
1228
+ details: [
1229
+ 'Each entry must be an object with a string `source` path that resolves to an existing soundscript source file.',
1230
+ ],
1231
+ suggestions: [
1232
+ {
1233
+ applicability: 'manual',
1234
+ title: 'Fix the invalid export entry',
1235
+ message:
1236
+ 'Ensure each `soundscript.exports` entry is an object with a valid `source` path to an existing `.sts` file.',
1237
+ },
1238
+ ],
1239
+ },
1240
+ SOUNDSCRIPT_BUILD_NO_PACKAGE_JSON: {
1241
+ code: 'SOUNDSCRIPT_BUILD_NO_PACKAGE_JSON',
1242
+ title: '`soundscript build` requires a package.json',
1243
+ summary:
1244
+ 'The build command packages a library surface, so it needs a nearby `package.json` to define package metadata.',
1245
+ details: [],
1246
+ suggestions: [
1247
+ {
1248
+ applicability: 'manual',
1249
+ title: 'Add a package.json',
1250
+ message: 'Create a `package.json` in the package root before running `soundscript build`.',
1251
+ },
1252
+ ],
1253
+ },
1254
+ SOUNDSCRIPT_BUILD_NO_EXPORTS: {
1255
+ code: 'SOUNDSCRIPT_BUILD_NO_EXPORTS',
1256
+ title: '`soundscript build` requires `soundscript.exports` metadata',
1257
+ summary:
1258
+ 'The package.json does not declare any soundscript source exports, so the build command has no package surface to emit.',
1259
+ details: [],
1260
+ suggestions: [
1261
+ {
1262
+ applicability: 'manual',
1263
+ title: 'Declare package source exports',
1264
+ message:
1265
+ "Add `package.json#soundscript.exports` entries that point at the package's `.sts` source files.",
1266
+ },
1267
+ ],
1268
+ },
1269
+ SOUNDSCRIPT_CLI_EXPAND_FILE_NOT_FOUND: {
1270
+ code: 'SOUNDSCRIPT_CLI_EXPAND_FILE_NOT_FOUND',
1271
+ title: 'Requested expand file is not part of the project',
1272
+ summary:
1273
+ 'The file passed to `soundscript expand --file` was not included in the expanded project graph.',
1274
+ details: [],
1275
+ suggestions: [
1276
+ {
1277
+ applicability: 'manual',
1278
+ title: 'Pass a project file',
1279
+ message:
1280
+ 'Use a file that is included by the selected `tsconfig.json`, or update the config so the file belongs to the project first.',
1281
+ },
1282
+ ],
1283
+ },
1284
+ SOUNDSCRIPT_NO_PROJECT: {
1285
+ code: 'SOUNDSCRIPT_NO_PROJECT',
1286
+ title: 'No project config was found',
1287
+ summary: 'The CLI could not find the requested `tsconfig.json` for the command.',
1288
+ details: [],
1289
+ suggestions: [
1290
+ {
1291
+ applicability: 'manual',
1292
+ title: 'Create or point to a project config',
1293
+ message:
1294
+ 'Run `soundscript init` for a new project or pass `--project` with the correct tsconfig path.',
1295
+ },
1296
+ ],
1297
+ },
1298
+ SOUNDSCRIPT_INIT_CONFLICT: {
1299
+ code: 'SOUNDSCRIPT_INIT_CONFLICT',
1300
+ title: 'Initialization would overwrite existing files',
1301
+ summary:
1302
+ 'The requested init mode found existing soundscript-managed files and refused to replace them.',
1303
+ details: [],
1304
+ suggestions: [
1305
+ {
1306
+ applicability: 'manual',
1307
+ title: 'Resolve the conflicting files first',
1308
+ message:
1309
+ 'Remove, rename, or intentionally reuse the existing soundscript config before running `soundscript init` again.',
1310
+ },
1311
+ ],
1312
+ },
1313
+ SOUNDSCRIPT_INIT_BASE_PROJECT_MISSING: {
1314
+ code: 'SOUNDSCRIPT_INIT_BASE_PROJECT_MISSING',
1315
+ title: 'Existing-project init requires a base tsconfig',
1316
+ summary: '`soundscript init --mode existing` needs a `tsconfig.json` in the current directory.',
1317
+ details: [],
1318
+ suggestions: [
1319
+ {
1320
+ applicability: 'manual',
1321
+ title: 'Create the base tsconfig first',
1322
+ message:
1323
+ 'Add a `tsconfig.json` to the project before running `soundscript init --mode existing`.',
1324
+ },
1325
+ ],
1326
+ },
1327
+ SOUNDSCRIPT_INVALID_COMMAND: {
1328
+ code: 'SOUNDSCRIPT_INVALID_COMMAND',
1329
+ title: 'CLI invocation is invalid',
1330
+ summary:
1331
+ 'The provided soundscript command line was missing required arguments or used an unsupported option.',
1332
+ details: [
1333
+ 'Usage and parse failures exit with code 2 so scripts can distinguish them from project diagnostics.',
1334
+ ],
1335
+ suggestions: [
1336
+ {
1337
+ applicability: 'manual',
1338
+ title: 'Check the command usage',
1339
+ message: 'Run `soundscript --help` and retry with a supported subcommand and option set.',
1340
+ },
1341
+ ],
1342
+ },
1343
+ SOUNDSCRIPT_INTERNAL_ERROR: {
1344
+ code: 'SOUNDSCRIPT_INTERNAL_ERROR',
1345
+ title: 'Unexpected internal error',
1346
+ summary:
1347
+ 'soundscript encountered an unexpected internal failure while running the requested command.',
1348
+ details: [
1349
+ 'Internal failures exit with code 2 so scripts can distinguish tool failure from project diagnostics.',
1350
+ ],
1351
+ suggestions: [
1352
+ {
1353
+ applicability: 'manual',
1354
+ title: 'Retry with a minimal reproduction',
1355
+ message:
1356
+ 'Retry the command with the smallest repro you can share, then file an issue if the failure persists.',
1357
+ },
1358
+ ],
1359
+ },
1360
+ SOUNDSCRIPT_RUNTIME_NO_ENTRY: {
1361
+ code: 'SOUNDSCRIPT_RUNTIME_NO_ENTRY',
1362
+ title: 'Runtime command did not receive an entry file',
1363
+ summary: 'The runtime materializer was asked to run without an entry module.',
1364
+ details: [],
1365
+ suggestions: [
1366
+ {
1367
+ applicability: 'manual',
1368
+ title: 'Pass an entry file',
1369
+ message:
1370
+ 'Provide a concrete `.sts`, `.ts`, or JavaScript entry path when running `soundscript node` or `soundscript deno run`.',
1371
+ },
1372
+ ],
1373
+ },
1374
+ SOUNDSCRIPT_RUNTIME_NO_PROJECT: {
1375
+ code: 'SOUNDSCRIPT_RUNTIME_NO_PROJECT',
1376
+ title: 'Runtime entry is not inside a soundscript project',
1377
+ summary:
1378
+ 'The runtime wrapper could not find a `tsconfig.soundscript.json` or `tsconfig.json` for the requested entry file.',
1379
+ details: [],
1380
+ suggestions: [
1381
+ {
1382
+ applicability: 'manual',
1383
+ title: 'Run inside a project config',
1384
+ message:
1385
+ 'Create a soundscript project with `soundscript init`, or place the entry under a directory with a matching `tsconfig.json` or `tsconfig.soundscript.json`.',
1386
+ },
1387
+ ],
1388
+ },
1389
+ SOUNDSCRIPT_RUNTIME_PACKAGE_MISSING: {
1390
+ code: 'SOUNDSCRIPT_RUNTIME_PACKAGE_MISSING',
1391
+ title: 'Runtime package is not installed',
1392
+ summary:
1393
+ 'The runtime wrappers need an installed `@soundscript/soundscript` package in the current project or an ancestor workspace.',
1394
+ details: [],
1395
+ suggestions: [
1396
+ {
1397
+ applicability: 'manual',
1398
+ title: 'Install the runtime package',
1399
+ message:
1400
+ 'Install `@soundscript/soundscript` in the project or an ancestor workspace before using `soundscript node` or `soundscript deno`.',
1401
+ },
1402
+ ],
1403
+ },
1404
+ SOUNDSCRIPT_MACRO_PARSE: {
1405
+ code: 'SOUNDSCRIPT_MACRO_PARSE',
1406
+ title: 'Macro syntax could not be parsed',
1407
+ summary: 'The macro frontend could not parse a macro form in the source file.',
1408
+ details: [],
1409
+ suggestions: [
1410
+ {
1411
+ applicability: 'manual',
1412
+ title: 'Reduce the macro to a supported form',
1413
+ message:
1414
+ 'Check the macro invocation syntax and rewrite it to a supported v1 form before retrying.',
1415
+ },
1416
+ ],
1417
+ },
1418
+ SOUNDSCRIPT_MACRO_EXPANSION: {
1419
+ code: 'SOUNDSCRIPT_MACRO_EXPANSION',
1420
+ title: 'Macro expansion failed',
1421
+ summary: 'The macro parsed, but expansion failed when applying its semantics.',
1422
+ details: [],
1423
+ suggestions: [
1424
+ {
1425
+ applicability: 'manual',
1426
+ title: 'Inspect the failing macro boundary',
1427
+ message:
1428
+ 'Check the macro invocation, its operand types, and any imported macro bindings near the reported span.',
1429
+ },
1430
+ ],
1431
+ },
1432
+ SOUNDSCRIPT_MACRO_UNSUPPORTED_SOURCE_KIND: {
1433
+ code: 'SOUNDSCRIPT_MACRO_UNSUPPORTED_SOURCE_KIND',
1434
+ title: 'Macro module must be soundscript source',
1435
+ summary: 'User-authored macros must come from `.sts` modules.',
1436
+ details: [],
1437
+ suggestions: [
1438
+ {
1439
+ applicability: 'manual',
1440
+ title: 'Move the macro module to `.sts`',
1441
+ message:
1442
+ 'Rewrite the macro module and any compile-time helpers as soundscript source instead of `.ts` or `.js`.',
1443
+ },
1444
+ ],
1445
+ },
1446
+ SOUNDSCRIPT_MACRO_NON_SOUNDSCRIPT_DEPENDENCY: {
1447
+ code: 'SOUNDSCRIPT_MACRO_NON_SOUNDSCRIPT_DEPENDENCY',
1448
+ title: 'Macro graph crossed a non-soundscript boundary',
1449
+ summary:
1450
+ 'Macro dependency graphs may only depend on `.sts` source plus supported builtin modules.',
1451
+ details: [],
1452
+ suggestions: [
1453
+ {
1454
+ applicability: 'manual',
1455
+ title: 'Keep the macro graph inside `.sts`',
1456
+ message:
1457
+ 'Move helper modules into `.sts` or replace the dependency with explicit compile-time inputs through `ctx.host`.',
1458
+ },
1459
+ ],
1460
+ },
1461
+ SOUNDSCRIPT_MACRO_INTEROP_GRAPH: {
1462
+ code: 'SOUNDSCRIPT_MACRO_INTEROP_GRAPH',
1463
+ title: 'Macro graph cannot use interop',
1464
+ summary: 'Macro modules may not cross `#[interop]` or projected declaration boundaries.',
1465
+ details: [],
1466
+ suggestions: [
1467
+ {
1468
+ applicability: 'manual',
1469
+ title: 'Remove `#[interop]` from the macro graph',
1470
+ message:
1471
+ 'Move macro helpers into pure soundscript modules and replace foreign reads with explicit `ctx.host` access when needed.',
1472
+ },
1473
+ ],
1474
+ },
1475
+ SOUNDSCRIPT_MACRO_FORBIDDEN_INVOCATION: {
1476
+ code: 'SOUNDSCRIPT_MACRO_FORBIDDEN_INVOCATION',
1477
+ title: 'Macro modules cannot invoke macros',
1478
+ summary:
1479
+ 'Macro authoring modules compile as soundscript, but macro syntax is disabled inside the macro target.',
1480
+ details: [],
1481
+ suggestions: [
1482
+ {
1483
+ applicability: 'manual',
1484
+ title: 'Remove macro syntax from the macro module',
1485
+ message:
1486
+ 'Compute helper values with ordinary soundscript code inside the macro module instead of invoking macros there.',
1487
+ },
1488
+ ],
1489
+ },
1490
+ SOUNDSCRIPT_MACRO_FORBIDDEN_GLOBAL: {
1491
+ code: 'SOUNDSCRIPT_MACRO_FORBIDDEN_GLOBAL',
1492
+ title: 'Macro module used a forbidden ambient global',
1493
+ summary:
1494
+ 'Portable macro modules must use explicit compile-time capabilities instead of ambient runtime globals.',
1495
+ details: [],
1496
+ suggestions: [
1497
+ {
1498
+ applicability: 'manual',
1499
+ title: 'Use `ctx.host` or `ctx.runtime` instead',
1500
+ message:
1501
+ 'Replace ambient runtime access such as `Deno`, `process`, `fetch`, randomness, or timers with supported compile-time capabilities.',
1502
+ },
1503
+ ],
1504
+ },
1505
+ SOUNDSCRIPT_MACRO_FORBIDDEN_TOP_LEVEL_EFFECT: {
1506
+ code: 'SOUNDSCRIPT_MACRO_FORBIDDEN_TOP_LEVEL_EFFECT',
1507
+ title: 'Macro module used a forbidden top-level effect',
1508
+ summary: 'Macro modules must remain deterministic and side-effect free at top level.',
1509
+ details: [],
1510
+ suggestions: [
1511
+ {
1512
+ applicability: 'manual',
1513
+ title: 'Move the effect behind explicit inputs',
1514
+ message:
1515
+ 'Remove top-level mutation, static initialization effects, or dynamic loading and derive the result from source plus `ctx.host` inputs instead.',
1516
+ },
1517
+ ],
1518
+ },
1519
+ } as const satisfies Record<string, DiagnosticReference>;
1520
+
1521
+ export function getDiagnosticReference(code: string): DiagnosticReference | undefined {
1522
+ return DIAGNOSTIC_REFERENCES[code.toUpperCase() as keyof typeof DIAGNOSTIC_REFERENCES];
1523
+ }