universal-physics-tensor 10.0.0 → 12.0.0

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 (835) hide show
  1. package/README.md +39 -36
  2. package/bin/upt.mjs +13 -1
  3. package/data/applied-cases.json +1892 -0
  4. package/data/applied-cases.schema.json +194 -0
  5. package/data/atlas/atlas.json +25 -25
  6. package/data/atlas/atlas.jsonld +1 -1
  7. package/data/atlas/diffusion.json +6 -6
  8. package/data/atlas/oscillators.json +7 -7
  9. package/data/atlas/waves.json +14 -14
  10. package/data/atlas/witness-results.json +11 -11
  11. package/data/bridge-catalog.json +389 -230
  12. package/data/bridge-catalog.schema.json +45 -7
  13. package/data/units.json +6 -25
  14. package/dist/atlas/applicability.d.ts.map +1 -1
  15. package/dist/atlas/applicability.js +21 -15
  16. package/dist/atlas/applicability.js.map +1 -1
  17. package/dist/atlas/benchmark/hybrid-retrieval.d.ts +9 -1
  18. package/dist/atlas/benchmark/hybrid-retrieval.d.ts.map +1 -1
  19. package/dist/atlas/benchmark/hybrid-retrieval.js +15 -13
  20. package/dist/atlas/benchmark/hybrid-retrieval.js.map +1 -1
  21. package/dist/atlas/benchmark/loader.js +2 -2
  22. package/dist/atlas/benchmark/loader.js.map +1 -1
  23. package/dist/atlas/benchmark/stats.d.ts +2 -2
  24. package/dist/atlas/benchmark/stats.d.ts.map +1 -1
  25. package/dist/atlas/benchmark/stats.js +9 -15
  26. package/dist/atlas/benchmark/stats.js.map +1 -1
  27. package/dist/atlas/catalog-formal-ref.d.ts +26 -3
  28. package/dist/atlas/catalog-formal-ref.d.ts.map +1 -1
  29. package/dist/atlas/catalog-formal-ref.js +52 -5
  30. package/dist/atlas/catalog-formal-ref.js.map +1 -1
  31. package/dist/atlas/chain-pipeline.d.ts.map +1 -1
  32. package/dist/atlas/chain-pipeline.js +7 -8
  33. package/dist/atlas/chain-pipeline.js.map +1 -1
  34. package/dist/atlas/diffusion/bridges-closure.d.ts +0 -4
  35. package/dist/atlas/diffusion/bridges-closure.d.ts.map +1 -1
  36. package/dist/atlas/diffusion/bridges-closure.js +8 -12
  37. package/dist/atlas/diffusion/bridges-closure.js.map +1 -1
  38. package/dist/atlas/diffusion/bridges.d.ts.map +1 -1
  39. package/dist/atlas/diffusion/bridges.js +27 -39
  40. package/dist/atlas/diffusion/bridges.js.map +1 -1
  41. package/dist/atlas/diffusion/dimensions.d.ts +6 -14
  42. package/dist/atlas/diffusion/dimensions.d.ts.map +1 -1
  43. package/dist/atlas/diffusion/dimensions.js +8 -16
  44. package/dist/atlas/diffusion/dimensions.js.map +1 -1
  45. package/dist/atlas/diffusion/models.d.ts +3 -3
  46. package/dist/atlas/diffusion/models.d.ts.map +1 -1
  47. package/dist/atlas/diffusion/models.js +5 -10
  48. package/dist/atlas/diffusion/models.js.map +1 -1
  49. package/dist/atlas/diffusion/numerics.d.ts +16 -4
  50. package/dist/atlas/diffusion/numerics.d.ts.map +1 -1
  51. package/dist/atlas/diffusion/numerics.js +38 -24
  52. package/dist/atlas/diffusion/numerics.js.map +1 -1
  53. package/dist/atlas/link-prediction.d.ts +106 -3
  54. package/dist/atlas/link-prediction.d.ts.map +1 -1
  55. package/dist/atlas/link-prediction.js +212 -66
  56. package/dist/atlas/link-prediction.js.map +1 -1
  57. package/dist/atlas/oscillators/bridges-coarse.d.ts.map +1 -1
  58. package/dist/atlas/oscillators/bridges-coarse.js +7 -11
  59. package/dist/atlas/oscillators/bridges-coarse.js.map +1 -1
  60. package/dist/atlas/oscillators/bridges-exact.d.ts.map +1 -1
  61. package/dist/atlas/oscillators/bridges-exact.js +6 -7
  62. package/dist/atlas/oscillators/bridges-exact.js.map +1 -1
  63. package/dist/atlas/oscillators/bridges-limits.d.ts +3 -16
  64. package/dist/atlas/oscillators/bridges-limits.d.ts.map +1 -1
  65. package/dist/atlas/oscillators/bridges-limits.js +23 -34
  66. package/dist/atlas/oscillators/bridges-limits.js.map +1 -1
  67. package/dist/atlas/oscillators/dimensions.d.ts +9 -21
  68. package/dist/atlas/oscillators/dimensions.d.ts.map +1 -1
  69. package/dist/atlas/oscillators/dimensions.js +9 -21
  70. package/dist/atlas/oscillators/dimensions.js.map +1 -1
  71. package/dist/atlas/oscillators/limit-witnesses.d.ts +2 -2
  72. package/dist/atlas/oscillators/limit-witnesses.d.ts.map +1 -1
  73. package/dist/atlas/oscillators/limit-witnesses.js +17 -15
  74. package/dist/atlas/oscillators/limit-witnesses.js.map +1 -1
  75. package/dist/atlas/oscillators/models.d.ts.map +1 -1
  76. package/dist/atlas/oscillators/models.js +2 -6
  77. package/dist/atlas/oscillators/models.js.map +1 -1
  78. package/dist/atlas/oscillators/pendulum-motion.d.ts +29 -6
  79. package/dist/atlas/oscillators/pendulum-motion.d.ts.map +1 -1
  80. package/dist/atlas/oscillators/pendulum-motion.js +60 -40
  81. package/dist/atlas/oscillators/pendulum-motion.js.map +1 -1
  82. package/dist/atlas/oscillators/phase-translation.d.ts +0 -11
  83. package/dist/atlas/oscillators/phase-translation.d.ts.map +1 -1
  84. package/dist/atlas/oscillators/phase-translation.js +3 -4
  85. package/dist/atlas/oscillators/phase-translation.js.map +1 -1
  86. package/dist/atlas/oscillators/position-translation.d.ts +68 -7
  87. package/dist/atlas/oscillators/position-translation.d.ts.map +1 -1
  88. package/dist/atlas/oscillators/position-translation.js +123 -12
  89. package/dist/atlas/oscillators/position-translation.js.map +1 -1
  90. package/dist/atlas/oscillators/rejections.d.ts +0 -2
  91. package/dist/atlas/oscillators/rejections.d.ts.map +1 -1
  92. package/dist/atlas/oscillators/rejections.js +0 -7
  93. package/dist/atlas/oscillators/rejections.js.map +1 -1
  94. package/dist/atlas/physjs-entries.generated.d.ts +35 -25
  95. package/dist/atlas/physjs-entries.generated.d.ts.map +1 -1
  96. package/dist/atlas/physjs-entries.generated.js +37 -25
  97. package/dist/atlas/physjs-entries.generated.js.map +1 -1
  98. package/dist/atlas/physjs-ref.d.ts +34 -31
  99. package/dist/atlas/physjs-ref.d.ts.map +1 -1
  100. package/dist/atlas/physjs-ref.js +55 -53
  101. package/dist/atlas/physjs-ref.js.map +1 -1
  102. package/dist/atlas/physjs-reviewed.d.ts +1 -1
  103. package/dist/atlas/physjs-reviewed.js +15 -15
  104. package/dist/atlas/physjs-reviewed.js.map +1 -1
  105. package/dist/atlas/poster/statements.d.ts +0 -19
  106. package/dist/atlas/poster/statements.d.ts.map +1 -1
  107. package/dist/atlas/poster/statements.js +1 -1
  108. package/dist/atlas/poster/statements.js.map +1 -1
  109. package/dist/atlas/proof-target.d.ts +1 -1
  110. package/dist/atlas/proof-target.js +1 -1
  111. package/dist/atlas/proof-target.js.map +1 -1
  112. package/dist/atlas/regime.d.ts +1 -1
  113. package/dist/atlas/regime.d.ts.map +1 -1
  114. package/dist/atlas/regime.js +1 -1
  115. package/dist/atlas/regime.js.map +1 -1
  116. package/dist/atlas/text-overlap.d.ts +23 -0
  117. package/dist/atlas/text-overlap.d.ts.map +1 -0
  118. package/dist/atlas/text-overlap.js +41 -0
  119. package/dist/atlas/text-overlap.js.map +1 -0
  120. package/dist/atlas/waves/bridges-closure.d.ts.map +1 -1
  121. package/dist/atlas/waves/bridges-closure.js +2 -6
  122. package/dist/atlas/waves/bridges-closure.js.map +1 -1
  123. package/dist/atlas/waves/bridges.d.ts.map +1 -1
  124. package/dist/atlas/waves/bridges.js +32 -48
  125. package/dist/atlas/waves/bridges.js.map +1 -1
  126. package/dist/atlas/waves/models.d.ts +5 -6
  127. package/dist/atlas/waves/models.d.ts.map +1 -1
  128. package/dist/atlas/waves/models.js +7 -13
  129. package/dist/atlas/waves/models.js.map +1 -1
  130. package/dist/atlas/waves/numerics.d.ts.map +1 -1
  131. package/dist/atlas/waves/numerics.js +10 -3
  132. package/dist/atlas/waves/numerics.js.map +1 -1
  133. package/dist/atlas/witness-numeric.d.ts +30 -0
  134. package/dist/atlas/witness-numeric.d.ts.map +1 -1
  135. package/dist/atlas/witness-numeric.js +53 -0
  136. package/dist/atlas/witness-numeric.js.map +1 -1
  137. package/dist/atlas/witness-specs.d.ts.map +1 -1
  138. package/dist/atlas/witness-specs.js +19 -0
  139. package/dist/atlas/witness-specs.js.map +1 -1
  140. package/dist/atlas/witness-symbolic.d.ts +75 -3
  141. package/dist/atlas/witness-symbolic.d.ts.map +1 -1
  142. package/dist/atlas/witness-symbolic.js +116 -10
  143. package/dist/atlas/witness-symbolic.js.map +1 -1
  144. package/dist/bridges/catalog-load.d.ts.map +1 -1
  145. package/dist/bridges/catalog-load.js +13 -8
  146. package/dist/bridges/catalog-load.js.map +1 -1
  147. package/dist/bridges/catalog-types.d.ts +26 -2
  148. package/dist/bridges/catalog-types.d.ts.map +1 -1
  149. package/dist/bridges/catalog-types.js +11 -1
  150. package/dist/bridges/catalog-types.js.map +1 -1
  151. package/dist/bridges/evaluation-errors.d.ts +31 -1
  152. package/dist/bridges/evaluation-errors.d.ts.map +1 -1
  153. package/dist/bridges/evaluation-errors.js +20 -2
  154. package/dist/bridges/evaluation-errors.js.map +1 -1
  155. package/dist/bridges/evaluator-inputs.d.ts.map +1 -1
  156. package/dist/bridges/evaluator-inputs.js +7 -5
  157. package/dist/bridges/evaluator-inputs.js.map +1 -1
  158. package/dist/bridges/evaluators.d.ts.map +1 -1
  159. package/dist/bridges/evaluators.js +27 -12
  160. package/dist/bridges/evaluators.js.map +1 -1
  161. package/dist/bridges/expr-parse.d.ts +11 -0
  162. package/dist/bridges/expr-parse.d.ts.map +1 -1
  163. package/dist/bridges/expr-parse.js +14 -5
  164. package/dist/bridges/expr-parse.js.map +1 -1
  165. package/dist/bridges/holds.d.ts +35 -3
  166. package/dist/bridges/holds.d.ts.map +1 -1
  167. package/dist/bridges/holds.js +117 -23
  168. package/dist/bridges/holds.js.map +1 -1
  169. package/dist/bridges/notices.d.ts.map +1 -1
  170. package/dist/bridges/notices.js +5 -5
  171. package/dist/bridges/notices.js.map +1 -1
  172. package/dist/bridges/relation-eval.d.ts +4 -4
  173. package/dist/bridges/relation-eval.d.ts.map +1 -1
  174. package/dist/bridges/relation-eval.js +15 -16
  175. package/dist/bridges/relation-eval.js.map +1 -1
  176. package/dist/bridges/sensitivity.d.ts.map +1 -1
  177. package/dist/bridges/sensitivity.js +3 -3
  178. package/dist/bridges/sensitivity.js.map +1 -1
  179. package/dist/bridges/validity.d.ts +33 -0
  180. package/dist/bridges/validity.d.ts.map +1 -0
  181. package/dist/bridges/validity.js +67 -0
  182. package/dist/bridges/validity.js.map +1 -0
  183. package/dist/canonical/entries/atomic.js +1 -3
  184. package/dist/canonical/entries/atomic.js.map +1 -1
  185. package/dist/canonical/entries/condensed-matter.d.ts.map +1 -1
  186. package/dist/canonical/entries/condensed-matter.js +4 -5
  187. package/dist/canonical/entries/condensed-matter.js.map +1 -1
  188. package/dist/canonical/entries/dimensional-classics.d.ts.map +1 -1
  189. package/dist/canonical/entries/dimensional-classics.js +3 -4
  190. package/dist/canonical/entries/dimensional-classics.js.map +1 -1
  191. package/dist/canonical/entries/electromagnetism.d.ts.map +1 -1
  192. package/dist/canonical/entries/electromagnetism.js +4 -10
  193. package/dist/canonical/entries/electromagnetism.js.map +1 -1
  194. package/dist/canonical/entries/fluids-waves.d.ts.map +1 -1
  195. package/dist/canonical/entries/fluids-waves.js +3 -7
  196. package/dist/canonical/entries/fluids-waves.js.map +1 -1
  197. package/dist/canonical/entries/mechanics.d.ts.map +1 -1
  198. package/dist/canonical/entries/mechanics.js +4 -6
  199. package/dist/canonical/entries/mechanics.js.map +1 -1
  200. package/dist/canonical/entries/nonmonomial.d.ts.map +1 -1
  201. package/dist/canonical/entries/nonmonomial.js +9 -17
  202. package/dist/canonical/entries/nonmonomial.js.map +1 -1
  203. package/dist/canonical/entries/relativity.d.ts.map +1 -1
  204. package/dist/canonical/entries/relativity.js +6 -6
  205. package/dist/canonical/entries/relativity.js.map +1 -1
  206. package/dist/canonical/entries/thermo-nuclear-cosmo.d.ts.map +1 -1
  207. package/dist/canonical/entries/thermo-nuclear-cosmo.js +6 -10
  208. package/dist/canonical/entries/thermo-nuclear-cosmo.js.map +1 -1
  209. package/dist/canonical/fixed-points.d.ts +94 -0
  210. package/dist/canonical/fixed-points.d.ts.map +1 -0
  211. package/dist/canonical/fixed-points.js +81 -0
  212. package/dist/canonical/fixed-points.js.map +1 -0
  213. package/dist/canonical/linkage.d.ts.map +1 -1
  214. package/dist/canonical/linkage.js +25 -44
  215. package/dist/canonical/linkage.js.map +1 -1
  216. package/dist/canonical/normal-form.d.ts.map +1 -1
  217. package/dist/canonical/normal-form.js +5 -11
  218. package/dist/canonical/normal-form.js.map +1 -1
  219. package/dist/canonical/structural.d.ts +21 -21
  220. package/dist/canonical/structural.d.ts.map +1 -1
  221. package/dist/canonical/structural.js +40 -19
  222. package/dist/canonical/structural.js.map +1 -1
  223. package/dist/cases/catalog-checks.d.ts +10 -0
  224. package/dist/cases/catalog-checks.d.ts.map +1 -0
  225. package/dist/cases/catalog-checks.js +241 -0
  226. package/dist/cases/catalog-checks.js.map +1 -0
  227. package/dist/cases/catalog.d.ts +83 -0
  228. package/dist/cases/catalog.d.ts.map +1 -0
  229. package/dist/cases/catalog.js +118 -0
  230. package/dist/cases/catalog.js.map +1 -0
  231. package/dist/cases/engine.d.ts +13 -0
  232. package/dist/cases/engine.d.ts.map +1 -0
  233. package/dist/cases/engine.js +179 -0
  234. package/dist/cases/engine.js.map +1 -0
  235. package/dist/cases/index.d.ts.map +1 -1
  236. package/dist/cases/index.js +5 -7
  237. package/dist/cases/index.js.map +1 -1
  238. package/dist/cases/methods.d.ts +215 -0
  239. package/dist/cases/methods.d.ts.map +1 -0
  240. package/dist/cases/methods.js +743 -0
  241. package/dist/cases/methods.js.map +1 -0
  242. package/dist/cases/quadrature.d.ts +7 -9
  243. package/dist/cases/quadrature.d.ts.map +1 -1
  244. package/dist/cases/quadrature.js +28 -32
  245. package/dist/cases/quadrature.js.map +1 -1
  246. package/dist/cases/types.d.ts +12 -0
  247. package/dist/cases/types.d.ts.map +1 -1
  248. package/dist/cases/types.js.map +1 -1
  249. package/dist/cli/args.d.ts +25 -1
  250. package/dist/cli/args.d.ts.map +1 -1
  251. package/dist/cli/args.js +30 -8
  252. package/dist/cli/args.js.map +1 -1
  253. package/dist/cli/bindings.d.ts.map +1 -1
  254. package/dist/cli/bindings.js +5 -4
  255. package/dist/cli/bindings.js.map +1 -1
  256. package/dist/cli/command.d.ts +11 -1
  257. package/dist/cli/command.d.ts.map +1 -1
  258. package/dist/cli/command.js.map +1 -1
  259. package/dist/cli/commands/_atlas-map.d.ts +0 -9
  260. package/dist/cli/commands/_atlas-map.d.ts.map +1 -1
  261. package/dist/cli/commands/_atlas-map.js +8 -18
  262. package/dist/cli/commands/_atlas-map.js.map +1 -1
  263. package/dist/cli/commands/_atlas-route.d.ts.map +1 -1
  264. package/dist/cli/commands/_atlas-route.js +6 -2
  265. package/dist/cli/commands/_atlas-route.js.map +1 -1
  266. package/dist/cli/commands/_discovery-opts.d.ts +1 -0
  267. package/dist/cli/commands/_discovery-opts.d.ts.map +1 -1
  268. package/dist/cli/commands/_discovery-opts.js +9 -9
  269. package/dist/cli/commands/_discovery-opts.js.map +1 -1
  270. package/dist/cli/commands/atlas.d.ts.map +1 -1
  271. package/dist/cli/commands/atlas.js +8 -5
  272. package/dist/cli/commands/atlas.js.map +1 -1
  273. package/dist/cli/commands/audit.d.ts.map +1 -1
  274. package/dist/cli/commands/audit.js +8 -1
  275. package/dist/cli/commands/audit.js.map +1 -1
  276. package/dist/cli/commands/axes.d.ts.map +1 -1
  277. package/dist/cli/commands/axes.js +20 -1
  278. package/dist/cli/commands/axes.js.map +1 -1
  279. package/dist/cli/commands/confront.d.ts.map +1 -1
  280. package/dist/cli/commands/confront.js +8 -14
  281. package/dist/cli/commands/confront.js.map +1 -1
  282. package/dist/cli/commands/derive.d.ts.map +1 -1
  283. package/dist/cli/commands/derive.js +22 -22
  284. package/dist/cli/commands/derive.js.map +1 -1
  285. package/dist/cli/commands/discover.d.ts.map +1 -1
  286. package/dist/cli/commands/discover.js +122 -73
  287. package/dist/cli/commands/discover.js.map +1 -1
  288. package/dist/cli/commands/eval.d.ts.map +1 -1
  289. package/dist/cli/commands/eval.js +1 -0
  290. package/dist/cli/commands/eval.js.map +1 -1
  291. package/dist/cli/commands/evaluate.d.ts.map +1 -1
  292. package/dist/cli/commands/evaluate.js +67 -39
  293. package/dist/cli/commands/evaluate.js.map +1 -1
  294. package/dist/cli/commands/explain.d.ts.map +1 -1
  295. package/dist/cli/commands/explain.js +24 -3
  296. package/dist/cli/commands/explain.js.map +1 -1
  297. package/dist/cli/commands/ground.d.ts.map +1 -1
  298. package/dist/cli/commands/ground.js +7 -1
  299. package/dist/cli/commands/ground.js.map +1 -1
  300. package/dist/cli/commands/map.d.ts.map +1 -1
  301. package/dist/cli/commands/map.js +84 -11
  302. package/dist/cli/commands/map.js.map +1 -1
  303. package/dist/cli/commands/metric.d.ts.map +1 -1
  304. package/dist/cli/commands/metric.js +12 -9
  305. package/dist/cli/commands/metric.js.map +1 -1
  306. package/dist/cli/commands/path.d.ts +10 -0
  307. package/dist/cli/commands/path.d.ts.map +1 -1
  308. package/dist/cli/commands/path.js +25 -3
  309. package/dist/cli/commands/path.js.map +1 -1
  310. package/dist/cli/commands/probe.d.ts.map +1 -1
  311. package/dist/cli/commands/probe.js +59 -16
  312. package/dist/cli/commands/probe.js.map +1 -1
  313. package/dist/cli/commands/regime.d.ts.map +1 -1
  314. package/dist/cli/commands/regime.js +1 -0
  315. package/dist/cli/commands/regime.js.map +1 -1
  316. package/dist/cli/commands/retrieve.d.ts.map +1 -1
  317. package/dist/cli/commands/retrieve.js +1 -0
  318. package/dist/cli/commands/retrieve.js.map +1 -1
  319. package/dist/cli/commands/search.d.ts.map +1 -1
  320. package/dist/cli/commands/search.js +1 -0
  321. package/dist/cli/commands/search.js.map +1 -1
  322. package/dist/cli/commands/symbolic.d.ts.map +1 -1
  323. package/dist/cli/commands/symbolic.js +19 -28
  324. package/dist/cli/commands/symbolic.js.map +1 -1
  325. package/dist/cli/commands/testplan.d.ts.map +1 -1
  326. package/dist/cli/commands/testplan.js +4 -2
  327. package/dist/cli/commands/testplan.js.map +1 -1
  328. package/dist/cli/determination.d.ts +1 -0
  329. package/dist/cli/determination.d.ts.map +1 -1
  330. package/dist/cli/determination.js.map +1 -1
  331. package/dist/cli/expr-print.d.ts +0 -2
  332. package/dist/cli/expr-print.d.ts.map +1 -1
  333. package/dist/cli/expr-print.js +7 -31
  334. package/dist/cli/expr-print.js.map +1 -1
  335. package/dist/cli/flag-help.d.ts +1 -0
  336. package/dist/cli/flag-help.d.ts.map +1 -1
  337. package/dist/cli/flag-help.js +1 -0
  338. package/dist/cli/flag-help.js.map +1 -1
  339. package/dist/cli/graphs.d.ts +2 -0
  340. package/dist/cli/graphs.d.ts.map +1 -1
  341. package/dist/cli/graphs.js +1 -0
  342. package/dist/cli/graphs.js.map +1 -1
  343. package/dist/cli/main.d.ts +8 -0
  344. package/dist/cli/main.d.ts.map +1 -1
  345. package/dist/cli/main.js +19 -3
  346. package/dist/cli/main.js.map +1 -1
  347. package/dist/cli/numeric-flag.d.ts +12 -0
  348. package/dist/cli/numeric-flag.d.ts.map +1 -0
  349. package/dist/cli/numeric-flag.js +44 -0
  350. package/dist/cli/numeric-flag.js.map +1 -0
  351. package/dist/cli/output.d.ts +28 -0
  352. package/dist/cli/output.d.ts.map +1 -1
  353. package/dist/cli/output.js +23 -0
  354. package/dist/cli/output.js.map +1 -1
  355. package/dist/cli/record-reach.js +2 -2
  356. package/dist/cli/record-reach.js.map +1 -1
  357. package/dist/cli/record-tables.d.ts.map +1 -1
  358. package/dist/cli/record-tables.js +6 -5
  359. package/dist/cli/record-tables.js.map +1 -1
  360. package/dist/cli/record.d.ts +1 -5
  361. package/dist/cli/record.d.ts.map +1 -1
  362. package/dist/cli/record.js +9 -8
  363. package/dist/cli/record.js.map +1 -1
  364. package/dist/cli/search-index.d.ts.map +1 -1
  365. package/dist/cli/search-index.js +7 -6
  366. package/dist/cli/search-index.js.map +1 -1
  367. package/dist/cli/statuses.d.ts +0 -2
  368. package/dist/cli/statuses.d.ts.map +1 -1
  369. package/dist/cli/statuses.js +12 -9
  370. package/dist/cli/statuses.js.map +1 -1
  371. package/dist/cli/stored-results.d.ts +7 -0
  372. package/dist/cli/stored-results.d.ts.map +1 -0
  373. package/dist/cli/stored-results.js +23 -0
  374. package/dist/cli/stored-results.js.map +1 -0
  375. package/dist/cli/version.d.ts +1 -0
  376. package/dist/cli/version.d.ts.map +1 -1
  377. package/dist/cli/version.js +8 -5
  378. package/dist/cli/version.js.map +1 -1
  379. package/dist/cli-api.d.ts +36 -5
  380. package/dist/cli-api.d.ts.map +1 -1
  381. package/dist/cli-api.js +30 -4
  382. package/dist/cli-api.js.map +1 -1
  383. package/dist/composition/algebraic-equivalence.d.ts +43 -0
  384. package/dist/composition/algebraic-equivalence.d.ts.map +1 -0
  385. package/dist/composition/algebraic-equivalence.js +115 -0
  386. package/dist/composition/algebraic-equivalence.js.map +1 -0
  387. package/dist/composition/axes.d.ts +0 -6
  388. package/dist/composition/axes.d.ts.map +1 -1
  389. package/dist/composition/axes.js +6 -6
  390. package/dist/composition/axes.js.map +1 -1
  391. package/dist/composition/axis-audit.d.ts +47 -20
  392. package/dist/composition/axis-audit.d.ts.map +1 -1
  393. package/dist/composition/axis-audit.js +82 -9
  394. package/dist/composition/axis-audit.js.map +1 -1
  395. package/dist/composition/bridge-analysis.d.ts +17 -0
  396. package/dist/composition/bridge-analysis.d.ts.map +1 -1
  397. package/dist/composition/bridge-analysis.js +102 -55
  398. package/dist/composition/bridge-analysis.js.map +1 -1
  399. package/dist/composition/canonical-compare.d.ts +40 -0
  400. package/dist/composition/canonical-compare.d.ts.map +1 -1
  401. package/dist/composition/canonical-compare.js +122 -24
  402. package/dist/composition/canonical-compare.js.map +1 -1
  403. package/dist/composition/canonical-graph.d.ts +3 -3
  404. package/dist/composition/canonical-graph.d.ts.map +1 -1
  405. package/dist/composition/canonical-graph.js +11 -38
  406. package/dist/composition/canonical-graph.js.map +1 -1
  407. package/dist/composition/canonical-json.js +2 -2
  408. package/dist/composition/canonical-json.js.map +1 -1
  409. package/dist/composition/catalog-graph.d.ts.map +1 -1
  410. package/dist/composition/catalog-graph.js +2 -5
  411. package/dist/composition/catalog-graph.js.map +1 -1
  412. package/dist/composition/chain-candidate.d.ts +8 -0
  413. package/dist/composition/chain-candidate.d.ts.map +1 -1
  414. package/dist/composition/chain-candidate.js +9 -2
  415. package/dist/composition/chain-candidate.js.map +1 -1
  416. package/dist/composition/chain-match.d.ts +6 -3
  417. package/dist/composition/chain-match.d.ts.map +1 -1
  418. package/dist/composition/chain-match.js +4 -1
  419. package/dist/composition/chain-match.js.map +1 -1
  420. package/dist/composition/chain-result.d.ts.map +1 -1
  421. package/dist/composition/chain-result.js +2 -14
  422. package/dist/composition/chain-result.js.map +1 -1
  423. package/dist/composition/compose-symbolic.d.ts.map +1 -1
  424. package/dist/composition/compose-symbolic.js +3 -2
  425. package/dist/composition/compose-symbolic.js.map +1 -1
  426. package/dist/composition/compose.d.ts.map +1 -1
  427. package/dist/composition/compose.js +13 -5
  428. package/dist/composition/compose.js.map +1 -1
  429. package/dist/composition/composition-recovery.d.ts.map +1 -1
  430. package/dist/composition/composition-recovery.js +4 -7
  431. package/dist/composition/composition-recovery.js.map +1 -1
  432. package/dist/composition/consequence.d.ts +15 -5
  433. package/dist/composition/consequence.d.ts.map +1 -1
  434. package/dist/composition/consequence.js +6 -4
  435. package/dist/composition/consequence.js.map +1 -1
  436. package/dist/composition/discovery.d.ts +129 -9
  437. package/dist/composition/discovery.d.ts.map +1 -1
  438. package/dist/composition/discovery.js +171 -67
  439. package/dist/composition/discovery.js.map +1 -1
  440. package/dist/composition/edge.d.ts +21 -2
  441. package/dist/composition/edge.d.ts.map +1 -1
  442. package/dist/composition/edge.js +23 -1
  443. package/dist/composition/edge.js.map +1 -1
  444. package/dist/composition/enumerate.d.ts.map +1 -1
  445. package/dist/composition/enumerate.js +18 -3
  446. package/dist/composition/enumerate.js.map +1 -1
  447. package/dist/composition/evaluate-relation.d.ts +35 -11
  448. package/dist/composition/evaluate-relation.d.ts.map +1 -1
  449. package/dist/composition/evaluate-relation.js +60 -39
  450. package/dist/composition/evaluate-relation.js.map +1 -1
  451. package/dist/composition/explain.d.ts +3 -12
  452. package/dist/composition/explain.d.ts.map +1 -1
  453. package/dist/composition/explain.js +7 -20
  454. package/dist/composition/explain.js.map +1 -1
  455. package/dist/composition/expr-eval.d.ts +1 -1
  456. package/dist/composition/expr-eval.d.ts.map +1 -1
  457. package/dist/composition/expr-eval.js +6 -15
  458. package/dist/composition/expr-eval.js.map +1 -1
  459. package/dist/composition/expr-simplify.d.ts +26 -14
  460. package/dist/composition/expr-simplify.d.ts.map +1 -1
  461. package/dist/composition/expr-simplify.js +64 -72
  462. package/dist/composition/expr-simplify.js.map +1 -1
  463. package/dist/composition/formula-shape.d.ts +23 -4
  464. package/dist/composition/formula-shape.d.ts.map +1 -1
  465. package/dist/composition/formula-shape.js +57 -17
  466. package/dist/composition/formula-shape.js.map +1 -1
  467. package/dist/composition/graph-structure.d.ts +98 -0
  468. package/dist/composition/graph-structure.d.ts.map +1 -0
  469. package/dist/composition/graph-structure.js +167 -0
  470. package/dist/composition/graph-structure.js.map +1 -0
  471. package/dist/composition/graph-viz-svg.d.ts.map +1 -1
  472. package/dist/composition/graph-viz-svg.js +1 -1
  473. package/dist/composition/graph-viz-svg.js.map +1 -1
  474. package/dist/composition/graph-viz.d.ts.map +1 -1
  475. package/dist/composition/graph-viz.js +8 -37
  476. package/dist/composition/graph-viz.js.map +1 -1
  477. package/dist/composition/grounding.d.ts.map +1 -1
  478. package/dist/composition/grounding.js +19 -7
  479. package/dist/composition/grounding.js.map +1 -1
  480. package/dist/composition/identifiability.d.ts +91 -4
  481. package/dist/composition/identifiability.d.ts.map +1 -1
  482. package/dist/composition/identifiability.js +363 -6
  483. package/dist/composition/identifiability.js.map +1 -1
  484. package/dist/composition/index.d.ts +8 -4
  485. package/dist/composition/index.d.ts.map +1 -1
  486. package/dist/composition/index.js +3 -2
  487. package/dist/composition/index.js.map +1 -1
  488. package/dist/composition/mathts-quiet.d.ts +7 -8
  489. package/dist/composition/mathts-quiet.d.ts.map +1 -1
  490. package/dist/composition/mathts-quiet.js +7 -16
  491. package/dist/composition/mathts-quiet.js.map +1 -1
  492. package/dist/composition/mathts-scalar-symbols.d.ts.map +1 -1
  493. package/dist/composition/mathts-scalar-symbols.js +2 -1
  494. package/dist/composition/mathts-scalar-symbols.js.map +1 -1
  495. package/dist/composition/own-equation-magnitude.d.ts +95 -0
  496. package/dist/composition/own-equation-magnitude.d.ts.map +1 -0
  497. package/dist/composition/own-equation-magnitude.js +270 -0
  498. package/dist/composition/own-equation-magnitude.js.map +1 -0
  499. package/dist/composition/probe/backend-protocol.d.ts +3 -0
  500. package/dist/composition/probe/backend-protocol.d.ts.map +1 -1
  501. package/dist/composition/probe/backend-protocol.js.map +1 -1
  502. package/dist/composition/probe/candidate-store.d.ts +1 -0
  503. package/dist/composition/probe/candidate-store.d.ts.map +1 -1
  504. package/dist/composition/probe/candidate-store.js +1 -0
  505. package/dist/composition/probe/candidate-store.js.map +1 -1
  506. package/dist/composition/probe/corpus.d.ts +8 -4
  507. package/dist/composition/probe/corpus.d.ts.map +1 -1
  508. package/dist/composition/probe/corpus.js +23 -12
  509. package/dist/composition/probe/corpus.js.map +1 -1
  510. package/dist/composition/probe/dataset.d.ts +18 -0
  511. package/dist/composition/probe/dataset.d.ts.map +1 -1
  512. package/dist/composition/probe/dataset.js +95 -50
  513. package/dist/composition/probe/dataset.js.map +1 -1
  514. package/dist/composition/probe/experiment-design.d.ts +7 -1
  515. package/dist/composition/probe/experiment-design.d.ts.map +1 -1
  516. package/dist/composition/probe/experiment-design.js +44 -24
  517. package/dist/composition/probe/experiment-design.js.map +1 -1
  518. package/dist/composition/probe/falsify.d.ts +2 -0
  519. package/dist/composition/probe/falsify.d.ts.map +1 -1
  520. package/dist/composition/probe/falsify.js +2 -0
  521. package/dist/composition/probe/falsify.js.map +1 -1
  522. package/dist/composition/probe/fit.d.ts +7 -0
  523. package/dist/composition/probe/fit.d.ts.map +1 -1
  524. package/dist/composition/probe/fit.js +46 -22
  525. package/dist/composition/probe/fit.js.map +1 -1
  526. package/dist/composition/probe/frontier.d.ts.map +1 -1
  527. package/dist/composition/probe/frontier.js +33 -15
  528. package/dist/composition/probe/frontier.js.map +1 -1
  529. package/dist/composition/probe/generator.d.ts +30 -1
  530. package/dist/composition/probe/generator.d.ts.map +1 -1
  531. package/dist/composition/probe/generator.js +58 -36
  532. package/dist/composition/probe/generator.js.map +1 -1
  533. package/dist/composition/probe/index.d.ts +14 -0
  534. package/dist/composition/probe/index.d.ts.map +1 -1
  535. package/dist/composition/probe/index.js +6 -0
  536. package/dist/composition/probe/index.js.map +1 -1
  537. package/dist/composition/probe/limits.d.ts +25 -1
  538. package/dist/composition/probe/limits.d.ts.map +1 -1
  539. package/dist/composition/probe/limits.js +53 -11
  540. package/dist/composition/probe/limits.js.map +1 -1
  541. package/dist/composition/probe/pipeline.d.ts +5 -0
  542. package/dist/composition/probe/pipeline.d.ts.map +1 -1
  543. package/dist/composition/probe/pipeline.js +73 -24
  544. package/dist/composition/probe/pipeline.js.map +1 -1
  545. package/dist/composition/probe/power-law.d.ts +121 -0
  546. package/dist/composition/probe/power-law.d.ts.map +1 -0
  547. package/dist/composition/probe/power-law.js +251 -0
  548. package/dist/composition/probe/power-law.js.map +1 -0
  549. package/dist/composition/probe/problem.d.ts +8 -4
  550. package/dist/composition/probe/problem.d.ts.map +1 -1
  551. package/dist/composition/probe/problem.js +177 -49
  552. package/dist/composition/probe/problem.js.map +1 -1
  553. package/dist/composition/probe/report.js +1 -1
  554. package/dist/composition/probe/report.js.map +1 -1
  555. package/dist/composition/probe/residual.d.ts +7 -1
  556. package/dist/composition/probe/residual.d.ts.map +1 -1
  557. package/dist/composition/probe/residual.js +10 -7
  558. package/dist/composition/probe/residual.js.map +1 -1
  559. package/dist/composition/probe/run-manifest.d.ts +1 -0
  560. package/dist/composition/probe/run-manifest.d.ts.map +1 -1
  561. package/dist/composition/probe/run-manifest.js.map +1 -1
  562. package/dist/composition/probe/scalar-search.d.ts +50 -0
  563. package/dist/composition/probe/scalar-search.d.ts.map +1 -0
  564. package/dist/composition/probe/scalar-search.js +169 -0
  565. package/dist/composition/probe/scalar-search.js.map +1 -0
  566. package/dist/composition/probe/scoring.d.ts +1 -0
  567. package/dist/composition/probe/scoring.d.ts.map +1 -1
  568. package/dist/composition/probe/scoring.js.map +1 -1
  569. package/dist/composition/probe/structure.d.ts +82 -17
  570. package/dist/composition/probe/structure.d.ts.map +1 -1
  571. package/dist/composition/probe/structure.js +129 -55
  572. package/dist/composition/probe/structure.js.map +1 -1
  573. package/dist/composition/probe/study.d.ts +31 -9
  574. package/dist/composition/probe/study.d.ts.map +1 -1
  575. package/dist/composition/probe/study.js +235 -184
  576. package/dist/composition/probe/study.js.map +1 -1
  577. package/dist/composition/probe/t-tail.d.ts +16 -0
  578. package/dist/composition/probe/t-tail.d.ts.map +1 -0
  579. package/dist/composition/probe/t-tail.js +29 -0
  580. package/dist/composition/probe/t-tail.js.map +1 -0
  581. package/dist/composition/probe/types.d.ts +3 -0
  582. package/dist/composition/probe/types.d.ts.map +1 -1
  583. package/dist/composition/probe/types.js.map +1 -1
  584. package/dist/composition/proposed-bridges.d.ts +52 -12
  585. package/dist/composition/proposed-bridges.d.ts.map +1 -1
  586. package/dist/composition/proposed-bridges.js +107 -60
  587. package/dist/composition/proposed-bridges.js.map +1 -1
  588. package/dist/composition/quantity-clusters.d.ts +48 -0
  589. package/dist/composition/quantity-clusters.d.ts.map +1 -0
  590. package/dist/composition/quantity-clusters.js +98 -0
  591. package/dist/composition/quantity-clusters.js.map +1 -0
  592. package/dist/composition/rational-exponent.d.ts +40 -0
  593. package/dist/composition/rational-exponent.d.ts.map +1 -0
  594. package/dist/composition/rational-exponent.js +65 -0
  595. package/dist/composition/rational-exponent.js.map +1 -0
  596. package/dist/composition/representative-values.d.ts +22 -0
  597. package/dist/composition/representative-values.d.ts.map +1 -1
  598. package/dist/composition/representative-values.js +29 -0
  599. package/dist/composition/representative-values.js.map +1 -1
  600. package/dist/composition/retrodiction.d.ts +15 -0
  601. package/dist/composition/retrodiction.d.ts.map +1 -1
  602. package/dist/composition/retrodiction.js +12 -4
  603. package/dist/composition/retrodiction.js.map +1 -1
  604. package/dist/composition/user-equation.d.ts +1 -0
  605. package/dist/composition/user-equation.d.ts.map +1 -1
  606. package/dist/composition/user-equation.js +3 -2
  607. package/dist/composition/user-equation.js.map +1 -1
  608. package/dist/core/assignment.d.ts +19 -0
  609. package/dist/core/assignment.d.ts.map +1 -0
  610. package/dist/core/assignment.js +19 -0
  611. package/dist/core/assignment.js.map +1 -0
  612. package/dist/core/compare.d.ts +32 -0
  613. package/dist/core/compare.d.ts.map +1 -0
  614. package/dist/core/compare.js +46 -0
  615. package/dist/core/compare.js.map +1 -0
  616. package/dist/core/constants.d.ts +42 -41
  617. package/dist/core/constants.d.ts.map +1 -1
  618. package/dist/core/constants.js +71 -51
  619. package/dist/core/constants.js.map +1 -1
  620. package/dist/core/data-file.d.ts +7 -0
  621. package/dist/core/data-file.d.ts.map +1 -1
  622. package/dist/core/data-file.js +17 -0
  623. package/dist/core/data-file.js.map +1 -1
  624. package/dist/core/format.d.ts +36 -0
  625. package/dist/core/format.d.ts.map +1 -0
  626. package/dist/core/format.js +39 -0
  627. package/dist/core/format.js.map +1 -0
  628. package/dist/core/hash.d.ts +14 -0
  629. package/dist/core/hash.d.ts.map +1 -0
  630. package/dist/core/hash.js +17 -0
  631. package/dist/core/hash.js.map +1 -0
  632. package/dist/core/json-schema.d.ts +2 -0
  633. package/dist/core/json-schema.d.ts.map +1 -1
  634. package/dist/core/json-schema.js +14 -13
  635. package/dist/core/json-schema.js.map +1 -1
  636. package/dist/core/labeled-tensor.d.ts.map +1 -1
  637. package/dist/core/labeled-tensor.js +0 -8
  638. package/dist/core/labeled-tensor.js.map +1 -1
  639. package/dist/core/mathts-read.d.ts +25 -0
  640. package/dist/core/mathts-read.d.ts.map +1 -0
  641. package/dist/core/mathts-read.js +51 -0
  642. package/dist/core/mathts-read.js.map +1 -0
  643. package/dist/core/tensor.d.ts.map +1 -1
  644. package/dist/core/tensor.js +24 -0
  645. package/dist/core/tensor.js.map +1 -1
  646. package/dist/core/types.d.ts +5 -5
  647. package/dist/diff/bridge-ast-gradient.d.ts +27 -23
  648. package/dist/diff/bridge-ast-gradient.d.ts.map +1 -1
  649. package/dist/diff/bridge-ast-gradient.js +75 -173
  650. package/dist/diff/bridge-ast-gradient.js.map +1 -1
  651. package/dist/diff/bridge-gradient.d.ts +19 -6
  652. package/dist/diff/bridge-gradient.d.ts.map +1 -1
  653. package/dist/diff/bridge-gradient.js +19 -11
  654. package/dist/diff/bridge-gradient.js.map +1 -1
  655. package/dist/diff/bridge-specs.d.ts.map +1 -1
  656. package/dist/diff/bridge-specs.js +3 -0
  657. package/dist/diff/bridge-specs.js.map +1 -1
  658. package/dist/dimensional/algebra.d.ts +18 -0
  659. package/dist/dimensional/algebra.d.ts.map +1 -1
  660. package/dist/dimensional/algebra.js +41 -1
  661. package/dist/dimensional/algebra.js.map +1 -1
  662. package/dist/dimensional/ast-builders.d.ts +7 -0
  663. package/dist/dimensional/ast-builders.d.ts.map +1 -1
  664. package/dist/dimensional/ast-builders.js +11 -0
  665. package/dist/dimensional/ast-builders.js.map +1 -1
  666. package/dist/dimensional/ast-leaves.d.ts +81 -0
  667. package/dist/dimensional/ast-leaves.d.ts.map +1 -0
  668. package/dist/dimensional/ast-leaves.js +146 -0
  669. package/dist/dimensional/ast-leaves.js.map +1 -0
  670. package/dist/dimensional/ast-types.d.ts +15 -0
  671. package/dist/dimensional/ast-types.d.ts.map +1 -1
  672. package/dist/dimensional/ast-types.js.map +1 -1
  673. package/dist/dimensional/buckingham.d.ts.map +1 -1
  674. package/dist/dimensional/buckingham.js +15 -27
  675. package/dist/dimensional/buckingham.js.map +1 -1
  676. package/dist/dimensional/constant-rows.js +9 -9
  677. package/dist/dimensional/constant-rows.js.map +1 -1
  678. package/dist/dimensional/curvature-composite.d.ts +1 -1
  679. package/dist/dimensional/curvature-composite.js.map +1 -1
  680. package/dist/dimensional/dimension-inference.d.ts.map +1 -1
  681. package/dist/dimensional/dimension-inference.js +1 -2
  682. package/dist/dimensional/dimension-inference.js.map +1 -1
  683. package/dist/dimensional/errors.d.ts +1 -1
  684. package/dist/dimensional/errors.d.ts.map +1 -1
  685. package/dist/dimensional/errors.js +1 -15
  686. package/dist/dimensional/errors.js.map +1 -1
  687. package/dist/dimensional/exact-scale.d.ts +24 -11
  688. package/dist/dimensional/exact-scale.d.ts.map +1 -1
  689. package/dist/dimensional/exact-scale.js +122 -130
  690. package/dist/dimensional/exact-scale.js.map +1 -1
  691. package/dist/dimensional/gauge-field.d.ts.map +1 -1
  692. package/dist/dimensional/gauge-field.js +2 -2
  693. package/dist/dimensional/gauge-field.js.map +1 -1
  694. package/dist/dimensional/hyphen-names.d.ts +12 -2
  695. package/dist/dimensional/hyphen-names.d.ts.map +1 -1
  696. package/dist/dimensional/hyphen-names.js +44 -19
  697. package/dist/dimensional/hyphen-names.js.map +1 -1
  698. package/dist/dimensional/mathts-unit-delegation.d.ts +29 -0
  699. package/dist/dimensional/mathts-unit-delegation.d.ts.map +1 -0
  700. package/dist/dimensional/mathts-unit-delegation.js +187 -0
  701. package/dist/dimensional/mathts-unit-delegation.js.map +1 -0
  702. package/dist/dimensional/mathts-unit-wrapper.d.ts +33 -0
  703. package/dist/dimensional/mathts-unit-wrapper.d.ts.map +1 -0
  704. package/dist/dimensional/mathts-unit-wrapper.js +190 -0
  705. package/dist/dimensional/mathts-unit-wrapper.js.map +1 -0
  706. package/dist/dimensional/metric.d.ts.map +1 -1
  707. package/dist/dimensional/metric.js +0 -1
  708. package/dist/dimensional/metric.js.map +1 -1
  709. package/dist/dimensional/scalar-lowering.d.ts +21 -0
  710. package/dist/dimensional/scalar-lowering.d.ts.map +1 -0
  711. package/dist/dimensional/scalar-lowering.js +45 -0
  712. package/dist/dimensional/scalar-lowering.js.map +1 -0
  713. package/dist/dimensional/symbolic-constants.d.ts +9 -0
  714. package/dist/dimensional/symbolic-constants.d.ts.map +1 -1
  715. package/dist/dimensional/symbolic-constants.js +13 -1
  716. package/dist/dimensional/symbolic-constants.js.map +1 -1
  717. package/dist/dimensional/types.d.ts +36 -0
  718. package/dist/dimensional/types.d.ts.map +1 -1
  719. package/dist/dimensional/types.js +45 -7
  720. package/dist/dimensional/types.js.map +1 -1
  721. package/dist/dimensional/unit-data.d.ts +5 -1
  722. package/dist/dimensional/unit-data.d.ts.map +1 -1
  723. package/dist/dimensional/unit-data.js +30 -6
  724. package/dist/dimensional/unit-data.js.map +1 -1
  725. package/dist/dimensional/units.d.ts +2 -0
  726. package/dist/dimensional/units.d.ts.map +1 -1
  727. package/dist/dimensional/units.js +59 -3
  728. package/dist/dimensional/units.js.map +1 -1
  729. package/dist/dimensional/validator.d.ts +2 -0
  730. package/dist/dimensional/validator.d.ts.map +1 -1
  731. package/dist/dimensional/validator.js.map +1 -1
  732. package/dist/index.d.ts +9 -3
  733. package/dist/index.d.ts.map +1 -1
  734. package/dist/index.js +10 -4
  735. package/dist/index.js.map +1 -1
  736. package/dist/numerical/christoffel-flat.d.ts.map +1 -1
  737. package/dist/numerical/christoffel-flat.js +3 -2
  738. package/dist/numerical/christoffel-flat.js.map +1 -1
  739. package/dist/numerical/connection-lowering-helpers.d.ts +3 -1
  740. package/dist/numerical/connection-lowering-helpers.d.ts.map +1 -1
  741. package/dist/numerical/connection-lowering-helpers.js +11 -15
  742. package/dist/numerical/connection-lowering-helpers.js.map +1 -1
  743. package/dist/numerical/covariant-eikonal.d.ts.map +1 -1
  744. package/dist/numerical/covariant-eikonal.js +34 -11
  745. package/dist/numerical/covariant-eikonal.js.map +1 -1
  746. package/dist/numerical/curvature-lowering-helpers.js +3 -2
  747. package/dist/numerical/curvature-lowering-helpers.js.map +1 -1
  748. package/dist/numerical/errors.d.ts.map +1 -1
  749. package/dist/numerical/errors.js +0 -3
  750. package/dist/numerical/errors.js.map +1 -1
  751. package/dist/numerical/finite-difference.d.ts +22 -0
  752. package/dist/numerical/finite-difference.d.ts.map +1 -0
  753. package/dist/numerical/finite-difference.js +27 -0
  754. package/dist/numerical/finite-difference.js.map +1 -0
  755. package/dist/numerical/geodesic-integrator.d.ts.map +1 -1
  756. package/dist/numerical/geodesic-integrator.js +22 -14
  757. package/dist/numerical/geodesic-integrator.js.map +1 -1
  758. package/dist/numerical/geometrized.d.ts.map +1 -1
  759. package/dist/numerical/geometrized.js +0 -1
  760. package/dist/numerical/geometrized.js.map +1 -1
  761. package/dist/numerical/mathts-engine.d.ts.map +1 -1
  762. package/dist/numerical/mathts-engine.js +10 -24
  763. package/dist/numerical/mathts-engine.js.map +1 -1
  764. package/dist/numerical/metric-inverse.d.ts.map +1 -1
  765. package/dist/numerical/metric-inverse.js +83 -46
  766. package/dist/numerical/metric-inverse.js.map +1 -1
  767. package/dist/numerical/null-ray-integrator.d.ts +2 -1
  768. package/dist/numerical/null-ray-integrator.d.ts.map +1 -1
  769. package/dist/numerical/null-ray-integrator.js +12 -12
  770. package/dist/numerical/null-ray-integrator.js.map +1 -1
  771. package/dist/numerical/painleve-gullstrand-metric.js +2 -2
  772. package/dist/numerical/painleve-gullstrand-metric.js.map +1 -1
  773. package/dist/numerical/pderiv.d.ts.map +1 -1
  774. package/dist/numerical/pderiv.js +2 -6
  775. package/dist/numerical/pderiv.js.map +1 -1
  776. package/dist/numerical/perihelion-finder.d.ts +0 -36
  777. package/dist/numerical/perihelion-finder.d.ts.map +1 -1
  778. package/dist/numerical/perihelion-finder.js +41 -87
  779. package/dist/numerical/perihelion-finder.js.map +1 -1
  780. package/dist/numerical/quadrature.d.ts.map +1 -1
  781. package/dist/numerical/quadrature.js +11 -13
  782. package/dist/numerical/quadrature.js.map +1 -1
  783. package/dist/numerical/rk4-trajectory.d.ts +10 -0
  784. package/dist/numerical/rk4-trajectory.d.ts.map +1 -0
  785. package/dist/numerical/rk4-trajectory.js +37 -0
  786. package/dist/numerical/rk4-trajectory.js.map +1 -0
  787. package/dist/numerical/schwarzschild.d.ts +14 -0
  788. package/dist/numerical/schwarzschild.d.ts.map +1 -0
  789. package/dist/numerical/schwarzschild.js +17 -0
  790. package/dist/numerical/schwarzschild.js.map +1 -0
  791. package/dist/numerical/spacetime-metrics.d.ts +12 -0
  792. package/dist/numerical/spacetime-metrics.d.ts.map +1 -1
  793. package/dist/numerical/spacetime-metrics.js +72 -56
  794. package/dist/numerical/spacetime-metrics.js.map +1 -1
  795. package/dist/numerical/statistics.d.ts +24 -0
  796. package/dist/numerical/statistics.d.ts.map +1 -0
  797. package/dist/numerical/statistics.js +52 -0
  798. package/dist/numerical/statistics.js.map +1 -0
  799. package/dist/numerical/strides.d.ts +3 -2
  800. package/dist/numerical/strides.d.ts.map +1 -1
  801. package/dist/numerical/strides.js +3 -10
  802. package/dist/numerical/strides.js.map +1 -1
  803. package/dist/numerical/tensor-engine.d.ts +21 -0
  804. package/dist/numerical/tensor-engine.d.ts.map +1 -1
  805. package/dist/numerical/tensor-engine.js +12 -0
  806. package/dist/numerical/tensor-engine.js.map +1 -1
  807. package/dist/relations/regime.d.ts +10 -0
  808. package/dist/relations/regime.d.ts.map +1 -1
  809. package/dist/relations/regime.js +18 -1
  810. package/dist/relations/regime.js.map +1 -1
  811. package/package.json +9 -12
  812. package/dist/cases/brownian-sphere.d.ts +0 -68
  813. package/dist/cases/brownian-sphere.d.ts.map +0 -1
  814. package/dist/cases/brownian-sphere.js +0 -354
  815. package/dist/cases/brownian-sphere.js.map +0 -1
  816. package/dist/cases/damped-resonator.d.ts +0 -23
  817. package/dist/cases/damped-resonator.d.ts.map +0 -1
  818. package/dist/cases/damped-resonator.js +0 -224
  819. package/dist/cases/damped-resonator.js.map +0 -1
  820. package/dist/cases/kepler-rv.d.ts +0 -13
  821. package/dist/cases/kepler-rv.d.ts.map +0 -1
  822. package/dist/cases/kepler-rv.js +0 -172
  823. package/dist/cases/kepler-rv.js.map +0 -1
  824. package/dist/cases/lumped-cooling.d.ts +0 -46
  825. package/dist/cases/lumped-cooling.d.ts.map +0 -1
  826. package/dist/cases/lumped-cooling.js +0 -261
  827. package/dist/cases/lumped-cooling.js.map +0 -1
  828. package/dist/cases/resistor-noise.d.ts +0 -14
  829. package/dist/cases/resistor-noise.d.ts.map +0 -1
  830. package/dist/cases/resistor-noise.js +0 -215
  831. package/dist/cases/resistor-noise.js.map +0 -1
  832. package/dist/cases/skin-depth.d.ts +0 -21
  833. package/dist/cases/skin-depth.d.ts.map +0 -1
  834. package/dist/cases/skin-depth.js +0 -174
  835. package/dist/cases/skin-depth.js.map +0 -1
@@ -31,19 +31,123 @@
31
31
  * `lhs − rhs = 0`; the capability needed is SIMPLIFICATION, which lives in
32
32
  * `expr-simplify.ts` (a different peer, `@danielsimonjr/mathts-functions`).
33
33
  *
34
+ * ## The numeric probe is a SECOND result, never folded into the CAS status
35
+ *
36
+ * A simplifier that fails on everything would leave every wrong dictionary
37
+ * `'unresolved'`, which is "not checked", not "shown wrong" (the weaker
38
+ * guarantee NOTES.md records). {@link probeSymbolicWitness} therefore
39
+ * evaluates both sides at seeded random positive points through `evalExpr`
40
+ * and REFUTES on disagreement. Its outcome is its own kind
41
+ * ({@link NumericProbeKind}), carried on the run result beside `status`:
42
+ * a probe that agrees never makes a run `'checked'`, a probe that refutes
43
+ * never makes it `'refuted'`, and the two are tallied as two sets of
44
+ * numbers ({@link tallySymbolicResults}; AGENTS law 4). MathTS
45
+ * `symbolicEqual` is not used: it is the same simplifier, not a second method.
46
+ *
34
47
  * @module atlas/witness-symbolic
35
48
  * @internal
36
49
  */
50
+ import { random, seedProbabilityRng } from '@danielsimonjr/mathts-functions';
51
+ import { sym } from '../dimensional/ast-builders.js';
52
+ import { DIMENSIONLESS } from '../dimensional/types.js';
53
+ import { evalExpr } from '../composition/expr-eval.js';
37
54
  import { isSimplifierAvailable, simplifyExpr } from '../composition/expr-simplify.js';
55
+ import { scalarSymbolsFromMathTs } from '../composition/mathts-scalar-symbols.js';
56
+ import { literalValue as leafLiteral } from '../dimensional/ast-leaves.js';
38
57
  const DEFAULT_BUDGET_MS = 5000;
39
- /** The numeric value of a literal leaf, or `null`. Same rule as `validator.ts`. */
58
+ /** Seeded points per probe. @internal */
59
+ export const NUMERIC_PROBE_POINTS = 8;
60
+ /** The relative difference above which a point refutes. @internal */
61
+ export const NUMERIC_PROBE_TOLERANCE = 1e-12;
62
+ /** A leaf that evaluates on its own (π, a registered constant, a literal) is a constant, not a free symbol. */
63
+ function evaluatesAlone(name) {
64
+ try {
65
+ return Number.isFinite(evalExpr(sym(name, DIMENSIONLESS)));
66
+ }
67
+ catch {
68
+ return false;
69
+ }
70
+ }
71
+ /** MathTS `random(lo, hi)`, read back as the number it is. */
72
+ function seededPoint(lo, hi) {
73
+ const v = random(lo, hi);
74
+ if (typeof v !== 'number')
75
+ throw new TypeError('random did not return a number');
76
+ return v;
77
+ }
78
+ /**
79
+ * Evaluate a symbolic witness's two sides at `points` seeded random points,
80
+ * every free symbol drawn from [0.5, 2) by MathTS `random` after
81
+ * `seedProbabilityRng(spec.id)`, so a re-run sees the same points. The free
82
+ * symbols are the scalar leaves (`scalarSymbolsFromMathTs`) that do not
83
+ * evaluate on their own. Never throws.
84
+ *
85
+ * @internal
86
+ */
87
+ export function probeSymbolicWitness(spec, points = NUMERIC_PROBE_POINTS) {
88
+ const notRun = (why) => ({ kind: 'numeric-not-run', points: 0, detail: `The numeric probe did not run: ${why}.` });
89
+ try {
90
+ const names = new Set();
91
+ for (const leaf of [...scalarSymbolsFromMathTs(spec.lhs), ...scalarSymbolsFromMathTs(spec.rhs)])
92
+ names.add(leaf.name);
93
+ const free = [...names].filter((name) => !evaluatesAlone(name)).sort();
94
+ seedProbabilityRng(spec.id);
95
+ let worst = 0;
96
+ for (let i = 0; i < points; i++) {
97
+ const values = {};
98
+ for (const name of free)
99
+ values[name] = seededPoint(0.5, 2);
100
+ const lhs = evalExpr(spec.lhs, values);
101
+ const rhs = evalExpr(spec.rhs, values);
102
+ if (!Number.isFinite(lhs) || !Number.isFinite(rhs)) {
103
+ return notRun(`a non-finite value (lhs ${lhs}, rhs ${rhs}) at point ${i + 1}`);
104
+ }
105
+ const scale = Math.abs(lhs) + Math.abs(rhs);
106
+ worst = Math.max(worst, scale === 0 ? 0 : Math.abs(lhs - rhs) / scale);
107
+ }
108
+ if (worst > NUMERIC_PROBE_TOLERANCE) {
109
+ return {
110
+ kind: 'numeric-refuted',
111
+ points,
112
+ worst,
113
+ detail: `lhs and rhs differ at a seeded point: max |lhs − rhs|/(|lhs| + |rhs|) = ${worst} over ${points} points, above ${NUMERIC_PROBE_TOLERANCE}.`,
114
+ };
115
+ }
116
+ return {
117
+ kind: 'numeric-agrees',
118
+ points,
119
+ worst,
120
+ detail: `lhs and rhs agree at ${points} seeded points: max |lhs − rhs|/(|lhs| + |rhs|) = ${worst}. Agreement at points is not a proof.`,
121
+ };
122
+ }
123
+ catch (err) {
124
+ return notRun(`the evaluator threw: ${String(err)}`);
125
+ }
126
+ }
127
+ /**
128
+ * The CAS outcomes and the numeric outcomes of symbolic runs, as two separate
129
+ * tallies. They are never added together.
130
+ *
131
+ * @internal
132
+ */
133
+ export function tallySymbolicResults(results) {
134
+ const cas = { checked: 0, refuted: 0, unresolved: 0 };
135
+ const numeric = { agrees: 0, refuted: 0, notRun: 0 };
136
+ for (const r of results) {
137
+ cas[r.status] += 1;
138
+ if (r.numericProbe.kind === 'numeric-agrees')
139
+ numeric.agrees += 1;
140
+ else if (r.numericProbe.kind === 'numeric-refuted')
141
+ numeric.refuted += 1;
142
+ else
143
+ numeric.notRun += 1;
144
+ }
145
+ return { cas, numeric };
146
+ }
147
+ /** The finite value of a decimal-literal leaf (the one rule, `dimensional/ast-leaves.ts`), or `null`. */
40
148
  function literalValue(node) {
41
- if (node.kind !== 'symbol')
42
- return null;
43
- if (node.name.trim() === '')
44
- return null;
45
- const v = Number(node.name);
46
- return Number.isFinite(v) ? v : null;
149
+ const v = leafLiteral(node);
150
+ return v !== undefined && Number.isFinite(v) ? v : null;
47
151
  }
48
152
  /** A sentinel the timeout race resolves with; never confusable with a result. */
49
153
  const TIMED_OUT = Symbol('timed-out');
@@ -54,8 +158,9 @@ const TIMED_OUT = Symbol('timed-out');
54
158
  * @param simplifier - the CAS capability, or `null` when the optional peer is
55
159
  * absent. When omitted, resolves to `simplifyExpr` if the peer is available and
56
160
  * to `null` otherwise. Pass `null` EXPLICITLY to exercise the absent path.
57
- * @returns a result; **never throws**, because a thrown error forces callers
58
- * into a `catch` that cannot distinguish "did not run" from "failed".
161
+ * @returns a result carrying the CAS status and, beside it, the numeric
162
+ * probe; **never throws**, because a thrown error forces callers into a
163
+ * `catch` that cannot distinguish "did not run" from "failed".
59
164
  * @internal
60
165
  */
61
166
  export async function runSymbolicWitness(spec, simplifier) {
@@ -63,7 +168,8 @@ export async function runSymbolicWitness(spec, simplifier) {
63
168
  if (simplifier === undefined) {
64
169
  simplifier = (await isSimplifierAvailable()) ? simplifyExpr : null;
65
170
  }
66
- const base = { witnessId: spec.id, kind: 'symbolic' };
171
+ // The probe is independent of the CAS: it runs on every path, and decides nothing below.
172
+ const base = { witnessId: spec.id, kind: 'symbolic', numericProbe: probeSymbolicWitness(spec) };
67
173
  const elapsed = () => Date.now() - started;
68
174
  if (simplifier === null) {
69
175
  return {
@@ -1 +1 @@
1
- {"version":3,"file":"witness-symbolic.js","sourceRoot":"","sources":["../../src/atlas/witness-symbolic.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAGH,OAAO,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAgCtF,MAAM,iBAAiB,GAAG,IAAI,CAAC;AAE/B,mFAAmF;AACnF,SAAS,YAAY,CAAC,IAAc;IAClC,IAAI,IAAI,CAAC,IAAI,KAAK,QAAQ;QAAE,OA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AAG,IAAI;YACP,MAAM,EAAE,SAAS;YACjB,MAAM,EAAE,iDAAiD,KAAK,GAAG;YACjE,SAAS,EAAE,OAAO,EAAE;SACrB,CAAC;IACJ,CAAC;IACD,OAAO;QACL,GAAG,IAAI;QACP,MAAM,EAAE,YAAY;QACpB,MAAM,EAAE,gBAAgB;QACxB,MAAM,EACJ,8EAA8E;YAC9E,+BAA+B;QACjC,SAAS,EAAE,OAAO,EAAE;KACrB,CAAC;AACJ,CAAC","sourcesContent":["/**\n * Atlas Phase 4, S4.2 — the symbolic witness runner.\n *\n * Design note: `docs/planning/Atlas-Phase-4-Design.md` §2.\n *\n * A symbolic witness claims `lhs = rhs`. The runner forms the DIFFERENCE and\n * asks the optional CAS peer to simplify it: a difference that collapses to a\n * literal zero is `'checked'`; one that collapses to a non-zero literal is\n * `'refuted'`; anything else is `'unresolved'` with the reason it could not\n * decide.\n *\n * ## The simplifier is INJECTED, and no test touches the registry\n *\n * `src/numerical/formula-registry.ts` caches its selection in module scope and\n * exposes no reset hook, so a test that registered a stub would leak it into\n * every later test in the same worker. {@link runSymbolicWitness} therefore\n * takes the simplifier as a PARAMETER, defaulting to `simplifyExpr`. Tests\n * pass a stub for the present path and `null` for the absent path; the\n * registry is never written. One test exercises the real peer under the\n * existing skip-when-absent pattern.\n *\n * `null` means \"the peer is absent\" and is a first-class argument value, not a\n * forgotten one. `simplifyExpr` itself CANNOT tell absence from \"nothing to\n * simplify\" — both return `simplified: false` — so when the argument is\n * OMITTED the runner asks `isSimplifierAvailable()` first and maps absence to\n * `null`. Without that step the default path would report a missing peer as\n * `'not-simplified'`, the wrong reason on the one path most callers take.\n *\n * Deviation from the plan's wording, recorded in the design note §2.1: the\n * plan names `getFormulaParser()` as the default. A parser cannot decide\n * `lhs − rhs = 0`; the capability needed is SIMPLIFICATION, which lives in\n * `expr-simplify.ts` (a different peer, `@danielsimonjr/mathts-functions`).\n *\n * @module atlas/witness-symbolic\n * @internal\n */\n\nimport type { ExprNode } from '../dimensional/ast-types.js';\nimport { isSimplifierAvailable, simplifyExpr } from '../composition/expr-simplify.js';\nimport type { WitnessRunResult } from './witness-result.js';\n\n/**\n * The simplification capability this runner needs, as a function rather than\n * the whole module — so a stub is five lines and cannot accidentally depend on\n * anything else `expr-simplify.ts` exports.\n *\n * @internal\n */\nexport type SymbolicSimplifier = (\n expr: ExprNode,\n) => Promise<{ readonly expr: ExprNode; readonly simplified: boolean }>;\n\n/** What a symbolic witness asserts. @internal */\nexport interface SymbolicWitnessSpec {\n /** The `Witness.id` (`'W7b'`). */\n readonly id: string;\n readonly lhs: ExprNode;\n readonly rhs: ExprNode;\n /**\n * Wall-clock budget in milliseconds. Default 5000.\n *\n * ⚠ **This bounds how long the RUNNER WAITS, not how long the CAS works.**\n * The peer's `simplify` is synchronous inside its promise, so nothing here\n * can interrupt it; a timeout reports that no answer arrived in time and the\n * underlying work may still be running. Saying otherwise would be the\n * \"a running process is not a working one\" error in reverse.\n */\n readonly budgetMs?: number;\n}\n\nconst DEFAULT_BUDGET_MS = 5000;\n\n/** The numeric value of a literal leaf, or `null`. Same rule as `validator.ts`. */\nfunction literalValue(node: ExprNode): number | null {\n if (node.kind !== 'symbol') return null;\n if (node.name.trim() === '') return null;\n const v = Number(node.name);\n return Number.isFinite(v) ? v : null;\n}\n\n/** A sentinel the timeout race resolves with; never confusable with a result. */\nconst TIMED_OUT = Symbol('timed-out');\n\n/**\n * Run one symbolic witness.\n *\n * @param spec - the claim, as two ASTs whose difference should vanish.\n * @param simplifier - the CAS capability, or `null` when the optional peer is\n * absent. When omitted, resolves to `simplifyExpr` if the peer is available and\n * to `null` otherwise. Pass `null` EXPLICITLY to exercise the absent path.\n * @returns a result; **never throws**, because a thrown error forces callers\n * into a `catch` that cannot distinguish \"did not run\" from \"failed\".\n * @internal\n */\nexport async function runSymbolicWitness(\n spec: SymbolicWitnessSpec,\n simplifier?: SymbolicSimplifier | null,\n): Promise<WitnessRunResult> {\n const started = Date.now();\n if (simplifier === undefined) {\n simplifier = (await isSimplifierAvailable()) ? simplifyExpr : null;\n }\n const base = { witnessId: spec.id, kind: 'symbolic' as const };\n const elapsed = (): number => Date.now() - started;\n\n if (simplifier === null) {\n return {\n ...base,\n status: 'unresolved',\n reason: 'peer-absent',\n detail:\n 'The optional CAS peer is absent, so the claim was never examined. This is ' +\n 'not evidence against it.',\n elapsedMs: elapsed(),\n };\n }\n\n const difference: ExprNode = { kind: 'op', op: '-', args: [spec.lhs, spec.rhs] };\n const budget = spec.budgetMs ?? DEFAULT_BUDGET_MS;\n\n let outcome: Awaited<ReturnType<SymbolicSimplifier>> | typeof TIMED_OUT;\n let timer: ReturnType<typeof setTimeout> | undefined;\n try {\n outcome = await Promise.race([\n simplifier(difference),\n new Promise<typeof TIMED_OUT>((resolve) => {\n timer = setTimeout(() => resolve(TIMED_OUT), budget);\n }),\n ]);\n } catch (err) {\n return {\n ...base,\n status: 'unresolved',\n reason: 'parse-error',\n detail:\n `The simplifier threw rather than answering: ${String(err)}. A throw is not a ` +\n 'refutation.',\n elapsedMs: elapsed(),\n };\n } finally {\n if (timer !== undefined) clearTimeout(timer);\n }\n\n if (outcome === TIMED_OUT) {\n return {\n ...base,\n status: 'unresolved',\n reason: 'timeout',\n detail:\n `No answer arrived within ${budget} ms. The budget bounds the WAIT, not the ` +\n 'CAS: the underlying simplification may still be running.',\n elapsedMs: elapsed(),\n };\n }\n\n const value = literalValue(outcome.expr);\n if (value === 0) {\n return {\n ...base,\n status: 'checked',\n detail: 'lhs − rhs simplified to literal 0.',\n elapsedMs: elapsed(),\n };\n }\n if (value !== null) {\n return {\n ...base,\n status: 'refuted',\n detail: `lhs − rhs simplified to the non-zero constant ${value}.`,\n elapsedMs: elapsed(),\n };\n }\n return {\n ...base,\n status: 'unresolved',\n reason: 'not-simplified',\n detail:\n 'The difference did not reduce to a constant. The claim may still hold; this ' +\n 'simplifier could not show it.',\n elapsedMs: elapsed(),\n };\n}\n"]}
1
+ {"version":3,"file":"witness-symbolic.js","sourceRo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D,SAAS,EAAE,OAAO,EAAE;SACrB,CAAC;IACJ,CAAC;IAED,MAAM,KAAK,GAAG,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACzC,IAAI,KAAK,KAAK,CAAC,EAAE,CAAC;QAChB,OAAO;YACL,GAAG,IAAI;YACP,MAAM,EAAE,SAAS;YACjB,MAAM,EAAE,oCAAoC;YAC5C,SAAS,EAAE,OAAO,EAAE;SACrB,CAAC;IACJ,CAAC;IACD,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QACnB,OAAO;YACL,GAAG,IAAI;YACP,MAAM,EAAE,SAAS;YACjB,MAAM,EAAE,iDAAiD,KAAK,GAAG;YACjE,SAAS,EAAE,OAAO,EAAE;SACrB,CAAC;IACJ,CAAC;IACD,OAAO;QACL,GAAG,IAAI;QACP,MAAM,EAAE,YAAY;QACpB,MAAM,EAAE,gBAAgB;QACxB,MAAM,EACJ,8EAA8E;YAC9E,+BAA+B;QACjC,SAAS,EAAE,OAAO,EAAE;KACrB,CAAC;AACJ,CAAC","sourcesContent":["/**\n * Atlas Phase 4, S4.2 — the symbolic witness runner.\n *\n * Design note: `docs/planning/Atlas-Phase-4-Design.md` §2.\n *\n * A symbolic witness claims `lhs = rhs`. The runner forms the DIFFERENCE and\n * asks the optional CAS peer to simplify it: a difference that collapses to a\n * literal zero is `'checked'`; one that collapses to a non-zero literal is\n * `'refuted'`; anything else is `'unresolved'` with the reason it could not\n * decide.\n *\n * ## The simplifier is INJECTED, and no test touches the registry\n *\n * `src/numerical/formula-registry.ts` caches its selection in module scope and\n * exposes no reset hook, so a test that registered a stub would leak it into\n * every later test in the same worker. {@link runSymbolicWitness} therefore\n * takes the simplifier as a PARAMETER, defaulting to `simplifyExpr`. Tests\n * pass a stub for the present path and `null` for the absent path; the\n * registry is never written. One test exercises the real peer under the\n * existing skip-when-absent pattern.\n *\n * `null` means \"the peer is absent\" and is a first-class argument value, not a\n * forgotten one. `simplifyExpr` itself CANNOT tell absence from \"nothing to\n * simplify\" — both return `simplified: false` — so when the argument is\n * OMITTED the runner asks `isSimplifierAvailable()` first and maps absence to\n * `null`. Without that step the default path would report a missing peer as\n * `'not-simplified'`, the wrong reason on the one path most callers take.\n *\n * Deviation from the plan's wording, recorded in the design note §2.1: the\n * plan names `getFormulaParser()` as the default. A parser cannot decide\n * `lhs − rhs = 0`; the capability needed is SIMPLIFICATION, which lives in\n * `expr-simplify.ts` (a different peer, `@danielsimonjr/mathts-functions`).\n *\n * ## The numeric probe is a SECOND result, never folded into the CAS status\n *\n * A simplifier that fails on everything would leave every wrong dictionary\n * `'unresolved'`, which is \"not checked\", not \"shown wrong\" (the weaker\n * guarantee NOTES.md records). {@link probeSymbolicWitness} therefore\n * evaluates both sides at seeded random positive points through `evalExpr`\n * and REFUTES on disagreement. Its outcome is its own kind\n * ({@link NumericProbeKind}), carried on the run result beside `status`:\n * a probe that agrees never makes a run `'checked'`, a probe that refutes\n * never makes it `'refuted'`, and the two are tallied as two sets of\n * numbers ({@link tallySymbolicResults}; AGENTS law 4). MathTS\n * `symbolicEqual` is not used: it is the same simplifier, not a second method.\n *\n * @module atlas/witness-symbolic\n * @internal\n */\n\nimport { random, seedProbabilityRng } from '@danielsimonjr/mathts-functions';\nimport type { ExprNode } from '../dimensional/ast-types.js';\nimport { sym } from '../dimensional/ast-builders.js';\nimport { DIMENSIONLESS } from '../dimensional/types.js';\nimport { evalExpr } from '../composition/expr-eval.js';\nimport { isSimplifierAvailable, simplifyExpr } from '../composition/expr-simplify.js';\nimport { scalarSymbolsFromMathTs } from '../composition/mathts-scalar-symbols.js';\nimport type { WitnessRunResult } from './witness-result.js';\nimport { literalValue as leafLiteral } from '../dimensional/ast-leaves.js';\n\n/**\n * The simplification capability this runner needs, as a function rather than\n * the whole module — so a stub is five lines and cannot accidentally depend on\n * anything else `expr-simplify.ts` exports.\n *\n * @internal\n */\nexport type SymbolicSimplifier = (\n expr: ExprNode,\n) => Promise<{ readonly expr: ExprNode; readonly simplified: boolean }>;\n\n/** What a symbolic witness asserts. @internal */\nexport interface SymbolicWitnessSpec {\n /** The `Witness.id` (`'W7b'`). */\n readonly id: string;\n readonly lhs: ExprNode;\n readonly rhs: ExprNode;\n /**\n * Wall-clock budget in milliseconds. Default 5000.\n *\n * ⚠ **This bounds how long the RUNNER WAITS, not how long the CAS works.**\n * The peer's `simplify` is synchronous inside its promise, so nothing here\n * can interrupt it; a timeout reports that no answer arrived in time and the\n * underlying work may still be running. Saying otherwise would be the\n * \"a running process is not a working one\" error in reverse.\n */\n readonly budgetMs?: number;\n}\n\nconst DEFAULT_BUDGET_MS = 5000;\n\n/**\n * What the numeric probe concluded: its own kind, never the CAS status.\n *\n * - `'numeric-refuted'`: some seeded point gives |lhs − rhs|/(|lhs| + |rhs|)\n * above {@link NUMERIC_PROBE_TOLERANCE}.\n * - `'numeric-agrees'`: every point is within it. Agreement at finitely\n * many points is not a proof, so this never lights an evidence tag.\n * - `'numeric-not-run'`: a side could not be evaluated to a finite number.\n *\n * @internal\n */\nexport type NumericProbeKind = 'numeric-refuted' | 'numeric-agrees' | 'numeric-not-run';\n\n/** The numeric probe's record. @internal */\nexport interface NumericProbe {\n readonly kind: NumericProbeKind;\n /** Points evaluated; 0 when not run. */\n readonly points: number;\n /** max |lhs − rhs|/(|lhs| + |rhs|) over the points; absent when not run. */\n readonly worst?: number;\n readonly detail: string;\n}\n\n/** Seeded points per probe. @internal */\nexport const NUMERIC_PROBE_POINTS = 8;\n/** The relative difference above which a point refutes. @internal */\nexport const NUMERIC_PROBE_TOLERANCE = 1e-12;\n\n/** A leaf that evaluates on its own (π, a registered constant, a literal) is a constant, not a free symbol. */\nfunction evaluatesAlone(name: string): boolean {\n try {\n return Number.isFinite(evalExpr(sym(name, DIMENSIONLESS)));\n } catch {\n return false;\n }\n}\n\n/** MathTS `random(lo, hi)`, read back as the number it is. */\nfunction seededPoint(lo: number, hi: number): number {\n const v: unknown = random(lo, hi);\n if (typeof v !== 'number') throw new TypeError('random did not return a number');\n return v;\n}\n\n/**\n * Evaluate a symbolic witness's two sides at `points` seeded random points,\n * every free symbol drawn from [0.5, 2) by MathTS `random` after\n * `seedProbabilityRng(spec.id)`, so a re-run sees the same points. The free\n * symbols are the scalar leaves (`scalarSymbolsFromMathTs`) that do not\n * evaluate on their own. Never throws.\n *\n * @internal\n */\nexport function probeSymbolicWitness(spec: SymbolicWitnessSpec, points: number = NUMERIC_PROBE_POINTS): NumericProbe {\n const notRun = (why: string): NumericProbe => ({ kind: 'numeric-not-run', points: 0, detail: `The numeric probe did not run: ${why}.` });\n try {\n const names = new Set<string>();\n for (const leaf of [...scalarSymbolsFromMathTs(spec.lhs), ...scalarSymbolsFromMathTs(spec.rhs)]) names.add(leaf.name);\n const free = [...names].filter((name) => !evaluatesAlone(name)).sort();\n seedProbabilityRng(spec.id);\n let worst = 0;\n for (let i = 0; i < points; i++) {\n const values: Record<string, number> = {};\n for (const name of free) values[name] = seededPoint(0.5, 2);\n const lhs = evalExpr(spec.lhs, values);\n const rhs = evalExpr(spec.rhs, values);\n if (!Number.isFinite(lhs) || !Number.isFinite(rhs)) {\n return notRun(`a non-finite value (lhs ${lhs}, rhs ${rhs}) at point ${i + 1}`);\n }\n const scale = Math.abs(lhs) + Math.abs(rhs);\n worst = Math.max(worst, scale === 0 ? 0 : Math.abs(lhs - rhs) / scale);\n }\n if (worst > NUMERIC_PROBE_TOLERANCE) {\n return {\n kind: 'numeric-refuted',\n points,\n worst,\n detail: `lhs and rhs differ at a seeded point: max |lhs − rhs|/(|lhs| + |rhs|) = ${worst} over ${points} points, above ${NUMERIC_PROBE_TOLERANCE}.`,\n };\n }\n return {\n kind: 'numeric-agrees',\n points,\n worst,\n detail: `lhs and rhs agree at ${points} seeded points: max |lhs − rhs|/(|lhs| + |rhs|) = ${worst}. Agreement at points is not a proof.`,\n };\n } catch (err) {\n return notRun(`the evaluator threw: ${String(err)}`);\n }\n}\n\n/** A symbolic run: the CAS status, and the numeric probe beside it. @internal */\nexport interface SymbolicWitnessRunResult extends WitnessRunResult {\n readonly kind: 'symbolic';\n readonly numericProbe: NumericProbe;\n}\n\n/**\n * The CAS outcomes and the numeric outcomes of symbolic runs, as two separate\n * tallies. They are never added together.\n *\n * @internal\n */\nexport function tallySymbolicResults(results: readonly SymbolicWitnessRunResult[]): {\n readonly cas: { readonly checked: number; readonly refuted: number; readonly unresolved: number };\n readonly numeric: { readonly agrees: number; readonly refuted: number; readonly notRun: number };\n} {\n const cas = { checked: 0, refuted: 0, unresolved: 0 };\n const numeric = { agrees: 0, refuted: 0, notRun: 0 };\n for (const r of results) {\n cas[r.status] += 1;\n if (r.numericProbe.kind === 'numeric-agrees') numeric.agrees += 1;\n else if (r.numericProbe.kind === 'numeric-refuted') numeric.refuted += 1;\n else numeric.notRun += 1;\n }\n return { cas, numeric };\n}\n\n/** The finite value of a decimal-literal leaf (the one rule, `dimensional/ast-leaves.ts`), or `null`. */\nfunction literalValue(node: ExprNode): number | null {\n const v = leafLiteral(node);\n return v !== undefined && Number.isFinite(v) ? v : null;\n}\n\n/** A sentinel the timeout race resolves with; never confusable with a result. */\nconst TIMED_OUT = Symbol('timed-out');\n\n/**\n * Run one symbolic witness.\n *\n * @param spec - the claim, as two ASTs whose difference should vanish.\n * @param simplifier - the CAS capability, or `null` when the optional peer is\n * absent. When omitted, resolves to `simplifyExpr` if the peer is available and\n * to `null` otherwise. Pass `null` EXPLICITLY to exercise the absent path.\n * @returns a result carrying the CAS status and, beside it, the numeric\n * probe; **never throws**, because a thrown error forces callers into a\n * `catch` that cannot distinguish \"did not run\" from \"failed\".\n * @internal\n */\nexport async function runSymbolicWitness(\n spec: SymbolicWitnessSpec,\n simplifier?: SymbolicSimplifier | null,\n): Promise<SymbolicWitnessRunResult> {\n const started = Date.now();\n if (simplifier === undefined) {\n simplifier = (await isSimplifierAvailable()) ? simplifyExpr : null;\n }\n // The probe is independent of the CAS: it runs on every path, and decides nothing below.\n const base = { witnessId: spec.id, kind: 'symbolic' as const, numericProbe: probeSymbolicWitness(spec) };\n const elapsed = (): number => Date.now() - started;\n\n if (simplifier === null) {\n return {\n ...base,\n status: 'unresolved',\n reason: 'peer-absent',\n detail:\n 'The optional CAS peer is absent, so the claim was never examined. This is ' +\n 'not evidence against it.',\n elapsedMs: elapsed(),\n };\n }\n\n const difference: ExprNode = { kind: 'op', op: '-', args: [spec.lhs, spec.rhs] };\n const budget = spec.budgetMs ?? DEFAULT_BUDGET_MS;\n\n let outcome: Awaited<ReturnType<SymbolicSimplifier>> | typeof TIMED_OUT;\n let timer: ReturnType<typeof setTimeout> | undefined;\n try {\n outcome = await Promise.race([\n simplifier(difference),\n new Promise<typeof TIMED_OUT>((resolve) => {\n timer = setTimeout(() => resolve(TIMED_OUT), budget);\n }),\n ]);\n } catch (err) {\n return {\n ...base,\n status: 'unresolved',\n reason: 'parse-error',\n detail:\n `The simplifier threw rather than answering: ${String(err)}. A throw is not a ` +\n 'refutation.',\n elapsedMs: elapsed(),\n };\n } finally {\n if (timer !== undefined) clearTimeout(timer);\n }\n\n if (outcome === TIMED_OUT) {\n return {\n ...base,\n status: 'unresolved',\n reason: 'timeout',\n detail:\n `No answer arrived within ${budget} ms. The budget bounds the WAIT, not the ` +\n 'CAS: the underlying simplification may still be running.',\n elapsedMs: elapsed(),\n };\n }\n\n const value = literalValue(outcome.expr);\n if (value === 0) {\n return {\n ...base,\n status: 'checked',\n detail: 'lhs − rhs simplified to literal 0.',\n elapsedMs: elapsed(),\n };\n }\n if (value !== null) {\n return {\n ...base,\n status: 'refuted',\n detail: `lhs − rhs simplified to the non-zero constant ${value}.`,\n elapsedMs: elapsed(),\n };\n }\n return {\n ...base,\n status: 'unresolved',\n reason: 'not-simplified',\n detail:\n 'The difference did not reduce to a constant. The claim may still hold; this ' +\n 'simplifier could not show it.',\n elapsedMs: elapsed(),\n };\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"catalog-load.d.ts","sourceRoot":"","sources":["../../src/bridges/catalog-load.ts"],"names":[],"mappings":"AAAA;;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ualInSigma } from './observations/types.js';
8
+ import { withinMixed } from '../core/compare.js';
8
9
  import { checkedDataFile } from '../core/data-file.js';
9
10
  /**
10
11
  * `data/bridge-catalog.json`, checked against `data/bridge-catalog.schema.json`
@@ -59,7 +60,7 @@ const boolean = (o, key, where) => {
59
60
  */
60
61
  /** A stored number is written to a few significant digits; it agrees when it rounds to the computed one within 1e-3 relative (or absolute near zero). */
61
62
  function agreesToStoredPrecision(stored, computed) {
62
- return Math.abs(stored - computed) <= 1e-3 * Math.max(1, Math.abs(computed));
63
+ return withinMixed(stored, computed, 1e-3);
63
64
  }
64
65
  /** True when `holds` contains `clause` as a whole clause, not as the tail of a longer name. */
65
66
  function holdsStatesClause(holds, clause) {
@@ -74,6 +75,12 @@ function holdsStatesClause(holds, clause) {
74
75
  from = at + 1;
75
76
  }
76
77
  }
78
+ /**
79
+ * Checks `row.outcome` arm by arm on the record's `kind` and narrows the row to
80
+ * a loaded {@link CatalogConfrontation}: an assertion guard, so the loaded
81
+ * record is a `ConfrontationOutcome` by inspection, not by a cast. A field
82
+ * that is missing or of the wrong type throws naming the record.
83
+ */
77
84
  function readOutcome(row) {
78
85
  const where = `data/bridge-catalog.json: confrontation ${row.catalogId}`;
79
86
  const o = row.outcome;
@@ -129,10 +136,12 @@ function readOutcome(row) {
129
136
  throw new Error(`${where}: outcome.rows must be an array`);
130
137
  break;
131
138
  }
132
- return o;
133
139
  }
134
140
  function narrowConfrontations(file) {
135
- return file.confrontations.map((row) => ({ ...row, outcome: readOutcome(row) }));
141
+ return file.confrontations.map((row) => {
142
+ readOutcome(row);
143
+ return row;
144
+ });
136
145
  }
137
146
  /**
138
147
  * A relation's confidence is its catalog row's `status`. The row is the one
@@ -203,11 +212,7 @@ function deriveDomains(file) {
203
212
  if (clauses.length === 0)
204
213
  return relation;
205
214
  const stated = relation.holds.trim() === 'true' ? '' : `${relation.holds} and `;
206
- return {
207
- ...relation,
208
- holds: `${stated}${clauses.join(' and ')}`,
209
- domain: relation.domain === '' ? clauses.join(', ') : `${relation.domain}; ${clauses.join(', ')}`,
210
- };
215
+ return { ...relation, holds: `${stated}${clauses.join(' and ')}` };
211
216
  });
212
217
  return { ...file, relations };
213
218
  }
@@ -1 +1 @@
1
- {"version":3,"file":"catalog-load.js","sourceRoot":"","sources":["../../src/bridges/catalog-load.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAcvD;;;;GAIG;AACH,SAAS,QAAQ;IACf,OAAO,eAAe,CAAC,qBAAqB,CAAsB,CAAC;AACrE,CAAC;AAED,gFAAgF;AAChF,SAAS,UAAU,CAAC,IAAuB;IACzC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;QAChD,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAE,CAAC,EAAE,CAAC;QACzC,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAE,CAAC,EAAE,CAAC;QACpC,IAAI,OAAO,IAAI,QAAQ,EAAE,CAAC;YACxB,MAAM,IAAI,KAAK,CAAC,mCAAmC,OAAO,kBAAkB,QAAQ,qCAAqC,CAAC,CAAC;QAC7H,CAAC;IACH,CAAC;IACD,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAC/B,KAAK,MAAM,GAAG,IAAI,IAAI,CAAC,cAAc,EAAE,CAAC;QACtC,IAAI,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,SAAS,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,wCAAwC,GAAG,CAAC,SAAS,yBAAyB,CAAC,CAAC;QAC7H,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IAC1B,CAAC;IACD,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Q,CAAC;IAClB,CAAC;IACD,MAAM,EAAE,GAAG,eAAe,CAAC,QAAQ,CAAC,CAAC;IACrC,IAAI,EAAE,KAAK,SAAS,EAAE,CAAC;QACrB,MAAM,IAAI,SAAS,CAAC,mBAAmB,QAAQ,uBAAuB,CAAC,CAAC;IAC1E,CAAC;IACD,OAAO,EAAE,CAAC;AACZ,CAAC;AAED,mEAAmE;AACnE,MAAM,UAAU,cAAc,CAAC,EAAU;IACvC,OAAO,MAAM,EAAE,EAAE,CAAC;AACpB,CAAC","sourcesContent":["/**\n * The catalog loader. This module is the only place that parses a bridge id\n * out of text. Everywhere else reads the loaded records.\n *\n * @module bridges/catalog-load\n */\n\nimport { residualInSigma } from './observations/types.js';\nimport { checkedDataFile } from '../core/data-file.js';\nimport type {\n CatalogConfrontation,\n CatalogConfrontationRecord,\n CatalogEntry,\n CatalogEvaluator,\n CatalogEvaluatorParameter,\n CatalogFile,\n CatalogFileRecord,\n CatalogRejection,\n CatalogRelation,\n} from './catalog-types.js';\nimport type { ConfrontationOutcome } from './observations/types.js';\n\n/**\n * `data/bridge-catalog.json`, checked against `data/bridge-catalog.schema.json`\n * (every record's `type`, the relation, evaluator, parameter and confrontation\n * shapes). What a schema cannot state is checked by {@link loadCatalog}.\n */\nfunction loadFile(): CatalogFileRecord {\n return checkedDataFile('bridge-catalog.json') as CatalogFileRecord;\n}\n\n/** Records in ascending id order; a duplicate or a disordered id is refused. */\nfunction checkOrder(file: CatalogFileRecord): void {\n for (let i = 1; i < file.entries.length; i += 1) {\n const previous = file.entries[i - 1]!.id;\n const current = file.entries[i]!.id;\n if (current <= previous) {\n throw new Error(`data/bridge-catalog.json: entry ${current} follows entry ${previous}; records are in ascending id order`);\n }\n }\n const seen = new Set<number>();\n for (const row of file.confrontations) {\n if (seen.has(row.catalogId)) throw new Error(`data/bridge-catalog.json: catalog id ${row.catalogId} has two confrontations`);\n seen.add(row.catalogId);\n }\n const rejected = new Set<number>();\n const ids = new Set(file.entries.map((entry) => entry.id));\n for (const row of file.rejections) {\n if (!ids.has(row.catalogId)) throw new Error(`data/bridge-catalog.json: rejection ${row.catalogId} names no catalog row`);\n if (rejected.has(row.catalogId)) throw new Error(`data/bridge-catalog.json: catalog id ${row.catalogId} is rejected twice`);\n rejected.add(row.catalogId);\n }\n}\n\nconst number = (o: Readonly<Record<string, unknown>>, key: string, where: string): number => {\n const v = o[key];\n if (typeof v !== 'number' || !Number.isFinite(v)) throw new Error(`${where}: outcome.${key} must be a finite number`);\n return v;\n};\nconst boolean = (o: Readonly<Record<string, unknown>>, key: string, where: string): boolean => {\n const v = o[key];\n if (typeof v !== 'boolean') throw new Error(`${where}: outcome.${key} must be a boolean`);\n return v;\n};\n\n/**\n * The outcome of one confrontation, checked arm by arm on its `kind`. The\n * schema states the shared fields (`kind`, `units`, `provenance`, the data\n * handling); the fields each arm must carry are checked here, so the loaded\n * record is a {@link ConfrontationOutcome} by inspection, not by assertion.\n */\n/** A stored number is written to a few significant digits; it agrees when it rounds to the computed one within 1e-3 relative (or absolute near zero). */\nfunction agreesToStoredPrecision(stored: number, computed: number): boolean {\n return Math.abs(stored - computed) <= 1e-3 * Math.max(1, Math.abs(computed));\n}\n\n/** True when `holds` contains `clause` as a whole clause, not as the tail of a longer name. */\nfunction holdsStatesClause(holds: string, clause: string): boolean {\n let from = 0;\n for (;;) {\n const at = holds.indexOf(clause, from);\n if (at < 0) return false;\n const before = at === 0 ? ' ' : holds[at - 1]!;\n if (!/[A-Za-z0-9_-]/.test(before)) return true;\n from = at + 1;\n }\n}\n\nfunction readOutcome(row: CatalogConfrontationRecord): ConfrontationOutcome {\n const where = `data/bridge-catalog.json: confrontation ${row.catalogId}`;\n const o = row.outcome;\n if (o['kind'] !== row.kind) throw new Error(`${where}: outcome.kind ${String(o['kind'])} is not the record kind ${row.kind}`);\n switch (row.kind) {\n case 'value': {\n // The verdict is derived from the numbers, never read as stored (AGENTS law 1): a stored\n // residual or verdict that disagrees with |predicted − observed|/σ is refused.\n const predicted = number(o, 'predicted', where);\n const observed = number(o, 'observed', where);\n const sigma = number(o, 'sigma', where);\n const stored = number(o, 'residualInSigma', where);\n const computed = residualInSigma(predicted, observed, sigma);\n if (!agreesToStoredPrecision(stored, computed)) {\n throw new Error(`${where}: outcome.residualInSigma ${stored} is not |predicted − observed|/sigma = ${computed}`);\n }\n if (boolean(o, 'withinObserved', where) !== computed <= 1) {\n throw new Error(`${where}: outcome.withinObserved must be residualInSigma <= 1 (${computed})`);\n }\n break;\n }\n case 'upper-bound': {\n const predicted = number(o, 'predicted', where);\n const bound = number(o, 'bound', where);\n // `predictedIs` picks the comparison (`observations/types.ts`): a point is satisfied at or\n // below the observed limit; an encoded bound (|x| ≤ predicted) when the limit lies inside it.\n const encodedBound = o['predictedIs'] === 'encoded-bound';\n const expected = encodedBound ? bound <= predicted : predicted <= bound;\n if (boolean(o, 'satisfied', where) !== expected) {\n throw new Error(\n `${where}: outcome.satisfied must be ${encodedBound ? 'bound <= predicted' : 'predicted <= bound'} (${predicted} vs ${bound})`,\n );\n }\n break;\n }\n case 'consistency': {\n const predicted = number(o, 'predicted', where);\n const approaches = number(o, 'approaches', where);\n const gap = number(o, 'fractionalGap', where);\n if (o['fractionalGapIs'] !== 'agreement-bound' && o['fractionalGapIs'] !== 'observed-difference') {\n throw new Error(`${where}: outcome.fractionalGapIs must name what fractionalGap holds`);\n }\n // An agreement bound is the record's stated tolerance; an observed difference is derived.\n if (o['fractionalGapIs'] === 'observed-difference' && predicted !== 0) {\n const computed = (approaches - predicted) / predicted;\n if (!agreesToStoredPrecision(gap, computed)) {\n throw new Error(`${where}: outcome.fractionalGap ${gap} is not (approaches − predicted)/predicted = ${computed}`);\n }\n }\n break;\n }\n case 'table':\n if (!Array.isArray(o['rows'])) throw new Error(`${where}: outcome.rows must be an array`);\n break;\n }\n return o as unknown as ConfrontationOutcome;\n}\n\nfunction narrowConfrontations(file: CatalogFileRecord): readonly CatalogConfrontation[] {\n return file.confrontations.map((row) => ({ ...row, outcome: readOutcome(row) }));\n}\n\n/**\n * A relation's confidence is its catalog row's `status`. The row is the one\n * owner, so the file may not store a confidence beside a catalog id; a\n * relation with no row stores its own. A row that is `invalid` has no\n * relation to evaluate.\n */\nfunction deriveConfidence(file: CatalogFileRecord): CatalogFile {\n const entries = new Map(file.entries.map((entry) => [entry.id, entry]));\n const confrontations = narrowConfrontations(file);\n const relations = file.relations.map((relation): CatalogRelation => {\n if (relation.catalogId === null) {\n if (relation.confidence === undefined) {\n throw new Error(`data/bridge-catalog.json: relation ${relation.id} has no catalog row and no confidence`);\n }\n return { ...relation, confidence: relation.confidence };\n }\n if (relation.confidence !== undefined) {\n throw new Error(`data/bridge-catalog.json: relation ${relation.id} stores a confidence; the row's status is the owner`);\n }\n const entry = entries.get(relation.catalogId);\n if (entry === undefined) {\n throw new Error(`data/bridge-catalog.json: relation ${relation.id} names an unknown catalog id ${relation.catalogId}`);\n }\n if (entry.status === 'invalid') {\n throw new Error(`data/bridge-catalog.json: relation ${relation.id} has a closed form but its row is invalid`);\n }\n return { ...relation, confidence: entry.status };\n });\n return { ...file, relations, confrontations };\n}\n\n/**\n * The validity clause a parameter's sign states, in the relation's own source\n * name. An absolute temperature is nonnegative unless the parameter says `any`.\n */\nfunction signClause(parameter: CatalogEvaluatorParameter, source: string): string | undefined {\n const sign = parameter.sign ?? (parameter.temperature === 'absolute' ? 'nonnegative' : undefined);\n if (sign === 'positive') return `${source} > 0`;\n if (sign === 'nonnegative') return `${source} >= 0`;\n return undefined;\n}\n\n/**\n * Add the sign clauses the evaluator parameters state to the relation they\n * evaluate. The validity domain is derived from the flags, so a new bridge\n * that flags its inputs cannot leave the domain behind. A clause the record\n * already states is not repeated.\n */\nfunction deriveDomains(file: CatalogFile): CatalogFile {\n const relations = file.relations.map((relation) => {\n if (relation.catalogId === null) return relation;\n const evaluator = file.evaluators.find((row) => row.catalogId === relation.catalogId);\n if (evaluator === undefined) return relation;\n const clauses: string[] = [];\n for (const parameter of evaluator.parameters) {\n const source =\n relation.sources.find((name) => name === parameter.key || (relation.aliases[name] ?? []).includes(parameter.key)) ??\n (relation.sources.includes(parameter.quantity) ? parameter.quantity : undefined);\n if (source === undefined) continue;\n const clause = signClause(parameter, source);\n // A whole-clause match: `radius > 0` is not already stated by `near-radius > 0`.\n if (clause !== undefined && !holdsStatesClause(relation.holds, clause)) clauses.push(clause);\n }\n if (clauses.length === 0) return relation;\n const stated = relation.holds.trim() === 'true' ? '' : `${relation.holds} and `;\n return {\n ...relation,\n holds: `${stated}${clauses.join(' and ')}`,\n domain: relation.domain === '' ? clauses.join(', ') : `${relation.domain}; ${clauses.join(', ')}`,\n };\n });\n return { ...file, relations };\n}\n\n/**\n * The loaded catalog from a file record: the records are in id order, each\n * outcome is checked on its kind, each relation takes its row's status as its\n * confidence, then the sign clauses its evaluator parameters state. The\n * production catalog is this function on `data/bridge-catalog.json`.\n * @internal\n */\nexport function loadCatalog(file: CatalogFileRecord): CatalogFile {\n checkOrder(file);\n return deriveDomains(deriveConfidence(file));\n}\n\nconst CATALOG = loadCatalog(loadFile());\n\n/** The loaded catalog. */\nexport function bridgeCatalog(): CatalogFile {\n return CATALOG;\n}\n\n/** Catalog rows, in file order. */\nexport function catalogEntries(): readonly CatalogEntry[] {\n return CATALOG.entries;\n}\n\n/** Closed forms, in file order. */\nexport function catalogRelations(): readonly CatalogRelation[] {\n return CATALOG.relations;\n}\n\n/** Evaluator input contracts, in file order. */\nexport function catalogEvaluators(): readonly CatalogEvaluator[] {\n return CATALOG.evaluators;\n}\n\n/** Confrontations, in file order; one per catalog id. */\nexport function catalogConfrontations(): readonly CatalogConfrontation[] {\n return CATALOG.confrontations;\n}\n\n/** The negative catalog, in file order. */\nexport function catalogRejections(): readonly CatalogRejection[] {\n return CATALOG.rejections;\n}\n\nconst ENTRY_BY_ID = new Map(CATALOG.entries.map((entry) => [entry.id, entry]));\nconst RELATIONS_BY_CATALOG = new Map<number, CatalogRelation[]>();\nfor (const relation of CATALOG.relations) {\n if (relation.catalogId === null) continue;\n const list = RELATIONS_BY_CATALOG.get(relation.catalogId);\n if (list === undefined) RELATIONS_BY_CATALOG.set(relation.catalogId, [relation]);\n else list.push(relation);\n}\n\n/** The row for a catalog id, or undefined. */\nexport function catalogEntry(id: number): CatalogEntry | undefined {\n return ENTRY_BY_ID.get(id);\n}\n\n/** Relations whose catalog id is `id`, in file order. */\nexport function relationsForCatalog(id: number): readonly CatalogRelation[] {\n return RELATIONS_BY_CATALOG.get(id) ?? [];\n}\n\n/**\n * The relation a numeric catalog id evaluates. The graph id `be-<id>` wins\n * when several relations share the id. Otherwise the first relation does.\n */\nexport function primaryRelation(id: number): CatalogRelation | undefined {\n const rows = relationsForCatalog(id);\n return rows.find((row) => row.id === `be-${id}`) ?? rows[0];\n}\n\n/**\n * The catalog number a piece of text names (`42`, `be-42`, `BE-42`), or\n * undefined when it names none (an atlas id, a canonical id, a quantity).\n * The one place a bridge id is read from text; {@link parseBridgeId} throws\n * where this returns undefined.\n */\nexport function catalogIdNumber(raw: string): number | undefined {\n const match = /^(?:be-)?(\\d+)$/i.exec(raw.trim());\n return match === null ? undefined : Number(match[1]);\n}\n\n/**\n * Parse a catalog id from a number or from text the caller typed.\n * Accepts `42`, `be-42`, and `BE-42`. This is the only such parser.\n */\nexport function parseBridgeId(bridgeId: number | string): number {\n if (typeof bridgeId === 'number') {\n if (!Number.isInteger(bridgeId)) {\n throw new RangeError(`parseBridgeId: ${bridgeId} is not an integer catalog id`);\n }\n return bridgeId;\n }\n const id = catalogIdNumber(bridgeId);\n if (id === undefined) {\n throw new TypeError(`parseBridgeId: '${bridgeId}' is not a catalog id`);\n }\n return id;\n}\n\n/** Graph id for a catalog number: the stable key, not a switch. */\nexport function catalogEdgeKey(id: number): string {\n return `be-${id}`;\n}\n"]}
1
+ {"version":3,"file":"catalog-load.js","sourceRoot":"","sources":["../../src/bridges/catalog-load.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,yBAA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;IACrC,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,EAAE,KAAK,MAAM,EAAE,EAAE,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC;AAC9D,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,GAAW;IACzC,MAAM,KAAK,GAAG,kBAAkB,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC;IAClD,OAAO,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AACvD,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,aAAa,CAAC,QAAyB;IACrD,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE,CAAC;QACjC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE,CAAC;YAChC,MAAM,IAAI,UAAU,CAAC,kBAAkB,QAAQ,+BAA+B,CAAC,CAAC;QAClF,CAAC;QACD,OAAO,QAAQ,CAAC;IAClB,CAAC;IACD,MAAM,EAAE,GAAG,eAAe,CAAC,QAAQ,CAAC,CAAC;IACrC,IAAI,EAAE,KAAK,SAAS,EAAE,CAAC;QACrB,MAAM,IAAI,SAAS,CAAC,mBAAmB,QAAQ,uBAAuB,CAAC,CAAC;IAC1E,CAAC;IACD,OAAO,EAAE,CAAC;AACZ,CAAC;AAED,mEAAmE;AACnE,MAAM,UAAU,cAAc,CAAC,EAAU;IACvC,OAAO,MAAM,EAAE,EAAE,CAAC;AACpB,CAAC","sourcesContent":["/**\n * The catalog loader. This module is the only place that parses a bridge id\n * out of text. Everywhere else reads the loaded records.\n *\n * @module bridges/catalog-load\n */\n\nimport { residualInSigma } from './observations/types.js';\nimport { withinMixed } from '../core/compare.js';\nimport { checkedDataFile } from '../core/data-file.js';\nimport type {\n CatalogConfrontation,\n CatalogConfrontationRecord,\n CatalogEntry,\n CatalogEvaluator,\n CatalogEvaluatorParameter,\n CatalogFile,\n CatalogFileRecord,\n CatalogRejection,\n CatalogRelation,\n} from './catalog-types.js';\nimport type { ConfrontationOutcome } from './observations/types.js';\n\n/**\n * `data/bridge-catalog.json`, checked against `data/bridge-catalog.schema.json`\n * (every record's `type`, the relation, evaluator, parameter and confrontation\n * shapes). What a schema cannot state is checked by {@link loadCatalog}.\n */\nfunction loadFile(): CatalogFileRecord {\n return checkedDataFile('bridge-catalog.json') as CatalogFileRecord;\n}\n\n/** Records in ascending id order; a duplicate or a disordered id is refused. */\nfunction checkOrder(file: CatalogFileRecord): void {\n for (let i = 1; i < file.entries.length; i += 1) {\n const previous = file.entries[i - 1]!.id;\n const current = file.entries[i]!.id;\n if (current <= previous) {\n throw new Error(`data/bridge-catalog.json: entry ${current} follows entry ${previous}; records are in ascending id order`);\n }\n }\n const seen = new Set<number>();\n for (const row of file.confrontations) {\n if (seen.has(row.catalogId)) throw new Error(`data/bridge-catalog.json: catalog id ${row.catalogId} has two confrontations`);\n seen.add(row.catalogId);\n }\n const rejected = new Set<number>();\n const ids = new Set(file.entries.map((entry) => entry.id));\n for (const row of file.rejections) {\n if (!ids.has(row.catalogId)) throw new Error(`data/bridge-catalog.json: rejection ${row.catalogId} names no catalog row`);\n if (rejected.has(row.catalogId)) throw new Error(`data/bridge-catalog.json: catalog id ${row.catalogId} is rejected twice`);\n rejected.add(row.catalogId);\n }\n}\n\nconst number = (o: Readonly<Record<string, unknown>>, key: string, where: string): number => {\n const v = o[key];\n if (typeof v !== 'number' || !Number.isFinite(v)) throw new Error(`${where}: outcome.${key} must be a finite number`);\n return v;\n};\nconst boolean = (o: Readonly<Record<string, unknown>>, key: string, where: string): boolean => {\n const v = o[key];\n if (typeof v !== 'boolean') throw new Error(`${where}: outcome.${key} must be a boolean`);\n return v;\n};\n\n/**\n * The outcome of one confrontation, checked arm by arm on its `kind`. The\n * schema states the shared fields (`kind`, `units`, `provenance`, the data\n * handling); the fields each arm must carry are checked here, so the loaded\n * record is a {@link ConfrontationOutcome} by inspection, not by assertion.\n */\n/** A stored number is written to a few significant digits; it agrees when it rounds to the computed one within 1e-3 relative (or absolute near zero). */\nfunction agreesToStoredPrecision(stored: number, computed: number): boolean {\n return withinMixed(stored, computed, 1e-3);\n}\n\n/** True when `holds` contains `clause` as a whole clause, not as the tail of a longer name. */\nfunction holdsStatesClause(holds: string, clause: string): boolean {\n let from = 0;\n for (;;) {\n const at = holds.indexOf(clause, from);\n if (at < 0) return false;\n const before = at === 0 ? ' ' : holds[at - 1]!;\n if (!/[A-Za-z0-9_-]/.test(before)) return true;\n from = at + 1;\n }\n}\n\n/**\n * Checks `row.outcome` arm by arm on the record's `kind` and narrows the row to\n * a loaded {@link CatalogConfrontation}: an assertion guard, so the loaded\n * record is a `ConfrontationOutcome` by inspection, not by a cast. A field\n * that is missing or of the wrong type throws naming the record.\n */\nfunction readOutcome(row: CatalogConfrontationRecord): asserts row is CatalogConfrontationRecord & CatalogConfrontation {\n const where = `data/bridge-catalog.json: confrontation ${row.catalogId}`;\n const o = row.outcome;\n if (o['kind'] !== row.kind) throw new Error(`${where}: outcome.kind ${String(o['kind'])} is not the record kind ${row.kind}`);\n switch (row.kind) {\n case 'value': {\n // The verdict is derived from the numbers, never read as stored (AGENTS law 1): a stored\n // residual or verdict that disagrees with |predicted − observed|/σ is refused.\n const predicted = number(o, 'predicted', where);\n const observed = number(o, 'observed', where);\n const sigma = number(o, 'sigma', where);\n const stored = number(o, 'residualInSigma', where);\n const computed = residualInSigma(predicted, observed, sigma);\n if (!agreesToStoredPrecision(stored, computed)) {\n throw new Error(`${where}: outcome.residualInSigma ${stored} is not |predicted − observed|/sigma = ${computed}`);\n }\n if (boolean(o, 'withinObserved', where) !== computed <= 1) {\n throw new Error(`${where}: outcome.withinObserved must be residualInSigma <= 1 (${computed})`);\n }\n break;\n }\n case 'upper-bound': {\n const predicted = number(o, 'predicted', where);\n const bound = number(o, 'bound', where);\n // `predictedIs` picks the comparison (`observations/types.ts`): a point is satisfied at or\n // below the observed limit; an encoded bound (|x| ≤ predicted) when the limit lies inside it.\n const encodedBound = o['predictedIs'] === 'encoded-bound';\n const expected = encodedBound ? bound <= predicted : predicted <= bound;\n if (boolean(o, 'satisfied', where) !== expected) {\n throw new Error(\n `${where}: outcome.satisfied must be ${encodedBound ? 'bound <= predicted' : 'predicted <= bound'} (${predicted} vs ${bound})`,\n );\n }\n break;\n }\n case 'consistency': {\n const predicted = number(o, 'predicted', where);\n const approaches = number(o, 'approaches', where);\n const gap = number(o, 'fractionalGap', where);\n if (o['fractionalGapIs'] !== 'agreement-bound' && o['fractionalGapIs'] !== 'observed-difference') {\n throw new Error(`${where}: outcome.fractionalGapIs must name what fractionalGap holds`);\n }\n // An agreement bound is the record's stated tolerance; an observed difference is derived.\n if (o['fractionalGapIs'] === 'observed-difference' && predicted !== 0) {\n const computed = (approaches - predicted) / predicted;\n if (!agreesToStoredPrecision(gap, computed)) {\n throw new Error(`${where}: outcome.fractionalGap ${gap} is not (approaches − predicted)/predicted = ${computed}`);\n }\n }\n break;\n }\n case 'table':\n if (!Array.isArray(o['rows'])) throw new Error(`${where}: outcome.rows must be an array`);\n break;\n }\n}\n\nfunction narrowConfrontations(file: CatalogFileRecord): readonly CatalogConfrontation[] {\n return file.confrontations.map((row) => {\n readOutcome(row);\n return row;\n });\n}\n\n/**\n * A relation's confidence is its catalog row's `status`. The row is the one\n * owner, so the file may not store a confidence beside a catalog id; a\n * relation with no row stores its own. A row that is `invalid` has no\n * relation to evaluate.\n */\nfunction deriveConfidence(file: CatalogFileRecord): CatalogFile {\n const entries = new Map(file.entries.map((entry) => [entry.id, entry]));\n const confrontations = narrowConfrontations(file);\n const relations = file.relations.map((relation): CatalogRelation => {\n if (relation.catalogId === null) {\n if (relation.confidence === undefined) {\n throw new Error(`data/bridge-catalog.json: relation ${relation.id} has no catalog row and no confidence`);\n }\n return { ...relation, confidence: relation.confidence };\n }\n if (relation.confidence !== undefined) {\n throw new Error(`data/bridge-catalog.json: relation ${relation.id} stores a confidence; the row's status is the owner`);\n }\n const entry = entries.get(relation.catalogId);\n if (entry === undefined) {\n throw new Error(`data/bridge-catalog.json: relation ${relation.id} names an unknown catalog id ${relation.catalogId}`);\n }\n if (entry.status === 'invalid') {\n throw new Error(`data/bridge-catalog.json: relation ${relation.id} has a closed form but its row is invalid`);\n }\n return { ...relation, confidence: entry.status };\n });\n return { ...file, relations, confrontations };\n}\n\n/**\n * The validity clause a parameter's sign states, in the relation's own source\n * name. An absolute temperature is nonnegative unless the parameter says `any`.\n */\nfunction signClause(parameter: CatalogEvaluatorParameter, source: string): string | undefined {\n const sign = parameter.sign ?? (parameter.temperature === 'absolute' ? 'nonnegative' : undefined);\n if (sign === 'positive') return `${source} > 0`;\n if (sign === 'nonnegative') return `${source} >= 0`;\n return undefined;\n}\n\n/**\n * Add the sign clauses the evaluator parameters state to the relation they\n * evaluate. The validity domain is derived from the flags, so a new bridge\n * that flags its inputs cannot leave the domain behind. A clause the record\n * already states is not repeated.\n */\nfunction deriveDomains(file: CatalogFile): CatalogFile {\n const relations = file.relations.map((relation) => {\n if (relation.catalogId === null) return relation;\n const evaluator = file.evaluators.find((row) => row.catalogId === relation.catalogId);\n if (evaluator === undefined) return relation;\n const clauses: string[] = [];\n for (const parameter of evaluator.parameters) {\n const source =\n relation.sources.find((name) => name === parameter.key || (relation.aliases[name] ?? []).includes(parameter.key)) ??\n (relation.sources.includes(parameter.quantity) ? parameter.quantity : undefined);\n if (source === undefined) continue;\n const clause = signClause(parameter, source);\n // A whole-clause match: `radius > 0` is not already stated by `near-radius > 0`.\n if (clause !== undefined && !holdsStatesClause(relation.holds, clause)) clauses.push(clause);\n }\n if (clauses.length === 0) return relation;\n const stated = relation.holds.trim() === 'true' ? '' : `${relation.holds} and `;\n return { ...relation, holds: `${stated}${clauses.join(' and ')}` };\n });\n return { ...file, relations };\n}\n\n/**\n * The loaded catalog from a file record: the records are in id order, each\n * outcome is checked on its kind, each relation takes its row's status as its\n * confidence, then the sign clauses its evaluator parameters state. The\n * production catalog is this function on `data/bridge-catalog.json`.\n * @internal\n */\nexport function loadCatalog(file: CatalogFileRecord): CatalogFile {\n checkOrder(file);\n return deriveDomains(deriveConfidence(file));\n}\n\nconst CATALOG = loadCatalog(loadFile());\n\n/** The loaded catalog. */\nexport function bridgeCatalog(): CatalogFile {\n return CATALOG;\n}\n\n/** Catalog rows, in file order. */\nexport function catalogEntries(): readonly CatalogEntry[] {\n return CATALOG.entries;\n}\n\n/** Closed forms, in file order. */\nexport function catalogRelations(): readonly CatalogRelation[] {\n return CATALOG.relations;\n}\n\n/** Evaluator input contracts, in file order. */\nexport function catalogEvaluators(): readonly CatalogEvaluator[] {\n return CATALOG.evaluators;\n}\n\n/** Confrontations, in file order; one per catalog id. */\nexport function catalogConfrontations(): readonly CatalogConfrontation[] {\n return CATALOG.confrontations;\n}\n\n/** The negative catalog, in file order. */\nexport function catalogRejections(): readonly CatalogRejection[] {\n return CATALOG.rejections;\n}\n\nconst ENTRY_BY_ID = new Map(CATALOG.entries.map((entry) => [entry.id, entry]));\nconst RELATIONS_BY_CATALOG = new Map<number, CatalogRelation[]>();\nfor (const relation of CATALOG.relations) {\n if (relation.catalogId === null) continue;\n const list = RELATIONS_BY_CATALOG.get(relation.catalogId);\n if (list === undefined) RELATIONS_BY_CATALOG.set(relation.catalogId, [relation]);\n else list.push(relation);\n}\n\n/** The row for a catalog id, or undefined. */\nexport function catalogEntry(id: number): CatalogEntry | undefined {\n return ENTRY_BY_ID.get(id);\n}\n\n/** Relations whose catalog id is `id`, in file order. */\nexport function relationsForCatalog(id: number): readonly CatalogRelation[] {\n return RELATIONS_BY_CATALOG.get(id) ?? [];\n}\n\n/**\n * The relation a numeric catalog id evaluates. The graph id `be-<id>` wins\n * when several relations share the id. Otherwise the first relation does.\n */\nexport function primaryRelation(id: number): CatalogRelation | undefined {\n const rows = relationsForCatalog(id);\n return rows.find((row) => row.id === `be-${id}`) ?? rows[0];\n}\n\n/**\n * The catalog number a piece of text names (`42`, `be-42`, `BE-42`), or\n * undefined when it names none (an atlas id, a canonical id, a quantity).\n * The one place a bridge id is read from text; {@link parseBridgeId} throws\n * where this returns undefined.\n */\nexport function catalogIdNumber(raw: string): number | undefined {\n const match = /^(?:be-)?(\\d+)$/i.exec(raw.trim());\n return match === null ? undefined : Number(match[1]);\n}\n\n/**\n * Parse a catalog id from a number or from text the caller typed.\n * Accepts `42`, `be-42`, and `BE-42`. This is the only such parser.\n */\nexport function parseBridgeId(bridgeId: number | string): number {\n if (typeof bridgeId === 'number') {\n if (!Number.isInteger(bridgeId)) {\n throw new RangeError(`parseBridgeId: ${bridgeId} is not an integer catalog id`);\n }\n return bridgeId;\n }\n const id = catalogIdNumber(bridgeId);\n if (id === undefined) {\n throw new TypeError(`parseBridgeId: '${bridgeId}' is not a catalog id`);\n }\n return id;\n}\n\n/** Graph id for a catalog number: the stable key, not a switch. */\nexport function catalogEdgeKey(id: number): string {\n return `be-${id}`;\n}\n"]}
@@ -13,14 +13,38 @@ import type { BridgeEquationEntry, BridgeEquationStatus } from './types.js';
13
13
  * Absence is not a state this record carries.
14
14
  */
15
15
  export type CatalogFiling = 'standard' | 'cross-domain';
16
+ /**
17
+ * How far `lean/` proves a catalog record, best first. `full`: the record's
18
+ * Lean theorem is kind `bridge` and its manifest row is reviewed, so it states
19
+ * the catalogued equation and the catalog path passes it to `deriveEvidence`.
20
+ * `weak`: the theorem proves part of the equation (a derivation-step, limit,
21
+ * reduction, property or cross-check) or its row is unreviewed. `pending`: the
22
+ * record has no Lean theorem. The order of this array is the rank.
23
+ *
24
+ * @internal
25
+ */
26
+ export declare const PROOF_STATUSES: readonly ['full', 'weak', 'pending'];
27
+ /** One of {@link PROOF_STATUSES}. @internal */
28
+ export type ProofStatus = (typeof PROOF_STATUSES)[number];
16
29
  /**
17
30
  * One catalog row. The row owns the relation contract, the regime, the
18
31
  * conventions and the counterexamples; its relations carry no copy.
19
32
  */
20
33
  export interface CatalogEntry extends BridgeEquationEntry {
21
34
  readonly type: CatalogFiling;
22
- /** The PhysJS manifest key. The reference and its kind are that entry's. */
35
+ /** The key of this record's entry in `formal/lean/manifest.json`. The reference and its kind are that entry's. */
23
36
  readonly formalKey?: string;
37
+ /**
38
+ * The Lean theorem that manifest entry names, present exactly when
39
+ * `formalKey` is. A projection of the manifest; `catalogFormalRef` refuses
40
+ * a record whose theorem is not the manifest's.
41
+ */
42
+ readonly theorem?: string;
43
+ /**
44
+ * The record's {@link ProofStatus}, a projection of `formalKey` and the
45
+ * manifest that `catalogProofProblems` checks against its derivation.
46
+ */
47
+ readonly proofStatus: ProofStatus;
24
48
  readonly dimension?: Dimension;
25
49
  /** The confrontation is a caller-supplied table, not a stored outcome. */
26
50
  readonly callerTable?: true;
@@ -50,7 +74,6 @@ export interface CatalogRelation {
50
74
  readonly sources: readonly string[];
51
75
  readonly aliases: Readonly<Record<string, readonly string[]>>;
52
76
  readonly holds: string;
53
- readonly domain: string;
54
77
  readonly confidence: 'established' | 'speculative' | 'highly-speculative';
55
78
  readonly citation: string;
56
79
  readonly coefficientUnset?: boolean;
@@ -97,6 +120,7 @@ export interface CatalogEvaluatorOutput {
97
120
  readonly name: string;
98
121
  readonly unit: string;
99
122
  readonly meaning: string;
123
+ /** Read over the evaluator's inputs and `value`. The output is computed when every input it reads is given. */
100
124
  readonly expression: string;
101
125
  }
102
126
  /** The input contract of one catalog evaluator. */
@@ -1 +1 @@
1
- {"version":3,"file":"catalog-types.d.ts","sourceRoot":"","sources":["../../src/bridges/catalog-types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AACpE,OAAO,KAAK,EACV,mBAAmB,EACnB,oBAAoB,EACrB,MAAM,YAAY,CAAC;AAEpB;;;;GAIG;AACH,MAAM,MAAM,aAAa,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B,EAAE,CAAC;CAChE,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,mBAAmB,GAAG,SAAS,GAAG,OAAO,GAAG,UAAU,GAAG,UAAU,CAAC;AAEhF,2EAA2E;AAC3E,MAAM,WAAW,mBAAmB;IAClC,+FAA+F;IAC/F,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,OAAO,EAAE,mBAAmB,CAAC;IACtC,8EAA8E;IAC9E,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,uDAAuD;IACvD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,yCAAyC;IACzC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,yCAAyC;AACzC,YAAY,EAAE,oBAAoB,EAAE,CAAC"}
@@ -4,5 +4,15 @@
4
4
  *
5
5
  * @module bridges/catalog-types
6
6
  */
7
- export {};
7
+ /**
8
+ * How far `lean/` proves a catalog record, best first. `full`: the record's
9
+ * Lean theorem is kind `bridge` and its manifest row is reviewed, so it states
10
+ * the catalogued equation and the catalog path passes it to `deriveEvidence`.
11
+ * `weak`: the theorem proves part of the equation (a derivation-step, limit,
12
+ * reduction, property or cross-check) or its row is unreviewed. `pending`: the
13
+ * record has no Lean theorem. The order of this array is the rank.
14
+ *
15
+ * @internal
16
+ */
17
+ export const PROOF_STATUSES = ['full', 'weak', 'pending'];
8
18
  //# sourceMappingURL=catalog-types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"catalog-types.js","sourceRoot":"","sources":["../../src/bridges/catalog-types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG","sourcesContent":["/**\n * Catalog record shapes. The file `data/bridge-catalog.json` is the source.\n * A bridge number is the `id` field. It is not a code identifier.\n *\n * @module bridges/catalog-types\n */\n\nimport type { Dimension } from '../dimensional/types.js';\nimport type { ConfrontationOutcome } from './observations/types.js';\nimport type {\n BridgeEquationEntry,\n BridgeEquationStatus,\n} from './types.js';\n\n/**\n * Filing label. `cross-domain` means the equation links quantities or\n * constants from two distinct fields. `standard` means it stays inside one.\n * Absence is not a state this record carries.\n */\nexport type CatalogFiling = 'standard' | 'cross-domain';\n\n/**\n * One catalog row. The row owns the relation contract, the regime, the\n * conventions and the counterexamples; its relations carry no copy.\n */\nexport interface CatalogEntry extends BridgeEquationEntry {\n readonly type: CatalogFiling;\n /** The PhysJS manifest key. The reference and its kind are that entry's. */\n readonly formalKey?: string;\n readonly dimension?: Dimension;\n /** The confrontation is a caller-supplied table, not a stored outcome. */\n readonly callerTable?: true;\n /** The adjudication is contested; the row stays out of the null-result list until adjudicated. */\n readonly contested?: true;\n /** A named statement this row's expression supports. */\n readonly statement?: string;\n /**\n * Scalar expression for a row that has no relation. The structural\n * registry parses it. It is not a graph edge and it is not evaluated.\n */\n readonly scalarExpression?: string;\n}\n\n/** Inputs and the number the engine returns at those inputs. */\nexport interface CatalogReference {\n readonly inputs: Readonly<Record<string, number>>;\n readonly value: number;\n}\n\n/** One closed form. Several relations may share one catalog id. */\nexport interface CatalogRelation {\n readonly id: string;\n readonly catalogId: number | null;\n readonly kind: 'bridge' | 'law';\n readonly label: string;\n readonly expression: string;\n readonly target: string;\n readonly sources: readonly string[];\n readonly aliases: Readonly<Record<string, readonly string[]>>;\n readonly holds: string;\n readonly domain: string;\n readonly confidence: 'established' | 'speculative' | 'highly-speculative';\n readonly citation: string;\n readonly coefficientUnset?: boolean;\n readonly formulaFactors?: Readonly<Record<string, number>>;\n readonly reference?: CatalogReference;\n /** A caveat the record states beside its value. The text is the record's; nothing switches on it. */\n readonly notice?: { readonly text: string };\n}\n\n/** One named input of a catalog evaluator. */\nexport interface CatalogEvaluatorParameter {\n readonly key: string;\n readonly quantity: string;\n readonly symbol: string;\n readonly unit: string;\n readonly meaning: string;\n readonly geometry?: 'radius' | 'diameter' | 'separation' | 'impact-parameter' | 'semi-major-axis';\n readonly temperature?: 'absolute';\n /**\n * The sign this input must have. `positive` is `> 0`, `nonnegative` is `>= 0`,\n * and `any` states that the quantity is signed and overrides the temperature\n * rule. An absolute temperature is `nonnegative` when no sign is stated.\n */\n readonly sign?: 'positive' | 'nonnegative' | 'any';\n /** An angular frequency in rad/s. A cycle unit (Hz, rpm) given to it is multiplied by 2π. */\n readonly angular?: true;\n readonly alternates?: readonly { readonly key: string; readonly meaning: string; readonly toKey: number }[];\n}\n\n/**\n * A second number the same record returns beside its `value`. The expression\n * reads evaluator parameter keys, the constants, and `value`. It is computed\n * when every parameter key it reads was given; a parameter only an output\n * reads is optional.\n *\n * @public\n */\nexport interface CatalogEvaluatorOutput {\n /** The result key, with its unit as a suffix (`E_F_J`). */\n readonly name: string;\n readonly unit: string;\n readonly meaning: string;\n readonly expression: string;\n}\n\n/** The input contract of one catalog evaluator. */\nexport interface CatalogEvaluator {\n readonly catalogId: number;\n readonly name: string;\n readonly parameters: readonly CatalogEvaluatorParameter[];\n readonly outputs?: readonly CatalogEvaluatorOutput[];\n}\n\n/**\n * The prediction point of a value-kind confrontation, in the evaluator's input\n * spellings. The evaluator at these inputs returns the outcome's `predicted`:\n * its value, or the extra output `output` names.\n */\nexport interface CatalogPrediction {\n readonly inputs: Readonly<Record<string, number>>;\n readonly output?: string;\n}\n\n/** One committed data confrontation of a catalog record, its outcome narrowed on `kind` when the catalog loads. */\nexport interface CatalogConfrontation {\n readonly catalogId: number;\n readonly title: string;\n readonly kind: 'value' | 'upper-bound' | 'consistency' | 'table';\n readonly rigor: 'stringent' | 'moderate' | 'loose';\n readonly outcome: ConfrontationOutcome;\n readonly prediction?: CatalogPrediction;\n}\n\n/** A confrontation as the file stores it: the outcome is checked arm by arm when the catalog loads. */\nexport type CatalogConfrontationRecord = Omit<CatalogConfrontation, 'outcome'> & {\n readonly outcome: Readonly<Record<string, unknown>>;\n};\n\n/** One row of the negative catalog: adjudicated not-a-bridge under the membership criterion. */\nexport interface CatalogRejection {\n readonly catalogId: number;\n readonly name: string;\n /** Why the endpoints do NOT differ in regime attributes. */\n readonly reason: string;\n readonly citation: string;\n}\n\n/**\n * A relation as the file stores it. `confidence` is stored only on a relation\n * that has no catalog row; a relation with a row takes its row's `status`\n * when the catalog loads, so the two cannot drift.\n */\nexport type CatalogRelationRecord = Omit<CatalogRelation, 'confidence'> & {\n readonly confidence?: CatalogRelation['confidence'];\n};\n\n/** The loaded catalog: schema 3, entries, relations, evaluators, confrontations, the two ledgers and the spine. */\nexport interface CatalogFile {\n readonly schemaVersion: 3;\n readonly packageVersion: string;\n readonly entries: readonly CatalogEntry[];\n readonly relations: readonly CatalogRelation[];\n readonly evaluators: readonly CatalogEvaluator[];\n readonly confrontations: readonly CatalogConfrontation[];\n /** The adjudication ledger: recorded verdicts on identification hypotheses. `composition/adjudication.ts` projects it. */\n readonly adjudications: readonly CatalogAdjudication[];\n /** The negative catalog. `bridges/rejected.ts` projects it. */\n readonly rejections: readonly CatalogRejection[];\n readonly spine: Readonly<Record<string, Readonly<Record<string, number>>>>;\n}\n\n/** The catalog as `data/bridge-catalog.json` stores it, before the loader derives the per-relation fields and narrows each outcome. */\nexport type CatalogFileRecord = Omit<CatalogFile, 'relations' | 'confrontations'> & {\n readonly relations: readonly CatalogRelationRecord[];\n readonly confrontations: readonly CatalogConfrontationRecord[];\n};\n\n/**\n * A recorded human verdict on an identification hypothesis `a ≟ b`.\n * - `genuine` — real physics AND a new link (nothing recorded qualifies yet).\n * - `entailed` — real physics already carried by the L-layer; not a new link.\n * - `decoy` — dimensional coincidence / no mechanism, including trivial and definitional identifications.\n * - `deferred` — reviewed and consciously parked (not the same as absent, which means never reviewed).\n */\nexport type AdjudicationVerdict = 'genuine' | 'decoy' | 'entailed' | 'deferred';\n\n/** One record of the adjudication ledger in `data/bridge-catalog.json`. */\nexport interface CatalogAdjudication {\n /** `candidateId(a, b)` of the identification: the two slugs in sorted order, joined by `~`. */\n readonly id: string;\n readonly verdict: AdjudicationVerdict;\n /** Why, condensed from the adjudication document; never machine-generated. */\n readonly grounds: string;\n /** Repo-relative path of the adjudication document. */\n readonly source: string;\n /** ISO date the verdict was recorded. */\n readonly date: string;\n}\n\n/** Lifecycle status of a catalog row. */\nexport type { BridgeEquationStatus };\n"]}
1
+ {"version":3,"file":"catalog-types.js","sourceRoot":"","sources":["../../src/bridges/catalog-types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAgBH;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,CAAU,CAAC","sourcesContent":["/**\n * Catalog record shapes. The file `data/bridge-catalog.json` is the source.\n * A bridge number is the `id` field. It is not a code identifier.\n *\n * @module bridges/catalog-types\n */\n\nimport type { Dimension } from '../dimensional/types.js';\nimport type { ConfrontationOutcome } from './observations/types.js';\nimport type {\n BridgeEquationEntry,\n BridgeEquationStatus,\n} from './types.js';\n\n/**\n * Filing label. `cross-domain` means the equation links quantities or\n * constants from two distinct fields. `standard` means it stays inside one.\n * Absence is not a state this record carries.\n */\nexport type CatalogFiling = 'standard' | 'cross-domain';\n\n/**\n * How far `lean/` proves a catalog record, best first. `full`: the record's\n * Lean theorem is kind `bridge` and its manifest row is reviewed, so it states\n * the catalogued equation and the catalog path passes it to `deriveEvidence`.\n * `weak`: the theorem proves part of the equation (a derivation-step, limit,\n * reduction, property or cross-check) or its row is unreviewed. `pending`: the\n * record has no Lean theorem. The order of this array is the rank.\n *\n * @internal\n */\nexport const PROOF_STATUSES = ['full', 'weak', 'pending'] as const;\n\n/** One of {@link PROOF_STATUSES}. @internal */\nexport type ProofStatus = (typeof PROOF_STATUSES)[number];\n\n/**\n * One catalog row. The row owns the relation contract, the regime, the\n * conventions and the counterexamples; its relations carry no copy.\n */\nexport interface CatalogEntry extends BridgeEquationEntry {\n readonly type: CatalogFiling;\n /** The key of this record's entry in `formal/lean/manifest.json`. The reference and its kind are that entry's. */\n readonly formalKey?: string;\n /**\n * The Lean theorem that manifest entry names, present exactly when\n * `formalKey` is. A projection of the manifest; `catalogFormalRef` refuses\n * a record whose theorem is not the manifest's.\n */\n readonly theorem?: string;\n /**\n * The record's {@link ProofStatus}, a projection of `formalKey` and the\n * manifest that `catalogProofProblems` checks against its derivation.\n */\n readonly proofStatus: ProofStatus;\n readonly dimension?: Dimension;\n /** The confrontation is a caller-supplied table, not a stored outcome. */\n readonly callerTable?: true;\n /** The adjudication is contested; the row stays out of the null-result list until adjudicated. */\n readonly contested?: true;\n /** A named statement this row's expression supports. */\n readonly statement?: string;\n /**\n * Scalar expression for a row that has no relation. The structural\n * registry parses it. It is not a graph edge and it is not evaluated.\n */\n readonly scalarExpression?: string;\n}\n\n/** Inputs and the number the engine returns at those inputs. */\nexport interface CatalogReference {\n readonly inputs: Readonly<Record<string, number>>;\n readonly value: number;\n}\n\n/** One closed form. Several relations may share one catalog id. */\nexport interface CatalogRelation {\n readonly id: string;\n readonly catalogId: number | null;\n readonly kind: 'bridge' | 'law';\n readonly label: string;\n readonly expression: string;\n readonly target: string;\n readonly sources: readonly string[];\n readonly aliases: Readonly<Record<string, readonly string[]>>;\n readonly holds: string;\n readonly confidence: 'established' | 'speculative' | 'highly-speculative';\n readonly citation: string;\n readonly coefficientUnset?: boolean;\n readonly formulaFactors?: Readonly<Record<string, number>>;\n readonly reference?: CatalogReference;\n /** A caveat the record states beside its value. The text is the record's; nothing switches on it. */\n readonly notice?: { readonly text: string };\n}\n\n/** One named input of a catalog evaluator. */\nexport interface CatalogEvaluatorParameter {\n readonly key: string;\n readonly quantity: string;\n readonly symbol: string;\n readonly unit: string;\n readonly meaning: string;\n readonly geometry?: 'radius' | 'diameter' | 'separation' | 'impact-parameter' | 'semi-major-axis';\n readonly temperature?: 'absolute';\n /**\n * The sign this input must have. `positive` is `> 0`, `nonnegative` is `>= 0`,\n * and `any` states that the quantity is signed and overrides the temperature\n * rule. An absolute temperature is `nonnegative` when no sign is stated.\n */\n readonly sign?: 'positive' | 'nonnegative' | 'any';\n /** An angular frequency in rad/s. A cycle unit (Hz, rpm) given to it is multiplied by 2π. */\n readonly angular?: true;\n readonly alternates?: readonly { readonly key: string; readonly meaning: string; readonly toKey: number }[];\n}\n\n/**\n * A second number the same record returns beside its `value`. The expression\n * reads evaluator parameter keys, the constants, and `value`. It is computed\n * when every parameter key it reads was given; a parameter only an output\n * reads is optional.\n *\n * @public\n */\nexport interface CatalogEvaluatorOutput {\n /** The result key, with its unit as a suffix (`E_F_J`). */\n readonly name: string;\n readonly unit: string;\n readonly meaning: string;\n /** Read over the evaluator's inputs and `value`. The output is computed when every input it reads is given. */\n readonly expression: string;\n}\n\n/** The input contract of one catalog evaluator. */\nexport interface CatalogEvaluator {\n readonly catalogId: number;\n readonly name: string;\n readonly parameters: readonly CatalogEvaluatorParameter[];\n readonly outputs?: readonly CatalogEvaluatorOutput[];\n}\n\n/**\n * The prediction point of a value-kind confrontation, in the evaluator's input\n * spellings. The evaluator at these inputs returns the outcome's `predicted`:\n * its value, or the extra output `output` names.\n */\nexport interface CatalogPrediction {\n readonly inputs: Readonly<Record<string, number>>;\n readonly output?: string;\n}\n\n/** One committed data confrontation of a catalog record, its outcome narrowed on `kind` when the catalog loads. */\nexport interface CatalogConfrontation {\n readonly catalogId: number;\n readonly title: string;\n readonly kind: 'value' | 'upper-bound' | 'consistency' | 'table';\n readonly rigor: 'stringent' | 'moderate' | 'loose';\n readonly outcome: ConfrontationOutcome;\n readonly prediction?: CatalogPrediction;\n}\n\n/** A confrontation as the file stores it: the outcome is checked arm by arm when the catalog loads. */\nexport type CatalogConfrontationRecord = Omit<CatalogConfrontation, 'outcome'> & {\n readonly outcome: Readonly<Record<string, unknown>>;\n};\n\n/** One row of the negative catalog: adjudicated not-a-bridge under the membership criterion. */\nexport interface CatalogRejection {\n readonly catalogId: number;\n readonly name: string;\n /** Why the endpoints do NOT differ in regime attributes. */\n readonly reason: string;\n readonly citation: string;\n}\n\n/**\n * A relation as the file stores it. `confidence` is stored only on a relation\n * that has no catalog row; a relation with a row takes its row's `status`\n * when the catalog loads, so the two cannot drift.\n */\nexport type CatalogRelationRecord = Omit<CatalogRelation, 'confidence'> & {\n readonly confidence?: CatalogRelation['confidence'];\n};\n\n/** The loaded catalog: schema 3, entries, relations, evaluators, confrontations, the two ledgers and the spine. */\nexport interface CatalogFile {\n readonly schemaVersion: 3;\n readonly packageVersion: string;\n readonly entries: readonly CatalogEntry[];\n readonly relations: readonly CatalogRelation[];\n readonly evaluators: readonly CatalogEvaluator[];\n readonly confrontations: readonly CatalogConfrontation[];\n /** The adjudication ledger: recorded verdicts on identification hypotheses. `composition/adjudication.ts` projects it. */\n readonly adjudications: readonly CatalogAdjudication[];\n /** The negative catalog. `bridges/rejected.ts` projects it. */\n readonly rejections: readonly CatalogRejection[];\n readonly spine: Readonly<Record<string, Readonly<Record<string, number>>>>;\n}\n\n/** The catalog as `data/bridge-catalog.json` stores it, before the loader derives the per-relation fields and narrows each outcome. */\nexport type CatalogFileRecord = Omit<CatalogFile, 'relations' | 'confrontations'> & {\n readonly relations: readonly CatalogRelationRecord[];\n readonly confrontations: readonly CatalogConfrontationRecord[];\n};\n\n/**\n * A recorded human verdict on an identification hypothesis `a ≟ b`.\n * - `genuine` — real physics AND a new link (nothing recorded qualifies yet).\n * - `entailed` — real physics already carried by the L-layer; not a new link.\n * - `decoy` — dimensional coincidence / no mechanism, including trivial and definitional identifications.\n * - `deferred` — reviewed and consciously parked (not the same as absent, which means never reviewed).\n */\nexport type AdjudicationVerdict = 'genuine' | 'decoy' | 'entailed' | 'deferred';\n\n/** One record of the adjudication ledger in `data/bridge-catalog.json`. */\nexport interface CatalogAdjudication {\n /** `candidateId(a, b)` of the identification: the two slugs in sorted order, joined by `~`. */\n readonly id: string;\n readonly verdict: AdjudicationVerdict;\n /** Why, condensed from the adjudication document; never machine-generated. */\n readonly grounds: string;\n /** Repo-relative path of the adjudication document. */\n readonly source: string;\n /** ISO date the verdict was recorded. */\n readonly date: string;\n}\n\n/** Lifecycle status of a catalog row. */\nexport type { BridgeEquationStatus };\n"]}
@@ -72,8 +72,34 @@ export declare class DuplicateInputError extends Error {
72
72
  * @internal
73
73
  */
74
74
  export declare function isInputContractError(error: unknown): error is MissingInputError | UnknownInputError | InputTypeError | NonFiniteInputError | DuplicateInputError | ConstantInputError;
75
+ /**
76
+ * One input a violated condition reads: the key the caller gave it under, the
77
+ * name the relation reads it by, and its value. @public
78
+ */
79
+ export interface DomainInput {
80
+ readonly key: string;
81
+ readonly quantity: string;
82
+ readonly value: number;
83
+ }
84
+ /**
85
+ * One violated condition of a validity domain. `condition` is the conjunct of
86
+ * the record's `holds` that failed, written with the caller's keys
87
+ * (`T_K >= 0`); `key` and `value` are the first input it reads, and `inputs`
88
+ * every input it reads. A condition that reads no input (a constant check) has
89
+ * `key` `''` and `value` `NaN`. A later range-per-kind change generates the
90
+ * same objects. @public
91
+ */
92
+ export interface DomainViolation {
93
+ readonly condition: string;
94
+ readonly key: string;
95
+ readonly value: number;
96
+ readonly inputs: readonly DomainInput[];
97
+ }
75
98
  /**
76
99
  * Evaluation refused: the inputs fall outside the relation's validity domain.
100
+ * The error lists only the conditions that failed, each with the input keys it
101
+ * reads and their values; the message is rendered from them, so it cannot name
102
+ * a condition the check did not run.
77
103
  *
78
104
  * Honest deviation from design D-3's "domain-incompatible at compose
79
105
  * time": domain predicates are opaque functions, so incompatibility is
@@ -84,6 +110,10 @@ export declare function isInputContractError(error: unknown): error is MissingIn
84
110
  * @public
85
111
  */
86
112
  export declare class DomainViolationError extends Error {
87
- constructor(message: string);
113
+ readonly id: string;
114
+ readonly violations: readonly DomainViolation[];
115
+ readonly context?: string | undefined;
116
+ /** The id evaluated, every violated condition, and, for a composed edge, where in the composition it failed. */
117
+ constructor(id: string, violations: readonly DomainViolation[], context?: string | undefined);
88
118
  }
89
119
  //# sourceMappingURL=evaluation-errors.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"evaluation-errors.d.ts","sourceRoot":"","sources":["../../src/bridges/evaluation-errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,4EAA4E;AAC5E,qBAAa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