@orangecharts/wrun-chart-host 0.8.0 → 0.10.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 (246) hide show
  1. package/README.md +3 -1
  2. package/dist/constants/feature-flags.constants.d.ts +9 -0
  3. package/dist/constants/feature-flags.constants.js +86 -16
  4. package/dist/constants/marketCapabilities.constants.d.ts +14 -9
  5. package/dist/constants/marketCapabilities.constants.js +36 -13
  6. package/dist/constants/opra-compliance.constants.d.ts +15 -0
  7. package/dist/constants/opra-compliance.constants.js +15 -0
  8. package/dist/constants/option-venues.constants.d.ts +11 -6
  9. package/dist/constants/option-venues.constants.js +5 -2
  10. package/dist/constants/scriptEditor/builtin-script-snippets.d.ts +26 -0
  11. package/dist/constants/scriptEditor/builtin-script-snippets.js +6 -0
  12. package/dist/constants/scriptEditor/technicalIndicatorScriptKeys.constants.d.ts +15 -0
  13. package/dist/constants/scriptEditor/technicalIndicatorScriptKeys.constants.js +17 -0
  14. package/dist/constants/venue-presets.constants.d.ts +20 -20
  15. package/dist/constants/venue-presets.constants.js +24 -26
  16. package/dist/host-env.d.ts +39 -9
  17. package/dist/host-env.js +6 -0
  18. package/dist/host-ports.types.d.ts +108 -18
  19. package/dist/index.d.ts +14 -0
  20. package/dist/index.js +14 -0
  21. package/dist/interfaces/kscript-diagnostics.interface.d.ts +6 -0
  22. package/dist/interfaces/opra-realtime.interface.d.ts +13 -11
  23. package/dist/interfaces/opra-realtime.interface.js +10 -10
  24. package/dist/interfaces/replay.interface.d.ts +8 -0
  25. package/dist/interfaces/wrun-runtime.interface.d.ts +52 -15
  26. package/dist/kscript-data/controls/live-trades-merge.util.d.ts +94 -14
  27. package/dist/kscript-data/controls/live-trades-merge.util.js +132 -22
  28. package/dist/kscript-data/controls/live-trades-order-gate.util.d.ts +56 -0
  29. package/dist/kscript-data/controls/live-trades-order-gate.util.js +107 -0
  30. package/dist/market-data/billing.interface.d.ts +227 -42
  31. package/dist/market-data/billing.interface.js +60 -12
  32. package/dist/market-data/venue.d.ts +88 -6
  33. package/dist/market-data/venues/cme.contract.copy.json +66 -0
  34. package/dist/market-data/venues/cme.d.ts +126 -0
  35. package/dist/market-data/venues/cme.js +133 -0
  36. package/dist/market-data/venues/index.d.ts +165 -8
  37. package/dist/market-data/venues/index.js +48 -6
  38. package/dist/market-data/venues/opra.contract.copy.json +5 -3
  39. package/dist/market-data/venues/opra.d.ts +3 -3
  40. package/dist/market-data/venues/opra.js +5 -4
  41. package/dist/replay/replayLadder.js +3 -1
  42. package/dist/settings-templates/index.js +7 -3
  43. package/dist/settings-templates/indicator-fields.d.ts +5 -4
  44. package/dist/settings-templates/indicator-fields.js +45 -6
  45. package/dist/settings-templates/tool-rules.d.ts +27 -17
  46. package/dist/settings-templates/tool-rules.js +27 -11
  47. package/dist/settings-templates/tool-tables.generated.js +91 -31
  48. package/dist/utility/chart/book-live-bucket.util.d.ts +15 -0
  49. package/dist/utility/chart/book-live-bucket.util.js +47 -0
  50. package/dist/utility/chart/crypto-index.leaf.d.ts +2 -2
  51. package/dist/utility/chart/crypto-index.leaf.js +2 -2
  52. package/dist/utility/chart/index-mode-admission.util.js +24 -3
  53. package/dist/utility/chart/index-mode.util.d.ts +5 -2
  54. package/dist/utility/chart/index-mode.util.js +23 -13
  55. package/dist/utility/chart/kscript-drawing-safe-area.util.d.ts +35 -11
  56. package/dist/utility/chart/kscript-drawing-safe-area.util.js +145 -35
  57. package/dist/utility/chart/kscript-live-coalesce.util.d.ts +7 -2
  58. package/dist/utility/chart/kscript-live-coalesce.util.js +9 -3
  59. package/dist/utility/chart/kscript-provenance-keys.util.js +6 -0
  60. package/dist/utility/chart/kscript-standin-identity.leaf.d.ts +3 -1
  61. package/dist/utility/chart/kscript-titancharts-render-keys.constants.d.ts +32 -2
  62. package/dist/utility/chart/kscript-titancharts-render-keys.constants.js +45 -0
  63. package/dist/utility/chart/kscript-venue-policy.util.d.ts +53 -27
  64. package/dist/utility/chart/kscript-venue-policy.util.js +74 -32
  65. package/dist/utility/chart/market-session-schedule.util.d.ts +10 -0
  66. package/dist/utility/chart/market-session-schedule.util.js +16 -0
  67. package/dist/utility/chart/marketKind.util.d.ts +12 -10
  68. package/dist/utility/chart/marketKind.util.js +17 -7
  69. package/dist/utility/chart/om-panel-push-style.util.d.ts +7 -7
  70. package/dist/utility/chart/om-panel-push-style.util.js +17 -15
  71. package/dist/utility/chart/om-panel.util.js +6 -6
  72. package/dist/utility/chart/opra-read-access.leaf.d.ts +5 -3
  73. package/dist/utility/chart/opra-read-access.leaf.js +5 -3
  74. package/dist/utility/chart/profile-block-size.util.d.ts +16 -0
  75. package/dist/utility/chart/profile-block-size.util.js +7 -0
  76. package/dist/utility/chart/quote-perp.leaf.d.ts +17 -0
  77. package/dist/utility/chart/quote-perp.leaf.js +20 -0
  78. package/dist/utility/chart/rth-session.util.d.ts +3 -2
  79. package/dist/utility/chart/rth-session.util.js +2 -1
  80. package/dist/utility/chart/window-geometry.leaf.d.ts +8 -0
  81. package/dist/utility/chart/window-geometry.leaf.js +22 -6
  82. package/dist/utility/chart/wrun-run-result.util.d.ts +17 -0
  83. package/dist/utility/chart/wrun-run-result.util.js +145 -7
  84. package/dist/utility/common/transformations.util.d.ts +7 -0
  85. package/dist/utility/common/transformations.util.js +11 -0
  86. package/dist/utility/options/option-bar-anchor.util.d.ts +145 -0
  87. package/dist/utility/options/option-bar-anchor.util.js +340 -0
  88. package/dist/utility/options/option-venue.util.d.ts +21 -3
  89. package/dist/utility/options/option-venue.util.js +30 -3
  90. package/dist/utility/scriptEditor/wrun-runtime-diagnostics.leaf.js +2 -0
  91. package/dist/utility/wrun/derived-roots.util.d.ts +213 -0
  92. package/dist/utility/wrun/derived-roots.util.js +471 -0
  93. package/dist/utility/wrun/run-schedule/wrun-chart-gate-reader.util.d.ts +41 -6
  94. package/dist/utility/wrun/run-schedule/wrun-chart-gate-reader.util.js +89 -19
  95. package/dist/utility/wrun/run-schedule/wrun-gate-reader-warm.util.d.ts +9 -4
  96. package/dist/utility/wrun/run-schedule/wrun-gate-reader-warm.util.js +47 -6
  97. package/dist/utility/wrun/run-schedule/wrun-late-reads.util.d.ts +5 -3
  98. package/dist/utility/wrun/run-schedule/wrun-late-reads.util.js +6 -4
  99. package/dist/utility/wrun/run-schedule/wrun-prefix-feeds.util.d.ts +2 -2
  100. package/dist/utility/wrun/run-schedule/wrun-prefix-feeds.util.js +5 -1
  101. package/dist/utility/wrun/sources/lanes/option_daily.js +5 -2
  102. package/dist/utility/wrun/sources/lanes/options_flow.js +5 -2
  103. package/dist/utility/wrun/sources/opra-option-lanes.util.d.ts +64 -19
  104. package/dist/utility/wrun/sources/opra-option-lanes.util.js +105 -35
  105. package/dist/utility/wrun/sources/row-lane-registry.js +3 -2
  106. package/dist/utility/wrun/sources/row-lanes/option_contract_flow.js +2 -1
  107. package/dist/utility/wrun/sources/row-lanes/option_contract_state.d.ts +9 -3
  108. package/dist/utility/wrun/sources/row-lanes/option_contract_state.js +15 -6
  109. package/dist/utility/wrun/sources/row-lanes/option_prints.d.ts +14 -0
  110. package/dist/utility/wrun/sources/row-lanes/option_prints.js +82 -13
  111. package/dist/utility/wrun/sources/row-lanes/option_strike_flow.js +17 -4
  112. package/dist/utility/wrun/sources/row-lanes/option_strikes.d.ts +55 -8
  113. package/dist/utility/wrun/sources/row-lanes/option_strikes.js +95 -14
  114. package/dist/utility/wrun/sources/row-lanes/option_surface.d.ts +5 -2
  115. package/dist/utility/wrun/sources/row-lanes/option_surface.js +7 -3
  116. package/dist/utility/wrun/sources/wrun-poll-lane.types.d.ts +19 -0
  117. package/dist/utility/wrun/sources/wrun-poll-lanes.util.d.ts +35 -14
  118. package/dist/utility/wrun/sources/wrun-poll-lanes.util.js +70 -20
  119. package/dist/utility/wrun/sources/wrun-row-lane-add-memo.util.d.ts +64 -0
  120. package/dist/utility/wrun/sources/wrun-row-lane-add-memo.util.js +89 -0
  121. package/dist/utility/wrun/sources/wrun-row-lane-first-paint.util.d.ts +45 -1
  122. package/dist/utility/wrun/sources/wrun-row-lane-first-paint.util.js +114 -6
  123. package/dist/utility/wrun/sources/wrun-row-lane.types.d.ts +56 -5
  124. package/dist/utility/wrun/sources/wrun-row-lanes.util.d.ts +224 -26
  125. package/dist/utility/wrun/sources/wrun-row-lanes.util.js +822 -58
  126. package/dist/utility/wrun/wrun-batched-marks.util.d.ts +16 -3
  127. package/dist/utility/wrun/wrun-batched-marks.util.js +30 -19
  128. package/dist/utility/wrun/wrun-batched-readout.util.d.ts +37 -9
  129. package/dist/utility/wrun/wrun-batched-readout.util.js +61 -15
  130. package/dist/utility/wrun/wrun-builtin-twin.util.d.ts +12 -0
  131. package/dist/utility/wrun/wrun-builtin-twin.util.js +21 -0
  132. package/dist/utility/wrun/wrun-canvas-readout.util.d.ts +4 -0
  133. package/dist/utility/wrun/wrun-cell-capacity.leaf.d.ts +66 -0
  134. package/dist/utility/wrun/wrun-cell-capacity.leaf.js +86 -0
  135. package/dist/utility/wrun/wrun-chart-market-facts.util.d.ts +192 -13
  136. package/dist/utility/wrun/wrun-chart-market-facts.util.js +437 -55
  137. package/dist/utility/wrun/wrun-color-facts.util.d.ts +19 -9
  138. package/dist/utility/wrun/wrun-color-facts.util.js +24 -14
  139. package/dist/utility/wrun/wrun-color-settings.util.d.ts +15 -4
  140. package/dist/utility/wrun/wrun-color-settings.util.js +31 -12
  141. package/dist/utility/wrun/wrun-dollar-unit-port.leaf.d.ts +17 -0
  142. package/dist/utility/wrun/wrun-dollar-unit-port.leaf.js +9 -0
  143. package/dist/utility/wrun/wrun-download-meter.util.d.ts +107 -0
  144. package/dist/utility/wrun/wrun-download-meter.util.js +134 -0
  145. package/dist/utility/wrun/wrun-download-plan.util.d.ts +99 -0
  146. package/dist/utility/wrun/wrun-download-plan.util.js +118 -0
  147. package/dist/utility/wrun/wrun-draft-legend-note.util.d.ts +11 -3
  148. package/dist/utility/wrun/wrun-draft-legend-note.util.js +26 -4
  149. package/dist/utility/wrun/wrun-draft-overlay.util.d.ts +6 -1
  150. package/dist/utility/wrun/wrun-draft-overlay.util.js +23 -3
  151. package/dist/utility/wrun/wrun-frames.d.ts +27 -6
  152. package/dist/utility/wrun/wrun-frames.js +78 -15
  153. package/dist/utility/wrun/wrun-hosted-wire-caps.d.ts +2 -2
  154. package/dist/utility/wrun/wrun-hosted-wire-caps.js +7 -0
  155. package/dist/utility/wrun/wrun-hosted-wire.util.d.ts +7 -1
  156. package/dist/utility/wrun/wrun-hosted-wire.util.js +12 -2
  157. package/dist/utility/wrun/wrun-hud-looks.util.d.ts +51 -21
  158. package/dist/utility/wrun/wrun-hud-looks.util.js +74 -28
  159. package/dist/utility/wrun/wrun-latest-snapshot.d.ts +11 -0
  160. package/dist/utility/wrun/wrun-lifecycle-runtime.util.d.ts +8 -6
  161. package/dist/utility/wrun/wrun-lifecycle-runtime.util.js +8 -6
  162. package/dist/utility/wrun/wrun-lifecycle.contract.d.ts +4 -2
  163. package/dist/utility/wrun/wrun-live-intake.util.d.ts +19 -9
  164. package/dist/utility/wrun/wrun-live-intake.util.js +213 -45
  165. package/dist/utility/wrun/wrun-live-tick.util.d.ts +4 -0
  166. package/dist/utility/wrun/wrun-live-tick.util.js +246 -49
  167. package/dist/utility/wrun/wrun-market-size-contract-carry.leaf.d.ts +53 -0
  168. package/dist/utility/wrun/wrun-market-size-contract-carry.leaf.js +162 -0
  169. package/dist/utility/wrun/wrun-market-size-defaults.leaf.d.ts +205 -48
  170. package/dist/utility/wrun/wrun-market-size-defaults.leaf.js +277 -34
  171. package/dist/utility/wrun/wrun-market-size-defaults.util.d.ts +51 -7
  172. package/dist/utility/wrun/wrun-market-size-defaults.util.js +340 -56
  173. package/dist/utility/wrun/wrun-opra-lane.util.d.ts +17 -4
  174. package/dist/utility/wrun/wrun-opra-lane.util.js +6 -4
  175. package/dist/utility/wrun/wrun-option-prints.util.d.ts +41 -2
  176. package/dist/utility/wrun/wrun-option-prints.util.js +80 -13
  177. package/dist/utility/wrun/wrun-option-strike-flow-forecast.util.d.ts +31 -0
  178. package/dist/utility/wrun/wrun-option-strike-flow-forecast.util.js +119 -0
  179. package/dist/utility/wrun/wrun-option-strike-flow-lane.util.d.ts +26 -6
  180. package/dist/utility/wrun/wrun-option-strike-flow-lane.util.js +50 -11
  181. package/dist/utility/wrun/wrun-option-strike-flow.util.d.ts +109 -19
  182. package/dist/utility/wrun/wrun-option-strike-flow.util.js +222 -61
  183. package/dist/utility/wrun/wrun-option-views.util.d.ts +96 -18
  184. package/dist/utility/wrun/wrun-option-views.util.js +246 -51
  185. package/dist/utility/wrun/wrun-options-stop.util.d.ts +2 -1
  186. package/dist/utility/wrun/wrun-options-stop.util.js +3 -2
  187. package/dist/utility/wrun/wrun-output-style.util.d.ts +6 -2
  188. package/dist/utility/wrun/wrun-output-style.util.js +20 -2
  189. package/dist/utility/wrun/wrun-overlay-drivers.util.d.ts +20 -0
  190. package/dist/utility/wrun/wrun-overlay-lifecycle.lazy.d.ts +31 -14
  191. package/dist/utility/wrun/wrun-overlay-lifecycle.lazy.js +22 -0
  192. package/dist/utility/wrun/wrun-overlay-lifecycle.util.d.ts +10 -1
  193. package/dist/utility/wrun/wrun-overlay-lifecycle.util.js +52 -4
  194. package/dist/utility/wrun/wrun-overlay-recovery.util.d.ts +7 -0
  195. package/dist/utility/wrun/wrun-overlay-recovery.util.js +25 -1
  196. package/dist/utility/wrun/wrun-overlay-result.util.d.ts +7 -1
  197. package/dist/utility/wrun/wrun-overlay-result.util.js +2 -0
  198. package/dist/utility/wrun/wrun-overlay-run.util.d.ts +134 -37
  199. package/dist/utility/wrun/wrun-overlay-run.util.js +1118 -254
  200. package/dist/utility/wrun/wrun-pack-widths.leaf.d.ts +4 -4
  201. package/dist/utility/wrun/wrun-pack-widths.leaf.js +4 -4
  202. package/dist/utility/wrun/wrun-pack.util.d.ts +7 -3
  203. package/dist/utility/wrun/wrun-pack.util.js +20 -9
  204. package/dist/utility/wrun/wrun-pane-format.util.d.ts +2 -1
  205. package/dist/utility/wrun/wrun-pane-format.util.js +7 -3
  206. package/dist/utility/wrun/wrun-panel-mount.util.d.ts +9 -0
  207. package/dist/utility/wrun/wrun-panel-mount.util.js +63 -13
  208. package/dist/utility/wrun/wrun-panel-style.util.d.ts +37 -24
  209. package/dist/utility/wrun/wrun-panel-style.util.js +100 -29
  210. package/dist/utility/wrun/wrun-param-map.util.d.ts +15 -11
  211. package/dist/utility/wrun/wrun-param-map.util.js +13 -5
  212. package/dist/utility/wrun/wrun-param-values.util.d.ts +21 -3
  213. package/dist/utility/wrun/wrun-param-values.util.js +6 -0
  214. package/dist/utility/wrun/wrun-pin-spelling.util.js +12 -11
  215. package/dist/utility/wrun/wrun-prefix-lanes.util.js +2 -2
  216. package/dist/utility/wrun/wrun-refusal-surface.util.d.ts +50 -0
  217. package/dist/utility/wrun/wrun-refusal-surface.util.js +68 -0
  218. package/dist/utility/wrun/wrun-refusal.util.js +10 -1
  219. package/dist/utility/wrun/wrun-refused-latest.util.d.ts +10 -0
  220. package/dist/utility/wrun/wrun-refused-latest.util.js +12 -0
  221. package/dist/utility/wrun/wrun-row-source.d.ts +11 -0
  222. package/dist/utility/wrun/wrun-run-interval.util.d.ts +4 -2
  223. package/dist/utility/wrun/wrun-run-interval.util.js +9 -6
  224. package/dist/utility/wrun/wrun-script-inputs.util.d.ts +52 -1
  225. package/dist/utility/wrun/wrun-script-inputs.util.js +112 -4
  226. package/dist/utility/wrun/wrun-setting-words.util.d.ts +7 -3
  227. package/dist/utility/wrun/wrun-setting-words.util.js +13 -5
  228. package/dist/utility/wrun/wrun-socket-row-source.d.ts +27 -2
  229. package/dist/utility/wrun/wrun-socket-row-source.js +113 -8
  230. package/dist/utility/wrun/wrun-source-rows.util.d.ts +9 -1
  231. package/dist/utility/wrun/wrun-source-rows.util.js +108 -43
  232. package/dist/utility/wrun/wrun-style-words.util.js +6 -4
  233. package/dist/utility/wrun/wrun-table-chrome.util.d.ts +3 -2
  234. package/dist/utility/wrun/wrun-table-chrome.util.js +19 -11
  235. package/dist/utility/wrun/wrun-tape-per-order.util.d.ts +2 -0
  236. package/dist/utility/wrun/wrun-tape-per-order.util.js +26 -0
  237. package/dist/utility/wrun/wrun-tape-source.util.d.ts +126 -50
  238. package/dist/utility/wrun/wrun-tape-source.util.js +193 -68
  239. package/dist/utility/wrun/wrun-volume-profile-lane.util.d.ts +7 -5
  240. package/dist/utility/wrun/wrun-volume-profile-lane.util.js +8 -6
  241. package/dist/utils/replay/replay-buffer-math.d.ts +53 -2
  242. package/dist/utils/replay/replay-buffer-math.js +227 -20
  243. package/dist/workers/utils/volume-profile.worker.util.d.ts +4 -1
  244. package/dist/workers/utils/volume-profile.worker.util.js +5 -2
  245. package/dist/workers/wrun/wrun-abi-host.js +3 -2
  246. package/package.json +5 -5
@@ -428,13 +428,24 @@ async function wrunSocketRunLevelOf(output, kind) {
428
428
  level.opra = true;
429
429
  else if (kind === 'result')
430
430
  level.opra = false;
431
+ // The receipt of the rows the answer was computed from rides the mark: a tier the reply named, never a guess.
432
+ if (raw.wrunOpra === true && raw.wrunOpraTier !== undefined) {
433
+ level.opraServed = {
434
+ tier: raw.wrunOpraTier,
435
+ ...(raw.wrunOpraDelaySeconds !== undefined ? { delaySeconds: raw.wrunOpraDelaySeconds } : {}),
436
+ };
437
+ }
431
438
  const rows = Array.isArray(raw.diagnostics) ? raw.diagnostics : undefined;
432
439
  if (rows !== undefined && rows.length > 0) {
433
440
  const [{ normalizeRuntimeDiagnostics }, { envelopeWorkerTransportDiagnostics }] = await Promise.all([
434
441
  import('../scriptEditor/wrun-runtime-diagnostics.leaf.js'),
435
442
  wrunChartHostEnv().transport.loadKScriptErrorEnvelope(),
436
443
  ]);
437
- level.diagnostics = envelopeWorkerTransportDiagnostics(normalizeRuntimeDiagnostics(rows), { editorRun: false });
444
+ const diagnostics = envelopeWorkerTransportDiagnostics(normalizeRuntimeDiagnostics(rows), { editorRun: false });
445
+ // The cloud computed these rows over OPRA data when the reply carries the mark (its execution errors can carry
446
+ // what the run computed): each row carries the row mark, so every console export strips it (contract K7).
447
+ level.diagnostics =
448
+ raw.wrunOpra === true ? diagnostics.map((row) => ({ ...row, opra: true })) : diagnostics;
438
449
  }
439
450
  else if (rows !== undefined || kind === 'result') {
440
451
  level.diagnostics = [];
@@ -493,6 +504,7 @@ function runLevelFields(level) {
493
504
  : {}),
494
505
  ...(level.skipped !== undefined ? level.skipped : {}),
495
506
  ...(level.opra !== undefined ? { opra: level.opra } : {}),
507
+ ...(level.opraServed !== undefined ? { opraServed: { ...level.opraServed } } : {}),
496
508
  };
497
509
  }
498
510
  /** A session of the store seeded with the record's sheet, so a reply without one still merges. */
@@ -667,11 +679,22 @@ export class SocketWrunRowSource {
667
679
  merges = Promise.resolve();
668
680
  /** The cells memo: the last cell rows answered and each celled entry's lane rows (`cellRows`). */
669
681
  cells;
682
+ /** The served tier of the OPRA rows the session holds (contract opra-server-lanes C4: the newest receipt that named a
683
+ * tier since the session opened), the one every merge is held to (`servedTierMoved`). */
684
+ retainedTier;
685
+ /** A served-tier move no listener took yet (`dropSessionAtServedTier`): the next subscriber is told first. */
686
+ servedTierMoveOwed;
670
687
  constructor(deps = {}) {
671
688
  this.deps = deps;
672
689
  this.frames = {
673
690
  subscribe: (listener) => {
674
691
  this.listener = listener;
692
+ // A move that landed before anyone listened (a frame between the create's answer and the install's
693
+ // subscribe) reaches the session that installs: it reseeds over the rows that install drew.
694
+ const owed = this.servedTierMoveOwed;
695
+ this.servedTierMoveOwed = undefined;
696
+ if (owed !== undefined)
697
+ this.deliver(owed);
675
698
  return () => {
676
699
  if (this.listener === listener)
677
700
  this.listener = undefined;
@@ -684,7 +707,8 @@ export class SocketWrunRowSource {
684
707
  return this.current;
685
708
  }
686
709
  /** The session's run-level keys as a batch carries them (copies): the newest strategy output and diagnostics a
687
- * result or a live frame carried, whichever merged last, the served legs' warning rows after the diagnostics. */
710
+ * result or a live frame carried, whichever merged last, the served legs' warning rows after the diagnostics, the
711
+ * newest result's OPRA word and the receipt of the newest OPRA rows (a result's or a marked live frame's). */
688
712
  get sessionRunLevel() {
689
713
  return runLevelFields(this.runLevel);
690
714
  }
@@ -725,6 +749,8 @@ export class SocketWrunRowSource {
725
749
  this.answered = [];
726
750
  this.runLevel = {};
727
751
  this.lossesAtOpen = undefined;
752
+ this.retainedTier = undefined;
753
+ this.servedTierMoveOwed = undefined;
728
754
  this.followLive();
729
755
  return this.withLoading(async () => {
730
756
  const page = newestWrunSocketPage(window, this.intervalMs(), this.pageBars());
@@ -855,6 +881,8 @@ export class SocketWrunRowSource {
855
881
  this.answered = [];
856
882
  this.runLevel = {};
857
883
  this.flight = undefined;
884
+ this.retainedTier = undefined;
885
+ this.servedTierMoveOwed = undefined;
858
886
  }
859
887
  /**
860
888
  * A facts-needed note for the overlay this source follows (`routeWrunSocketFactsNeeded`): the ask waiting on the
@@ -1070,6 +1098,12 @@ export class SocketWrunRowSource {
1070
1098
  throw new WrunSocketReplyUnreadable(read.reason);
1071
1099
  const level = await wrunSocketRunLevelOf(output, 'result');
1072
1100
  this.assertCurrent(generation);
1101
+ // A page (or the paging after a patch) the cloud served at another tier than the rows the session holds: none
1102
+ // of them may stand beside it, so the session is dropped and the overlay reseeds; the ask settles superseded.
1103
+ if (freshSheet === undefined && this.servedTierMoved(level)) {
1104
+ this.dropSessionAtServedTier(read.wire.window);
1105
+ throw new WrunSocketRowSourceStopped('superseded');
1106
+ }
1073
1107
  const identity = this.storeIdentity(generation);
1074
1108
  const base = freshSheet !== undefined
1075
1109
  ? seededSession(identity, freshSheet)
@@ -1099,9 +1133,72 @@ export class SocketWrunRowSource {
1099
1133
  ...(skipped !== undefined ? { skipped } : {}),
1100
1134
  // The newest result's OPRA word (every result answers one): a re-plan off OPRA names false.
1101
1135
  ...(level.opra !== undefined ? { opra: level.opra } : {}),
1136
+ // And the receipt of its rows: a result without the mark (or naming no tier) leaves none.
1137
+ ...(level.opraServed !== undefined ? { opraServed: level.opraServed } : {}),
1102
1138
  };
1139
+ if (freshSheet !== undefined)
1140
+ this.retainedTier = undefined;
1141
+ this.retainTier(level);
1103
1142
  });
1104
1143
  }
1144
+ // ── The served tier ──────────────────────────────────────────────────────────────────────────
1145
+ /** A merge's tier joins the session's: the tier the receipt of a marked answer named, when it named one. */
1146
+ retainTier(level) {
1147
+ if (level.opra === true && level.opraServed !== undefined)
1148
+ this.retainedTier = level.opraServed.tier;
1149
+ }
1150
+ /**
1151
+ * Whether an answer moves the session's served tier: it carries the OPRA mark and names a tier, and the rows the
1152
+ * session holds were served at the other one (contract opra-server-lanes C4: the gate re-resolved the owner's tier,
1153
+ * a downgrade or an upgrade). An answer that names no tier moves nothing (its rows read no OPRA yet), nor does a
1154
+ * session whose rows never named one.
1155
+ */
1156
+ servedTierMoved(level) {
1157
+ const tier = level.opra === true ? level.opraServed?.tier : undefined;
1158
+ return tier !== undefined && this.retainedTier !== undefined && tier !== this.retainedTier;
1159
+ }
1160
+ /**
1161
+ * The served tier moved under the session: nothing it holds may stand beside rows served at the new tier (a
1162
+ * real-time prefix under a delayed receipt, or the reverse). Its rows, coverage, owed window, cells and run-level
1163
+ * keys go, the generation moves (an ask on its way settles superseded, a frame merged behind this one is dropped), and
1164
+ * the overlay is told (`WrunRowBatch.servedTierMoved`): it takes what it drew off the chart, ends its live session
1165
+ * and reruns, which creates a fresh session at the tier the cloud serves now. The source never extends a session
1166
+ * across the move.
1167
+ */
1168
+ dropSessionAtServedTier(window) {
1169
+ this.nextGeneration();
1170
+ this.current = undefined;
1171
+ this.answered = [];
1172
+ this.runLevel = {};
1173
+ this.owed = undefined;
1174
+ this.cells = undefined;
1175
+ this.retainedTier = undefined;
1176
+ const frame = {
1177
+ window: { ...window },
1178
+ asOfMs: Number.NaN,
1179
+ rows: [],
1180
+ grids: [],
1181
+ frames: undefined,
1182
+ handles: undefined,
1183
+ refusals: [],
1184
+ servedTierMoved: true,
1185
+ };
1186
+ if (this.listener === undefined)
1187
+ this.servedTierMoveOwed = frame;
1188
+ else
1189
+ this.deliver(frame);
1190
+ }
1191
+ deliver(frame) {
1192
+ const listener = this.listener;
1193
+ if (listener === undefined)
1194
+ return;
1195
+ try {
1196
+ listener(frame);
1197
+ }
1198
+ catch (error) {
1199
+ console.warn('[wrun] socket row source frame listener failed:', error);
1200
+ }
1201
+ }
1105
1202
  /**
1106
1203
  * Page a window until the planner's coverage says done: each round runs the pages still missing,
1107
1204
  * newest first and planned again after each one, through the in-flight registry (or around it, for a
@@ -1308,6 +1405,12 @@ export class SocketWrunRowSource {
1308
1405
  // A frame before the session's first answer (or of a patch not yet answered) has nothing to extend.
1309
1406
  if (this.current?.identity !== identity)
1310
1407
  return;
1408
+ // A frame served at another tier than the rows the session holds never extends them: the session is dropped
1409
+ // and the overlay reseeds (`dropSessionAtServedTier`).
1410
+ if (this.servedTierMoved(level)) {
1411
+ this.dropSessionAtServedTier(read.wire.window);
1412
+ return;
1413
+ }
1311
1414
  const merge = mergeWrunHostedReply(this.current, read.wire, { identity, kind: 'live' }, WRUN_SOCKET_ROW_STORE_UNCAPPED);
1312
1415
  if ('refused' in merge)
1313
1416
  return;
@@ -1319,6 +1422,13 @@ export class SocketWrunRowSource {
1319
1422
  this.runLevel = { ...this.runLevel, diagnostics: level.diagnostics };
1320
1423
  if (level.skipped !== undefined)
1321
1424
  this.runLevel = { ...this.runLevel, skipped: level.skipped };
1425
+ // A frame with the OPRA mark names the receipt of its own rows, the session's newest: its tier, or none (a
1426
+ // frame computed before any OPRA read answered names no tier, and the legend then names none).
1427
+ if (level.opra === true) {
1428
+ const { opraServed: _replaced, ...rest } = this.runLevel;
1429
+ this.runLevel = { ...rest, ...(level.opraServed !== undefined ? { opraServed: level.opraServed } : {}) };
1430
+ }
1431
+ this.retainTier(level);
1322
1432
  this.emitFrame(read.wire, merge, level);
1323
1433
  }).catch((error) => {
1324
1434
  console.warn('[wrun] socket row source live frame skipped:', error);
@@ -1344,12 +1454,7 @@ export class SocketWrunRowSource {
1344
1454
  refusals: session.refusals.map((refusal) => ({ ...refusal })),
1345
1455
  ...runLevelFields({ ...level, servedLegs: this.runLevel.servedLegs }),
1346
1456
  };
1347
- try {
1348
- listener(frame);
1349
- }
1350
- catch (error) {
1351
- console.warn('[wrun] socket row source frame listener failed:', error);
1352
- }
1457
+ this.deliver(frame);
1353
1458
  }
1354
1459
  }
1355
1460
  // ── The one extra ask after a refusal for absent facts ───────────────────────────────────────────
@@ -126,7 +126,11 @@
126
126
  * shared host's cell adapter, side +1 for a buy and -1 for a sell, in the
127
127
  * row's own order, the plan's floor kept (the host plans the tape ask with
128
128
  * `min_size` resolved from the run's settings, `sources.settings`, the floor
129
- * the lane's acquisition was asked at). A primary bar with no row (before the
129
+ * the lane's acquisition was asked at), except where the per-order switch
130
+ * holds (`wrunTapePerOrder`: a CME Group venue, the build flag on), where the
131
+ * lane served every fill of each order that reached the floor and the cells
132
+ * are read whole (the host's per-cell check would drop the small fills of a
133
+ * big order before the package combines them). A primary bar with no row (before the
130
134
  * served history, a quiet bar, a live-edge tape) is a PRESENT EMPTY block; a
131
135
  * bar over the input's `max_cells` refuses by name where the rows are packed
132
136
  * (`wrun_cell_block_too_large`, never truncated). The facets (`min_size`,
@@ -1017,6 +1021,10 @@ export declare function wrunBrowserReadsFeeds(): boolean;
1017
1021
  * must be loaded first (`wrunChartHostEnv().loadSharedHost()`) whenever the flag is on.
1018
1022
  */
1019
1023
  export declare function wrunBrowserRunWireCaps(): string[];
1024
+ /** The celled classes the browser lanes serve by an exact join (intrabar and candles ride legs): each class's inputs
1025
+ * read the one lane its class rides, an unasked one none (`wrunUnaskedCelledInput`; the class guard walks this set,
1026
+ * tests/utility/wrun/wrun-source-rows.lane-demand.spec.ts). */
1027
+ export declare const WRUN_LANE_CELL_CLASSES: ReadonlySet<string>;
1020
1028
  /**
1021
1029
  * The state the aligner holds between builds (the shared host's `WrunInputCarry`): the newest row
1022
1030
  * folded in, each carry input's newest finite value, each forming fold's bucket, each leg's
@@ -126,7 +126,11 @@
126
126
  * shared host's cell adapter, side +1 for a buy and -1 for a sell, in the
127
127
  * row's own order, the plan's floor kept (the host plans the tape ask with
128
128
  * `min_size` resolved from the run's settings, `sources.settings`, the floor
129
- * the lane's acquisition was asked at). A primary bar with no row (before the
129
+ * the lane's acquisition was asked at), except where the per-order switch
130
+ * holds (`wrunTapePerOrder`: a CME Group venue, the build flag on), where the
131
+ * lane served every fill of each order that reached the floor and the cells
132
+ * are read whole (the host's per-cell check would drop the small fills of a
133
+ * big order before the package combines them). A primary bar with no row (before the
130
134
  * served history, a quiet bar, a live-edge tape) is a PRESENT EMPTY block; a
131
135
  * bar over the input's `max_cells` refuses by name where the rows are packed
132
136
  * (`wrun_cell_block_too_large`, never truncated). The facets (`min_size`,
@@ -352,6 +356,8 @@ import { findMonday } from '../chart/titan-constants.pin.js';
352
356
  import { wrunBarSessionFactsResolver, } from '../chart/wrun-bar-session-facts.util.js';
353
357
  import { wrunSettingRefusedMessage } from '../scriptEditor/wrun-runtime-diagnostics.leaf.js';
354
358
  import { attachWrunRefusal, wrunPinFinerSeed } from './wrun-refusal.util.js';
359
+ import { isWrunAskedTapeSource, wrunTapeFloorParamOf } from './wrun-tape-source.util.js';
360
+ import { wrunTapePerOrder } from './wrun-tape-per-order.util.js';
355
361
  import { WRUN_BROWSER_REFUSED_CLASS_CODES } from './wrun-browser-sources.leaf.js';
356
362
  import { wrunProtocolPendingSeed } from './wrun-protocol-pending.util.js';
357
363
  import { planWrunRowLaneInputs, wrunRowLaneCellRows } from './sources/wrun-row-lanes.util.js';
@@ -558,12 +564,14 @@ export function wrunChartGapBarsOf(rows) {
558
564
  export function wrunDemandedSourceClass(source) {
559
565
  return source === undefined || source.undemanded === true ? undefined : source.source;
560
566
  }
561
- /** A leg stream input (`candles`, `oi_candles`, `volume_profile_candles`: wrun-leg-stream-classes) the run's
562
- * sheet on this chart left undemanded (wrunSheetWithLaneGate: its `chart_interval_below` gates the lane off
563
- * on the chart's interval): no leg, no wire, no check, no ask; the row builder hands it a present EMPTY
564
- * block on every row. */
565
- function wrunGatedLegStream(source) {
566
- return isWrunLegStreamClass(source?.source) && source?.undemanded === true;
567
+ /** A celled input the run's sheet on this chart left undemanded: a leg stream (`candles`, `oi_candles`,
568
+ * `volume_profile_candles`: wrun-leg-stream-classes) its `chart_interval_below` gates off on the chart's interval
569
+ * (wrunSheetWithLaneGate), or a tape its `needed_by` leaves the market's size unit out of (wrunSheetWithLaneDemand,
570
+ * kit 0.95.0). No leg, no wire, no check, no ask; the row builder hands it a present EMPTY block on every row (zero
571
+ * cells), never the rows a lane of its class fetched for another input (Big Trades 0.8.0's two tapes ride one tape
572
+ * lane). A row lane keeps its own empty lane (`WrunCellLaneRead`, read before this). */
573
+ function wrunUnaskedCelledInput(input, source) {
574
+ return source?.undemanded === true && (input.cellType === 'array' || isWrunLegStreamClass(source.source));
567
575
  }
568
576
  /**
569
577
  * The row builder's lane an input reads: its source class, except a `trades`
@@ -1341,9 +1349,9 @@ export function planWrunPinnedWires(metadata, chartIntervalMs) {
1341
1349
  };
1342
1350
  for (const input of inputs) {
1343
1351
  const source = metadata.inputSources[input.name];
1344
- // A candles lane gated off on this chart (wrunGatedLegStream) plans nothing, before any check: no
1345
- // leg to fetch, wall-check or re-ask, and never a refusal for its knobs or its cells here.
1346
- if (!source || wrunGatedLegStream(source))
1352
+ // An unasked celled input (a gated candles lane, an unasked tape: wrunUnaskedCelledInput) plans nothing,
1353
+ // before any check: no leg to fetch, wall-check or re-ask, and never a refusal for its knobs or its cells here.
1354
+ if (!source || wrunUnaskedCelledInput(input, source))
1347
1355
  continue;
1348
1356
  const name = input.name;
1349
1357
  if (isWrunLaneStreamClass(source.source)) {
@@ -1909,8 +1917,11 @@ function checkWrunRowReads(metadata, sources, clock, hasRows) {
1909
1917
  }
1910
1918
  }
1911
1919
  // The row lanes (sources/row-lane-registry.ts): each celled input's lane from the static plan (a
1912
- // scalar input and one with no max_cells refuse here), its rows from the instance the run pass
1913
- // planned it into (`sources.rowLanes`; a caller that planned none reads an empty lane).
1920
+ // scalar input, one with no max_cells and a capacity no build writes refuse here), its rows from
1921
+ // the instance the run pass planned it into (`sources.rowLanes`; a caller that planned none reads
1922
+ // an empty lane), and the tuples a bar's block may hold in the run's module, the bound the packer
1923
+ // refuses past (the plan's `capacity`: the sheet's `capacity ?? max_cells`, a print union's whole
1924
+ // only where the capacity holds it).
1914
1925
  const cellLanes = new Map();
1915
1926
  const rowInputs = planWrunRowLaneInputs(metadata);
1916
1927
  if (rowInputs.length > 0) {
@@ -1925,7 +1936,12 @@ function checkWrunRowReads(metadata, sources, clock, hasRows) {
1925
1936
  key: `lane|${instance ?? 'unplanned'}#${planned.inputIndex}`,
1926
1937
  rows: (instance === undefined ? undefined : sources.rowLaneRows?.[instance]) ?? [],
1927
1938
  lane: planned.lane,
1928
- input: { name: planned.inputName, source: planned.source, maxCells: planned.maxCells },
1939
+ input: {
1940
+ name: planned.inputName,
1941
+ source: planned.source,
1942
+ maxCells: planned.maxCells,
1943
+ capacity: planned.capacity,
1944
+ },
1929
1945
  });
1930
1946
  }
1931
1947
  }
@@ -1954,8 +1970,8 @@ function checkWrunRowReads(metadata, sources, clock, hasRows) {
1954
1970
  if (wires.has(input.index) || lanes.has(input.index) || cellLanes.has(input.index))
1955
1971
  continue;
1956
1972
  const source = requireSource(metadata, input.name);
1957
- // A gated candles lane reads its empty block, no lane (wrunGatedLegStream).
1958
- if (wrunGatedLegStream(source))
1973
+ // An unasked celled input reads its empty block, no lane (wrunUnaskedCelledInput).
1974
+ if (wrunUnaskedCelledInput(input, source))
1959
1975
  continue;
1960
1976
  checkWrunLaneRead(metadata, input, source);
1961
1977
  }
@@ -2030,8 +2046,10 @@ function checkWrunLaneRead(metadata, input, source) {
2030
2046
  `(input '${input.name}')`);
2031
2047
  }
2032
2048
  }
2033
- /** The celled classes the browser lanes serve by an exact join (intrabar and candles ride legs). */
2034
- const WRUN_LANE_CELL_CLASSES = new Set([
2049
+ /** The celled classes the browser lanes serve by an exact join (intrabar and candles ride legs): each class's inputs
2050
+ * read the one lane its class rides, an unasked one none (`wrunUnaskedCelledInput`; the class guard walks this set,
2051
+ * tests/utility/wrun/wrun-source-rows.lane-demand.spec.ts). */
2052
+ export const WRUN_LANE_CELL_CLASSES = new Set([
2035
2053
  'book',
2036
2054
  'volume_profile',
2037
2055
  'trade_volume_by_size',
@@ -2110,9 +2128,10 @@ function wrunNeedsChartPrimary(metadata, intervalMs, lanes, sparseGrid) {
2110
2128
  return true;
2111
2129
  return source.interval !== undefined && wrunPinnedIntervalOf(source.interval)?.ms !== intervalMs;
2112
2130
  }
2113
- /** The run's settings the plan reads: the values of the params a tape input's `min_size` names
2114
- * (the floor the lane's acquisition was asked at), and no other (the browser paints every other
2115
- * setting on the sheet), so a sheet without a param-bound floor plans with none, as before. */
2131
+ /** The run's settings the plan reads: the values of the params a tape input's floor (`min_size` or
2132
+ * `min_value`) names (the floor the lane's acquisition was asked at), and no other (the browser
2133
+ * paints every other setting on the sheet), so a sheet without a param-bound floor plans with none,
2134
+ * as before. */
2116
2135
  function wrunTapePlanSettings(metadata, settings) {
2117
2136
  const planned = {};
2118
2137
  if (settings === undefined)
@@ -2123,42 +2142,77 @@ function wrunTapePlanSettings(metadata, settings) {
2123
2142
  }
2124
2143
  return planned;
2125
2144
  }
2126
- /** The params a tape input's `min_size` names: the host resolves that floor itself, from the run's
2127
- * settings (its planTapeFloors), so the plan reads their declarations and their values. */
2145
+ /** The params an asked tape input's floor (`min_size` or `min_value`) names: the host resolves that
2146
+ * floor itself, from the run's settings (its planTapeFloors), so the plan reads their declarations
2147
+ * and their values. An unasked tape (`isWrunAskedTapeSource`) is planned as no tape at all. */
2128
2148
  function wrunTapeFloorParams(metadata) {
2129
2149
  const names = new Set();
2130
2150
  for (const source of Object.values(metadata.inputSources)) {
2131
- if (source?.source === 'tape' && typeof source.min_size === 'string')
2132
- names.add(source.min_size);
2151
+ if (!isWrunAskedTapeSource(source))
2152
+ continue;
2153
+ const paramName = wrunTapeFloorParamOf(source);
2154
+ if (paramName !== undefined)
2155
+ names.add(paramName);
2133
2156
  }
2134
2157
  return names;
2135
2158
  }
2159
+ /**
2160
+ * A tape source as the shared host plans it: a dollar floor (`min_value`, C-DOLLAR) as the kit's tape floor facet
2161
+ * (`min_size`) over the same param or literal. The kit's tape class compares each cell's size column with its floor,
2162
+ * whatever the unit (its cell adapter keeps `size >= floor`), and the browser lane serves a dollar tape's cells sized
2163
+ * by their dollar value (k-trades.worker, the live fold's `tradesTapeCellSize`), so the floor and the column it reads
2164
+ * are one unit there. The installed kit (0.91.1) declares no `min_value` facet and refuses a tape without its own
2165
+ * floor; this is the browser lane's own plan input, never the package's sheet. A raw floor plans as declared.
2166
+ */
2167
+ /**
2168
+ * A source as the shared host plans it, without `needed_by` (kit 0.72.0, and on a secondary tape kit 0.95.0): the
2169
+ * browser's demand verdict is the run's only one (wrunSheetWithLaneDemand on the chart's own market: an input it left
2170
+ * undemanded reads its fill or an empty block, wrunUnaskedCelledInput, and one it asked is asked). The host reads the
2171
+ * word against its own size unit of the run market (`hostFills`), which the plan never carries (its market is the
2172
+ * placeholder, unit 0), so a list without 0 read there dropped an input the browser asked: a coins-only liquidations
2173
+ * lane read NaN on BTCUSDT with its rows fetched, and Big Trades 0.8.0's contracts tape would read zero cells on CME.
2174
+ */
2175
+ function wrunPlannedWithoutDemandWord(source) {
2176
+ if (source.needed_by === undefined)
2177
+ return source;
2178
+ const { needed_by: _decided, ...planned } = source;
2179
+ return planned;
2180
+ }
2181
+ function wrunPlannedTapeSource(source) {
2182
+ if (source.min_value === undefined || source.min_size !== undefined)
2183
+ return source;
2184
+ const { min_value: minValue, ...rest } = source;
2185
+ return { ...rest, min_size: minValue };
2186
+ }
2136
2187
  /**
2137
2188
  * The sheet the shared host plans for one build: every lane read (`WrunLaneRead`) as the lane
2138
2189
  * stand-in under its own missing policy, save a published feed's, planned as the kit's own series
2139
2190
  * wire (`wrunPlannedSeriesRead`: the host's rule e then carries the lane's pre-window bar), every
2140
- * stamp read (`wrunStampReads`) as an `open` read, a candles lane gated off on this chart
2141
- * (`wrunGatedLegStream`) as a cell-less NaN stand-in, and, when input 0 is no host primary, the
2142
- * chart's close prepended as input 0 (every declared input one index later). The sheet's
2143
- * presentation families and params stay out: the browser delivers its own families, and the pins
2144
- * the params set are already painted on the inputs (wrunSheetWithSettings). The one exception is a
2145
- * param a tape input's `min_size` names, which the plan resolves from the run's settings
2146
- * (`wrunTapeFloorParams`).
2191
+ * stamp read (`wrunStampReads`) as an `open` read, an unasked celled input (a candles lane gated off
2192
+ * on this chart, a tape the market does not ask: `wrunUnaskedCelledInput`) as a cell-less NaN
2193
+ * stand-in, and, when input 0 is no host primary, the chart's close prepended as input 0 (every
2194
+ * declared input one index later). No source carries `needed_by` (wrunPlannedWithoutDemandWord: the
2195
+ * browser's demand verdict is the run's one). The sheet's presentation families and params stay out:
2196
+ * the browser delivers its own families, and the pins the params set are already painted on the
2197
+ * inputs (wrunSheetWithSettings). The one exception is a param an asked tape input's floor names,
2198
+ * which the plan resolves from the run's settings (`wrunTapeFloorParams`).
2147
2199
  */
2148
2200
  function wrunPlannedSheet(metadata, lanes, stamps, shift, cellLanes = new Map()) {
2149
2201
  const inputSources = {};
2150
2202
  for (const input of metadata.inputs) {
2151
- const source = metadata.inputSources[input.name];
2152
- if (source === undefined)
2203
+ const declared = metadata.inputSources[input.name];
2204
+ if (declared === undefined)
2153
2205
  continue;
2206
+ // The host never reads the demand word: the browser decided it on the chart's own market.
2207
+ const source = wrunPlannedWithoutDemandWord(declared);
2154
2208
  if (cellLanes.has(input.index)) {
2155
2209
  // A row-lane read: the celled stand-in, its wire re-pointed at the lane's own blocks below.
2156
2210
  inputSources[input.name] = { ...WRUN_ROWS_CELL_LANE_STAND_IN };
2157
2211
  }
2158
- else if (wrunGatedLegStream(source)) {
2159
- // A gated candles lane is planned as a scalar stand-in (its cells dropped below) and read as the
2212
+ else if (wrunUnaskedCelledInput(input, source)) {
2213
+ // An unasked celled input is planned as a scalar stand-in (its cells dropped below) and read as the
2160
2214
  // plan's unserved wire, the NaN placeholder of a celled slot: the host never plans, checks or
2161
- // asks its leg, and the browser hands it an empty block on every row (wrunBrowserRowsOf).
2215
+ // asks its leg or its cells, and the browser hands it an empty block on every row (wrunBrowserRowsOf).
2162
2216
  inputSources[input.name] = { ...WRUN_ROWS_LANE_STAND_IN, missing: 'nan' };
2163
2217
  }
2164
2218
  else if (lanes.has(input.index)) {
@@ -2173,12 +2227,15 @@ function wrunPlannedSheet(metadata, lanes, stamps, shift, cellLanes = new Map())
2173
2227
  else if (stamps.has(input.index)) {
2174
2228
  inputSources[input.name] = { ...source, field: 'open' };
2175
2229
  }
2230
+ else if (source.source === 'tape') {
2231
+ inputSources[input.name] = wrunPlannedTapeSource(source);
2232
+ }
2176
2233
  else {
2177
2234
  inputSources[input.name] = source;
2178
2235
  }
2179
2236
  }
2180
2237
  const inputs = metadata.inputs.map((input) => {
2181
- const planned = wrunGatedLegStream(metadata.inputSources[input.name])
2238
+ const planned = !cellLanes.has(input.index) && wrunUnaskedCelledInput(input, metadata.inputSources[input.name])
2182
2239
  ? { index: input.index, name: input.name }
2183
2240
  : input;
2184
2241
  return shift === 0 ? planned : { ...planned, index: planned.index + 1 };
@@ -2409,9 +2466,9 @@ function wrunHostRunOf(metadata, sources, clock, cellsAfterTs) {
2409
2466
  const cellLegKeys = new Map();
2410
2467
  const softRefused = new Set();
2411
2468
  // The inputs this market does not need (wrunSheetWithLaneDemand: their needed_by leaves it out), and
2412
- // the candles lanes gated off on this chart (wrunSheetWithLaneGate, planned as a scalar stand-in): no
2413
- // lane was asked for them, so each scalar read is the plan's unserved wire, its fill on every row,
2414
- // never gating.
2469
+ // the candles lanes gated off on this chart (wrunSheetWithLaneGate): no lane was asked for them, so
2470
+ // each scalar read is the plan's unserved wire, its fill on every row, never gating, and each celled
2471
+ // one (planned as a scalar stand-in, wrunUnaskedCelledInput) reads its empty block (`emptyBlocks`).
2415
2472
  const undemanded = new Set(metadata.inputs
2416
2473
  .filter((input) => metadata.inputSources[input.name]?.undemanded === true)
2417
2474
  .map((input) => input.index));
@@ -2623,8 +2680,16 @@ function wrunHostRunOf(metadata, sources, clock, cellsAfterTs) {
2623
2680
  ? sources.tapeRows
2624
2681
  : sources.optionsChainRows;
2625
2682
  // The browser's book lane is asked at the sheet's depth already: its rows are read whole. The
2626
- // tape keeps the plan's floor (the one its lane was asked at, from the run's settings).
2627
- const adapted = ask.class === 'book' ? { ...ask, max_depth: undefined } : ask;
2683
+ // tape keeps the plan's floor (the one its lane was asked at, from the run's settings), except where
2684
+ // the per-order switch holds (wrunTapePerOrder: a CME Group venue, the build flag on): its lane served
2685
+ // every fill of each order that reached the floor (the history read's per-order floor, the per-order
2686
+ // live fold), so its rows are read whole too. The host's per-cell check there drew a 147-contract NQZ6
2687
+ // buy of 45 fills as its two 17-lot fills, the fills dropped one by one before "Combine fills" saw them.
2688
+ const adapted = ask.class === 'book'
2689
+ ? { ...ask, max_depth: undefined }
2690
+ : ask.class === 'tape' && wrunTapePerOrder(gridMarket?.exchange)
2691
+ ? { ...ask, min_size: undefined, min_value: undefined }
2692
+ : ask;
2628
2693
  // Past the carry only (`cellsAfterTs`), except the options chain: the live row reads its newest poll, however old.
2629
2694
  const rows = wrunPlainLaneRows(cellsAfterTs === undefined || source.source === 'options_chain'
2630
2695
  ? (lane ?? [])
@@ -2745,7 +2810,7 @@ function wrunHostRunOf(metadata, sources, clock, cellsAfterTs) {
2745
2810
  ...(reads.barFacts !== undefined ? { barFacts: reads.barFacts } : {}),
2746
2811
  };
2747
2812
  const emptyBlocks = metadata.inputs
2748
- .filter((input) => wrunGatedLegStream(metadata.inputSources[input.name]))
2813
+ .filter((input) => !reads.cellLanes.has(input.index) && wrunUnaskedCelledInput(input, metadata.inputSources[input.name]))
2749
2814
  .map((input) => input.index);
2750
2815
  return { plan, sources: answered, clock: hostClock, shift, stamps, emptyBlocks };
2751
2816
  }
@@ -326,9 +326,11 @@ function wrunAuto(abs, decimals) {
326
326
  return wrunGrouped(fixed.indexOf(".") < 0 ? fixed : fixed.replace(/\.?0+$/, ""));
327
327
  }
328
328
  // prettier-ignore
329
- function wrunScaled(abs, decimals) {
329
+ function wrunScaled(abs, decimals, trimZeros) {
330
330
  const small = abs.toFixed(decimals ?? 2);
331
- return Number(small) < 1000 ? small : wrunCompact(Math.max(abs, 1000), decimals ?? 1);
331
+ if (Number(small) >= 1000)
332
+ return wrunCompact(Math.max(abs, 1000), decimals ?? 1);
333
+ return trimZeros && decimals === undefined ? small.replace(/\.?0+$/, "") : small;
332
334
  }
333
335
  /** Prints one number the way its surface declared (format, decimals,
334
336
  * signed, unit, priceDigits). Without a format: today's card text
@@ -370,11 +372,11 @@ export function formatWrunNumber(value, spec = {}) {
370
372
  suffix = "%";
371
373
  break;
372
374
  case "si":
373
- body = wrunScaled(abs, decimals);
375
+ body = wrunScaled(abs, decimals, true);
374
376
  break;
375
377
  case "usd":
376
378
  prefix = "$";
377
- body = wrunScaled(abs, decimals);
379
+ body = wrunScaled(abs, decimals, false);
378
380
  break;
379
381
  case "auto":
380
382
  body = wrunAuto(abs, decimals);
@@ -56,8 +56,9 @@
56
56
  * kscript-drawing-safe-area.util), the tags from titan's own main settings
57
57
  * (`showHighLowLabel`, which every axis toggle and tape mode write). One
58
58
  * tracker per chart caches the boxes, so a live tick never forces a layout,
59
- * and follows them: rows resizing, coming and going, the legend section's
60
- * padding and size, the bar. When that moves a mounted table, the
59
+ * and follows them: rows resizing, coming and going, a host row mounting or
60
+ * moving (the quick-trade pill), the legend section's padding and size, the
61
+ * bar. When that moves a mounted table, the
61
62
  * overlay's last result is placed again and handed back to its lane's
62
63
  * re-apply (the adapter's mounted-row refresh), so a table follows the legend
63
64
  * on a chart without ticks too; the legend edge follows the plot's width.
@@ -56,13 +56,14 @@
56
56
  * kscript-drawing-safe-area.util), the tags from titan's own main settings
57
57
  * (`showHighLowLabel`, which every axis toggle and tape mode write). One
58
58
  * tracker per chart caches the boxes, so a live tick never forces a layout,
59
- * and follows them: rows resizing, coming and going, the legend section's
60
- * padding and size, the bar. When that moves a mounted table, the
59
+ * and follows them: rows resizing, coming and going, a host row mounting or
60
+ * moving (the quick-trade pill), the legend section's padding and size, the
61
+ * bar. When that moves a mounted table, the
61
62
  * overlay's last result is placed again and handed back to its lane's
62
63
  * re-apply (the adapter's mounted-row refresh), so a table follows the legend
63
64
  * on a chart without ticks too; the legend edge follows the plot's width.
64
65
  */
65
- import { legendPaneOf, legendRowsOf, measureLegendBox } from '../chart/kscript-drawing-safe-area.util.js';
66
+ import { legendPaneOf, legendRowsOf, measureLegendBox, observeLegendHostRows, } from '../chart/kscript-drawing-safe-area.util.js';
66
67
  /** Air between the chrome and the table. */
67
68
  export const WRUN_TABLE_CHROME_GAP_PX = 8;
68
69
  /** The engine's own inset from the anchored corner (TextPlot `Table`). */
@@ -468,8 +469,13 @@ function startTracker(tc) {
468
469
  return tracker;
469
470
  const refresh = () => followChrome(tc, tracker);
470
471
  const sizes = new ResizeObserver(refresh);
472
+ let rows = null;
471
473
  // The section itself (its padding follows the host rows and the compare
472
- // strip), every legend row, the host rows and the action bar.
474
+ // strip), every legend row, the host rows and the action bar. Rows come and
475
+ // go with the indicators (direct children of the legend section), and a host
476
+ // row comes, goes and moves without resizing (the quick-trade pill, a child
477
+ // of the cell riding its inline `top`): re-watch, re-measure, so a top_left
478
+ // table re-seats under the pill when it mounts or moves.
473
479
  const watch = () => {
474
480
  sizes.disconnect();
475
481
  sizes.observe(pane.plot);
@@ -478,18 +484,20 @@ function startTracker(tc) {
478
484
  const bar = pane.root.querySelector(ACTION_BAR_SELECTOR);
479
485
  if (bar)
480
486
  sizes.observe(bar);
487
+ if (!rows)
488
+ return;
489
+ rows.disconnect();
490
+ rows.observe(pane.plot, { childList: true });
491
+ observeLegendHostRows(rows, pane);
481
492
  };
482
- watch();
483
- // Rows come and go with the indicators (direct children of the legend section): re-watch, re-measure.
484
- const rows = typeof MutationObserver === 'function'
485
- ? new MutationObserver(() => {
493
+ if (typeof MutationObserver === 'function')
494
+ rows = new MutationObserver(() => {
486
495
  if (trackers.get(tc) !== tracker)
487
496
  return;
488
497
  watch();
489
498
  refresh();
490
- })
491
- : null;
492
- rows?.observe(pane.plot, { childList: true });
499
+ });
500
+ watch();
493
501
  tracker.stop = () => {
494
502
  sizes.disconnect();
495
503
  rows?.disconnect();
@@ -0,0 +1,2 @@
1
+ /** Whether a tape on `exchange` is judged per aggressor order (above). */
2
+ export declare function wrunTapePerOrder(exchange: unknown): boolean;