@orangecharts/wrun-chart-host 0.9.0 → 0.11.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 (252) hide show
  1. package/README.md +2 -0
  2. package/dist/constants/feature-flags.constants.d.ts +15 -1
  3. package/dist/constants/feature-flags.constants.js +130 -24
  4. package/dist/constants/governed-exchanges.constants.d.ts +12 -0
  5. package/dist/constants/governed-exchanges.constants.js +16 -0
  6. package/dist/constants/opra-compliance.constants.d.ts +3 -2
  7. package/dist/constants/opra-compliance.constants.js +3 -2
  8. package/dist/constants/option-venues.constants.d.ts +2 -2
  9. package/dist/constants/scriptEditor/builtin-script-snippets.d.ts +26 -0
  10. package/dist/constants/scriptEditor/builtin-script-snippets.js +6 -0
  11. package/dist/constants/scriptEditor/technicalIndicatorScriptKeys.constants.d.ts +15 -0
  12. package/dist/constants/scriptEditor/technicalIndicatorScriptKeys.constants.js +17 -0
  13. package/dist/constants/venue-presets.constants.d.ts +20 -20
  14. package/dist/constants/venue-presets.constants.js +24 -26
  15. package/dist/host-env.d.ts +21 -5
  16. package/dist/host-env.js +6 -0
  17. package/dist/host-ports.types.d.ts +102 -19
  18. package/dist/index.d.ts +18 -0
  19. package/dist/index.js +18 -0
  20. package/dist/interfaces/cancel-reason.interface.d.ts +1 -1
  21. package/dist/interfaces/cme-realtime.interface.d.ts +16 -9
  22. package/dist/interfaces/cme-realtime.interface.js +6 -3
  23. package/dist/interfaces/kscript-diagnostics.interface.d.ts +12 -0
  24. package/dist/interfaces/opra-realtime.interface.d.ts +1 -5
  25. package/dist/interfaces/prediction-market.interface.d.ts +7 -0
  26. package/dist/interfaces/replay.interface.d.ts +8 -0
  27. package/dist/interfaces/stocks-realtime.interface.d.ts +57 -0
  28. package/dist/interfaces/stocks-realtime.interface.js +32 -0
  29. package/dist/interfaces/wrun-runtime.interface.d.ts +18 -2
  30. package/dist/kscript-data/controls/live-trades-merge.util.d.ts +62 -94
  31. package/dist/kscript-data/controls/live-trades-merge.util.js +106 -171
  32. package/dist/market-data/billing.interface.d.ts +174 -36
  33. package/dist/market-data/billing.interface.js +58 -8
  34. package/dist/market-data/venue.d.ts +152 -7
  35. package/dist/market-data/venues/cme.contract.copy.json +66 -0
  36. package/dist/market-data/venues/cme.d.ts +126 -0
  37. package/dist/market-data/venues/cme.js +133 -0
  38. package/dist/market-data/venues/index.d.ts +294 -7
  39. package/dist/market-data/venues/index.js +49 -6
  40. package/dist/market-data/venues/opra.contract.copy.json +3 -2
  41. package/dist/market-data/venues/opra.d.ts +2 -2
  42. package/dist/market-data/venues/opra.js +5 -2
  43. package/dist/market-data/venues/stocks.contract.copy.json +64 -0
  44. package/dist/market-data/venues/stocks.d.ts +130 -0
  45. package/dist/market-data/venues/stocks.js +117 -0
  46. package/dist/settings-templates/footprint-rows.js +35 -2
  47. package/dist/settings-templates/form-rows.d.ts +2 -1
  48. package/dist/settings-templates/index.js +7 -3
  49. package/dist/settings-templates/indicator-fields.d.ts +5 -4
  50. package/dist/settings-templates/indicator-fields.js +79 -10
  51. package/dist/settings-templates/tool-rules.d.ts +32 -15
  52. package/dist/settings-templates/tool-rules.js +33 -11
  53. package/dist/settings-templates/tool-tables.generated.js +95 -31
  54. package/dist/utility/chart/book-live-bucket.util.d.ts +15 -0
  55. package/dist/utility/chart/book-live-bucket.util.js +47 -0
  56. package/dist/utility/chart/cme-cache-context.util.d.ts +5 -3
  57. package/dist/utility/chart/cme-cache-context.util.js +10 -6
  58. package/dist/utility/chart/cme-realtime.util.js +10 -0
  59. package/dist/utility/chart/cme-user-scripts-gate.util.d.ts +83 -0
  60. package/dist/utility/chart/cme-user-scripts-gate.util.js +142 -0
  61. package/dist/utility/chart/effective-chart-session.util.d.ts +14 -0
  62. package/dist/utility/chart/effective-chart-session.util.js +39 -0
  63. package/dist/utility/chart/host-bar-placement.util.d.ts +28 -0
  64. package/dist/utility/chart/host-bar-placement.util.js +170 -30
  65. package/dist/utility/chart/index-host-tier.util.d.ts +3 -1
  66. package/dist/utility/chart/index-host-tier.util.js +7 -2
  67. package/dist/utility/chart/index-mode-admission.util.js +30 -3
  68. package/dist/utility/chart/kscript-apply-fingerprint.util.js +1 -1
  69. package/dist/utility/chart/kscript-drawing-safe-area.util.d.ts +35 -11
  70. package/dist/utility/chart/kscript-drawing-safe-area.util.js +145 -35
  71. package/dist/utility/chart/kscript-live-coalesce.util.d.ts +9 -7
  72. package/dist/utility/chart/kscript-live-coalesce.util.js +13 -8
  73. package/dist/utility/chart/kscript-live-source-identity.util.d.ts +9 -0
  74. package/dist/utility/chart/kscript-live-source-identity.util.js +10 -1
  75. package/dist/utility/chart/kscript-provenance-keys.util.js +13 -0
  76. package/dist/utility/chart/kscript-standin-identity.leaf.d.ts +5 -1
  77. package/dist/utility/chart/kscript-titancharts-render-keys.constants.d.ts +32 -2
  78. package/dist/utility/chart/kscript-titancharts-render-keys.constants.js +45 -0
  79. package/dist/utility/chart/kscript-venue-policy.util.d.ts +156 -43
  80. package/dist/utility/chart/kscript-venue-policy.util.js +249 -59
  81. package/dist/utility/chart/live-bucket.util.d.ts +24 -8
  82. package/dist/utility/chart/live-bucket.util.js +85 -27
  83. package/dist/utility/chart/market-session-schedule.util.d.ts +10 -0
  84. package/dist/utility/chart/market-session-schedule.util.js +16 -0
  85. package/dist/utility/chart/marketKind.util.js +5 -0
  86. package/dist/utility/chart/mixed-mode.util.d.ts +7 -0
  87. package/dist/utility/chart/mixed-mode.util.js +14 -0
  88. package/dist/utility/chart/opra-read-access.leaf.d.ts +5 -3
  89. package/dist/utility/chart/opra-read-access.leaf.js +5 -3
  90. package/dist/utility/chart/opra-user-scripts-gate.util.d.ts +11 -16
  91. package/dist/utility/chart/opra-user-scripts-gate.util.js +12 -28
  92. package/dist/utility/chart/rth-session.util.d.ts +12 -10
  93. package/dist/utility/chart/rth-session.util.js +25 -21
  94. package/dist/utility/chart/trading-day.util.d.ts +17 -0
  95. package/dist/utility/chart/trading-day.util.js +59 -0
  96. package/dist/utility/chart/window-geometry.leaf.d.ts +8 -0
  97. package/dist/utility/chart/window-geometry.leaf.js +22 -6
  98. package/dist/utility/chart/window-owner.leaf.d.ts +23 -2
  99. package/dist/utility/chart/window-owner.leaf.js +45 -3
  100. package/dist/utility/chart/wrun-bar-session-facts.util.d.ts +33 -15
  101. package/dist/utility/chart/wrun-bar-session-facts.util.js +70 -20
  102. package/dist/utility/chart/wrun-run-result.util.d.ts +12 -0
  103. package/dist/utility/chart/wrun-run-result.util.js +141 -6
  104. package/dist/utility/intl-locale.util.js +5 -0
  105. package/dist/utility/options/option-bar-anchor.util.d.ts +145 -0
  106. package/dist/utility/options/option-bar-anchor.util.js +340 -0
  107. package/dist/utility/options/option-venue.util.d.ts +18 -0
  108. package/dist/utility/options/option-venue.util.js +27 -0
  109. package/dist/utility/scriptEditor/wrun-runtime-diagnostics.leaf.js +4 -0
  110. package/dist/utility/v2/gate-plane.util.d.ts +12 -3
  111. package/dist/utility/v2/gate-plane.util.js +30 -4
  112. package/dist/utility/v2/gate-session-latch.util.js +1 -1
  113. package/dist/utility/v2/stocks-governed.util.d.ts +16 -0
  114. package/dist/utility/v2/stocks-governed.util.js +34 -0
  115. package/dist/utility/wrun/derived-roots.leaf.d.ts +13 -0
  116. package/dist/utility/wrun/derived-roots.leaf.js +27 -0
  117. package/dist/utility/wrun/derived-roots.util.d.ts +205 -0
  118. package/dist/utility/wrun/derived-roots.util.js +451 -0
  119. package/dist/utility/wrun/run-schedule/wrun-chart-gate-reader.util.d.ts +43 -7
  120. package/dist/utility/wrun/run-schedule/wrun-chart-gate-reader.util.js +89 -19
  121. package/dist/utility/wrun/run-schedule/wrun-gate-reader-warm.util.d.ts +9 -4
  122. package/dist/utility/wrun/run-schedule/wrun-gate-reader-warm.util.js +47 -6
  123. package/dist/utility/wrun/run-schedule/wrun-late-reads.util.d.ts +4 -2
  124. package/dist/utility/wrun/run-schedule/wrun-late-reads.util.js +4 -2
  125. package/dist/utility/wrun/run-schedule/wrun-own-candles.util.d.ts +24 -3
  126. package/dist/utility/wrun/run-schedule/wrun-own-candles.util.js +46 -10
  127. package/dist/utility/wrun/sources/lanes/option_daily.js +5 -2
  128. package/dist/utility/wrun/sources/lanes/options_flow.js +5 -2
  129. package/dist/utility/wrun/sources/opra-option-lanes.util.d.ts +64 -19
  130. package/dist/utility/wrun/sources/opra-option-lanes.util.js +105 -35
  131. package/dist/utility/wrun/sources/row-lanes/option_contract_flow.js +2 -1
  132. package/dist/utility/wrun/sources/row-lanes/option_contract_state.js +2 -1
  133. package/dist/utility/wrun/sources/row-lanes/option_prints.d.ts +3 -0
  134. package/dist/utility/wrun/sources/row-lanes/option_prints.js +19 -4
  135. package/dist/utility/wrun/sources/row-lanes/option_strike_flow.js +17 -4
  136. package/dist/utility/wrun/sources/row-lanes/option_strikes.d.ts +52 -13
  137. package/dist/utility/wrun/sources/row-lanes/option_strikes.js +88 -19
  138. package/dist/utility/wrun/sources/row-lanes/option_surface.js +2 -1
  139. package/dist/utility/wrun/sources/wrun-poll-lane.types.d.ts +19 -0
  140. package/dist/utility/wrun/sources/wrun-poll-lanes.util.d.ts +24 -9
  141. package/dist/utility/wrun/sources/wrun-poll-lanes.util.js +41 -10
  142. package/dist/utility/wrun/sources/wrun-row-lane-add-memo.util.d.ts +111 -0
  143. package/dist/utility/wrun/sources/wrun-row-lane-add-memo.util.js +133 -0
  144. package/dist/utility/wrun/sources/wrun-row-lane-first-paint.util.d.ts +15 -3
  145. package/dist/utility/wrun/sources/wrun-row-lane-first-paint.util.js +22 -3
  146. package/dist/utility/wrun/sources/wrun-row-lane.types.d.ts +31 -0
  147. package/dist/utility/wrun/sources/wrun-row-lanes.util.d.ts +197 -13
  148. package/dist/utility/wrun/sources/wrun-row-lanes.util.js +761 -27
  149. package/dist/utility/wrun/wrun-browser-sources.leaf.js +1 -2
  150. package/dist/utility/wrun/wrun-builtin-twin.util.d.ts +12 -0
  151. package/dist/utility/wrun/wrun-builtin-twin.util.js +21 -0
  152. package/dist/utility/wrun/wrun-chart-market-facts.util.d.ts +60 -16
  153. package/dist/utility/wrun/wrun-chart-market-facts.util.js +113 -61
  154. package/dist/utility/wrun/wrun-color-settings.util.d.ts +9 -0
  155. package/dist/utility/wrun/wrun-color-settings.util.js +33 -0
  156. package/dist/utility/wrun/wrun-download-meter.util.d.ts +15 -0
  157. package/dist/utility/wrun/wrun-download-meter.util.js +14 -2
  158. package/dist/utility/wrun/wrun-download-plan.util.d.ts +99 -0
  159. package/dist/utility/wrun/wrun-download-plan.util.js +118 -0
  160. package/dist/utility/wrun/wrun-draft-legend-note.util.d.ts +11 -3
  161. package/dist/utility/wrun/wrun-draft-legend-note.util.js +26 -4
  162. package/dist/utility/wrun/wrun-frames.d.ts +27 -6
  163. package/dist/utility/wrun/wrun-frames.js +73 -10
  164. package/dist/utility/wrun/wrun-handles.util.d.ts +7 -3
  165. package/dist/utility/wrun/wrun-handles.util.js +9 -8
  166. package/dist/utility/wrun/wrun-hosted-wire.util.d.ts +7 -1
  167. package/dist/utility/wrun/wrun-hosted-wire.util.js +12 -2
  168. package/dist/utility/wrun/wrun-hud-looks.util.d.ts +18 -4
  169. package/dist/utility/wrun/wrun-hud-looks.util.js +45 -13
  170. package/dist/utility/wrun/wrun-input-requirements.leaf.d.ts +68 -0
  171. package/dist/utility/wrun/wrun-input-requirements.leaf.js +163 -7
  172. package/dist/utility/wrun/wrun-latest-snapshot.d.ts +11 -0
  173. package/dist/utility/wrun/wrun-leg-close.util.d.ts +59 -23
  174. package/dist/utility/wrun/wrun-leg-close.util.js +186 -28
  175. package/dist/utility/wrun/wrun-live-intake.util.d.ts +35 -15
  176. package/dist/utility/wrun/wrun-live-intake.util.js +243 -126
  177. package/dist/utility/wrun/wrun-live-tick.util.d.ts +13 -5
  178. package/dist/utility/wrun/wrun-live-tick.util.js +279 -99
  179. package/dist/utility/wrun/wrun-market-facts.util.d.ts +13 -3
  180. package/dist/utility/wrun/wrun-market-facts.util.js +13 -3
  181. package/dist/utility/wrun/wrun-market-size-defaults.leaf.d.ts +60 -11
  182. package/dist/utility/wrun/wrun-market-size-defaults.leaf.js +70 -5
  183. package/dist/utility/wrun/wrun-market-size-defaults.util.js +31 -5
  184. package/dist/utility/wrun/wrun-opra-lane.util.d.ts +17 -4
  185. package/dist/utility/wrun/wrun-opra-lane.util.js +6 -4
  186. package/dist/utility/wrun/wrun-option-book-rows.util.d.ts +56 -0
  187. package/dist/utility/wrun/wrun-option-book-rows.util.js +96 -0
  188. package/dist/utility/wrun/wrun-option-strike-flow-forecast.util.d.ts +31 -0
  189. package/dist/utility/wrun/wrun-option-strike-flow-forecast.util.js +119 -0
  190. package/dist/utility/wrun/wrun-option-strike-flow-lane.util.d.ts +23 -6
  191. package/dist/utility/wrun/wrun-option-strike-flow-lane.util.js +47 -11
  192. package/dist/utility/wrun/wrun-option-strike-flow.util.d.ts +86 -19
  193. package/dist/utility/wrun/wrun-option-strike-flow.util.js +168 -62
  194. package/dist/utility/wrun/wrun-option-views.util.d.ts +323 -28
  195. package/dist/utility/wrun/wrun-option-views.util.js +484 -71
  196. package/dist/utility/wrun/wrun-options-chain.util.d.ts +3 -3
  197. package/dist/utility/wrun/wrun-options-chain.util.js +2 -0
  198. package/dist/utility/wrun/wrun-output-style.util.d.ts +6 -2
  199. package/dist/utility/wrun/wrun-output-style.util.js +20 -2
  200. package/dist/utility/wrun/wrun-overlay-drivers.util.d.ts +32 -2
  201. package/dist/utility/wrun/wrun-overlay-drivers.util.js +13 -3
  202. package/dist/utility/wrun/wrun-overlay-lifecycle.util.d.ts +10 -1
  203. package/dist/utility/wrun/wrun-overlay-lifecycle.util.js +52 -4
  204. package/dist/utility/wrun/wrun-overlay-recovery.util.js +3 -1
  205. package/dist/utility/wrun/wrun-overlay-run.util.d.ts +160 -42
  206. package/dist/utility/wrun/wrun-overlay-run.util.js +1244 -209
  207. package/dist/utility/wrun/wrun-pane-format.util.d.ts +2 -1
  208. package/dist/utility/wrun/wrun-pane-format.util.js +7 -3
  209. package/dist/utility/wrun/wrun-panel-mount.util.d.ts +9 -0
  210. package/dist/utility/wrun/wrun-panel-mount.util.js +114 -19
  211. package/dist/utility/wrun/wrun-panel-style.util.d.ts +10 -9
  212. package/dist/utility/wrun/wrun-panel-style.util.js +58 -9
  213. package/dist/utility/wrun/wrun-param-map.util.d.ts +14 -11
  214. package/dist/utility/wrun/wrun-param-map.util.js +10 -5
  215. package/dist/utility/wrun/wrun-param-values.util.d.ts +14 -4
  216. package/dist/utility/wrun/wrun-param-values.util.js +4 -0
  217. package/dist/utility/wrun/wrun-pin-spelling.util.d.ts +15 -2
  218. package/dist/utility/wrun/wrun-pin-spelling.util.js +39 -14
  219. package/dist/utility/wrun/wrun-refusal-surface.util.d.ts +50 -0
  220. package/dist/utility/wrun/wrun-refusal-surface.util.js +68 -0
  221. package/dist/utility/wrun/wrun-refusal.util.d.ts +3 -2
  222. package/dist/utility/wrun/wrun-refusal.util.js +22 -0
  223. package/dist/utility/wrun/wrun-refused-latest.util.d.ts +10 -0
  224. package/dist/utility/wrun/wrun-refused-latest.util.js +12 -0
  225. package/dist/utility/wrun/wrun-registry-errors.util.d.ts +26 -0
  226. package/dist/utility/wrun/wrun-registry-errors.util.js +34 -0
  227. package/dist/utility/wrun/wrun-replay-lane.util.js +3 -2
  228. package/dist/utility/wrun/wrun-row-source.d.ts +11 -0
  229. package/dist/utility/wrun/wrun-run-interval-session.util.d.ts +20 -6
  230. package/dist/utility/wrun/wrun-run-interval-session.util.js +22 -7
  231. package/dist/utility/wrun/wrun-run-interval.util.d.ts +43 -9
  232. package/dist/utility/wrun/wrun-run-interval.util.js +58 -15
  233. package/dist/utility/wrun/wrun-script-inputs.util.d.ts +45 -1
  234. package/dist/utility/wrun/wrun-script-inputs.util.js +112 -4
  235. package/dist/utility/wrun/wrun-setting-words.util.d.ts +7 -3
  236. package/dist/utility/wrun/wrun-setting-words.util.js +13 -5
  237. package/dist/utility/wrun/wrun-socket-row-source.d.ts +27 -2
  238. package/dist/utility/wrun/wrun-socket-row-source.js +118 -8
  239. package/dist/utility/wrun/wrun-source-rows.util.d.ts +29 -18
  240. package/dist/utility/wrun/wrun-source-rows.util.js +61 -27
  241. package/dist/utility/wrun/wrun-style-words.util.js +6 -4
  242. package/dist/utility/wrun/wrun-table-chrome.util.d.ts +3 -2
  243. package/dist/utility/wrun/wrun-table-chrome.util.js +19 -11
  244. package/dist/utility/wrun/wrun-tape-per-order.util.d.ts +2 -0
  245. package/dist/utility/wrun/wrun-tape-per-order.util.js +7 -0
  246. package/dist/utility/wrun/wrun-tape-source.util.d.ts +17 -9
  247. package/dist/utility/wrun/wrun-tape-source.util.js +20 -12
  248. package/dist/utils/replay/replay-buffer-math.d.ts +53 -2
  249. package/dist/utils/replay/replay-buffer-math.js +227 -20
  250. package/dist/workers/constants/socket-slots.d.ts +91 -6
  251. package/dist/workers/constants/socket-slots.js +85 -6
  252. package/package.json +5 -5
@@ -36,6 +36,17 @@ export type WrunPinCatalogLookup = (candidate: WrunPinCandidate) => WrunPinCatal
36
36
  export interface WrunPinCatalogPage {
37
37
  marketSymbols?: ReadonlyArray<unknown>;
38
38
  vetoed?: boolean;
39
+ /** Part of the ask went unanswered (a lost batch, a source that failed): an unlisted market there is unknown. */
40
+ incomplete?: boolean;
41
+ /** Catalog sources that failed or never answered: an unlisted market on any of them is unknown. */
42
+ failedSources?: readonly unknown[];
43
+ pendingSources?: readonly unknown[];
44
+ /** Exactly the identities a lost batch asked for (venues as enum ids), when the page names them. */
45
+ unansweredPairs?: ReadonlyArray<{
46
+ exchange: unknown;
47
+ rawSymbol?: string;
48
+ normalizedSymbol?: string;
49
+ }>;
39
50
  }
40
51
  /** `wrun_pin_venue_unknown`: a venue word no table maps (the venue judge's code and words). */
41
52
  export type WrunPinRefusalCode = typeof WRUN_PIN_UNRESOLVABLE_CODE | typeof WRUN_PIN_VENUE_UNKNOWN_CODE;
@@ -116,8 +127,10 @@ export declare function wrunPinUnknownVenue(input: WrunPinInput, chartExchange?:
116
127
  /**
117
128
  * The sync lookup over one catalog answer: `asked` are the candidates the page was asked for (any other reads
118
129
  * `undefined`, pending), `page` what `getMarketsRaw` answered (null when the ask failed: every asked candidate reads
119
- * `unavailable`, as does a page vetoed at the gateway's deadline). Rows are read raw: a hidden or retired venue still
120
- * answers for a spelling written on it, as the fetch would.
130
+ * `unavailable`, as does a page vetoed at the gateway's deadline). A candidate a partial page does not list reads
131
+ * `unavailable` when the page cannot vouch for it (`unknownIdsOf`), never `null`: a lost batch is no proof that a
132
+ * market does not exist. Rows are read raw: a hidden or retired venue still answers for a spelling written on it, as
133
+ * the fetch would.
121
134
  */
122
135
  export declare function wrunPinCatalogLookupOf(asked: readonly WrunPinCandidate[], page: WrunPinCatalogPage | null | undefined): WrunPinCatalogLookup;
123
136
  /**
@@ -13,10 +13,10 @@
13
13
  * wire (a TradingView prefix, a display alias such as `BINANCE.F`, a stock listing), TradingView's perpetual suffix
14
14
  * (`BTCUSDT.P`), our key typed into the symbol half (`COINBASE|BTC-USD`), a stock or forex symbol without its
15
15
  * `/` (`POLYGON:AAPL`, `FX_OTC:EURUSD`), or a crypto pair whose form the venue's catalog spelling does not vouch for
16
- * (`venue-presets.constants`: Coinbase and OKX write `BTC-USD`, OKX's perpetuals `BTC-USDT-SWAP`, Binance and Bybit
17
- * `BTCUSDT`; a pair on a venue the presets do not describe is confirmed by the catalog), or a CRYPTOCAP symbol
18
- * TradingView spells unlike us (`CRYPTOCAP:HYPEH.D`, the coin cap `CRYPTOCAP:BTC`). Everything else is ours and skips
19
- * the catalog.
16
+ * (`venue-presets.constants` VENUE_PAIR_QUOTES: Coinbase and OKX write `BTC-USD`, OKX's perpetuals `BTC-USDT-SWAP`,
17
+ * Binance and Bybit `BTCUSDT`; a pair on a venue the table does not spell is confirmed by the catalog), or a
18
+ * CRYPTOCAP symbol TradingView spells unlike us (`CRYPTOCAP:HYPEH.D`, the coin cap `CRYPTOCAP:BTC`). Everything else
19
+ * is ours and skips the catalog.
20
20
  * - `resolveWrunPinMarket` (sync over an already-loaded catalog): the written spelling first (our own spelling always
21
21
  * wins), then the same instrument through the TradingView prefix tables (tradingview-symbols.leaf, the watchlist
22
22
  * import's own: the venue map, the quote split, the perpetual ids, the metals, the CRYPTOCAP ticker renames, where
@@ -36,7 +36,7 @@
36
36
  * in an empty fetch. Pure: no store, no service, no I/O (the one async helper awaits a catalog ask its caller injects).
37
37
  */
38
38
  import { Category, Exchange } from '@orangecharts/orange-v2-pb-common';
39
- import { PERP_PRESET_VENUE_QUOTES, SPOT_PRESET_VENUE_QUOTES } from '../../constants/venue-presets.constants.js';
39
+ import { VENUE_PAIR_QUOTES } from '../../constants/venue-presets.constants.js';
40
40
  import { normalizeLegacyExchange } from '../chart/legacy-exchange.leaf.js';
41
41
  import { EXCHANGE_DISPLAY_SUFFIXES, formatDisplayToExchange } from '../exchange-normalization.util.js';
42
42
  import { BASE_ALIASES, CME_PREFIXES, CRYPTO_VENUES, CRYPTOCAP_PREFIX, FX_PREFIXES, NATIVE_PREFIX, PERP_SUFFIX_RE, TVC_SPOT_METALS, US_STOCK_PREFIXES, VENUE_TO_TRADINGVIEW, cmeContinuousKeyOf, cryptoCandidate, cryptoCapSeriesOf, fxPair, splitCryptoSymbol, } from '../watchlist/import/tradingview-symbols.leaf.js';
@@ -109,15 +109,16 @@ function readingsOf(input, chartExchange) {
109
109
  const meant = unwrapNative(named ?? written);
110
110
  return meant === written ? [written] : [written, meant];
111
111
  }
112
- /** A crypto venue of ours the TradingView tables or the venue presets describe. */
112
+ /** A crypto venue of ours the TradingView tables describe or the venue spelling table spells. */
113
113
  function isOurCryptoVenue(venue) {
114
- return venue in VENUE_TO_TRADINGVIEW || venue in SPOT_PRESET_VENUE_QUOTES || venue in PERP_PRESET_VENUE_QUOTES;
114
+ return venue in VENUE_TO_TRADINGVIEW || Object.hasOwn(VENUE_PAIR_QUOTES, venue);
115
115
  }
116
- /** How a preset venue spells a pair in its catalog, read off the whole quote (`venue-presets.constants`: `BINANCE:
117
- * 'USDT'` is `BTCUSDT`, `COINBASE: '-USD'` is `BTC-USD`, `OKEX_SWAP: '-USDT-SWAP'` is `BTC-USDT-SWAP`); undefined
118
- * for a venue the presets do not describe, and for the bare coin (Hyperliquid's quote ''), which no shape tells. */
116
+ /** How a venue spells a pair in its catalog, read off the whole quote (`venue-presets.constants` VENUE_PAIR_QUOTES:
117
+ * `BINANCE: 'USDT'` is `BTCUSDT`, `COINBASE: '-USD'` is `BTC-USD`, `OKEX_SWAP: '-USDT-SWAP'` is `BTC-USDT-SWAP`);
118
+ * undefined for a venue the table does not spell, and for the bare coin (Hyperliquid's quote ''), which no shape
119
+ * tells. */
119
120
  function presetPairForm(venue) {
120
- const quote = SPOT_PRESET_VENUE_QUOTES[venue] ?? PERP_PRESET_VENUE_QUOTES[venue];
121
+ const quote = Object.hasOwn(VENUE_PAIR_QUOTES, venue) ? VENUE_PAIR_QUOTES[venue] : undefined;
121
122
  if (!quote)
122
123
  return undefined;
123
124
  if (/^[A-Z0-9]/.test(quote))
@@ -342,15 +343,36 @@ function rowRank(category) {
342
343
  const word = typeof category === 'number' ? Category[category] : category;
343
344
  return word === 'PERPETUAL' || word === 'SPOT' ? 0 : 1;
344
345
  }
346
+ /**
347
+ * What a partial answer leaves unknown among the candidates it does not list: nothing on a complete page; exactly the
348
+ * pairs a lost batch asked for when the page names them; every unlisted candidate when a source failed or the page is
349
+ * incomplete for a reason it does not name.
350
+ */
351
+ function unknownIdsOf(page) {
352
+ if (page.failedSources?.length || page.pendingSources?.length)
353
+ return 'all';
354
+ if (page.unansweredPairs?.length) {
355
+ return new Set(page.unansweredPairs.map((pair) => candidateId({
356
+ exchange: rowVenue(pair.exchange),
357
+ ...(pair.rawSymbol !== undefined
358
+ ? { rawSymbol: pair.rawSymbol }
359
+ : { normalizedSymbol: pair.normalizedSymbol }),
360
+ })));
361
+ }
362
+ return page.incomplete ? 'all' : null;
363
+ }
345
364
  /**
346
365
  * The sync lookup over one catalog answer: `asked` are the candidates the page was asked for (any other reads
347
366
  * `undefined`, pending), `page` what `getMarketsRaw` answered (null when the ask failed: every asked candidate reads
348
- * `unavailable`, as does a page vetoed at the gateway's deadline). Rows are read raw: a hidden or retired venue still
349
- * answers for a spelling written on it, as the fetch would.
367
+ * `unavailable`, as does a page vetoed at the gateway's deadline). A candidate a partial page does not list reads
368
+ * `unavailable` when the page cannot vouch for it (`unknownIdsOf`), never `null`: a lost batch is no proof that a
369
+ * market does not exist. Rows are read raw: a hidden or retired venue still answers for a spelling written on it, as
370
+ * the fetch would.
350
371
  */
351
372
  export function wrunPinCatalogLookupOf(asked, page) {
352
373
  const askedIds = new Set(asked.map(candidateId));
353
374
  const failed = page === null || page === undefined || page.vetoed === true;
375
+ const unknown = failed ? null : unknownIdsOf(page);
354
376
  const byId = new Map();
355
377
  for (const entry of failed ? [] : (page.marketSymbols ?? [])) {
356
378
  const row = entry;
@@ -374,7 +396,10 @@ export function wrunPinCatalogLookupOf(asked, page) {
374
396
  return undefined;
375
397
  if (failed)
376
398
  return 'unavailable';
377
- return byId.get(id)?.row ?? null;
399
+ const row = byId.get(id)?.row;
400
+ if (row)
401
+ return row;
402
+ return unknown === 'all' || unknown?.has(id) ? 'unavailable' : null;
378
403
  };
379
404
  }
380
405
  /** The pin as its note names it: what the setting or the sheet wrote. */
@@ -1,4 +1,45 @@
1
+ /**
2
+ * Where a refusal record lands (contract C3): the overlay's legend chip and card, a change event
3
+ * for the folded legend summary and the works-on list, and, once per failed user attempt, a toast.
4
+ *
5
+ * - Per-owner verdicts: a full run (`run`) and a live tick (`tick`) each hold at most one record
6
+ * per overlay; the legend shows the higher one by precedence (`compareWrunRefusals`), written
7
+ * through the inert-legend writer, so the legend observer and the change-only comparator keep
8
+ * working and an equal record writes once. A full run or reseed success retracts `all` (it
9
+ * supersedes every earlier tick verdict); a healthy tick retracts `tick`, which shows the run's
10
+ * verdict again when one stands.
11
+ * - Currentness: `projectWrunRefusal` re-checks `isCurrent()` and re-resolves the overlay after
12
+ * EVERY await, so a stale settlement never writes onto an overlay a newer run owns, and a target
13
+ * that moved cells is followed to its new cell.
14
+ * - Attempt tokens: one per overlay key (`chartIndex:indicatorId`), each open a new generation with
15
+ * its origin. A notice is claimable once per live user-origin token, never for `system`, never
16
+ * after close or after the request that carried it ended (`concludeWrunRefusalAttempt`: answered,
17
+ * or superseded by a later request); re-opening a key supersedes the earlier token (the
18
+ * attempt-envelope discipline, kept apart from it: that one settles analytics).
19
+ * - The transient grace (CLOUD-RUN-ROBUST C5, wrun-transient-rerun.util): a record whose cause is
20
+ * transient (`telemetry.cause` in WRUN_TRANSIENT_FAILURE_CAUSES) on an overlay a rerun driver runs
21
+ * waits instead of showing: the overlay shows loading, the events that end the condition rerun it,
22
+ * and the owner's latest record waits. A retraction of its owner (a paint) drops it and nothing
23
+ * shows; a record that shows at once replaces it; a teardown drops it; the grace's deadline shows
24
+ * it exactly as it would have shown at once, while the run or tick that raised it still owns the
25
+ * overlay. A record with no cause, any other cause, or on an overlay no driver runs (a revive or
26
+ * an add whose load failed: nothing could rerun it) shows at once as before, with its Retry.
27
+ * - The HUD (OPRA QA class 5): a `run` record that drew nothing (`paused`) replaces the overlay's
28
+ * latest-values snapshot with the refused one (`wrunRefusedLatestSnapshotOf`) the moment it
29
+ * shows, whoever raised it (the run pass, the loader's own phases, the grace's deadline), so the
30
+ * card says the chip's sentence instead of the numbers of a run before it. A note keeps the
31
+ * snapshot (its picture stands), a record waiting out its grace has not shown yet, and the next
32
+ * accepted run replaces the refused snapshot.
33
+ *
34
+ * Import graph: the chart instances load through the host's loader (`chart.loadTitanCharts`, the
35
+ * wrun lifecycle's rule), and the toast rides the actions util through its loader too
36
+ * (`ui.loadWrunRefusalActions`). The HUD snapshot rides the host's `chart.publishLatestValues`;
37
+ * its words, its bar and its clock come from leaves the boot closure already holds (the legend
38
+ * writer's text util, the gap detector, the server clock).
39
+ */
40
+ import type { WrunChartHandle } from '../../host-ports.types.js';
1
41
  import type { WrunRunReason } from './wrun-lifecycle.contract.js';
42
+ import type { WrunLatestSnapshot } from './wrun-latest-snapshot.js';
2
43
  import { type WrunRefusal, type WrunRefusalAttemptToken, type WrunRefusalOverlayTarget } from './wrun-refusal.util.js';
3
44
  /** Load the chart instances once (shared by every caller; a failed load is retried). Every async
4
45
  * entry point awaits it before `resolveWrunRefusalTarget`, which reads them synchronously. */
@@ -26,6 +67,15 @@ export declare function projectWrunRefusal(target: WrunRefusalOverlayTarget, r:
26
67
  notify: boolean;
27
68
  isCurrent: () => boolean;
28
69
  }): Promise<boolean>;
70
+ /**
71
+ * The latest-values snapshot of a full run refused by name (contract C2, `WrunLatestSnapshot.refused`): no values,
72
+ * strings or history, so no reader (the HUD card, the legend's entries, the hover) shows the numbers of a run before
73
+ * it, which computed for another market or other settings. `refused` carries the record's C2 row key
74
+ * (`<class>/<variant>`, the row its words come from) and the one sentence its legend chip shows
75
+ * (`wrunRefusalSentence`: the chip's tooltip and its card's words, buildWrunRefusalErrorMessage), in the locale
76
+ * active at the publish. Stamped at the chart's newest bar, else now on the server's clock.
77
+ */
78
+ export declare function wrunRefusedLatestSnapshotOf(r: WrunRefusal, tc?: WrunChartHandle | null): WrunLatestSnapshot;
29
79
  export declare function wrunRefusalRetractionCount(target: WrunRefusalOverlayTarget): number;
30
80
  export declare function retractWrunRefusal(target: WrunRefusalOverlayTarget, owner: 'run' | 'tick' | 'all'): Promise<void>;
31
81
  /**
@@ -1,4 +1,7 @@
1
+ import { serverNowMs } from '../auth/server-clock.util.js';
2
+ import { realMainRows } from '../chart/indicator-gap-detector.util.js';
1
3
  import { applyWrunInertLegendState, clearWrunInertLegendState } from './wrun-inert-legend.util.js';
4
+ import { wrunRefusalSentence } from './wrun-refusal-text.util.js';
2
5
  import { compareWrunRefusals, } from './wrun-refusal.util.js';
3
6
  import { isWrunTransientFailureCause } from './wrun-failure-cause.js';
4
7
  import { __resetWrunTransientGraceForTests, endWrunTransientGrace, holdWrunTransientRefusal, } from './wrun-transient-rerun.util.js';
@@ -138,9 +141,14 @@ export async function projectWrunRefusal(target, r, opts) {
138
141
  const owned = { ...verdicts.get(key), [opts.owner]: r };
139
142
  verdicts.set(key, owned);
140
143
  const tc = chartReader?.getTC(resolved.chartIndex);
144
+ // The HUD's publish is scheduled before the legend write and awaited after it: a legend writer that throws never
145
+ // leaves the card on the numbers this run replaced (the publish is already on its way), and the caller's await
146
+ // covers the publish.
147
+ const published = opts.owner === 'run' && r.severity === 'paused' ? publishWrunRefusedLatestValues(resolved, r, tc) : undefined;
141
148
  if (tc)
142
149
  writeTop(tc, resolved, owned);
143
150
  emitWrunRefusalChange(resolved.chartIndex);
151
+ await published;
144
152
  if (opts.notify && r.severity === 'paused') {
145
153
  const actions = await wrunChartHostEnv().ui.loadWrunRefusalActions();
146
154
  if (!opts.isCurrent())
@@ -160,6 +168,65 @@ export async function projectWrunRefusal(target, r, opts) {
160
168
  return true;
161
169
  }
162
170
  // ---------------------------------------------------------------------------
171
+ // The HUD's refused snapshot (OPRA QA class 5)
172
+ // ---------------------------------------------------------------------------
173
+ /**
174
+ * The latest-values snapshot of a full run refused by name (contract C2, `WrunLatestSnapshot.refused`): no values,
175
+ * strings or history, so no reader (the HUD card, the legend's entries, the hover) shows the numbers of a run before
176
+ * it, which computed for another market or other settings. `refused` carries the record's C2 row key
177
+ * (`<class>/<variant>`, the row its words come from) and the one sentence its legend chip shows
178
+ * (`wrunRefusalSentence`: the chip's tooltip and its card's words, buildWrunRefusalErrorMessage), in the locale
179
+ * active at the publish. Stamped at the chart's newest bar, else now on the server's clock.
180
+ */
181
+ export function wrunRefusedLatestSnapshotOf(r, tc) {
182
+ return {
183
+ time: newestWrunChartBarTs(tc) ?? serverNowMs(),
184
+ values: {},
185
+ strings: {},
186
+ history: {},
187
+ refused: { reason: `${r.cls}/${r.variant}`, sentence: wrunRefusalSentence(r) },
188
+ };
189
+ }
190
+ /** The open time of the chart's newest traded bar: the newest row the server sent (`realMainRows`, no synthetic
191
+ * marker) with a close, the bar the run pass's candle read ends on; undefined on a chart with none. */
192
+ function newestWrunChartBarTs(tc) {
193
+ const main = tc
194
+ ?.metadata?.[0];
195
+ const raw = main?.rawData;
196
+ if (!Array.isArray(raw))
197
+ return undefined;
198
+ const rows = realMainRows(raw, main?.syntheticFlags ?? undefined) ?? [];
199
+ for (let at = rows.length - 1; at >= 0; at -= 1) {
200
+ const row = rows[at];
201
+ if (Array.isArray(row) && Number.isFinite(row[0]) && Number.isFinite(row[4]))
202
+ return Number(row[0]);
203
+ }
204
+ return undefined;
205
+ }
206
+ /** The publisher of the refused snapshot, loaded beside the run binder: `chart.publishLatestValues` is a run port,
207
+ * and this surface is reached by every toast path, most of which never loaded the run plane
208
+ * (web-ports.cold-entries.spec.ts: a package module reads a non-boot member only behind its binder's load). The
209
+ * same carried-import form as wrun-transient-rerun.util's admit load. */
210
+ let refusedLatestLoad;
211
+ /** Publish the refused snapshot of a run record that shows now. The snapshot is built at the call (the record's
212
+ * words in the locale of the moment, the chart's newest bar); the port write lands once the run binder is bound.
213
+ * Presentation only: a failure is logged, never a second failure over the projection. */
214
+ function publishWrunRefusedLatestValues(t, r, tc) {
215
+ const snapshot = wrunRefusedLatestSnapshotOf(r, tc);
216
+ refusedLatestLoad ??= Promise.all([
217
+ import('./wrun-refused-latest.util.js'),
218
+ wrunChartHostEnv().chart.loadRunPorts(),
219
+ ]).then(([publisher]) => publisher, (error) => {
220
+ refusedLatestLoad = undefined;
221
+ throw error;
222
+ });
223
+ return refusedLatestLoad
224
+ .then((publisher) => publisher.publishWrunRefusedLatest(t.chartIndex, t.indicatorId, snapshot))
225
+ .catch((error) => {
226
+ console.warn(`[wrun] the refused snapshot of '${t.indicatorId}' was not published:`, error);
227
+ });
228
+ }
229
+ // ---------------------------------------------------------------------------
163
230
  // The transient grace (CLOUD-RUN-ROBUST C5)
164
231
  // ---------------------------------------------------------------------------
165
232
  const OWNERS = ['run', 'tick'];
@@ -378,4 +445,5 @@ export function __resetWrunRefusalSurfaceForTests() {
378
445
  changeListeners.clear();
379
446
  chartReader = undefined;
380
447
  chartReaderLoad = undefined;
448
+ refusedLatestLoad = undefined;
381
449
  }
@@ -1,8 +1,9 @@
1
+ import type { GateProvider } from '../../workers/constants/socket-slots.js';
1
2
  import { type WrunFailureBaseCause, type WrunFailureCause } from './wrun-failure-cause.js';
2
3
  import { WRUN_KIT_REFUSAL_STAGES, wrunKitRefusalStageOf, type WrunFrameRefusal, type WrunKitRefusalStage } from './wrun-hosted-wire-caps.js';
3
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';
4
- /** A gate plane a take-back names (the app's `GateProvider`, spelled here: the package reads no app constant). */
5
- export type WrunRefusalGatePlane = 'cme' | 'opra';
5
+ /** A gate plane a take-back names: every plane with a one-session latch (CME, OPRA, the US stocks tape). */
6
+ export type WrunRefusalGatePlane = GateProvider;
6
7
  /**
7
8
  * Why an options lane stopped although its data exists: the reason the point that stopped it already knows,
8
9
  * carried as this word to the one place the chip is chosen (the `options-stopped` class, one variant per word).
@@ -262,6 +262,28 @@ const VARIANTS = {
262
262
  // The same wall on US options data (OPRA): a package that is not one of OpenMarket's own reads no OPRA chain
263
263
  // (product decision 2026-10-14), whatever chart it runs on.
264
264
  opra: row('wrun.refusal.sentence.opraWall', 'wrun.refusal.chip.opraWall', [], { severity: 'paused' }),
265
+ // CME user studies (the `cme-user-scripts` gate, kscript-venue-policy.util `isCmeUserScriptRun`): a hosted (Cloud)
266
+ // run on CME, which the gate never opens (CME chart studies run in the browser).
267
+ cloud: row('wrun.refusal.sentence.cmeCloud', 'wrun.refusal.chip.cmeCloud', [], { severity: 'paused' }),
268
+ // A running study the gate stopped in place when the viewer's access moved (the account, the CME data terms, the
269
+ // served access, the session): its source and settings stay.
270
+ stopped: row('wrun.refusal.sentence.cmeStudyStopped', 'wrun.refusal.chip.cmeStudyStopped', [], {
271
+ severity: 'paused',
272
+ }),
273
+ // A running study the gate stopped in place when the `cme-user-scripts` flag went dark: its source and settings
274
+ // stay.
275
+ 'studies-off': row('wrun.refusal.sentence.cmeStudiesOff', 'wrun.refusal.chip.cmeStudiesOff', [], {
276
+ severity: 'paused',
277
+ }),
278
+ // A strategy sheet on a CME chart, whoever wrote it (Kyle 2026-10-29): strategy testing is no CME chart study, so
279
+ // the run head refuses it before any fetch (wrun-overlay-run.util, `WrunStrategyVenueBlockedError`).
280
+ strategy: row('wrun.refusal.sentence.cmeStrategy', 'wrun.refusal.chip.cmeStrategy', [], { severity: 'paused' }),
281
+ // A sheet with an input read by the chart's coin on a prediction market (Kyle 2026-10-29): the run head refuses it
282
+ // before any fetch (wrun-overlay-run.util, `WrunPredictionMarketBlockedError`; the rule is
283
+ // wrun-input-requirements.leaf `wrunPredictionMarketWalls`).
284
+ prediction: row('wrun.refusal.sentence.predictionWall', 'wrun.refusal.chip.predictionWall', [], {
285
+ severity: 'paused',
286
+ }),
265
287
  },
266
288
  'pin-refused': {
267
289
  default: row('wrun.refusal.sentence.pinRefused', 'wrun.refusal.chip.pinRefused', ['pin'], { severity: 'paused' }),
@@ -0,0 +1,10 @@
1
+ import type { WrunLatestSnapshot } from './wrun-latest-snapshot.js';
2
+ /**
3
+ * The HUD's refused snapshot reaches the host through `chart.publishLatestValues`, a run port
4
+ * (web-ports/run.ts): this module is loaded beside `chart.loadRunPorts()` by the refusal surface
5
+ * (wrun-refusal-surface.util `publishWrunRefusedLatestValues`), the carried-import form
6
+ * web-ports.cold-entries.spec.ts proves, so a refusal projected from a web module that never
7
+ * loaded the run plane still writes to a bound port. Nothing else belongs here: the surface
8
+ * itself must stay free of run members (every toast path reaches it).
9
+ */
10
+ export declare function publishWrunRefusedLatest(chartIndex: number, indicatorId: string, snapshot: WrunLatestSnapshot): void;
@@ -0,0 +1,12 @@
1
+ import { wrunChartHostEnv } from '../../host-env.js';
2
+ /**
3
+ * The HUD's refused snapshot reaches the host through `chart.publishLatestValues`, a run port
4
+ * (web-ports/run.ts): this module is loaded beside `chart.loadRunPorts()` by the refusal surface
5
+ * (wrun-refusal-surface.util `publishWrunRefusedLatestValues`), the carried-import form
6
+ * web-ports.cold-entries.spec.ts proves, so a refusal projected from a web module that never
7
+ * loaded the run plane still writes to a bound port. Nothing else belongs here: the surface
8
+ * itself must stay free of run members (every toast path reaches it).
9
+ */
10
+ export function publishWrunRefusedLatest(chartIndex, indicatorId, snapshot) {
11
+ wrunChartHostEnv().chart.publishLatestValues(chartIndex, indicatorId, snapshot);
12
+ }
@@ -72,6 +72,32 @@ export declare class WrunVenueBlockedError extends WrunRegistryAddRefusedError {
72
72
  constructor(message: string);
73
73
  }
74
74
  export declare function isWrunVenueBlockedError(error: unknown): error is WrunVenueBlockedError;
75
+ /** Thrown at the head of the WRUN run pass for a strategy sheet on a CME
76
+ * chart: strategy testing is no CME chart study, so every strategy is
77
+ * refused there, an OpenMarket package's included (Kyle 2026-10-29),
78
+ * before anything is fetched or computed. A venue refusal like the wall's
79
+ * (the venue policy's own message, so the kScript error envelope reads
80
+ * VENUE_BLOCKED, and the same held settle: the run after the chart leaves
81
+ * CME computes), with one difference: no wall painter stands behind it (the
82
+ * display wall admits the overlay), so the run pass projects its own record
83
+ * (`cme-wall`, variant `strategy`, which the raiser attaches) on the
84
+ * legend, and the editor's Run reads the same record. */
85
+ export declare class WrunStrategyVenueBlockedError extends WrunVenueBlockedError {
86
+ constructor(message: string);
87
+ }
88
+ export declare function isWrunStrategyVenueBlockedError(error: unknown): error is WrunStrategyVenueBlockedError;
89
+ /** Thrown at the head of the WRUN run pass for a sheet with an input read
90
+ * by the chart's coin on a prediction market (Polymarket, HIP4: the rule is
91
+ * wrun-input-requirements.leaf `wrunPredictionMarketWalls`), before anything
92
+ * is fetched or computed: the odds of an outcome follow no coin, so the
93
+ * coin's options or flows would draw another market. A venue refusal like
94
+ * the strategy one (the same held settle: the run after the chart leaves the
95
+ * prediction market computes), and like it no wall painter stands behind it,
96
+ * so the run pass projects its own record (`cme-wall`, variant `prediction`,
97
+ * which the raiser attaches). */
98
+ export declare class WrunPredictionMarketBlockedError extends WrunVenueBlockedError {
99
+ constructor(message: string);
100
+ }
75
101
  /** The run head refused because the overlay is paused or its execution guard
76
102
  * tripped. Silent like the venue wall: the legend already shows the Paused
77
103
  * state, so no caller adds a chip or a toast, the driver stays registered,
@@ -90,6 +90,40 @@ export class WrunVenueBlockedError extends WrunRegistryAddRefusedError {
90
90
  export function isWrunVenueBlockedError(error) {
91
91
  return error instanceof WrunVenueBlockedError;
92
92
  }
93
+ /** Thrown at the head of the WRUN run pass for a strategy sheet on a CME
94
+ * chart: strategy testing is no CME chart study, so every strategy is
95
+ * refused there, an OpenMarket package's included (Kyle 2026-10-29),
96
+ * before anything is fetched or computed. A venue refusal like the wall's
97
+ * (the venue policy's own message, so the kScript error envelope reads
98
+ * VENUE_BLOCKED, and the same held settle: the run after the chart leaves
99
+ * CME computes), with one difference: no wall painter stands behind it (the
100
+ * display wall admits the overlay), so the run pass projects its own record
101
+ * (`cme-wall`, variant `strategy`, which the raiser attaches) on the
102
+ * legend, and the editor's Run reads the same record. */
103
+ export class WrunStrategyVenueBlockedError extends WrunVenueBlockedError {
104
+ constructor(message) {
105
+ super(message);
106
+ this.name = 'WrunStrategyVenueBlockedError';
107
+ }
108
+ }
109
+ export function isWrunStrategyVenueBlockedError(error) {
110
+ return error instanceof WrunStrategyVenueBlockedError;
111
+ }
112
+ /** Thrown at the head of the WRUN run pass for a sheet with an input read
113
+ * by the chart's coin on a prediction market (Polymarket, HIP4: the rule is
114
+ * wrun-input-requirements.leaf `wrunPredictionMarketWalls`), before anything
115
+ * is fetched or computed: the odds of an outcome follow no coin, so the
116
+ * coin's options or flows would draw another market. A venue refusal like
117
+ * the strategy one (the same held settle: the run after the chart leaves the
118
+ * prediction market computes), and like it no wall painter stands behind it,
119
+ * so the run pass projects its own record (`cme-wall`, variant `prediction`,
120
+ * which the raiser attaches). */
121
+ export class WrunPredictionMarketBlockedError extends WrunVenueBlockedError {
122
+ constructor(message) {
123
+ super(message);
124
+ this.name = 'WrunPredictionMarketBlockedError';
125
+ }
126
+ }
93
127
  /** The run head refused because the overlay is paused or its execution guard
94
128
  * tripped. Silent like the venue wall: the legend already shows the Paused
95
129
  * state, so no caller adds a chip or a toast, the driver stays registered,
@@ -393,8 +393,9 @@ async function stepWrunReplayLane(lane) {
393
393
  let ohlcvRows;
394
394
  if (runSession && record.runBars) {
395
395
  // The run bars as of the cutoff: the closed ones as fetched, the forming
396
- // one folded from the completed chart bars in its bucket.
397
- runSession.rows = runUtil.wrunReplayRunBars(record.runBars, replayed, target, runSession.run.intervalMs, record.chartIntervalMs);
396
+ // one folded again from the completed chart bars in its span (a step
397
+ // forward and a seek back alike), each span on the run's calendar.
398
+ runSession.rows = runUtil.wrunReplayRunBars(record.runBars, replayed, target, runSession.run, record.chartIntervalMs);
398
399
  ohlcvRows = runIntervalSession.wrunRunIntervalComputeRows(runSession.run, runSession.rows, target + record.chartIntervalMs);
399
400
  }
400
401
  else {
@@ -22,6 +22,7 @@
22
22
  * (`wrunRowBatchDeliveredSheet`, the one rule the pass reads every batch by).
23
23
  */
24
24
  import type { WrunHostedGrid, WrunHostedRefusal, WrunHostedWire } from './wrun-hosted-wire.util.js';
25
+ import type { WrunOpraServedReceipt } from './wrun-opra-lane.util.js';
25
26
  import type { RuntimeDiagnostic } from '../../interfaces/kscript-diagnostics.interface.js';
26
27
  import type { WrunIndicatorMetadata } from '../../interfaces/wrun-runtime.interface.js';
27
28
  /** The window a batch covers (ms, inclusive of the bar at `fromMs`, exclusive past `toMs`). */
@@ -83,6 +84,16 @@ export interface WrunRowBatch {
83
84
  * writer's own refusal); absent from a source that does not speak it (the browser lanes stamp their own runs). A
84
85
  * live frame carries only true: a frame never clears the stamp. */
85
86
  opra?: boolean;
87
+ /** The receipt of the OPRA rows the cloud computed these rows from (contract opra-server-lanes C4, the reply's
88
+ * `wrunOpraTier` and `wrunOpraDelaySeconds` beside the mark): the tier the legend's served word names. On a result
89
+ * batch the session's newest receipt (absent once a result names no OPRA read, or no tier); on a live frame, the
90
+ * frame's own, present only when it carried the mark and a tier. Absent: no tier word, never the account's tier. */
91
+ opraServed?: WrunOpraServedReceipt;
92
+ /** On a live frame only, with no rows: the cloud served the session's OPRA rows at another tier than the rows the
93
+ * session held (a downgrade or an upgrade of the owner's tier, the receipt's transition). The source dropped
94
+ * every row it held, its coverage and its run-level keys; the overlay takes its rows off the chart, ends its live
95
+ * session and reruns on a fresh one (the live tick's reseed). */
96
+ servedTierMoved?: true;
86
97
  }
87
98
  /** A live frame: the same batch shape for the bars that moved since the last frame. */
88
99
  export type WrunRowFrame = WrunRowBatch;
@@ -33,7 +33,7 @@ export declare const WRUN_RUN_INTERVAL_ROWS_KEY = "run-interval|main";
33
33
  export interface WrunRunIntervalSession {
34
34
  /** The run interval the session computes at, as the full run read it. */
35
35
  run: WrunRunInterval;
36
- /** Identity of the run bars (wrunRunIntervalCoverageKey): the run interval and the chart market. */
36
+ /** Identity of the run bars (wrunRunIntervalCoverageKey): the run interval, the chart market, the session. */
37
37
  key: string;
38
38
  /** The chart's own interval in ms (the chart clock beside the run clock). */
39
39
  chartIntervalMs: number;
@@ -66,12 +66,26 @@ export declare function wrunRunIntervalSessionOf(context: object | undefined): W
66
66
  /** The run interval in ms the overlay's live session computes at, undefined when it computes on
67
67
  * the chart's bars (or holds no session): the bucket a rider's rows are floored on. */
68
68
  export declare function wrunLiveRunIntervalMs(indicatorId: string): number | undefined;
69
- /** The identity of the run bars a session holds: the run interval and the chart market they were
70
- * fetched for (exchange, symbol, transformations), never the chart's own interval. */
71
- export declare function wrunRunIntervalCoverageKey(run: Pick<OverlayRunInterval, 'interval'>, market: {
69
+ /** Whether the chart's candle lane fetches `intervalMs` bars on a session filter, its `tradingHour`
70
+ * following the chart's session (candle-trading-hour.util): regular hours on a US listing unless it
71
+ * opted into extended hours, RTH on a CME chart in RTH at an intraday interval. */
72
+ export declare function wrunBarsSessionFiltered(market: {
73
+ exchange?: unknown;
74
+ symbol?: unknown;
75
+ sessionType?: unknown;
76
+ } | null | undefined, intervalMs: unknown): boolean;
77
+ /** The identity of the run bars a session holds: the run interval, the chart market they were
78
+ * fetched for (exchange, symbol, transformations) and the session their ask resolved, never the
79
+ * chart's own interval. The run bars ride the chart's candle lane at the RUN interval: on a session
80
+ * filter there (wrunBarsSessionFiltered) the key ends in `regular`, so a session flip re-keys the
81
+ * bars and the next full run refetches them, never computing on the other session's bars while the
82
+ * intake folds the new session's frames on another lattice. Every other key (a crypto run, an ETH
83
+ * run, a CME run at 1D or coarser) names no session: the flip changes none of those bars. */
84
+ export declare function wrunRunIntervalCoverageKey(run: Pick<OverlayRunInterval, 'interval' | 'intervalMs'>, market: {
72
85
  exchange?: unknown;
73
86
  symbol?: unknown;
74
87
  transformations?: unknown;
88
+ sessionType?: unknown;
75
89
  } | null | undefined): string;
76
90
  /** The run bars open at or before the chart's newest bar: a frame or an answer may hold the next
77
91
  * bucket before the chart shows a bar in it. A bar opens at its stamp, on the session lattice at
@@ -111,7 +125,7 @@ export interface WrunRunIntervalRowsPlan {
111
125
  /**
112
126
  * Which run bars one full run computes over (run-interval-engine.util's planRunIntervalRefresh
113
127
  * rule, on the session's buffer): the previous session's run bars when they are the same run
114
- * interval on the same market (`key`), were asked from at or before the warm-up the chart's first
128
+ * interval on the same market and session (`key`), were asked from at or before the warm-up the chart's first
115
129
  * bar needs (`warmupBars` run bars below the run bar holding it), hold the run bar of the chart's
116
130
  * newest bar (one still open there: its close past it) and hold no bar stamped past their coverage
117
131
  * (the ask windows' end, read on stamps; the intake extends the forming bar it opened at the
@@ -119,7 +133,7 @@ export interface WrunRunIntervalRowsPlan {
119
133
  * no answer filled); else a fetch from that warm-up start. Without the warm-up term, consecutive
120
134
  * prepended pages would erode the warm-up toward zero run bars. Every full run passes here (a lazy
121
135
  * page, a settings save, a live rebuild), so a style edit or a pan inside the held warm-up reuses
122
- * the bars while another timeframe (a new key) or a raised lookback (an earlier start) refetches.
136
+ * the bars while another timeframe or session (a new key) or a raised lookback (an earlier start) refetches.
123
137
  * The live reconcile right after the run refreshes the newest run bars either way.
124
138
  */
125
139
  export declare function planWrunRunIntervalRows(input: {
@@ -24,7 +24,9 @@
24
24
  * with the one it was built for), like the session's chart names (wrun-chart-context-names.util).
25
25
  */
26
26
  import { runBarSpan } from '../chart/indicator-run-interval.util.js';
27
+ import { isChartRthActive } from '../chart/rth-session.util.js';
27
28
  import { runIntervalWarmupStartTs } from '../chart/run-interval-warmup.leaf.js';
29
+ import { isEquityRegularSessionGated } from '../chart/us-equities-session.util.js';
28
30
  import { getWrunOverlayLiveContext } from './wrun-overlay-drivers.util.js';
29
31
  /** The intake queue key the chart market's candle frames ride for a session at another interval
30
32
  * (beside the grid legs' queues, never a leg's fetch key). */
@@ -43,12 +45,25 @@ export function wrunRunIntervalSessionOf(context) {
43
45
  export function wrunLiveRunIntervalMs(indicatorId) {
44
46
  return wrunRunIntervalSessionOf(getWrunOverlayLiveContext(indicatorId))?.run.intervalMs;
45
47
  }
46
- /** The identity of the run bars a session holds: the run interval and the chart market they were
47
- * fetched for (exchange, symbol, transformations), never the chart's own interval. */
48
+ /** Whether the chart's candle lane fetches `intervalMs` bars on a session filter, its `tradingHour`
49
+ * following the chart's session (candle-trading-hour.util): regular hours on a US listing unless it
50
+ * opted into extended hours, RTH on a CME chart in RTH at an intraday interval. */
51
+ export function wrunBarsSessionFiltered(market, intervalMs) {
52
+ return (isEquityRegularSessionGated(market?.exchange, market?.sessionType) ||
53
+ isChartRthActive(market?.exchange, market?.symbol, market?.sessionType, intervalMs));
54
+ }
55
+ /** The identity of the run bars a session holds: the run interval, the chart market they were
56
+ * fetched for (exchange, symbol, transformations) and the session their ask resolved, never the
57
+ * chart's own interval. The run bars ride the chart's candle lane at the RUN interval: on a session
58
+ * filter there (wrunBarsSessionFiltered) the key ends in `regular`, so a session flip re-keys the
59
+ * bars and the next full run refetches them, never computing on the other session's bars while the
60
+ * intake folds the new session's frames on another lattice. Every other key (a crypto run, an ETH
61
+ * run, a CME run at 1D or coarser) names no session: the flip changes none of those bars. */
48
62
  export function wrunRunIntervalCoverageKey(run, market) {
49
- return [run.interval, market?.exchange, market?.symbol, market?.transformations]
50
- .map((part) => (part === undefined || part === null ? '' : String(part)))
51
- .join('|');
63
+ const parts = [run.interval, market?.exchange, market?.symbol, market?.transformations];
64
+ if (wrunBarsSessionFiltered(market, run.intervalMs))
65
+ parts.push('regular');
66
+ return parts.map((part) => (part === undefined || part === null ? '' : String(part))).join('|');
52
67
  }
53
68
  /** The run bars open at or before the chart's newest bar: a frame or an answer may hold the next
54
69
  * bucket before the chart shows a bar in it. A bar opens at its stamp, on the session lattice at
@@ -82,7 +97,7 @@ export function wrunRunIntervalSentRow(row) {
82
97
  /**
83
98
  * Which run bars one full run computes over (run-interval-engine.util's planRunIntervalRefresh
84
99
  * rule, on the session's buffer): the previous session's run bars when they are the same run
85
- * interval on the same market (`key`), were asked from at or before the warm-up the chart's first
100
+ * interval on the same market and session (`key`), were asked from at or before the warm-up the chart's first
86
101
  * bar needs (`warmupBars` run bars below the run bar holding it), hold the run bar of the chart's
87
102
  * newest bar (one still open there: its close past it) and hold no bar stamped past their coverage
88
103
  * (the ask windows' end, read on stamps; the intake extends the forming bar it opened at the
@@ -90,7 +105,7 @@ export function wrunRunIntervalSentRow(row) {
90
105
  * no answer filled); else a fetch from that warm-up start. Without the warm-up term, consecutive
91
106
  * prepended pages would erode the warm-up toward zero run bars. Every full run passes here (a lazy
92
107
  * page, a settings save, a live rebuild), so a style edit or a pan inside the held warm-up reuses
93
- * the bars while another timeframe (a new key) or a raised lookback (an earlier start) refetches.
108
+ * the bars while another timeframe or session (a new key) or a raised lookback (an earlier start) refetches.
94
109
  * The live reconcile right after the run refreshes the newest run bars either way.
95
110
  */
96
111
  export function planWrunRunIntervalRows(input) {