@orangecharts/wrun-chart-host 0.9.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 (170) hide show
  1. package/README.md +1 -0
  2. package/dist/constants/feature-flags.constants.d.ts +6 -1
  3. package/dist/constants/feature-flags.constants.js +67 -24
  4. package/dist/constants/opra-compliance.constants.d.ts +3 -2
  5. package/dist/constants/opra-compliance.constants.js +3 -2
  6. package/dist/constants/scriptEditor/builtin-script-snippets.d.ts +26 -0
  7. package/dist/constants/scriptEditor/builtin-script-snippets.js +6 -0
  8. package/dist/constants/scriptEditor/technicalIndicatorScriptKeys.constants.d.ts +15 -0
  9. package/dist/constants/scriptEditor/technicalIndicatorScriptKeys.constants.js +17 -0
  10. package/dist/constants/venue-presets.constants.d.ts +20 -20
  11. package/dist/constants/venue-presets.constants.js +24 -26
  12. package/dist/host-env.d.ts +29 -5
  13. package/dist/host-env.js +6 -0
  14. package/dist/host-ports.types.d.ts +69 -15
  15. package/dist/index.d.ts +13 -0
  16. package/dist/index.js +13 -0
  17. package/dist/interfaces/kscript-diagnostics.interface.d.ts +6 -0
  18. package/dist/interfaces/replay.interface.d.ts +8 -0
  19. package/dist/interfaces/wrun-runtime.interface.d.ts +18 -2
  20. package/dist/kscript-data/controls/live-trades-merge.util.d.ts +41 -4
  21. package/dist/kscript-data/controls/live-trades-merge.util.js +52 -7
  22. package/dist/kscript-data/controls/live-trades-order-gate.util.d.ts +56 -0
  23. package/dist/kscript-data/controls/live-trades-order-gate.util.js +107 -0
  24. package/dist/market-data/billing.interface.d.ts +95 -31
  25. package/dist/market-data/billing.interface.js +36 -5
  26. package/dist/market-data/venue.d.ts +88 -6
  27. package/dist/market-data/venues/cme.contract.copy.json +66 -0
  28. package/dist/market-data/venues/cme.d.ts +126 -0
  29. package/dist/market-data/venues/cme.js +133 -0
  30. package/dist/market-data/venues/index.d.ts +162 -5
  31. package/dist/market-data/venues/index.js +48 -6
  32. package/dist/settings-templates/index.js +7 -3
  33. package/dist/settings-templates/indicator-fields.d.ts +5 -4
  34. package/dist/settings-templates/indicator-fields.js +45 -6
  35. package/dist/settings-templates/tool-rules.d.ts +27 -17
  36. package/dist/settings-templates/tool-rules.js +27 -11
  37. package/dist/settings-templates/tool-tables.generated.js +91 -31
  38. package/dist/utility/chart/book-live-bucket.util.d.ts +15 -0
  39. package/dist/utility/chart/book-live-bucket.util.js +47 -0
  40. package/dist/utility/chart/index-mode-admission.util.js +15 -2
  41. package/dist/utility/chart/kscript-drawing-safe-area.util.d.ts +35 -11
  42. package/dist/utility/chart/kscript-drawing-safe-area.util.js +145 -35
  43. package/dist/utility/chart/kscript-live-coalesce.util.d.ts +7 -2
  44. package/dist/utility/chart/kscript-live-coalesce.util.js +9 -3
  45. package/dist/utility/chart/kscript-provenance-keys.util.js +6 -0
  46. package/dist/utility/chart/kscript-standin-identity.leaf.d.ts +3 -1
  47. package/dist/utility/chart/kscript-titancharts-render-keys.constants.d.ts +32 -2
  48. package/dist/utility/chart/kscript-titancharts-render-keys.constants.js +45 -0
  49. package/dist/utility/chart/kscript-venue-policy.util.d.ts +54 -35
  50. package/dist/utility/chart/kscript-venue-policy.util.js +78 -42
  51. package/dist/utility/chart/market-session-schedule.util.d.ts +10 -0
  52. package/dist/utility/chart/market-session-schedule.util.js +16 -0
  53. package/dist/utility/chart/opra-read-access.leaf.d.ts +5 -3
  54. package/dist/utility/chart/opra-read-access.leaf.js +5 -3
  55. package/dist/utility/chart/rth-session.util.d.ts +3 -2
  56. package/dist/utility/chart/rth-session.util.js +2 -1
  57. package/dist/utility/chart/window-geometry.leaf.d.ts +8 -0
  58. package/dist/utility/chart/window-geometry.leaf.js +22 -6
  59. package/dist/utility/chart/wrun-run-result.util.d.ts +12 -0
  60. package/dist/utility/chart/wrun-run-result.util.js +141 -6
  61. package/dist/utility/options/option-bar-anchor.util.d.ts +145 -0
  62. package/dist/utility/options/option-bar-anchor.util.js +340 -0
  63. package/dist/utility/options/option-venue.util.d.ts +18 -0
  64. package/dist/utility/options/option-venue.util.js +27 -0
  65. package/dist/utility/scriptEditor/wrun-runtime-diagnostics.leaf.js +2 -0
  66. package/dist/utility/wrun/derived-roots.util.d.ts +213 -0
  67. package/dist/utility/wrun/derived-roots.util.js +471 -0
  68. package/dist/utility/wrun/run-schedule/wrun-chart-gate-reader.util.d.ts +41 -6
  69. package/dist/utility/wrun/run-schedule/wrun-chart-gate-reader.util.js +89 -19
  70. package/dist/utility/wrun/run-schedule/wrun-gate-reader-warm.util.d.ts +9 -4
  71. package/dist/utility/wrun/run-schedule/wrun-gate-reader-warm.util.js +47 -6
  72. package/dist/utility/wrun/run-schedule/wrun-late-reads.util.d.ts +4 -2
  73. package/dist/utility/wrun/run-schedule/wrun-late-reads.util.js +4 -2
  74. package/dist/utility/wrun/sources/lanes/option_daily.js +5 -2
  75. package/dist/utility/wrun/sources/lanes/options_flow.js +5 -2
  76. package/dist/utility/wrun/sources/opra-option-lanes.util.d.ts +64 -19
  77. package/dist/utility/wrun/sources/opra-option-lanes.util.js +105 -35
  78. package/dist/utility/wrun/sources/row-lanes/option_contract_flow.js +2 -1
  79. package/dist/utility/wrun/sources/row-lanes/option_contract_state.js +2 -1
  80. package/dist/utility/wrun/sources/row-lanes/option_prints.d.ts +3 -0
  81. package/dist/utility/wrun/sources/row-lanes/option_prints.js +19 -4
  82. package/dist/utility/wrun/sources/row-lanes/option_strike_flow.js +17 -4
  83. package/dist/utility/wrun/sources/row-lanes/option_strikes.d.ts +52 -13
  84. package/dist/utility/wrun/sources/row-lanes/option_strikes.js +88 -19
  85. package/dist/utility/wrun/sources/row-lanes/option_surface.js +2 -1
  86. package/dist/utility/wrun/sources/wrun-poll-lane.types.d.ts +19 -0
  87. package/dist/utility/wrun/sources/wrun-poll-lanes.util.d.ts +24 -9
  88. package/dist/utility/wrun/sources/wrun-poll-lanes.util.js +39 -10
  89. package/dist/utility/wrun/sources/wrun-row-lane-add-memo.util.d.ts +64 -0
  90. package/dist/utility/wrun/sources/wrun-row-lane-add-memo.util.js +89 -0
  91. package/dist/utility/wrun/sources/wrun-row-lane-first-paint.util.d.ts +15 -3
  92. package/dist/utility/wrun/sources/wrun-row-lane-first-paint.util.js +22 -3
  93. package/dist/utility/wrun/sources/wrun-row-lane.types.d.ts +31 -0
  94. package/dist/utility/wrun/sources/wrun-row-lanes.util.d.ts +174 -13
  95. package/dist/utility/wrun/sources/wrun-row-lanes.util.js +685 -27
  96. package/dist/utility/wrun/wrun-builtin-twin.util.d.ts +12 -0
  97. package/dist/utility/wrun/wrun-builtin-twin.util.js +21 -0
  98. package/dist/utility/wrun/wrun-chart-market-facts.util.d.ts +53 -12
  99. package/dist/utility/wrun/wrun-chart-market-facts.util.js +101 -53
  100. package/dist/utility/wrun/wrun-download-meter.util.d.ts +15 -0
  101. package/dist/utility/wrun/wrun-download-meter.util.js +14 -2
  102. package/dist/utility/wrun/wrun-download-plan.util.d.ts +99 -0
  103. package/dist/utility/wrun/wrun-download-plan.util.js +118 -0
  104. package/dist/utility/wrun/wrun-draft-legend-note.util.d.ts +11 -3
  105. package/dist/utility/wrun/wrun-draft-legend-note.util.js +26 -4
  106. package/dist/utility/wrun/wrun-frames.d.ts +27 -6
  107. package/dist/utility/wrun/wrun-frames.js +73 -10
  108. package/dist/utility/wrun/wrun-hosted-wire.util.d.ts +7 -1
  109. package/dist/utility/wrun/wrun-hosted-wire.util.js +12 -2
  110. package/dist/utility/wrun/wrun-hud-looks.util.d.ts +18 -4
  111. package/dist/utility/wrun/wrun-hud-looks.util.js +45 -13
  112. package/dist/utility/wrun/wrun-latest-snapshot.d.ts +11 -0
  113. package/dist/utility/wrun/wrun-live-intake.util.d.ts +13 -7
  114. package/dist/utility/wrun/wrun-live-intake.util.js +82 -29
  115. package/dist/utility/wrun/wrun-live-tick.util.d.ts +4 -0
  116. package/dist/utility/wrun/wrun-live-tick.util.js +158 -14
  117. package/dist/utility/wrun/wrun-market-size-defaults.leaf.d.ts +49 -10
  118. package/dist/utility/wrun/wrun-market-size-defaults.leaf.js +65 -5
  119. package/dist/utility/wrun/wrun-market-size-defaults.util.js +31 -5
  120. package/dist/utility/wrun/wrun-opra-lane.util.d.ts +17 -4
  121. package/dist/utility/wrun/wrun-opra-lane.util.js +6 -4
  122. package/dist/utility/wrun/wrun-option-strike-flow-forecast.util.d.ts +31 -0
  123. package/dist/utility/wrun/wrun-option-strike-flow-forecast.util.js +119 -0
  124. package/dist/utility/wrun/wrun-option-strike-flow-lane.util.d.ts +23 -6
  125. package/dist/utility/wrun/wrun-option-strike-flow-lane.util.js +47 -11
  126. package/dist/utility/wrun/wrun-option-strike-flow.util.d.ts +86 -19
  127. package/dist/utility/wrun/wrun-option-strike-flow.util.js +168 -62
  128. package/dist/utility/wrun/wrun-option-views.util.d.ts +47 -13
  129. package/dist/utility/wrun/wrun-option-views.util.js +98 -26
  130. package/dist/utility/wrun/wrun-output-style.util.d.ts +6 -2
  131. package/dist/utility/wrun/wrun-output-style.util.js +20 -2
  132. package/dist/utility/wrun/wrun-overlay-drivers.util.d.ts +17 -0
  133. package/dist/utility/wrun/wrun-overlay-lifecycle.util.d.ts +10 -1
  134. package/dist/utility/wrun/wrun-overlay-lifecycle.util.js +52 -4
  135. package/dist/utility/wrun/wrun-overlay-run.util.d.ts +100 -31
  136. package/dist/utility/wrun/wrun-overlay-run.util.js +733 -114
  137. package/dist/utility/wrun/wrun-pane-format.util.d.ts +2 -1
  138. package/dist/utility/wrun/wrun-pane-format.util.js +7 -3
  139. package/dist/utility/wrun/wrun-panel-mount.util.d.ts +9 -0
  140. package/dist/utility/wrun/wrun-panel-mount.util.js +63 -13
  141. package/dist/utility/wrun/wrun-panel-style.util.d.ts +10 -9
  142. package/dist/utility/wrun/wrun-panel-style.util.js +58 -9
  143. package/dist/utility/wrun/wrun-param-map.util.d.ts +14 -11
  144. package/dist/utility/wrun/wrun-param-map.util.js +10 -5
  145. package/dist/utility/wrun/wrun-param-values.util.d.ts +14 -4
  146. package/dist/utility/wrun/wrun-param-values.util.js +4 -0
  147. package/dist/utility/wrun/wrun-pin-spelling.util.js +12 -11
  148. package/dist/utility/wrun/wrun-refusal-surface.util.d.ts +50 -0
  149. package/dist/utility/wrun/wrun-refusal-surface.util.js +68 -0
  150. package/dist/utility/wrun/wrun-refused-latest.util.d.ts +10 -0
  151. package/dist/utility/wrun/wrun-refused-latest.util.js +12 -0
  152. package/dist/utility/wrun/wrun-row-source.d.ts +11 -0
  153. package/dist/utility/wrun/wrun-run-interval.util.d.ts +4 -2
  154. package/dist/utility/wrun/wrun-run-interval.util.js +9 -6
  155. package/dist/utility/wrun/wrun-script-inputs.util.d.ts +45 -1
  156. package/dist/utility/wrun/wrun-script-inputs.util.js +112 -4
  157. package/dist/utility/wrun/wrun-setting-words.util.d.ts +7 -3
  158. package/dist/utility/wrun/wrun-setting-words.util.js +13 -5
  159. package/dist/utility/wrun/wrun-socket-row-source.d.ts +27 -2
  160. package/dist/utility/wrun/wrun-socket-row-source.js +113 -8
  161. package/dist/utility/wrun/wrun-source-rows.util.d.ts +5 -1
  162. package/dist/utility/wrun/wrun-source-rows.util.js +16 -3
  163. package/dist/utility/wrun/wrun-style-words.util.js +6 -4
  164. package/dist/utility/wrun/wrun-table-chrome.util.d.ts +3 -2
  165. package/dist/utility/wrun/wrun-table-chrome.util.js +19 -11
  166. package/dist/utility/wrun/wrun-tape-per-order.util.d.ts +2 -0
  167. package/dist/utility/wrun/wrun-tape-per-order.util.js +26 -0
  168. package/dist/utils/replay/replay-buffer-math.d.ts +53 -2
  169. package/dist/utils/replay/replay-buffer-math.js +227 -20
  170. package/package.json +11 -11
@@ -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,10 @@ 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';
43
47
  import type { WrunMissingFeed } from '../wrun-run-health.util.js';
44
- import { type WrunHostGridAsk } from '../wrun-tier-grid.util.js';
48
+ import type { WrunLaneDownloadMeter } from '../wrun-download-plan.util.js';
49
+ import { type WrunBackendTier, type WrunHostGridAsk } from '../wrun-tier-grid.util.js';
45
50
  /** One input of a row-lane class under the static plan. */
46
51
  export interface WrunRowLaneInput {
47
52
  inputIndex: number;
@@ -83,12 +88,13 @@ export interface WrunRowLaneChart {
83
88
  /** A crypto venue (the refusal's words). */
84
89
  isCryptoVenueExchange?: (exchange: string) => boolean;
85
90
  /** 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;
91
+ * contract chart, a stock twin reading its stock's chain: `governedOptionPlane(metadata) === 'opra'` over the chart
92
+ * market's exchange and symbol, either spelling of the stock venue). */
93
+ isOpraPlaneExchange?: (exchange: string, symbol: string) => boolean;
88
94
  /** Why a chart off the plane is off it although its options list on OPRA (opra-options-gate.util
89
95
  * `opraOptionPlaneStop`: the flag check's `flag-off`, the plane router's `chart-kind`); absent, the market's own
90
96
  * words. */
91
- opraPlaneStop?: (exchange: string) => OpraOptionPlaneStop | undefined;
97
+ opraPlaneStop?: (exchange: string, symbol: string) => OpraOptionPlaneStop | undefined;
92
98
  }
93
99
  /** The run's plan of its row lanes: the instances to fetch, and the feeds the chart never serves to inputs that
94
100
  * declared `missing: "empty"` (one entry per lane key). */
@@ -115,7 +121,9 @@ export interface WrunRowLanePlan {
115
121
  * 3. the lane's identity, once per lane (the first admitted input's context names a refusal), then the input's
116
122
  * facets (awaited, in declaration order), each knob naming a setting first read as the setting's current value
117
123
  * (`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
124
+ * (`WrunRowLanePlanFacts`); the instance is the identity and the facets together. An input naming another root
125
+ * (contract F's `underlying`, `planWrunRowLaneUnderlying`) is planned against that root's market instead, its
126
+ * identity once per lane and market. A lane with
119
127
  * `acquisitions: 'one'` refuses a second input whose acquisition differs (one fetch, one live fold per package). A
120
128
  * chart with no option chain (an identity or facets refusal seeded `no-options` / `chain`, `wrunLaneNoChainRefusal`:
121
129
  * 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 +136,11 @@ export declare function planWrunRowLanes(metadata: WrunIndicatorMetadata, chart:
128
136
  * `wrunParamValuesFromSettings` over the overlay's settings; absent: a knob naming a setting is refused by name). */
129
137
  export interface WrunRowLaneRunFacts extends OpraReadFacts {
130
138
  paramValues?: Readonly<Record<string, number>>;
139
+ /** The run's one options decision (derived-roots.util `decideWrunRunOptionsMarket`, taken at its head): every chain
140
+ * lane's input on the chart it was taken for carries it (wrun-poll-lanes.util `wrunChainLaneContext`), so its chain
141
+ * resolves under the decided plane, and a stock twin's input is planned against the twin's lane market. Absent: the
142
+ * plane is read when the chain resolves. */
143
+ options?: WrunRunOptionsMarket;
131
144
  }
132
145
  /**
133
146
  * What the planner hands an input's facets beside the chart (on its context):
@@ -199,7 +212,38 @@ export interface WrunRowLaneWindow {
199
212
  * lane's slice so the slice holds whole sessions (wrun-row-lane-first-paint.util `wrunRowLaneFirstPaintSplit`): a
200
213
  * first paint's asks and a later run's are the same windows. Absent: the plain cut, and no early answer. */
201
214
  tradeDateOf?: (barOpenMs: number) => number;
215
+ /**
216
+ * A replay's cursor (wrun-replay-lane.util `WrunReplayRunPlan.cutoffTs`, a replay step's newest revealed bar): a flow
217
+ * or snapshot lane's window ends at that bar (`wrunRowLaneWindowAtReplayCursor`), so no bar after it is asked and a
218
+ * per-bar source shows its board, prints and flow as of the cursor; the read keeps a replay memo of what it landed
219
+ * whole (`fetchWrunRowLaneRows`), so a later read of the same lane asks only the bars it lacks. Absent (every read but
220
+ * a replay's): the whole window.
221
+ */
222
+ replayCursorMs?: number;
202
223
  }
224
+ /** A row lane's window bounded at a replay cursor (`WrunRowLaneWindow.replayCursorMs`): a flow or snapshot lane's bars
225
+ * opening after the cursor are left out; a `latest` lane (the live row's snapshot), and a window naming no cursor,
226
+ * as they are. */
227
+ export declare function wrunRowLaneWindowAtReplayCursor(lane: Pick<WrunRowLaneDescriptor, 'landing'>, window: WrunRowLaneWindow): WrunRowLaneWindow;
228
+ /**
229
+ * The row lane instances a replay run reads through its cursor (`wrunRowLaneWindowAtReplayCursor`: the flow and snapshot
230
+ * lanes), by key: the session's coverage of each is the cursor, never the replay window's end its other lanes reach, so
231
+ * each replay step extends them (`wrunReplayRowLaneExtensions`) and the replay record keeps naming the window's end.
232
+ */
233
+ export declare function wrunRowLanesReplayBounded(instances: ReadonlyArray<Pick<WrunRowLaneInstance, 'key' | 'laneKey'>> | undefined): ReadonlySet<string>;
234
+ /**
235
+ * What a replay step owes a session's row lanes before it computes the bars it reveals (SKYLIT-PARITY L6a): each flow
236
+ * or snapshot lane covered short of the step's cursor (`coveredThroughTs`, the newest bar its buffer holds), from the
237
+ * bar after its coverage (`fromTs`) through the cursor. A lane holding no coverage (the run degraded it) is left to its
238
+ * degrade, and a `latest` lane to its live-row snapshot.
239
+ */
240
+ export declare function wrunReplayRowLaneExtensions(instances: ReadonlyArray<Pick<WrunRowLaneInstance, 'key' | 'laneKey'>> | undefined, coveredThroughTs: Readonly<Partial<Record<string, number>>>, cursorMs: number): Array<{
241
+ key: WrunRowLaneId;
242
+ fromTs: number;
243
+ }>;
244
+ /** 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
245
+ * a held one of the same bar (a replay holds no live-folded row an answer could lose). */
246
+ export declare function mergeWrunReplayRowLaneRows(held: ReadonlyArray<ReadonlyArray<unknown>> | undefined, answer: ReadonlyArray<ReadonlyArray<unknown>>): unknown[][];
203
247
  /** What a row lane's fetch hands its caller beside the whole answer (`fetchWrunRowLaneRows`). */
204
248
  export interface WrunRowLaneFetchOptions {
205
249
  /**
@@ -208,6 +252,85 @@ export interface WrunRowLaneFetchOptions {
208
252
  * Only a full run's first paint asks for it (wrun-overlay-run.util `runWrunSourceLanes`, the lane's early rows).
209
253
  */
210
254
  onFirstSlice?: (rows: unknown[][], sliceFromTs: number) => void;
255
+ /**
256
+ * The row budget's cut of this read (`WrunRowLaneBudgetCut`): called once, before any ask leaves, when the budget
257
+ * leaves asked bars partial, so the caller names the cut on the legend. A cut bar lands one partial marker, which a
258
+ * package reads as no cells: unnamed, Strike Footprint drew its newest 30 bars on every interval and nothing said
259
+ * why. The debug ring records every cut (`wrun-row-lane-budget-cut`) whether or not a caller listens.
260
+ */
261
+ onBudgetCut?: (cut: WrunRowLaneBudgetCut) => void;
262
+ /**
263
+ * A budgeted run's hold on this read (OPTLOAD W3 R2, `WrunRowLaneDownload`; wrun-download-plan.util): the newest slice
264
+ * is asked first and alone, then the newest older bars the read's share fits by the slice's own wire bytes, and no
265
+ * others; every bar it leaves unasked reads partial and the cut is named (`onBudgetCut`, `budget: 'download'`) once
266
+ * the asks landed. Absent (a whole run, the flag off): today's asks.
267
+ */
268
+ download?: WrunRowLaneDownload;
269
+ /**
270
+ * The add this read belongs to (OPTLOAD W3, one download budget per add; wrun-row-lane-add-memo.util): `key` names the
271
+ * chart, the mounted indicator and the instance (`wrunRowLaneAddKey`), `role` the read. A budgeted run's read leaves
272
+ * the add a memo (the bars it landed whole and final, the bars its budget cut, what it downloaded); every later read
273
+ * of the add, a run's or a live reconcile's, reuses the landed bars, keeps the cut ones partial and asks only the
274
+ * rest, a run within what is left of the add's share. A run with no `download` (the add's plan is whole) drops the
275
+ * memo. Absent (the flag off): no memo is read or left. A replay's read (`replayCursorMs`) never reads or leaves the
276
+ * add's memo: it keeps one of its own (`role: 'replay'`, keyed by the lane, the acquisition and the bar span), whole
277
+ * read or not, so a later read at the same or a later cursor reuses the bars it landed and asks the rest. Every memo
278
+ * admits only the bars of asks the chart's fetch confirmed whole (`ask`'s verdict).
279
+ */
280
+ addMemo?: {
281
+ key: string;
282
+ role: 'run' | 'live' | 'replay';
283
+ };
284
+ /**
285
+ * The asked bars whose asks the chart's fetch did not confirm whole (a synthetic completion, a trimmed window, an ask
286
+ * that reported no verdict): called once, after the asks landed, when there are any, ascending. Their rows (none, or
287
+ * the ones collected so far) look like data, and no memo admits them, so a later read asks them again (a replay step
288
+ * reopens its session instead of computing over them).
289
+ */
290
+ onUnconfirmed?: (bars: readonly number[]) => void;
291
+ }
292
+ /** The add a row lane read belongs to (`WrunRowLaneFetchOptions.addMemo`): the chart, the indicator, the instance. */
293
+ export declare function wrunRowLaneAddKey(chartIndex: number, indicatorId: string, instanceKey: string): string;
294
+ /** A budgeted run's hold on one row lane read (`WrunRowLaneFetchOptions.download`, OPTLOAD W3 R2 and FE-FOLD-CAP). */
295
+ export interface WrunRowLaneDownload {
296
+ /** The read's share of the run's download budget, in bytes (wrun-download-plan.util `wrunRunDownloadMode`): what its
297
+ * older bars may spend once its newest slice landed. The slice is asked whatever the share. */
298
+ share: number;
299
+ /** The read's own tally beside the run's meter (wrun-download-plan.util `createWrunLaneDownloadMeter`): every ask of
300
+ * the read charges it (the caller's fetch hands it to the transport), so the slice's wire bytes are its own. */
301
+ meter: Pick<WrunLaneDownloadMeter, 'charge' | 'spentBytes'>;
302
+ /** 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
303
+ * budget of its own (Spot Exposures' slice is its newest bar alone) and project an older bar before any read. */
304
+ declaredBarRows?: number;
305
+ /** FE-FOLD-CAP: the ask field a lane's browser fold reads its contract-row cap from, and one folded row's cells:
306
+ * each ask names the rows the bytes its group may still spend buy at the row's cells (8 bytes each), the unit the
307
+ * fold plan counts its projected rows in. Never at a measured wire row: the wire carries the chain's actual rows,
308
+ * which outnumber the projection where the chain is busier than it (3.2 to 1 on an ES1! regular-hours hour), so a
309
+ * cap priced there bought 2.4 times its share (INT 2026-10-23). */
310
+ fold?: {
311
+ field: string;
312
+ cellsPerRow: number;
313
+ };
314
+ }
315
+ /** What a row budget left out of one read (`WrunRowLaneFetchOptions.onBudgetCut`). */
316
+ export interface WrunRowLaneBudgetCut {
317
+ /** The lane's key: the feed the note names. */
318
+ laneKey: string;
319
+ /** The asked bars read whole: the newest that fit the budget. */
320
+ keptBars: number;
321
+ /** The asked bars the budget left partial: older than the kept ones, or a newest bar that cannot fit alone. */
322
+ cutBars: number;
323
+ /** The oldest kept bar's stamp; absent when no asked bar fits. */
324
+ keptFromTs?: number;
325
+ /** The budget's cap in rows of the lane's answered width (`wrunRowLaneMaxRows`). */
326
+ maxRows: number;
327
+ /** The budget that cut: absent, the source answer budget (before any ask leaves); `download`, the run's download
328
+ * budget (OPTLOAD W3 R2, once the asks landed: the bars the read's share left unread, and the bars its browser fold
329
+ * left partial under its cap). */
330
+ budget?: 'download';
331
+ /** A download cut: the bytes the read downloaded and its share. */
332
+ spentBytes?: number;
333
+ shareBytes?: number;
211
334
  }
212
335
  /**
213
336
  * 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 +353,34 @@ export interface WrunRowLaneFetchOptions {
230
353
  * still out a macrotask later: the slice's rows, every older bar the projection reads rows for read partial
231
354
  * (wrun-row-lane-first-paint.util `wrunRowLaneFirstSliceHeldBars`), and the slice's first bar. Never when no cut falls
232
355
  * 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).
356
+ * `present` mask (it cannot read a bar as partial), a kit fold carrying the next bar (its pages ask one at a time),
357
+ * Strike Footprint's per-(expiry, strike) rows (it learns its strike step over the whole run:
358
+ * wrun-row-lane-first-paint.util `wrunRowLaneDrawsFirstSlice`), or a snapshot whose empty bars ask a coarser tier (that
359
+ * pass would ask the slice's bars again).
360
+ *
361
+ * A row budget that leaves asked bars partial says so before any ask leaves (`opts.onBudgetCut`, and the debug ring).
362
+ *
363
+ * `opts.download` (a budgeted run, OPTLOAD W3 R2; `landWithinDownloadShare`): after the tier rule, the horizon and the
364
+ * row budget (the smaller cut wins), the read asks its newest slice first and alone, then the newest older bars its
365
+ * share fits by the slice's own wire bytes, and no others; every bar it leaves unasked reads partial (bit 14 with the
366
+ * marker tuple; an empty block on a class with no `present` mask), and the cut is named once the asks landed
367
+ * (`onBudgetCut`, `budget: 'download'`). No early handover in that mode. Absent: today's asks, exactly.
368
+ *
369
+ * A replay's window (`window.replayCursorMs`, plan L6a): a flow or snapshot lane's bars end at the replay's cursor
370
+ * (`wrunRowLaneWindowAtReplayCursor`), so nothing after it is asked, and the read keeps a replay memo (the add memo's
371
+ * machinery, `role: 'replay'`, never the add's own): a replay step's read of the bars it reveals
372
+ * (wrun-live-tick.util, `wrunReplayRowLaneExtensions`) and a reopened run reuse the bars landed whole and final and
373
+ * ask the rest. A read that names no cursor asks exactly as before.
374
+ *
375
+ * `ask` reports its answer's completion through its fourth argument (`whole`: the chart's fetch verdict,
376
+ * wrun-source-rows.util `wrunSourceVerdictWhole`); an ask that never reports is not whole. A memo admits a bar only from
377
+ * an ask reported whole, and the bars of every other ask are named to the caller (`opts.onUnconfirmed`), so a synthetic
378
+ * completion's empty or short answer is asked again, never remembered as the bar.
235
379
  */
236
- export declare function fetchWrunRowLaneRows(lane: WrunRowLaneDescriptor, extras: Readonly<Record<string, unknown>>, window: WrunRowLaneWindow, fallback: {
380
+ export declare function fetchWrunRowLaneRows(lane: WrunRowLaneDescriptor, extras: Readonly<Record<string, unknown>>, askedWindow: WrunRowLaneWindow, fallback: {
237
381
  fromTs: number;
238
382
  toTs: number;
239
- }, ask: (extras: Readonly<Record<string, unknown>>, fromTs: number, toTs: number) => Promise<ReadonlyArray<ReadonlyArray<unknown>>>, opts?: WrunRowLaneFetchOptions): Promise<unknown[][]>;
383
+ }, ask: (extras: Readonly<Record<string, unknown>>, fromTs: number, toTs: number, whole?: (whole: boolean) => void) => Promise<ReadonlyArray<ReadonlyArray<unknown>>>, opts?: WrunRowLaneFetchOptions): Promise<unknown[][]>;
240
384
  /**
241
385
  * A landed row with every packed block (a Float64Array a worker handed the page by transfer, `count x width` values back
242
386
  * 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 +441,23 @@ export declare function wrunRowLaneAsksWithinRowBudget(plan: {
297
441
  asks: WrunHostGridAsk[];
298
442
  partialBars: number[];
299
443
  };
444
+ /** Test seam: forget every measurement. */
445
+ export declare function __resetWrunRowLaneMeasurementsForTests(): void;
446
+ /**
447
+ * The rows a row-budget lane's next ask projects for one bar: its own projection (`rowBudget.barRows`: a proxy, the
448
+ * 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
449
+ * same lane, acquisition, tier and width held in the reads that landed before, never past the instance's `maxCells`
450
+ * (the most tuples a bar of it is read with, which option_strike_flow's facets name); a bar its projection reads
451
+ * nothing for (before today under `history` "today") stays at nothing. A market busier than its proxy then reads fewer
452
+ * bars on its next ask instead of an answer past the source answer budget, and a quieter one keeps the proxy. A
453
+ * contract flow bar's measured tuples (its contracts) are no more than the raw rows it reads, so they only ever lift a
454
+ * projection that was under them.
455
+ */
456
+ export declare function wrunRowLaneProjectedBarRows(lane: Pick<WrunRowLaneDescriptor, 'laneKey' | 'rowBudget'>, extras: Readonly<Record<string, unknown>>, bar: {
457
+ openMs: number;
458
+ endMs: number;
459
+ tier?: WrunBackendTier;
460
+ }, nowMs: number, acquisition?: Readonly<Record<string, unknown>>): number;
300
461
  /**
301
462
  * How far back one row lane's source holds rows for an acquisition at the clock: the later of its horizon's served
302
463
  * start and the oldest bar its longest-kept tier still holds; null when it names neither, or a tier keeps its rows for