universal-physics-tensor 0.45.1 → 0.46.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 (473) hide show
  1. package/README.md +28 -27
  2. package/dist/atlas/applicability.d.ts +108 -0
  3. package/dist/atlas/applicability.d.ts.map +1 -0
  4. package/dist/atlas/applicability.js +301 -0
  5. package/dist/atlas/applicability.js.map +1 -0
  6. package/dist/atlas/association.d.ts +92 -0
  7. package/dist/atlas/association.d.ts.map +1 -0
  8. package/dist/atlas/association.js +112 -0
  9. package/dist/atlas/association.js.map +1 -0
  10. package/dist/atlas/benchmark/backend-shapes.d.ts +47 -0
  11. package/dist/atlas/benchmark/backend-shapes.d.ts.map +1 -0
  12. package/dist/atlas/benchmark/backend-shapes.js +58 -0
  13. package/dist/atlas/benchmark/backend-shapes.js.map +1 -0
  14. package/dist/atlas/benchmark/baselines.d.ts +64 -0
  15. package/dist/atlas/benchmark/baselines.d.ts.map +1 -0
  16. package/dist/atlas/benchmark/baselines.js +112 -0
  17. package/dist/atlas/benchmark/baselines.js.map +1 -0
  18. package/dist/atlas/benchmark/leakage.d.ts +56 -0
  19. package/dist/atlas/benchmark/leakage.d.ts.map +1 -0
  20. package/dist/atlas/benchmark/leakage.js +100 -0
  21. package/dist/atlas/benchmark/leakage.js.map +1 -0
  22. package/dist/atlas/benchmark/loader.d.ts +56 -0
  23. package/dist/atlas/benchmark/loader.d.ts.map +1 -0
  24. package/dist/atlas/benchmark/loader.js +104 -0
  25. package/dist/atlas/benchmark/loader.js.map +1 -0
  26. package/dist/atlas/benchmark/run-atlas.d.ts +72 -0
  27. package/dist/atlas/benchmark/run-atlas.d.ts.map +1 -0
  28. package/dist/atlas/benchmark/run-atlas.js +210 -0
  29. package/dist/atlas/benchmark/run-atlas.js.map +1 -0
  30. package/dist/atlas/benchmark/stats.d.ts +90 -0
  31. package/dist/atlas/benchmark/stats.d.ts.map +1 -0
  32. package/dist/atlas/benchmark/stats.js +159 -0
  33. package/dist/atlas/benchmark/stats.js.map +1 -0
  34. package/dist/atlas/benchmark/study.d.ts +120 -0
  35. package/dist/atlas/benchmark/study.d.ts.map +1 -0
  36. package/dist/atlas/benchmark/study.js +192 -0
  37. package/dist/atlas/benchmark/study.js.map +1 -0
  38. package/dist/atlas/benchmark/types.d.ts +79 -0
  39. package/dist/atlas/benchmark/types.d.ts.map +1 -0
  40. package/dist/atlas/benchmark/types.js +46 -0
  41. package/dist/atlas/benchmark/types.js.map +1 -0
  42. package/dist/atlas/composition-table.d.ts +55 -0
  43. package/dist/atlas/composition-table.d.ts.map +1 -0
  44. package/dist/atlas/composition-table.js +133 -0
  45. package/dist/atlas/composition-table.js.map +1 -0
  46. package/dist/atlas/conventions.d.ts +63 -0
  47. package/dist/atlas/conventions.d.ts.map +1 -0
  48. package/dist/atlas/conventions.js +93 -0
  49. package/dist/atlas/conventions.js.map +1 -0
  50. package/dist/atlas/coverage.d.ts +93 -0
  51. package/dist/atlas/coverage.d.ts.map +1 -0
  52. package/dist/atlas/coverage.js +69 -0
  53. package/dist/atlas/coverage.js.map +1 -0
  54. package/dist/atlas/derivation.d.ts +137 -0
  55. package/dist/atlas/derivation.d.ts.map +1 -0
  56. package/dist/atlas/derivation.js +190 -0
  57. package/dist/atlas/derivation.js.map +1 -0
  58. package/dist/atlas/derive-evidence.d.ts +218 -0
  59. package/dist/atlas/derive-evidence.d.ts.map +1 -0
  60. package/dist/atlas/derive-evidence.js +225 -0
  61. package/dist/atlas/derive-evidence.js.map +1 -0
  62. package/dist/atlas/diffusion/bridges-closure.d.ts +63 -0
  63. package/dist/atlas/diffusion/bridges-closure.d.ts.map +1 -0
  64. package/dist/atlas/diffusion/bridges-closure.js +324 -0
  65. package/dist/atlas/diffusion/bridges-closure.js.map +1 -0
  66. package/dist/atlas/diffusion/bridges.d.ts +36 -0
  67. package/dist/atlas/diffusion/bridges.d.ts.map +1 -0
  68. package/dist/atlas/diffusion/bridges.js +226 -0
  69. package/dist/atlas/diffusion/bridges.js.map +1 -0
  70. package/dist/atlas/diffusion/dimensions.d.ts +21 -0
  71. package/dist/atlas/diffusion/dimensions.d.ts.map +1 -0
  72. package/dist/atlas/diffusion/dimensions.js +21 -0
  73. package/dist/atlas/diffusion/dimensions.js.map +1 -0
  74. package/dist/atlas/diffusion/index.d.ts +16 -0
  75. package/dist/atlas/diffusion/index.d.ts.map +1 -0
  76. package/dist/atlas/diffusion/index.js +23 -0
  77. package/dist/atlas/diffusion/index.js.map +1 -0
  78. package/dist/atlas/diffusion/models.d.ts +24 -0
  79. package/dist/atlas/diffusion/models.d.ts.map +1 -0
  80. package/dist/atlas/diffusion/models.js +139 -0
  81. package/dist/atlas/diffusion/models.js.map +1 -0
  82. package/dist/atlas/diffusion/numerics.d.ts +181 -0
  83. package/dist/atlas/diffusion/numerics.d.ts.map +1 -0
  84. package/dist/atlas/diffusion/numerics.js +251 -0
  85. package/dist/atlas/diffusion/numerics.js.map +1 -0
  86. package/dist/atlas/error-algebra.d.ts +52 -0
  87. package/dist/atlas/error-algebra.d.ts.map +1 -0
  88. package/dist/atlas/error-algebra.js +55 -0
  89. package/dist/atlas/error-algebra.js.map +1 -0
  90. package/dist/atlas/export.d.ts +48 -0
  91. package/dist/atlas/export.d.ts.map +1 -0
  92. package/dist/atlas/export.js +106 -0
  93. package/dist/atlas/export.js.map +1 -0
  94. package/dist/atlas/families.d.ts +14 -0
  95. package/dist/atlas/families.d.ts.map +1 -0
  96. package/dist/atlas/families.js +20 -0
  97. package/dist/atlas/families.js.map +1 -0
  98. package/dist/atlas/index.d.ts +90 -0
  99. package/dist/atlas/index.d.ts.map +1 -0
  100. package/dist/atlas/index.js +69 -0
  101. package/dist/atlas/index.js.map +1 -0
  102. package/dist/atlas/link-prediction.d.ts +71 -0
  103. package/dist/atlas/link-prediction.d.ts.map +1 -0
  104. package/dist/atlas/link-prediction.js +128 -0
  105. package/dist/atlas/link-prediction.js.map +1 -0
  106. package/dist/atlas/model.d.ts +70 -0
  107. package/dist/atlas/model.d.ts.map +1 -0
  108. package/dist/atlas/model.js +26 -0
  109. package/dist/atlas/model.js.map +1 -0
  110. package/dist/atlas/oscillators/bridges-coarse.d.ts +71 -0
  111. package/dist/atlas/oscillators/bridges-coarse.d.ts.map +1 -0
  112. package/dist/atlas/oscillators/bridges-coarse.js +146 -0
  113. package/dist/atlas/oscillators/bridges-coarse.js.map +1 -0
  114. package/dist/atlas/oscillators/bridges-exact.d.ts +70 -0
  115. package/dist/atlas/oscillators/bridges-exact.d.ts.map +1 -0
  116. package/dist/atlas/oscillators/bridges-exact.js +227 -0
  117. package/dist/atlas/oscillators/bridges-exact.js.map +1 -0
  118. package/dist/atlas/oscillators/bridges-limits.d.ts +118 -0
  119. package/dist/atlas/oscillators/bridges-limits.d.ts.map +1 -0
  120. package/dist/atlas/oscillators/bridges-limits.js +342 -0
  121. package/dist/atlas/oscillators/bridges-limits.js.map +1 -0
  122. package/dist/atlas/oscillators/dimensions.d.ts +34 -0
  123. package/dist/atlas/oscillators/dimensions.d.ts.map +1 -0
  124. package/dist/atlas/oscillators/dimensions.js +34 -0
  125. package/dist/atlas/oscillators/dimensions.js.map +1 -0
  126. package/dist/atlas/oscillators/index.d.ts +38 -0
  127. package/dist/atlas/oscillators/index.d.ts.map +1 -0
  128. package/dist/atlas/oscillators/index.js +37 -0
  129. package/dist/atlas/oscillators/index.js.map +1 -0
  130. package/dist/atlas/oscillators/models.d.ts +25 -0
  131. package/dist/atlas/oscillators/models.d.ts.map +1 -0
  132. package/dist/atlas/oscillators/models.js +160 -0
  133. package/dist/atlas/oscillators/models.js.map +1 -0
  134. package/dist/atlas/oscillators/rejections.d.ts +21 -0
  135. package/dist/atlas/oscillators/rejections.d.ts.map +1 -0
  136. package/dist/atlas/oscillators/rejections.js +54 -0
  137. package/dist/atlas/oscillators/rejections.js.map +1 -0
  138. package/dist/atlas/path-bound.d.ts +143 -0
  139. package/dist/atlas/path-bound.d.ts.map +1 -0
  140. package/dist/atlas/path-bound.js +268 -0
  141. package/dist/atlas/path-bound.js.map +1 -0
  142. package/dist/atlas/poster/associations.d.ts +66 -0
  143. package/dist/atlas/poster/associations.d.ts.map +1 -0
  144. package/dist/atlas/poster/associations.js +90 -0
  145. package/dist/atlas/poster/associations.js.map +1 -0
  146. package/dist/atlas/poster/derivations.d.ts +156 -0
  147. package/dist/atlas/poster/derivations.d.ts.map +1 -0
  148. package/dist/atlas/poster/derivations.js +430 -0
  149. package/dist/atlas/poster/derivations.js.map +1 -0
  150. package/dist/atlas/poster/statements.d.ts +198 -0
  151. package/dist/atlas/poster/statements.d.ts.map +1 -0
  152. package/dist/atlas/poster/statements.js +365 -0
  153. package/dist/atlas/poster/statements.js.map +1 -0
  154. package/dist/atlas/public.d.ts +26 -0
  155. package/dist/atlas/public.d.ts.map +1 -0
  156. package/dist/atlas/public.js +21 -0
  157. package/dist/atlas/public.js.map +1 -0
  158. package/dist/atlas/regime.d.ts +171 -0
  159. package/dist/atlas/regime.d.ts.map +1 -0
  160. package/dist/atlas/regime.js +309 -0
  161. package/dist/atlas/regime.js.map +1 -0
  162. package/dist/atlas/serialize.d.ts +50 -0
  163. package/dist/atlas/serialize.d.ts.map +1 -0
  164. package/dist/atlas/serialize.js +180 -0
  165. package/dist/atlas/serialize.js.map +1 -0
  166. package/dist/atlas/statement.d.ts +165 -0
  167. package/dist/atlas/statement.d.ts.map +1 -0
  168. package/dist/atlas/statement.js +176 -0
  169. package/dist/atlas/statement.js.map +1 -0
  170. package/dist/atlas/types.d.ts +308 -0
  171. package/dist/atlas/types.d.ts.map +1 -0
  172. package/dist/atlas/types.js +61 -0
  173. package/dist/atlas/types.js.map +1 -0
  174. package/dist/atlas/waves/bridges-closure.d.ts +39 -0
  175. package/dist/atlas/waves/bridges-closure.d.ts.map +1 -0
  176. package/dist/atlas/waves/bridges-closure.js +223 -0
  177. package/dist/atlas/waves/bridges-closure.js.map +1 -0
  178. package/dist/atlas/waves/bridges.d.ts +49 -0
  179. package/dist/atlas/waves/bridges.d.ts.map +1 -0
  180. package/dist/atlas/waves/bridges.js +265 -0
  181. package/dist/atlas/waves/bridges.js.map +1 -0
  182. package/dist/atlas/waves/index.d.ts +16 -0
  183. package/dist/atlas/waves/index.d.ts.map +1 -0
  184. package/dist/atlas/waves/index.js +23 -0
  185. package/dist/atlas/waves/index.js.map +1 -0
  186. package/dist/atlas/waves/models.d.ts +29 -0
  187. package/dist/atlas/waves/models.d.ts.map +1 -0
  188. package/dist/atlas/waves/models.js +127 -0
  189. package/dist/atlas/waves/models.js.map +1 -0
  190. package/dist/atlas/waves/numerics.d.ts +149 -0
  191. package/dist/atlas/waves/numerics.d.ts.map +1 -0
  192. package/dist/atlas/waves/numerics.js +218 -0
  193. package/dist/atlas/waves/numerics.js.map +1 -0
  194. package/dist/atlas/witness-artifact.d.ts +65 -0
  195. package/dist/atlas/witness-artifact.d.ts.map +1 -0
  196. package/dist/atlas/witness-artifact.js +78 -0
  197. package/dist/atlas/witness-artifact.js.map +1 -0
  198. package/dist/atlas/witness-numeric.d.ts +81 -0
  199. package/dist/atlas/witness-numeric.d.ts.map +1 -0
  200. package/dist/atlas/witness-numeric.js +105 -0
  201. package/dist/atlas/witness-numeric.js.map +1 -0
  202. package/dist/atlas/witness-result.d.ts +77 -0
  203. package/dist/atlas/witness-result.d.ts.map +1 -0
  204. package/dist/atlas/witness-result.js +39 -0
  205. package/dist/atlas/witness-result.js.map +1 -0
  206. package/dist/atlas/witness-specs.d.ts +110 -0
  207. package/dist/atlas/witness-specs.d.ts.map +1 -0
  208. package/dist/atlas/witness-specs.js +372 -0
  209. package/dist/atlas/witness-specs.js.map +1 -0
  210. package/dist/atlas/witness-symbolic.d.ts +79 -0
  211. package/dist/atlas/witness-symbolic.d.ts.map +1 -0
  212. package/dist/atlas/witness-symbolic.js +140 -0
  213. package/dist/atlas/witness-symbolic.js.map +1 -0
  214. package/dist/atlas/witnesses/quantum-support.d.ts +50 -0
  215. package/dist/atlas/witnesses/quantum-support.d.ts.map +1 -0
  216. package/dist/atlas/witnesses/quantum-support.js +48 -0
  217. package/dist/atlas/witnesses/quantum-support.js.map +1 -0
  218. package/dist/bridges/be11-decoherence-confrontation.js.map +1 -1
  219. package/dist/bridges/be21-kss-confrontation.js.map +1 -1
  220. package/dist/bridges/be23-planckian-confrontation.js.map +1 -1
  221. package/dist/bridges/be35-bootstrap-confrontation.js.map +1 -1
  222. package/dist/bridges/be36-gw170817-confrontation.js.map +1 -1
  223. package/dist/bridges/be37-cassini-confrontation.js.map +1 -1
  224. package/dist/bridges/be48-collapse-confrontation.js.map +1 -1
  225. package/dist/bridges/be51-lensing-confrontation.js.map +1 -1
  226. package/dist/bridges/be52-mercury-confrontation.js.map +1 -1
  227. package/dist/bridges/be55-quantum-hall-confrontation.js.map +1 -1
  228. package/dist/bridges/be56-casimir-confrontation.js.map +1 -1
  229. package/dist/bridges/be58-johnson-nyquist-confrontation.js.map +1 -1
  230. package/dist/bridges/be59-ac-josephson-confrontation.js.map +1 -1
  231. package/dist/bridges/be60-fractional-qh-confrontation.js.map +1 -1
  232. package/dist/bridges/be61-wiedemann-franz-confrontation.js.map +1 -1
  233. package/dist/bridges/be62-bcs-gap-confrontation.js.map +1 -1
  234. package/dist/bridges/be63-chandrasekhar-mass-confrontation.js.map +1 -1
  235. package/dist/bridges/be64-eddington-luminosity-confrontation.js.map +1 -1
  236. package/dist/bridges/be65-jeans-mass-confrontation.js.map +1 -1
  237. package/dist/bridges/bridge-equations.d.ts +2 -1
  238. package/dist/bridges/bridge-equations.d.ts.map +1 -1
  239. package/dist/bridges/bridge-equations.js +3 -2
  240. package/dist/bridges/bridge-equations.js.map +1 -1
  241. package/dist/bridges/catalog-adapter.d.ts.map +1 -1
  242. package/dist/bridges/catalog-adapter.js.map +1 -1
  243. package/dist/bridges/equations/_be-helpers.d.ts +2 -2
  244. package/dist/bridges/equations/_be-helpers.js +2 -2
  245. package/dist/bridges/equations/be-20-vacuum-energy.js.map +1 -1
  246. package/dist/bridges/equations/be-35-conformal-bootstrap.d.ts +88 -58
  247. package/dist/bridges/equations/be-35-conformal-bootstrap.d.ts.map +1 -1
  248. package/dist/bridges/equations/be-35-conformal-bootstrap.js +102 -62
  249. package/dist/bridges/equations/be-35-conformal-bootstrap.js.map +1 -1
  250. package/dist/bridges/equations/be-48-grw-localization.d.ts +9 -8
  251. package/dist/bridges/equations/be-48-grw-localization.d.ts.map +1 -1
  252. package/dist/bridges/equations/be-48-grw-localization.js +9 -8
  253. package/dist/bridges/equations/be-48-grw-localization.js.map +1 -1
  254. package/dist/bridges/gravitational-lensing.d.ts +10 -0
  255. package/dist/bridges/gravitational-lensing.d.ts.map +1 -1
  256. package/dist/bridges/gravitational-lensing.js.map +1 -1
  257. package/dist/bridges/index.d.ts +125 -7
  258. package/dist/bridges/index.d.ts.map +1 -1
  259. package/dist/bridges/index.js +483 -20
  260. package/dist/bridges/index.js.map +1 -1
  261. package/dist/bridges/perihelion-precession.d.ts +10 -0
  262. package/dist/bridges/perihelion-precession.d.ts.map +1 -1
  263. package/dist/bridges/perihelion-precession.js.map +1 -1
  264. package/dist/bridges/rhs-registry.js +2 -2
  265. package/dist/canonical/canonical-equation.d.ts +15 -0
  266. package/dist/canonical/canonical-equation.d.ts.map +1 -1
  267. package/dist/canonical/entries/_l1-build.d.ts +1 -1
  268. package/dist/canonical/entries/_l1-build.d.ts.map +1 -1
  269. package/dist/canonical/entries/atomic.d.ts.map +1 -1
  270. package/dist/canonical/entries/atomic.js +23 -0
  271. package/dist/canonical/entries/atomic.js.map +1 -1
  272. package/dist/canonical/entries/nonmonomial.d.ts.map +1 -1
  273. package/dist/canonical/entries/nonmonomial.js +93 -0
  274. package/dist/canonical/entries/nonmonomial.js.map +1 -1
  275. package/dist/canonical/normal-form.js.map +1 -1
  276. package/dist/canonical/residual.d.ts +28 -0
  277. package/dist/canonical/residual.d.ts.map +1 -0
  278. package/dist/canonical/residual.js +31 -0
  279. package/dist/canonical/residual.js.map +1 -0
  280. package/dist/cli/command.d.ts +8 -0
  281. package/dist/cli/command.d.ts.map +1 -1
  282. package/dist/cli/command.js +10 -0
  283. package/dist/cli/command.js.map +1 -1
  284. package/dist/cli/commands/atlas.d.ts +3 -0
  285. package/dist/cli/commands/atlas.d.ts.map +1 -0
  286. package/dist/cli/commands/atlas.js +158 -0
  287. package/dist/cli/commands/atlas.js.map +1 -0
  288. package/dist/cli/commands/confront.js.map +1 -1
  289. package/dist/cli/commands/coverage.js +3 -3
  290. package/dist/cli/commands/index.d.ts +3 -0
  291. package/dist/cli/commands/index.d.ts.map +1 -1
  292. package/dist/cli/commands/index.js +3 -0
  293. package/dist/cli/commands/index.js.map +1 -1
  294. package/dist/cli/commands/map.d.ts.map +1 -1
  295. package/dist/cli/commands/map.js +161 -27
  296. package/dist/cli/commands/map.js.map +1 -1
  297. package/dist/cli/commands/path.d.ts +3 -0
  298. package/dist/cli/commands/path.d.ts.map +1 -0
  299. package/dist/cli/commands/path.js +145 -0
  300. package/dist/cli/commands/path.js.map +1 -0
  301. package/dist/cli/commands/recover.d.ts.map +1 -1
  302. package/dist/cli/commands/recover.js +25 -6
  303. package/dist/cli/commands/recover.js.map +1 -1
  304. package/dist/cli/commands/regime.d.ts +14 -0
  305. package/dist/cli/commands/regime.d.ts.map +1 -0
  306. package/dist/cli/commands/regime.js +189 -0
  307. package/dist/cli/commands/regime.js.map +1 -0
  308. package/dist/cli/errors.d.ts.map +1 -1
  309. package/dist/cli/graphs.d.ts.map +1 -1
  310. package/dist/cli/graphs.js +5 -1
  311. package/dist/cli/graphs.js.map +1 -1
  312. package/dist/cli/main.d.ts.map +1 -1
  313. package/dist/cli/main.js +22 -0
  314. package/dist/cli/main.js.map +1 -1
  315. package/dist/cli/output.d.ts +6 -1
  316. package/dist/cli/output.d.ts.map +1 -1
  317. package/dist/cli/output.js.map +1 -1
  318. package/dist/cli/version.js.map +1 -1
  319. package/dist/cli-api.d.ts +16 -0
  320. package/dist/cli-api.d.ts.map +1 -1
  321. package/dist/cli-api.js +18 -0
  322. package/dist/cli-api.js.map +1 -1
  323. package/dist/composition/axis-audit.js.map +1 -1
  324. package/dist/composition/bridge-prediction.d.ts.map +1 -1
  325. package/dist/composition/bridge-prediction.js +0 -0
  326. package/dist/composition/bridge-prediction.js.map +1 -1
  327. package/dist/composition/canonical-graph.d.ts +2 -2
  328. package/dist/composition/canonical-graph.js +2 -2
  329. package/dist/composition/canonical-graph.js.map +1 -1
  330. package/dist/composition/compose-symbolic.d.ts.map +1 -1
  331. package/dist/composition/compose-symbolic.js.map +1 -1
  332. package/dist/composition/compose.d.ts.map +1 -1
  333. package/dist/composition/compose.js +80 -1
  334. package/dist/composition/compose.js.map +1 -1
  335. package/dist/composition/consequence.js.map +1 -1
  336. package/dist/composition/discovery.js.map +1 -1
  337. package/dist/composition/edge.d.ts +64 -0
  338. package/dist/composition/edge.d.ts.map +1 -1
  339. package/dist/composition/edge.js +29 -0
  340. package/dist/composition/edge.js.map +1 -1
  341. package/dist/composition/edges/calibration.d.ts.map +1 -1
  342. package/dist/composition/edges/calibration.js +46 -0
  343. package/dist/composition/edges/calibration.js.map +1 -1
  344. package/dist/composition/edges/catalog-quantum.d.ts.map +1 -1
  345. package/dist/composition/edges/catalog-quantum.js +9 -0
  346. package/dist/composition/edges/catalog-quantum.js.map +1 -1
  347. package/dist/composition/edges/catalog-tranche.d.ts.map +1 -1
  348. package/dist/composition/edges/catalog-tranche.js +18 -0
  349. package/dist/composition/edges/catalog-tranche.js.map +1 -1
  350. package/dist/composition/enumerate.js.map +1 -1
  351. package/dist/composition/explain.js.map +1 -1
  352. package/dist/composition/expr-eval.d.ts.map +1 -1
  353. package/dist/composition/expr-eval.js.map +1 -1
  354. package/dist/composition/expr-simplify.d.ts +13 -0
  355. package/dist/composition/expr-simplify.d.ts.map +1 -1
  356. package/dist/composition/expr-simplify.js +25 -0
  357. package/dist/composition/expr-simplify.js.map +1 -1
  358. package/dist/composition/expr-subst.js.map +1 -1
  359. package/dist/composition/graph-viz-svg.d.ts.map +1 -1
  360. package/dist/composition/graph-viz.d.ts +118 -1
  361. package/dist/composition/graph-viz.d.ts.map +1 -1
  362. package/dist/composition/graph-viz.js +189 -6
  363. package/dist/composition/graph-viz.js.map +1 -1
  364. package/dist/composition/identifiability.js.map +1 -1
  365. package/dist/composition/index.d.ts +4 -2
  366. package/dist/composition/index.d.ts.map +1 -1
  367. package/dist/composition/index.js +2 -1
  368. package/dist/composition/index.js.map +1 -1
  369. package/dist/composition/poster-source.d.ts +153 -0
  370. package/dist/composition/poster-source.d.ts.map +1 -0
  371. package/dist/composition/poster-source.js +183 -0
  372. package/dist/composition/poster-source.js.map +1 -0
  373. package/dist/composition/probe/backend-protocol.d.ts +34 -1
  374. package/dist/composition/probe/backend-protocol.d.ts.map +1 -1
  375. package/dist/composition/probe/backend-protocol.js +9 -2
  376. package/dist/composition/probe/backend-protocol.js.map +1 -1
  377. package/dist/composition/probe/candidate-store.d.ts.map +1 -1
  378. package/dist/composition/probe/limits.js.map +1 -1
  379. package/dist/composition/probe/pipeline.js.map +1 -1
  380. package/dist/composition/probe/problem.js.map +1 -1
  381. package/dist/composition/probe/residual.d.ts.map +1 -1
  382. package/dist/composition/probe/residual.js.map +1 -1
  383. package/dist/composition/probe/search-budget.js.map +1 -1
  384. package/dist/composition/proposed-bridges.d.ts +2 -2
  385. package/dist/composition/proposed-bridges.d.ts.map +1 -1
  386. package/dist/composition/proposed-bridges.js +1 -1
  387. package/dist/composition/proposed-bridges.js.map +1 -1
  388. package/dist/composition/retrodiction.js.map +1 -1
  389. package/dist/composition/uncertainty.d.ts +52 -2
  390. package/dist/composition/uncertainty.d.ts.map +1 -1
  391. package/dist/composition/uncertainty.js +38 -2
  392. package/dist/composition/uncertainty.js.map +1 -1
  393. package/dist/composition/user-equation.d.ts.map +1 -1
  394. package/dist/core/flux-rules.d.ts.map +1 -1
  395. package/dist/core/flux-rules.js.map +1 -1
  396. package/dist/core/labeled-tensor.d.ts.map +1 -1
  397. package/dist/core/regime-registry.d.ts.map +1 -1
  398. package/dist/core/regime-rule-install.js.map +1 -1
  399. package/dist/core/tensor.d.ts.map +1 -1
  400. package/dist/core/tensor.js.map +1 -1
  401. package/dist/core/types.d.ts.map +1 -1
  402. package/dist/diff/bridge-ast-gradient.js.map +1 -1
  403. package/dist/dimensional/ast-types.d.ts +31 -1
  404. package/dist/dimensional/ast-types.d.ts.map +1 -1
  405. package/dist/dimensional/bridge-check.d.ts +1 -1
  406. package/dist/dimensional/bridge-check.js +1 -1
  407. package/dist/dimensional/buckingham.d.ts.map +1 -1
  408. package/dist/dimensional/connection.d.ts +2 -0
  409. package/dist/dimensional/connection.d.ts.map +1 -1
  410. package/dist/dimensional/connection.js +2 -0
  411. package/dist/dimensional/connection.js.map +1 -1
  412. package/dist/dimensional/curvature-composite.d.ts +5 -3
  413. package/dist/dimensional/curvature-composite.d.ts.map +1 -1
  414. package/dist/dimensional/curvature-composite.js +1 -0
  415. package/dist/dimensional/curvature-composite.js.map +1 -1
  416. package/dist/dimensional/curvature-invariants.d.ts +2 -0
  417. package/dist/dimensional/curvature-invariants.d.ts.map +1 -1
  418. package/dist/dimensional/curvature-invariants.js +2 -0
  419. package/dist/dimensional/curvature-invariants.js.map +1 -1
  420. package/dist/dimensional/dimension-spec.d.ts.map +1 -1
  421. package/dist/dimensional/einstein-equation.d.ts +3 -3
  422. package/dist/dimensional/einstein-equation.js +3 -3
  423. package/dist/dimensional/errors.d.ts.map +1 -1
  424. package/dist/dimensional/metric.d.ts +5 -2
  425. package/dist/dimensional/metric.d.ts.map +1 -1
  426. package/dist/dimensional/metric.js +5 -2
  427. package/dist/dimensional/metric.js.map +1 -1
  428. package/dist/dimensional/tensor-trace.js.map +1 -1
  429. package/dist/dimensional/validator-registry.js.map +1 -1
  430. package/dist/dimensional/validator.d.ts +3 -2
  431. package/dist/dimensional/validator.d.ts.map +1 -1
  432. package/dist/dimensional/validator.js +23 -4
  433. package/dist/dimensional/validator.js.map +1 -1
  434. package/dist/index.d.ts +4 -3
  435. package/dist/index.d.ts.map +1 -1
  436. package/dist/index.js +4 -1
  437. package/dist/index.js.map +1 -1
  438. package/dist/numerical/curvature-lowering-helpers.d.ts.map +1 -1
  439. package/dist/numerical/curvature-lowering-helpers.js +142 -1
  440. package/dist/numerical/curvature-lowering-helpers.js.map +1 -1
  441. package/dist/numerical/errors.d.ts.map +1 -1
  442. package/dist/numerical/errors.js.map +1 -1
  443. package/dist/numerical/float64-engine.d.ts.map +1 -1
  444. package/dist/numerical/float64-engine.js +51 -24
  445. package/dist/numerical/float64-engine.js.map +1 -1
  446. package/dist/numerical/formula-dimension.d.ts.map +1 -1
  447. package/dist/numerical/formula-dimension.js.map +1 -1
  448. package/dist/numerical/formula.d.ts.map +1 -1
  449. package/dist/numerical/formula.js.map +1 -1
  450. package/dist/numerical/geometrized.d.ts.map +1 -1
  451. package/dist/numerical/gl4-integrator.d.ts +3 -3
  452. package/dist/numerical/gl4-integrator.js +3 -3
  453. package/dist/numerical/killing.d.ts +47 -5
  454. package/dist/numerical/killing.d.ts.map +1 -1
  455. package/dist/numerical/killing.js +41 -3
  456. package/dist/numerical/killing.js.map +1 -1
  457. package/dist/numerical/klein-gordon.d.ts +2 -2
  458. package/dist/numerical/klein-gordon.js +2 -2
  459. package/dist/numerical/lowering.d.ts +2 -2
  460. package/dist/numerical/lowering.d.ts.map +1 -1
  461. package/dist/numerical/lowering.js +5 -3
  462. package/dist/numerical/lowering.js.map +1 -1
  463. package/dist/numerical/mathts-engine.d.ts.map +1 -1
  464. package/dist/numerical/mathts-engine.js.map +1 -1
  465. package/dist/numerical/metric-inverse.js.map +1 -1
  466. package/dist/numerical/perihelion-finder.d.ts +15 -13
  467. package/dist/numerical/perihelion-finder.d.ts.map +1 -1
  468. package/dist/numerical/perihelion-finder.js +15 -13
  469. package/dist/numerical/perihelion-finder.js.map +1 -1
  470. package/dist/numerical/weyl-lowering.d.ts.map +1 -1
  471. package/dist/numerical/weyl-lowering.js +90 -40
  472. package/dist/numerical/weyl-lowering.js.map +1 -1
  473. package/package.json +121 -104
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../../src/atlas/benchmark/loader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAKH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD,0DAA0D;AAC1D,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,SAAS,aAAa,EAAE,EAAE,MAAM,EAAE,OAAO,GAAG,WAAW,EAAE,CA0B7F;AAED,kFAAkF;AAClF,qBAAa,uBAAwB,SAAQ,KAAK;IACpC,QAAQ,CAAC,QAAQ,EAAE,SAAS,WAAW,EAAE;IAArD,YAAqB,QAAQ,EAAE,SAAS,WAAW,EAAE,EAMpD;CACF;AAQD;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,YAAY,EAAE,MAAM,GAAG,aAAa,EAAE,CAKrE;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,YAAY,EAAE,MAAM,GAAG,aAAa,EAAE,CAKzE"}
@@ -0,0 +1,104 @@
1
+ /**
2
+ * Atlas Phase 5, S5.1 — load and validate benchmark items.
3
+ *
4
+ * Design note: `docs/planning/Atlas-Phase-5-Design.md` §0, §2.
5
+ *
6
+ * This module reads the PUBLIC half of a benchmark directory and nothing else.
7
+ * The answers live in a sibling half that no `src/` file may read;
8
+ * `tests/atlas/benchmark.test.ts` holds the import guard, with a positive
9
+ * control proving the guard can fire.
10
+ *
11
+ * **The loader enforces the one part of the independence rule that code CAN
12
+ * enforce: a frozen item whose `authorship` is not `'independent'` is refused.**
13
+ * Whether the author really was independent is a fact about people, recorded in
14
+ * the pre-registration note and checked by review.
15
+ *
16
+ * @module atlas/benchmark/loader
17
+ * @internal
18
+ */
19
+ import { readFileSync } from 'node:fs';
20
+ import { join } from 'node:path';
21
+ import { HELD_OUT_FAMILY } from './types.js';
22
+ /**
23
+ * Validate an item set against the schema and the rules that make it a benchmark.
24
+ *
25
+ * @param items - the items, as parsed.
26
+ * @param frozen - true for the frozen set (authorship must be `'independent'`),
27
+ * false for the contested staging area (authorship must be `'contested-draft'`).
28
+ * @returns every problem found; empty means admissible. Never throws, so a
29
+ * caller sees ALL problems at once rather than the first.
30
+ * @internal
31
+ */
32
+ export function validateItems(items, frozen) {
33
+ const problems = [];
34
+ const seen = new Set();
35
+ for (const item of items) {
36
+ const p = (problem) => {
37
+ problems.push({ id: item.id, problem });
38
+ };
39
+ if (seen.has(item.id))
40
+ p('duplicate id');
41
+ seen.add(item.id);
42
+ const wanted = frozen ? 'independent' : 'contested-draft';
43
+ if (item.authorship !== wanted) {
44
+ p(`authorship '${item.authorship}' where the ${frozen ? 'frozen' : 'contested'} set requires '${wanted}'`);
45
+ }
46
+ // The answer lives in the scorer half. A public item that carries it would
47
+ // hand the key to any condition that reads the public file.
48
+ if ('kind' in item || 'failureKind' in item) {
49
+ p('the public half carries the answer (kind/failureKind); it belongs in scorer/labels.json');
50
+ }
51
+ if ((item.family === HELD_OUT_FAMILY) !== (item.split === 'held-out')) {
52
+ p(`the held-out split is exactly the '${HELD_OUT_FAMILY}' family; got family '${item.family}' in split '${item.split}'`);
53
+ }
54
+ if (item.premises.length === 0)
55
+ p('no premises');
56
+ if (item.source.trim() === '')
57
+ p('no source');
58
+ }
59
+ return problems;
60
+ }
61
+ /** Thrown when a benchmark directory holds an inadmissible item set. @internal */
62
+ export class BenchmarkAdmissionError extends Error {
63
+ problems;
64
+ constructor(problems) {
65
+ super(`benchmark items are not admissible: ${problems
66
+ .map((p) => `${p.id}: ${p.problem}`)
67
+ .join('; ')}`);
68
+ this.problems = problems;
69
+ }
70
+ }
71
+ function readItems(file) {
72
+ const parsed = JSON.parse(readFileSync(file, 'utf-8'));
73
+ if (!Array.isArray(parsed))
74
+ throw new Error(`${file}: expected a JSON array of items`);
75
+ return parsed;
76
+ }
77
+ /**
78
+ * Load the FROZEN items from `<benchmarkDir>/public/items.json`.
79
+ *
80
+ * @throws BenchmarkAdmissionError when any item is inadmissible — a frozen set
81
+ * with one contested draft in it is not a smaller benchmark, it is a broken one.
82
+ * @internal
83
+ */
84
+ export function loadFrozenItems(benchmarkDir) {
85
+ const items = readItems(join(benchmarkDir, 'public', 'items.json'));
86
+ const problems = validateItems(items, true);
87
+ if (problems.length > 0)
88
+ throw new BenchmarkAdmissionError(problems);
89
+ return items;
90
+ }
91
+ /**
92
+ * Load the CONTESTED drafts from `<benchmarkDir>/contested/items.json`. These are
93
+ * never scored; they wait for an independent author to accept or rewrite them.
94
+ *
95
+ * @internal
96
+ */
97
+ export function loadContestedDrafts(benchmarkDir) {
98
+ const items = readItems(join(benchmarkDir, 'contested', 'items.json'));
99
+ const problems = validateItems(items, false);
100
+ if (problems.length > 0)
101
+ throw new BenchmarkAdmissionError(problems);
102
+ return items;
103
+ }
104
+ //# sourceMappingURL=loader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loader.js","sourceRoot":"","sources":["../../../src/atlas/benchmark/loader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAS7C;;;;;;;;;GASG;AACH,MAAM,UAAU,aAAa,CAAC,KAA+B,EAAE,MAAe;IAC5E,MAAM,QAAQ,GAAkB,EAAE,CAAC;IACnC,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAC/B,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,CAAC,GAAG,CAAC,OAAe,EAAQ,EAAE;YAClC,QAAQ,CAAC,IAAI,CAAC,EAAE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* Atlas Phase 5, S5.2 — the ATLAS condition of the invalid-bridge benchmark.
3
+ *
4
+ * Design note: `docs/planning/Atlas-Phase-5-Design.md` §6.
5
+ *
6
+ * For each item the runner applies three atlas instruments — the applicability
7
+ * checker (S4.1), the composition table (S3) and the regime check (S2) — and
8
+ * emits `accept`, `reject` or `abstain`.
9
+ *
10
+ * ## The decision rule, and why accept is the HARDEST outcome to reach
11
+ *
12
+ * - **reject** when an instrument DEMONSTRABLY fires: a blocking applicability
13
+ * finding, a chain OVERCLAIMED as an exact equivalence, a structural analogy
14
+ * promoted to an equivalence, or a regime inequality checked and violated.
15
+ * - **accept** only when EVERY ENABLED instrument RAN and CLEARED: side conditions were
16
+ * stated, the applicability checker found nothing, the regime was supplied and
17
+ * every inequality was checked and held, and any claimed chain agrees with the
18
+ * table. At least one instrument must have RUN: an item that no enabled
19
+ * instrument applies to abstains, because nothing cleared it. S4.1 already fixed the principle: an empty finding list means "no rule
20
+ * fired", which is weaker than "valid". An item that leaves a check unrun has
21
+ * not been cleared by it.
22
+ * - **abstain** otherwise. Abstention is a first-class outcome and is preferred
23
+ * to a wrong accept (ROADMAP Phase 5, pre-stated criteria).
24
+ *
25
+ * The failure kind a rejection names is a MAPPING from the rule that fired, and
26
+ * it is only as good as that mapping: a dimensional inconsistency is reported as
27
+ * `notation-collision` because that is its commonest cause, not because the rule
28
+ * can see notation. The scorer grades "rejected" and "named the right kind"
29
+ * separately, so an imperfect mapping costs the second score only.
30
+ *
31
+ * @module atlas/benchmark/run-atlas
32
+ * @internal
33
+ */
34
+ import type { BenchmarkItem, FailureKind } from './types.js';
35
+ /** What the atlas condition concluded about one item. @internal */
36
+ export interface AtlasVerdict {
37
+ readonly itemId: string;
38
+ readonly outcome: 'accept' | 'reject' | 'abstain';
39
+ /** Present on a reject when the rule that fired maps to a failure kind. */
40
+ readonly detectedFailure?: FailureKind;
41
+ /** Every reason, in rule order — including the unrun checks behind an abstention. */
42
+ readonly reasons: readonly string[];
43
+ }
44
+ /**
45
+ * Which instruments a run uses — the S6.2 ablation. The four named
46
+ * configurations in {@link ABLATION_CONFIGS} are CUMULATIVE.
47
+ *
48
+ * @internal
49
+ */
50
+ export interface AtlasRunConfig {
51
+ /** The composition table over relation types. */
52
+ readonly types: boolean;
53
+ /** Side-condition rules: unguarded / zero divisors, squaring. */
54
+ readonly assumptions: boolean;
55
+ /** Dimensional consistency and convention agreement. */
56
+ readonly dimensionsAndConventions: boolean;
57
+ /** The regime check at the use site. */
58
+ readonly regimes: boolean;
59
+ }
60
+ /** Every instrument on: the atlas condition as scored. @internal */
61
+ export declare const FULL_CONFIG: AtlasRunConfig;
62
+ /** The four cumulative ablation configurations, in the plan's order. @internal */
63
+ export declare const ABLATION_CONFIGS: ReadonlyArray<readonly [string, AtlasRunConfig]>;
64
+ /**
65
+ * Run the atlas condition on one item. Pure and deterministic; never throws.
66
+ *
67
+ * @internal
68
+ */
69
+ export declare function runAtlasOnItem(item: BenchmarkItem, config?: AtlasRunConfig): AtlasVerdict;
70
+ /** Run the atlas condition over a set of items, in order. @internal */
71
+ export declare function runAtlasCondition(items: readonly BenchmarkItem[], config?: AtlasRunConfig): AtlasVerdict[];
72
+ //# sourceMappingURL=run-atlas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run-atlas.d.ts","sourceRoot":"","sources":["../../../src/atlas/benchmark/run-atlas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAOH,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE7D,mEAAmE;AACnE,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,OAAO,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAC;IAClD,2EAA2E;IAC3E,QAAQ,CAAC,eAAe,CAAC,EAAE,WAAW,CAAC;IACvC,qFAAqF;IACrF,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;CACrC;AAED;;;;;GAKG;AACH,MAAM,WAAW,cAAc;IAC7B,iDAAiD;IACjD,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,iEAAiE;IACjE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;IAC9B,wDAAwD;IACxD,QAAQ,CAAC,wBAAwB,EAAE,OAAO,CAAC;IAC3C,wCAAwC;IACxC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;CAC3B;AAED,oEAAoE;AACpE,eAAO,MAAM,WAAW,EAAE,cAKzB,CAAC;AAEF,kFAAkF;AAClF,eAAO,MAAM,gBAAgB,EAAE,aAAa,CAAC,SAAS,CAAC,MAAM,EAAE,cAAc,CAAC,CAK7E,CAAC;AA6CF;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,aAAa,EAAE,MAAM,GAAE,cAA4B,GAAG,YAAY,CAoHtG;AAED,uEAAuE;AACvE,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,SAAS,aAAa,EAAE,EAC/B,MAAM,GAAE,cAA4B,GACnC,YAAY,EAAE,CAEhB"}
@@ -0,0 +1,210 @@
1
+ /**
2
+ * Atlas Phase 5, S5.2 — the ATLAS condition of the invalid-bridge benchmark.
3
+ *
4
+ * Design note: `docs/planning/Atlas-Phase-5-Design.md` §6.
5
+ *
6
+ * For each item the runner applies three atlas instruments — the applicability
7
+ * checker (S4.1), the composition table (S3) and the regime check (S2) — and
8
+ * emits `accept`, `reject` or `abstain`.
9
+ *
10
+ * ## The decision rule, and why accept is the HARDEST outcome to reach
11
+ *
12
+ * - **reject** when an instrument DEMONSTRABLY fires: a blocking applicability
13
+ * finding, a chain OVERCLAIMED as an exact equivalence, a structural analogy
14
+ * promoted to an equivalence, or a regime inequality checked and violated.
15
+ * - **accept** only when EVERY ENABLED instrument RAN and CLEARED: side conditions were
16
+ * stated, the applicability checker found nothing, the regime was supplied and
17
+ * every inequality was checked and held, and any claimed chain agrees with the
18
+ * table. At least one instrument must have RUN: an item that no enabled
19
+ * instrument applies to abstains, because nothing cleared it. S4.1 already fixed the principle: an empty finding list means "no rule
20
+ * fired", which is weaker than "valid". An item that leaves a check unrun has
21
+ * not been cleared by it.
22
+ * - **abstain** otherwise. Abstention is a first-class outcome and is preferred
23
+ * to a wrong accept (ROADMAP Phase 5, pre-stated criteria).
24
+ *
25
+ * The failure kind a rejection names is a MAPPING from the rule that fired, and
26
+ * it is only as good as that mapping: a dimensional inconsistency is reported as
27
+ * `notation-collision` because that is its commonest cause, not because the rule
28
+ * can see notation. The scorer grades "rejected" and "named the right kind"
29
+ * separately, so an imperfect mapping costs the second score only.
30
+ *
31
+ * @module atlas/benchmark/run-atlas
32
+ * @internal
33
+ */
34
+ import { checkApplicability } from '../applicability.js';
35
+ import { composeRelation, NO_COMPOSITE_CLAIM } from '../composition-table.js';
36
+ import { regimeHolds } from '../regime.js';
37
+ /** Every instrument on: the atlas condition as scored. @internal */
38
+ export const FULL_CONFIG = {
39
+ types: true,
40
+ assumptions: true,
41
+ dimensionsAndConventions: true,
42
+ regimes: true,
43
+ };
44
+ /** The four cumulative ablation configurations, in the plan's order. @internal */
45
+ export const ABLATION_CONFIGS = [
46
+ ['types only', { types: true, assumptions: false, dimensionsAndConventions: false, regimes: false }],
47
+ ['+ assumptions', { types: true, assumptions: true, dimensionsAndConventions: false, regimes: false }],
48
+ ['+ dimensions & conventions', { types: true, assumptions: true, dimensionsAndConventions: true, regimes: false }],
49
+ ['+ regimes', FULL_CONFIG],
50
+ ];
51
+ /** The instrument each applicability finding belongs to. */
52
+ const FINDING_INSTRUMENT = {
53
+ 'dimensional-inconsistency': 'dimensionsAndConventions',
54
+ 'convention-mismatch': 'dimensionsAndConventions',
55
+ 'convention-undeclared': 'dimensionsAndConventions',
56
+ 'division-unguarded': 'assumptions',
57
+ 'division-by-zero': 'assumptions',
58
+ 'squaring-adds-solutions': 'assumptions',
59
+ 'model-incompatibility': 'models',
60
+ };
61
+ /** Which failure kind a BLOCKING applicability finding points to. */
62
+ const FINDING_TO_FAILURE = {
63
+ 'dimensional-inconsistency': 'notation-collision',
64
+ 'convention-mismatch': 'convention-mismatch',
65
+ 'division-by-zero': 'domain-violation',
66
+ };
67
+ /** Relations that assert more than an analogy can carry. */
68
+ const STRONG = new Set(['exact-equivalence', 'derivation']);
69
+ /**
70
+ * The failure kind an OVERCLAIMED chain points to: a chain claimed as an exact
71
+ * equivalence that the table composes to something weaker.
72
+ *
73
+ * - through a restriction ⇒ the restriction's condition was dropped:
74
+ * `omitted-premise`;
75
+ * - to a derivation or a coarse-graining ⇒ the claim asserts an inverse the
76
+ * one-way step does not have: `false-inverse`.
77
+ */
78
+ function overclaimFailure(chain) {
79
+ return chain.includes('restriction') ? 'omitted-premise' : 'false-inverse';
80
+ }
81
+ /**
82
+ * Whether `claimed` follows from `composed`. The table's own non-declined
83
+ * results are exact-equivalence, derivation, restriction and coarse-graining;
84
+ * of these only exact-equivalence ⇒ derivation is an implication this module
85
+ * asserts. Anything else unequal is "not shown", never "shown".
86
+ */
87
+ const implies = (composed, claimed) => composed === claimed || (composed === 'exact-equivalence' && claimed === 'derivation');
88
+ /**
89
+ * Run the atlas condition on one item. Pure and deterministic; never throws.
90
+ *
91
+ * @internal
92
+ */
93
+ export function runAtlasOnItem(item, config = FULL_CONFIG) {
94
+ const reasons = [];
95
+ let rejectKind;
96
+ let rejected = false;
97
+ const reject = (reason, kind) => {
98
+ reasons.push(`REJECT: ${reason}`);
99
+ if (!rejected)
100
+ rejectKind = kind;
101
+ rejected = true;
102
+ };
103
+ let allRanAndCleared = true;
104
+ // An accept needs at least one instrument that actually RAN. Without this,
105
+ // an item no enabled instrument applies to is accepted with nothing checked.
106
+ let ranAny = false;
107
+ const unrun = (reason) => {
108
+ reasons.push(`UNRUN: ${reason}`);
109
+ allRanAndCleared = false;
110
+ };
111
+ // 1. Applicability — split by instrument so the ablation can switch each off.
112
+ const applicabilityOn = config.assumptions || config.dimensionsAndConventions;
113
+ if (!applicabilityOn) {
114
+ // Instrument disabled: neither run nor required.
115
+ }
116
+ else if (item.sideConditions === undefined) {
117
+ unrun('no side conditions stated, so the applicability checker has nothing to check against');
118
+ }
119
+ else {
120
+ ranAny = true;
121
+ const findings = checkApplicability({
122
+ ast: item.expr,
123
+ sideConditions: item.sideConditions,
124
+ ...(item.conventions?.premise === undefined ? {} : { premiseConventions: item.conventions.premise }),
125
+ ...(item.conventions?.conclusion === undefined
126
+ ? {}
127
+ : { conclusionConventions: item.conventions.conclusion }),
128
+ });
129
+ for (const f of findings) {
130
+ const instrument = FINDING_INSTRUMENT[f.kind];
131
+ if (instrument === 'assumptions' && !config.assumptions)
132
+ continue;
133
+ if (instrument === 'dimensionsAndConventions' && !config.dimensionsAndConventions)
134
+ continue;
135
+ if (f.severity === 'blocking')
136
+ reject(`${f.kind}: ${f.detail}`, FINDING_TO_FAILURE[f.kind]);
137
+ else {
138
+ reasons.push(`QUESTION: ${f.kind}: ${f.detail}`);
139
+ allRanAndCleared = false;
140
+ }
141
+ }
142
+ }
143
+ // 2. Composition. Only for items that claim a chain.
144
+ if (config.types && item.composedFrom !== undefined) {
145
+ ranAny = true;
146
+ const [first, second] = item.composedFrom;
147
+ const composed = composeRelation(first, second);
148
+ if (item.composedFrom.includes('structural-analogy') && STRONG.has(item.claimedRelation)) {
149
+ reject(`a chain through structural-analogy is claimed as ${item.claimedRelation}`, 'analogy-promoted');
150
+ }
151
+ else if (composed === NO_COMPOSITE_CLAIM) {
152
+ reasons.push(`QUESTION: the table declines to compose ${first} ∘ ${second}`);
153
+ allRanAndCleared = false;
154
+ }
155
+ else if (implies(composed, item.claimedRelation)) {
156
+ reasons.push(`CLEARED: ${first} ∘ ${second} composes to ${composed}, which gives ${item.claimedRelation}`);
157
+ }
158
+ else if (item.claimedRelation === 'exact-equivalence') {
159
+ reject(`${first} ∘ ${second} composes only to ${composed}; the exact equivalence is overclaimed`, overclaimFailure(item.composedFrom));
160
+ }
161
+ else {
162
+ reasons.push(`QUESTION: ${first} ∘ ${second} composes to ${composed}; the table does not show ${item.claimedRelation}`);
163
+ allRanAndCleared = false;
164
+ }
165
+ }
166
+ // 3. Regime.
167
+ if (!config.regimes) {
168
+ // Instrument disabled: neither run nor required.
169
+ }
170
+ else if (item.regime === undefined) {
171
+ unrun('no regime supplied, so the use site was never checked against a domain');
172
+ }
173
+ else {
174
+ ranAny = true;
175
+ const check = regimeHolds({ family: item.family, inequalities: item.regime.inequalities, groupDefinitions: {} }, item.regime.values);
176
+ if (check.ok === false) {
177
+ reject(`regime violated: ${check.violated.map((i) => `${i.group} ${i.op} ${i.bound}`).join(', ')}`, 'domain-violation');
178
+ }
179
+ else if (check.ok === 'unknown') {
180
+ unrun(`regime unchecked for ${check.unchecked.map((i) => i.group).join(', ')}`);
181
+ }
182
+ else if (item.regime.inequalities.length === 0) {
183
+ // regimeHolds returns true for an empty list; that is "nothing to check",
184
+ // not "checked and held" — the silent pass RegimeCheck warns about.
185
+ unrun('the regime states no inequality, so nothing was checked');
186
+ }
187
+ }
188
+ if (rejected) {
189
+ return {
190
+ itemId: item.id,
191
+ outcome: 'reject',
192
+ ...(rejectKind === undefined ? {} : { detectedFailure: rejectKind }),
193
+ reasons,
194
+ };
195
+ }
196
+ if (allRanAndCleared && !ranAny) {
197
+ reasons.push('UNRUN: no enabled instrument applies to this item, so nothing was checked');
198
+ return { itemId: item.id, outcome: 'abstain', reasons };
199
+ }
200
+ if (allRanAndCleared) {
201
+ reasons.push('ACCEPT: every instrument ran and cleared');
202
+ return { itemId: item.id, outcome: 'accept', reasons };
203
+ }
204
+ return { itemId: item.id, outcome: 'abstain', reasons };
205
+ }
206
+ /** Run the atlas condition over a set of items, in order. @internal */
207
+ export function runAtlasCondition(items, config = FULL_CONFIG) {
208
+ return items.map((item) => runAtlasOnItem(item, config));
209
+ }
210
+ //# sourceMappingURL=run-atlas.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run-atlas.js","sourceRoot":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yDAAyD,CAAC,CAAC;QACnE,CAAC;IACH,CAAC;IAED,IAAI,QAAQ,EAAE,CAAC;QACb,OAAO;YACL,MAAM,EAAE,IAAI,CAAC,EAAE;YACf,OAAO,EAAE,QAAQ;YACjB,GAAG,CAAC,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,eAAe,EAAE,UAAU,EAAE,CAAC;YACpE,OAAO;SACR,CAAC;IACJ,CAAC;IACD,IAAI,gBAAgB,IAAI,CAAC,MAAM,EAAE,CAAC;QAChC,OAAO,CAAC,IAAI,CAAC,2EAA2E,CAAC,CAAC;QAC1F,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC;IAC1D,CAAC;IACD,IAAI,gBAAgB,EAAE,CAAC;QACrB,OAAO,CAAC,IAAI,CAAC,0CAA0C,CAAC,CAAC;QACzD,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC;IACzD,CAAC;IACD,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC;AAC1D,CAAC;AAED,uEAAuE;AACvE,MAAM,UAAU,iBAAiB,CAC/B,KAA+B,EAC/B,MAAM,GAAmB,WAAW;IAEpC,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,cAAc,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;AAC3D,CAAC"}
@@ -0,0 +1,90 @@
1
+ /**
2
+ * Atlas Phase 5, S5.4 — the benchmark's statistics and power report.
3
+ *
4
+ * Design note: `docs/planning/Atlas-Phase-5-Design.md` §8.
5
+ *
6
+ * Every function here is tested against a value computed independently, not
7
+ * against its own output: the Wilson intervals against the plan's textbook
8
+ * values, McNemar against a hand-computed 2×2 table, and κ against a hand-computed
9
+ * confusion matrix. The paired-difference interval (Newcombe's method 10) has no
10
+ * textbook value in the repository; it is tested by properties that pin it to
11
+ * Wilson and to the unpaired square-and-add interval where those must agree.
12
+ *
13
+ * @module atlas/benchmark/stats
14
+ * @internal
15
+ */
16
+ /** The two-sided 95% normal quantile. @internal */
17
+ export declare const Z95 = 1.959963984540054;
18
+ /** A closed interval. @internal */
19
+ export interface Interval {
20
+ readonly lower: number;
21
+ readonly upper: number;
22
+ }
23
+ /**
24
+ * Wilson score interval for a binomial proportion.
25
+ *
26
+ * @throws Error when `n` is not a positive integer or `successes` is outside `[0, n]`.
27
+ * @internal
28
+ */
29
+ export declare function wilsonInterval(successes: number, n: number, z?: number): Interval;
30
+ /** A paired 2×2 table: a = both right, b = only A right, c = only B right, d = both wrong. @internal */
31
+ export interface PairedTable {
32
+ readonly a: number;
33
+ readonly b: number;
34
+ readonly c: number;
35
+ readonly d: number;
36
+ }
37
+ /** McNemar's test on the discordant cells. @internal */
38
+ export interface McNemarResult {
39
+ /** Continuity-corrected χ² = (|b − c| − 1)² / (b + c); 0 when b + c = 0. */
40
+ readonly chiSquared: number;
41
+ /** Exact two-sided p-value from Binomial(b + c, ½); 1 when b + c = 0. */
42
+ readonly exactP: number;
43
+ }
44
+ /**
45
+ * McNemar's paired test. The EXACT binomial p-value is the one to report at
46
+ * these sample sizes; the χ² is given because readers expect it.
47
+ *
48
+ * @internal
49
+ */
50
+ export declare function mcnemar(table: PairedTable): McNemarResult;
51
+ /**
52
+ * Newcombe's method 10: a 95% interval for the PAIRED difference in proportions
53
+ * p_A − p_B = (b − c)/n, built from the two marginal Wilson intervals and a
54
+ * correlation correction φ. Pre-registered criterion: the interval for the
55
+ * atlas-minus-baseline difference must exclude zero.
56
+ *
57
+ * Newcombe, Statistics in Medicine 17 (1998) 2635.
58
+ *
59
+ * @internal
60
+ */
61
+ export declare function pairedDifferenceInterval(table: PairedTable, z?: number): Interval & {
62
+ readonly diff: number;
63
+ };
64
+ /**
65
+ * Cohen's κ for two raters over the same items, from a square confusion matrix
66
+ * (`matrix[i][j]` = items rater 1 put in category i and rater 2 in category j).
67
+ *
68
+ * @returns NaN when chance agreement is 1 (κ is undefined there), never 1.
69
+ * @internal
70
+ */
71
+ export declare function cohensKappa(matrix: readonly (readonly number[])[]): number;
72
+ /** What a frozen set of a given size can and cannot resolve. @internal */
73
+ export interface PowerReport {
74
+ readonly nPerClass: number;
75
+ /** The assumed per-class accuracy the interval is computed at. */
76
+ readonly assumedAccuracy: number;
77
+ readonly interval: Interval;
78
+ /** Half the interval width: differences smaller than about twice this are not resolvable. */
79
+ readonly halfWidth: number;
80
+ readonly statement: string;
81
+ }
82
+ /**
83
+ * The interval a frozen set of `nPerClass` items per class can afford at an
84
+ * assumed accuracy. This is the "report the interval it can afford rather than
85
+ * the claim it cannot" line of ROADMAP Phase 5.
86
+ *
87
+ * @internal
88
+ */
89
+ export declare function powerReport(nPerClass: number, assumedAccuracy?: number): PowerReport;
90
+ //# sourceMappingURL=stats.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stats.d.ts","sourceRoot":"","sources":["../../../src/atlas/benchmark/stats.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,mDAAmD;AACnD,eAAO,MAAM,GAAG,oBAAoB,CAAC;AAErC,mCAAmC;AACnC,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,SAAM,GAAG,QAAQ,CAgB9E;AAED,wGAAwG;AACxG,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,CAAC,EAAE,MAAM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