@orangecharts/wrun-chart-host 0.1.0 → 0.3.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 (337) hide show
  1. package/README.md +39 -6
  2. package/dist/constants/common.constants.d.ts +15 -0
  3. package/dist/constants/common.constants.js +23 -0
  4. package/dist/constants/data-source.constants.d.ts +1 -0
  5. package/dist/constants/data-source.constants.js +1 -0
  6. package/dist/constants/economic.constants.d.ts +39 -0
  7. package/dist/constants/economic.constants.js +77 -0
  8. package/dist/constants/etf-covered-coins.constants.d.ts +1 -0
  9. package/dist/constants/etf-covered-coins.constants.js +9 -0
  10. package/dist/constants/feature-flags.constants.d.ts +60 -0
  11. package/dist/constants/feature-flags.constants.js +308 -0
  12. package/dist/constants/feature-limits.constants.d.ts +134 -0
  13. package/dist/constants/feature-limits.constants.js +155 -0
  14. package/dist/constants/marketCapabilities.constants.d.ts +87 -0
  15. package/dist/constants/marketCapabilities.constants.js +213 -0
  16. package/dist/constants/option-venues.constants.d.ts +100 -0
  17. package/dist/constants/option-venues.constants.js +167 -0
  18. package/dist/constants/overlay-data.constants.d.ts +53 -0
  19. package/dist/constants/overlay-data.constants.js +80 -0
  20. package/dist/constants/pane-grid.constants.d.ts +15 -0
  21. package/dist/constants/pane-grid.constants.js +17 -0
  22. package/dist/constants/venue-presets.constants.d.ts +10 -0
  23. package/dist/constants/venue-presets.constants.js +22 -0
  24. package/dist/enums/chart.enum.d.ts +68 -0
  25. package/dist/enums/chart.enum.js +70 -0
  26. package/dist/helpers/data.helpers.d.ts +2 -0
  27. package/dist/helpers/data.helpers.js +14 -0
  28. package/dist/host-env.d.ts +161 -5
  29. package/dist/host-ports.types.d.ts +446 -0
  30. package/dist/host-ports.types.js +1 -0
  31. package/dist/index.d.ts +131 -0
  32. package/dist/index.js +131 -0
  33. package/dist/indicators/controls/technical-script/technical-script-input-rendering.d.ts +86 -0
  34. package/dist/indicators/controls/technical-script/technical-script-input-rendering.js +179 -0
  35. package/dist/interfaces/asset-venue.interface.d.ts +91 -0
  36. package/dist/interfaces/asset-venue.interface.js +1 -0
  37. package/dist/interfaces/cancel-reason.interface.d.ts +24 -0
  38. package/dist/interfaces/cancel-reason.interface.js +2 -0
  39. package/dist/interfaces/catalog-display.interface.d.ts +3 -0
  40. package/dist/interfaces/catalog-display.interface.js +1 -0
  41. package/dist/interfaces/cme-realtime.interface.d.ts +251 -0
  42. package/dist/interfaces/cme-realtime.interface.js +46 -0
  43. package/dist/interfaces/feed.interface.d.ts +80 -0
  44. package/dist/interfaces/feed.interface.js +7 -0
  45. package/dist/interfaces/market-kind.interface.d.ts +8 -0
  46. package/dist/interfaces/market-kind.interface.js +1 -0
  47. package/dist/interfaces/opra-realtime.interface.d.ts +224 -0
  48. package/dist/interfaces/opra-realtime.interface.js +105 -0
  49. package/dist/interfaces/option-instrument.interface.d.ts +32 -0
  50. package/dist/interfaces/option-instrument.interface.js +1 -0
  51. package/dist/interfaces/options-chain-scope.interface.d.ts +29 -0
  52. package/dist/interfaces/options-chain-scope.interface.js +7 -0
  53. package/dist/interfaces/prediction-market.interface.d.ts +88 -0
  54. package/dist/interfaces/prediction-market.interface.js +8 -0
  55. package/dist/interfaces/wrun-runtime.interface.d.ts +5 -0
  56. package/dist/kscript-data/controls/live-trades-merge.util.d.ts +185 -0
  57. package/dist/kscript-data/controls/live-trades-merge.util.js +357 -0
  58. package/dist/settings-templates/frvp-fields.d.ts +27 -0
  59. package/dist/settings-templates/frvp-fields.js +108 -0
  60. package/dist/settings-templates/index.d.ts +119 -0
  61. package/dist/settings-templates/index.js +442 -0
  62. package/dist/settings-templates/indicator-fields.d.ts +56 -0
  63. package/dist/settings-templates/indicator-fields.js +793 -0
  64. package/dist/settings-templates/tool-rules.d.ts +59 -0
  65. package/dist/settings-templates/tool-rules.js +49 -0
  66. package/dist/settings-templates/tool-tables.generated.d.ts +2 -0
  67. package/dist/settings-templates/tool-tables.generated.js +1668 -0
  68. package/dist/utility/blk-market.util.d.ts +5 -0
  69. package/dist/utility/blk-market.util.js +12 -0
  70. package/dist/utility/chart/chart-load-phase.util.d.ts +32 -0
  71. package/dist/utility/chart/chart-load-phase.util.js +78 -0
  72. package/dist/utility/chart/cme-cache-context.util.d.ts +108 -0
  73. package/dist/utility/chart/cme-cache-context.util.js +166 -0
  74. package/dist/utility/chart/cme-session-bucket.util.d.ts +82 -0
  75. package/dist/utility/chart/cme-session-bucket.util.js +343 -0
  76. package/dist/utility/chart/cme-trade-calendar.util.d.ts +26 -0
  77. package/dist/utility/chart/cme-trade-calendar.util.js +147 -0
  78. package/dist/utility/chart/continuous-contracts.util.d.ts +138 -0
  79. package/dist/utility/chart/continuous-contracts.util.js +374 -0
  80. package/dist/utility/chart/feed-interval.util.d.ts +119 -0
  81. package/dist/utility/chart/feed-interval.util.js +321 -0
  82. package/dist/utility/chart/fetch-dedupe-policy.util.d.ts +110 -0
  83. package/dist/utility/chart/fetch-dedupe-policy.util.js +407 -0
  84. package/dist/utility/chart/footprint-band.util.d.ts +76 -0
  85. package/dist/utility/chart/footprint-band.util.js +205 -0
  86. package/dist/utility/chart/footprint-cell-identity.util.d.ts +82 -0
  87. package/dist/utility/chart/footprint-cell-identity.util.js +346 -0
  88. package/dist/utility/chart/formula-calendar.util.d.ts +27 -0
  89. package/dist/utility/chart/formula-calendar.util.js +59 -0
  90. package/dist/utility/chart/history-wall.util.d.ts +67 -0
  91. package/dist/utility/chart/history-wall.util.js +87 -0
  92. package/dist/utility/chart/index-mode.util.d.ts +66 -0
  93. package/dist/utility/chart/index-mode.util.js +360 -0
  94. package/dist/utility/chart/indicator-coverage-planner.util.d.ts +217 -0
  95. package/dist/utility/chart/indicator-coverage-planner.util.js +443 -0
  96. package/dist/utility/chart/indicator-coverage-state.util.d.ts +33 -0
  97. package/dist/utility/chart/indicator-coverage-state.util.js +110 -0
  98. package/dist/utility/chart/indicator-gap-detector.util.d.ts +127 -0
  99. package/dist/utility/chart/indicator-gap-detector.util.js +260 -0
  100. package/dist/utility/chart/indicator-gap-repair.util.d.ts +88 -0
  101. package/dist/utility/chart/indicator-gap-repair.util.js +177 -0
  102. package/dist/utility/chart/indicator-inflight-registry.util.d.ts +26 -0
  103. package/dist/utility/chart/indicator-inflight-registry.util.js +254 -0
  104. package/dist/utility/chart/interval-registry.util.d.ts +23 -0
  105. package/dist/utility/chart/interval-registry.util.js +83 -0
  106. package/dist/utility/chart/kscript-main-grid-stages.util.d.ts +21 -0
  107. package/dist/utility/chart/kscript-main-grid-stages.util.js +332 -0
  108. package/dist/utility/chart/legacy-exchange.leaf.d.ts +11 -0
  109. package/dist/utility/chart/legacy-exchange.leaf.js +43 -0
  110. package/dist/utility/chart/live-bucket.util.d.ts +66 -0
  111. package/dist/utility/chart/live-bucket.util.js +165 -0
  112. package/dist/utility/chart/market-session-schedule.util.d.ts +91 -0
  113. package/dist/utility/chart/market-session-schedule.util.js +337 -0
  114. package/dist/utility/chart/marketKind.util.d.ts +181 -0
  115. package/dist/utility/chart/marketKind.util.js +371 -0
  116. package/dist/utility/chart/om-panel.util.js +6 -0
  117. package/dist/utility/chart/om-widget.util.d.ts +4 -0
  118. package/dist/utility/chart/opra-read-access.leaf.d.ts +26 -0
  119. package/dist/utility/chart/opra-read-access.leaf.js +25 -0
  120. package/dist/utility/chart/prediction-identity.util.d.ts +159 -0
  121. package/dist/utility/chart/prediction-identity.util.js +236 -0
  122. package/dist/utility/chart/rth-session.util.d.ts +352 -0
  123. package/dist/utility/chart/rth-session.util.js +926 -0
  124. package/dist/utility/chart/titan-constants.pin.d.ts +43 -0
  125. package/dist/utility/chart/titan-constants.pin.js +50 -0
  126. package/dist/utility/chart/us-equities-session.util.d.ts +127 -0
  127. package/dist/utility/chart/us-equities-session.util.js +251 -0
  128. package/dist/utility/chart/wrun-bar-session-facts.util.d.ts +100 -0
  129. package/dist/utility/chart/wrun-bar-session-facts.util.js +354 -0
  130. package/dist/utility/chart/wrun-run-result.util.js +10 -0
  131. package/dist/utility/chart/wrun-wire-ref.util.d.ts +23 -0
  132. package/dist/utility/chart/wrun-wire-ref.util.js +16 -0
  133. package/dist/utility/common/safe-math-eval.d.ts +18 -0
  134. package/dist/utility/common/safe-math-eval.js +160 -0
  135. package/dist/utility/common/time.util.d.ts +134 -0
  136. package/dist/utility/common/time.util.js +428 -0
  137. package/dist/utility/common/transformations.util.d.ts +126 -0
  138. package/dist/utility/common/transformations.util.js +711 -0
  139. package/dist/utility/common/visible-timeout.util.d.ts +17 -0
  140. package/dist/utility/common/visible-timeout.util.js +75 -0
  141. package/dist/utility/exchange-normalization.util.d.ts +8 -0
  142. package/dist/utility/exchange-normalization.util.js +32 -0
  143. package/dist/utility/intl-locale.util.d.ts +2 -0
  144. package/dist/utility/intl-locale.util.js +28 -0
  145. package/dist/utility/number-format.util.d.ts +14 -1
  146. package/dist/utility/number-format.util.js +50 -19
  147. package/dist/utility/options/option-symbol.util.d.ts +28 -0
  148. package/dist/utility/options/option-symbol.util.js +176 -0
  149. package/dist/utility/options/option-trade-units.util.d.ts +190 -0
  150. package/dist/utility/options/option-trade-units.util.js +283 -0
  151. package/dist/utility/options/option-venue.util.d.ts +75 -0
  152. package/dist/utility/options/option-venue.util.js +85 -0
  153. package/dist/utility/pool-symbol.leaf.d.ts +34 -0
  154. package/dist/utility/pool-symbol.leaf.js +95 -0
  155. package/dist/utility/scriptEditor/wrun-runtime-diagnostics.leaf.d.ts +109 -0
  156. package/dist/utility/scriptEditor/wrun-runtime-diagnostics.leaf.js +302 -0
  157. package/dist/utility/symbol-selection/contract-expiry.util.d.ts +39 -0
  158. package/dist/utility/symbol-selection/contract-expiry.util.js +111 -0
  159. package/dist/utility/v2/gate-plane.util.d.ts +58 -0
  160. package/dist/utility/v2/gate-plane.util.js +99 -0
  161. package/dist/utility/v2/gate-session-latch.util.d.ts +22 -0
  162. package/dist/utility/v2/gate-session-latch.util.js +34 -0
  163. package/dist/utility/watchlist/import/tradingview-symbols.leaf.d.ts +76 -0
  164. package/dist/utility/watchlist/import/tradingview-symbols.leaf.js +221 -0
  165. package/dist/utility/wrun/sources/host-grid-landing.d.ts +15 -0
  166. package/dist/utility/wrun/sources/host-grid-landing.js +26 -0
  167. package/dist/utility/wrun/sources/lanes/bitfinex_funding.d.ts +27 -0
  168. package/dist/utility/wrun/sources/lanes/bitfinex_funding.js +85 -0
  169. package/dist/utility/wrun/sources/lanes/economic.d.ts +27 -0
  170. package/dist/utility/wrun/sources/lanes/economic.js +79 -0
  171. package/dist/utility/wrun/sources/lanes/etf_holdings.d.ts +35 -0
  172. package/dist/utility/wrun/sources/lanes/etf_holdings.js +165 -0
  173. package/dist/utility/wrun/sources/lanes/etf_premium.d.ts +19 -0
  174. package/dist/utility/wrun/sources/lanes/etf_premium.js +114 -0
  175. package/dist/utility/wrun/sources/lanes/ethena_positions.d.ts +30 -0
  176. package/dist/utility/wrun/sources/lanes/ethena_positions.js +51 -0
  177. package/dist/utility/wrun/sources/lanes/index.d.ts +2 -0
  178. package/dist/utility/wrun/sources/lanes/index.js +32 -0
  179. package/dist/utility/wrun/sources/lanes/long_short_ratio.d.ts +17 -0
  180. package/dist/utility/wrun/sources/lanes/long_short_ratio.js +47 -0
  181. package/dist/utility/wrun/sources/lanes/option_daily.d.ts +30 -0
  182. package/dist/utility/wrun/sources/lanes/option_daily.js +53 -0
  183. package/dist/utility/wrun/sources/lanes/option_stats_10m.d.ts +23 -0
  184. package/dist/utility/wrun/sources/lanes/option_stats_10m.js +20 -0
  185. package/dist/utility/wrun/sources/lanes/options_flow.d.ts +50 -0
  186. package/dist/utility/wrun/sources/lanes/options_flow.js +155 -0
  187. package/dist/utility/wrun/sources/lanes/options_oi.d.ts +29 -0
  188. package/dist/utility/wrun/sources/lanes/options_oi.js +59 -0
  189. package/dist/utility/wrun/sources/lanes/options_volume.d.ts +38 -0
  190. package/dist/utility/wrun/sources/lanes/options_volume.js +63 -0
  191. package/dist/utility/wrun/sources/lanes/series.d.ts +67 -0
  192. package/dist/utility/wrun/sources/lanes/series.js +321 -0
  193. package/dist/utility/wrun/sources/lanes/token_supply.d.ts +30 -0
  194. package/dist/utility/wrun/sources/lanes/token_supply.js +145 -0
  195. package/dist/utility/wrun/sources/lanes/treasury_balance.d.ts +25 -0
  196. package/dist/utility/wrun/sources/lanes/treasury_balance.js +47 -0
  197. package/dist/utility/wrun/sources/lanes/volatility_index.d.ts +21 -0
  198. package/dist/utility/wrun/sources/lanes/volatility_index.js +11 -0
  199. package/dist/utility/wrun/sources/opra-option-lanes.util.d.ts +196 -0
  200. package/dist/utility/wrun/sources/opra-option-lanes.util.js +446 -0
  201. package/dist/utility/wrun/sources/registry.d.ts +21 -0
  202. package/dist/utility/wrun/sources/registry.js +207 -0
  203. package/dist/utility/wrun/sources/row-lane-registry.d.ts +28 -0
  204. package/dist/utility/wrun/sources/row-lane-registry.js +230 -0
  205. package/dist/utility/wrun/sources/row-lanes/index.d.ts +2 -0
  206. package/dist/utility/wrun/sources/row-lanes/index.js +12 -0
  207. package/dist/utility/wrun/sources/row-lanes/option_contract_flow.d.ts +2 -0
  208. package/dist/utility/wrun/sources/row-lanes/option_contract_flow.js +38 -0
  209. package/dist/utility/wrun/sources/row-lanes/option_contract_state.d.ts +6 -0
  210. package/dist/utility/wrun/sources/row-lanes/option_contract_state.js +70 -0
  211. package/dist/utility/wrun/sources/row-lanes/option_prints.d.ts +4 -0
  212. package/dist/utility/wrun/sources/row-lanes/option_prints.js +191 -0
  213. package/dist/utility/wrun/sources/row-lanes/option_strikes.d.ts +13 -0
  214. package/dist/utility/wrun/sources/row-lanes/option_strikes.js +137 -0
  215. package/dist/utility/wrun/sources/row-lanes/option_surface.d.ts +38 -0
  216. package/dist/utility/wrun/sources/row-lanes/option_surface.js +150 -0
  217. package/dist/utility/wrun/sources/wrun-poll-lane.types.d.ts +275 -0
  218. package/dist/utility/wrun/sources/wrun-poll-lane.types.js +26 -0
  219. package/dist/utility/wrun/sources/wrun-poll-lanes.util.d.ts +224 -0
  220. package/dist/utility/wrun/sources/wrun-poll-lanes.util.js +394 -0
  221. package/dist/utility/wrun/sources/wrun-row-lane.types.d.ts +283 -0
  222. package/dist/utility/wrun/sources/wrun-row-lane.types.js +16 -0
  223. package/dist/utility/wrun/sources/wrun-row-lanes.util.d.ts +205 -0
  224. package/dist/utility/wrun/sources/wrun-row-lanes.util.js +469 -0
  225. package/dist/utility/wrun/wrun-browser-sources.leaf.d.ts +28 -0
  226. package/dist/utility/wrun/wrun-browser-sources.leaf.js +66 -0
  227. package/dist/utility/wrun/wrun-cloud-record.util.d.ts +65 -0
  228. package/dist/utility/wrun/wrun-cloud-record.util.js +121 -0
  229. package/dist/utility/wrun/wrun-color-settings.util.js +1 -1
  230. package/dist/utility/wrun/wrun-daily-lane.util.d.ts +95 -0
  231. package/dist/utility/wrun/wrun-daily-lane.util.js +297 -0
  232. package/dist/utility/wrun/wrun-deadline.util.d.ts +52 -0
  233. package/dist/utility/wrun/wrun-deadline.util.js +82 -0
  234. package/dist/utility/wrun/wrun-etf-flow-lane.util.d.ts +94 -0
  235. package/dist/utility/wrun/wrun-etf-flow-lane.util.js +224 -0
  236. package/dist/utility/wrun/wrun-etf-funds.util.d.ts +82 -0
  237. package/dist/utility/wrun/wrun-etf-funds.util.js +242 -0
  238. package/dist/utility/wrun/wrun-failure-cause.d.ts +39 -0
  239. package/dist/utility/wrun/wrun-failure-cause.js +94 -0
  240. package/dist/utility/wrun/wrun-frames.d.ts +28 -3
  241. package/dist/utility/wrun/wrun-frames.js +132 -52
  242. package/dist/utility/wrun/wrun-hosted-wire-caps.d.ts +167 -4
  243. package/dist/utility/wrun/wrun-hosted-wire-caps.js +47 -2
  244. package/dist/utility/wrun/wrun-hosted-wire.util.d.ts +5 -2
  245. package/dist/utility/wrun/wrun-hosted-wire.util.js +4 -2
  246. package/dist/utility/wrun/wrun-lane-refusal.leaf.d.ts +22 -0
  247. package/dist/utility/wrun/wrun-lane-refusal.leaf.js +32 -0
  248. package/dist/utility/wrun/wrun-lane-warmup.util.d.ts +18 -0
  249. package/dist/utility/wrun/wrun-lane-warmup.util.js +112 -0
  250. package/dist/utility/wrun/wrun-leg-close.util.d.ts +57 -0
  251. package/dist/utility/wrun/wrun-leg-close.util.js +187 -0
  252. package/dist/utility/wrun/wrun-leg-fetch.util.d.ts +144 -0
  253. package/dist/utility/wrun/wrun-leg-fetch.util.js +212 -0
  254. package/dist/utility/wrun/wrun-leg-stream-classes.d.ts +73 -0
  255. package/dist/utility/wrun/wrun-leg-stream-classes.js +86 -0
  256. package/dist/utility/wrun/wrun-levels-child.util.d.ts +101 -6
  257. package/dist/utility/wrun/wrun-levels-child.util.js +335 -157
  258. package/dist/utility/wrun/wrun-memory-clamp.util.d.ts +33 -0
  259. package/dist/utility/wrun/wrun-memory-clamp.util.js +146 -0
  260. package/dist/utility/wrun/wrun-odds-template-market.util.d.ts +51 -0
  261. package/dist/utility/wrun/wrun-odds-template-market.util.js +251 -0
  262. package/dist/utility/wrun/wrun-opra-flow.leaf.d.ts +65 -0
  263. package/dist/utility/wrun/wrun-opra-flow.leaf.js +94 -0
  264. package/dist/utility/wrun/wrun-opra-lane.util.d.ts +47 -0
  265. package/dist/utility/wrun/wrun-opra-lane.util.js +58 -0
  266. package/dist/utility/wrun/wrun-opra-stats.leaf.d.ts +30 -0
  267. package/dist/utility/wrun/wrun-opra-stats.leaf.js +96 -0
  268. package/dist/utility/wrun/wrun-opra-underlying.util.d.ts +12 -0
  269. package/dist/utility/wrun/wrun-opra-underlying.util.js +1 -0
  270. package/dist/utility/wrun/wrun-option-contract-flow.util.d.ts +142 -0
  271. package/dist/utility/wrun/wrun-option-contract-flow.util.js +451 -0
  272. package/dist/utility/wrun/wrun-option-knobs.util.d.ts +43 -0
  273. package/dist/utility/wrun/wrun-option-knobs.util.js +81 -0
  274. package/dist/utility/wrun/wrun-option-prints.util.d.ts +144 -0
  275. package/dist/utility/wrun/wrun-option-prints.util.js +356 -0
  276. package/dist/utility/wrun/wrun-option-summary-lane.util.d.ts +102 -0
  277. package/dist/utility/wrun/wrun-option-summary-lane.util.js +143 -0
  278. package/dist/utility/wrun/wrun-options-chain.util.d.ts +308 -0
  279. package/dist/utility/wrun/wrun-options-chain.util.js +502 -0
  280. package/dist/utility/wrun/wrun-overlay-identity.util.d.ts +9 -4
  281. package/dist/utility/wrun/wrun-overlay-identity.util.js +16 -6
  282. package/dist/utility/wrun/wrun-pack.util.d.ts +6 -2
  283. package/dist/utility/wrun/wrun-pack.util.js +13 -3
  284. package/dist/utility/wrun/wrun-param-map.util.d.ts +298 -0
  285. package/dist/utility/wrun/wrun-param-map.util.js +581 -0
  286. package/dist/utility/wrun/wrun-param-values.util.d.ts +8 -0
  287. package/dist/utility/wrun/wrun-param-values.util.js +8 -0
  288. package/dist/utility/wrun/wrun-pin-spelling.util.d.ts +149 -0
  289. package/dist/utility/wrun/wrun-pin-spelling.util.js +523 -0
  290. package/dist/utility/wrun/wrun-pin-venues.util.d.ts +116 -0
  291. package/dist/utility/wrun/wrun-pin-venues.util.js +320 -0
  292. package/dist/utility/wrun/wrun-pinned-interval.util.d.ts +20 -0
  293. package/dist/utility/wrun/wrun-pinned-interval.util.js +47 -0
  294. package/dist/utility/wrun/wrun-present-bits.util.d.ts +37 -0
  295. package/dist/utility/wrun/wrun-present-bits.util.js +73 -0
  296. package/dist/utility/wrun/wrun-protocol-pending.util.d.ts +33 -0
  297. package/dist/utility/wrun/wrun-protocol-pending.util.js +57 -0
  298. package/dist/utility/wrun/wrun-refusal.util.d.ts +95 -7
  299. package/dist/utility/wrun/wrun-refusal.util.js +314 -18
  300. package/dist/utility/wrun/wrun-registry-errors.util.d.ts +1 -14
  301. package/dist/utility/wrun/wrun-registry-errors.util.js +0 -16
  302. package/dist/utility/wrun/wrun-render-select.util.js +1 -0
  303. package/dist/utility/wrun/wrun-row-market.util.d.ts +29 -0
  304. package/dist/utility/wrun/wrun-row-market.util.js +92 -0
  305. package/dist/utility/wrun/wrun-row-source.d.ts +158 -0
  306. package/dist/utility/wrun/wrun-row-source.js +75 -0
  307. package/dist/utility/wrun/wrun-run-health.util.d.ts +155 -0
  308. package/dist/utility/wrun/wrun-run-health.util.js +273 -0
  309. package/dist/utility/wrun/wrun-socket-row-source.d.ts +439 -0
  310. package/dist/utility/wrun/wrun-socket-row-source.js +1689 -0
  311. package/dist/utility/wrun/wrun-socket-session-losses.util.d.ts +18 -0
  312. package/dist/utility/wrun/wrun-socket-session-losses.util.js +25 -0
  313. package/dist/utility/wrun/wrun-source-rows.util.d.ts +911 -0
  314. package/dist/utility/wrun/wrun-source-rows.util.js +2597 -0
  315. package/dist/utility/wrun/wrun-symbol-code.util.d.ts +32 -0
  316. package/dist/utility/wrun/wrun-symbol-code.util.js +56 -0
  317. package/dist/utility/wrun/wrun-tape-source.util.d.ts +82 -0
  318. package/dist/utility/wrun/wrun-tape-source.util.js +151 -0
  319. package/dist/utility/wrun/wrun-tier-grid.util.d.ts +137 -0
  320. package/dist/utility/wrun/wrun-tier-grid.util.js +279 -0
  321. package/dist/utility/wrun/wrun-trades-lane.util.d.ts +52 -0
  322. package/dist/utility/wrun/wrun-trades-lane.util.js +58 -0
  323. package/dist/utility/wrun/wrun-volume-profile-lane.util.d.ts +41 -0
  324. package/dist/utility/wrun/wrun-volume-profile-lane.util.js +66 -0
  325. package/dist/utility/wrun-display-name.util.d.ts +33 -0
  326. package/dist/utility/wrun-display-name.util.js +64 -0
  327. package/dist/workers/constants/kscript-transport-codes.d.ts +15 -0
  328. package/dist/workers/constants/kscript-transport-codes.js +15 -0
  329. package/dist/workers/constants/socket-slots.d.ts +574 -0
  330. package/dist/workers/constants/socket-slots.js +539 -0
  331. package/dist/workers/utils/number.worker.util.d.ts +5 -0
  332. package/dist/workers/utils/number.worker.util.js +10 -0
  333. package/dist/workers/utils/time.worker.util.d.ts +12 -0
  334. package/dist/workers/utils/time.worker.util.js +24 -0
  335. package/dist/workers/utils/volume-profile.worker.util.d.ts +200 -0
  336. package/dist/workers/utils/volume-profile.worker.util.js +631 -0
  337. package/package.json +10 -4
@@ -0,0 +1,407 @@
1
+ /**
2
+ * The fetch-dedupe policy table (fan-out unification P5): every class of
3
+ * duplicate handling against the fetchCache ledger, NAMED, with the reason
4
+ * it exists. Zero behavior change: the two guard sites in
5
+ * data-fetching.util.ts (main ~2282, indicator ~4440) consult this resolver
6
+ * instead of raw flag combinations; branch precedence mirrors the historical
7
+ * code order exactly and is pinned by the exhaustive golden table.
8
+ *
9
+ * Verbs:
10
+ * - onPendingTwin: what to do when an identical same-key request is in
11
+ * flight. 'await' coalesces onto it, 'skip' drops this request (the
12
+ * wave/recovery loop owns covering the span), 'ignore' dispatches anyway.
13
+ * - onRecentCompletion: what to do when an identical key completed within
14
+ * the fetchCache completion window. 'skip' drops, 'refresh' fetches anyway
15
+ * (heals must re-request), 'ignore' means the lane never consults the
16
+ * window at all.
17
+ * - registersPending: whether the dispatch marks a pending ledger entry
18
+ * (owner-token guarded) that twins can observe.
19
+ *
20
+ * The legally-asked-twice cases are deliberate: main polling + main gap
21
+ * recovery can fetch overlapping windows on the same tick, and post-wake
22
+ * resync overlaps both; main-data merges are idempotent by design, and the
23
+ * backend bucket cache absorbs bucket-canonical repeats cheaply.
24
+ *
25
+ * Ledger key and retraction scope (data-loading plan S1, 2026-09-26): the
26
+ * verbs above select a policy, they never build a key. The indicator lane's
27
+ * pending/completion key carries the interval, the market identity and the
28
+ * indicator cache settings fingerprint after the `${chartIndex}-${overlayId}-`
29
+ * prefix (fetch-cache.util getKey; data-fetching.util
30
+ * indicatorFetchLedgerSegments), so a twin is only ever an ask for the SAME
31
+ * market, interval and settings, and a completion recorded under old settings
32
+ * can never satisfy a 'skip' verb for new ones. Overlay actions (settings
33
+ * refetch, removeIndicator, the OB depth resubscribe) retract only their own
34
+ * overlay (fetchCache.clearOverlay); cancelFetchDataOfChart's clearChart stays
35
+ * the only chart-wide sweep. Neither changes a row of this table, and both
36
+ * goldens (fetch-dedupe-policies.json, fetch-dedupe-resolution.json) stay
37
+ * byte-identical: the ledger specs are the gate for key and scope.
38
+ *
39
+ * Flag discipline (adjudicated 2026-07-27): isPolling is reserved for the
40
+ * steady-state cadence lane (useDataPolling's per-tick polls). Indicator
41
+ * gap-repair and gap-recovery initiators (the B3 plain repair scan, the B4
42
+ * recovery poller, executePlannedPlainIndicatorFetch, the one-shot gap heal)
43
+ * stamp { isLazyload, isGapRecovery } WITHOUT isPolling, so they resolve to
44
+ * IND_REPAIR_REFRESH. They historically also stamped isPolling, which this
45
+ * resolver's precedence routed to IND_POLL_BYPASS: no pending registration,
46
+ * pending twins ignored, and exemption from the known-empty/doomed guard
47
+ * classes. That mislabel produced the same-identity duplicate-network pairs
48
+ * and the upstream-persistent refetch hammer in the 2026-07-27 field dumps.
49
+ * The resolver precedence itself is unchanged (the golden pins it); only the
50
+ * initiators' declared intent moved.
51
+ *
52
+ * The replay-DOM window lane (DOM_REPLAY_WINDOW, Spec 2B/C) is a ledger
53
+ * bypass like the replay buffer lane: its duplicate control is the
54
+ * replayDomDriver module latch per (instanceId, generation, windowStartSec),
55
+ * not the fetchCache. isReplayBuffer outranks isDomReplayWindow when both are
56
+ * stamped (the buffer lane's own collector wins).
57
+ *
58
+ * Two suppression classes live OUTSIDE this flag table because they depend on
59
+ * delivered data, not request flags:
60
+ * - FIXED_WINDOW_COVERED_SKIP (fixed-window-fetch-skip.util.ts): fixed-window
61
+ * single-request overlays replace the wave span with a settings-derived
62
+ * range at payload build, so ledger keys never match their repeats; the
63
+ * guard site skips heal-class lazy refetches while the overlay has
64
+ * delivered rows.
65
+ * - KNOWN_EMPTY_RANGE_SKIP (known-empty-range.util.ts): a heal-class fetch
66
+ * whose response was truly empty (backend has no data for that range, e.g.
67
+ * past orderflow retention) arms a 60s identity+range memory; heal-class
68
+ * re-asks of the same window skip until the TTL expires instead of looping
69
+ * the identical empty fetch every wave round.
70
+ */
71
+ /**
72
+ * Kill switch for data-loading phase S6 (background lanes, poll cadence
73
+ * inputs, recovery terminals), in the boot-provisional shape
74
+ * (boot-candle-intent.util): the compile-time HARD_KILL dominates (flipping it
75
+ * true dead-ends the phase for every cohort, guests and pre-flag boots
76
+ * included, in one revert), below it the runtime read is
77
+ * `!isExplicitlyOff('data-load-heal-register')`: default ON, only a doc
78
+ * minted `enabled: false` (or the dev override) darkens it. The store read is
79
+ * INJECTED (data-fetching.util registers it at module init) so this table
80
+ * stays a leaf the golden specs can import without pinia; unregistered
81
+ * (node specs of the leaf consumers) reads ON, exactly like an unminted key.
82
+ * Consumers read the value ONCE where they plan (the poll tick, the resync
83
+ * pass, the heal decision) and carry it, so a flag map landing mid-pass
84
+ * cannot mix rules.
85
+ */
86
+ const DATA_LOAD_HEAL_REGISTER_HARD_KILL = false;
87
+ let dataLoadHealRegisterExplicitlyOff = null;
88
+ export function registerDataLoadHealRegisterFlagReader(reader) {
89
+ dataLoadHealRegisterExplicitlyOff = reader;
90
+ }
91
+ export function isDataLoadHealRegisterEnabled() {
92
+ if (DATA_LOAD_HEAL_REGISTER_HARD_KILL)
93
+ return false;
94
+ try {
95
+ return dataLoadHealRegisterExplicitlyOff?.() !== true;
96
+ }
97
+ catch {
98
+ return true;
99
+ }
100
+ }
101
+ const POLICIES = {
102
+ MAIN_COALESCE: {
103
+ name: 'MAIN_COALESCE',
104
+ onPendingTwin: 'await',
105
+ onRecentCompletion: 'ignore',
106
+ registersPending: true,
107
+ why: 'An identical in-flight twin paints this same chart slot; await it. Recent completions are ' +
108
+ 'deliberately NOT suppressed for main data: cache-aligned requests are bucket-canonical, so ' +
109
+ 'legitimate re-fetches carry identical keys by design and skipping them strands stale paints.',
110
+ },
111
+ MAIN_POLL_BYPASS: {
112
+ name: 'MAIN_POLL_BYPASS',
113
+ onPendingTwin: 'ignore',
114
+ onRecentCompletion: 'ignore',
115
+ registersPending: false,
116
+ why: 'Polling re-issues an identical (from=0, period) key every tick; it once marked itself pending ' +
117
+ 'without clearing, silently suppressing every poll after the first.',
118
+ },
119
+ MAIN_HISTORICAL_BYPASS: {
120
+ name: 'MAIN_HISTORICAL_BYPASS',
121
+ onPendingTwin: 'ignore',
122
+ onRecentCompletion: 'ignore',
123
+ registersPending: false,
124
+ why: 'Historical-mode fetches replace the dataset under explicit identity stamps; nothing may absorb them.',
125
+ },
126
+ MAIN_RETRY_BYPASS: {
127
+ name: 'MAIN_RETRY_BYPASS',
128
+ onPendingTwin: 'ignore',
129
+ onRecentCompletion: 'ignore',
130
+ registersPending: false,
131
+ why: 'Blank-boot retries and hedges exist to dispatch a REAL transport request past a possibly wedged twin.',
132
+ },
133
+ IND_SKIP_DUPLICATE: {
134
+ name: 'IND_SKIP_DUPLICATE',
135
+ onPendingTwin: 'skip',
136
+ onRecentCompletion: 'skip',
137
+ registersPending: true,
138
+ why: 'Indicator policy differs from main: in-flight duplicates are skipped, not awaited, because the ' +
139
+ 'lazy wave / gap-recovery loop owns covering the span; a recent completion means the span was just served. ' +
140
+ 'CMETAIL adjudication 2026-09-02: that ownership assumption fails for types outside those healers, so a ' +
141
+ 'pending-duplicate skip leaves a re-arm receipt on the owner and an UNSERVED owner terminal re-dispatches ' +
142
+ 'the skipped ask once (rearmHop dispatches never re-arm: no chains).',
143
+ },
144
+ IND_REPAIR_REFRESH: {
145
+ name: 'IND_REPAIR_REFRESH',
146
+ onPendingTwin: 'skip',
147
+ onRecentCompletion: 'refresh',
148
+ registersPending: true,
149
+ why: 'Lazy-load and gap-recovery requests may re-request a recently completed range, but never bypass the ' +
150
+ 'in-flight duplicate guard. A receipt is a claim, never proof of rows: a gap heal of a CLOSED window ' +
151
+ 'stays home on its receipt only where every 50-bar piece holds a row on the pane or no main bar ' +
152
+ '(COVERED_RECENT_COMPLETION_SKIP, the stamp-proof round 2026-10-08), and every other heal refreshes ' +
153
+ 'past it. A lazy wave re-ask skips only the whole-span repeat (receipt plus a spanning row set).',
154
+ },
155
+ IND_POLL_BYPASS: {
156
+ name: 'IND_POLL_BYPASS',
157
+ onPendingTwin: 'ignore',
158
+ onRecentCompletion: 'ignore',
159
+ registersPending: false,
160
+ why: 'Indicator polling sizes its own steady-state requests each tick; the ledger never gates it.',
161
+ },
162
+ HEATMAP_CACHE_ONLY_BYPASS: {
163
+ name: 'HEATMAP_CACHE_ONLY_BYPASS',
164
+ onPendingTwin: 'ignore',
165
+ onRecentCompletion: 'ignore',
166
+ registersPending: false,
167
+ why: 'Cache-only heatmap reads serve from the local chunk cache; transport dedupe must not suppress them.',
168
+ },
169
+ IND_RETRY_BYPASS: {
170
+ name: 'IND_RETRY_BYPASS',
171
+ onPendingTwin: 'ignore',
172
+ onRecentCompletion: 'ignore',
173
+ registersPending: false,
174
+ why: 'The transport retry chain re-dispatches its own request; its twin IS the entry being retried.',
175
+ },
176
+ IND_SPLIT_FAMILY_OWNER_CHILD: {
177
+ name: 'IND_SPLIT_FAMILY_OWNER_CHILD',
178
+ onPendingTwin: 'ignore',
179
+ onRecentCompletion: 'ignore',
180
+ registersPending: false,
181
+ why: 'A split-family child whose span equals the pre-split span its parent registered as pending (the ' +
182
+ "planner's settled-tail cut leaves the newest unsettled piece as the parent's own ask). The pending " +
183
+ 'twin it sees IS its own family: skipping it left the span unserved and attached a re-arm receipt to ' +
184
+ 'the parent, whose unserved terminal re-dispatched the identical ask in a microtask, forever (the ' +
185
+ '2026-09-19 ETHUSDT heatmap dump: about 30 family cycles a second, over 100 fetch entries, the newest ' +
186
+ 'two book columns never painted). The parent already passed the recent-completion gate for this exact ' +
187
+ 'span and holds the ' +
188
+ 'ledger entry, so the child neither consults nor writes the ledger.',
189
+ },
190
+ IND_REPLAY_LANE_BYPASS: {
191
+ name: 'IND_REPLAY_LANE_BYPASS',
192
+ onPendingTwin: 'ignore',
193
+ onRecentCompletion: 'ignore',
194
+ registersPending: false,
195
+ why: 'Replay lane fetches deliver through their own collector (onReplayRows) and never paint the chart, ' +
196
+ "so a ledger twin's completion can NEVER reach this consumer: a settings re-lane re-requests the " +
197
+ 'same deterministic chunk windows the replaced lane generation just fetched, and suppressing it ' +
198
+ 'registers an empty coarse buffer (history footprints vanish after a ticksize change). Replay owns ' +
199
+ 'its own duplicate control (session overlay-load joins, prepareOne single-flight, the lane chunk ' +
200
+ 'cap), and it must not poison the production ledger either, so it neither consults nor writes it.',
201
+ },
202
+ IND_SEAM_TOPUP: {
203
+ name: 'IND_SEAM_TOPUP',
204
+ onPendingTwin: 'skip',
205
+ onRecentCompletion: 'refresh',
206
+ registersPending: true,
207
+ why: 'The one-shot 1s book seam top-up (heatmap-seam-topup.util.ts, adjudicated 2026-08-10) re-asks the ' +
208
+ 'structurally unowned [clipFloor .. first live apply] window once it ages past the 3-minute replay ' +
209
+ 'cap. Same verbs as IND_REPAIR_REFRESH (a heal must actually refresh, never bypass the in-flight ' +
210
+ 'guard) under its own honest name: one-shot per (overlay identity, clip floor) is enforced by the ' +
211
+ "module's fired latch, only its standard transport retries take the retry bypass, and the 1s book " +
212
+ 'entitlement denial stays terminal (breaker consulted before dispatch, never re-asked).',
213
+ },
214
+ KSCRIPT_SOURCE_DEDUPE: {
215
+ name: 'KSCRIPT_SOURCE_DEDUPE',
216
+ onPendingTwin: 'skip',
217
+ onRecentCompletion: 'skip',
218
+ registersPending: true,
219
+ why: 'Engine source fetches single-flight per source (kScriptSourceFetchInFlight) and consult the shared ' +
220
+ 'ledger. P6 key fix landed: entries are keyed by real chartIndex and completion keys carry the same ' +
221
+ '(type, sourceName) as start keys, resolved on every terminal path; empty successful replies clear ' +
222
+ 'the pending without recording a suppressing completion. The TECHNICAL_SCRIPT dup exemption remains ' +
223
+ 'pending its own adjudication.',
224
+ },
225
+ DOM_REPLAY_WINDOW: {
226
+ name: 'DOM_REPLAY_WINDOW',
227
+ onPendingTwin: 'ignore',
228
+ onRecentCompletion: 'ignore',
229
+ registersPending: false,
230
+ why: 'Replay-DOM window fetches (replayDomDriver.ts, adjudicated with Spec 2B/C) deliver through the ' +
231
+ "driver's own collector into the pane worker's replay rings and never paint an overlay, so a ledger " +
232
+ "twin's completion can never reach this consumer; like the replay buffer lane they neither consult " +
233
+ 'nor write the production ledger. Duplicate control is the module one-shot latch per ' +
234
+ '(instanceId, generation, windowStartSec): fired windows never re-dispatch within a generation, a ' +
235
+ 'failed window unlatches behind a cooldown, and the 1s book entitlement denial stays terminal ' +
236
+ '(breaker consulted before dispatch, never re-asked). Shed or suppressed windows are logged through ' +
237
+ 'the lazy-load debug ring, never dropped silently.',
238
+ },
239
+ TAPE_SVP_SEED: {
240
+ name: 'TAPE_SVP_SEED',
241
+ onPendingTwin: 'ignore',
242
+ onRecentCompletion: 'ignore',
243
+ registersPending: false,
244
+ why: 'Tape session-SVP seed fetches (tape-svp-seed.service.ts, adjudicated with DOM new-viz F5) stream ' +
245
+ '[sessionStart, enterCutoff) K_TRADES rows into a STAGING accumulator that merges atomically into ' +
246
+ 'the tape session stats on complete success and is discarded whole on any failure; they never paint ' +
247
+ 'an overlay, so like the replay lanes they neither consult nor write the production ledger. ' +
248
+ 'Duplicate control is the service latch, one-shot per (chartIndex, enterGeneration, sessionStartMs): ' +
249
+ 'a failed seed never re-asks within its enter scope (re-enter re-runs), stop/retarget aborts the ' +
250
+ 'in-flight run through enterGeneration ownership, and session rollover re-arms under a new ' +
251
+ 'sessionStart key. Deterministic-refusal exclusions apply: the known-empty and doomed-range guard ' +
252
+ 'classes never gate this lane because its collector owns emptiness honestly (an empty session seeds ' +
253
+ 'nothing and still commits).',
254
+ },
255
+ FOOTPRINT_PANEL: {
256
+ name: 'FOOTPRINT_PANEL',
257
+ onPendingTwin: 'ignore',
258
+ onRecentCompletion: 'ignore',
259
+ registersPending: false,
260
+ why: 'Footprint panel own-lane fetches (footprint-panel-lane.service.ts, FOOTPRINT-PANEL) ask VOLUME_FOOTPRINT or ' +
261
+ 'AGGREGATED_VOLUME_FOOTPRINT snapshot windows under a fresh synthetic ovId per request and deliver into the ' +
262
+ "panel lane's own store, never an overlay, so like the tape seed they neither consult nor write the " +
263
+ 'production ledger. Duplicate control is the lane: the panel shows only the forming candle, so it asks one ' +
264
+ '2-bar tail at a time (the forming candle and the one before it: on open, at a candle roll, then every 1 s, ' +
265
+ '5 s after an error, resting once a closed market answered its final row) and tears down on every chart, ' +
266
+ 'market, setting or replay change. Every request reads its transport outcome (polls included), so a ' +
267
+ 'laundered completion never records an empty; the known-empty and doomed-range guard classes never gate it ' +
268
+ 'because the lane owns emptiness itself.',
269
+ },
270
+ };
271
+ /** Branch precedence mirrors the historical guard-site code order exactly. */
272
+ export function resolveFetchDedupePolicy(intent) {
273
+ if (intent.lane === 'main') {
274
+ if (intent.isPolling)
275
+ return POLICIES.MAIN_POLL_BYPASS;
276
+ if (intent.isHistoricalModeFetch)
277
+ return POLICIES.MAIN_HISTORICAL_BYPASS;
278
+ if (intent.bypassPendingCoalesce)
279
+ return POLICIES.MAIN_RETRY_BYPASS;
280
+ return POLICIES.MAIN_COALESCE;
281
+ }
282
+ if (intent.lane === 'kscript-source') {
283
+ return POLICIES.KSCRIPT_SOURCE_DEDUPE;
284
+ }
285
+ if (intent.isReplayBuffer)
286
+ return POLICIES.IND_REPLAY_LANE_BYPASS;
287
+ if (intent.isDomReplayWindow)
288
+ return POLICIES.DOM_REPLAY_WINDOW;
289
+ if (intent.isTapeSvpSeed)
290
+ return POLICIES.TAPE_SVP_SEED;
291
+ if (intent.isFootprintPanel)
292
+ return POLICIES.FOOTPRINT_PANEL;
293
+ if (intent.isPolling)
294
+ return POLICIES.IND_POLL_BYPASS;
295
+ if (intent.heatmapCacheOnly)
296
+ return POLICIES.HEATMAP_CACHE_ONLY_BYPASS;
297
+ if (intent.bypassPendingCoalesce)
298
+ return POLICIES.IND_RETRY_BYPASS;
299
+ if (intent.isSplitFamilyOwnerChild)
300
+ return POLICIES.IND_SPLIT_FAMILY_OWNER_CHILD;
301
+ if (intent.isHeatmapSeamTopUp)
302
+ return POLICIES.IND_SEAM_TOPUP;
303
+ if (intent.isLazyload || intent.isGapRecovery)
304
+ return POLICIES.IND_REPAIR_REFRESH;
305
+ return POLICIES.IND_SKIP_DUPLICATE;
306
+ }
307
+ export const FETCH_DEDUPE_POLICIES = Object.values(POLICIES);
308
+ // ── Kill switch: the main coverage step, PLAN (data-loading plan S4, A42) ──
309
+ //
310
+ // The boot-provisional shape (boot-candle-intent.util): a compile-time
311
+ // HARD_KILL above a runtime `!isExplicitlyOff(key)` read, default ON. The
312
+ // value is read ONCE per chart context token (captureChartContext) and rides
313
+ // the token through plan, kick, reconcile and commit, so a flag map landing
314
+ // mid-switch cannot mix rules. Flipping HARD_KILL true disables the phase for
315
+ // every cohort, guests and pre-flag boots included; minting the key
316
+ // `enabled: false` darkens it for logged-in users without a deploy. Off
317
+ // restores today's full-window ask, the whole-window replace arms and the
318
+ // paint-or-nothing read; the span store, the receipts, the staging slot and
319
+ // the identity key stay inert. The store read is injected so this module
320
+ // stays import-free (the dedupe goldens import it in node).
321
+ const MAIN_PLAN_HARD_KILL = false;
322
+ export const MAIN_PLAN_FLAG_KEY = 'data-load-main-plan';
323
+ export function isMainPlanEnabled(readExplicitlyOff) {
324
+ if (MAIN_PLAN_HARD_KILL)
325
+ return false;
326
+ try {
327
+ return !readExplicitlyOff(MAIN_PLAN_FLAG_KEY);
328
+ }
329
+ catch {
330
+ // An unloaded or unavailable store reads ON (feature-gating.md, default-ON flags).
331
+ return true;
332
+ }
333
+ }
334
+ // ── Kill switch: receipts cover settled bars only (data-load-receipt-settle) ──
335
+ //
336
+ // The same boot-provisional shape as the plan switch above, read once per
337
+ // chart context token (captureChartContext), once per poll cycle for the
338
+ // live-silent main poll and once per prefetch warm. Off restores today's
339
+ // receipts and polls exactly: no settle cut and no newest-row rule on a
340
+ // receipt (wire-receipt-settle.util), no widening of PLAN over mounted rows no
341
+ // receipt covers, no receipted-tail rule on the dry lane, no live-silent main
342
+ // poll. The one-time receipt epoch reset (ohlcv-cache.service
343
+ // WIRE_RECEIPT_EPOCH) is one-way and not behind it.
344
+ const RECEIPT_SETTLE_HARD_KILL = false;
345
+ export const RECEIPT_SETTLE_FLAG_KEY = 'data-load-receipt-settle';
346
+ export function isReceiptSettleEnabled(readExplicitlyOff) {
347
+ if (RECEIPT_SETTLE_HARD_KILL)
348
+ return false;
349
+ try {
350
+ return !readExplicitlyOff(RECEIPT_SETTLE_FLAG_KEY);
351
+ }
352
+ catch {
353
+ // An unloaded or unavailable store reads ON (feature-gating.md, default-ON flags).
354
+ return true;
355
+ }
356
+ }
357
+ /**
358
+ * Cross-chart sharing eligibility (data-loading plan S11a, Codex C7), derived
359
+ * from the RESOLVED policy and carried BESIDE the canonical payload to the
360
+ * transport (V2FetchOptions.shareable), never inside it, so the wire payload
361
+ * stays byte-identical and both dedupe goldens stay untouched (this is a
362
+ * function over the name, not a policy field). An ineligible dispatch never
363
+ * attaches to an in-flight shared request and opens one nobody may attach
364
+ * to: a hedge or blank-boot retry exists to escape a possibly wedged twin
365
+ * (MAIN_RETRY_BYPASS, IND_RETRY_BYPASS), a historical-mode fetch replaces
366
+ * the dataset under explicit identity stamps, and the replay, DOM-replay,
367
+ * tape-seed, footprint-panel and cache-only lanes deliver through collectors
368
+ * that never paint the chart. Everything else (coalesce, polls, repair, split
369
+ * children, the seam top-up, engine sources) may share one wire request
370
+ * across panes.
371
+ */
372
+ const UNSHAREABLE_FETCH_DEDUPE_POLICIES = new Set([
373
+ 'MAIN_RETRY_BYPASS',
374
+ 'MAIN_HISTORICAL_BYPASS',
375
+ 'IND_RETRY_BYPASS',
376
+ 'HEATMAP_CACHE_ONLY_BYPASS',
377
+ 'IND_REPLAY_LANE_BYPASS',
378
+ 'DOM_REPLAY_WINDOW',
379
+ 'TAPE_SVP_SEED',
380
+ 'FOOTPRINT_PANEL',
381
+ ]);
382
+ export function isShareableFetchDedupePolicy(policy) {
383
+ const name = typeof policy === 'string' ? policy : policy.name;
384
+ return !UNSHAREABLE_FETCH_DEDUPE_POLICIES.has(name);
385
+ }
386
+ // ── Kill switch: one kick base, delta reconcile, overlay coverage subtraction (data-loading plan S5, A42) ──
387
+ //
388
+ // Same shape and lifecycle as the main coverage step above: read ONCE per
389
+ // chart context token and carried through the kick, the post-main compare,
390
+ // the reconcile slice and the commit contract. Off restores the raw-window
391
+ // early heatmap kick, the union reconcile, the unserved outcome for
392
+ // ledger-skipped children, whole-window overlay asks and the flag-driven
393
+ // replace decision; the complete-bucket stamps, the ledger key and the
394
+ // receipts stay inert.
395
+ export const KICK_BASE_HARD_KILL = false;
396
+ export const KICK_BASE_FLAG_KEY = 'data-load-kick-base';
397
+ export function isKickBaseEnabled(readExplicitlyOff) {
398
+ if (KICK_BASE_HARD_KILL)
399
+ return false;
400
+ try {
401
+ return !readExplicitlyOff(KICK_BASE_FLAG_KEY);
402
+ }
403
+ catch {
404
+ // An unloaded or unavailable store reads ON (feature-gating.md, default-ON flags).
405
+ return true;
406
+ }
407
+ }
@@ -0,0 +1,76 @@
1
+ /**
2
+ * Footprint display bands are CENTERED on their price level.
3
+ *
4
+ * The server (and the live bucketing) reports volume AT a grid price: the
5
+ * profile row for a bar's high is the high itself. Rendering that price as
6
+ * the band's BOTTOM edge draws the high row's cell entirely above the wick
7
+ * (and the low row flush-inside), because boundary trades always sit exactly
8
+ * on the grid. Centering matches the TPO renderer's convention
9
+ * (price - tickSize / 2) and keeps the extreme rows straddling the wick tips.
10
+ *
11
+ * Coarse cells (render height > tick, i.e. barHeightMultiplier >= 2) hold the
12
+ * fine levels [rung, rung + cellHeight). Their band is the union of those
13
+ * levels' centered bands: [rung - tick/2, rung + cellHeight - tick/2]. The
14
+ * offset is half a TICK, not half the cell: shifting by cellHeight/2 (the
15
+ * pre-2026-08 behavior) parked every coarse cell half a row below where its
16
+ * volume traded, so the top cell could end below the bar's high while the
17
+ * bottom cell overhung the low. Cells keep the full grid width, which keeps
18
+ * adjacent cells contiguous and titan's row-LOD merge stable.
19
+ *
20
+ * Both producers of footprint buckets use this with the settings tick: the
21
+ * worker's historical fetch and the live delta merge (for a row with no cell
22
+ * to copy its phase from). Neither keys on the resulting priceLow: cells are
23
+ * identified by their integer row index (footprint-cell-identity.util), so a
24
+ * tick that differs between the two in the last bit moves a cell's drawing
25
+ * by at most half a tick and can never split it into two.
26
+ *
27
+ * The tick is the ANCHOR tick (`resolveFootprintAnchorTick`): the exchange
28
+ * price tick inferred from the chart's own candles, clamped to each row's own
29
+ * height. The minimum block is NOT the tick on every venue: the
30
+ * gateway serves Binance BTCUSDT profiles in 3.0 buckets keyed by the bucket
31
+ * LOW (trades at 78533.8 land in row 78531), so a half-BLOCK offset drew every
32
+ * cell 1.5 too low and the row holding the candle low sat entirely under the
33
+ * wick (field case 2026-09-11). Where block == tick (CME after the exchange-tick
34
+ * move, prediction cents) the anchor is the block and nothing changes.
35
+ *
36
+ * Centering is the LAST step of the fetch pipeline, at the render bar height:
37
+ * everything upstream floors priceLow onto a zero-based grid, so a half-shifted
38
+ * low lands a rung low and regroups the cells. Changing this anchoring changes
39
+ * the cached-row format: bump INDICATOR_CACHE_CONFIG.SCHEMA_VERSION with it.
40
+ */
41
+ export declare function decimalPlaces(value: number): number;
42
+ export declare function centeredFootprintBand(gridPrice: number, bandHeight: number, tickSize?: number | null): [number, number];
43
+ /** Candle rows sampled for the tick inference (main rawData: [ts, o, h, l, c, ...]). */
44
+ export declare const PRICE_TICK_INFERENCE_ROWS = 2000;
45
+ /**
46
+ * The exchange price tick as the chart's own candles reveal it: the greatest
47
+ * common divisor of every OHLC value's distance to the first, computed in
48
+ * whole units of the sample's decimal places and returned as a clean decimal.
49
+ * No metadata carries a per-symbol tick, and the profile block catalog is not
50
+ * one (Binance BTCUSDT: block 3.0, tick 0.1). Every traded price is a tick
51
+ * multiple, so the estimate can only ever be the tick or a multiple of it (a
52
+ * thin sample), never finer.
53
+ *
54
+ * Integer arithmetic, not the smallest float gap: at 85,000 a 0.01 gap
55
+ * subtracts to 0.0099999999947 and snapping it to 9 significant digits kept
56
+ * the dust (0.00999999999 on Coinbase BTC-USD, Binance BTCUSDT spot, BRK.A;
57
+ * 0.000999999999 on a 0.001-tick ETH book). Each price is read at
58
+ * PRICE_TICK_SIGNIFICANT_DIGITS so client-side float noise is not a lattice.
59
+ * Null below `minRows` rows, until two distinct prices exist, or when the
60
+ * sample has no decimal lattice (more than PRICE_TICK_MAX_DECIMALS places:
61
+ * AMM-priced tokens, split-adjusted stocks) or its whole units overflow safe
62
+ * integers: the caller then keeps the block anchor instead of a garbage tick.
63
+ */
64
+ export declare function inferPriceTickFromRows(rows: ArrayLike<unknown> | null | undefined, maxRows?: number, minRows?: number): number | null;
65
+ /**
66
+ * The tick both footprint producers anchor on: the inferred exchange tick when
67
+ * one is known, else the overlay's minimum block (the pre-existing convention,
68
+ * exact where the served block IS the tick). `centeredFootprintBand` clamps
69
+ * it to each row's own height, so a tick coarser than a row (a thin sample,
70
+ * or a catalog block finer than the served rows) can never widen the offset
71
+ * past half that row. An unusable block with no tick yields undefined so the
72
+ * band keeps its half-height fallback.
73
+ */
74
+ export declare function resolveFootprintAnchorTick(minimumBarHeight: unknown, priceTick: unknown): number | undefined;
75
+ /** Rebuilds rather than mutates: the buckets may be the caller's own accumulator arrays. */
76
+ export declare function centerFootprintRows(rows: (number | number[])[][], bandHeight: number, tickSize?: number | null): (number | number[])[][];