@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
@@ -0,0 +1,133 @@
1
+ import { wrunHostBarSpanOf } from '../wrun-tier-grid.util.js';
2
+ const MINUTE_MS = 60_000;
3
+ /** A landed bar is final once it ended this long before the read: a delayed route serves a bar's last buckets up to 15
4
+ * minutes after its close, so a bar closer to the clock is asked again by the add's next read. */
5
+ export const WRUN_ROW_LANE_FINAL_LAG_MS = 20 * MINUTE_MS;
6
+ /** The memos kept, the oldest dropped first: one for each row lane instance of a mounted indicator. An add whose memo
7
+ * went asks its window whole on its next read and leaves a new one. */
8
+ const MEMOS_KEPT = 32;
9
+ const memos = new Map();
10
+ /** The add's memo, or undefined when it holds none or one of another fingerprint (dropped then). */
11
+ export function wrunRowLaneAddMemoOf(key, fingerprint) {
12
+ const memo = memos.get(key);
13
+ if (memo === undefined)
14
+ return undefined;
15
+ if (memo.fingerprint !== fingerprint) {
16
+ memos.delete(key);
17
+ return undefined;
18
+ }
19
+ return memo;
20
+ }
21
+ export function rememberWrunRowLaneAdd(key, memo) {
22
+ memos.delete(key);
23
+ memos.set(key, memo);
24
+ while (memos.size > MEMOS_KEPT)
25
+ memos.delete(memos.keys().next().value);
26
+ }
27
+ /** The memo a whole run of the add reads (no budget applies: its plan fits, or the cut is off): the landed bars are
28
+ * still reused, the bars a budgeted read cut are asked again, and the add's spend and share start over. */
29
+ export function wrunRowLaneAddMemoWhole(memo) {
30
+ if (memo.cut.size === 0 && memo.spentBytes === 0 && memo.shareBytes === undefined)
31
+ return memo;
32
+ return {
33
+ fingerprint: memo.fingerprint,
34
+ landed: memo.landed,
35
+ cut: new Set(),
36
+ spentBytes: 0,
37
+ shareBytes: undefined,
38
+ };
39
+ }
40
+ /** Test seam: forget every memo. */
41
+ export function __resetWrunRowLaneAddMemosForTests() {
42
+ memos.clear();
43
+ }
44
+ /** The asks over the bars `keep` keeps: each ask cut into the runs of its kept bars (a bar belongs to the ask its span
45
+ * opens in), the tier kept; a run reaching the ask's last bar keeps the ask's own end. */
46
+ export function wrunRowLaneAsksOverBars(asks, keep, window, sessionGrid) {
47
+ const out = [];
48
+ for (const ask of asks) {
49
+ const bars = window.barOpens.filter((stampMs) => {
50
+ const { fromMs } = wrunHostBarSpanOf(stampMs, window.intervalMs, sessionGrid);
51
+ return fromMs >= ask.fromMs && fromMs < ask.toMs;
52
+ });
53
+ let runFrom;
54
+ for (let at = 0; at < bars.length; at += 1) {
55
+ const span = wrunHostBarSpanOf(bars[at], window.intervalMs, sessionGrid);
56
+ if (keep(bars[at])) {
57
+ if (runFrom === undefined)
58
+ runFrom = span.fromMs;
59
+ if (at === bars.length - 1)
60
+ out.push({ ...ask, fromMs: runFrom, toMs: ask.toMs });
61
+ continue;
62
+ }
63
+ if (runFrom !== undefined)
64
+ out.push({ ...ask, fromMs: runFrom, toMs: span.fromMs });
65
+ runFrom = undefined;
66
+ }
67
+ }
68
+ return out;
69
+ }
70
+ /**
71
+ * The add's memo after one of its reads, whatever its role and whether or not a budget applies: every bar the read
72
+ * asked that landed whole (not partial for the read, no partial mark on its row, and a row at all unless an empty bar
73
+ * is quiet for the instance) and final under the instance's dependency (`WrunRowLaneRowDependency`: the lag after the
74
+ * bar's own end, its trade date's end, or its next bar with rows' being whole and final too) joins the landed bars and
75
+ * leaves the cut; every bar the read's budget cut joins the cut unless it is landed; a budgeted read adds what it
76
+ * downloaded and names its share (a whole run and a live read add nothing: the add's budget is its budgeted runs').
77
+ */
78
+ export function wrunRowLaneAddMemoAfter(args) {
79
+ const landed = new Map(args.previous?.landed ?? []);
80
+ const cut = new Set(args.previous?.cut ?? []);
81
+ const { dependency } = args;
82
+ const finalBefore = args.window.nowMs - WRUN_ROW_LANE_FINAL_LAG_MS;
83
+ const asked = new Set(args.askedBars);
84
+ const endOf = (stampMs) => wrunHostBarSpanOf(stampMs, args.window.intervalMs, args.sessionGrid).toMs;
85
+ /** A bar this read landed whole, or one the add's memo already held (whole when it was admitted). A bar the answer
86
+ * left with no row is whole only where an empty bar is quiet (`emptyIsQuiet`: a flow's, never a snapshot's). */
87
+ const wholeAt = (stampMs) => {
88
+ if (!asked.has(stampMs))
89
+ return args.previous?.landed.has(stampMs) === true;
90
+ if (args.partialBars.has(stampMs))
91
+ return false;
92
+ const row = args.landedRows.get(stampMs);
93
+ return row === undefined || row.length <= 1 ? dependency.emptyIsQuiet : !args.marked(row);
94
+ };
95
+ const bars = [...args.window.barOpens].sort((a, b) => a - b);
96
+ const indexOf = new Map(bars.map((stampMs, at) => [stampMs, at]));
97
+ /** Whether a bar's row can no longer change: its own end, then what it depends on, the lag behind the read's clock. */
98
+ const finalAt = (stampMs) => {
99
+ if (endOf(stampMs) > finalBefore)
100
+ return false;
101
+ if (dependency.kind === 'bar')
102
+ return true;
103
+ if (dependency.kind === 'session')
104
+ return dependency.sessionEndMs(stampMs) <= finalBefore;
105
+ // The next bar with rows decides what this bar carries: every bar up to it must be whole and final, and it must be
106
+ // in the window (a bar whose next rows the read cannot see stays asked).
107
+ for (let at = (indexOf.get(stampMs) ?? bars.length) + 1; at < bars.length; at += 1) {
108
+ const next = bars[at];
109
+ if (endOf(next) > finalBefore || !wholeAt(next))
110
+ return false;
111
+ const row = args.landedRows.get(next);
112
+ if (row !== undefined && dependency.hasRows(row))
113
+ return true;
114
+ }
115
+ return false;
116
+ };
117
+ for (const stampMs of asked) {
118
+ if (!wholeAt(stampMs) || !finalAt(stampMs))
119
+ continue;
120
+ landed.set(stampMs, args.landedRows.get(stampMs));
121
+ cut.delete(stampMs);
122
+ }
123
+ for (const stampMs of args.cutBars)
124
+ if (!landed.has(stampMs))
125
+ cut.add(stampMs);
126
+ return {
127
+ fingerprint: args.fingerprint,
128
+ landed,
129
+ cut,
130
+ spentBytes: (args.previous?.spentBytes ?? 0) + Math.max(0, args.spentBytes),
131
+ shareBytes: args.shareBytes ?? args.previous?.shareBytes,
132
+ };
133
+ }
@@ -7,10 +7,18 @@ export declare const WRUN_ROW_LANE_FIRST_PAINT_BARS = 30;
7
7
  /** The most bytes a row lane's first ask is projected to answer (OPTLOAD first paint: 0.25 MB, at 8 bytes a cell). */
8
8
  export declare const WRUN_ROW_LANE_FIRST_PAINT_BYTES: number;
9
9
  /** The fewest bars a first slice holds to draw before the older bars land: a closed bar beside the newest. A lane
10
- * whose budget leaves the newest bar alone (Strike Footprint's expiry_strike rows, Interval Flow's contracts at 1h)
11
- * draws nothing early: one bar, forming most of a session, is no first picture to check, and Strike Footprint learns
12
- * its strike step over the whole run, so that bar could read another value once the older bars land. */
10
+ * whose budget leaves the newest bar alone (Interval Flow's contracts at 1h) draws nothing early: one bar, forming
11
+ * most of a session, is no first picture to check. Strike Footprint never draws early
12
+ * (`wrunRowLaneDrawsFirstSlice`). */
13
13
  export declare const WRUN_ROW_LANE_FIRST_SLICE_MIN_BARS = 2;
14
+ /**
15
+ * Whether an instance's first slice may draw before its older bars land (wrun-row-lanes.util `onFirstSlice`): never
16
+ * Strike Footprint's per-(expiry, strike) rows (`option_strike_flow`'s `expiry_strike` group), whatever the slice
17
+ * holds. It learns its strike step over the whole run, so a slice bar could read another value once the older bars
18
+ * land. Its projection alone kept it out (one bar filled the slice) until the projection followed the bar's width: a
19
+ * 5-minute slice holds five of its bars.
20
+ */
21
+ export declare function wrunRowLaneDrawsFirstSlice(sourceClass: string, acquisition: Readonly<Record<string, unknown>>): boolean;
14
22
  /** A host-grid ask plan split for first paint: the slice's asks (`first`), the older parts newest first (`older`, empty
15
23
  * when the slice holds the plan whole), where the slice starts (its first bar's open; set only when it split) and
16
24
  * whether its cut falls on a trade date's first bar (`sessions` asked and met; set only then). */
@@ -27,6 +35,10 @@ export interface WrunRowLaneFirstPaintSplit {
27
35
  * slice: a 5m chart inside its day) the split is the plain one, unaligned, and nothing draws before the whole answer.
28
36
  */
29
37
  export declare function wrunRowLaneFirstPaintSplit(asks: readonly WrunHostGridAsk[], window: Pick<WrunRowLaneWindow, 'barOpens' | 'intervalMs' | 'nowMs'>, budget: WrunRowLaneRowBudget | undefined, acquisition?: Readonly<Record<string, unknown>>, sessionGrid?: LiveBucketVenue | null, sessions?: (barOpenMs: number) => number): WrunRowLaneFirstPaintSplit;
38
+ /** A host-grid ask plan cut at `sliceFromMs` (never inside a bar): the slice's asks and the older ones, newest first;
39
+ * the plan whole as the slice when no ask opens before it. A budgeted read of a whole session per row slices on its
40
+ * newest session's first bar (wrun-row-lanes.util `landWithinDownloadShare`, OPTLOAD W3 R2). */
41
+ export declare function wrunRowLaneSplitAt(asks: readonly WrunHostGridAsk[], sliceFromMs: number): WrunRowLaneFirstPaintSplit;
30
42
  /** A host-grid ask plan ordered for first paint (see the module doc): the slice's asks, then the older ones. */
31
43
  export declare function wrunRowLaneFirstPaintAsks(asks: readonly WrunHostGridAsk[], window: Pick<WrunRowLaneWindow, 'barOpens' | 'intervalMs' | 'nowMs'>, budget: WrunRowLaneRowBudget | undefined, acquisition?: Readonly<Record<string, unknown>>, sessionGrid?: LiveBucketVenue | null): WrunHostGridAsk[];
32
44
  /**
@@ -15,15 +15,26 @@
15
15
  */
16
16
  import { KSCRIPT_SOURCE_CELL_BYTES } from '../../chart/kscript-source-answer-budget.leaf.js';
17
17
  import { wrunHostBarSpanOf } from '../wrun-tier-grid.util.js';
18
+ import { WRUN_OPTION_STRIKE_FLOW_CLASS } from '../wrun-option-strike-flow-lane.util.js';
18
19
  /** The most host bars a row lane's first ask covers (OPTLOAD first paint: the newest 30 bars first). */
19
20
  export const WRUN_ROW_LANE_FIRST_PAINT_BARS = 30;
20
21
  /** The most bytes a row lane's first ask is projected to answer (OPTLOAD first paint: 0.25 MB, at 8 bytes a cell). */
21
22
  export const WRUN_ROW_LANE_FIRST_PAINT_BYTES = 256 * 1024;
22
23
  /** The fewest bars a first slice holds to draw before the older bars land: a closed bar beside the newest. A lane
23
- * whose budget leaves the newest bar alone (Strike Footprint's expiry_strike rows, Interval Flow's contracts at 1h)
24
- * draws nothing early: one bar, forming most of a session, is no first picture to check, and Strike Footprint learns
25
- * its strike step over the whole run, so that bar could read another value once the older bars land. */
24
+ * whose budget leaves the newest bar alone (Interval Flow's contracts at 1h) draws nothing early: one bar, forming
25
+ * most of a session, is no first picture to check. Strike Footprint never draws early
26
+ * (`wrunRowLaneDrawsFirstSlice`). */
26
27
  export const WRUN_ROW_LANE_FIRST_SLICE_MIN_BARS = 2;
28
+ /**
29
+ * Whether an instance's first slice may draw before its older bars land (wrun-row-lanes.util `onFirstSlice`): never
30
+ * Strike Footprint's per-(expiry, strike) rows (`option_strike_flow`'s `expiry_strike` group), whatever the slice
31
+ * holds. It learns its strike step over the whole run, so a slice bar could read another value once the older bars
32
+ * land. Its projection alone kept it out (one bar filled the slice) until the projection followed the bar's width: a
33
+ * 5-minute slice holds five of its bars.
34
+ */
35
+ export function wrunRowLaneDrawsFirstSlice(sourceClass, acquisition) {
36
+ return sourceClass !== WRUN_OPTION_STRIKE_FLOW_CLASS || acquisition.group !== 'expiry_strike';
37
+ }
27
38
  /**
28
39
  * A host-grid ask plan split for first paint (see the module doc). `sessions` (the chart's trade date of a bar, on
29
40
  * every run that reads one) moves the cut forward to the first slice bar of another trade date than the bar before the cut, so the slice
@@ -65,6 +76,14 @@ export function wrunRowLaneFirstPaintSplit(asks, window, budget, acquisition = {
65
76
  ...(aligned !== undefined ? { sessionAligned: true } : {}),
66
77
  };
67
78
  }
79
+ /** A host-grid ask plan cut at `sliceFromMs` (never inside a bar): the slice's asks and the older ones, newest first;
80
+ * the plan whole as the slice when no ask opens before it. A budgeted read of a whole session per row slices on its
81
+ * newest session's first bar (wrun-row-lanes.util `landWithinDownloadShare`, OPTLOAD W3 R2). */
82
+ export function wrunRowLaneSplitAt(asks, sliceFromMs) {
83
+ if (asks.every((ask) => ask.fromMs >= sliceFromMs))
84
+ return { first: [...asks], older: [] };
85
+ return { ...cutAsks(asks, sliceFromMs), sliceFromMs };
86
+ }
68
87
  /** The asks cut at `sliceFrom` (never inside a bar): the slice's in their order, the older ones newest first. */
69
88
  function cutAsks(asks, sliceFrom) {
70
89
  const first = [];
@@ -264,6 +264,37 @@ export interface WrunRowLaneDescriptor {
264
264
  /** Live points by coin (see `WrunRowLaneLiveByCoin`: a governed lane's plane, a chain lane's own chain per
265
265
  * instance); absent: a poll lane (the reconcile re-asks it). */
266
266
  liveByCoin?: WrunRowLaneLiveByCoin;
267
+ /** How the indicator download budget prices and caps a read the lane downloads more for than its declaration says
268
+ * (OPTLOAD W3 R2 and FE-FOLD-CAP, `WrunRowLaneDownloadFacts`); absent: the kit's projection of the declared read. */
269
+ download?: WrunRowLaneDownloadFacts;
270
+ }
271
+ /** The chart a lane's download forecast reads before any fetch (`WrunRowLaneDownloadFacts.forecastBytes`): the chain the
272
+ * chart's options list on as the chain lanes resolve it (its exchange and underlying), the tier its reads are routed to
273
+ * on a governed exchange, and the run's window of host bars. */
274
+ export interface WrunRowLaneDownloadChart {
275
+ chainExchange: string;
276
+ coin: string;
277
+ servedTier?: 'realtime' | 'delayed';
278
+ barOpens: readonly number[];
279
+ intervalMs: number;
280
+ barGrid?: LiveBucketVenue | null;
281
+ nowMs: number;
282
+ }
283
+ /**
284
+ * A lane's own words to the download budget (OPTLOAD W3 R2, FE-FOLD-CAP; wrun-download-plan.util):
285
+ * - `forecastBytes`: what a read of one input (its declaration, setting-bound knobs already read) is forecast to
286
+ * download over the run's window before any fetch, where it downloads more than its declaration says (a read the
287
+ * lane folds from the chain's contract rows in the browser), or undefined when the kit's projection holds. Loaded
288
+ * lazily: the lane file stays light;
289
+ * - `fold`: the ask field the lane's browser fold reads its contract-row cap from, and one folded row's cells, so a
290
+ * budgeted read spends the indicator's budget, not the source answer's.
291
+ */
292
+ export interface WrunRowLaneDownloadFacts {
293
+ forecastBytes?: (source: WrunRowLaneSource, ctx: WrunRowLaneContext, chart: WrunRowLaneDownloadChart) => Promise<number | undefined>;
294
+ fold?: {
295
+ field: string;
296
+ cellsPerRow: number;
297
+ };
267
298
  }
268
299
  /** The input a lane's per-input projection (`cells`) reads: its name, its declaration, its `max_cells` (the row
269
300
  * builder hands it from the static plan) and the most tuples a bar's block may hold in the run's module (`capacity`:
@@ -20,10 +20,13 @@
20
20
  * - `fetchWrunRowLaneRows`: a lane's rows over a chart window: its asks under the tier rule, landed on the host
21
21
  * bars, the partial bars marked (a `latest` lane asked once, its rows as they come), a row-budget lane's newest bars
22
22
  * first, cut on a trade date's first bar where the chart reads one (wrun-row-lane-first-paint.util; a full run's
23
- * first paint draws them before the older bars land, `onFirstSlice`), and so an instance's whose facets ask a
24
- * per-bar word (OPTLOAD G5); every
25
- * packed block a worker transferred split into plain tuples of the instance's width as it lands
26
- * (`wrunRowLanePlainRow`).
23
+ * first paint draws them before the older bars land, `onFirstSlice`), each bar projected at least at what the
24
+ * lane's earlier reads measured (`wrunRowLaneProjectedBarRows`), the bars its budget left out named to the caller
25
+ * (`onBudgetCut`) and the debug ring, and so an instance's whose facets ask a per-bar word (OPTLOAD G5); a budgeted
26
+ * run's read (`download`, OPTLOAD W3 R2: wrun-download-plan.util) asks its newest slice first and alone, then the
27
+ * newest older bars its share of the run's download budget fits by the slice's own wire bytes, every older bar left
28
+ * partial and named; every packed block a worker transferred split into plain tuples of the instance's width as it
29
+ * lands (`wrunRowLanePlainRow`).
27
30
  * - an option knob naming a setting read as its value before a lane's facets judge it (`resolveWrunOptionSettingKnobs`).
28
31
  * - `wrunRowLaneCellRows`: the row builder's read of one input: the lane's host-bar rows as cell blocks on the
29
32
  * chart's grid (exact width, finite values or NaN outside a lane's `finiteColumns`, the lane's per-input
@@ -40,8 +43,11 @@ import type { OpraReadFacts } from '../../chart/opra-read-access.leaf.js';
40
43
  import type { OpraOptionPlaneStop } from '../../../host-ports.types.js';
41
44
  import type { WrunPollLaneFetchAsk } from './wrun-poll-lane.types.js';
42
45
  import { type WrunLaneChainPlane, type WrunRowLaneCellInput, type WrunRowLaneDescriptor, type WrunRowLaneHorizon, type WrunRowLaneId, type WrunRowLaneInstance, type WrunRowLaneRowBudget } from './wrun-row-lane.types.js';
46
+ import { type WrunRunOptionsMarket } from '../derived-roots.util.js';
47
+ import type { WrunRowLaneRowDependency } from './wrun-row-lane-add-memo.util.js';
43
48
  import type { WrunMissingFeed } from '../wrun-run-health.util.js';
44
- import { type WrunHostGridAsk } from '../wrun-tier-grid.util.js';
49
+ import type { WrunLaneDownloadMeter } from '../wrun-download-plan.util.js';
50
+ import { type WrunBackendTier, type WrunHostGridAsk } from '../wrun-tier-grid.util.js';
45
51
  /** One input of a row-lane class under the static plan. */
46
52
  export interface WrunRowLaneInput {
47
53
  inputIndex: number;
@@ -83,12 +89,13 @@ export interface WrunRowLaneChart {
83
89
  /** A crypto venue (the refusal's words). */
84
90
  isCryptoVenueExchange?: (exchange: string) => boolean;
85
91
  /** The chart's options ride the OPRA plane (a US stock or ETF chart while the `opra` flag is lit, an OPRA
86
- * contract chart: `governedOptionPlane(metadata) === 'opra'`, either spelling of the stock venue). */
87
- isOpraPlaneExchange?: (exchange: string) => boolean;
92
+ * contract chart, a stock twin reading its stock's chain: `governedOptionPlane(metadata) === 'opra'` over the chart
93
+ * market's exchange and symbol, either spelling of the stock venue). */
94
+ isOpraPlaneExchange?: (exchange: string, symbol: string) => boolean;
88
95
  /** Why a chart off the plane is off it although its options list on OPRA (opra-options-gate.util
89
96
  * `opraOptionPlaneStop`: the flag check's `flag-off`, the plane router's `chart-kind`); absent, the market's own
90
97
  * words. */
91
- opraPlaneStop?: (exchange: string) => OpraOptionPlaneStop | undefined;
98
+ opraPlaneStop?: (exchange: string, symbol: string) => OpraOptionPlaneStop | undefined;
92
99
  }
93
100
  /** The run's plan of its row lanes: the instances to fetch, and the feeds the chart never serves to inputs that
94
101
  * declared `missing: "empty"` (one entry per lane key). */
@@ -115,7 +122,9 @@ export interface WrunRowLanePlan {
115
122
  * 3. the lane's identity, once per lane (the first admitted input's context names a refusal), then the input's
116
123
  * facets (awaited, in declaration order), each knob naming a setting first read as the setting's current value
117
124
  * (`resolveWrunOptionSettingKnobs` over `run.paramValues`), the context carrying the plan's facts beside the chart
118
- * (`WrunRowLanePlanFacts`); the instance is the identity and the facets together. A lane with
125
+ * (`WrunRowLanePlanFacts`); the instance is the identity and the facets together. An input naming another root
126
+ * (contract F's `underlying`, `planWrunRowLaneUnderlying`) is planned against that root's market instead, its
127
+ * identity once per lane and market. A lane with
119
128
  * `acquisitions: 'one'` refuses a second input whose acquisition differs (one fetch, one live fold per package). A
120
129
  * chart with no option chain (an identity or facets refusal seeded `no-options` / `chain`, `wrunLaneNoChainRefusal`:
121
130
  * a LINK perp, a forex pair) does not serve the feed either: the same one rule, its note naming the feed with the
@@ -128,6 +137,11 @@ export declare function planWrunRowLanes(metadata: WrunIndicatorMetadata, chart:
128
137
  * `wrunParamValuesFromSettings` over the overlay's settings; absent: a knob naming a setting is refused by name). */
129
138
  export interface WrunRowLaneRunFacts extends OpraReadFacts {
130
139
  paramValues?: Readonly<Record<string, number>>;
140
+ /** The run's one options decision (derived-roots.util `decideWrunRunOptionsMarket`, taken at its head): every chain
141
+ * lane's input on the chart it was taken for carries it (wrun-poll-lanes.util `wrunChainLaneContext`), so its chain
142
+ * resolves under the decided plane, and a stock twin's input is planned against the twin's lane market. Absent: the
143
+ * plane is read when the chain resolves. */
144
+ options?: WrunRunOptionsMarket;
131
145
  }
132
146
  /**
133
147
  * What the planner hands an input's facets beside the chart (on its context):
@@ -199,7 +213,38 @@ export interface WrunRowLaneWindow {
199
213
  * lane's slice so the slice holds whole sessions (wrun-row-lane-first-paint.util `wrunRowLaneFirstPaintSplit`): a
200
214
  * first paint's asks and a later run's are the same windows. Absent: the plain cut, and no early answer. */
201
215
  tradeDateOf?: (barOpenMs: number) => number;
216
+ /**
217
+ * A replay's cursor (wrun-replay-lane.util `WrunReplayRunPlan.cutoffTs`, a replay step's newest revealed bar): a flow
218
+ * or snapshot lane's window ends at that bar (`wrunRowLaneWindowAtReplayCursor`), so no bar after it is asked and a
219
+ * per-bar source shows its board, prints and flow as of the cursor; the read keeps a replay memo of what it landed
220
+ * whole (`fetchWrunRowLaneRows`), so a later read of the same lane asks only the bars it lacks. Absent (every read but
221
+ * a replay's): the whole window.
222
+ */
223
+ replayCursorMs?: number;
202
224
  }
225
+ /** A row lane's window bounded at a replay cursor (`WrunRowLaneWindow.replayCursorMs`): a flow or snapshot lane's bars
226
+ * opening after the cursor are left out; a `latest` lane (the live row's snapshot), and a window naming no cursor,
227
+ * as they are. */
228
+ export declare function wrunRowLaneWindowAtReplayCursor(lane: Pick<WrunRowLaneDescriptor, 'landing'>, window: WrunRowLaneWindow): WrunRowLaneWindow;
229
+ /**
230
+ * The row lane instances a replay run reads through its cursor (`wrunRowLaneWindowAtReplayCursor`: the flow and snapshot
231
+ * lanes), by key: the session's coverage of each is the cursor, never the replay window's end its other lanes reach, so
232
+ * each replay step extends them (`wrunReplayRowLaneExtensions`) and the replay record keeps naming the window's end.
233
+ */
234
+ export declare function wrunRowLanesReplayBounded(instances: ReadonlyArray<Pick<WrunRowLaneInstance, 'key' | 'laneKey'>> | undefined): ReadonlySet<string>;
235
+ /**
236
+ * What a replay step owes a session's row lanes before it computes the bars it reveals (SKYLIT-PARITY L6a): each flow
237
+ * or snapshot lane covered short of the step's cursor (`coveredThroughTs`, the newest bar its buffer holds), from the
238
+ * bar after its coverage (`fromTs`) through the cursor. A lane holding no coverage (the run degraded it) is left to its
239
+ * degrade, and a `latest` lane to its live-row snapshot.
240
+ */
241
+ export declare function wrunReplayRowLaneExtensions(instances: ReadonlyArray<Pick<WrunRowLaneInstance, 'key' | 'laneKey'>> | undefined, coveredThroughTs: Readonly<Partial<Record<string, number>>>, cursorMs: number): Array<{
242
+ key: WrunRowLaneId;
243
+ fromTs: number;
244
+ }>;
245
+ /** A replay step's answer merged into a row lane's held rows: one row per bar, ascending, the answer's row in place of
246
+ * a held one of the same bar (a replay holds no live-folded row an answer could lose). */
247
+ export declare function mergeWrunReplayRowLaneRows(held: ReadonlyArray<ReadonlyArray<unknown>> | undefined, answer: ReadonlyArray<ReadonlyArray<unknown>>): unknown[][];
203
248
  /** What a row lane's fetch hands its caller beside the whole answer (`fetchWrunRowLaneRows`). */
204
249
  export interface WrunRowLaneFetchOptions {
205
250
  /**
@@ -208,6 +253,87 @@ export interface WrunRowLaneFetchOptions {
208
253
  * Only a full run's first paint asks for it (wrun-overlay-run.util `runWrunSourceLanes`, the lane's early rows).
209
254
  */
210
255
  onFirstSlice?: (rows: unknown[][], sliceFromTs: number) => void;
256
+ /**
257
+ * The row budget's cut of this read (`WrunRowLaneBudgetCut`): called once, before any ask leaves, when the budget
258
+ * leaves asked bars partial, so the caller names the cut on the legend. A cut bar lands one partial marker, which a
259
+ * package reads as no cells: unnamed, Strike Footprint drew its newest 30 bars on every interval and nothing said
260
+ * why. The debug ring records every cut (`wrun-row-lane-budget-cut`) whether or not a caller listens.
261
+ */
262
+ onBudgetCut?: (cut: WrunRowLaneBudgetCut) => void;
263
+ /**
264
+ * A budgeted run's hold on this read (OPTLOAD W3 R2, `WrunRowLaneDownload`; wrun-download-plan.util): the newest slice
265
+ * is asked first and alone, then the newest older bars the read's share fits by the slice's own wire bytes, and no
266
+ * others; every bar it leaves unasked reads partial and the cut is named (`onBudgetCut`, `budget: 'download'`) once
267
+ * the asks landed. Absent (a whole run, the flag off): the plan's asks, over the bars the add's memo does not hold.
268
+ */
269
+ download?: WrunRowLaneDownload;
270
+ /**
271
+ * The add this read belongs to (OPTLOAD W3; wrun-row-lane-add-memo.util): `key` names the chart, the mounted
272
+ * indicator and the instance (`wrunRowLaneAddKey`), `role` the read. Every read that names its add leaves the add a
273
+ * memo of the bars it landed whole and final, and every later read of the add (a run's, the live start, a live
274
+ * reconcile) reuses them and asks only the rest: a new bar at the head, a bar still forming. Whether a download
275
+ * budget applies changes none of that; a budgeted run's read also leaves the bars its budget cut (kept partial by
276
+ * every later read) and what it downloaded (a later budgeted run reads within what is left of the add's share), and a
277
+ * run with no `download` (the add's plan is whole, or the cut is off) asks the cut bars again and starts the add's
278
+ * spend over. Absent (a read of no add: a spec, a probe): no memo is read or left. A replay's read (`replayCursorMs`)
279
+ * never reads or leaves the add's memo: it keeps one of its own (`role: 'replay'`, keyed by the lane, the acquisition
280
+ * and the bar span), so a later read at the same or a later cursor reuses the bars it landed and asks the rest. Every
281
+ * memo admits only the bars of asks the chart's fetch confirmed whole (`ask`'s verdict).
282
+ */
283
+ addMemo?: {
284
+ key: string;
285
+ role: 'run' | 'live' | 'replay';
286
+ };
287
+ /**
288
+ * The asked bars whose asks the chart's fetch did not confirm whole (a synthetic completion, a trimmed window, an ask
289
+ * that reported no verdict): called once, after the asks landed, when there are any, ascending. Their rows (none, or
290
+ * the ones collected so far) look like data, and no memo admits them, so a later read asks them again (a replay step
291
+ * reopens its session instead of computing over them).
292
+ */
293
+ onUnconfirmed?: (bars: readonly number[]) => void;
294
+ }
295
+ /** The add a row lane read belongs to (`WrunRowLaneFetchOptions.addMemo`): the chart, the indicator, the instance. */
296
+ export declare function wrunRowLaneAddKey(chartIndex: number, indicatorId: string, instanceKey: string): string;
297
+ /** A budgeted run's hold on one row lane read (`WrunRowLaneFetchOptions.download`, OPTLOAD W3 R2 and FE-FOLD-CAP). */
298
+ export interface WrunRowLaneDownload {
299
+ /** The read's share of the run's download budget, in bytes (wrun-download-plan.util `wrunRunDownloadMode`): what its
300
+ * older bars may spend once its newest slice landed. The slice is asked whatever the share. */
301
+ share: number;
302
+ /** The read's own tally beside the run's meter (wrun-download-plan.util `createWrunLaneDownloadMeter`): every ask of
303
+ * the read charges it (the caller's fetch hands it to the transport), so the slice's wire bytes are its own. */
304
+ meter: Pick<WrunLaneDownloadMeter, 'charge' | 'spentBytes'>;
305
+ /** The rows one bar is declared to read (the kit's rows a bar): they size the newest slice of a lane with no row
306
+ * budget of its own (Spot Exposures' slice is its newest bar alone) and project an older bar before any read. */
307
+ declaredBarRows?: number;
308
+ /** FE-FOLD-CAP: the ask field a lane's browser fold reads its contract-row cap from, and one folded row's cells:
309
+ * each ask names the rows the bytes its group may still spend buy at the row's cells (8 bytes each), the unit the
310
+ * fold plan counts its projected rows in. Never at a measured wire row: the wire carries the chain's actual rows,
311
+ * which outnumber the projection where the chain is busier than it (3.2 to 1 on an ES1! regular-hours hour), so a
312
+ * cap priced there bought 2.4 times its share (INT 2026-10-23). */
313
+ fold?: {
314
+ field: string;
315
+ cellsPerRow: number;
316
+ };
317
+ }
318
+ /** What a row budget left out of one read (`WrunRowLaneFetchOptions.onBudgetCut`). */
319
+ export interface WrunRowLaneBudgetCut {
320
+ /** The lane's key: the feed the note names. */
321
+ laneKey: string;
322
+ /** The asked bars read whole: the newest that fit the budget. */
323
+ keptBars: number;
324
+ /** The asked bars the budget left partial: older than the kept ones, or a newest bar that cannot fit alone. */
325
+ cutBars: number;
326
+ /** The oldest kept bar's stamp; absent when no asked bar fits. */
327
+ keptFromTs?: number;
328
+ /** The budget's cap in rows of the lane's answered width (`wrunRowLaneMaxRows`). */
329
+ maxRows: number;
330
+ /** The budget that cut: absent, the source answer budget (before any ask leaves); `download`, the run's download
331
+ * budget (OPTLOAD W3 R2, once the asks landed: the bars the read's share left unread, and the bars its browser fold
332
+ * left partial under its cap). */
333
+ budget?: 'download';
334
+ /** A download cut: the bytes the read downloaded and its share. */
335
+ spentBytes?: number;
336
+ shareBytes?: number;
211
337
  }
212
338
  /**
213
339
  * A row lane's rows over a chart window `[barOpens[0], last bar's end)`: a flow or snapshot lane's asks under the
@@ -230,13 +356,54 @@ export interface WrunRowLaneFetchOptions {
230
356
  * still out a macrotask later: the slice's rows, every older bar the projection reads rows for read partial
231
357
  * (wrun-row-lane-first-paint.util `wrunRowLaneFirstSliceHeldBars`), and the slice's first bar. Never when no cut falls
232
358
  * on a session's first bar (a session longer than the slice: the plain split, asked as today), for a block with no
233
- * `present` mask (it cannot read a bar as partial), a kit fold carrying the next bar (its pages ask one at a time), or
234
- * a snapshot whose empty bars ask a coarser tier (that pass would ask the slice's bars again).
359
+ * `present` mask (it cannot read a bar as partial), a kit fold carrying the next bar (its pages ask one at a time),
360
+ * Strike Footprint's per-(expiry, strike) rows (it learns its strike step over the whole run:
361
+ * wrun-row-lane-first-paint.util `wrunRowLaneDrawsFirstSlice`), or a snapshot whose empty bars ask a coarser tier (that
362
+ * pass would ask the slice's bars again).
363
+ *
364
+ * A row budget that leaves asked bars partial says so before any ask leaves (`opts.onBudgetCut`, and the debug ring).
365
+ *
366
+ * `opts.download` (a budgeted run, OPTLOAD W3 R2; `landWithinDownloadShare`): after the tier rule, the horizon and the
367
+ * row budget (the smaller cut wins), the read asks its newest slice first and alone, then the newest older bars its
368
+ * share fits by the slice's own wire bytes, and no others; every bar it leaves unasked reads partial (bit 14 with the
369
+ * marker tuple; an empty block on a class with no `present` mask), and the cut is named once the asks landed
370
+ * (`onBudgetCut`, `budget: 'download'`). No early handover in that mode. Absent: the plan's asks, over the bars the
371
+ * add's memo does not hold (`opts.addMemo`).
372
+ *
373
+ * A replay's window (`window.replayCursorMs`, plan L6a): a flow or snapshot lane's bars end at the replay's cursor
374
+ * (`wrunRowLaneWindowAtReplayCursor`), so nothing after it is asked, and the read keeps a replay memo (the add memo's
375
+ * machinery, `role: 'replay'`, never the add's own): a replay step's read of the bars it reveals
376
+ * (wrun-live-tick.util, `wrunReplayRowLaneExtensions`) and a reopened run reuse the bars landed whole and final and
377
+ * ask the rest. A read that names no cursor asks exactly as before.
378
+ *
379
+ * `ask` reports its answer's completion through its fourth argument (`whole`: the chart's fetch verdict,
380
+ * wrun-source-rows.util `wrunSourceVerdictWhole`); an ask that never reports is not whole. A memo admits a bar only from
381
+ * an ask reported whole, and the bars of every other ask are named to the caller (`opts.onUnconfirmed`), so a synthetic
382
+ * completion's empty or short answer is asked again, never remembered as the bar.
235
383
  */
236
- export declare function fetchWrunRowLaneRows(lane: WrunRowLaneDescriptor, extras: Readonly<Record<string, unknown>>, window: WrunRowLaneWindow, fallback: {
384
+ export declare function fetchWrunRowLaneRows(lane: WrunRowLaneDescriptor, extras: Readonly<Record<string, unknown>>, askedWindow: WrunRowLaneWindow, fallback: {
237
385
  fromTs: number;
238
386
  toTs: number;
239
- }, ask: (extras: Readonly<Record<string, unknown>>, fromTs: number, toTs: number) => Promise<ReadonlyArray<ReadonlyArray<unknown>>>, opts?: WrunRowLaneFetchOptions): Promise<unknown[][]>;
387
+ }, ask: (extras: Readonly<Record<string, unknown>>, fromTs: number, toTs: number, whole?: (whole: boolean) => void) => Promise<ReadonlyArray<ReadonlyArray<unknown>>>, opts?: WrunRowLaneFetchOptions): Promise<unknown[][]>;
388
+ /**
389
+ * What one host bar's landed row depends on beyond its own span, read off a row lane instance's acquisition: the add
390
+ * memo's ONE eligibility rule (wrun-row-lane-add-memo.util `WrunRowLaneRowDependency`), so no read reuses a row a later
391
+ * read would answer otherwise (LIVE-REREAD review 2026-10-28). By the acquisition's own words, whatever the lane:
392
+ * - a window-wide cut (`newest`, and `newestTailMs` beside it: the window's N newest prints, option_prints): a bar's
393
+ * rows depend on every newer print of the read's window: `never`;
394
+ * - `history: "today"` (the flow lanes): which bars hold rows depends on the trade date of the chart's newest bar (the K
395
+ * control's `todayFromMs`), which no bar's clock settles: `never`;
396
+ * - `span: "session"` (the flow lanes): one sum per contract per trade date on the session's first bar, growing all
397
+ * session: `session`, its trade date's end on the chain's clock (`optionTradeDateClockOf`, the clock the worker
398
+ * twins group by); `never` for a chain the acquisition names no exchange of;
399
+ * - a kit fold carrying the next bar's strikes (`wrunOptionLaneCarriesNext`): `next-bar`, its rows read as the paging
400
+ * seam reads them (`wrunOptionKitBarHasRows`);
401
+ * - anything else: `bar`, final the lag after its own end.
402
+ * And by the lane's landing, an empty bar: quiet on a flow (nothing traded), never final on a snapshot (`emptyIsQuiet`
403
+ * false: a picture not shown yet, a failed read answered empty, a folded kit read's older bars past its cap, a CME
404
+ * surface bar whose settlement row is not published yet; LIVE-REREAD sweep 2026-10-28).
405
+ */
406
+ export declare function wrunRowLaneRowDependencyOf(lane: Pick<WrunRowLaneDescriptor, 'sourceClass' | 'chain' | 'landing'>, extras: Readonly<Record<string, unknown>>): WrunRowLaneRowDependency;
240
407
  /**
241
408
  * A landed row with every packed block (a Float64Array a worker handed the page by transfer, `count x width` values back
242
409
  * to back: OPTLOAD G5 O6) split into plain tuples of `width` values, every other cell as it is; a new array. The one
@@ -297,6 +464,23 @@ export declare function wrunRowLaneAsksWithinRowBudget(plan: {
297
464
  asks: WrunHostGridAsk[];
298
465
  partialBars: number[];
299
466
  };
467
+ /** Test seam: forget every measurement. */
468
+ export declare function __resetWrunRowLaneMeasurementsForTests(): void;
469
+ /**
470
+ * The rows a row-budget lane's next ask projects for one bar: its own projection (`rowBudget.barRows`: a proxy, the
471
+ * strike flow's SPY bars at one width, the contract flow's SPY session at each tier) raised to the tuples a bar of the
472
+ * same lane, acquisition, tier and width held in the reads that landed before, never past the instance's `maxCells`
473
+ * (the most tuples a bar of it is read with, which option_strike_flow's facets name); a bar its projection reads
474
+ * nothing for (before today under `history` "today") stays at nothing. A market busier than its proxy then reads fewer
475
+ * bars on its next ask instead of an answer past the source answer budget, and a quieter one keeps the proxy. A
476
+ * contract flow bar's measured tuples (its contracts) are no more than the raw rows it reads, so they only ever lift a
477
+ * projection that was under them.
478
+ */
479
+ export declare function wrunRowLaneProjectedBarRows(lane: Pick<WrunRowLaneDescriptor, 'laneKey' | 'rowBudget'>, extras: Readonly<Record<string, unknown>>, bar: {
480
+ openMs: number;
481
+ endMs: number;
482
+ tier?: WrunBackendTier;
483
+ }, nowMs: number, acquisition?: Readonly<Record<string, unknown>>): number;
300
484
  /**
301
485
  * How far back one row lane's source holds rows for an acquisition at the clock: the later of its horizon's served
302
486
  * start and the oldest bar its longest-kept tier still holds; null when it names neither, or a tier keeps its rows for