@orangecharts/wrun-chart-host 0.11.0 → 0.14.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 (311) hide show
  1. package/README.md +1 -0
  2. package/dist/constants/feature-flags.constants.d.ts +3 -4
  3. package/dist/constants/feature-flags.constants.js +34 -52
  4. package/dist/constants/feature-limits.constants.d.ts +1 -1
  5. package/dist/constants/feature-limits.constants.js +5 -4
  6. package/dist/constants/interval.constants.d.ts +7 -0
  7. package/dist/constants/interval.constants.js +7 -0
  8. package/dist/constants/scriptEditor/cme-official-scripts.constants.d.ts +20 -149
  9. package/dist/constants/scriptEditor/cme-official-scripts.constants.js +20 -309
  10. package/dist/constants/stocks-compliance.constants.d.ts +15 -0
  11. package/dist/constants/stocks-compliance.constants.js +15 -0
  12. package/dist/host-env.d.ts +55 -3
  13. package/dist/host-env.js +6 -0
  14. package/dist/host-ports.types.d.ts +36 -3
  15. package/dist/index.d.ts +18 -0
  16. package/dist/index.js +19 -0
  17. package/dist/indicators/controls/tpo-session.util.d.ts +78 -15
  18. package/dist/indicators/controls/tpo-session.util.js +320 -242
  19. package/dist/instances/script-engine-worker-ohlcv-transfer.d.ts +6 -0
  20. package/dist/instances/script-engine-worker-ohlcv-transfer.js +16 -0
  21. package/dist/interfaces/cme-realtime.interface.d.ts +8 -0
  22. package/dist/interfaces/cme-realtime.interface.js +2 -1
  23. package/dist/interfaces/feed.interface.d.ts +15 -1
  24. package/dist/interfaces/replay.interface.d.ts +5 -0
  25. package/dist/interfaces/stocks-realtime.interface.d.ts +4 -3
  26. package/dist/interfaces/stocks-realtime.interface.js +5 -4
  27. package/dist/interfaces/wrun-runtime.interface.d.ts +97 -19
  28. package/dist/kscript-data/controls/live-ohlcv-merge.util.d.ts +17 -0
  29. package/dist/kscript-data/controls/live-ohlcv-merge.util.js +22 -0
  30. package/dist/kscript-data/controls/live-trades-merge.util.d.ts +46 -40
  31. package/dist/kscript-data/controls/live-trades-merge.util.js +80 -107
  32. package/dist/market-data/billing.interface.d.ts +9 -1
  33. package/dist/market-data/venue.d.ts +1 -1
  34. package/dist/market-data/venues/index.d.ts +4 -4
  35. package/dist/market-data/venues/stocks.contract.copy.json +4 -4
  36. package/dist/market-data/venues/stocks.d.ts +4 -4
  37. package/dist/market-data/venues/stocks.js +15 -13
  38. package/dist/settings-templates/frvp-fields.d.ts +12 -1
  39. package/dist/settings-templates/frvp-fields.js +15 -4
  40. package/dist/settings-templates/index.js +12 -5
  41. package/dist/settings-templates/indicator-fields.js +28 -2
  42. package/dist/settings-templates/tool-rules.d.ts +17 -8
  43. package/dist/settings-templates/tool-rules.js +15 -8
  44. package/dist/settings-templates/tool-tables.generated.js +4 -2
  45. package/dist/utility/auth/server-clock.util.d.ts +3 -1
  46. package/dist/utility/auth/server-clock.util.js +3 -1
  47. package/dist/utility/chart/book-live-bucket.util.js +2 -2
  48. package/dist/utility/chart/cache-alignment.util.d.ts +15 -7
  49. package/dist/utility/chart/cache-alignment.util.js +14 -7
  50. package/dist/utility/chart/chart-data-fetch-generation.util.d.ts +2 -0
  51. package/dist/utility/chart/chart-data-fetch-generation.util.js +16 -0
  52. package/dist/utility/chart/cme-session-bucket.util.d.ts +18 -75
  53. package/dist/utility/chart/cme-session-bucket.util.js +25 -332
  54. package/dist/utility/chart/continuous-contracts.util.js +6 -5
  55. package/dist/utility/chart/display-offset.leaf.d.ts +24 -0
  56. package/dist/utility/chart/display-offset.leaf.js +41 -0
  57. package/dist/utility/chart/effective-chart-session.util.d.ts +2 -1
  58. package/dist/utility/chart/effective-chart-session.util.js +13 -5
  59. package/dist/utility/chart/feed-interval.util.d.ts +6 -20
  60. package/dist/utility/chart/feed-interval.util.js +13 -22
  61. package/dist/utility/chart/fetch-dedupe-policy.util.d.ts +27 -7
  62. package/dist/utility/chart/fetch-dedupe-policy.util.js +86 -11
  63. package/dist/utility/chart/host-bar-placement.util.d.ts +7 -4
  64. package/dist/utility/chart/host-bar-placement.util.js +8 -2
  65. package/dist/utility/chart/indicator-inflight-registry.util.d.ts +32 -0
  66. package/dist/utility/chart/indicator-inflight-registry.util.js +52 -0
  67. package/dist/utility/chart/indicator-run-interval.util.d.ts +10 -4
  68. package/dist/utility/chart/indicator-run-interval.util.js +21 -12
  69. package/dist/utility/chart/interval-registry.util.d.ts +1 -1
  70. package/dist/utility/chart/interval-registry.util.js +1 -1
  71. package/dist/utility/chart/kscript-legend-entries.util.d.ts +12 -0
  72. package/dist/utility/chart/kscript-legend-entries.util.js +16 -0
  73. package/dist/utility/chart/kscript-run-interval-projection.util.d.ts +1 -1
  74. package/dist/utility/chart/kscript-run-interval-projection.util.js +4 -2
  75. package/dist/utility/chart/kscript-venue-policy.util.d.ts +53 -62
  76. package/dist/utility/chart/kscript-venue-policy.util.js +85 -94
  77. package/dist/utility/chart/live-bucket.util.d.ts +39 -17
  78. package/dist/utility/chart/live-bucket.util.js +103 -57
  79. package/dist/utility/chart/local-kscript-source-revalidation.util.d.ts +58 -20
  80. package/dist/utility/chart/local-kscript-source-revalidation.util.js +98 -23
  81. package/dist/utility/chart/local-kscript-warmup-depth.util.d.ts +35 -11
  82. package/dist/utility/chart/local-kscript-warmup-depth.util.js +24 -3
  83. package/dist/utility/chart/market-session-schedule.util.d.ts +8 -0
  84. package/dist/utility/chart/market-session-schedule.util.js +39 -1
  85. package/dist/utility/chart/market-session.util.d.ts +136 -0
  86. package/dist/utility/chart/market-session.util.js +341 -0
  87. package/dist/utility/chart/market-sessions.util.d.ts +83 -0
  88. package/dist/utility/chart/market-sessions.util.js +220 -0
  89. package/dist/utility/chart/om-panel.util.d.ts +5 -3
  90. package/dist/utility/chart/om-panel.util.js +42 -7
  91. package/dist/utility/chart/om-target.util.d.ts +14 -1
  92. package/dist/utility/chart/om-target.util.js +22 -5
  93. package/dist/utility/chart/opra-read-access.leaf.d.ts +16 -1
  94. package/dist/utility/chart/opra-read-access.leaf.js +22 -0
  95. package/dist/utility/chart/profile-row-height.util.d.ts +49 -16
  96. package/dist/utility/chart/profile-row-height.util.js +74 -37
  97. package/dist/utility/chart/rth-session.util.d.ts +55 -20
  98. package/dist/utility/chart/rth-session.util.js +94 -46
  99. package/dist/utility/chart/session-interval.util.d.ts +2 -1
  100. package/dist/utility/chart/session-interval.util.js +1 -3
  101. package/dist/utility/chart/session-lattice.util.d.ts +150 -0
  102. package/dist/utility/chart/session-lattice.util.js +488 -0
  103. package/dist/utility/chart/trading-day.util.d.ts +40 -2
  104. package/dist/utility/chart/trading-day.util.js +84 -7
  105. package/dist/utility/chart/us-equities-session.util.d.ts +32 -11
  106. package/dist/utility/chart/us-equities-session.util.js +44 -15
  107. package/dist/utility/chart/window-geometry.leaf.d.ts +28 -7
  108. package/dist/utility/chart/window-geometry.leaf.js +57 -8
  109. package/dist/utility/chart/wrun-bar-session-facts.util.d.ts +21 -14
  110. package/dist/utility/chart/wrun-bar-session-facts.util.js +32 -38
  111. package/dist/utility/chart/wrun-run-result.util.d.ts +29 -12
  112. package/dist/utility/chart/wrun-run-result.util.js +89 -25
  113. package/dist/utility/common/time.util.js +5 -4
  114. package/dist/utility/market-events/earnings-scope.util.d.ts +10 -5
  115. package/dist/utility/market-events/earnings-scope.util.js +17 -9
  116. package/dist/utility/market-events/market-events.util.d.ts +14 -7
  117. package/dist/utility/market-events/market-events.util.js +30 -17
  118. package/dist/utility/number-format.util.d.ts +14 -21
  119. package/dist/utility/number-format.util.js +38 -24
  120. package/dist/utility/options/option-venue-disclosure.util.d.ts +40 -6
  121. package/dist/utility/options/option-venue-disclosure.util.js +71 -11
  122. package/dist/utility/options/option-venue.util.d.ts +1 -1
  123. package/dist/utility/options/option-venue.util.js +1 -1
  124. package/dist/utility/pool-symbol.leaf.d.ts +7 -0
  125. package/dist/utility/pool-symbol.leaf.js +50 -5
  126. package/dist/utility/stocks/stock-display.util.d.ts +15 -0
  127. package/dist/utility/stocks/stock-display.util.js +37 -0
  128. package/dist/utility/symbol-selection/contract-expiry.util.js +5 -4
  129. package/dist/utility/v2/gate-plane.util.d.ts +6 -0
  130. package/dist/utility/v2/gate-plane.util.js +11 -1
  131. package/dist/utility/v2/gate-session-latch.util.d.ts +1 -1
  132. package/dist/utility/v2/gate-session-latch.util.js +3 -3
  133. package/dist/utility/v2/governed-tier.leaf.d.ts +17 -16
  134. package/dist/utility/v2/governed-tier.leaf.js +17 -16
  135. package/dist/utility/v2/stocks-governed.util.d.ts +5 -0
  136. package/dist/utility/v2/stocks-governed.util.js +14 -0
  137. package/dist/utility/v2/v2-enums.leaf.d.ts +13 -0
  138. package/dist/utility/v2/v2-enums.leaf.js +458 -0
  139. package/dist/utility/wrun/derived-roots.leaf.d.ts +21 -1
  140. package/dist/utility/wrun/derived-roots.leaf.js +27 -1
  141. package/dist/utility/wrun/derived-roots.util.d.ts +44 -32
  142. package/dist/utility/wrun/derived-roots.util.js +97 -56
  143. package/dist/utility/wrun/run-schedule/wrun-late-reads.util.d.ts +4 -3
  144. package/dist/utility/wrun/run-schedule/wrun-late-reads.util.js +4 -3
  145. package/dist/utility/wrun/sources/lanes/option_daily.d.ts +2 -1
  146. package/dist/utility/wrun/sources/lanes/option_daily.js +2 -1
  147. package/dist/utility/wrun/sources/lanes/options_flow.d.ts +3 -0
  148. package/dist/utility/wrun/sources/lanes/options_flow.js +23 -5
  149. package/dist/utility/wrun/sources/opra-option-lanes.util.d.ts +3 -4
  150. package/dist/utility/wrun/sources/row-lane-registry.js +9 -4
  151. package/dist/utility/wrun/sources/row-lanes/dark_pool.d.ts +19 -0
  152. package/dist/utility/wrun/sources/row-lanes/dark_pool.js +104 -0
  153. package/dist/utility/wrun/sources/row-lanes/index.js +2 -0
  154. package/dist/utility/wrun/sources/wrun-lane-fetch-abort.util.d.ts +20 -0
  155. package/dist/utility/wrun/sources/wrun-lane-fetch-abort.util.js +103 -0
  156. package/dist/utility/wrun/sources/wrun-poll-lane.types.d.ts +19 -2
  157. package/dist/utility/wrun/sources/wrun-poll-lanes.util.d.ts +15 -13
  158. package/dist/utility/wrun/sources/wrun-poll-lanes.util.js +49 -23
  159. package/dist/utility/wrun/sources/wrun-row-lane.types.d.ts +14 -9
  160. package/dist/utility/wrun/sources/wrun-row-lanes.util.d.ts +75 -27
  161. package/dist/utility/wrun/sources/wrun-row-lanes.util.js +139 -82
  162. package/dist/utility/wrun/wrun-app-layer.leaf.d.ts +78 -0
  163. package/dist/utility/wrun/wrun-app-layer.leaf.js +89 -0
  164. package/dist/utility/wrun/wrun-bar-count.util.d.ts +11 -7
  165. package/dist/utility/wrun/wrun-bar-count.util.js +12 -8
  166. package/dist/utility/wrun/wrun-batched-kinds.leaf.d.ts +13 -0
  167. package/dist/utility/wrun/wrun-batched-kinds.leaf.js +18 -0
  168. package/dist/utility/wrun/wrun-batched-marks.util.d.ts +41 -22
  169. package/dist/utility/wrun/wrun-batched-marks.util.js +255 -59
  170. package/dist/utility/wrun/wrun-batched-readout.util.d.ts +26 -19
  171. package/dist/utility/wrun/wrun-batched-readout.util.js +81 -27
  172. package/dist/utility/wrun/wrun-book-bands.leaf.d.ts +8 -0
  173. package/dist/utility/wrun/wrun-book-bands.leaf.js +7 -0
  174. package/dist/utility/wrun/wrun-candle-equal.leaf.d.ts +19 -0
  175. package/dist/utility/wrun/wrun-candle-equal.leaf.js +40 -0
  176. package/dist/utility/wrun/wrun-canvas-readout.util.d.ts +4 -2
  177. package/dist/utility/wrun/wrun-canvases.util.js +7 -3
  178. package/dist/utility/wrun/wrun-chart-context-names.util.d.ts +6 -3
  179. package/dist/utility/wrun/wrun-chart-context-names.util.js +8 -4
  180. package/dist/utility/wrun/wrun-chart-market-facts.util.d.ts +47 -29
  181. package/dist/utility/wrun/wrun-chart-market-facts.util.js +201 -201
  182. package/dist/utility/wrun/wrun-child-overlay-id.util.js +2 -1
  183. package/dist/utility/wrun/wrun-cme-legs-note.util.d.ts +15 -0
  184. package/dist/utility/wrun/wrun-cme-legs-note.util.js +49 -0
  185. package/dist/utility/wrun/wrun-cme-root-specs.util.d.ts +38 -0
  186. package/dist/utility/wrun/wrun-cme-root-specs.util.js +81 -0
  187. package/dist/utility/wrun/wrun-coin-lane-live.util.js +3 -0
  188. package/dist/utility/wrun/wrun-color-settings.util.d.ts +6 -1
  189. package/dist/utility/wrun/wrun-color-settings.util.js +32 -7
  190. package/dist/utility/wrun/wrun-dark-pool.util.d.ts +50 -0
  191. package/dist/utility/wrun/wrun-dark-pool.util.js +127 -0
  192. package/dist/utility/wrun/wrun-declared-warmup.util.d.ts +67 -12
  193. package/dist/utility/wrun/wrun-declared-warmup.util.js +165 -13
  194. package/dist/utility/wrun/wrun-draft-legend-note.util.d.ts +18 -8
  195. package/dist/utility/wrun/wrun-draft-legend-note.util.js +57 -11
  196. package/dist/utility/wrun/wrun-draft-overlay.util.d.ts +14 -10
  197. package/dist/utility/wrun/wrun-draft-overlay.util.js +26 -14
  198. package/dist/utility/wrun/wrun-earnings-facts.util.js +3 -2
  199. package/dist/utility/wrun/wrun-etf-funds.util.d.ts +2 -0
  200. package/dist/utility/wrun/wrun-etf-funds.util.js +4 -0
  201. package/dist/utility/wrun/wrun-held-lanes.util.js +8 -2
  202. package/dist/utility/wrun/wrun-history-as-of.util.d.ts +77 -0
  203. package/dist/utility/wrun/wrun-history-as-of.util.js +108 -0
  204. package/dist/utility/wrun/wrun-host.service.d.ts +64 -14
  205. package/dist/utility/wrun/wrun-host.service.js +137 -27
  206. package/dist/utility/wrun/wrun-hosted-wire-caps.d.ts +3 -3
  207. package/dist/utility/wrun/wrun-hosted-wire-caps.js +12 -2
  208. package/dist/utility/wrun/wrun-inert-legend.util.d.ts +13 -0
  209. package/dist/utility/wrun/wrun-inert-legend.util.js +31 -3
  210. package/dist/utility/wrun/wrun-input-requirements.leaf.d.ts +7 -5
  211. package/dist/utility/wrun/wrun-input-requirements.leaf.js +16 -6
  212. package/dist/utility/wrun/wrun-install-pacer.util.d.ts +26 -0
  213. package/dist/utility/wrun/wrun-install-pacer.util.js +145 -0
  214. package/dist/utility/wrun/wrun-kit-refusal-stages.types.d.ts +22 -0
  215. package/dist/utility/wrun/wrun-kit-refusal-stages.types.js +1 -0
  216. package/dist/utility/wrun/wrun-lane-refusal.leaf.d.ts +12 -5
  217. package/dist/utility/wrun/wrun-lane-refusal.leaf.js +23 -5
  218. package/dist/utility/wrun/wrun-lane-warmup.util.js +22 -4
  219. package/dist/utility/wrun/wrun-leg-close.util.d.ts +6 -5
  220. package/dist/utility/wrun/wrun-leg-close.util.js +11 -9
  221. package/dist/utility/wrun/wrun-leg-fetch.util.d.ts +3 -1
  222. package/dist/utility/wrun/wrun-leg-fetch.util.js +9 -2
  223. package/dist/utility/wrun/wrun-levels-child.util.d.ts +2 -0
  224. package/dist/utility/wrun/wrun-levels-child.util.js +6 -0
  225. package/dist/utility/wrun/wrun-lifecycle.contract.d.ts +4 -0
  226. package/dist/utility/wrun/wrun-live-intake.util.d.ts +15 -6
  227. package/dist/utility/wrun/wrun-live-intake.util.js +167 -47
  228. package/dist/utility/wrun/wrun-live-tick.util.d.ts +52 -8
  229. package/dist/utility/wrun/wrun-live-tick.util.js +648 -97
  230. package/dist/utility/wrun/wrun-market-facts.util.d.ts +16 -2
  231. package/dist/utility/wrun/wrun-market-facts.util.js +32 -3
  232. package/dist/utility/wrun/wrun-market-size-defaults.leaf.d.ts +27 -27
  233. package/dist/utility/wrun/wrun-market-size-defaults.leaf.js +28 -16
  234. package/dist/utility/wrun/wrun-market-size-defaults.util.js +34 -5
  235. package/dist/utility/wrun/wrun-oi-lane.util.d.ts +10 -7
  236. package/dist/utility/wrun/wrun-oi-lane.util.js +16 -10
  237. package/dist/utility/wrun/wrun-option-strike-flow.util.js +1 -1
  238. package/dist/utility/wrun/wrun-option-views.util.d.ts +2 -2
  239. package/dist/utility/wrun/wrun-option-views.util.js +5 -2
  240. package/dist/utility/wrun/wrun-options-flow-underlying.leaf.d.ts +5 -0
  241. package/dist/utility/wrun/wrun-options-flow-underlying.leaf.js +16 -0
  242. package/dist/utility/wrun/wrun-options-stop.util.d.ts +3 -2
  243. package/dist/utility/wrun/wrun-options-stop.util.js +6 -4
  244. package/dist/utility/wrun/wrun-overlay-drivers.util.d.ts +75 -11
  245. package/dist/utility/wrun/wrun-overlay-drivers.util.js +176 -43
  246. package/dist/utility/wrun/wrun-overlay-lifecycle.util.js +20 -10
  247. package/dist/utility/wrun/wrun-overlay-park.util.d.ts +84 -0
  248. package/dist/utility/wrun/wrun-overlay-park.util.js +135 -0
  249. package/dist/utility/wrun/wrun-overlay-recovery.util.d.ts +37 -4
  250. package/dist/utility/wrun/wrun-overlay-recovery.util.js +26 -14
  251. package/dist/utility/wrun/wrun-overlay-run.util.d.ts +239 -24
  252. package/dist/utility/wrun/wrun-overlay-run.util.js +2204 -405
  253. package/dist/utility/wrun/wrun-pack.util.d.ts +8 -5
  254. package/dist/utility/wrun/wrun-panel-mount.util.d.ts +2 -1
  255. package/dist/utility/wrun/wrun-panel-mount.util.js +20 -14
  256. package/dist/utility/wrun/wrun-panel-style.util.d.ts +4 -2
  257. package/dist/utility/wrun/wrun-panel-style.util.js +3 -2
  258. package/dist/utility/wrun/wrun-pin-spelling.util.d.ts +7 -0
  259. package/dist/utility/wrun/wrun-pin-spelling.util.js +18 -4
  260. package/dist/utility/wrun/wrun-pin-venues.util.d.ts +26 -17
  261. package/dist/utility/wrun/wrun-pin-venues.util.js +43 -36
  262. package/dist/utility/wrun/wrun-pinned-lanes.util.d.ts +58 -0
  263. package/dist/utility/wrun/wrun-pinned-lanes.util.js +72 -0
  264. package/dist/utility/wrun/wrun-prefix-cohort.util.js +2 -1
  265. package/dist/utility/wrun/wrun-prefix-lanes.util.d.ts +22 -9
  266. package/dist/utility/wrun/wrun-prefix-lanes.util.js +145 -26
  267. package/dist/utility/wrun/wrun-prefix-proof.util.d.ts +29 -0
  268. package/dist/utility/wrun/wrun-prefix-proof.util.js +23 -5
  269. package/dist/utility/wrun/wrun-refusal-surface.util.d.ts +9 -1
  270. package/dist/utility/wrun/wrun-refusal-surface.util.js +15 -1
  271. package/dist/utility/wrun/wrun-refusal.util.d.ts +19 -1
  272. package/dist/utility/wrun/wrun-refusal.util.js +103 -16
  273. package/dist/utility/wrun/wrun-registry-errors.util.d.ts +20 -6
  274. package/dist/utility/wrun/wrun-registry-errors.util.js +20 -6
  275. package/dist/utility/wrun/wrun-replay-rows.util.js +6 -10
  276. package/dist/utility/wrun/wrun-run-health.util.d.ts +89 -2
  277. package/dist/utility/wrun/wrun-run-health.util.js +204 -1
  278. package/dist/utility/wrun/wrun-run-interval-session.util.d.ts +2 -2
  279. package/dist/utility/wrun/wrun-run-interval-session.util.js +2 -2
  280. package/dist/utility/wrun/wrun-run-interval.util.d.ts +9 -8
  281. package/dist/utility/wrun/wrun-run-interval.util.js +13 -11
  282. package/dist/utility/wrun/wrun-sandbox-row-source.js +5 -2
  283. package/dist/utility/wrun/wrun-script-inputs.util.d.ts +13 -3
  284. package/dist/utility/wrun/wrun-script-inputs.util.js +51 -13
  285. package/dist/utility/wrun/wrun-session-composition.util.d.ts +81 -0
  286. package/dist/utility/wrun/wrun-session-composition.util.js +169 -0
  287. package/dist/utility/wrun/wrun-setting-words.util.d.ts +10 -7
  288. package/dist/utility/wrun/wrun-setting-words.util.js +25 -7
  289. package/dist/utility/wrun/wrun-source-rows.util.d.ts +94 -28
  290. package/dist/utility/wrun/wrun-source-rows.util.js +738 -93
  291. package/dist/utility/wrun/wrun-stream-clock.util.d.ts +45 -0
  292. package/dist/utility/wrun/wrun-stream-clock.util.js +108 -0
  293. package/dist/utility/wrun/wrun-tape-coins.util.d.ts +116 -0
  294. package/dist/utility/wrun/wrun-tape-coins.util.js +110 -0
  295. package/dist/utility/wrun/wrun-tape-source.util.d.ts +62 -32
  296. package/dist/utility/wrun/wrun-tape-source.util.js +72 -34
  297. package/dist/utility/wrun/wrun-tier-grid.util.d.ts +13 -5
  298. package/dist/utility/wrun/wrun-tier-grid.util.js +23 -13
  299. package/dist/utility/wrun/wrun-tpo-rows.util.js +2 -1
  300. package/dist/utility/wrun/wrun-trades-lane.util.d.ts +73 -0
  301. package/dist/utility/wrun/wrun-trades-lane.util.js +82 -0
  302. package/dist/utility/wrun/wrun-twin-compute-inputs.util.d.ts +5 -0
  303. package/dist/utility/wrun/wrun-twin-compute-inputs.util.js +9 -2
  304. package/dist/utility/wrun/wrun-visibility-table.d.ts +13 -0
  305. package/dist/utility/wrun/wrun-visibility-table.js +9 -0
  306. package/dist/utility/wrun/wrun-volume-profile.util.js +44 -32
  307. package/dist/utils/replay/replay-buffer-math.d.ts +16 -6
  308. package/dist/utils/replay/replay-buffer-math.js +60 -30
  309. package/dist/workers/constants/socket-slots.d.ts +11 -7
  310. package/dist/workers/constants/socket-slots.js +6 -5
  311. package/package.json +11 -11
@@ -44,6 +44,7 @@
44
44
  */
45
45
  import { WRUN_PREFIX_SAFE_ROSTER } from '../../constants/wrun-prefix-safe.constants.js';
46
46
  import { compareSemver, parseSemver } from '../scriptEditor/package-semver.util.js';
47
+ import { WRUN_BATCHED_MARKS_KINDS } from './wrun-batched-kinds.leaf.js';
47
48
  // The registry's package-name grammar (tharamine ANY_PACKAGE_NAME_RE, mirrored as WRUN_PACKAGE_NAME_RE in
48
49
  // wrun-registry.service). Mirrored again rather than imported so this leaf never pulls the registry service in.
49
50
  const PACKAGE_NAME_RE = /^@[a-z0-9_-]+\/[a-z0-9_-]+$/;
@@ -322,7 +323,7 @@ const PREPEND_CHILD_LAYOUTS = new Set(['book', 'grid']);
322
323
  /** The batched marks children a windowed landing merges as a prepend (WRUN-BATCHED-MARKS round 2, fold 10): the
323
324
  * row-backed canvas kinds whose rows are per-bar rows `[ts, ...fields]` read off the bar's own outputs, mounted
324
325
  * with their kind as the layout (wrun-overlay-run `wrunPrefixMountedOutputsOf`). */
325
- const PREPEND_BATCHED_LAYOUTS = new Set(['marks', 'spans', 'rays']);
326
+ const PREPEND_BATCHED_LAYOUTS = new Set(WRUN_BATCHED_MARKS_KINDS);
326
327
  /** A lower-pane child (`series`, wrun-run-result WrunChildOverlay): a pane of the sheet's own outputs, merged
327
328
  * through the same route as the parent's rows (wrun-overlay-run mergeWrunChildOverlays), so it is judged by those
328
329
  * outputs, which the sheet pass checks. Either spelling of the kind is read. */
@@ -2,6 +2,8 @@ import type { WrunLaneRevision, WrunOverlayLiveContext } from './wrun-overlay-dr
2
2
  import type { WrunLiveLane } from './wrun-live-intake.util.js';
3
3
  import { type WrunChartSourceRows } from './wrun-source-rows.util.js';
4
4
  import { type WrunPollLaneInstance } from './sources/wrun-poll-lane.types.js';
5
+ import { type WrunTradesLegLane } from './wrun-trades-lane.util.js';
6
+ import { type WrunPinnedLaneId } from './wrun-pinned-lanes.util.js';
5
7
  /** The clause of the lanes rule that refuses, which the skip reason names (`lanes:<clause>`):
6
8
  * - `input-source`: an input outside every admitted source (a `time` input with a key of its own, or a time field
7
9
  * past the bar's open and its trade date, included);
@@ -9,8 +11,9 @@ import { type WrunPollLaneInstance } from './sources/wrun-poll-lane.types.js';
9
11
  * page asks again: its first page rows carry observations from before the page, which a whole run reads off its
10
12
  * hidden lane head and a page never asks (an explicit `missing: "nan"` or `"zero"` primary is admitted, and so is
11
13
  * one whose lane holds no row: undemanded, or never dispatched);
12
- * - `legs` (a pinned, period, intrabar, candles or odds leg, and a trades input pinned to another market: its leg lane
13
- * is asked on that market, which a page does not ask again), `preroll` (a forming pre-roll), `degraded` (a lane the
14
+ * - `legs` (a pinned, period, intrabar, candles or odds leg, and a trades input pinned to another market whose leg is
15
+ * not on the chart's own grid: the whole run asks it at a tier, on an index-mode chart, or the session holds no rows
16
+ * of it at the chart's interval, `wrunPrefixSameGridLeg`), `preroll` (a forming pre-roll), `degraded` (a lane the
14
17
  * session's run computed without);
15
18
  * - `vp`, `iv`, `daily`, `tape-history`, `carry-cache`, `worker-empty`: a feed a page cannot ask again exactly (above);
16
19
  * - `index-mode`: a fetched lane on an index-mode chart; `live-row`: the options chain's snapshot inside the window;
@@ -30,13 +33,18 @@ export declare const WRUN_PREFIX_ASK_LANES: Readonly<Record<WrunPrefixAskLane, {
30
33
  }>>;
31
34
  /** The fetch-key suffix of a poll lane instance's page ask: `poll-<instance id>`. */
32
35
  export declare function wrunPrefixPollSuffix(instance: Pick<WrunPollLaneInstance, 'key'>): string;
33
- /** What a prefix page asks again: the row-builder lanes, then the poll lane instances (the book keeps its own ask). */
36
+ /** What a prefix page asks again: the row-builder lanes, the trades legs on the chart's own grid by lane id, the
37
+ * pinned lanes by lane id (U9e: a pinned book through the packed worker), then the poll lane instances (the chart's
38
+ * own book keeps its own ask). */
34
39
  export interface WrunPrefixLanePlan {
35
40
  builtin: WrunPrefixAskLane[];
41
+ legs: WrunTradesLegLane[];
42
+ pinned: WrunPinnedLaneId[];
36
43
  poll: WrunPollLaneInstance[];
37
44
  }
38
45
  /**
39
- * The lanes rule (C1 v3, widened for the per-bar stamp and the roster 2026-10-14): the clause that refuses
46
+ * The lanes rule (C1 v3, widened for the per-bar stamp and the roster 2026-10-14, for the trades legs on the chart's
47
+ * own grid by WRUN-PANBACK C): the clause that refuses
40
48
  * (`WrunPrefixLaneClause`), or what a page asks again. Inputs first, in declaration order (the first refusal wins),
41
49
  * then the session's legs, pre-roll and degraded lanes, then every lane the session fetched (its acquisition record)
42
50
  * and every poll lane instance, the index-mode chart, last a book input with no book lane. An exact warm-up session
@@ -70,9 +78,11 @@ export interface WrunPrefixLaneEvidence {
70
78
  * build hands them. An asked lane: its page, then the session's own rows over the overlap `[firstRowTs, toMs]` (the
71
79
  * very objects the session holds). The tape (a live edge): the session's own rows over the overlap, none before (a
72
80
  * live-edge tape serves no history). Every other lane the session holds: empty (the options chain, a lane the
73
- * capability rule never dispatched); a lane it never held stays absent. The tape's floor settings and the poll lane
81
+ * capability rule never dispatched); a lane it never held stays absent. An asked trades leg: its page, then the
82
+ * session's own rows over the overlap, with the interval each leg's rows ride (`tradeLegIntervals`, the session's
83
+ * acquisition, as the whole run's and the reseed's builds read it). The tape's floor settings and the poll lane
74
84
  * instances ride along. Beside it the window's lane evidence (the proof's prefix side, `wrunPrefixHeldLanes` the
75
- * mounted side): every asked lane and the tape.
85
+ * mounted side): every asked lane, every asked leg and the tape.
76
86
  */
77
87
  export declare function wrunPrefixWindowLanes(context: WrunOverlayLiveContext, plan: WrunPrefixLanePlan, pages: WrunPrefixLanePages, firstRowTs: number, toMs: number): {
78
88
  sourceRows: Partial<WrunChartSourceRows>;
@@ -82,9 +92,12 @@ export declare function wrunPrefixWindowLanes(context: WrunOverlayLiveContext, p
82
92
  * proof's mounted side. */
83
93
  export declare function wrunPrefixHeldLanes(context: WrunOverlayLiveContext, plan: WrunPrefixLanePlan): WrunPrefixLaneEvidence[];
84
94
  /** The buffers a landed page leaves its session (`wrunPrefixLaneSplice`): each asked row-builder lane's by its field,
85
- * each poll instance's by its id. */
95
+ * each asked trades leg's by its lane id (`tradeLegRows`), each asked pinned lane's by its lane id
96
+ * (`pinnedLaneRows`), each poll instance's by its id. */
86
97
  export interface WrunPrefixLaneSplice {
87
98
  builtin: Array<[field: (typeof WRUN_PREFIX_ASK_LANES)[WrunPrefixAskLane]['rows'], rows: ArrayLike<unknown>[]]>;
99
+ legs: Record<string, ArrayLike<unknown>[]>;
100
+ pinned: Record<string, ArrayLike<unknown>[]>;
88
101
  poll: Record<string, ArrayLike<unknown>[]>;
89
102
  }
90
103
  /**
@@ -95,8 +108,8 @@ export interface WrunPrefixLaneSplice {
95
108
  * spliced here (the book's is the caller's; the others asked nothing, and their buffers stay the session's).
96
109
  */
97
110
  export declare function wrunPrefixLaneSplice(context: WrunOverlayLiveContext, plan: WrunPrefixLanePlan, pages: WrunPrefixLanePages, firstRowTs: number): WrunPrefixLaneSplice | null;
98
- /** Write a splice onto its session (synchronous; a poll instance's buffers as a new record, the reseed and the tail
99
- * builder read the context's own). */
111
+ /** Write a splice onto its session (synchronous; a trades leg's and a poll instance's buffers as a new record, the
112
+ * reseed and the tail builder read the context's own; the legs' intervals ride the acquisition, untouched). */
100
113
  export declare function applyWrunPrefixLaneSplice(context: WrunOverlayLiveContext, splice: WrunPrefixLaneSplice): void;
101
114
  /** The span of timestamps at or after `fromTs` where two buffers differ exactly (a row on one side only, or any
102
115
  * value), null when none does. */
@@ -6,17 +6,22 @@
6
6
  * - The rule (`planWrunPrefixLanes`): admitted with a window ask (the page is asked again under its own fetch key
7
7
  * with the session's recorded acquisition): buy/sell volume (`trades`, `trades_usd`), open interest, funding,
8
8
  * liquidations, trade volume by size and the bar-joined registry poll lanes (a relay `series` through its own
9
- * fetch), each read per bar. Admitted with NO ask (the fill or an empty block on every page row, exactly as a whole
9
+ * fetch), each read per bar, and a trades leg on another market that rides the chart's own grid
10
+ * (`wrunPrefixSameGridLeg`, WRUN-PANBACK C: asked through the whole run's own leg planner, wrun-trades-lane.util
11
+ * `planWrunTradeLegAsk`). Admitted with NO ask (the fill or an empty block on every page row, exactly as a whole
10
12
  * run's older bars read them): the options chain (its live snapshot lands on the build's last row only), a
11
13
  * live-edge tape (`history` "0"), an undemanded input and a lane the capability rule never dispatched
12
14
  * (`unservedLanes`). The book keeps its own packed ask (`book-transport`, `book-missing`). Every other feed refuses
13
15
  * by a named clause: a feed primary under carry (`primary-carry`), the volume profile (`vp`), the option summaries
14
- * (`iv`), the daily-joined lanes (`daily`), legs and odds (`legs`), the forming pre-roll (`preroll`), a degraded
15
- * lane (`degraded`), a tape with history (`tape-history`), ETF holdings (`carry-cache`: its worker carries across
16
- * requests), the options OI and options volume lanes (`worker-empty`: their workers answer a failed upstream as an
17
- * empty page), any fetched lane on an index-mode chart (`index-mode`: the chart's fetch replaces an explicit window
18
- * with the chart's whole span there), and an options chain whose snapshot would land inside the window
19
- * (`live-row`, judged against the planned window, `wrunPrefixLiveRowRefused`).
16
+ * (`iv`), the daily-joined lanes (`daily`), every other leg and odds (`legs`), the forming pre-roll (`preroll`), a
17
+ * degraded lane (`degraded`), a tape with history (`tape-history`), ETF holdings (`carry-cache`: its worker carries
18
+ * across requests), the options OI and options volume lanes (`worker-empty`: their workers answer a failed upstream
19
+ * as an empty page), any fetched lane on an index-mode chart (`index-mode`: the chart's fetch replaces an explicit
20
+ * window with the chart's whole span there), and an options chain whose snapshot would land inside the window
21
+ * (`live-row`, judged against the planned window, `wrunPrefixLiveRowRefused`). A lane pinned to another market (U9e,
22
+ * wrun-pinned-lanes.util: a book, oi, funding or liquidations input's own lane there) is asked again with the
23
+ * session's recorded acquisition, its market among it (`plan.pinned`), the book through the packed worker its whole
24
+ * run rode (`book-transport` otherwise).
20
25
  * - The window split (`wrunPrefixWindowLanes`): each asked lane's page is `[fromMs, firstRowTs)` (the answer cut
21
26
  * strictly before the session's first row: the transport pads its inclusive end); the overlap
22
27
  * `[firstRowTs, toMs]` takes the session's OWN rows, so the guest computes the overlap on the very row objects
@@ -24,7 +29,9 @@
24
29
  * identity first. A live-edge tape takes the session's own rows over the overlap too (live prints exact-join).
25
30
  * - The splice (`wrunPrefixLaneSplice`, `applyWrunPrefixLaneSplice`): every asked lane's buffer becomes the page
26
31
  * then the session's rows from its first row on, decided at the commit before anything applies, all or none; the
27
- * commit then starts the session's lanes (`lanesFromTs`) at the page's first bar, the certified start.
32
+ * commit then starts the session's lanes (`lanesFromTs`) at the page's first bar, the certified start. An asked
33
+ * trades leg's buffer is `tradeLegRows[lane]`; the interval its rows ride (`tradeLegIntervals`, read off the
34
+ * session's acquisition) is the chart's and stays as it is.
28
35
  * - The revisions (`noteWrunLaneRevision`, `wrunPrefixOverlapUnproven`): a live reconcile that replaces a buffer row
29
36
  * with another value (exactly: its tolerated float noise included) records the span, until a reseed computes the
30
37
  * session's outputs whole again. An overlap such a span reaches rests on values the mounted outputs never read, so
@@ -35,11 +42,12 @@
35
42
  */
36
43
  import { checkIsIndexMode } from '../chart/index-mode.util.js';
37
44
  import { wrunInputReadsChartFeed } from './wrun-bar-count.util.js';
38
- import { wrunSourceLane } from './wrun-source-rows.util.js';
45
+ import { wrunSourceLane, wrunTradeLegIntervals } from './wrun-source-rows.util.js';
39
46
  import { wrunPollLaneByKey, wrunPollLanesOfClass } from './sources/registry.js';
40
47
  import { isWrunPollLaneId } from './sources/wrun-poll-lane.types.js';
41
48
  import { parseWrunTapeHistory, wrunTapeAcquisitionFloor, wrunTapeFloorSettings, wrunTapeHistoryOf, } from './wrun-tape-source.util.js';
42
- import { isWrunTradesLegLane } from './wrun-trades-lane.util.js';
49
+ import { isWrunTradesLegLane, planWrunTradeLegAsk } from './wrun-trades-lane.util.js';
50
+ import { isWrunPinnedLaneId, wrunPinnedLaneOf } from './wrun-pinned-lanes.util.js';
43
51
  import { isWrunLegStreamClass } from './wrun-leg-stream-classes.js';
44
52
  /** Each asked lane: the fetch type the full run rode, the fetch-key suffix of the page's ask
45
53
  * (`<fetchKey>-prefix-<suffix>`, the full run's own suffix) and the buffer the session holds it in. */
@@ -103,6 +111,29 @@ function wrunPrefixPrimaryCarries(input, entry) {
103
111
  return false;
104
112
  return entry.missing !== 'nan' && entry.missing !== 'zero';
105
113
  }
114
+ /**
115
+ * Whether a trades leg on another market rides the chart's own grid, so a page asks it again exactly as the whole run
116
+ * asked it (WRUN-PANBACK C): the session's chart is known and not index mode (there every leg rides the native-rows
117
+ * path, and the chart's fetch replaces an explicit window with the chart's whole span), the whole run's planner asks
118
+ * the leg plainly on that chart (`planWrunTradeLegAsk`: no tier, so a 24/7 market whose rows open on the chart's bars),
119
+ * and the session holds the leg's rows from a plain ask at the chart's interval (`tradeLegRows`; its acquisition names
120
+ * no native-rows path, and `tradeLegIntervals`, read off it as the row builder reads it, is the interval the chart's
121
+ * fetch stamped on the whole run's ask).
122
+ */
123
+ function wrunPrefixSameGridLeg(context, lane) {
124
+ const exchange = context.market?.exchange;
125
+ if (typeof exchange !== 'string' || exchange === '' || checkIsIndexMode(exchange))
126
+ return false;
127
+ const ask = planWrunTradeLegAsk(lane, { intervalMs: context.intervalMs, venue: context.market }, { fromMs: context.firstRowTs, toMs: context.lastRowTs });
128
+ if (ask === undefined || ask.tier !== null)
129
+ return false;
130
+ const acquisition = context.acquisition[lane];
131
+ if (acquisition === undefined || acquisition.nativeRows === true)
132
+ return false;
133
+ if (context.tradeLegRows?.[lane] === undefined)
134
+ return false;
135
+ return wrunTradeLegIntervals(context.acquisition)[lane] === context.intervalMs;
136
+ }
106
137
  /** A poll lane instance's clause, or null when its page is asked (a bar join no rule above refuses). */
107
138
  function wrunPrefixPollClause(instance) {
108
139
  const lane = wrunPollLaneByKey(instance.laneKey);
@@ -117,7 +148,8 @@ function wrunPrefixPollClause(instance) {
117
148
  return WRUN_PREFIX_POLL_REFUSALS[lane.sourceClass] ?? null;
118
149
  }
119
150
  /**
120
- * The lanes rule (C1 v3, widened for the per-bar stamp and the roster 2026-10-14): the clause that refuses
151
+ * The lanes rule (C1 v3, widened for the per-bar stamp and the roster 2026-10-14, for the trades legs on the chart's
152
+ * own grid by WRUN-PANBACK C): the clause that refuses
121
153
  * (`WrunPrefixLaneClause`), or what a page asks again. Inputs first, in declaration order (the first refusal wins),
122
154
  * then the session's legs, pre-roll and degraded lanes, then every lane the session fetched (its acquisition record)
123
155
  * and every poll lane instance, the index-mode chart, last a book input with no book lane. An exact warm-up session
@@ -147,16 +179,41 @@ export function planWrunPrefixLanes(context) {
147
179
  // The chart's candles; a leg on them (a market or an interval of its own) is judged with the legs below.
148
180
  continue;
149
181
  case 'book':
150
- readsBook = true;
151
- continue;
152
- case 'trades':
153
182
  case 'oi':
154
183
  case 'funding':
155
184
  case 'liquidations':
185
+ case 'trades':
156
186
  case 'trade_volume_by_size': {
157
- // A trades input on another market reads its leg lane there (kit 0.77.0): a leg, which no page asks.
158
- if (isWrunTradesLegLane(wrunSourceLane(entry)))
159
- return refused('legs');
187
+ // A book, oi, funding or liquidations input pinned to another market reads its own lane there (U9e): asked
188
+ // again when the session holds its acquisition (the acquisition loop below plans it), read empty when the
189
+ // capability rule never dispatched it.
190
+ const pinnedLane = wrunSourceLane(entry);
191
+ if (isWrunPinnedLaneId(pinnedLane)) {
192
+ if (context.acquisition[pinnedLane] === undefined) {
193
+ if (!wrunPrefixUnserved(context, pinnedLane)) {
194
+ return refused(entry.source === 'book' ? 'book-missing' : entry.source);
195
+ }
196
+ continue;
197
+ }
198
+ if (wrunPrefixPrimaryCarries(input, entry))
199
+ return refused('primary-carry');
200
+ continue;
201
+ }
202
+ if (entry.source === 'book') {
203
+ readsBook = true;
204
+ continue;
205
+ }
206
+ // A trades input on another market reads its leg lane there (kit 0.77.0): asked again when it rides the chart's
207
+ // own grid (`wrunPrefixSameGridLeg`, the acquisition loop below plans it), else a leg no page asks.
208
+ const legLane = wrunSourceLane(entry);
209
+ if (isWrunTradesLegLane(legLane)) {
210
+ if (!wrunPrefixSameGridLeg(context, legLane))
211
+ return refused('legs');
212
+ // A primary under carry, as below: same-grid admission never replaces it.
213
+ if (wrunPrefixPrimaryCarries(input, entry))
214
+ return refused('primary-carry');
215
+ continue;
216
+ }
160
217
  const lane = wrunSourceLane(entry);
161
218
  // Asked when the session fetched it (the acquisition loop below), read empty when the capability rule never
162
219
  // dispatched it, and otherwise a lane the session should hold and does not.
@@ -222,12 +279,25 @@ export function planWrunPrefixLanes(context) {
222
279
  return refused('preroll');
223
280
  if ((context.degradedLanes?.size ?? 0) > 0)
224
281
  return refused('degraded');
225
- const plan = { builtin: [], poll: [] };
282
+ const plan = { builtin: [], legs: [], pinned: [], poll: [] };
226
283
  for (const [lane, acquisition] of Object.entries(context.acquisition)) {
227
284
  if (acquisition === undefined || isWrunPollLaneId(lane))
228
285
  continue;
229
- if (isWrunTradesLegLane(lane))
230
- return refused('legs');
286
+ if (isWrunTradesLegLane(lane)) {
287
+ if (!wrunPrefixSameGridLeg(context, lane))
288
+ return refused('legs');
289
+ plan.legs.push(lane);
290
+ continue;
291
+ }
292
+ if (isWrunPinnedLaneId(lane)) {
293
+ // A pinned lane (U9e) is asked again on its market with its recorded acquisition; a book only on the packed
294
+ // worker its whole run rode, as the chart's own book.
295
+ const packed = acquisition.preferPackedOrderbookWorker === true;
296
+ if (wrunPinnedLaneOf(lane)?.cls === 'book' && !packed)
297
+ return refused('book-transport');
298
+ plan.pinned.push(lane);
299
+ continue;
300
+ }
231
301
  switch (lane) {
232
302
  case 'book':
233
303
  if (acquisition.preferPackedOrderbookWorker !== true) {
@@ -272,7 +342,11 @@ export function planWrunPrefixLanes(context) {
272
342
  if (isWrunPollLaneId(lane) && !pollLanes.some((instance) => instance.key === lane))
273
343
  return refused('poll');
274
344
  }
275
- const fetchesLanes = plan.builtin.length > 0 || plan.poll.length > 0 || context.acquisition.book !== undefined;
345
+ const fetchesLanes = plan.builtin.length > 0 ||
346
+ plan.legs.length > 0 ||
347
+ plan.pinned.length > 0 ||
348
+ plan.poll.length > 0 ||
349
+ context.acquisition.book !== undefined;
276
350
  if (fetchesLanes && checkIsIndexMode(context.market?.exchange))
277
351
  return refused('index-mode');
278
352
  if (readsBook && context.acquisition.book === undefined && !wrunPrefixUnserved(context, 'book')) {
@@ -312,9 +386,11 @@ function wrunRowsInside(rows, fromTs, toTs) {
312
386
  * build hands them. An asked lane: its page, then the session's own rows over the overlap `[firstRowTs, toMs]` (the
313
387
  * very objects the session holds). The tape (a live edge): the session's own rows over the overlap, none before (a
314
388
  * live-edge tape serves no history). Every other lane the session holds: empty (the options chain, a lane the
315
- * capability rule never dispatched); a lane it never held stays absent. The tape's floor settings and the poll lane
389
+ * capability rule never dispatched); a lane it never held stays absent. An asked trades leg: its page, then the
390
+ * session's own rows over the overlap, with the interval each leg's rows ride (`tradeLegIntervals`, the session's
391
+ * acquisition, as the whole run's and the reseed's builds read it). The tape's floor settings and the poll lane
316
392
  * instances ride along. Beside it the window's lane evidence (the proof's prefix side, `wrunPrefixHeldLanes` the
317
- * mounted side): every asked lane and the tape.
393
+ * mounted side): every asked lane, every asked leg and the tape.
318
394
  */
319
395
  export function wrunPrefixWindowLanes(context, plan, pages, firstRowTs, toMs) {
320
396
  const sourceRows = {};
@@ -335,6 +411,27 @@ export function wrunPrefixWindowLanes(context, plan, pages, firstRowTs, toMs) {
335
411
  sourceRows[field] = rows;
336
412
  lanes.push({ lane, rows });
337
413
  }
414
+ if (context.tradeLegRows !== undefined) {
415
+ const tradeLegRows = {};
416
+ for (const lane of plan.legs) {
417
+ const rows = windowOf(pages.get(lane), context.tradeLegRows[lane] ?? []);
418
+ tradeLegRows[lane] = rows;
419
+ lanes.push({ lane, rows });
420
+ }
421
+ sourceRows.tradeLegRows = tradeLegRows;
422
+ sourceRows.tradeLegIntervals = wrunTradeLegIntervals(context.acquisition);
423
+ }
424
+ if (context.pinnedLaneRows !== undefined) {
425
+ // An asked pinned lane (U9e): its page, then the session's own rows over the overlap; a lane the capability rule
426
+ // never dispatched holds none, as the session's does.
427
+ const pinnedLaneRows = {};
428
+ for (const lane of plan.pinned) {
429
+ const rows = windowOf(pages.get(lane), context.pinnedLaneRows[lane] ?? []);
430
+ pinnedLaneRows[lane] = rows;
431
+ lanes.push({ lane, rows });
432
+ }
433
+ sourceRows.pinnedLaneRows = pinnedLaneRows;
434
+ }
338
435
  for (const field of WRUN_PREFIX_NO_ASK_ROWS) {
339
436
  if (context[field] !== undefined)
340
437
  sourceRows[field] = [];
@@ -367,6 +464,10 @@ export function wrunPrefixHeldLanes(context, plan) {
367
464
  lane,
368
465
  rows: (context[WRUN_PREFIX_ASK_LANES[lane].rows] ?? []),
369
466
  }));
467
+ for (const lane of plan.legs)
468
+ lanes.push({ lane, rows: context.tradeLegRows?.[lane] ?? [] });
469
+ for (const lane of plan.pinned)
470
+ lanes.push({ lane, rows: context.pinnedLaneRows?.[lane] ?? [] });
370
471
  if (context.tapeRows !== undefined)
371
472
  lanes.push({ lane: 'tape', rows: context.tapeRows });
372
473
  for (const instance of plan.poll)
@@ -385,7 +486,7 @@ export function wrunPrefixLaneSplice(context, plan, pages, firstRowTs) {
385
486
  ...(pages.get(lane) ?? []),
386
487
  ...held.filter((row) => Number(row[0]) >= firstRowTs),
387
488
  ];
388
- const splice = { builtin: [], poll: {} };
489
+ const splice = { builtin: [], legs: {}, pinned: {}, poll: {} };
389
490
  for (const lane of plan.builtin) {
390
491
  const field = WRUN_PREFIX_ASK_LANES[lane].rows;
391
492
  const held = context[field];
@@ -393,6 +494,18 @@ export function wrunPrefixLaneSplice(context, plan, pages, firstRowTs) {
393
494
  return null;
394
495
  splice.builtin.push([field, spliced(held, lane)]);
395
496
  }
497
+ for (const lane of plan.legs) {
498
+ const held = context.tradeLegRows?.[lane];
499
+ if (held === undefined)
500
+ return null;
501
+ splice.legs[lane] = spliced(held, lane);
502
+ }
503
+ for (const lane of plan.pinned) {
504
+ const held = context.pinnedLaneRows?.[lane];
505
+ if (held === undefined)
506
+ return null;
507
+ splice.pinned[lane] = spliced(held, lane);
508
+ }
396
509
  for (const instance of plan.poll) {
397
510
  const held = context.pollLaneRows?.[instance.key];
398
511
  if (held === undefined)
@@ -401,11 +514,17 @@ export function wrunPrefixLaneSplice(context, plan, pages, firstRowTs) {
401
514
  }
402
515
  return splice;
403
516
  }
404
- /** Write a splice onto its session (synchronous; a poll instance's buffers as a new record, the reseed and the tail
405
- * builder read the context's own). */
517
+ /** Write a splice onto its session (synchronous; a trades leg's and a poll instance's buffers as a new record, the
518
+ * reseed and the tail builder read the context's own; the legs' intervals ride the acquisition, untouched). */
406
519
  export function applyWrunPrefixLaneSplice(context, splice) {
407
520
  for (const [field, rows] of splice.builtin)
408
521
  context[field] = rows;
522
+ if (Object.keys(splice.legs).length > 0) {
523
+ context.tradeLegRows = { ...context.tradeLegRows, ...splice.legs };
524
+ }
525
+ if (Object.keys(splice.pinned).length > 0) {
526
+ context.pinnedLaneRows = { ...context.pinnedLaneRows, ...splice.pinned };
527
+ }
409
528
  if (Object.keys(splice.poll).length > 0) {
410
529
  context.pollLaneRows = { ...context.pollLaneRows, ...splice.poll };
411
530
  }
@@ -20,6 +20,14 @@
20
20
  * rows in the span. An empty overlap proves nothing and is refused.
21
21
  * - Values compare with `Object.is` (NaN equals NaN, -0 differs from 0), every column of every candle, book and
22
22
  * child row (its timestamp included), every output of every row.
23
+ * - One exception, a converging warm-up session's (STAMPS round A, `outputTolerance`): its row `outputs` values
24
+ * compare within its tolerance (`wrunConvergedEqual`: `|a - b| <= tol * max(1, |a|, |b|)`, a non-finite value as a
25
+ * pattern), its selector columns exactly (an output any `*_by` or `*_where` field, a renderer's `where` gate, an
26
+ * output's `badges` or a hover block's `output` names, and a barcolor output: wrun-declared-warmup.util
27
+ * `wrunHistoryStampExactColumns`).
28
+ * Timestamps, strings, candles, the book, lanes, children, handles and the run-level snapshots below compare exactly
29
+ * whatever the tolerance: a converging session lands no drawing in round A (its admission refuses one), and every
30
+ * other field is an input or a discrete choice, never a level a recursion converges on.
23
31
  * - Row states never equal one another: a missing row, `outputs: null`, an all-NaN outputs array, an absent strings
24
32
  * array (`strings` undefined or null), a null string and an empty string. Inside a strings array, undefined reads
25
33
  * as null (both spell an absent slot: the host's unpacked rows use undefined, this contract null).
@@ -193,6 +201,23 @@ type Failure = {
193
201
  firstMismatchTs: number | null;
194
202
  detail: string | null;
195
203
  };
204
+ /**
205
+ * Whether two output values agree (STAMPS round A, the converging warm-up stamp's tolerance): with no tolerance (`tol`
206
+ * not a finite number above 0) exactly `Object.is` (NaN equals NaN, -0 differs from 0), the rule every value of every
207
+ * other session compares by; with one, a non-finite value on either side still compares as a pattern (`Object.is`:
208
+ * the same NaN or infinity on both sides, else a mismatch, an infinity against a finite value included), and two
209
+ * finite values agree when `|a - b| <= tol * max(1, |a|, |b|)` (relative, with an absolute floor at magnitudes below
210
+ * 1: the gate's own rule), so -0 and 0 agree there. Pure.
211
+ */
212
+ export declare function wrunConvergedEqual(a: number, b: number, tol: number | undefined): boolean;
213
+ /** A converging warm-up session's tolerance for the row `outputs` values (STAMPS round A): every output column
214
+ * compares within `tolerance` (`wrunConvergedEqual`) but the `exactColumns` (the selector columns: an output any
215
+ * `*_by` or `*_where` field, a `where` gate, `badges` or a hover block's `output` names, and a barcolor output,
216
+ * wrun-declared-warmup.util `wrunHistoryStampExactColumns`), which compare exactly. */
217
+ export interface WrunPrefixOutputTolerance {
218
+ tolerance: number;
219
+ exactColumns: ReadonlySet<number>;
220
+ }
196
221
  /**
197
222
  * Whether the prefix run's evidence equals the mounted evidence over the overlap: ok, or the first mismatch with its
198
223
  * kind, its earliest timestamp and a plain-words detail. Validation only; the roster admits (see the module note).
@@ -203,6 +228,10 @@ export declare function proveWrunPrefixOverlap(input: {
203
228
  mounted: WrunPrefixEvidence;
204
229
  /** The candle evidence (D2): checked first when given; absent keeps the overlap check alone. */
205
230
  candleEvidence?: WrunCandleEvidenceInput;
231
+ /** A converging warm-up session's tolerance (STAMPS round A), read by the row `outputs` values alone; absent, every
232
+ * value compares exactly. Timestamps, strings, candles, the book, lanes, children and handles compare exactly
233
+ * whatever it says. */
234
+ outputTolerance?: WrunPrefixOutputTolerance;
206
235
  }): {
207
236
  ok: true;
208
237
  } | {
@@ -258,7 +258,22 @@ function lanesByName(lanes) {
258
258
  }
259
259
  return byName;
260
260
  }
261
- function outputsDifference(a, b) {
261
+ /**
262
+ * Whether two output values agree (STAMPS round A, the converging warm-up stamp's tolerance): with no tolerance (`tol`
263
+ * not a finite number above 0) exactly `Object.is` (NaN equals NaN, -0 differs from 0), the rule every value of every
264
+ * other session compares by; with one, a non-finite value on either side still compares as a pattern (`Object.is`:
265
+ * the same NaN or infinity on both sides, else a mismatch, an infinity against a finite value included), and two
266
+ * finite values agree when `|a - b| <= tol * max(1, |a|, |b|)` (relative, with an absolute floor at magnitudes below
267
+ * 1: the gate's own rule), so -0 and 0 agree there. Pure.
268
+ */
269
+ export function wrunConvergedEqual(a, b, tol) {
270
+ if (tol === undefined || !Number.isFinite(tol) || !(tol > 0))
271
+ return Object.is(a, b);
272
+ if (!Number.isFinite(a) || !Number.isFinite(b))
273
+ return Object.is(a, b);
274
+ return Math.abs(a - b) <= tol * Math.max(1, Math.abs(a), Math.abs(b));
275
+ }
276
+ function outputsDifference(a, b, tolerance) {
262
277
  if (a === null || b === null) {
263
278
  if (a === b)
264
279
  return null;
@@ -267,8 +282,10 @@ function outputsDifference(a, b) {
267
282
  if (a.length !== b.length)
268
283
  return `${a.length} outputs on the prefix side, ${b.length} on the mounted side`;
269
284
  for (let index = 0; index < a.length; index += 1) {
270
- if (!Object.is(a[index], b[index])) {
271
- return `output ${index}: ${show(a[index])} on the prefix side, ${show(b[index])} on the mounted side`;
285
+ const tol = tolerance !== undefined && !tolerance.exactColumns.has(index) ? tolerance.tolerance : undefined;
286
+ if (!wrunConvergedEqual(a[index], b[index], tol)) {
287
+ const beyond = tol !== undefined ? ` (beyond the tolerance ${show(tol)})` : '';
288
+ return `output ${index}: ${show(a[index])} on the prefix side, ${show(b[index])} on the mounted side${beyond}`;
272
289
  }
273
290
  }
274
291
  return null;
@@ -471,12 +488,13 @@ export function proveWrunPrefixOverlap(input) {
471
488
  return fail('lane', lane.prefix[at].ts, `${lane.label}: ${difference}`);
472
489
  }
473
490
  }
474
- // 3. Outputs, row by row: the outputs, then the strings.
491
+ // 3. Outputs, row by row: the outputs (within a converging session's tolerance, its selector columns exactly), then
492
+ // the strings (exactly).
475
493
  for (let at = 0; at < rows.prefix.length; at += 1) {
476
494
  const ts = rows.prefix[at].ts;
477
495
  const a = rows.prefix[at].item;
478
496
  const b = rows.mounted[at].item;
479
- const outputs = outputsDifference(a.outputs, b.outputs);
497
+ const outputs = outputsDifference(a.outputs, b.outputs, input.outputTolerance);
480
498
  if (outputs !== null)
481
499
  return fail('output', ts, outputs);
482
500
  const strings = stringsDifference(a.strings, b.strings);
@@ -54,6 +54,12 @@ export declare function resolveWrunRefusalTarget(t: WrunRefusalOverlayTarget): W
54
54
  export declare function wrunRefusalTargetSettings(t: WrunRefusalOverlayTarget): Record<string, unknown> | undefined;
55
55
  export declare function emitWrunRefusalChange(chartIndex: number): void;
56
56
  export declare function onWrunRefusalChange(fn: (chartIndex: number) => void): () => void;
57
+ /** The overlay's standing run record (a full run's verdict, shown or outranked by a tick's), or undefined: what the
58
+ * CME late re-judgment reads to rerun a run a closed gate refused a pin (cme-user-scripts-rejudge.util). */
59
+ export declare function wrunStandingRefusalOf(target: WrunRefusalOverlayTarget): WrunRefusal | undefined;
60
+ /** The record the overlay's verdicts show (the higher of run and tick), or undefined: the store derives the legend
61
+ * slot's chip from it beside its rows (`legendChipOutranksRefusal`). */
62
+ export declare function wrunShownRefusalOf(target: WrunRefusalOverlayTarget): WrunRefusal | undefined;
57
63
  /**
58
64
  * Project a record for its owner: the legend (the higher of the overlay's run and tick verdicts),
59
65
  * the change event, and a toast when `notify` is true AND the record is paused. `isCurrent` and the
@@ -77,7 +83,9 @@ export declare function projectWrunRefusal(target: WrunRefusalOverlayTarget, r:
77
83
  */
78
84
  export declare function wrunRefusedLatestSnapshotOf(r: WrunRefusal, tc?: WrunChartHandle | null): WrunLatestSnapshot;
79
85
  export declare function wrunRefusalRetractionCount(target: WrunRefusalOverlayTarget): number;
80
- export declare function retractWrunRefusal(target: WrunRefusalOverlayTarget, owner: 'run' | 'tick' | 'all'): Promise<void>;
86
+ export declare function retractWrunRefusal(target: WrunRefusalOverlayTarget, owner: 'run' | 'tick' | 'all', options?: {
87
+ isCurrent?: () => boolean;
88
+ }): Promise<void>;
81
89
  /**
82
90
  * The origin of an executor request's attempt: `user` for the requests a person made (retry, a
83
91
  * settings save), `system` for everything the chart starts on its own (resume, the range and
@@ -81,6 +81,17 @@ const verdicts = new Map();
81
81
  function overlayKey(t) {
82
82
  return `${t.chartIndex}:${t.indicatorId}`;
83
83
  }
84
+ /** The overlay's standing run record (a full run's verdict, shown or outranked by a tick's), or undefined: what the
85
+ * CME late re-judgment reads to rerun a run a closed gate refused a pin (cme-user-scripts-rejudge.util). */
86
+ export function wrunStandingRefusalOf(target) {
87
+ return verdicts.get(overlayKey(target))?.run;
88
+ }
89
+ /** The record the overlay's verdicts show (the higher of run and tick), or undefined: the store derives the legend
90
+ * slot's chip from it beside its rows (`legendChipOutranksRefusal`). */
91
+ export function wrunShownRefusalOf(target) {
92
+ const owned = verdicts.get(overlayKey(target));
93
+ return owned === undefined ? undefined : topVerdict(owned)?.refusal;
94
+ }
84
95
  function topVerdict(owned) {
85
96
  const { run, tick } = owned;
86
97
  if (run && tick) {
@@ -308,13 +319,16 @@ const retractions = new Map();
308
319
  export function wrunRefusalRetractionCount(target) {
309
320
  return retractions.get(overlayKey(resolveWrunRefusalTarget(target) ?? target)) ?? 0;
310
321
  }
311
- export async function retractWrunRefusal(target, owner) {
322
+ export async function retractWrunRefusal(target, owner, options = {}) {
312
323
  try {
313
324
  await ensureWrunRefusalChartSide();
314
325
  }
315
326
  catch {
316
327
  return;
317
328
  }
329
+ // The owner, judged after the wait: a same-id remount meanwhile keeps its own verdicts.
330
+ if (options.isCurrent?.() === false)
331
+ return;
318
332
  const resolved = resolveWrunRefusalTarget(target) ?? target;
319
333
  const key = overlayKey(resolved);
320
334
  retractions.set(key, (retractions.get(key) ?? 0) + 1);
@@ -1,4 +1,4 @@
1
- import type { GateProvider } from '../../workers/constants/socket-slots.js';
1
+ import { type GateProvider } from '../../workers/constants/socket-slots.js';
2
2
  import { type WrunFailureBaseCause, type WrunFailureCause } from './wrun-failure-cause.js';
3
3
  import { WRUN_KIT_REFUSAL_STAGES, wrunKitRefusalStageOf, type WrunFrameRefusal, type WrunKitRefusalStage } from './wrun-hosted-wire-caps.js';
4
4
  export type WrunRefusalClass = 'legs-empty' | 'feed-missing' | 'no-options' | 'coin-outside-feed' | 'interval-unserved' | 'service-no-answer' | 'waiting' | 'cme-wall' | 'pin-refused' | 'index-unserved' | 'too-big' | 'live-stopped' | 'not-reached' | 'nothing-ready' | 'slots' | 'not-added' | 'run-failed' | 'options-stopped';
@@ -70,6 +70,20 @@ export type WrunRefusalOut = {
70
70
  | {
71
71
  kind: 'take-session';
72
72
  plane: WrunRefusalGatePlane;
73
+ }
74
+ /** A paid feed this viewer has not bought (`cme-wall` `feed-paid`): the in-app checkout of its listing (`package`). */
75
+ | {
76
+ kind: 'subscribe';
77
+ package: string;
78
+ }
79
+ /** A CME pin the viewer's CME data terms keep closed (`pin-refused` `terms`): the terms door, re-judgment armed. */
80
+ | {
81
+ kind: 'accept-cme-terms';
82
+ }
83
+ /** A tape lane on Price only (`feed-missing` `price-only`): the chart's switch to Trades, the Live price wall's ways
84
+ * out (Back to Trades, Get real-time on the card). */
85
+ | {
86
+ kind: 'switch-to-trades';
73
87
  };
74
88
  export interface WrunRefusalMarket {
75
89
  exchange: string;
@@ -179,6 +193,8 @@ export interface WrunAddGateRefusal {
179
193
  scope: 'chart' | 'layout';
180
194
  chartIndex: number;
181
195
  };
196
+ /** The market a `cme-venue` refusal walled (any gate plane): its plane picks the record's row. */
197
+ exchange?: string;
182
198
  }
183
199
  /** Every class, in the C2 precedence order (paused before note decides first). */
184
200
  export declare const WRUN_REFUSAL_CLASSES: readonly WrunRefusalClass[];
@@ -215,6 +231,8 @@ export declare function wrunOptionsStopSeed(reason: WrunOptionsStopReason, opts?
215
231
  severity?: 'note' | 'paused';
216
232
  plane?: WrunRefusalGatePlane;
217
233
  }): WrunRefusalSeed;
234
+ /** The ONE seed of a venue wall, by the plane of the market it refused (`cmeRow` read on CME alone); none off a plane. */
235
+ export declare function wrunVenueWallSeed(venue: unknown, cmeRow?: string): WrunRefusalSeed | undefined;
218
236
  /** The variants of a class, in C2 order (the spec walks every one). */
219
237
  export declare function wrunRefusalVariants(cls: WrunRefusalClass): string[];
220
238
  /** Equal records give equal strings: a fixed key order, the params sorted by key, the telemetry last (the join