@orangecharts/wrun-chart-host 0.3.0 → 0.4.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 (50) hide show
  1. package/README.md +11 -5
  2. package/dist/constants/scriptEditor/builtin-script-snippets.d.ts +133 -0
  3. package/dist/constants/scriptEditor/builtin-script-snippets.js +451 -0
  4. package/dist/host-env.d.ts +8 -6
  5. package/dist/host-ports.types.d.ts +7 -22
  6. package/dist/index.d.ts +10 -0
  7. package/dist/index.js +10 -0
  8. package/dist/utility/chart/date-labelled-interval.leaf.d.ts +15 -0
  9. package/dist/utility/chart/date-labelled-interval.leaf.js +19 -0
  10. package/dist/utility/chart/indicator-run-interval.util.d.ts +130 -0
  11. package/dist/utility/chart/indicator-run-interval.util.js +268 -0
  12. package/dist/utility/chart/window-geometry.leaf.d.ts +119 -0
  13. package/dist/utility/chart/window-geometry.leaf.js +391 -0
  14. package/dist/utility/chart/window-owner.leaf.d.ts +19 -0
  15. package/dist/utility/chart/window-owner.leaf.js +24 -0
  16. package/dist/utility/html-escape.leaf.d.ts +11 -0
  17. package/dist/utility/html-escape.leaf.js +20 -0
  18. package/dist/utility/wrun/sources/lanes/option_daily.d.ts +43 -15
  19. package/dist/utility/wrun/sources/lanes/option_daily.js +78 -20
  20. package/dist/utility/wrun/sources/lanes/option_stats_10m.d.ts +14 -10
  21. package/dist/utility/wrun/sources/lanes/option_stats_10m.js +5 -4
  22. package/dist/utility/wrun/sources/opra-option-lanes.util.d.ts +22 -3
  23. package/dist/utility/wrun/sources/opra-option-lanes.util.js +38 -7
  24. package/dist/utility/wrun/sources/registry.js +31 -1
  25. package/dist/utility/wrun/sources/row-lane-registry.js +5 -5
  26. package/dist/utility/wrun/sources/row-lanes/option_contract_state.d.ts +49 -0
  27. package/dist/utility/wrun/sources/row-lanes/option_contract_state.js +74 -18
  28. package/dist/utility/wrun/sources/row-lanes/option_strikes.d.ts +49 -0
  29. package/dist/utility/wrun/sources/row-lanes/option_strikes.js +57 -47
  30. package/dist/utility/wrun/sources/row-lanes/option_surface.d.ts +36 -4
  31. package/dist/utility/wrun/sources/row-lanes/option_surface.js +6 -12
  32. package/dist/utility/wrun/sources/wrun-poll-lane.types.d.ts +37 -3
  33. package/dist/utility/wrun/sources/wrun-poll-lanes.util.d.ts +128 -2
  34. package/dist/utility/wrun/sources/wrun-poll-lanes.util.js +233 -51
  35. package/dist/utility/wrun/sources/wrun-row-lane.types.d.ts +0 -8
  36. package/dist/utility/wrun/sources/wrun-row-lanes.util.d.ts +26 -24
  37. package/dist/utility/wrun/sources/wrun-row-lanes.util.js +85 -104
  38. package/dist/utility/wrun/wrun-opra-stats.leaf.d.ts +29 -10
  39. package/dist/utility/wrun/wrun-opra-stats.leaf.js +29 -10
  40. package/dist/utility/wrun/wrun-panel-mount.lazy.d.ts +10 -0
  41. package/dist/utility/wrun/wrun-panel-mount.lazy.js +68 -0
  42. package/dist/utility/wrun/wrun-panel-mount.util.d.ts +377 -0
  43. package/dist/utility/wrun/wrun-panel-mount.util.js +2251 -0
  44. package/dist/utility/wrun/wrun-pause-dim.util.d.ts +52 -0
  45. package/dist/utility/wrun/wrun-pause-dim.util.js +153 -0
  46. package/dist/utility/wrun/wrun-plot-gate.types.d.ts +23 -0
  47. package/dist/utility/wrun/wrun-plot-gate.types.js +7 -0
  48. package/dist/utility/wrun/wrun-run-interval-projection.types.d.ts +14 -0
  49. package/dist/utility/wrun/wrun-run-interval-projection.types.js +1 -0
  50. package/package.json +1 -1
@@ -1,8 +1,9 @@
1
- import { wrunOptionsStopSeed } from '../wrun-refusal.util.js';
2
- import { wrunPollLaneGlobalClasses, wrunPollLanes, wrunPollLanesOfClass } from './registry.js';
1
+ import { wrunOptionsStopSeed, wrunRefusalSeedOf } from '../wrun-refusal.util.js';
2
+ import { wrunPollLaneByKey, wrunPollLaneGlobalClasses, wrunPollLanes, wrunPollLanesOfClass } from './registry.js';
3
3
  import { refuseWrunPollInput, WRUN_POLL_LANE_ID_PREFIX, } from './wrun-poll-lane.types.js';
4
+ import { wrunLaneChainPlaneOf } from './wrun-row-lane.types.js';
4
5
  import { WRUN_DAILY_LANE_INTERVAL_KEY, wrunDailyLaneFetchFrom, wrunDailyLaneFetchTo, wrunDailyLaneReconcileFrom, wrunDailyLaneReconcileTo, } from '../wrun-daily-lane.util.js';
5
- import { assertWrunOpraLaneReadable } from '../wrun-opra-lane.util.js';
6
+ import { assertWrunOpraLaneReadable, wrunOpraLanePayloadFields } from '../wrun-opra-lane.util.js';
6
7
  import { wrunHostGridAsks, wrunHostGridFetchTo, wrunLandScalarRowsOnHostBars } from '../wrun-tier-grid.util.js';
7
8
  /**
8
9
  * The static plan: every input whose class the registry serves, in declaration order, with the
@@ -92,6 +93,102 @@ export function wrunOpraPlaneStopDetail(stop) {
92
93
  ? 'is not served for this account yet: the opra flag is off, so no US options data is read on any chart'
93
94
  : 'is not served on this chart: an index chart does not ride the OPRA plane yet, so no US options data is read for it';
94
95
  }
96
+ /** The chart's OPRA plane facts, off the predicates the run injects (`isOpraPlaneExchange`: absent, no chart rides
97
+ * the plane; `opraPlaneStop`, asked only off the plane). */
98
+ export function wrunChartOpraPlane(exchange, facts) {
99
+ if (facts?.isOpraPlaneExchange?.(exchange) === true)
100
+ return { onPlane: true };
101
+ const stop = facts?.opraPlaneStop?.(exchange);
102
+ return stop !== undefined ? { onPlane: false, stop } : { onPlane: false };
103
+ }
104
+ /** The fills a scalar input reads on every bar of a feed the chart does not serve (`missing: "nan"` or `"zero"`). */
105
+ const WRUN_POLL_LANE_UNSERVED_FILLS = Object.freeze(['nan', 'zero']);
106
+ /**
107
+ * The ONE rule for an input of a lane the chart does not serve, both planners' (`planWrunPollLanes` with
108
+ * `WRUN_POLL_LANE_UNSERVED_FILLS`, wrun-row-lanes.util `planWrunRowLanes` with a celled input's `empty`), whatever keeps
109
+ * it unserved (an index-mode chart, an OPRA lane off the plane, a chain lane stopped off it, a chart with no option
110
+ * chain): an input that declared one of `fills` is dropped from planning and named in `missing` under its feed, one
111
+ * entry per feed with its inputs in declaration order (the run draws, the row builder hands it an empty lane, a note
112
+ * says which feed and why); any other refuses by name (the default `carry` policy has nothing to carry). Throws, or
113
+ * records the note.
114
+ *
115
+ * The words: a known stop (`stop`) says that reason, the note and the refusal alike (`options-stopped`), never "this
116
+ * market has no such feed"; a chart with no option chain (`noChain`) puts the chain decision's own words in the note's
117
+ * details under the market's note (an options feed is missing on every market alike, a crypto one too), and an input
118
+ * with no fill refuses with that decision itself (`no-options` / `chain`); any other is the feed-missing record, saying
119
+ * "it comes from crypto markets" only on a chart provably no crypto venue (`cryptoVenue` false).
120
+ */
121
+ export function wrunUnservedLaneInput(missing, input, fills, why, cryptoVenue) {
122
+ const fill = typeof input.missing === 'string' && fills.includes(input.missing) ? input.missing : undefined;
123
+ if (fill === undefined) {
124
+ if ('noChain' in why)
125
+ throw why.noChain;
126
+ return refuseWrunPollInput(input, why.words, why.stop !== undefined
127
+ ? wrunOptionsStopSeed(why.stop, { severity: 'paused' })
128
+ : {
129
+ cls: 'feed-missing',
130
+ variant: cryptoVenue === false ? 'crypto-only' : 'market-paused',
131
+ params: { feed: input.feed },
132
+ severity: 'paused',
133
+ });
134
+ }
135
+ const said = 'noChain' in why ? why.noChain.message : `Input '${input.inputName}' (${input.sourceClass}) ${why.words}`;
136
+ const details = `${said}; it declares missing: "${fill}", so it reads ${fill === 'empty' ? 'an empty block' : 'that fill'} on every bar`;
137
+ const entry = missing.get(input.feed);
138
+ if (entry !== undefined) {
139
+ entry.inputNames.push(input.inputName);
140
+ entry.details = `${entry.details}\n${details}`;
141
+ return;
142
+ }
143
+ const stop = 'stop' in why ? why.stop : undefined;
144
+ missing.set(input.feed, {
145
+ inputNames: [input.inputName],
146
+ feed: input.feed,
147
+ variant: !('noChain' in why) && cryptoVenue === false ? 'crypto-only' : 'market',
148
+ details,
149
+ ...(stop !== undefined ? { stop } : {}),
150
+ });
151
+ }
152
+ /**
153
+ * Whether a lane's refusal says the chart has no option chain: its record's seed is `no-options` / `chain` (the chain
154
+ * decision's `no-chain`, opra-option-lanes.util `wrunLaneChainRefusalSeed`, and the OPRA-only lanes' "OPRA lists no
155
+ * options here"), read off the seed, never the words. Such a chart (a LINK perp, a forex pair, a stock listing no
156
+ * options) does not serve the feed: both planners hand the refusal to `wrunUnservedLaneInput`, so a declared fill reads.
157
+ */
158
+ export function wrunLaneNoChainRefusal(error) {
159
+ const seed = wrunRefusalSeedOf(error);
160
+ return error instanceof Error && seed?.cls === 'no-options' && seed.variant === 'chain';
161
+ }
162
+ /**
163
+ * A chain lane's input before its chain is resolved, both planners' one rule: where the chart's options list on OPRA
164
+ * (riding the plane, or kept off it by a known stop) the OPRA wall first (`opra-official-only:<class>`), every chain it
165
+ * would read there being OPRA's; then, kept off the plane by a known stop (the `opra` flag dark, an index chart), why
166
+ * the input is unserved (the stop's words and the stop, for `wrunUnservedLaneInput`), so no chain is resolved past the
167
+ * stop. Undefined: the lane resolves its chain (its instance then meets its own plane's wall,
168
+ * `assertWrunLaneChainPlaneReadable`).
169
+ */
170
+ export function wrunChainLaneStop(plane, run, ctx) {
171
+ if (plane.onPlane || plane.stop !== undefined)
172
+ assertWrunOpraLaneReadable(run, ctx);
173
+ return plane.stop === undefined ? undefined : { words: wrunOpraPlaneStopDetail(plane.stop), stop: plane.stop };
174
+ }
175
+ /**
176
+ * Why a poll lane that is no chain lane is not served on the chart, or undefined: an `opra` lane (after the OPRA wall,
177
+ * on any chart) off the plane when the run judges the plane (the stop's words when a known stop keeps the chart's
178
+ * options off it, else `WRUN_POLL_OPRA_UNADMITTED_REASON`), and a lane reading the chart's own market on an index-mode
179
+ * chart (`wrunPollLaneIndexModeReason`).
180
+ */
181
+ function wrunPollLaneUnserved(lane, plane, indexMode, run, ctx) {
182
+ if (lane.opra === true) {
183
+ assertWrunOpraLaneReadable(run, ctx);
184
+ if (run?.isOpraPlaneExchange !== undefined && !plane.onPlane) {
185
+ return plane.stop !== undefined
186
+ ? { words: wrunOpraPlaneStopDetail(plane.stop), stop: plane.stop }
187
+ : { words: WRUN_POLL_OPRA_UNADMITTED_REASON };
188
+ }
189
+ }
190
+ return indexMode && !wrunPollLaneServedOnIndexMode(lane) ? { words: wrunPollLaneIndexModeReason() } : undefined;
191
+ }
95
192
  function wrunPollLanePlanResult(lanes, missingFeeds) {
96
193
  const result = [...lanes];
97
194
  Object.defineProperty(result, 'lanes', { value: lanes, enumerable: false });
@@ -138,6 +235,21 @@ function wrunPollLanePlanResult(lanes, missingFeeds) {
138
235
  * note and in the refusal (`options-stopped`), never "this market has no such feed".
139
236
  * The run's facts reach an `opra` lane's `plan` as `ctx.official` and `ctx.opraUserScripts`.
140
237
  *
238
+ * A `chain` lane (the chart's options chain on whichever plane it lists on) is admitted on every chart its options are
239
+ * not stopped on: its `plan` resolves the chain through the one chain resolver. It meets the OPRA wall before its
240
+ * `plan` runs where the chart's options list on OPRA (every chain it reads there is OPRA's), and each instance then
241
+ * meets its own plane's wall (`assertWrunLaneChainPlaneReadable`: OPRA's, the CME display wall, none for a crypto
242
+ * chain). On a chart whose options list on OPRA but ride no plane for a known reason (`run.opraPlaneStop`) it keeps an
243
+ * `opra` lane's rules (`wrunChainLaneStop`, the row lanes' one rule): a declared fill drops the input with the stop's
244
+ * note, any other input refuses with it, and no chain is resolved past the stop. Its context carries the run's OPRA
245
+ * facts (the chain decision's `auto` reads them), the chart's category, the plane verdict (`opraPlane`: a lane reading
246
+ * by coin there reads no chain directory) and the plan's `runScope` (its inputs share one chart resolution).
247
+ *
248
+ * A chart with no option chain (a LINK perp, a forex pair, a stock listing no options) does not serve an options feed:
249
+ * an input whose lane's `plan` refuses so (`wrunLaneNoChainRefusal`: the record's `no-options` / `chain`) meets the
250
+ * same rule as an input an index-mode chart does not serve (`wrunUnservedLaneInput`), its note naming the feed with the
251
+ * chain decision's words, its refusal the decision's own.
252
+ *
141
253
  * An input the market leaves undemanded (its `needed_by` leaves the market out, wrunSheetWithLaneDemand) is planned
142
254
  * nowhere, before all of the above: no wall, no admission, no `plan`, no fetch, no note; the row builder reads its
143
255
  * fill on every bar.
@@ -152,70 +264,71 @@ export async function planWrunPollLanes(metadata, chart, isIndexModeExchange = (
152
264
  const missing = new Map();
153
265
  const indexModeChart = isIndexModeExchange(chart.exchange);
154
266
  const cryptoVenue = isCryptoVenueExchange?.(chart.exchange);
267
+ // The chart's category (pb-common `Category`), handed on when the chart holds one.
268
+ const category = typeof chart.category === 'number' ? { category: chart.category } : {};
269
+ // The chart's OPRA plane facts, read once (`wrunChartOpraPlane`, the row lanes' planner reads them the same way):
270
+ // whether its options ride the plane, and off it the known reason a chart whose options list on OPRA rides none.
271
+ const plane = wrunChartOpraPlane(chart.exchange, run);
272
+ // One object per plan: the inputs of this run share a chain lane's resolutions by it.
273
+ const runScope = {};
155
274
  for (const planned of planWrunPollLaneInputs(metadata)) {
156
275
  if (planned.source.undemanded === true)
157
276
  continue;
277
+ const chainLane = planned.lane.chain !== undefined;
158
278
  const ctx = {
159
- ...chart,
279
+ coin: chart.coin,
280
+ exchange: chart.exchange,
281
+ symbol: chart.symbol,
282
+ ...category,
283
+ intervalMs: chart.intervalMs,
160
284
  inputName: planned.inputName,
161
285
  sourceClass: planned.lane.sourceClass,
162
286
  indexMode: indexModeChart,
163
287
  cryptoVenue,
164
- // The run's OPRA facts reach the plan of a lane that reads OPRA (`opra`, the lanes the decision concerns);
165
- // every other lane's context is as it always was. Absent reads closed.
166
- ...(run !== undefined && planned.lane.opra === true
288
+ // The run's OPRA facts reach the plan of a lane that reads OPRA (`opra`) or may (a `chain` lane: its chain
289
+ // decision's `auto` reads them), the lanes the decision concerns; every other lane's context is as it always
290
+ // was. Absent reads closed.
291
+ ...(run !== undefined && (planned.lane.opra === true || chainLane)
167
292
  ? { official: run.official === true, opraUserScripts: run.opraUserScripts === true }
168
293
  : {}),
294
+ ...(chainLane ? { runScope, opraPlane: plane.onPlane } : {}),
169
295
  };
170
- // The OPRA wall first: a run the plane is closed to reads no US options, on any chart.
171
- if (planned.lane.opra === true)
172
- assertWrunOpraLaneReadable(run, ctx);
173
- // An OPRA lane is served where the chart's options ride the plane; any other lane reading the chart's market
174
- // is not served on an index-mode chart.
175
- const offPlane = planned.lane.opra === true && run?.isOpraPlaneExchange !== undefined && !run.isOpraPlaneExchange(chart.exchange);
176
- if (offPlane || (indexModeChart && !wrunPollLaneServedOnIndexMode(planned.lane))) {
177
- // A chart whose options DO list on OPRA is off the plane for a known reason (the flag, the router): the note
178
- // and the refusal say that reason, never "this market has no such feed".
179
- const stop = offPlane ? run?.opraPlaneStop?.(chart.exchange) : undefined;
180
- const reason = stop !== undefined
181
- ? wrunOpraPlaneStopDetail(stop)
182
- : offPlane
183
- ? WRUN_POLL_OPRA_UNADMITTED_REASON
184
- : wrunPollLaneIndexModeReason();
185
- const fill = planned.source.missing;
186
- if (fill === 'nan' || fill === 'zero') {
187
- const feed = planned.lane.laneKey;
188
- const details = `Input '${ctx.inputName}' (${ctx.sourceClass}) ${reason}; it declares missing: "${fill}", so it reads that fill on every bar`;
189
- const entry = missing.get(feed);
190
- if (entry === undefined) {
191
- missing.set(feed, {
192
- inputNames: [planned.inputName],
193
- feed,
194
- variant: cryptoVenue === false ? 'crypto-only' : 'market',
195
- details,
196
- ...(stop !== undefined ? { stop } : {}),
197
- });
198
- }
199
- else {
200
- entry.inputNames.push(planned.inputName);
201
- entry.details = `${entry.details}\n${details}`;
202
- }
203
- continue;
204
- }
205
- refuseWrunPollInput(ctx, reason, stop !== undefined
206
- ? wrunOptionsStopSeed(stop, { severity: 'paused' })
207
- : {
208
- cls: 'feed-missing',
209
- variant: cryptoVenue === false ? 'crypto-only' : 'market-paused',
210
- params: { feed: planned.lane.laneKey },
211
- severity: 'paused',
212
- });
296
+ const unserved = {
297
+ inputName: planned.inputName,
298
+ sourceClass: planned.lane.sourceClass,
299
+ feed: planned.lane.laneKey,
300
+ missing: planned.source.missing,
301
+ };
302
+ // A chain lane meets the OPRA wall where the chart's options list on OPRA, and stops before its chain is resolved
303
+ // where a known stop keeps them off the plane (`wrunChainLaneStop`, the row lanes' one rule); any other lane is
304
+ // served by its own plane and the chart's mode. An input the chart does not serve meets the one rule both planners
305
+ // keep (`wrunUnservedLaneInput`: a declared fill drops it with a note, any other refuses by name).
306
+ const why = chainLane
307
+ ? wrunChainLaneStop(plane, run, ctx)
308
+ : wrunPollLaneUnserved(planned.lane, plane, indexModeChart, run, ctx);
309
+ if (why !== undefined) {
310
+ wrunUnservedLaneInput(missing, unserved, WRUN_POLL_LANE_UNSERVED_FILLS, why, cryptoVenue);
311
+ continue;
312
+ }
313
+ let answered;
314
+ try {
315
+ answered = await planned.lane.plan(planned.source, ctx);
316
+ }
317
+ catch (error) {
318
+ // A chart with no option chain does not serve the feed (`wrunLaneNoChainRefusal`): the same one rule.
319
+ if (!wrunLaneNoChainRefusal(error))
320
+ throw error;
321
+ wrunUnservedLaneInput(missing, unserved, WRUN_POLL_LANE_UNSERVED_FILLS, { noChain: error }, cryptoVenue);
322
+ continue;
213
323
  }
214
- const answered = await planned.lane.plan(planned.source, ctx);
215
324
  const extras = {};
216
325
  for (const [key, value] of Object.entries(answered ?? {}))
217
326
  if (value !== undefined)
218
327
  extras[key] = value;
328
+ // A chain instance meets its own plane's wall, by the exchange its chain lists on.
329
+ if (chainLane) {
330
+ assertWrunLaneChainPlaneReadable(wrunPollLaneChainPlane(planned.lane, extras), wrunPollLaneChainExchange(planned.lane, extras), run, ctx);
331
+ }
219
332
  const key = wrunPollLaneInstanceKey(planned.lane.laneKey, extras);
220
333
  let instance = instances.get(key);
221
334
  if (instance === undefined) {
@@ -238,6 +351,75 @@ export async function planWrunPollLanes(metadata, chart, isIndexModeExchange = (
238
351
  export async function planWrunPollLaneInstances(metadata, chart, isIndexModeExchange, isCryptoVenueExchange, run) {
239
352
  return (await planWrunPollLanes(metadata, chart, isIndexModeExchange, isCryptoVenueExchange, run)).lanes;
240
353
  }
354
+ // ---------------------------------------------------------------------------
355
+ // A chain lane's plane per instance (`WrunPollLane.chain`, the row lanes' mark): the run's and the live tick's rule
356
+ // ---------------------------------------------------------------------------
357
+ /** The record seed of the CME display wall on a chain instance's CME chain (the display wall's own record). */
358
+ const WRUN_CME_WALL_SEED = Object.freeze({ cls: 'cme-wall' });
359
+ /**
360
+ * A chain instance against its own plane's wall, by the plane and the exchange its chain lists on: an OPRA chain the
361
+ * OPRA wall (`mayReadOpra`), a CME chain the CME display wall (OpenMarket's own packages only, the run door's rule on
362
+ * a CME chart, kscript-venue-policy.util; the `opra-user-scripts` flag never opens it), a crypto chain (`plain`)
363
+ * none. The row lanes keep the same rule (wrun-row-lanes.util), in the same words.
364
+ */
365
+ export function assertWrunLaneChainPlaneReadable(plane, exchange, run, ctx) {
366
+ if (plane === 'opra')
367
+ assertWrunOpraLaneReadable(run, ctx);
368
+ if (plane === 'cme' && run?.official !== true) {
369
+ refuseWrunPollInput(ctx, `reads CME options data (${exchange}), which is open to OpenMarket's own Indicators only: a package you wrote ` +
370
+ 'or added from the community cannot read it yet', WRUN_CME_WALL_SEED);
371
+ }
372
+ }
373
+ /** The exchange a chain-lane instance's chain lists on (the payload field its `chain` names); '' for any other lane
374
+ * or a payload naming none. */
375
+ export function wrunPollLaneChainExchange(lane, extras) {
376
+ const exchange = lane.chain === undefined ? undefined : extras[lane.chain.exchangeField];
377
+ return typeof exchange === 'string' ? exchange : '';
378
+ }
379
+ /** The plane a chain-lane instance reads, by its chain's exchange (`wrunLaneChainPlaneOf`, off the governed exchange
380
+ * sets); undefined for any other lane (its plane, if any, is its descriptor's `opra`). */
381
+ export function wrunPollLaneChainPlane(lane, extras) {
382
+ return lane.chain === undefined ? undefined : wrunLaneChainPlaneOf(wrunPollLaneChainExchange(lane, extras));
383
+ }
384
+ /** Whether one poll-lane instance reads the OPRA plane (the provenance stamp and the legend note follow it): every
385
+ * instance of an `opra` lane, a chain lane's whose chain lists on OPRA. */
386
+ export function wrunPollLaneInstanceReadsOpra(lane, extras) {
387
+ return lane.opra === true || wrunPollLaneChainPlane(lane, extras) === 'opra';
388
+ }
389
+ /** The governed exchange a chain-lane instance reads beside its chart's own market (the exchange its served access,
390
+ * and so its delayed window and its gate session, is read under): its chain's when a gate governs it (OPRA, a CME
391
+ * Group exchange); null for a crypto chain and for any other lane. */
392
+ export function wrunPollLaneChainGovernedExchange(lane, extras) {
393
+ const plane = wrunPollLaneChainPlane(lane, extras);
394
+ return plane === 'opra' || plane === 'cme' ? wrunPollLaneChainExchange(lane, extras) : null;
395
+ }
396
+ /**
397
+ * A chain instance's ask (the full run's and the reconcile's, re-read on every ask): its payload with the fields its
398
+ * plane names beside it. An OPRA chain names the plane and its routed tier (`wrunOpraLanePayloadFields`: Door C judges
399
+ * it an OPRA ask, the legend names a delayed tier); a CME chain its routed tier alone (`servedTier`, so no source cache
400
+ * serves one tier's rows to the other; the chart's own badge names the delay); a crypto chain nothing. Any other
401
+ * lane's payload as it is. `tierOf` is the routing's rule (governed-route.util `governedMarketDataTier`), handed in so
402
+ * this module stays off the routing graph, and asked only for a governed exchange: it answers delayed for any
403
+ * exchange no gate governs.
404
+ */
405
+ export function wrunPollLaneChainAsk(lane, extras, tierOf) {
406
+ const plane = wrunPollLaneChainPlane(lane, extras);
407
+ if (plane !== 'opra' && plane !== 'cme')
408
+ return extras;
409
+ const servedTier = tierOf(wrunPollLaneChainExchange(lane, extras));
410
+ return plane === 'opra' ? { ...extras, ...wrunOpraLanePayloadFields(servedTier) } : { ...extras, servedTier };
411
+ }
412
+ /** The first poll-lane instance of a session whose acquisition moved since the run planned it (its lane's
413
+ * `acquisitionMoved` over the run's record of it, else over the instance's payload), or undefined: the live tick
414
+ * rebuilds the session then, as for a row lane's (wrun-row-lanes.util `wrunRowLaneMovedInstance`). */
415
+ export function wrunPollLaneMovedInstance(instances, acquisition) {
416
+ for (const instance of instances ?? []) {
417
+ const moved = wrunPollLaneByKey(instance.laneKey)?.acquisitionMoved;
418
+ if (moved !== undefined && moved(acquisition[instance.key] ?? instance.extras))
419
+ return instance.key;
420
+ }
421
+ return undefined;
422
+ }
241
423
  /**
242
424
  * Whether a lane must answer rows for the package: true when any input reading it (`reads`)
243
425
  * rides the default carry policy (an absent series has nothing to carry, so an empty lane
@@ -235,14 +235,6 @@ export interface WrunRowLaneDescriptor {
235
235
  * per-input projection is applied as it is. Absent: the last column is the `present` mask.
236
236
  */
237
237
  presentMask?: false;
238
- /**
239
- * `'empty'` (a `governed` lane only): on a chart whose options do not ride the lane's plane, every input still
240
- * runs the lane's identity and facets (their refusals by name) and the one-acquisition rule, then reads an EMPTY
241
- * block on every bar with no fetch, no OPRA wall and no note (om's `option_strikes`: a chain the venue word
242
- * resolves off the OPRA plane has no strike rows). Absent: off the plane an input refuses by name, or reads its
243
- * empty block with a feed-missing note when it declares `missing: "empty"`.
244
- */
245
- offPlane?: 'empty';
246
238
  /** One input's projection of a bar's tuples (its own `expiries` word over a lane two inputs share, a field
247
239
  * selection, a cut to the input's own `max_cells`): applied per input per bar, never refetching. Absent: the
248
240
  * bar's tuples as they are. */
@@ -25,7 +25,7 @@ import type { WrunIndicatorMetadata, WrunInputSource } from '../../../interfaces
25
25
  import type { LiveBucketVenue } from '../../chart/live-bucket.util.js';
26
26
  import type { OpraReadFacts } from '../../chart/opra-read-access.leaf.js';
27
27
  import type { OpraOptionPlaneStop } from '../../../host-ports.types.js';
28
- import { type WrunPollLaneFetchAsk } from './wrun-poll-lane.types.js';
28
+ import type { WrunPollLaneFetchAsk } from './wrun-poll-lane.types.js';
29
29
  import { type WrunLaneChainPlane, type WrunRowLaneCellInput, type WrunRowLaneDescriptor, type WrunRowLaneHorizon, type WrunRowLaneId, type WrunRowLaneInstance, type WrunRowLaneRowBudget } from './wrun-row-lane.types.js';
30
30
  import type { WrunMissingFeed } from '../wrun-run-health.util.js';
31
31
  import { type WrunHostGridAsk } from '../wrun-tier-grid.util.js';
@@ -81,36 +81,38 @@ export interface WrunRowLanePlan {
81
81
  * 0. an input the market leaves undemanded (its `needed_by` leaves the market out, wrunSheetWithLaneDemand) is planned
82
82
  * nowhere: no wall, no admission, no acquisition, no note; the row builder reads its empty block on every bar;
83
83
  * 1. the OPRA wall: an input of a `governed: 'opra'` lane is refused for a run that may not read OPRA
84
- * (`opra-official-only:<class>`, `mayReadOpra` over `run`; absent reads closed);
84
+ * (`opra-official-only:<class>`, `mayReadOpra` over `run`; absent reads closed), and so is an input of a chain lane
85
+ * on a chart whose options list on OPRA (riding the plane or stopped off it), before its chain is resolved;
85
86
  * 2. the admission: a governed OPRA lane is served where the chart's options ride the OPRA plane
86
- * (`isOpraPlaneExchange`) and nowhere else; a chain lane on every chart (its identity or facets refuse a chart
87
- * with no chain by name); any other lane wherever the chart is not index-mode. On a chart
88
- * that does not serve it an input declaring `missing: "empty"` is dropped (its blocks read EMPTY, a note names
89
- * the feed) and any other refuses by name, seeded feed-missing (paused); a governed lane off the plane for a known
90
- * reason (`opraPlaneStop`: the `opra` flag dark, an index chart) says that reason instead (`options-stopped`,
91
- * the note and the refusal alike). A governed lane declaring
92
- * `offPlane: 'empty'` is the exception off its plane: no wall, no refusal and no note, its identity, facets and
93
- * acquisition rule judged as anywhere, and then no instance (every input reads its empty block);
87
+ * (`isOpraPlaneExchange`) and nowhere else; a chain lane on every chart no known stop keeps its options off the
88
+ * plane on (`wrunChainLaneStop`, the chain poll lanes' one rule: no chain is resolved past the stop); any other lane
89
+ * wherever the chart is not index-mode. An input the chart does not serve meets the one rule both planners keep
90
+ * (wrun-poll-lanes.util `wrunUnservedLaneInput`): declaring `missing: "empty"` it is dropped (its blocks read EMPTY,
91
+ * a note names the feed), any other refuses by name, seeded feed-missing (paused); a lane off the plane for a known
92
+ * reason (`opraPlaneStop`: the `opra` flag dark, an index chart) says that reason instead (`options-stopped`, the
93
+ * note and the refusal alike);
94
94
  * 3. the lane's identity, once per lane (the first admitted input's context names a refusal), then the input's
95
95
  * facets (awaited, in declaration order); the instance is the identity and the facets together. A lane with
96
- * `acquisitions: 'one'` refuses a second input whose acquisition differs (one fetch, one live fold per package).
97
- * A chain lane's instance then meets its own plane's wall (`wrunRowLaneChainPlane`): the OPRA wall (met before the
98
- * chain is resolved on a chart whose options ride the OPRA plane), or the CME display wall (OpenMarket's own
99
- * packages only); a plain chain (a crypto venue) none.
96
+ * `acquisitions: 'one'` refuses a second input whose acquisition differs (one fetch, one live fold per package). A
97
+ * chart with no option chain (an identity or facets refusal seeded `no-options` / `chain`, `wrunLaneNoChainRefusal`:
98
+ * a LINK perp, a forex pair) does not serve the feed either: the same one rule, its note naming the feed with the
99
+ * chain decision's words, its refusal the decision's own. A chain lane's instance then meets its own plane's wall
100
+ * (`assertWrunLaneChainPlaneReadable`, the one rule a chain poll lane meets too): OPRA's, or the CME display wall
101
+ * (OpenMarket's own packages only); a plain chain (a crypto venue) none.
100
102
  */
101
103
  export declare function planWrunRowLanes(metadata: WrunIndicatorMetadata, chart: WrunRowLaneChart, run?: OpraReadFacts): Promise<WrunRowLanePlan>;
102
104
  /** The exchange a chain-lane instance's chain lists on (the payload field its `chain` names); '' for any other lane
103
- * or a payload naming none. */
105
+ * or a payload naming none. The chain poll lanes' one rule (`wrunPollLaneChainExchange`: the mark is the same). */
104
106
  export declare function wrunRowLaneChainExchange(lane: Pick<WrunRowLaneDescriptor, 'chain'>, extras: Readonly<Record<string, unknown>>): string;
105
- /** The plane a chain-lane instance reads, by its chain's exchange (`wrunLaneChainPlaneOf`); undefined for any other
106
- * lane (its plane, if any, is its descriptor's `governed`). */
107
+ /** The plane a chain-lane instance reads, by its chain's exchange (`wrunPollLaneChainPlane`, the chain poll lanes' one
108
+ * rule over `wrunLaneChainPlaneOf`); undefined for any other lane (its plane, if any, is its descriptor's `governed`). */
107
109
  export declare function wrunRowLaneChainPlane(lane: Pick<WrunRowLaneDescriptor, 'chain'>, extras: Readonly<Record<string, unknown>>): WrunLaneChainPlane | undefined;
108
110
  /** Whether one row-lane instance reads the OPRA plane (the provenance stamp follows it): every instance of a governed
109
111
  * lane, a chain lane's whose chain lists on OPRA. */
110
112
  export declare function wrunRowLaneInstanceReadsOpra(lane: Pick<WrunRowLaneDescriptor, 'governed' | 'chain'>, extras: Readonly<Record<string, unknown>>): boolean;
111
113
  /** The governed exchange a chain-lane instance reads beside its chart's own market (the exchange its served access,
112
114
  * and so its delayed window, is read under): its chain's when a gate governs it (OPRA, a CME Group exchange); null
113
- * for a plain chain and for any other lane. */
115
+ * for a plain chain and for any other lane. The chain poll lanes' one rule (`wrunPollLaneChainGovernedExchange`). */
114
116
  export declare function wrunRowLaneChainGovernedExchange(lane: Pick<WrunRowLaneDescriptor, 'chain'>, extras: Readonly<Record<string, unknown>>): string | null;
115
117
  /** The first row-lane instance of a session whose acquisition moved since the run planned it (its lane's
116
118
  * `acquisitionMoved` over the run's record of it, else over the instance's payload), or undefined: the live tick
@@ -118,12 +120,12 @@ export declare function wrunRowLaneChainGovernedExchange(lane: Pick<WrunRowLaneD
118
120
  export declare function wrunRowLaneMovedInstance(instances: ReadonlyArray<Pick<WrunRowLaneInstance, 'key' | 'laneKey' | 'extras'>> | undefined, acquisition: Readonly<Partial<Record<WrunRowLaneId, Readonly<Record<string, unknown>>>>>): WrunRowLaneId | undefined;
119
121
  /**
120
122
  * A chain instance's ask (the full run's and the reconcile's, re-read on every ask): its payload with the fields its
121
- * plane names beside it. An OPRA chain names the plane and its routed tier (`wrunOpraLanePayloadFields`: Door C judges
122
- * it an OPRA ask, the legend names a delayed tier); a CME chain its routed tier alone (`servedTier`, so no source cache
123
- * serves one tier's rows to the other; the chart's own badge names the delay); a plain chain (a crypto venue) nothing.
124
- * Any other lane's payload as it is. `tierOf` is the routing's rule (governed-route.util `governedMarketDataTier`),
125
- * handed in so this module stays off the routing graph, and asked only for a governed exchange: it answers delayed
126
- * for any exchange no gate governs.
123
+ * plane names beside it, by the chain poll lanes' one rule (`wrunPollLaneChainAsk`): an OPRA chain names the plane and
124
+ * its routed tier (Door C judges it an OPRA ask, the legend names a delayed tier); a CME chain its routed tier alone
125
+ * (`servedTier`, so no source cache serves one tier's rows to the other; the chart's own badge names the delay); a
126
+ * plain chain (a crypto venue) nothing. Any other lane's payload as it is. `tierOf` is the routing's rule
127
+ * (governed-route.util `governedMarketDataTier`), handed in so this module stays off the routing graph, and asked only
128
+ * for a governed exchange: it answers delayed for any exchange no gate governs.
127
129
  */
128
130
  export declare function wrunRowLaneChainAsk(lane: Pick<WrunRowLaneDescriptor, 'chain'>, extras: Readonly<Record<string, unknown>>, tierOf: (exchange: string) => 'realtime' | 'delayed'): Readonly<Record<string, unknown>>;
129
131
  /** How an empty answer reads for a lane: quiet (present EMPTY blocks) or degrading (a state lane's). */