universal-physics-tensor 11.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 (287) hide show
  1. package/README.md +36 -34
  2. package/data/applied-cases.json +1892 -0
  3. package/data/applied-cases.schema.json +194 -0
  4. package/data/atlas/atlas.json +21 -21
  5. package/data/atlas/atlas.jsonld +1 -1
  6. package/data/atlas/diffusion.json +5 -5
  7. package/data/atlas/oscillators.json +7 -7
  8. package/data/atlas/waves.json +11 -11
  9. package/data/bridge-catalog.json +20 -4
  10. package/data/units.json +6 -25
  11. package/dist/atlas/benchmark/stats.d.ts.map +1 -1
  12. package/dist/atlas/benchmark/stats.js +6 -20
  13. package/dist/atlas/benchmark/stats.js.map +1 -1
  14. package/dist/atlas/physjs-entries.generated.d.ts +13 -4
  15. package/dist/atlas/physjs-entries.generated.d.ts.map +1 -1
  16. package/dist/atlas/physjs-entries.generated.js +15 -4
  17. package/dist/atlas/physjs-entries.generated.js.map +1 -1
  18. package/dist/atlas/physjs-reviewed.js +2 -2
  19. package/dist/atlas/physjs-reviewed.js.map +1 -1
  20. package/dist/cases/catalog-checks.d.ts +10 -0
  21. package/dist/cases/catalog-checks.d.ts.map +1 -0
  22. package/dist/cases/catalog-checks.js +241 -0
  23. package/dist/cases/catalog-checks.js.map +1 -0
  24. package/dist/cases/catalog.d.ts +83 -0
  25. package/dist/cases/catalog.d.ts.map +1 -0
  26. package/dist/cases/catalog.js +118 -0
  27. package/dist/cases/catalog.js.map +1 -0
  28. package/dist/cases/engine.d.ts +13 -0
  29. package/dist/cases/engine.d.ts.map +1 -0
  30. package/dist/cases/engine.js +179 -0
  31. package/dist/cases/engine.js.map +1 -0
  32. package/dist/cases/index.d.ts.map +1 -1
  33. package/dist/cases/index.js +5 -7
  34. package/dist/cases/index.js.map +1 -1
  35. package/dist/cases/methods.d.ts +215 -0
  36. package/dist/cases/methods.d.ts.map +1 -0
  37. package/dist/cases/methods.js +743 -0
  38. package/dist/cases/methods.js.map +1 -0
  39. package/dist/cases/types.d.ts +12 -0
  40. package/dist/cases/types.d.ts.map +1 -1
  41. package/dist/cases/types.js.map +1 -1
  42. package/dist/cli/args.d.ts +2 -0
  43. package/dist/cli/args.d.ts.map +1 -1
  44. package/dist/cli/args.js.map +1 -1
  45. package/dist/cli/command.d.ts +3 -0
  46. package/dist/cli/command.d.ts.map +1 -1
  47. package/dist/cli/command.js.map +1 -1
  48. package/dist/cli/commands/_discovery-opts.d.ts +1 -0
  49. package/dist/cli/commands/_discovery-opts.d.ts.map +1 -1
  50. package/dist/cli/commands/_discovery-opts.js +1 -0
  51. package/dist/cli/commands/_discovery-opts.js.map +1 -1
  52. package/dist/cli/commands/discover.d.ts.map +1 -1
  53. package/dist/cli/commands/discover.js +116 -71
  54. package/dist/cli/commands/discover.js.map +1 -1
  55. package/dist/cli/commands/evaluate.js +2 -2
  56. package/dist/cli/commands/evaluate.js.map +1 -1
  57. package/dist/cli/commands/explain.d.ts.map +1 -1
  58. package/dist/cli/commands/explain.js +22 -2
  59. package/dist/cli/commands/explain.js.map +1 -1
  60. package/dist/cli/commands/ground.d.ts.map +1 -1
  61. package/dist/cli/commands/ground.js +6 -1
  62. package/dist/cli/commands/ground.js.map +1 -1
  63. package/dist/cli/commands/map.d.ts.map +1 -1
  64. package/dist/cli/commands/map.js +9 -6
  65. package/dist/cli/commands/map.js.map +1 -1
  66. package/dist/cli/determination.d.ts +1 -0
  67. package/dist/cli/determination.d.ts.map +1 -1
  68. package/dist/cli/determination.js.map +1 -1
  69. package/dist/cli/flag-help.d.ts +1 -0
  70. package/dist/cli/flag-help.d.ts.map +1 -1
  71. package/dist/cli/flag-help.js +1 -0
  72. package/dist/cli/flag-help.js.map +1 -1
  73. package/dist/cli/graphs.d.ts +2 -0
  74. package/dist/cli/graphs.d.ts.map +1 -1
  75. package/dist/cli/graphs.js +1 -0
  76. package/dist/cli/graphs.js.map +1 -1
  77. package/dist/cli/main.d.ts +1 -0
  78. package/dist/cli/main.d.ts.map +1 -1
  79. package/dist/cli/main.js +1 -0
  80. package/dist/cli/main.js.map +1 -1
  81. package/dist/cli/output.d.ts +8 -0
  82. package/dist/cli/output.d.ts.map +1 -1
  83. package/dist/cli/output.js +8 -0
  84. package/dist/cli/output.js.map +1 -1
  85. package/dist/cli/statuses.d.ts.map +1 -1
  86. package/dist/cli/statuses.js +12 -2
  87. package/dist/cli/statuses.js.map +1 -1
  88. package/dist/cli/version.d.ts +1 -0
  89. package/dist/cli/version.d.ts.map +1 -1
  90. package/dist/cli/version.js +1 -0
  91. package/dist/cli/version.js.map +1 -1
  92. package/dist/cli-api.d.ts +2 -0
  93. package/dist/cli-api.d.ts.map +1 -1
  94. package/dist/cli-api.js +2 -0
  95. package/dist/cli-api.js.map +1 -1
  96. package/dist/composition/canonical-graph.d.ts +2 -2
  97. package/dist/composition/canonical-graph.js +2 -2
  98. package/dist/composition/canonical-graph.js.map +1 -1
  99. package/dist/composition/consequence.d.ts +15 -5
  100. package/dist/composition/consequence.d.ts.map +1 -1
  101. package/dist/composition/consequence.js +6 -4
  102. package/dist/composition/consequence.js.map +1 -1
  103. package/dist/composition/discovery.d.ts +78 -14
  104. package/dist/composition/discovery.d.ts.map +1 -1
  105. package/dist/composition/discovery.js +73 -23
  106. package/dist/composition/discovery.js.map +1 -1
  107. package/dist/composition/expr-eval.d.ts +1 -1
  108. package/dist/composition/expr-eval.d.ts.map +1 -1
  109. package/dist/composition/expr-eval.js +4 -4
  110. package/dist/composition/expr-eval.js.map +1 -1
  111. package/dist/composition/expr-simplify.d.ts +10 -14
  112. package/dist/composition/expr-simplify.d.ts.map +1 -1
  113. package/dist/composition/expr-simplify.js +49 -52
  114. package/dist/composition/expr-simplify.js.map +1 -1
  115. package/dist/composition/grounding.d.ts.map +1 -1
  116. package/dist/composition/grounding.js +19 -7
  117. package/dist/composition/grounding.js.map +1 -1
  118. package/dist/composition/mathts-quiet.d.ts +4 -6
  119. package/dist/composition/mathts-quiet.d.ts.map +1 -1
  120. package/dist/composition/mathts-quiet.js +4 -14
  121. package/dist/composition/mathts-quiet.js.map +1 -1
  122. package/dist/composition/own-equation-magnitude.d.ts +95 -0
  123. package/dist/composition/own-equation-magnitude.d.ts.map +1 -0
  124. package/dist/composition/own-equation-magnitude.js +270 -0
  125. package/dist/composition/own-equation-magnitude.js.map +1 -0
  126. package/dist/composition/probe/backend-protocol.d.ts +3 -0
  127. package/dist/composition/probe/backend-protocol.d.ts.map +1 -1
  128. package/dist/composition/probe/backend-protocol.js.map +1 -1
  129. package/dist/composition/probe/candidate-store.d.ts +1 -0
  130. package/dist/composition/probe/candidate-store.d.ts.map +1 -1
  131. package/dist/composition/probe/candidate-store.js +1 -0
  132. package/dist/composition/probe/candidate-store.js.map +1 -1
  133. package/dist/composition/probe/corpus.d.ts +4 -2
  134. package/dist/composition/probe/corpus.d.ts.map +1 -1
  135. package/dist/composition/probe/corpus.js +3 -3
  136. package/dist/composition/probe/corpus.js.map +1 -1
  137. package/dist/composition/probe/dataset.d.ts +1 -0
  138. package/dist/composition/probe/dataset.d.ts.map +1 -1
  139. package/dist/composition/probe/dataset.js.map +1 -1
  140. package/dist/composition/probe/experiment-design.d.ts +2 -0
  141. package/dist/composition/probe/experiment-design.d.ts.map +1 -1
  142. package/dist/composition/probe/experiment-design.js.map +1 -1
  143. package/dist/composition/probe/falsify.d.ts +2 -0
  144. package/dist/composition/probe/falsify.d.ts.map +1 -1
  145. package/dist/composition/probe/falsify.js.map +1 -1
  146. package/dist/composition/probe/fit.d.ts +1 -0
  147. package/dist/composition/probe/fit.d.ts.map +1 -1
  148. package/dist/composition/probe/fit.js.map +1 -1
  149. package/dist/composition/probe/generator.d.ts +3 -0
  150. package/dist/composition/probe/generator.d.ts.map +1 -1
  151. package/dist/composition/probe/generator.js +5 -6
  152. package/dist/composition/probe/generator.js.map +1 -1
  153. package/dist/composition/probe/limits.d.ts +1 -0
  154. package/dist/composition/probe/limits.d.ts.map +1 -1
  155. package/dist/composition/probe/limits.js.map +1 -1
  156. package/dist/composition/probe/pipeline.d.ts +5 -0
  157. package/dist/composition/probe/pipeline.d.ts.map +1 -1
  158. package/dist/composition/probe/pipeline.js +64 -21
  159. package/dist/composition/probe/pipeline.js.map +1 -1
  160. package/dist/composition/probe/power-law.d.ts.map +1 -1
  161. package/dist/composition/probe/power-law.js +3 -7
  162. package/dist/composition/probe/power-law.js.map +1 -1
  163. package/dist/composition/probe/problem.d.ts +1 -0
  164. package/dist/composition/probe/problem.d.ts.map +1 -1
  165. package/dist/composition/probe/problem.js.map +1 -1
  166. package/dist/composition/probe/residual.d.ts +1 -0
  167. package/dist/composition/probe/residual.d.ts.map +1 -1
  168. package/dist/composition/probe/residual.js +1 -0
  169. package/dist/composition/probe/residual.js.map +1 -1
  170. package/dist/composition/probe/run-manifest.d.ts +1 -0
  171. package/dist/composition/probe/run-manifest.d.ts.map +1 -1
  172. package/dist/composition/probe/run-manifest.js.map +1 -1
  173. package/dist/composition/probe/scalar-search.d.ts +50 -0
  174. package/dist/composition/probe/scalar-search.d.ts.map +1 -0
  175. package/dist/composition/probe/scalar-search.js +169 -0
  176. package/dist/composition/probe/scalar-search.js.map +1 -0
  177. package/dist/composition/probe/scoring.d.ts +1 -0
  178. package/dist/composition/probe/scoring.d.ts.map +1 -1
  179. package/dist/composition/probe/scoring.js.map +1 -1
  180. package/dist/composition/probe/study.d.ts +2 -2
  181. package/dist/composition/probe/study.d.ts.map +1 -1
  182. package/dist/composition/probe/study.js +6 -10
  183. package/dist/composition/probe/study.js.map +1 -1
  184. package/dist/composition/probe/t-tail.d.ts +3 -4
  185. package/dist/composition/probe/t-tail.d.ts.map +1 -1
  186. package/dist/composition/probe/t-tail.js +7 -10
  187. package/dist/composition/probe/t-tail.js.map +1 -1
  188. package/dist/composition/proposed-bridges.d.ts +11 -2
  189. package/dist/composition/proposed-bridges.d.ts.map +1 -1
  190. package/dist/composition/proposed-bridges.js +7 -5
  191. package/dist/composition/proposed-bridges.js.map +1 -1
  192. package/dist/composition/rational-exponent.d.ts +2 -2
  193. package/dist/composition/rational-exponent.d.ts.map +1 -1
  194. package/dist/composition/rational-exponent.js +4 -4
  195. package/dist/composition/rational-exponent.js.map +1 -1
  196. package/dist/composition/representative-values.d.ts.map +1 -1
  197. package/dist/composition/representative-values.js +6 -0
  198. package/dist/composition/representative-values.js.map +1 -1
  199. package/dist/composition/retrodiction.d.ts +15 -0
  200. package/dist/composition/retrodiction.d.ts.map +1 -1
  201. package/dist/composition/retrodiction.js +10 -3
  202. package/dist/composition/retrodiction.js.map +1 -1
  203. package/dist/composition/user-equation.d.ts +1 -0
  204. package/dist/composition/user-equation.d.ts.map +1 -1
  205. package/dist/composition/user-equation.js +1 -0
  206. package/dist/composition/user-equation.js.map +1 -1
  207. package/dist/core/constants.d.ts +12 -11
  208. package/dist/core/constants.d.ts.map +1 -1
  209. package/dist/core/constants.js +24 -21
  210. package/dist/core/constants.js.map +1 -1
  211. package/dist/diff/bridge-ast-gradient.d.ts +27 -23
  212. package/dist/diff/bridge-ast-gradient.d.ts.map +1 -1
  213. package/dist/diff/bridge-ast-gradient.js +75 -173
  214. package/dist/diff/bridge-ast-gradient.js.map +1 -1
  215. package/dist/dimensional/ast-types.d.ts +15 -0
  216. package/dist/dimensional/ast-types.d.ts.map +1 -1
  217. package/dist/dimensional/ast-types.js.map +1 -1
  218. package/dist/dimensional/curvature-composite.d.ts +1 -1
  219. package/dist/dimensional/curvature-composite.js.map +1 -1
  220. package/dist/dimensional/exact-scale.d.ts +41 -11
  221. package/dist/dimensional/exact-scale.d.ts.map +1 -1
  222. package/dist/dimensional/exact-scale.js +115 -123
  223. package/dist/dimensional/exact-scale.js.map +1 -1
  224. package/dist/dimensional/mathts-unit-delegation.d.ts +29 -0
  225. package/dist/dimensional/mathts-unit-delegation.d.ts.map +1 -0
  226. package/dist/dimensional/mathts-unit-delegation.js +187 -0
  227. package/dist/dimensional/mathts-unit-delegation.js.map +1 -0
  228. package/dist/dimensional/mathts-unit-wrapper.d.ts +33 -0
  229. package/dist/dimensional/mathts-unit-wrapper.d.ts.map +1 -0
  230. package/dist/dimensional/mathts-unit-wrapper.js +190 -0
  231. package/dist/dimensional/mathts-unit-wrapper.js.map +1 -0
  232. package/dist/dimensional/scalar-lowering.d.ts +21 -0
  233. package/dist/dimensional/scalar-lowering.d.ts.map +1 -0
  234. package/dist/dimensional/scalar-lowering.js +45 -0
  235. package/dist/dimensional/scalar-lowering.js.map +1 -0
  236. package/dist/dimensional/unit-data.d.ts +5 -1
  237. package/dist/dimensional/unit-data.d.ts.map +1 -1
  238. package/dist/dimensional/unit-data.js +28 -4
  239. package/dist/dimensional/unit-data.js.map +1 -1
  240. package/dist/dimensional/units.d.ts +2 -0
  241. package/dist/dimensional/units.d.ts.map +1 -1
  242. package/dist/dimensional/units.js +59 -3
  243. package/dist/dimensional/units.js.map +1 -1
  244. package/dist/dimensional/validator.d.ts +2 -0
  245. package/dist/dimensional/validator.d.ts.map +1 -1
  246. package/dist/dimensional/validator.js.map +1 -1
  247. package/dist/index.js.map +1 -1
  248. package/dist/numerical/connection-lowering-helpers.d.ts +3 -1
  249. package/dist/numerical/connection-lowering-helpers.d.ts.map +1 -1
  250. package/dist/numerical/connection-lowering-helpers.js +11 -15
  251. package/dist/numerical/connection-lowering-helpers.js.map +1 -1
  252. package/dist/numerical/pderiv.d.ts.map +1 -1
  253. package/dist/numerical/pderiv.js +2 -6
  254. package/dist/numerical/pderiv.js.map +1 -1
  255. package/dist/numerical/quadrature.js +3 -3
  256. package/dist/numerical/quadrature.js.map +1 -1
  257. package/dist/numerical/statistics.js +1 -1
  258. package/dist/numerical/statistics.js.map +1 -1
  259. package/dist/numerical/strides.d.ts +3 -2
  260. package/dist/numerical/strides.d.ts.map +1 -1
  261. package/dist/numerical/strides.js +3 -10
  262. package/dist/numerical/strides.js.map +1 -1
  263. package/package.json +9 -12
  264. package/dist/cases/brownian-sphere.d.ts +0 -68
  265. package/dist/cases/brownian-sphere.d.ts.map +0 -1
  266. package/dist/cases/brownian-sphere.js +0 -355
  267. package/dist/cases/brownian-sphere.js.map +0 -1
  268. package/dist/cases/damped-resonator.d.ts +0 -23
  269. package/dist/cases/damped-resonator.d.ts.map +0 -1
  270. package/dist/cases/damped-resonator.js +0 -221
  271. package/dist/cases/damped-resonator.js.map +0 -1
  272. package/dist/cases/kepler-rv.d.ts +0 -13
  273. package/dist/cases/kepler-rv.d.ts.map +0 -1
  274. package/dist/cases/kepler-rv.js +0 -173
  275. package/dist/cases/kepler-rv.js.map +0 -1
  276. package/dist/cases/lumped-cooling.d.ts +0 -51
  277. package/dist/cases/lumped-cooling.d.ts.map +0 -1
  278. package/dist/cases/lumped-cooling.js +0 -259
  279. package/dist/cases/lumped-cooling.js.map +0 -1
  280. package/dist/cases/resistor-noise.d.ts +0 -14
  281. package/dist/cases/resistor-noise.d.ts.map +0 -1
  282. package/dist/cases/resistor-noise.js +0 -215
  283. package/dist/cases/resistor-noise.js.map +0 -1
  284. package/dist/cases/skin-depth.d.ts +0 -17
  285. package/dist/cases/skin-depth.d.ts.map +0 -1
  286. package/dist/cases/skin-depth.js +0 -170
  287. package/dist/cases/skin-depth.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"canonical-graph.js","sourceRoot":"","sources":["../../src/composition/canonical-graph.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+DG;AAEH,OAAO,EAAE,cAAc,EAAwC,MAAM,WAAW,CAAC;AAEjF,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,oBAAoB,EAAE,eAAe,EAAE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C,UAAU,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE;QACnC,GAAG,CAAC,EAAE,CAAC,eAAe,KAAK,aAAa,IAAI,kBAAkB,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,SAAS;YACjF,CAAC,CAAC,EAAE,gBAAgB,EAAE,IAAa,EAAE;YACrC,CAAC,CAAC,EAAE,CAAC;QACP,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,cAAc,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACvE,GAAG,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACjD,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAC9B,SAAS,GAAiC,mBAAmB;IAE7D,OAAO,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AAC/B,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,MAAM,eAAe,GAA0B,gBAAgB,EAAE,CAAC","sourcesContent":["/**\n * Canonical-only graph — project the standard-physics L-layer\n * (`CANONICAL_EQUATIONS`) into the composition-graph edge vocabulary so the\n * discovery/analysis funnel (`upt discover` / `candidates` / `map`) can run on\n * established textbook physics ALONE, with the speculative bridge catalog\n * excluded.\n *\n * WHY this exists: `CATALOG_GRAPH` mixes established bridges with speculative\n * ones (the counts per status are NOTES.md's), so a `promising` discovery\n * there is polluted by speculation. Feeding ONLY canonical equations gives (a) a new-candidate\n * review surface motivated by textbook physics, and (b) a regression harness —\n * discovery on canonical-only must introduce no numerical contradiction\n * (standard physics, fed to the inference suite, stays self-consistent).\n *\n * DESIGN — parity with the bridge graph:\n * - Universal constants (G, c, ℏ, k_B, ε₀, σ_sb, b, e) are BAKED INTO the\n * evaluator, exactly as the catalog edges bake them — they are not graph\n * nodes. This keeps the candidate proposer about physical OBSERVABLES and\n * lets the numeric filter fire from the standard `{ mass }` anchor (an\n * anchor cannot supply G/c/ℏ). A `governing` entry is a constant iff its\n * name is registered in `CANONICAL_CONSTANT_SI`; everything else is a\n * physical variable and becomes a source/target node.\n * - Every canonical equation is `established` physics, so every edge is\n * `confidence: 'established'` — the canonical graph IS the anchored core.\n * - `kind: 'law'` (within-domain ground truth, not a cross-regime bridge);\n * `beId: null` (not a catalog bridge). **Annotation-correctness note:**\n * `toEdge` hardcodes `kind:'law'`; the attributes an edge carries do not\n * decide its kind here. The attribute mapping is annotation-only; there\n * is no edge-kind path and no delta to measure.\n * - Evaluator: the dimensional MONOMIAL gives the power law over the variable\n * sources, times the baked constant factor. A fully-quantitative scalar\n * AST whose extra factors are a closed dimensionless coefficient\n * (4π, ln 2, 8π/3, …) multiplies that coefficient on the Buckingham path,\n * including a minus sign. The sourced prefactor table owns the factor\n * for an AST that is intentionally constant-free, so that path does not\n * multiply the AST coefficient again. A null monomial, or a dimensionless\n * count, is evaluated from the AST, which already folded those leaves.\n * A sourced prefactor from `canonicalPrefactor` multiplies as well. A dimensionless\n * group in `CANONICAL_GROUP_PREFACTORS` multiplies only when that input is\n * present (`√γ` for sound speed). Absent, a dimensional entry with no\n * sourced prefactor returns no number. That table is\n * outside this tree. `scalar-up-to-constant` is not a license to drop ½,\n * 2π, or 6π. A sourced 1 stays a value. A fully-quantitative dimensionless count (`N`,\n * `1-e²`) is a source in `formulaFactors`, not a stub that drops the\n * rest of the coefficient: the evaluator multiplies it, and a missing\n * count does not return the count-free value. A `scalar-up-to-constant`\n * stub (Jarzynski's log average) stays out of that list. A G-closure\n * is not given a second constant here. Where\n * dimensions cannot pin a monomial\n * (`monomial: null`), a fully-quantitative product, quotient, or integer\n * power is evaluated from that AST, so a numeric leaf (4, 6π, 8π) is not\n * dropped and Newton's two same-dim masses still return G m₁ m₂ / r².\n * A fully-quantitative sum or transcendental (Carnot, the first law, the\n * Boltzmann factor) is evaluated from that same AST. A\n * `scalar-up-to-constant` stub still carries a NaN evaluator;\n * `retrodict` accepts only finite derivations, so it abstains on those\n * rather than inventing a monomial or presenting the dropped ½ as the law.\n *\n * The public counterpart to `CATALOG_GRAPH` (the bridge-catalog graph): exported\n * from the package manifest and surfaced via the CLI's `--source=canonical`\n * flag on `discover` / `candidates` / `map`.\n *\n * @module composition/canonical-graph\n */\n\nimport { validityDomain, type BridgeEdge, type ValidityDomain } from './edge.js';\nimport type { Quantity, RegimeAttributes } from './quantity.js';\nimport { regimeAttributesOf } from './quantity.js';\nimport { AXES } from './axes.js';\nimport type { CanonicalEquation } from '../canonical/canonical-equation.js';\nimport { CANONICAL_EQUATIONS } from '../canonical/registry.js';\nimport { applyCarrierSignPolicy } from '../bridges/carrier-sign.js';\nimport { CONSTANT_REGISTRY, CONSTANTS, isRegisteredConstant, piMultipleValue } from '../dimensional/symbolic-constants.js';\nimport { forEachScalarLeaf } from '../dimensional/ast-leaves.js';\nimport type { Dimension } from '../dimensional/types.js';\nimport type { InformationMeasure } from '../core/types.js';\nimport { CHARGE, DIMENSIONLESS, MASS } from '../dimensional/types.js';\nimport { equals } from '../dimensional/algebra.js';\nimport type { ExprNode } from '../dimensional/validator.js';\nimport { CANONICAL_GROUP_PREFACTORS, canonicalGroupPrefactor, canonicalPrefactor } from './canonical-prefactors.js';\nimport { evalExpr } from './expr-eval.js';\nimport { monomialExponents } from './formula-shape.js';\n\n/** A universal constant a canonical `governing` list may name: SI value + dim. Named by the public `CANONICAL_CONSTANTS`. @public */\nexport interface ConstantDef {\n readonly value: number;\n readonly dim: Dimension;\n}\n\n/**\n * The universal constants a canonical `governing` list may name, under every\n * registered spelling, with SI value AND dimension: the canonical rows of the\n * constant registry. A governing entry is BAKED into the evaluator iff its\n * name AND dimension match an entry here; everything else is a physical\n * variable (a graph node). The dimension guard is load-bearing: it stops a\n * future same-named physical variable (e.g. orbital eccentricity `e`,\n * dimensionless) from being silently replaced by a constant of the same name.\n */\nexport const CANONICAL_CONSTANTS: Readonly<Record<string, ConstantDef>> = Object.fromEntries(\n CONSTANT_REGISTRY.filter((row) => row.canonical).flatMap((row) =>\n [row.name, ...row.spellings].map((spelling) => [spelling, { value: row.value, dim: row.dim }]),\n ),\n);\n\n/**\n * Map camelCase `InformationMeasure` (from canonical regime) to kebab-case\n * `RegimeAttributes.information` (for composition graph).\n */\nconst INFO_MAP: Record<InformationMeasure, NonNullable<RegimeAttributes['information']>> = {\n vonNeumann: 'von-neumann',\n shannon: 'shannon',\n kolmogorov: 'kolmogorov',\n quantumDiscord: 'discord',\n};\n\n/** A governing entry is a baked constant iff its name AND dimension match. */\nconst constantValue = (name: string, dim: Dimension): number | null => {\n const c = CANONICAL_CONSTANTS[name];\n return c !== undefined && equals(c.dim, dim) ? c.value : null;\n};\n\n/**\n * Carry every registry axis the canonical regime states under the same\n * vocabulary (scale, force, symmetry), plus information through `INFO_MAP`,\n * whose spelling differs. `TensorIndices.topology` is a number, not a\n * `TopologyAxis`, and `dimension` is not a registry axis; neither is carried.\n * The result is checked against the registry, so a canonical regime value\n * outside an axis's value list is a load-time error, not an unstated axis.\n */\nfunction attributesOf(eq: CanonicalEquation): RegimeAttributes {\n const stated: Record<string, string> = {};\n for (const { name } of AXES) {\n const value = (eq.regime as Readonly<Record<string, unknown>>)[name];\n if (name === 'information' || typeof value !== 'string') continue;\n stated[name] = value;\n }\n if (eq.regime.information) stated['information'] = INFO_MAP[eq.regime.information];\n return regimeAttributesOf(stated, `canonical ${eq.id} regime`);\n}\n\nconst PERMISSIVE_DOMAIN: ValidityDomain = {\n description: 'standard-physics regime (canonical L-layer)',\n predicate: () => true,\n violations: () => [],\n};\n\n/**\n * The validity domain of `eq`: its stated condition over the source names, or\n * the permissive domain when none is stated. An unbound name is a violation.\n */\nfunction domainOf(eq: CanonicalEquation, sourceNames: readonly string[]): ValidityDomain {\n const text = eq.holds;\n if (text === undefined) return PERMISSIVE_DOMAIN;\n return validityDomain(text, sourceNames, sourceNames);\n}\n\n/** A registered or literal dimensionless number, or undefined when `name` is not one. */\nfunction dimensionlessLeaf(name: string): number | undefined {\n const c = CONSTANTS[name];\n if (c !== undefined && equals(c.dim, DIMENSIONLESS)) return c.value;\n const pi = piMultipleValue(name);\n if (pi !== undefined) return pi;\n const n = Number(name);\n return Number.isFinite(n) ? n : undefined;\n}\n\n/**\n * The dimensionless coefficient of a product or quotient. Dimensionful symbols\n * contribute 1 — the monomial evaluator already carries them. A sum, a\n * non-scalar arm, or a non-literal exponent is not a closed coefficient.\n */\nfunction dimensionlessCoefficient(node: ExprNode): number | undefined {\n if (node.kind === 'symbol') {\n const v = dimensionlessLeaf(node.name);\n return v !== undefined ? v : 1;\n }\n if (node.kind !== 'op') return undefined;\n if (node.op === '*') {\n let acc = 1;\n for (const a of node.args) {\n const c = dimensionlessCoefficient(a);\n if (c === undefined) return undefined;\n acc *= c;\n }\n return acc;\n }\n if (node.op === '/') {\n if (node.args.length !== 2) return undefined;\n const n = dimensionlessCoefficient(node.args[0]!);\n const d = dimensionlessCoefficient(node.args[1]!);\n if (n === undefined || d === undefined || d === 0) return undefined;\n return n / d;\n }\n if (node.op === '^') {\n const base = node.args[0];\n const exp = node.args[1];\n if (base === undefined || exp === undefined || exp.kind !== 'symbol') return undefined;\n const e = Number(exp.name);\n if (!Number.isFinite(e)) return undefined;\n if (base.kind === 'symbol') {\n const v = dimensionlessLeaf(base.name);\n return v !== undefined ? Math.pow(v, e) : 1;\n }\n const inner = dimensionlessCoefficient(base);\n return inner === undefined ? undefined : Math.pow(inner, e);\n }\n return undefined;\n}\n\n/** A symbol the coefficient walker would treat as 1 but that is not a constant or a governing name. */\nfunction hasUnresolvedStub(node: ExprNode, governing: ReadonlySet<string>): boolean {\n if (node.kind === 'symbol') {\n if (dimensionlessLeaf(node.name) !== undefined) return false;\n if (governing.has(node.name)) return false;\n if (isRegisteredConstant(node.name)) return false;\n return true;\n }\n if (node.kind === 'op') return node.args.some((a) => hasUnresolvedStub(a, governing));\n return true;\n}\n\n/**\n * The closed dimensionless factor a fully-quantitative AST records in front of\n * its dimensional monomial. `undefined` when there is nothing to multiply\n * (no AST, not fully quantitative, a stub, a sum, a factor of +1, or a factor\n * the sourced prefactor table already owns).\n */\nfunction recordedDimensionlessCoefficient(eq: CanonicalEquation): number | undefined {\n if (eq.epistemicStatus !== 'fully-quantitative' || eq.scalarAst === undefined) return undefined;\n // The table is the sourced multiplier for an AST that stays constant-free.\n // Multiplying the AST as well would count that factor twice.\n if (canonicalPrefactor(eq.id) !== undefined) return undefined;\n const governing = new Set(eq.dimensional.governing.map((g) => g.name));\n if (hasUnresolvedStub(eq.scalarAst, governing)) return undefined;\n const c = dimensionlessCoefficient(eq.scalarAst);\n if (c === undefined || !Number.isFinite(c) || c === 0) return undefined;\n if (Math.abs(c - 1) < 1e-12) return undefined;\n return c;\n}\n\n/**\n * Dimensionless counts a fully-quantitative AST multiplies in and Buckingham\n * cannot see. `scalar-up-to-constant` stays excluded: that stub is the\n * unfixed factor, not a required input.\n */\nfunction formulaFactorExponents(eq: CanonicalEquation): Record<string, number> {\n if (eq.epistemicStatus !== 'fully-quantitative' || eq.scalarAst === undefined) return {};\n const powers = monomialExponents(eq.scalarAst);\n if (powers === undefined) return {};\n const governing = new Set(eq.dimensional.governing.map((g) => g.name));\n const dims = new Map<string, Dimension>();\n forEachScalarLeaf(eq.scalarAst, (leaf) => dims.set(leaf.name, leaf.dim), {});\n const factors: Record<string, number> = {};\n for (const [name, exp] of powers) {\n if (exp === 0) continue;\n const dim = dims.get(name);\n if (dim === undefined || !equals(dim, DIMENSIONLESS)) continue;\n if (dimensionlessLeaf(name) !== undefined) continue;\n if (governing.has(name) || isRegisteredConstant(name)) continue;\n factors[name] = exp;\n }\n return factors;\n}\n\ntype InputParity = 'even' | 'odd' | 'neither' | 'absent';\n\n/**\n * Sign parity of `node` as a function of `name`. A product of two odd\n * factors is even. An absolute value is even. An even integer power is\n * even. A fractional power of an even subexpression stays even\n * (`√(q²)`), and a fractional power of an odd one is not a magnitude.\n */\nfunction inputParity(node: ExprNode, name: string): InputParity {\n if (node.kind === 'symbol') return node.name === name ? 'odd' : 'absent';\n if (node.kind === 'abs') {\n const inner = inputParity(node.arg, name);\n if (inner === 'absent' || inner === 'neither') return inner;\n return 'even';\n }\n if (node.kind === 'transcendental' || node.kind === 'dirac-delta') {\n const inner = inputParity(node.arg, name);\n return inner === 'absent' ? 'absent' : 'neither';\n }\n if (node.kind !== 'op') return 'neither';\n if (node.op === '+' || node.op === '-') {\n const parts = node.args.map((arg) => inputParity(arg, name)).filter((p) => p !== 'absent');\n if (parts.length === 0) return 'absent';\n if (parts.some((p) => p === 'neither')) return 'neither';\n if (parts.every((p) => p === 'even')) return 'even';\n if (parts.every((p) => p === 'odd')) return 'odd';\n return 'neither';\n }\n if (node.op === '*' || node.op === '/') {\n let acc: InputParity = 'absent';\n for (const arg of node.args) {\n const part = inputParity(arg, name);\n if (part === 'neither') return 'neither';\n if (part === 'absent') continue;\n if (acc === 'absent') acc = part;\n else if (acc === 'odd' && part === 'odd') acc = 'even';\n else if (acc === 'odd' || part === 'odd') acc = 'odd';\n else acc = 'even';\n }\n return acc;\n }\n if (node.op === '^') {\n const base = node.args[0];\n const expNode = node.args[1];\n if (base === undefined || expNode === undefined || expNode.kind !== 'symbol') return 'neither';\n const exp = Number(expNode.name);\n const inner = inputParity(base, name);\n if (!Number.isFinite(exp) || inner === 'neither') return inner === 'absent' ? 'absent' : 'neither';\n if (inner === 'absent' || exp === 0) return 'absent';\n if (Number.isInteger(exp) && Math.abs(exp) % 2 === 0) return 'even';\n if (Number.isInteger(exp)) return inner;\n return inner === 'even' ? 'even' : 'neither';\n }\n return 'neither';\n}\n\n/** Names whose scalar AST is an even function. A magnitude uses these absolutely. */\nfunction evenInputNames(node: ExprNode | undefined): ReadonlySet<string> {\n if (node === undefined) return new Set();\n const names = new Set<string>();\n forEachScalarLeaf(node, (leaf) => names.add(leaf.name), { abs: true, transcendental: true, diracDelta: true });\n const even = new Set<string>();\n for (const name of names) {\n if (inputParity(node, name) === 'even') even.add(name);\n }\n return even;\n}\n\n/** Evaluate a fully-quantitative monomial AST, including its dimensionless counts. */\nfunction evaluateAstMonomial(\n eq: CanonicalEquation,\n powers: ReadonlyMap<string, number>,\n): (inputs: Record<string, number>) => number {\n const dimByName = new Map(eq.dimensional.governing.map((g) => [g.name, g.dim]));\n let constFactor = 1;\n const varExps: Array<[string, number]> = [];\n for (const [name, exp] of powers) {\n if (exp === 0) continue;\n const leaf = dimensionlessLeaf(name);\n if (leaf !== undefined) {\n constFactor *= Math.pow(leaf, exp);\n continue;\n }\n const dim = dimByName.get(name) ?? CONSTANTS[name]?.dim;\n const cv = dim !== undefined ? constantValue(name, dim) : null;\n if (cv !== null) constFactor *= Math.pow(cv, exp);\n else varExps.push([name, exp]);\n }\n return (inputs: Record<string, number>): number => {\n let v = constFactor;\n for (const [name, exp] of varExps) {\n const x = inputs[name];\n if (x === undefined || !Number.isFinite(x)) return Number.NaN;\n v *= Math.pow(x, exp);\n }\n return v;\n };\n}\n\n/** Numeric literal symbols (`1`, `-1`) the monomial path already folded. */\nfunction literalInputs(node: ExprNode, inputs: Record<string, number>): Record<string, number> {\n const scope: Record<string, number> = { ...inputs };\n const walk = (current: ExprNode): void => {\n if (current.kind === 'symbol') {\n if (Object.hasOwn(scope, current.name)) return;\n const numeric = Number(current.name);\n if (current.name.trim() !== '' && Number.isFinite(numeric)) scope[current.name] = numeric;\n return;\n }\n if (current.kind === 'op') for (const arg of current.args) walk(arg);\n else if (current.kind === 'abs' || current.kind === 'transcendental' || current.kind === 'dirac-delta') walk(current.arg);\n };\n walk(node);\n return scope;\n}\n\n/**\n * A fully-quantitative sum or transcendental. The monomial exponent walk\n * cannot see it. `scalar-up-to-constant` stays out: that status dropped a\n * factor, and the AST is not the law.\n */\nfunction evaluateClosedScalar(\n eq: CanonicalEquation,\n): ((inputs: Record<string, number>) => number) | undefined {\n if (eq.epistemicStatus !== 'fully-quantitative' || eq.scalarAst === undefined) return undefined;\n if (monomialExponents(eq.scalarAst) !== undefined) return undefined;\n const ast = eq.scalarAst;\n const required = eq.dimensional.governing.filter((governing) => constantValue(governing.name, governing.dim) === null);\n return (inputs) => {\n for (const governing of required) {\n const value = inputs[governing.name];\n if (value === undefined || !Number.isFinite(value)) return Number.NaN;\n }\n try {\n const value = evalExpr(ast, literalInputs(ast, inputs));\n return Number.isFinite(value) ? value : Number.NaN;\n } catch {\n return Number.NaN;\n }\n };\n}\n\n/**\n * Build the evaluator for one canonical equation, keyed by its VARIABLE source\n * names. Variables carry the monomial exponent from `inputs`; constants\n * contribute a fixed baked factor. A fully-quantitative monomial multiplies\n * its recorded dimensionless coefficient when the sourced table does not\n * already own that factor, and multiplies the sourced table prefactor.\n * A fully-quantitative AST that names a dimensionless count, or whose\n * Buckingham monomial is null, is evaluated from that AST so the count and\n * the numeric leaves (6π) are not dropped. A fully-quantitative sum or\n * transcendental is evaluated from that AST too. The edge applies the sign policy\n * once before this function: an input the AST is even in is an absolute\n * value, and a product odd in both charge and mobility rejects opposite\n * signs. This function does not do that again.\n * Returns NaN when the monomial is null and the AST is not a fully-quantitative\n * closed form, and when a dimensional coefficient is unset and its group is unbound.\n * `retrodict` then abstains.\n */\nfunction makeEvaluate(\n eq: CanonicalEquation,\n): (inputs: Record<string, number>) => number {\n const powers = eq.epistemicStatus === 'fully-quantitative' ? monomialExponents(eq.scalarAst) : undefined;\n const factors = formulaFactorExponents(eq);\n if (powers !== undefined && (Object.keys(factors).length > 0 || eq.dimensional.monomial === null)) {\n return evaluateAstMonomial(eq, powers);\n }\n const closed = evaluateClosedScalar(eq);\n if (closed !== undefined) return closed;\n const monomial = eq.dimensional.monomial;\n if (monomial === null) return () => NaN;\n const dimByName = new Map(eq.dimensional.governing.map((g) => [g.name, g.dim]));\n let constFactor = 1;\n const varExps: Array<[string, number]> = [];\n for (const [name, exp] of Object.entries(monomial)) {\n const dim = dimByName.get(name);\n const cv = dim !== undefined ? constantValue(name, dim) : null;\n if (cv !== null) constFactor *= Math.pow(cv, exp);\n else varExps.push([name, exp]);\n }\n const recorded = recordedDimensionlessCoefficient(eq);\n const tabled = canonicalPrefactor(eq.id);\n const group = CANONICAL_GROUP_PREFACTORS.find((p) => p.id === eq.id);\n const unset = eq.epistemicStatus === 'dimensional' && tabled === undefined;\n return (inputs: Record<string, number>): number => {\n if (unset) {\n if (group === undefined) return Number.NaN;\n const bound = inputs[group.group];\n if (bound === undefined || !Number.isFinite(bound)) return Number.NaN;\n }\n let v = constFactor;\n if (recorded !== undefined) v *= recorded;\n if (tabled !== undefined) v *= tabled;\n if (group !== undefined) {\n const g = inputs[group.group];\n if (g !== undefined && Number.isFinite(g)) {\n const factor = canonicalGroupPrefactor(eq.id, g);\n if (factor !== undefined) v *= factor;\n }\n }\n for (const [name, exp] of varExps) {\n const x = inputs[name];\n v *= Math.pow(x === undefined ? Number.NaN : x, exp);\n }\n return v;\n };\n}\n\n/** Project one canonical equation to a composition-graph edge. */\nfunction toEdge(eq: CanonicalEquation): BridgeEdge {\n const attributes = attributesOf(eq);\n const target: Quantity = {\n name: eq.dimensional.target.name,\n symbol: eq.dimensional.target.name,\n dim: eq.dimensional.target.dim,\n attributes,\n };\n const factors = formulaFactorExponents(eq);\n const sources: Quantity[] = eq.dimensional.governing\n .filter((g) => constantValue(g.name, g.dim) === null)\n .map((g) => ({ name: g.name, symbol: g.name, dim: g.dim, attributes }));\n for (const name of Object.keys(factors)) {\n sources.push({ name, symbol: name, dim: DIMENSIONLESS, attributes });\n }\n const evaluateRaw = makeEvaluate(eq);\n const even = evenInputNames(eq.scalarAst);\n const evenInputs = sources.filter((source) => even.has(source.name)).map((source) => source.name);\n const monomial = eq.dimensional.monomial;\n return {\n id: eq.id,\n beId: null,\n kind: 'law',\n label: eq.name,\n sources,\n target,\n confidence: 'established',\n domain: domainOf(eq, sources.map((source) => source.name)),\n evaluate: (inputs) => evaluateRaw(applyCarrierSignPolicy(monomial, inputs, even)),\n citation: eq.references[0] ?? eq.id,\n ...(eq.epistemicStatus === 'dimensional' && canonicalPrefactor(eq.id) === undefined\n ? { coefficientUnset: true as const }\n : {}),\n ...(Object.keys(factors).length > 0 ? { formulaFactors: factors } : {}),\n ...(evenInputs.length > 0 ? { evenInputs } : {}),\n };\n}\n\n/**\n * Project canonical equations into composition-graph edges (defaults to the\n * full registry). See the module docstring for the modelling decisions.\n *\n * @internal\n */\nexport function canonicalToEdges(\n equations: readonly CanonicalEquation[] = CANONICAL_EQUATIONS,\n): BridgeEdge[] {\n return equations.map(toEdge);\n}\n\n/**\n * The standard-physics composition graph: every canonical equation as an\n * `established` `law` edge. The bridge-free counterpart to `CATALOG_GRAPH`.\n *\n * @internal\n */\nexport const CANONICAL_GRAPH: readonly BridgeEdge[] = canonicalToEdges();\n"]}
1
+ {"version":3,"file":"canonical-graph.js","sourceRoot":"","sources":["../../src/composition/canonical-graph.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+DG;AAEH,OAAO,EAAE,cAAc,EAAwC,MAAM,WAAW,CAAC;AAEjF,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAC3H,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAGjE,OAAO,EAAU,aAAa,EAAQ,MAAM,yBAAyB,CAAC;AACtE,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AAEnD,OAAO,EAAE,0BAA0B,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,MAAM,2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AC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,cAAc,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACvE,GAAG,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACjD,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAC9B,SAAS,GAAiC,mBAAmB;IAE7D,OAAO,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AAC/B,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,MAAM,eAAe,GAA0B,gBAAgB,EAAE,CAAC","sourcesContent":["/**\n * Canonical-only graph — project the standard-physics L-layer\n * (`CANONICAL_EQUATIONS`) into the composition-graph edge vocabulary so the\n * discovery/analysis funnel (`upt discover` / `candidates` / `map`) can run on\n * established textbook physics ALONE, with the speculative bridge catalog\n * excluded.\n *\n * WHY this exists: `CATALOG_GRAPH` mixes established bridges with speculative\n * ones (the counts per status are NOTES.md's), so a `promising` discovery\n * there is polluted by speculation. Feeding ONLY canonical equations gives (a) a new-candidate\n * review surface motivated by textbook physics, and (b) a regression harness —\n * discovery on canonical-only must introduce no numerical contradiction\n * (standard physics, fed to the inference suite, stays self-consistent).\n *\n * DESIGN — parity with the bridge graph:\n * - Universal constants (G, c, ℏ, k_B, ε₀, σ_sb, b, e) are BAKED INTO the\n * evaluator, exactly as the catalog edges bake them — they are not graph\n * nodes. This keeps the candidate proposer about physical OBSERVABLES and\n * lets the numeric filter fire from the standard `{ mass }` anchor (an\n * anchor cannot supply G/c/ℏ). A `governing` entry is a constant iff its\n * name is registered in `CANONICAL_CONSTANT_SI`; everything else is a\n * physical variable and becomes a source/target node.\n * - Every canonical equation is `established` physics, so every edge is\n * `confidence: 'established'` — the canonical graph IS the anchored core.\n * - `kind: 'law'` (within-domain ground truth, not a cross-regime bridge);\n * `beId: null` (not a catalog bridge). **Annotation-correctness note:**\n * `toEdge` hardcodes `kind:'law'`; the attributes an edge carries do not\n * decide its kind here. The attribute mapping is annotation-only; there\n * is no edge-kind path and no delta to measure.\n * - Evaluator: the dimensional MONOMIAL gives the power law over the variable\n * sources, times the baked constant factor. A fully-quantitative scalar\n * AST whose extra factors are a closed dimensionless coefficient\n * (4π, ln 2, 8π/3, …) multiplies that coefficient on the Buckingham path,\n * including a minus sign. The sourced prefactor table owns the factor\n * for an AST that is intentionally constant-free, so that path does not\n * multiply the AST coefficient again. A null monomial, or a dimensionless\n * count, is evaluated from the AST, which already folded those leaves.\n * A sourced prefactor from `canonicalPrefactor` multiplies as well. A dimensionless\n * group in `CANONICAL_GROUP_PREFACTORS` multiplies only when that input is\n * present (`√γ` for sound speed). Absent, a dimensional entry with no\n * sourced prefactor returns no number. That table is\n * outside this tree. `scalar-up-to-constant` is not a license to drop ½,\n * 2π, or 6π. A sourced 1 stays a value. A fully-quantitative dimensionless count (`N`,\n * `1-e²`) is a source in `formulaFactors`, not a stub that drops the\n * rest of the coefficient: the evaluator multiplies it, and a missing\n * count does not return the count-free value. A `scalar-up-to-constant`\n * stub (Jarzynski's log average) stays out of that list. A G-closure\n * is not given a second constant here. Where\n * dimensions cannot pin a monomial\n * (`monomial: null`), a fully-quantitative product, quotient, or integer\n * power is evaluated from that AST, so a numeric leaf (4, 6π, 8π) is not\n * dropped and Newton's two same-dim masses still return G m₁ m₂ / r².\n * A fully-quantitative sum or transcendental (Carnot, the first law, the\n * Boltzmann factor) is evaluated from that same AST. A\n * `scalar-up-to-constant` stub still carries a NaN evaluator;\n * `retrodict` accepts only finite derivations, so it abstains on those\n * rather than inventing a monomial or presenting the dropped ½ as the law.\n *\n * The public counterpart to `CATALOG_GRAPH` (the bridge-catalog graph): exported\n * from the package manifest and surfaced via the CLI's `--source=canonical`\n * flag on `discover` / `candidates` / `map`.\n *\n * @module composition/canonical-graph\n */\n\nimport { validityDomain, type BridgeEdge, type ValidityDomain } from './edge.js';\nimport type { Quantity, RegimeAttributes } from './quantity.js';\nimport { regimeAttributesOf } from './quantity.js';\nimport { AXES } from './axes.js';\nimport type { CanonicalEquation } from '../canonical/canonical-equation.js';\nimport { CANONICAL_EQUATIONS } from '../canonical/registry.js';\nimport { applyCarrierSignPolicy } from '../bridges/carrier-sign.js';\nimport { CONSTANT_REGISTRY, CONSTANTS, isRegisteredConstant, piMultipleValue } from '../dimensional/symbolic-constants.js';\nimport { forEachScalarLeaf } from '../dimensional/ast-leaves.js';\nimport type { Dimension } from '../dimensional/types.js';\nimport type { InformationMeasure } from '../core/types.js';\nimport { CHARGE, DIMENSIONLESS, MASS } from '../dimensional/types.js';\nimport { equals } from '../dimensional/algebra.js';\nimport type { ExprNode } from '../dimensional/validator.js';\nimport { CANONICAL_GROUP_PREFACTORS, canonicalGroupPrefactor, canonicalPrefactor } from './canonical-prefactors.js';\nimport { evalExpr } from './expr-eval.js';\nimport { monomialExponents } from './formula-shape.js';\n\n/** A universal constant a canonical `governing` list may name: SI value + dim. Named by the public `CANONICAL_CONSTANTS`. @public */\nexport interface ConstantDef {\n readonly value: number;\n readonly dim: Dimension;\n}\n\n/**\n * The universal constants a canonical `governing` list may name, under every\n * registered spelling, with SI value AND dimension: the canonical rows of the\n * constant registry. A governing entry is BAKED into the evaluator iff its\n * name AND dimension match an entry here; everything else is a physical\n * variable (a graph node). The dimension guard is load-bearing: it stops a\n * future same-named physical variable (e.g. orbital eccentricity `e`,\n * dimensionless) from being silently replaced by a constant of the same name.\n */\nexport const CANONICAL_CONSTANTS: Readonly<Record<string, ConstantDef>> = Object.fromEntries(\n CONSTANT_REGISTRY.filter((row) => row.canonical).flatMap((row) =>\n [row.name, ...row.spellings].map((spelling) => [spelling, { value: row.value, dim: row.dim }]),\n ),\n);\n\n/**\n * Map camelCase `InformationMeasure` (from canonical regime) to kebab-case\n * `RegimeAttributes.information` (for composition graph).\n */\nconst INFO_MAP: Record<InformationMeasure, NonNullable<RegimeAttributes['information']>> = {\n vonNeumann: 'von-neumann',\n shannon: 'shannon',\n kolmogorov: 'kolmogorov',\n quantumDiscord: 'discord',\n};\n\n/** A governing entry is a baked constant iff its name AND dimension match. */\nconst constantValue = (name: string, dim: Dimension): number | null => {\n const c = CANONICAL_CONSTANTS[name];\n return c !== undefined && equals(c.dim, dim) ? c.value : null;\n};\n\n/**\n * Carry every registry axis the canonical regime states under the same\n * vocabulary (scale, force, symmetry), plus information through `INFO_MAP`,\n * whose spelling differs. `TensorIndices.topology` is a number, not a\n * `TopologyAxis`, and `dimension` is not a registry axis; neither is carried.\n * The result is checked against the registry, so a canonical regime value\n * outside an axis's value list is a load-time error, not an unstated axis.\n */\nfunction attributesOf(eq: CanonicalEquation): RegimeAttributes {\n const stated: Record<string, string> = {};\n for (const { name } of AXES) {\n const value = (eq.regime as Readonly<Record<string, unknown>>)[name];\n if (name === 'information' || typeof value !== 'string') continue;\n stated[name] = value;\n }\n if (eq.regime.information) stated['information'] = INFO_MAP[eq.regime.information];\n return regimeAttributesOf(stated, `canonical ${eq.id} regime`);\n}\n\nconst PERMISSIVE_DOMAIN: ValidityDomain = {\n description: 'standard-physics regime (canonical L-layer)',\n predicate: () => true,\n violations: () => [],\n};\n\n/**\n * The validity domain of `eq`: its stated condition over the source names, or\n * the permissive domain when none is stated. An unbound name is a violation.\n */\nfunction domainOf(eq: CanonicalEquation, sourceNames: readonly string[]): ValidityDomain {\n const text = eq.holds;\n if (text === undefined) return PERMISSIVE_DOMAIN;\n return validityDomain(text, sourceNames, sourceNames);\n}\n\n/** A registered or literal dimensionless number, or undefined when `name` is not one. */\nfunction dimensionlessLeaf(name: string): number | undefined {\n const c = CONSTANTS[name];\n if (c !== undefined && equals(c.dim, DIMENSIONLESS)) return c.value;\n const pi = piMultipleValue(name);\n if (pi !== undefined) return pi;\n const n = Number(name);\n return Number.isFinite(n) ? n : undefined;\n}\n\n/**\n * The dimensionless coefficient of a product or quotient. Dimensionful symbols\n * contribute 1 — the monomial evaluator already carries them. A sum, a\n * non-scalar arm, or a non-literal exponent is not a closed coefficient.\n */\nfunction dimensionlessCoefficient(node: ExprNode): number | undefined {\n if (node.kind === 'symbol') {\n const v = dimensionlessLeaf(node.name);\n return v !== undefined ? v : 1;\n }\n if (node.kind !== 'op') return undefined;\n if (node.op === '*') {\n let acc = 1;\n for (const a of node.args) {\n const c = dimensionlessCoefficient(a);\n if (c === undefined) return undefined;\n acc *= c;\n }\n return acc;\n }\n if (node.op === '/') {\n if (node.args.length !== 2) return undefined;\n const n = dimensionlessCoefficient(node.args[0]!);\n const d = dimensionlessCoefficient(node.args[1]!);\n if (n === undefined || d === undefined || d === 0) return undefined;\n return n / d;\n }\n if (node.op === '^') {\n const base = node.args[0];\n const exp = node.args[1];\n if (base === undefined || exp === undefined || exp.kind !== 'symbol') return undefined;\n const e = Number(exp.name);\n if (!Number.isFinite(e)) return undefined;\n if (base.kind === 'symbol') {\n const v = dimensionlessLeaf(base.name);\n return v !== undefined ? Math.pow(v, e) : 1;\n }\n const inner = dimensionlessCoefficient(base);\n return inner === undefined ? undefined : Math.pow(inner, e);\n }\n return undefined;\n}\n\n/** A symbol the coefficient walker would treat as 1 but that is not a constant or a governing name. */\nfunction hasUnresolvedStub(node: ExprNode, governing: ReadonlySet<string>): boolean {\n if (node.kind === 'symbol') {\n if (dimensionlessLeaf(node.name) !== undefined) return false;\n if (governing.has(node.name)) return false;\n if (isRegisteredConstant(node.name)) return false;\n return true;\n }\n if (node.kind === 'op') return node.args.some((a) => hasUnresolvedStub(a, governing));\n return true;\n}\n\n/**\n * The closed dimensionless factor a fully-quantitative AST records in front of\n * its dimensional monomial. `undefined` when there is nothing to multiply\n * (no AST, not fully quantitative, a stub, a sum, a factor of +1, or a factor\n * the sourced prefactor table already owns).\n */\nfunction recordedDimensionlessCoefficient(eq: CanonicalEquation): number | undefined {\n if (eq.epistemicStatus !== 'fully-quantitative' || eq.scalarAst === undefined) return undefined;\n // The table is the sourced multiplier for an AST that stays constant-free.\n // Multiplying the AST as well would count that factor twice.\n if (canonicalPrefactor(eq.id) !== undefined) return undefined;\n const governing = new Set(eq.dimensional.governing.map((g) => g.name));\n if (hasUnresolvedStub(eq.scalarAst, governing)) return undefined;\n const c = dimensionlessCoefficient(eq.scalarAst);\n if (c === undefined || !Number.isFinite(c) || c === 0) return undefined;\n if (Math.abs(c - 1) < 1e-12) return undefined;\n return c;\n}\n\n/**\n * Dimensionless counts a fully-quantitative AST multiplies in and Buckingham\n * cannot see. `scalar-up-to-constant` stays excluded: that stub is the\n * unfixed factor, not a required input.\n */\nfunction formulaFactorExponents(eq: CanonicalEquation): Record<string, number> {\n if (eq.epistemicStatus !== 'fully-quantitative' || eq.scalarAst === undefined) return {};\n const powers = monomialExponents(eq.scalarAst);\n if (powers === undefined) return {};\n const governing = new Set(eq.dimensional.governing.map((g) => g.name));\n const dims = new Map<string, Dimension>();\n forEachScalarLeaf(eq.scalarAst, (leaf) => dims.set(leaf.name, leaf.dim), {});\n const factors: Record<string, number> = {};\n for (const [name, exp] of powers) {\n if (exp === 0) continue;\n const dim = dims.get(name);\n if (dim === undefined || !equals(dim, DIMENSIONLESS)) continue;\n if (dimensionlessLeaf(name) !== undefined) continue;\n if (governing.has(name) || isRegisteredConstant(name)) continue;\n factors[name] = exp;\n }\n return factors;\n}\n\ntype InputParity = 'even' | 'odd' | 'neither' | 'absent';\n\n/**\n * Sign parity of `node` as a function of `name`. A product of two odd\n * factors is even. An absolute value is even. An even integer power is\n * even. A fractional power of an even subexpression stays even\n * (`√(q²)`), and a fractional power of an odd one is not a magnitude.\n */\nfunction inputParity(node: ExprNode, name: string): InputParity {\n if (node.kind === 'symbol') return node.name === name ? 'odd' : 'absent';\n if (node.kind === 'abs') {\n const inner = inputParity(node.arg, name);\n if (inner === 'absent' || inner === 'neither') return inner;\n return 'even';\n }\n if (node.kind === 'transcendental' || node.kind === 'dirac-delta') {\n const inner = inputParity(node.arg, name);\n return inner === 'absent' ? 'absent' : 'neither';\n }\n if (node.kind !== 'op') return 'neither';\n if (node.op === '+' || node.op === '-') {\n const parts = node.args.map((arg) => inputParity(arg, name)).filter((p) => p !== 'absent');\n if (parts.length === 0) return 'absent';\n if (parts.some((p) => p === 'neither')) return 'neither';\n if (parts.every((p) => p === 'even')) return 'even';\n if (parts.every((p) => p === 'odd')) return 'odd';\n return 'neither';\n }\n if (node.op === '*' || node.op === '/') {\n let acc: InputParity = 'absent';\n for (const arg of node.args) {\n const part = inputParity(arg, name);\n if (part === 'neither') return 'neither';\n if (part === 'absent') continue;\n if (acc === 'absent') acc = part;\n else if (acc === 'odd' && part === 'odd') acc = 'even';\n else if (acc === 'odd' || part === 'odd') acc = 'odd';\n else acc = 'even';\n }\n return acc;\n }\n if (node.op === '^') {\n const base = node.args[0];\n const expNode = node.args[1];\n if (base === undefined || expNode === undefined || expNode.kind !== 'symbol') return 'neither';\n const exp = Number(expNode.name);\n const inner = inputParity(base, name);\n if (!Number.isFinite(exp) || inner === 'neither') return inner === 'absent' ? 'absent' : 'neither';\n if (inner === 'absent' || exp === 0) return 'absent';\n if (Number.isInteger(exp) && Math.abs(exp) % 2 === 0) return 'even';\n if (Number.isInteger(exp)) return inner;\n return inner === 'even' ? 'even' : 'neither';\n }\n return 'neither';\n}\n\n/** Names whose scalar AST is an even function. A magnitude uses these absolutely. */\nfunction evenInputNames(node: ExprNode | undefined): ReadonlySet<string> {\n if (node === undefined) return new Set();\n const names = new Set<string>();\n forEachScalarLeaf(node, (leaf) => names.add(leaf.name), { abs: true, transcendental: true, diracDelta: true });\n const even = new Set<string>();\n for (const name of names) {\n if (inputParity(node, name) === 'even') even.add(name);\n }\n return even;\n}\n\n/** Evaluate a fully-quantitative monomial AST, including its dimensionless counts. */\nfunction evaluateAstMonomial(\n eq: CanonicalEquation,\n powers: ReadonlyMap<string, number>,\n): (inputs: Record<string, number>) => number {\n const dimByName = new Map(eq.dimensional.governing.map((g) => [g.name, g.dim]));\n let constFactor = 1;\n const varExps: Array<[string, number]> = [];\n for (const [name, exp] of powers) {\n if (exp === 0) continue;\n const leaf = dimensionlessLeaf(name);\n if (leaf !== undefined) {\n constFactor *= Math.pow(leaf, exp);\n continue;\n }\n const dim = dimByName.get(name) ?? CONSTANTS[name]?.dim;\n const cv = dim !== undefined ? constantValue(name, dim) : null;\n if (cv !== null) constFactor *= Math.pow(cv, exp);\n else varExps.push([name, exp]);\n }\n return (inputs: Record<string, number>): number => {\n let v = constFactor;\n for (const [name, exp] of varExps) {\n const x = inputs[name];\n if (x === undefined || !Number.isFinite(x)) return Number.NaN;\n v *= Math.pow(x, exp);\n }\n return v;\n };\n}\n\n/** Numeric literal symbols (`1`, `-1`) the monomial path already folded. */\nfunction literalInputs(node: ExprNode, inputs: Record<string, number>): Record<string, number> {\n const scope: Record<string, number> = { ...inputs };\n const walk = (current: ExprNode): void => {\n if (current.kind === 'symbol') {\n if (Object.hasOwn(scope, current.name)) return;\n const numeric = Number(current.name);\n if (current.name.trim() !== '' && Number.isFinite(numeric)) scope[current.name] = numeric;\n return;\n }\n if (current.kind === 'op') for (const arg of current.args) walk(arg);\n else if (current.kind === 'abs' || current.kind === 'transcendental' || current.kind === 'dirac-delta') walk(current.arg);\n };\n walk(node);\n return scope;\n}\n\n/**\n * A fully-quantitative sum or transcendental. The monomial exponent walk\n * cannot see it. `scalar-up-to-constant` stays out: that status dropped a\n * factor, and the AST is not the law.\n */\nfunction evaluateClosedScalar(\n eq: CanonicalEquation,\n): ((inputs: Record<string, number>) => number) | undefined {\n if (eq.epistemicStatus !== 'fully-quantitative' || eq.scalarAst === undefined) return undefined;\n if (monomialExponents(eq.scalarAst) !== undefined) return undefined;\n const ast = eq.scalarAst;\n const required = eq.dimensional.governing.filter((governing) => constantValue(governing.name, governing.dim) === null);\n return (inputs) => {\n for (const governing of required) {\n const value = inputs[governing.name];\n if (value === undefined || !Number.isFinite(value)) return Number.NaN;\n }\n try {\n const value = evalExpr(ast, literalInputs(ast, inputs));\n return Number.isFinite(value) ? value : Number.NaN;\n } catch {\n return Number.NaN;\n }\n };\n}\n\n/**\n * Build the evaluator for one canonical equation, keyed by its VARIABLE source\n * names. Variables carry the monomial exponent from `inputs`; constants\n * contribute a fixed baked factor. A fully-quantitative monomial multiplies\n * its recorded dimensionless coefficient when the sourced table does not\n * already own that factor, and multiplies the sourced table prefactor.\n * A fully-quantitative AST that names a dimensionless count, or whose\n * Buckingham monomial is null, is evaluated from that AST so the count and\n * the numeric leaves (6π) are not dropped. A fully-quantitative sum or\n * transcendental is evaluated from that AST too. The edge applies the sign policy\n * once before this function: an input the AST is even in is an absolute\n * value, and a product odd in both charge and mobility rejects opposite\n * signs. This function does not do that again.\n * Returns NaN when the monomial is null and the AST is not a fully-quantitative\n * closed form, and when a dimensional coefficient is unset and its group is unbound.\n * `retrodict` then abstains.\n */\nfunction makeEvaluate(\n eq: CanonicalEquation,\n): (inputs: Record<string, number>) => number {\n const powers = eq.epistemicStatus === 'fully-quantitative' ? monomialExponents(eq.scalarAst) : undefined;\n const factors = formulaFactorExponents(eq);\n if (powers !== undefined && (Object.keys(factors).length > 0 || eq.dimensional.monomial === null)) {\n return evaluateAstMonomial(eq, powers);\n }\n const closed = evaluateClosedScalar(eq);\n if (closed !== undefined) return closed;\n const monomial = eq.dimensional.monomial;\n if (monomial === null) return () => NaN;\n const dimByName = new Map(eq.dimensional.governing.map((g) => [g.name, g.dim]));\n let constFactor = 1;\n const varExps: Array<[string, number]> = [];\n for (const [name, exp] of Object.entries(monomial)) {\n const dim = dimByName.get(name);\n const cv = dim !== undefined ? constantValue(name, dim) : null;\n if (cv !== null) constFactor *= Math.pow(cv, exp);\n else varExps.push([name, exp]);\n }\n const recorded = recordedDimensionlessCoefficient(eq);\n const tabled = canonicalPrefactor(eq.id);\n const group = CANONICAL_GROUP_PREFACTORS.find((p) => p.id === eq.id);\n const unset = eq.epistemicStatus === 'dimensional' && tabled === undefined;\n return (inputs: Record<string, number>): number => {\n if (unset) {\n if (group === undefined) return Number.NaN;\n const bound = inputs[group.group];\n if (bound === undefined || !Number.isFinite(bound)) return Number.NaN;\n }\n let v = constFactor;\n if (recorded !== undefined) v *= recorded;\n if (tabled !== undefined) v *= tabled;\n if (group !== undefined) {\n const g = inputs[group.group];\n if (g !== undefined && Number.isFinite(g)) {\n const factor = canonicalGroupPrefactor(eq.id, g);\n if (factor !== undefined) v *= factor;\n }\n }\n for (const [name, exp] of varExps) {\n const x = inputs[name];\n v *= Math.pow(x === undefined ? Number.NaN : x, exp);\n }\n return v;\n };\n}\n\n/** Project one canonical equation to a composition-graph edge. */\nfunction toEdge(eq: CanonicalEquation): BridgeEdge {\n const attributes = attributesOf(eq);\n const target: Quantity = {\n name: eq.dimensional.target.name,\n symbol: eq.dimensional.target.name,\n dim: eq.dimensional.target.dim,\n attributes,\n };\n const factors = formulaFactorExponents(eq);\n const sources: Quantity[] = eq.dimensional.governing\n .filter((g) => constantValue(g.name, g.dim) === null)\n .map((g) => ({ name: g.name, symbol: g.name, dim: g.dim, attributes }));\n for (const name of Object.keys(factors)) {\n sources.push({ name, symbol: name, dim: DIMENSIONLESS, attributes });\n }\n const evaluateRaw = makeEvaluate(eq);\n const even = evenInputNames(eq.scalarAst);\n const evenInputs = sources.filter((source) => even.has(source.name)).map((source) => source.name);\n const monomial = eq.dimensional.monomial;\n return {\n id: eq.id,\n beId: null,\n kind: 'law',\n label: eq.name,\n sources,\n target,\n confidence: 'established',\n domain: domainOf(eq, sources.map((source) => source.name)),\n evaluate: (inputs) => evaluateRaw(applyCarrierSignPolicy(monomial, inputs, even)),\n citation: eq.references[0] ?? eq.id,\n ...(eq.epistemicStatus === 'dimensional' && canonicalPrefactor(eq.id) === undefined\n ? { coefficientUnset: true as const }\n : {}),\n ...(Object.keys(factors).length > 0 ? { formulaFactors: factors } : {}),\n ...(evenInputs.length > 0 ? { evenInputs } : {}),\n };\n}\n\n/**\n * Project canonical equations into composition-graph edges (defaults to the\n * full registry). See the module docstring for the modelling decisions.\n *\n * @public\n */\nexport function canonicalToEdges(\n equations: readonly CanonicalEquation[] = CANONICAL_EQUATIONS,\n): BridgeEdge[] {\n return equations.map(toEdge);\n}\n\n/**\n * The standard-physics composition graph: every canonical equation as an\n * `established` `law` edge. The bridge-free counterpart to `CATALOG_GRAPH`.\n *\n * @public\n */\nexport const CANONICAL_GRAPH: readonly BridgeEdge[] = canonicalToEdges();\n"]}
@@ -14,9 +14,15 @@
14
14
  import type { VettedCandidate } from './discovery.js';
15
15
  import type { ProposedBridge } from './proposed-bridges.js';
16
16
  import type { CanonicalEquation } from '../canonical/canonical-equation.js';
17
- /** @public */
17
+ /**
18
+ * The consequence signal of a promising candidate: entailed, novel-consequence or inconclusive.
19
+ * @public
20
+ */
18
21
  export type ConsequenceSignal = 'entailed' | 'novel-consequence' | 'inconclusive';
19
- /** @public */
22
+ /**
23
+ * The evidence behind one consequence signal: the derived claim and any canonical match.
24
+ * @public
25
+ */
20
26
  export interface ConsequenceEvidence {
21
27
  readonly target: string;
22
28
  readonly governing: readonly string[];
@@ -25,7 +31,10 @@ export interface ConsequenceEvidence {
25
31
  readonly canonicalMatch: string | null;
26
32
  readonly sourceEquationIds: readonly [string, string];
27
33
  }
28
- /** @public */
34
+ /**
35
+ * A vetted candidate, plus its optional consequence signal and evidence.
36
+ * @public
37
+ */
29
38
  export type ConsequenceAnnotatedCandidate = VettedCandidate & {
30
39
  readonly consequence?: {
31
40
  readonly signal: ConsequenceSignal;
@@ -84,8 +93,9 @@ type ClaimEquation = Pick<CanonicalEquation, 'id' | 'name' | 'assumptions' | 'sc
84
93
  export declare function describeDerivedClaim(proposal: Pick<ProposedBridge, 'target' | 'governing' | 'scalarAst' | 'derivedFrom'>, canonical?: readonly ClaimEquation[]): DerivedClaim;
85
94
  /**
86
95
  * Annotate ranked candidates with their consequence signal. Order-preserving,
87
- * 1:1 with the input; only `promising` candidates are classified (they are the
88
- * only ones `deriveProposedBridges` processes). A promising candidate with no
96
+ * 1:1 with the input; only candidates in a promising tier (`promising` or
97
+ * `promising-unchecked`) are classified (they are the only ones
98
+ * `deriveProposedBridges` processes). A promising candidate with no
89
99
  * derived proposal is `inconclusive`. Generic over the input candidate type so
90
100
  * it composes with other post-pass annotators (e.g. `annotateAdjudications`)
91
101
  * without forgetting fields the caller already attached.
@@ -1 +1 @@
1
- {"version":3,"file":"consequence.d.ts","sourceRoot":"","sources":["../../src/composition/consequence.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAI5D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAE5E,cAAc;AACd,MAAM,MAAM,iBAAiB,GAAG,UAAU,GAAG,mBAAmB,GAAG,cAAc,CAAC;AAElF,cAAc;AACd,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;IACtC,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;IACnC,0EAA0E;IAC1E,QAAQ,CAAC,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IACvC,QAAQ,CAAC,iBAAiB,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACvD;AAED,cAAc;AACd,MAAM,MAAM,6BAA6B,GAAG,eAAe,GAAG;IAC5D,QAAQ,CAAC,WAAW,CAAC,EAAE;QACrB,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAC;QACnC,QAAQ,CAAC,QAAQ,EAAE,SAAS,mBAAmB,EAAE,CAAC;KACnD,CAAC;CACH,CAAC;AASF;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,IAAI,CAAC,cAAc,EAAE,QAAQ,GAAG,WAAW,GAAG,WAAW,GAAG,aAAa,CAAC,EACpF,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KAAK,EAAE,6BAA6B,CAAC;KAC/C,CAAC;CACH;AAED,KAAK,aAAa,GAAG,IAAI,CAAC,iBAAiB,EAAE,IAAI,GAAG,MAAM,GAAG,aAAa,GAAG,WAAW,CAAC,GAAG;IAC1F,QAAQ,CAAC,WAAW,EAAE,IAAI,CAAC,iBAAiB,CAAC,aAAa,CAAC,EAAE,QAAQ,GAAG,WAAW,CAAC,CAAC;CACtF,CAAC;AAEF;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,IAAI,CAAC,cAAc,EAAE,QAAQ,GAAG,WAAW,GAAG,WAAW,GAAG,aAAa,CAAC,EACpF,SAAS,GAAE,SAAS,aAAa,EAAwB,GACxD,YAAY,CA4Cd;AAED;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,SAAS,eAAe,EAC5D,UAAU,EAAE,SAAS,CAAC,EAAE,GACvB,SAAS,CAAC,CAAC,GAAG;IACf,QAAQ,CAAC,WAAW,CAAC,EAAE;QACrB,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAC;QACnC,QAAQ,CAAC,QAAQ,EAAE,SAAS,mBAAmB,EAAE,CAAC;KACnD,CAAC;CACH,CAAC,EAAE,CA0BH"}
@@ -1,3 +1,4 @@
1
+ import { isPromisingTier } from './discovery.js';
1
2
  import { deriveProposedBridges } from './proposed-bridges.js';
2
3
  import { normalForm } from '../canonical/normal-form.js';
3
4
  import { CANONICAL_EQUATIONS } from '../canonical/registry.js';
@@ -90,15 +91,16 @@ export function describeDerivedClaim(proposal, canonical = CANONICAL_EQUATIONS)
90
91
  }
91
92
  /**
92
93
  * Annotate ranked candidates with their consequence signal. Order-preserving,
93
- * 1:1 with the input; only `promising` candidates are classified (they are the
94
- * only ones `deriveProposedBridges` processes). A promising candidate with no
94
+ * 1:1 with the input; only candidates in a promising tier (`promising` or
95
+ * `promising-unchecked`) are classified (they are the only ones
96
+ * `deriveProposedBridges` processes). A promising candidate with no
95
97
  * derived proposal is `inconclusive`. Generic over the input candidate type so
96
98
  * it composes with other post-pass annotators (e.g. `annotateAdjudications`)
97
99
  * without forgetting fields the caller already attached.
98
100
  * @public
99
101
  */
100
102
  export function annotateConsequences(candidates) {
101
- const promising = candidates.filter((c) => c.verdict === 'promising');
103
+ const promising = candidates.filter((c) => isPromisingTier(c.verdict));
102
104
  const proposals = deriveProposedBridges(promising);
103
105
  // Group proposals + their classification by the sorted candidate-pair key.
104
106
  const byPair = new Map();
@@ -117,7 +119,7 @@ export function annotateConsequences(candidates) {
117
119
  }
118
120
  }
119
121
  return candidates.map((c) => {
120
- if (c.verdict !== 'promising')
122
+ if (!isPromisingTier(c.verdict))
121
123
  return c;
122
124
  const key = [c.a, c.b].sort().join('~');
123
125
  const hit = byPair.get(key);
@@ -1 +1 @@
1
- {"version":3,"file":"consequence.js","sourceRoot":"","sources":["../../src/composition/consequence.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAwB/D,uDAAuD;AACvD,SAAS,aAAa,CAAC,CAA8B,EAAE,CAA8B;IACnF,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM;QAAE,OAAO,KAAK,CAAC;IACxC,MAAM,EAAE,GAAG,IAAI,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;IACzC,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;AACxC,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,gBAAgB,CAC9B,QAAoF,EACpF,SAAS,GAAiC,mBAAmB;IAE7D,MAAM,SAA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Q,CAAC,CAAC;YAChC,+FAA+F;YAC/F,IAAI,GAAG,CAAC,MAAM,KAAK,UAAU;gBAAE,GAAG,CAAC,MAAM,GAAG,UAAU,CAAC;QACzD,CAAC;IACH,CAAC;IAED,OAAO,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;QAC1B,IAAI,CAAC,CAAC,OAAO,KAAK,WAAW;YAAE,OAAO,CAAC,CAAC;QACxC,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACxC,MAAM,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAC5B,MAAM,MAAM,GAAsB,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,cAAc,CAAC;QACpE,OAAO,EAAE,GAAG,CAAC,EAAE,WAAW,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,EAAE,QAAQ,IAAI,EAAE,EAAE,EAAE,CAAC;IAC1E,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["/**\n * Consequence propagation — the machine pre-classifier for the human\n * adjudication ledger. A POST-PASS annotation over ranked candidates (mirrors\n * `annotateAdjudications`): reuse `deriveProposedBridges` to derive each\n * promising candidate's monomial consequence, then compare its `normalForm`\n * against the canonical registry (SAME target AND SAME governing set) to label\n * it `entailed` (re-derives known physics), `novel-consequence` (valid, no\n * match), or `inconclusive` (no monomial consequence). Annotation-only: never\n * mutates the catalog/graph, never re-orders or re-scores, never writes to\n * ADJUDICATIONS. The underlying ProposedBridge stays `status:'unadjudicated'`.\n *\n * @module composition/consequence\n */\nimport type { VettedCandidate } from './discovery.js';\nimport type { ProposedBridge } from './proposed-bridges.js';\nimport { deriveProposedBridges } from './proposed-bridges.js';\nimport { normalForm } from '../canonical/normal-form.js';\nimport { CANONICAL_EQUATIONS } from '../canonical/registry.js';\nimport type { CanonicalEquation } from '../canonical/canonical-equation.js';\n\n/** @public */\nexport type ConsequenceSignal = 'entailed' | 'novel-consequence' | 'inconclusive';\n\n/** @public */\nexport interface ConsequenceEvidence {\n readonly target: string;\n readonly governing: readonly string[];\n readonly derivedNormalForm: string;\n /** The id of the canonical equation whose normalForm matched, or null. */\n readonly canonicalMatch: string | null;\n readonly sourceEquationIds: readonly [string, string];\n}\n\n/** @public */\nexport type ConsequenceAnnotatedCandidate = VettedCandidate & {\n readonly consequence?: {\n readonly signal: ConsequenceSignal;\n readonly evidence: readonly ConsequenceEvidence[];\n };\n};\n\n/** Governing-name set equality (order-insensitive). */\nfunction sameGoverning(a: readonly { name: string }[], b: readonly { name: string }[]): boolean {\n if (a.length !== b.length) return false;\n const sa = new Set(a.map((g) => g.name));\n return b.every((g) => sa.has(g.name));\n}\n\n/**\n * Classify ONE derived proposal against the canonical registry.\n * `entailed` iff some canonical equation with a `scalarAst` has the SAME target\n * name AND SAME governing set AND a matching `normalForm`. Otherwise\n * `novel-consequence`. There is NO contradiction signal — a differing normalForm\n * for the same target is NOT a contradiction (design r2: E=mc² vs E=hf).\n * @public\n */\nexport function classifyProposal(\n proposal: Pick<ProposedBridge, 'target' | 'governing' | 'scalarAst' | 'derivedFrom'>,\n canonical: readonly CanonicalEquation[] = CANONICAL_EQUATIONS,\n): { readonly signal: Exclude<ConsequenceSignal, 'inconclusive'>; readonly evidence: ConsequenceEvidence } {\n const derivedNF = normalForm(proposal.scalarAst);\n let canonicalMatch: string | null = null;\n for (const ce of canonical) {\n if (!ce.scalarAst) continue;\n if (ce.dimensional.target.name !== proposal.target.name) continue;\n if (!sameGoverning(ce.dimensional.governing, proposal.governing)) continue;\n if (normalForm(ce.scalarAst) === derivedNF) {\n canonicalMatch = ce.id; // CanonicalEquation.id is a top-level `readonly id: string` (verified)\n break;\n }\n }\n return {\n signal: canonicalMatch ? 'entailed' : 'novel-consequence',\n evidence: {\n target: proposal.target.name,\n governing: proposal.governing.map((g) => g.name),\n derivedNormalForm: derivedNF,\n canonicalMatch,\n sourceEquationIds: proposal.derivedFrom.sourceEquationIds,\n },\n };\n}\n\n/**\n * What a derived proposal claims, in a form that travels with it: the premise,\n * whether it is a known law or a conditional identity, what the solved-for\n * symbol means, the source equations' assumptions, and the exact scope of the\n * canonical-match check.\n * @internal\n */\nexport interface DerivedClaim {\n /** The unadjudicated identification the relation rests on. */\n readonly premise: string;\n /** `known-law`: re-derives a registry equation. `conditional-identity`: holds only if the premise does. */\n readonly relation: 'known-law' | 'conditional-identity';\n /** No derived proposal has been confronted with a measurement. */\n readonly tested: false;\n readonly symbol: { readonly name: string; readonly fromEquation: string; readonly meaning: string };\n readonly assumptions: readonly { readonly equation: string; readonly assumptions: readonly string[] }[];\n readonly canonicalMatch: {\n readonly id: string | null;\n readonly sameTarget: number;\n readonly sameTargetAndGoverning: number;\n readonly scope: 'the canonical registry only';\n };\n}\n\ntype ClaimEquation = Pick<CanonicalEquation, 'id' | 'name' | 'assumptions' | 'scalarAst'> & {\n readonly dimensional: Pick<CanonicalEquation['dimensional'], 'target' | 'governing'>;\n};\n\n/**\n * Describe the claim a derived proposal makes. Pure; the proposal is unchanged.\n * @internal\n */\nexport function describeDerivedClaim(\n proposal: Pick<ProposedBridge, 'target' | 'governing' | 'scalarAst' | 'derivedFrom'>,\n canonical: readonly ClaimEquation[] = CANONICAL_EQUATIONS,\n): DerivedClaim {\n const { identification, sourceEquationIds, solvedFor } = proposal.derivedFrom;\n // `deriveProposedBridges` resolves the first source id for the smaller\n // endpoint name and the second for the larger, so each id's target is known\n // even when the source is a catalog bridge the canonical registry does not\n // hold (then `canonical.find` is undefined; the sentence once printed\n // \"equals ? (undefined)\" there, 9.0.0 audit §7 T1).\n const [t0, t1] = [identification.a, identification.b].sort();\n const endpointOf = (id: string): string => (id === sourceEquationIds[0] ? t0 : t1);\n const sources = sourceEquationIds\n .map((id) => canonical.find((e) => e.id === id))\n .filter((e): e is ClaimEquation => e !== undefined);\n const home = sources.find((e) => e.dimensional.governing.some((g) => g.name === solvedFor)) ?? sources[0];\n const homeId = home?.id ?? sourceEquationIds[0];\n const otherId = sourceEquationIds.find((id) => id !== homeId) ?? sourceEquationIds[1];\n const other = sources.find((e) => e.id === otherId);\n const homeTarget = home?.dimensional.target.name ?? endpointOf(homeId);\n const otherTarget = other?.dimensional.target.name ?? endpointOf(otherId);\n\n const derivedNF = normalForm(proposal.scalarAst);\n const sameTarget = canonical.filter((e) => e.scalarAst && e.dimensional.target.name === proposal.target.name);\n const sameGov = sameTarget.filter((e) => sameGoverning(e.dimensional.governing, proposal.governing));\n const match = sameGov.find((e) => normalForm(e.scalarAst!) === derivedNF);\n\n return {\n premise: `${identification.a} ≡ ${identification.b}`,\n relation: match ? 'known-law' : 'conditional-identity',\n tested: false,\n symbol: {\n name: solvedFor,\n fromEquation: homeId,\n meaning:\n `${solvedFor} is the ${solvedFor} of ${homeId}${home !== undefined ? ` (${home.name})` : ''}: the ${solvedFor} for which ` +\n `${homeTarget} equals ${otherTarget} (${otherId}) — an equal-${identification.dim} scale; ` +\n `the ${otherTarget} side is not given a ${solvedFor}`,\n },\n assumptions: sources.map((e) => ({ equation: e.id, assumptions: [...e.assumptions] })),\n canonicalMatch: {\n id: match?.id ?? null,\n sameTarget: sameTarget.length,\n sameTargetAndGoverning: sameGov.length,\n scope: 'the canonical registry only',\n },\n };\n}\n\n/**\n * Annotate ranked candidates with their consequence signal. Order-preserving,\n * 1:1 with the input; only `promising` candidates are classified (they are the\n * only ones `deriveProposedBridges` processes). A promising candidate with no\n * derived proposal is `inconclusive`. Generic over the input candidate type so\n * it composes with other post-pass annotators (e.g. `annotateAdjudications`)\n * without forgetting fields the caller already attached.\n * @public\n */\nexport function annotateConsequences<T extends VettedCandidate>(\n candidates: readonly T[],\n): readonly (T & {\n readonly consequence?: {\n readonly signal: ConsequenceSignal;\n readonly evidence: readonly ConsequenceEvidence[];\n };\n})[] {\n const promising = candidates.filter((c) => c.verdict === 'promising');\n const proposals = deriveProposedBridges(promising);\n\n // Group proposals + their classification by the sorted candidate-pair key.\n const byPair = new Map<string, { signal: ConsequenceSignal; evidence: ConsequenceEvidence[] }>();\n for (const p of proposals) {\n const key = [p.derivedFrom.identification.a, p.derivedFrom.identification.b].sort().join('~');\n const cls = classifyProposal(p);\n const cur = byPair.get(key);\n if (!cur) {\n byPair.set(key, { signal: cls.signal, evidence: [cls.evidence] });\n } else {\n cur.evidence.push(cls.evidence);\n // entailed dominates novel: if ANY consequence re-derives known physics, the pair is entailed.\n if (cls.signal === 'entailed') cur.signal = 'entailed';\n }\n }\n\n return candidates.map((c) => {\n if (c.verdict !== 'promising') return c;\n const key = [c.a, c.b].sort().join('~');\n const hit = byPair.get(key);\n const signal: ConsequenceSignal = hit ? hit.signal : 'inconclusive';\n return { ...c, consequence: { signal, evidence: hit?.evidence ?? [] } };\n });\n}\n"]}
1
+ {"version":3,"file":"consequence.js","sourceRoot":"","sources":["../../src/composition/consequence.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEjD,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAiC/D,uDAAuD;AACvD,SAAS,aAAa,CAAC,CAA8B,EAAE,CAA8B;IACnF,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM;QAAE,OAAO,KAAK,CAAC;IACxC,MAAM,EAAE,GAAG,IAAI,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;IACzC,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC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G,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;QACpE,CAAC;aAAM,CAAC;YACN,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;YAChC,+FAA+F;YAC/F,IAAI,GAAG,CAAC,MAAM,KAAK,UAAU;gBAAE,GAAG,CAAC,MAAM,GAAG,UAAU,CAAC;QACzD,CAAC;IACH,CAAC;IAED,OAAO,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;QAC1B,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,OAAO,CAAC;YAAE,OAAO,CAAC,CAAC;QAC1C,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACxC,MAAM,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAC5B,MAAM,MAAM,GAAsB,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,cAAc,CAAC;QACpE,OAAO,EAAE,GAAG,CAAC,EAAE,WAAW,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,EAAE,QAAQ,IAAI,EAAE,EAAE,EAAE,CAAC;IAC1E,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["/**\n * Consequence propagation — the machine pre-classifier for the human\n * adjudication ledger. A POST-PASS annotation over ranked candidates (mirrors\n * `annotateAdjudications`): reuse `deriveProposedBridges` to derive each\n * promising candidate's monomial consequence, then compare its `normalForm`\n * against the canonical registry (SAME target AND SAME governing set) to label\n * it `entailed` (re-derives known physics), `novel-consequence` (valid, no\n * match), or `inconclusive` (no monomial consequence). Annotation-only: never\n * mutates the catalog/graph, never re-orders or re-scores, never writes to\n * ADJUDICATIONS. The underlying ProposedBridge stays `status:'unadjudicated'`.\n *\n * @module composition/consequence\n */\nimport type { VettedCandidate } from './discovery.js';\nimport { isPromisingTier } from './discovery.js';\nimport type { ProposedBridge } from './proposed-bridges.js';\nimport { deriveProposedBridges } from './proposed-bridges.js';\nimport { normalForm } from '../canonical/normal-form.js';\nimport { CANONICAL_EQUATIONS } from '../canonical/registry.js';\nimport type { CanonicalEquation } from '../canonical/canonical-equation.js';\n\n/**\n * The consequence signal of a promising candidate: entailed, novel-consequence or inconclusive.\n * @public\n */\nexport type ConsequenceSignal = 'entailed' | 'novel-consequence' | 'inconclusive';\n\n/**\n * The evidence behind one consequence signal: the derived claim and any canonical match.\n * @public\n */\nexport interface ConsequenceEvidence {\n readonly target: string;\n readonly governing: readonly string[];\n readonly derivedNormalForm: string;\n /** The id of the canonical equation whose normalForm matched, or null. */\n readonly canonicalMatch: string | null;\n readonly sourceEquationIds: readonly [string, string];\n}\n\n/**\n * A vetted candidate, plus its optional consequence signal and evidence.\n * @public\n */\nexport type ConsequenceAnnotatedCandidate = VettedCandidate & {\n readonly consequence?: {\n readonly signal: ConsequenceSignal;\n readonly evidence: readonly ConsequenceEvidence[];\n };\n};\n\n/** Governing-name set equality (order-insensitive). */\nfunction sameGoverning(a: readonly { name: string }[], b: readonly { name: string }[]): boolean {\n if (a.length !== b.length) return false;\n const sa = new Set(a.map((g) => g.name));\n return b.every((g) => sa.has(g.name));\n}\n\n/**\n * Classify ONE derived proposal against the canonical registry.\n * `entailed` iff some canonical equation with a `scalarAst` has the SAME target\n * name AND SAME governing set AND a matching `normalForm`. Otherwise\n * `novel-consequence`. There is NO contradiction signal — a differing normalForm\n * for the same target is NOT a contradiction (design r2: E=mc² vs E=hf).\n * @public\n */\nexport function classifyProposal(\n proposal: Pick<ProposedBridge, 'target' | 'governing' | 'scalarAst' | 'derivedFrom'>,\n canonical: readonly CanonicalEquation[] = CANONICAL_EQUATIONS,\n): { readonly signal: Exclude<ConsequenceSignal, 'inconclusive'>; readonly evidence: ConsequenceEvidence } {\n const derivedNF = normalForm(proposal.scalarAst);\n let canonicalMatch: string | null = null;\n for (const ce of canonical) {\n if (!ce.scalarAst) continue;\n if (ce.dimensional.target.name !== proposal.target.name) continue;\n if (!sameGoverning(ce.dimensional.governing, proposal.governing)) continue;\n if (normalForm(ce.scalarAst) === derivedNF) {\n canonicalMatch = ce.id; // CanonicalEquation.id is a top-level `readonly id: string` (verified)\n break;\n }\n }\n return {\n signal: canonicalMatch ? 'entailed' : 'novel-consequence',\n evidence: {\n target: proposal.target.name,\n governing: proposal.governing.map((g) => g.name),\n derivedNormalForm: derivedNF,\n canonicalMatch,\n sourceEquationIds: proposal.derivedFrom.sourceEquationIds,\n },\n };\n}\n\n/**\n * What a derived proposal claims, in a form that travels with it: the premise,\n * whether it is a known law or a conditional identity, what the solved-for\n * symbol means, the source equations' assumptions, and the exact scope of the\n * canonical-match check.\n * @internal\n */\nexport interface DerivedClaim {\n /** The unadjudicated identification the relation rests on. */\n readonly premise: string;\n /** `known-law`: re-derives a registry equation. `conditional-identity`: holds only if the premise does. */\n readonly relation: 'known-law' | 'conditional-identity';\n /** No derived proposal has been confronted with a measurement. */\n readonly tested: false;\n readonly symbol: { readonly name: string; readonly fromEquation: string; readonly meaning: string };\n readonly assumptions: readonly { readonly equation: string; readonly assumptions: readonly string[] }[];\n readonly canonicalMatch: {\n readonly id: string | null;\n readonly sameTarget: number;\n readonly sameTargetAndGoverning: number;\n readonly scope: 'the canonical registry only';\n };\n}\n\ntype ClaimEquation = Pick<CanonicalEquation, 'id' | 'name' | 'assumptions' | 'scalarAst'> & {\n readonly dimensional: Pick<CanonicalEquation['dimensional'], 'target' | 'governing'>;\n};\n\n/**\n * Describe the claim a derived proposal makes. Pure; the proposal is unchanged.\n * @internal\n */\nexport function describeDerivedClaim(\n proposal: Pick<ProposedBridge, 'target' | 'governing' | 'scalarAst' | 'derivedFrom'>,\n canonical: readonly ClaimEquation[] = CANONICAL_EQUATIONS,\n): DerivedClaim {\n const { identification, sourceEquationIds, solvedFor } = proposal.derivedFrom;\n // `deriveProposedBridges` resolves the first source id for the smaller\n // endpoint name and the second for the larger, so each id's target is known\n // even when the source is a catalog bridge the canonical registry does not\n // hold (then `canonical.find` is undefined; the sentence once printed\n // \"equals ? (undefined)\" there, 9.0.0 audit §7 T1).\n const [t0, t1] = [identification.a, identification.b].sort();\n const endpointOf = (id: string): string => (id === sourceEquationIds[0] ? t0 : t1);\n const sources = sourceEquationIds\n .map((id) => canonical.find((e) => e.id === id))\n .filter((e): e is ClaimEquation => e !== undefined);\n const home = sources.find((e) => e.dimensional.governing.some((g) => g.name === solvedFor)) ?? sources[0];\n const homeId = home?.id ?? sourceEquationIds[0];\n const otherId = sourceEquationIds.find((id) => id !== homeId) ?? sourceEquationIds[1];\n const other = sources.find((e) => e.id === otherId);\n const homeTarget = home?.dimensional.target.name ?? endpointOf(homeId);\n const otherTarget = other?.dimensional.target.name ?? endpointOf(otherId);\n\n const derivedNF = normalForm(proposal.scalarAst);\n const sameTarget = canonical.filter((e) => e.scalarAst && e.dimensional.target.name === proposal.target.name);\n const sameGov = sameTarget.filter((e) => sameGoverning(e.dimensional.governing, proposal.governing));\n const match = sameGov.find((e) => normalForm(e.scalarAst!) === derivedNF);\n\n return {\n premise: `${identification.a} ≡ ${identification.b}`,\n relation: match ? 'known-law' : 'conditional-identity',\n tested: false,\n symbol: {\n name: solvedFor,\n fromEquation: homeId,\n meaning:\n `${solvedFor} is the ${solvedFor} of ${homeId}${home !== undefined ? ` (${home.name})` : ''}: the ${solvedFor} for which ` +\n `${homeTarget} equals ${otherTarget} (${otherId}) — an equal-${identification.dim} scale; ` +\n `the ${otherTarget} side is not given a ${solvedFor}`,\n },\n assumptions: sources.map((e) => ({ equation: e.id, assumptions: [...e.assumptions] })),\n canonicalMatch: {\n id: match?.id ?? null,\n sameTarget: sameTarget.length,\n sameTargetAndGoverning: sameGov.length,\n scope: 'the canonical registry only',\n },\n };\n}\n\n/**\n * Annotate ranked candidates with their consequence signal. Order-preserving,\n * 1:1 with the input; only candidates in a promising tier (`promising` or\n * `promising-unchecked`) are classified (they are the only ones\n * `deriveProposedBridges` processes). A promising candidate with no\n * derived proposal is `inconclusive`. Generic over the input candidate type so\n * it composes with other post-pass annotators (e.g. `annotateAdjudications`)\n * without forgetting fields the caller already attached.\n * @public\n */\nexport function annotateConsequences<T extends VettedCandidate>(\n candidates: readonly T[],\n): readonly (T & {\n readonly consequence?: {\n readonly signal: ConsequenceSignal;\n readonly evidence: readonly ConsequenceEvidence[];\n };\n})[] {\n const promising = candidates.filter((c) => isPromisingTier(c.verdict));\n const proposals = deriveProposedBridges(promising);\n\n // Group proposals + their classification by the sorted candidate-pair key.\n const byPair = new Map<string, { signal: ConsequenceSignal; evidence: ConsequenceEvidence[] }>();\n for (const p of proposals) {\n const key = [p.derivedFrom.identification.a, p.derivedFrom.identification.b].sort().join('~');\n const cls = classifyProposal(p);\n const cur = byPair.get(key);\n if (!cur) {\n byPair.set(key, { signal: cls.signal, evidence: [cls.evidence] });\n } else {\n cur.evidence.push(cls.evidence);\n // entailed dominates novel: if ANY consequence re-derives known physics, the pair is entailed.\n if (cls.signal === 'entailed') cur.signal = 'entailed';\n }\n }\n\n return candidates.map((c) => {\n if (!isPromisingTier(c.verdict)) return c;\n const key = [c.a, c.b].sort().join('~');\n const hit = byPair.get(key);\n const signal: ConsequenceSignal = hit ? hit.signal : 'inconclusive';\n return { ...c, consequence: { signal, evidence: hit?.evidence ?? [] } };\n });\n}\n"]}
@@ -38,6 +38,7 @@ import type { QuantityIdentification } from './compose.js';
38
38
  import type { RegimeAttributes } from './quantity.js';
39
39
  import type { LinkCandidate } from './bridge-analysis.js';
40
40
  import type { RepresentativeValue } from './representative-values.js';
41
+ import type { DerivedMagnitudes } from './own-equation-magnitude.js';
41
42
  /** The canonical quantity→attributes map (registry nodes + per-equation stamps).
42
43
  * Exported for the axis-discrimination audit. @internal */
43
44
  export declare const REGISTRY_ATTRIBUTES_BY_NAME: ReadonlyMap<string, RegimeAttributes>;
@@ -83,7 +84,8 @@ export interface VettedCandidate {
83
84
  * The calibrated STRENGTH of the magnitude falsifier against the two values' stated
84
85
  * uncertainties: `2·Φ(−ordersApart / √(σ_a² + σ_b²))`, with σ in decades per representative
85
86
  * value (`sigmaDecades`, default one decade: the table's "good to about one order"; an
86
- * anchor-derived value takes the default), through MathTS `normalCDF` of the negative
87
+ * anchor-derived value takes the default; a value from the quantity's own equation, its
88
+ * propagated σ), through MathTS `normalCDF` of the negative
87
89
  * argument so a far tail is not rounded to 0 by `1 − cdf`. It is reported BESIDE the verdict
88
90
  * and changes no verdict: the clash threshold stays `ordersApart > maxOrders`. A small p says
89
91
  * the two magnitudes are hard to reconcile at their stated precision; 2.9 decades at σ = 1
@@ -95,7 +97,10 @@ export interface VettedCandidate {
95
97
  /** Both endpoints had a representative value, so the magnitude gate ran. */
96
98
  readonly magnitudeChecked: boolean;
97
99
  /** The magnitude gate read at least one endpoint value from the graph at
98
- * the anchor (no static table entry) rather than the sourced table. */
100
+ * the anchor (no static table entry) rather than the sourced table. A value
101
+ * the graph computes from registered constants alone, with no anchor input
102
+ * (the target of a source-less equation), is a constant and is not
103
+ * anchor-derived. */
99
104
  readonly magnitudeUsedAnchor: boolean;
100
105
  /**
101
106
  * The magnitude comparison used an anchor-derived value, and the ratio of the
@@ -106,17 +111,30 @@ export interface VettedCandidate {
106
111
  * the temperature to the Hawking temperature of the anchor mass M, and then
107
112
  * the thermal wavelength is exactly 4π ℓ_P for EVERY M. Its anchor-derived
108
113
  * magnitude is not a representative magnitude of the quantity at all.
109
- * A quantity whose value really is a constant belongs in the
110
- * representative-value table, where it is not anchor-derived.
114
+ * A quantity whose value really is a constant is not anchor-derived: the
115
+ * sourced table states it, or the graph computes it from registered constants
116
+ * with no anchor input (`DiscoveryContext.constantValues`), and the probe does
117
+ * not withhold a comparison of two such values, which can fail by the clash
118
+ * threshold.
111
119
  * A clash stays a clash (the graph itself fixes the two apart); only a pass is
112
120
  * withheld, in `describeGrounding`. Optional on the type so hand-built
113
121
  * candidates need not state it; the funnel always sets it.
114
122
  */
115
123
  readonly magnitudeAnchorInvariant?: boolean;
116
124
  /**
117
- * The endpoints with no representative magnitude (neither in the sourced
118
- * table nor valued at the anchor) — why the magnitude gate abstained. Empty
119
- * when it ran. Optional on the type; the funnel always sets it.
125
+ * The endpoints whose magnitude the gate took from the quantity's own equation
126
+ * (`own-equation-magnitude.ts`): no table value and no no-anchor constant, but
127
+ * an edge into it whose every source the table or the constants value, at a
128
+ * propagated σ within one decade. Such a value is not anchor-derived. Empty
129
+ * when neither endpoint's magnitude came from there. Optional on the type; the
130
+ * funnel always sets it.
131
+ */
132
+ readonly magnitudeDerived?: readonly string[];
133
+ /**
134
+ * The endpoints with no representative magnitude (not in the sourced table,
135
+ * not a no-anchor constant, not derived from their own equation, not valued
136
+ * at the anchor) — why the magnitude gate abstained. Empty when it ran.
137
+ * Optional on the type; the funnel always sets it.
120
138
  */
121
139
  readonly magnitudeMissing?: readonly string[];
122
140
  /**
@@ -145,11 +163,18 @@ export interface VettedCandidate {
145
163
  * compares catalog labels and runs no computation, so
146
164
  * it is never counted or described as a falsification.
147
165
  * - `promising` — consistent AND connects disconnected physics AND
148
- * unlocks ≥1 quantity. Worth physicist review.
166
+ * unlocks ≥1 quantity, AND the magnitude falsifier ran
167
+ * and could have failed ({@link hasMagnitudeEvidence}).
168
+ * Worth physicist review.
169
+ * - `promising-unchecked` — the same structure, but the magnitude falsifier
170
+ * never tested it: it abstained (an endpoint has no
171
+ * representative magnitude) or its pass is anchor-invariant
172
+ * and so could not fail. A separate count, never added to
173
+ * `promising` (AGENTS law 4).
149
174
  * - `inert` — consistent but structurally/numerically idle (a
150
175
  * dimensional coincidence with no consequence).
151
176
  */
152
- readonly verdict: 'promising' | 'inert' | 'contradictory' | 'magnitude-clash' | 'axis-clash';
177
+ readonly verdict: 'promising' | 'promising-unchecked' | 'inert' | 'contradictory' | 'magnitude-clash' | 'axis-clash';
153
178
  /** Composite ranking score (higher = more worth review). */
154
179
  readonly score: number;
155
180
  /**
@@ -177,6 +202,23 @@ export interface VettedCandidate {
177
202
  * (weak name-based prior; informational). */
178
203
  readonly touchesCanonical: boolean;
179
204
  }
205
+ /**
206
+ * Whether the magnitude falsifier ran on a candidate AND could have failed: both endpoints had a
207
+ * representative magnitude (`magnitudeChecked`) and the comparison is not anchor-invariant. An
208
+ * anchor-invariant pass is fixed by the graph at every anchor, so it cannot fail and is not a
209
+ * check (AGENTS law 2). The one owner of this predicate: the verdict split between `promising`
210
+ * and `promising-unchecked`, the CLI readiness count and the grounding ledger all read it.
211
+ * @internal
212
+ */
213
+ export declare function hasMagnitudeEvidence(c: Pick<VettedCandidate, 'magnitudeChecked' | 'magnitudeAnchorInvariant'>): boolean;
214
+ /**
215
+ * Whether a verdict is one of the two promising tiers, `promising` (with magnitude evidence) or
216
+ * `promising-unchecked` (without): the structural set the consequence and proposal layers
217
+ * process, so splitting the tiers loses no proposal. A selector, never a count: the two tiers are
218
+ * reported apart and never added (AGENTS law 4).
219
+ * @internal
220
+ */
221
+ export declare function isPromisingTier(verdict: VettedCandidate['verdict']): boolean;
180
222
  /** Options for the discovery loop. @internal */
181
223
  export interface DiscoveryOptions {
182
224
  /**
@@ -243,6 +285,19 @@ export interface DiscoveryContext {
243
285
  readonly attributesByName: ReadonlyMap<string, RegimeAttributes>;
244
286
  /** `forwardEvaluate(edges, groundTruth, baseIdents)` — anchor magnitudes. */
245
287
  readonly anchorValues: ReadonlyMap<string, number>;
288
+ /**
289
+ * `forwardEvaluate(edges, {}, baseIdents)` — the values the graph fixes with NO anchor input:
290
+ * the targets of source-less equations (an all-constant right-hand side such as the Rydberg
291
+ * energy or the Planck length) and whatever they alone determine. Such a value is a constant,
292
+ * not an anchor-derived magnitude, so the magnitude gate reads it as `fromAnchor: false`.
293
+ */
294
+ readonly constantValues: ReadonlyMap<string, number>;
295
+ /**
296
+ * The magnitudes the graph derives from the sourced table and the constants alone, never from
297
+ * the anchor (`deriveOwnEquationMagnitudes`), with every refusal and its reason: a σ above one
298
+ * decade, two disagreeing edges, or a σ that could not be measured.
299
+ */
300
+ readonly derivedMagnitudes: DerivedMagnitudes;
246
301
  /** The same evaluation with every anchor input times {@link ANCHOR_PROBE_FACTOR}. */
247
302
  readonly anchorValuesProbe: ReadonlyMap<string, number>;
248
303
  /** `quantityComponents(edges, baseIdents)` — base component roots. */
@@ -264,6 +319,8 @@ export declare function buildDiscoveryContext(edges: readonly BridgeEdge[], opts
264
319
  interface GateMagnitude {
265
320
  readonly value: number;
266
321
  readonly fromAnchor: boolean;
322
+ /** Derived from the quantity's own equation (`ctx.derivedMagnitudes`). */
323
+ readonly fromOwnEquation: boolean;
267
324
  readonly sigmaDecades: number;
268
325
  }
269
326
  /** What the magnitude gate found for one candidate. @internal */
@@ -281,6 +338,8 @@ export interface MagnitudeGate {
281
338
  readonly p: number | null;
282
339
  /** The endpoints with no magnitude (why the gate abstained); empty when it ran. */
283
340
  readonly missing: readonly string[];
341
+ /** The endpoints whose magnitude came from their own equation, in candidate order. */
342
+ readonly derived: readonly string[];
284
343
  }
285
344
  /**
286
345
  * The two-sided tail of a gap of `orders` decades between two values whose log10 carry
@@ -294,10 +353,14 @@ export declare function magnitudeStrength(orders: number, sigmaA: number, sigmaB
294
353
  /**
295
354
  * The magnitude gate: an INDEPENDENT falsifier the single-anchor graph cannot make. It runs only
296
355
  * when both endpoints have a representative value and abstains (never false-rejects) otherwise.
297
- * A value comes from the sourced static table first, else — for graph-derived quantities the
298
- * table omits by design (schwarzschild-radius, thermal-de-broglie-wavelength) — from the
299
- * quantity's value AT THE REGISTERED ANCHOR, a definite magnitude for this run, with the default
300
- * σ of one decade. The verdict is `ordersApart > ctx.maxOrders`; `p` is reported beside it.
356
+ * A value comes from the sourced static table first; else from the value the graph fixes with NO
357
+ * anchor input (a constant computed from registered constants alone, `ctx.constantValues`: not
358
+ * anchor-derived); else from the quantity's own equation evaluated from the table and the
359
+ * constants (`ctx.derivedMagnitudes`, at its propagated σ, never above one decade: not
360
+ * anchor-derived); else — for graph-derived quantities the table omits by design
361
+ * (schwarzschild-radius, thermal-de-broglie-wavelength) — from the quantity's value AT THE
362
+ * REGISTERED ANCHOR, a definite magnitude for this run. The constant and the anchor value take the
363
+ * default σ of one decade. The verdict is `ordersApart > ctx.maxOrders`; `p` is reported beside it.
301
364
  *
302
365
  * @internal
303
366
  */
@@ -320,7 +383,8 @@ export declare function vetLinkCandidate(edges: readonly BridgeEdge[], candidate
320
383
  export declare function vetInContext(edges: readonly BridgeEdge[], candidate: LinkCandidate, ctx: DiscoveryContext): VettedCandidate;
321
384
  /**
322
385
  * Run the full discovery funnel: propose cross-cluster candidates, vet each
323
- * against the inference suite, and rank — `promising` first, then by score.
386
+ * against the inference suite, and rank — `promising` first, then `promising-unchecked`, then
387
+ * the rest, and by score within a verdict.
324
388
  * The output is the physicist's worklist (vetted, provenance-traced), not a
325
389
  * list of discoveries.
326
390
  *
@@ -1 +1 @@
1
- {"version":3,"file":"discovery.d.ts","sourceRoot":"","sources":["../../src/composition/discovery.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAG3D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAItD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAK1D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAYtE;4DAC4D;AAC5D,eAAO,MAAM,2BAA2B,EAAE,WAAW,CAAC,MAAM,EAAE,gBAAgB,CAE7E,CAAC;AA+BF,iFAAiF;AACjF,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,+CAA+C;IAC/C,QAAQ,CAAC,GAAG,EAAE,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