@orangecharts/wrun-chart-host 0.10.0 → 0.11.1
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.
- package/README.md +1 -0
- package/dist/constants/feature-flags.constants.d.ts +9 -0
- package/dist/constants/feature-flags.constants.js +67 -4
- package/dist/constants/governed-exchanges.constants.d.ts +12 -0
- package/dist/constants/governed-exchanges.constants.js +16 -0
- package/dist/constants/option-venues.constants.d.ts +2 -2
- package/dist/host-env.d.ts +1 -9
- package/dist/host-ports.types.d.ts +36 -7
- package/dist/index.d.ts +7 -1
- package/dist/index.js +7 -1
- package/dist/indicators/controls/tpo-session.util.d.ts +36 -13
- package/dist/indicators/controls/tpo-session.util.js +217 -236
- package/dist/interfaces/cancel-reason.interface.d.ts +1 -1
- package/dist/interfaces/cme-realtime.interface.d.ts +16 -9
- package/dist/interfaces/cme-realtime.interface.js +6 -3
- package/dist/interfaces/kscript-diagnostics.interface.d.ts +6 -0
- package/dist/interfaces/opra-realtime.interface.d.ts +1 -5
- package/dist/interfaces/prediction-market.interface.d.ts +7 -0
- package/dist/interfaces/stocks-realtime.interface.d.ts +57 -0
- package/dist/interfaces/stocks-realtime.interface.js +32 -0
- package/dist/kscript-data/controls/live-trades-merge.util.d.ts +48 -117
- package/dist/kscript-data/controls/live-trades-merge.util.js +97 -207
- package/dist/market-data/billing.interface.d.ts +86 -12
- package/dist/market-data/billing.interface.js +23 -4
- package/dist/market-data/venue.d.ts +65 -2
- package/dist/market-data/venues/index.d.ts +135 -5
- package/dist/market-data/venues/index.js +2 -1
- package/dist/market-data/venues/opra.contract.copy.json +3 -2
- package/dist/market-data/venues/opra.d.ts +2 -2
- package/dist/market-data/venues/opra.js +5 -2
- package/dist/market-data/venues/stocks.contract.copy.json +64 -0
- package/dist/market-data/venues/stocks.d.ts +130 -0
- package/dist/market-data/venues/stocks.js +117 -0
- package/dist/settings-templates/footprint-rows.js +35 -2
- package/dist/settings-templates/form-rows.d.ts +2 -1
- package/dist/settings-templates/indicator-fields.js +34 -4
- package/dist/settings-templates/tool-rules.d.ts +12 -5
- package/dist/settings-templates/tool-rules.js +11 -5
- package/dist/settings-templates/tool-tables.generated.js +4 -0
- package/dist/utility/chart/cme-cache-context.util.d.ts +5 -3
- package/dist/utility/chart/cme-cache-context.util.js +10 -6
- package/dist/utility/chart/cme-realtime.util.js +10 -0
- package/dist/utility/chart/cme-user-scripts-gate.util.d.ts +83 -0
- package/dist/utility/chart/cme-user-scripts-gate.util.js +142 -0
- package/dist/utility/chart/effective-chart-session.util.d.ts +14 -0
- package/dist/utility/chart/effective-chart-session.util.js +39 -0
- package/dist/utility/chart/host-bar-placement.util.d.ts +28 -0
- package/dist/utility/chart/host-bar-placement.util.js +170 -30
- package/dist/utility/chart/index-host-tier.util.d.ts +3 -1
- package/dist/utility/chart/index-host-tier.util.js +7 -2
- package/dist/utility/chart/index-mode-admission.util.js +25 -11
- package/dist/utility/chart/kscript-apply-fingerprint.util.js +1 -1
- package/dist/utility/chart/kscript-live-coalesce.util.d.ts +6 -9
- package/dist/utility/chart/kscript-live-coalesce.util.js +8 -9
- package/dist/utility/chart/kscript-live-source-identity.util.d.ts +9 -0
- package/dist/utility/chart/kscript-live-source-identity.util.js +10 -1
- package/dist/utility/chart/kscript-provenance-keys.util.js +7 -0
- package/dist/utility/chart/kscript-standin-identity.leaf.d.ts +3 -1
- package/dist/utility/chart/kscript-venue-policy.util.d.ts +115 -21
- package/dist/utility/chart/kscript-venue-policy.util.js +194 -40
- package/dist/utility/chart/live-bucket.util.d.ts +24 -8
- package/dist/utility/chart/live-bucket.util.js +85 -27
- package/dist/utility/chart/market-sessions.util.d.ts +83 -0
- package/dist/utility/chart/market-sessions.util.js +220 -0
- package/dist/utility/chart/marketKind.util.js +5 -0
- package/dist/utility/chart/mixed-mode.util.d.ts +7 -0
- package/dist/utility/chart/mixed-mode.util.js +14 -0
- package/dist/utility/chart/opra-user-scripts-gate.util.d.ts +11 -16
- package/dist/utility/chart/opra-user-scripts-gate.util.js +12 -28
- package/dist/utility/chart/rth-session.util.d.ts +9 -8
- package/dist/utility/chart/rth-session.util.js +23 -20
- package/dist/utility/chart/session-interval.util.d.ts +2 -1
- package/dist/utility/chart/session-interval.util.js +1 -3
- package/dist/utility/chart/trading-day.util.d.ts +17 -0
- package/dist/utility/chart/trading-day.util.js +59 -0
- package/dist/utility/chart/window-owner.leaf.d.ts +23 -2
- package/dist/utility/chart/window-owner.leaf.js +45 -3
- package/dist/utility/chart/wrun-bar-session-facts.util.d.ts +33 -15
- package/dist/utility/chart/wrun-bar-session-facts.util.js +70 -20
- package/dist/utility/intl-locale.util.js +5 -0
- package/dist/utility/scriptEditor/wrun-runtime-diagnostics.leaf.js +2 -0
- package/dist/utility/v2/gate-plane.util.d.ts +12 -3
- package/dist/utility/v2/gate-plane.util.js +30 -4
- package/dist/utility/v2/gate-session-latch.util.js +1 -1
- package/dist/utility/v2/stocks-governed.util.d.ts +16 -0
- package/dist/utility/v2/stocks-governed.util.js +34 -0
- package/dist/utility/wrun/derived-roots.leaf.d.ts +13 -0
- package/dist/utility/wrun/derived-roots.leaf.js +27 -0
- package/dist/utility/wrun/derived-roots.util.d.ts +1 -9
- package/dist/utility/wrun/derived-roots.util.js +3 -23
- package/dist/utility/wrun/run-schedule/wrun-chart-gate-reader.util.d.ts +4 -3
- package/dist/utility/wrun/run-schedule/wrun-own-candles.util.d.ts +24 -3
- package/dist/utility/wrun/run-schedule/wrun-own-candles.util.js +46 -10
- package/dist/utility/wrun/sources/wrun-poll-lanes.util.js +2 -0
- package/dist/utility/wrun/sources/wrun-row-lane-add-memo.util.d.ts +63 -16
- package/dist/utility/wrun/sources/wrun-row-lane-add-memo.util.js +58 -14
- package/dist/utility/wrun/sources/wrun-row-lanes.util.d.ts +34 -11
- package/dist/utility/wrun/sources/wrun-row-lanes.util.js +106 -30
- package/dist/utility/wrun/wrun-browser-sources.leaf.js +1 -2
- package/dist/utility/wrun/wrun-chart-market-facts.util.d.ts +7 -4
- package/dist/utility/wrun/wrun-chart-market-facts.util.js +12 -8
- package/dist/utility/wrun/wrun-color-settings.util.d.ts +9 -0
- package/dist/utility/wrun/wrun-color-settings.util.js +33 -0
- package/dist/utility/wrun/wrun-handles.util.d.ts +7 -3
- package/dist/utility/wrun/wrun-handles.util.js +9 -8
- package/dist/utility/wrun/wrun-input-requirements.leaf.d.ts +68 -0
- package/dist/utility/wrun/wrun-input-requirements.leaf.js +163 -7
- package/dist/utility/wrun/wrun-leg-close.util.d.ts +59 -23
- package/dist/utility/wrun/wrun-leg-close.util.js +186 -28
- package/dist/utility/wrun/wrun-live-intake.util.d.ts +26 -12
- package/dist/utility/wrun/wrun-live-intake.util.js +219 -155
- package/dist/utility/wrun/wrun-live-tick.util.d.ts +9 -5
- package/dist/utility/wrun/wrun-live-tick.util.js +130 -94
- package/dist/utility/wrun/wrun-market-facts.util.d.ts +13 -3
- package/dist/utility/wrun/wrun-market-facts.util.js +13 -3
- package/dist/utility/wrun/wrun-market-size-defaults.leaf.d.ts +20 -10
- package/dist/utility/wrun/wrun-market-size-defaults.leaf.js +10 -5
- package/dist/utility/wrun/wrun-option-book-rows.util.d.ts +56 -0
- package/dist/utility/wrun/wrun-option-book-rows.util.js +96 -0
- package/dist/utility/wrun/wrun-option-views.util.d.ts +281 -20
- package/dist/utility/wrun/wrun-option-views.util.js +391 -50
- package/dist/utility/wrun/wrun-options-chain.util.d.ts +3 -3
- package/dist/utility/wrun/wrun-options-chain.util.js +2 -0
- package/dist/utility/wrun/wrun-overlay-drivers.util.d.ts +15 -2
- package/dist/utility/wrun/wrun-overlay-drivers.util.js +13 -3
- package/dist/utility/wrun/wrun-overlay-recovery.util.js +3 -1
- package/dist/utility/wrun/wrun-overlay-run.util.d.ts +60 -11
- package/dist/utility/wrun/wrun-overlay-run.util.js +529 -113
- package/dist/utility/wrun/wrun-panel-mount.util.js +51 -6
- package/dist/utility/wrun/wrun-pin-spelling.util.d.ts +15 -2
- package/dist/utility/wrun/wrun-pin-spelling.util.js +27 -3
- package/dist/utility/wrun/wrun-refusal.util.d.ts +3 -2
- package/dist/utility/wrun/wrun-refusal.util.js +22 -0
- package/dist/utility/wrun/wrun-registry-errors.util.d.ts +26 -0
- package/dist/utility/wrun/wrun-registry-errors.util.js +34 -0
- package/dist/utility/wrun/wrun-replay-lane.util.js +3 -2
- package/dist/utility/wrun/wrun-run-interval-session.util.d.ts +20 -6
- package/dist/utility/wrun/wrun-run-interval-session.util.js +22 -7
- package/dist/utility/wrun/wrun-run-interval.util.d.ts +39 -7
- package/dist/utility/wrun/wrun-run-interval.util.js +49 -9
- package/dist/utility/wrun/wrun-socket-row-source.js +7 -2
- package/dist/utility/wrun/wrun-source-rows.util.d.ts +29 -22
- package/dist/utility/wrun/wrun-source-rows.util.js +62 -41
- package/dist/utility/wrun/wrun-tape-per-order.util.js +1 -20
- package/dist/utility/wrun/wrun-tape-source.util.d.ts +17 -9
- package/dist/utility/wrun/wrun-tape-source.util.js +20 -12
- package/dist/utility/wrun/wrun-volume-profile.util.js +37 -29
- package/dist/workers/constants/socket-slots.d.ts +91 -6
- package/dist/workers/constants/socket-slots.js +85 -6
- package/package.json +5 -5
- package/dist/kscript-data/controls/live-trades-order-gate.util.d.ts +0 -56
- package/dist/kscript-data/controls/live-trades-order-gate.util.js +0 -107
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The derived-roots table, a leaf with no imports: the wrun `underlying` knob (derived-roots.util) and the built-in
|
|
3
|
+
* options overlays' Chain row (utility/options/options-derived-root.util in the web app) read the same rows.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Contract F's mapping table (the kit's DERIVED_ROOTS in options.ts, row for row): a chart root and the roots whose
|
|
7
|
+
* chains its derived levels read, the first one the default (`defaultDerivedRoot`).
|
|
8
|
+
*/
|
|
9
|
+
export const WRUN_DERIVED_ROOTS = Object.freeze({
|
|
10
|
+
ES: Object.freeze(['SPX', 'SPY']),
|
|
11
|
+
NQ: Object.freeze(['NDX', 'QQQ']),
|
|
12
|
+
GC: Object.freeze(['GLD']),
|
|
13
|
+
SI: Object.freeze(['SLV']),
|
|
14
|
+
YM: Object.freeze(['DIA']),
|
|
15
|
+
RTY: Object.freeze(['IWM']),
|
|
16
|
+
SPY: Object.freeze(['SPX']),
|
|
17
|
+
QQQ: Object.freeze(['NDX']),
|
|
18
|
+
});
|
|
19
|
+
/** The roots the table maps `chartRoot` to, the default first; none for a root off the table. */
|
|
20
|
+
export function wrunDerivedRootsOf(chartRoot) {
|
|
21
|
+
const key = chartRoot.trim().toUpperCase();
|
|
22
|
+
return Object.prototype.hasOwnProperty.call(WRUN_DERIVED_ROOTS, key) ? WRUN_DERIVED_ROOTS[key] : [];
|
|
23
|
+
}
|
|
24
|
+
/** The root `underlying: "derived"` reads on a chart of `chartRoot`: the table's first, undefined off the table. */
|
|
25
|
+
export function defaultDerivedRoot(chartRoot) {
|
|
26
|
+
return wrunDerivedRootsOf(chartRoot)[0];
|
|
27
|
+
}
|
|
@@ -5,15 +5,7 @@ import { type WrunChartOptionsMarketDecision } from './run-schedule/wrun-chart-g
|
|
|
5
5
|
import type { WrunLaneChainDecider, WrunLaneChartChain } from './sources/opra-option-lanes.util.js';
|
|
6
6
|
import type { WrunPollLaneContext } from './sources/wrun-poll-lane.types.js';
|
|
7
7
|
import { type WrunOptionsChainCryptoVenueWord, type WrunOptionsChainDecision } from './wrun-options-chain.util.js';
|
|
8
|
-
|
|
9
|
-
* Contract F's mapping table (the kit's DERIVED_ROOTS in options.ts, row for row): a chart root and the roots whose
|
|
10
|
-
* chains its derived levels read, the first one the default (`defaultDerivedRoot`).
|
|
11
|
-
*/
|
|
12
|
-
export declare const WRUN_DERIVED_ROOTS: Readonly<Record<string, readonly string[]>>;
|
|
13
|
-
/** The roots the table maps `chartRoot` to, the default first; none for a root off the table. */
|
|
14
|
-
export declare function wrunDerivedRootsOf(chartRoot: string): readonly string[];
|
|
15
|
-
/** The root `underlying: "derived"` reads on a chart of `chartRoot`: the table's first, undefined off the table. */
|
|
16
|
-
export declare function defaultDerivedRoot(chartRoot: string): string | undefined;
|
|
8
|
+
export { WRUN_DERIVED_ROOTS, defaultDerivedRoot, wrunDerivedRootsOf } from './derived-roots.leaf.js';
|
|
17
9
|
/** The knob's name on a source. */
|
|
18
10
|
export declare const WRUN_UNDERLYING_KNOB = "underlying";
|
|
19
11
|
/** The knob's default word: the chart's own chain. */
|
|
@@ -49,29 +49,9 @@ import { wrunParamChoices } from './wrun-color-settings.util.js';
|
|
|
49
49
|
import { WRUN_OPTIONS_CHAIN_CRYPTO_VENUE_IDS, } from './wrun-options-chain.util.js';
|
|
50
50
|
import { refuseWrunOptionKnob } from './wrun-option-knobs.util.js';
|
|
51
51
|
import { attachWrunRefusal } from './wrun-refusal.util.js';
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
*/
|
|
56
|
-
export const WRUN_DERIVED_ROOTS = Object.freeze({
|
|
57
|
-
ES: Object.freeze(['SPX', 'SPY']),
|
|
58
|
-
NQ: Object.freeze(['NDX', 'QQQ']),
|
|
59
|
-
GC: Object.freeze(['GLD']),
|
|
60
|
-
SI: Object.freeze(['SLV']),
|
|
61
|
-
YM: Object.freeze(['DIA']),
|
|
62
|
-
RTY: Object.freeze(['IWM']),
|
|
63
|
-
SPY: Object.freeze(['SPX']),
|
|
64
|
-
QQQ: Object.freeze(['NDX']),
|
|
65
|
-
});
|
|
66
|
-
/** The roots the table maps `chartRoot` to, the default first; none for a root off the table. */
|
|
67
|
-
export function wrunDerivedRootsOf(chartRoot) {
|
|
68
|
-
const key = chartRoot.trim().toUpperCase();
|
|
69
|
-
return Object.prototype.hasOwnProperty.call(WRUN_DERIVED_ROOTS, key) ? WRUN_DERIVED_ROOTS[key] : [];
|
|
70
|
-
}
|
|
71
|
-
/** The root `underlying: "derived"` reads on a chart of `chartRoot`: the table's first, undefined off the table. */
|
|
72
|
-
export function defaultDerivedRoot(chartRoot) {
|
|
73
|
-
return wrunDerivedRootsOf(chartRoot)[0];
|
|
74
|
-
}
|
|
52
|
+
import { WRUN_DERIVED_ROOTS, defaultDerivedRoot } from './derived-roots.leaf.js';
|
|
53
|
+
// The table is the leaf's (derived-roots.leaf), so a reader of the rows alone never loads this module's graph.
|
|
54
|
+
export { WRUN_DERIVED_ROOTS, defaultDerivedRoot, wrunDerivedRootsOf } from './derived-roots.leaf.js';
|
|
75
55
|
/** The knob's name on a source. */
|
|
76
56
|
export const WRUN_UNDERLYING_KNOB = 'underlying';
|
|
77
57
|
/** The knob's default word: the chart's own chain. */
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { OptionsGateProvider } from '../../../workers/constants/socket-slots.js';
|
|
2
|
+
import type { OpraOptionPlaneStop, WrunChartOptionsMarket, WrunChartOptionsMarketRef, WrunGateReaderIntentSurface, WrunOptionsGateProvider, WrunGateReaderIntentWarm, WrunGateReaderReadKind } from '../../../host-ports.types.js';
|
|
2
3
|
/**
|
|
3
4
|
* The exchange a gate plane's lane reads name, the one the transport routes them by: an OPRA lane asks by the plane's
|
|
4
5
|
* own exchange whatever the chart's venue spelling (`wrunLaneOpraPlaneChain`, the stats lanes' `statsExchange`), a CME
|
|
5
6
|
* chain lane by the chart's own CME exchange.
|
|
6
7
|
*/
|
|
7
|
-
export declare function wrunGateReadExchangeOf(plane:
|
|
8
|
+
export declare function wrunGateReadExchangeOf(plane: OptionsGateProvider, chartExchange: string): string;
|
|
8
9
|
/** A chart market as a door names it: the market itself, or, from a door that holds the exchange alone, the exchange
|
|
9
10
|
* (no market named: a stock twin is never seen there, its venue's own options are read). */
|
|
10
11
|
export type WrunGateReaderChart = WrunChartOptionsMarketRef | string;
|
|
@@ -15,7 +16,7 @@ export interface WrunChartOptionsMarketDecision {
|
|
|
15
16
|
/** The market whose options the chart reads: the chart's own, or a stock twin's US stock (`twinOf` names the chart). */
|
|
16
17
|
market: WrunChartOptionsMarket;
|
|
17
18
|
/** The gate plane those options ride (`governedOptionPlane` over `market`), null for none. */
|
|
18
|
-
plane:
|
|
19
|
+
plane: WrunOptionsGateProvider | null;
|
|
19
20
|
/** Off every plane, the known reason options that list on OPRA ride none (`opraOptionPlaneStop` over `market`). */
|
|
20
21
|
opraStop?: OpraOptionPlaneStop;
|
|
21
22
|
}
|
|
@@ -11,8 +11,9 @@
|
|
|
11
11
|
*
|
|
12
12
|
* The rule (`serveWrunOwnCandles`), judged before the ask leaves:
|
|
13
13
|
* - the ask: the candle lane (`ohlcv`), naming no other market (no payload extras but the chart's own exchange and
|
|
14
|
-
* symbol
|
|
15
|
-
* the
|
|
14
|
+
* symbol, and the `candleSource` the chart's rows came from when they came from another market: a US stock Trades
|
|
15
|
+
* chart's tape), at the chart's interval (no interval option, or the chart's), never a replay run's (its window
|
|
16
|
+
* reaches the replay's forward runway, past the rows the chart shows);
|
|
16
17
|
* - the window `[fromTs, toTs]` (the end an inclusive bar, as the chart's fetch reads it) held whole by the chart's
|
|
17
18
|
* bars (`held`: the chart's rows, copied, so the lane's buffer never shares the forming bar the live feed rewrites);
|
|
18
19
|
* anything else is null and the wire answers the window whole, exactly as before: a window opening before the
|
|
@@ -28,7 +29,8 @@
|
|
|
28
29
|
export interface WrunOwnCandlesAsk {
|
|
29
30
|
/** The fetch type of the ask (`ohlcv` is the candle lane). */
|
|
30
31
|
type: string;
|
|
31
|
-
/** The payload extras of the ask beyond the current-market placeholders (a pinned market's exchange and symbol
|
|
32
|
+
/** The payload extras of the ask beyond the current-market placeholders (a pinned market's exchange and symbol, the
|
|
33
|
+
* `candleSource` its rows are read from). */
|
|
32
34
|
payloadExtras?: Readonly<Record<string, unknown>>;
|
|
33
35
|
/** The interval the ask rides (undefined: the chart's own). */
|
|
34
36
|
interval?: string;
|
|
@@ -52,5 +54,24 @@ export type WrunOwnCandlesServe = {
|
|
|
52
54
|
kind: 'held';
|
|
53
55
|
rows: number[][];
|
|
54
56
|
} | null;
|
|
57
|
+
/** A chart as the host's candle-source reader reads it: its metadata object, whose other fields the host may read. */
|
|
58
|
+
export type WrunMainCandleChart = {
|
|
59
|
+
exchange?: unknown;
|
|
60
|
+
symbol?: unknown;
|
|
61
|
+
};
|
|
62
|
+
/** The market a chart's main series is read from when it is not the chart's own (web: a US stock chart's tape). */
|
|
63
|
+
export type WrunMainCandleSourceReader = (chart: WrunMainCandleChart) => {
|
|
64
|
+
exchange: string;
|
|
65
|
+
symbol: string;
|
|
66
|
+
} | null;
|
|
67
|
+
/** The host's reader, one per realm (null removes it): without one every chart's rows are its own market's. */
|
|
68
|
+
export declare function registerWrunMainCandleSource(reader: WrunMainCandleSourceReader | null): void;
|
|
69
|
+
/** The market a chart's own rows came from when it is another than the chart's; undefined when the reader threw. */
|
|
70
|
+
export declare function wrunMainCandleSourceOf(chart: WrunMainCandleChart | null | undefined): {
|
|
71
|
+
exchange: string;
|
|
72
|
+
symbol: string;
|
|
73
|
+
} | null | undefined;
|
|
74
|
+
/** The venue a script wall judges for the chart's own candles: the market its rows came from, else its exchange. */
|
|
75
|
+
export declare function wrunChartCandleVenue(chart: WrunMainCandleChart | null | undefined): unknown;
|
|
55
76
|
/** The chart's own candles for an ask of the chart's series at its interval (the module note), or null. */
|
|
56
77
|
export declare function serveWrunOwnCandles(ask: WrunOwnCandlesAsk): WrunOwnCandlesServe;
|
|
@@ -11,8 +11,9 @@
|
|
|
11
11
|
*
|
|
12
12
|
* The rule (`serveWrunOwnCandles`), judged before the ask leaves:
|
|
13
13
|
* - the ask: the candle lane (`ohlcv`), naming no other market (no payload extras but the chart's own exchange and
|
|
14
|
-
* symbol
|
|
15
|
-
* the
|
|
14
|
+
* symbol, and the `candleSource` the chart's rows came from when they came from another market: a US stock Trades
|
|
15
|
+
* chart's tape), at the chart's interval (no interval option, or the chart's), never a replay run's (its window
|
|
16
|
+
* reaches the replay's forward runway, past the rows the chart shows);
|
|
16
17
|
* - the window `[fromTs, toTs]` (the end an inclusive bar, as the chart's fetch reads it) held whole by the chart's
|
|
17
18
|
* bars (`held`: the chart's rows, copied, so the lane's buffer never shares the forming bar the live feed rewrites);
|
|
18
19
|
* anything else is null and the wire answers the window whole, exactly as before: a window opening before the
|
|
@@ -25,21 +26,54 @@
|
|
|
25
26
|
* lane of a run asks through). The call-site census (tests/utility/wrun/run-schedule/wrun-own-candles.census.spec.ts)
|
|
26
27
|
* fails a new source fetch door in the package that this rule does not stand in front of.
|
|
27
28
|
*/
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
29
|
+
let mainCandleSourceReader = null;
|
|
30
|
+
/** The host's reader, one per realm (null removes it): without one every chart's rows are its own market's. */
|
|
31
|
+
export function registerWrunMainCandleSource(reader) {
|
|
32
|
+
mainCandleSourceReader = reader;
|
|
33
|
+
}
|
|
34
|
+
/** The market a chart's own rows came from when it is another than the chart's; undefined when the reader threw. */
|
|
35
|
+
export function wrunMainCandleSourceOf(chart) {
|
|
36
|
+
if (mainCandleSourceReader === null || !chart)
|
|
37
|
+
return null;
|
|
38
|
+
try {
|
|
39
|
+
return mainCandleSourceReader(chart);
|
|
40
|
+
}
|
|
41
|
+
catch {
|
|
42
|
+
return undefined;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
/** The venue a script wall judges for the chart's own candles: the market its rows came from, else its exchange. */
|
|
46
|
+
export function wrunChartCandleVenue(chart) {
|
|
47
|
+
return wrunMainCandleSourceOf(chart)?.exchange ?? chart?.exchange;
|
|
48
|
+
}
|
|
49
|
+
/** The candle source an ask's extras name (`candleSource`, the market its rows are read from), else null. */
|
|
50
|
+
function askedCandleSource(value) {
|
|
51
|
+
if (typeof value !== 'object' || value === null)
|
|
52
|
+
return null;
|
|
53
|
+
const { exchange, symbol } = value;
|
|
54
|
+
return typeof exchange === 'string' && typeof symbol === 'string' ? { exchange, symbol } : null;
|
|
55
|
+
}
|
|
56
|
+
/** Whether an ask names the chart's own series read where its rows came from (`rowsSource`, null: the chart's own). */
|
|
57
|
+
function asksRowsMarket(ask, rowsSource) {
|
|
58
|
+
let source = null;
|
|
59
|
+
for (const [key, value] of Object.entries(ask.payloadExtras ?? {})) {
|
|
34
60
|
if (value === undefined)
|
|
35
61
|
continue;
|
|
36
62
|
if (key === 'exchange' && value === ask.chart.exchange)
|
|
37
63
|
continue;
|
|
38
64
|
if (key === 'symbol' && value === ask.chart.symbol)
|
|
39
65
|
continue;
|
|
66
|
+
if (key === 'candleSource') {
|
|
67
|
+
source = askedCandleSource(value);
|
|
68
|
+
if (source !== null)
|
|
69
|
+
continue;
|
|
70
|
+
}
|
|
40
71
|
return false;
|
|
41
72
|
}
|
|
42
|
-
|
|
73
|
+
// An ask naming no source wants the chart's own market's bars: tape rows are never served for it, nor the reverse.
|
|
74
|
+
return source === null
|
|
75
|
+
? rowsSource === null
|
|
76
|
+
: rowsSource !== null && source.exchange === rowsSource.exchange && source.symbol === rowsSource.symbol;
|
|
43
77
|
}
|
|
44
78
|
/** The chart's own candles for an ask of the chart's series at its interval (the module note), or null. */
|
|
45
79
|
export function serveWrunOwnCandles(ask) {
|
|
@@ -47,7 +81,9 @@ export function serveWrunOwnCandles(ask) {
|
|
|
47
81
|
return null;
|
|
48
82
|
if (ask.interval !== undefined && ask.interval !== ask.chart.interval)
|
|
49
83
|
return null;
|
|
50
|
-
|
|
84
|
+
// A reader that threw reads unknown, so the wire answers; else the ask must name the market the rows came from.
|
|
85
|
+
const rowsSource = wrunMainCandleSourceOf(ask.chart);
|
|
86
|
+
if (rowsSource === undefined || !asksRowsMarket(ask, rowsSource))
|
|
51
87
|
return null;
|
|
52
88
|
const { rows, intervalMs } = ask.chart;
|
|
53
89
|
if (rows.length === 0 || !(intervalMs > 0) || !(ask.toTs >= ask.fromTs))
|
|
@@ -548,6 +548,8 @@ const WRUN_CME_WALL_SEED = Object.freeze({ cls: 'cme-wall' });
|
|
|
548
548
|
export function assertWrunLaneChainPlaneReadable(plane, exchange, run, ctx) {
|
|
549
549
|
if (plane === 'opra')
|
|
550
550
|
assertWrunOpraLaneReadable(run, ctx);
|
|
551
|
+
// OpenMarket's own packages only, whatever the `cme-user-scripts` gate says: the gate opens CME chart studies (the
|
|
552
|
+
// chart's own futures data), never CME options data (no implied expansion to CME options in this release).
|
|
551
553
|
if (plane === 'cme' && run?.official !== true) {
|
|
552
554
|
refuseWrunPollInput(ctx, `reads CME options data (${exchange}), which is open to OpenMarket's own Indicators only: a package you wrote ` +
|
|
553
555
|
'or added from the community cannot read it yet', WRUN_CME_WALL_SEED);
|
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* One
|
|
3
|
-
* `addMemo`).
|
|
4
|
-
*
|
|
5
|
-
* same add
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
2
|
+
* One record per ADD of what its reads landed (OPTLOAD W3, after R2 and FE-FOLD-CAP; wrun-row-lanes.util
|
|
3
|
+
* `fetchWrunRowLaneRows` `addMemo`). Every read of one row lane instance of a mounted indicator (its runs, its live
|
|
4
|
+
* start, each live reconcile) leaves the add a memo: the bars it landed whole and final with their rows. Every later
|
|
5
|
+
* read of the same add reuses the landed bars and asks only the bars the memo does not hold (a new bar at the head, a
|
|
6
|
+
* bar still forming). The reuse is unconditional: it never waits on the download budget (`wrun-download-budget-cut`).
|
|
7
|
+
* Gated on it, an add's live start and every live reconcile asked their whole window again: ES1! 1h Interval Flow on
|
|
8
|
+
* INT (2026-10-27, after the close) read its newest regular hour and the 26 h before it (0.68 MB), then its live row
|
|
9
|
+
* read that hour and the 6 h before it again, at +3.6 s and at +17 s (0.50 MB each), every bar of them final.
|
|
10
|
+
*
|
|
11
|
+
* The budget's cut alone stays behind its flag: a budgeted read also leaves the bars its budget cut (kept partial,
|
|
12
|
+
* never asked again by the add) and what it downloaded within which share (a later budgeted run reads what is left), so
|
|
13
|
+
* the add spends its budget once, not once a read. INT 2026-10-23, Premium by Strike 0.3.0 on ES1! 1h: the refresh run,
|
|
14
|
+
* the live start and a live reconcile each folded the same 3 newest bars again, 1.21 MB a read. A whole run (no budget
|
|
15
|
+
* applies) reads the add's memo with the budget's record dropped (`wrunRowLaneAddMemoWhole`).
|
|
9
16
|
*
|
|
10
17
|
* Off the boot path: wrun-row-lanes.util loads it only for a read that names an add.
|
|
11
18
|
*/
|
|
@@ -14,6 +21,38 @@ import { type WrunHostGridAsk } from '../wrun-tier-grid.util.js';
|
|
|
14
21
|
/** A landed bar is final once it ended this long before the read: a delayed route serves a bar's last buckets up to 15
|
|
15
22
|
* minutes after its close, so a bar closer to the clock is asked again by the add's next read. */
|
|
16
23
|
export declare const WRUN_ROW_LANE_FINAL_LAG_MS: number;
|
|
24
|
+
/**
|
|
25
|
+
* What one host bar's landed row depends on beyond its own span: the add memo's one eligibility rule, decided per row
|
|
26
|
+
* lane instance off its acquisition (wrun-row-lanes.util `wrunRowLaneRowDependencyOf`), so the memo never freezes a row
|
|
27
|
+
* a later read would answer otherwise (LIVE-REREAD review 2026-10-28: a whole session's sum, a carried next bar, a
|
|
28
|
+
* window-wide cut, the chart's newest trade date):
|
|
29
|
+
* - `bar`: the bar's own span and the data up to its end: final `WRUN_ROW_LANE_FINAL_LAG_MS` after the bar ends;
|
|
30
|
+
* - `session`: the whole trade date the bar falls on (`span: "session"`: one sum per contract per trade date, landed on
|
|
31
|
+
* the session's first bar and growing all session): final the lag after that trade date ends (`sessionEndMs`, on the
|
|
32
|
+
* chain's trade-date clock);
|
|
33
|
+
* - `next-bar`: the next bar with rows (a kit fold carrying the next bar's strikes): final once every bar after it, up
|
|
34
|
+
* to and including the next one with rows (`hasRows`), is whole and final too;
|
|
35
|
+
* - `never`: what no bar's clock settles (the window's newest cut, the chart's newest trade date under `history`
|
|
36
|
+
* "today"): the read neither reuses nor records a memo.
|
|
37
|
+
* Beside it, `emptyIsQuiet`: whether a bar the answer left with no row can be final at all. A flow's empty bar is quiet
|
|
38
|
+
* (nothing traded in it). A snapshot's is a picture not shown yet, asked again by every read: a read its worker failed
|
|
39
|
+
* and answered empty (option_strikes, option_surface), the older bars a folded strike kit read leaves unread past its
|
|
40
|
+
* cap, a CME surface bar whose settlement row is published after the bar's own end.
|
|
41
|
+
*/
|
|
42
|
+
export type WrunRowLaneRowDependency = (({
|
|
43
|
+
kind: 'bar';
|
|
44
|
+
} | {
|
|
45
|
+
kind: 'session';
|
|
46
|
+
sessionEndMs: (stampMs: number) => number;
|
|
47
|
+
} | {
|
|
48
|
+
kind: 'next-bar';
|
|
49
|
+
hasRows: (row: ReadonlyArray<unknown>) => boolean;
|
|
50
|
+
}) & {
|
|
51
|
+
emptyIsQuiet: boolean;
|
|
52
|
+
}) | {
|
|
53
|
+
kind: 'never';
|
|
54
|
+
why: string;
|
|
55
|
+
};
|
|
17
56
|
/** What the add's reads of one row lane instance hold (`wrunRowLaneAddMemoAfter`). */
|
|
18
57
|
export interface WrunRowLaneAddMemo {
|
|
19
58
|
/** The lane, its acquisition without any per-ask field, and the bar span: a read printing another reads another add
|
|
@@ -21,17 +60,19 @@ export interface WrunRowLaneAddMemo {
|
|
|
21
60
|
readonly fingerprint: string;
|
|
22
61
|
/** The bars read whole and final, each with its landed row (undefined: the bar answered nothing, an empty bar). */
|
|
23
62
|
readonly landed: ReadonlyMap<number, ReadonlyArray<unknown> | undefined>;
|
|
24
|
-
/** The bars the add's budget left partial: never asked again by the add. */
|
|
63
|
+
/** The bars the add's budget left partial: never asked again by the add (none without a budgeted read). */
|
|
25
64
|
readonly cut: ReadonlySet<number>;
|
|
26
|
-
/** What the add's budgeted reads downloaded, and the share they read within (a later run reads what is left).
|
|
65
|
+
/** What the add's budgeted reads downloaded, and the share they read within (a later budgeted run reads what is left).
|
|
66
|
+
* No share before a budgeted read names one: a later budgeted run then reads its own whole share. */
|
|
27
67
|
readonly spentBytes: number;
|
|
28
|
-
readonly shareBytes: number;
|
|
68
|
+
readonly shareBytes: number | undefined;
|
|
29
69
|
}
|
|
30
70
|
/** The add's memo, or undefined when it holds none or one of another fingerprint (dropped then). */
|
|
31
71
|
export declare function wrunRowLaneAddMemoOf(key: string, fingerprint: string): WrunRowLaneAddMemo | undefined;
|
|
32
72
|
export declare function rememberWrunRowLaneAdd(key: string, memo: WrunRowLaneAddMemo): void;
|
|
33
|
-
/**
|
|
34
|
-
|
|
73
|
+
/** The memo a whole run of the add reads (no budget applies: its plan fits, or the cut is off): the landed bars are
|
|
74
|
+
* still reused, the bars a budgeted read cut are asked again, and the add's spend and share start over. */
|
|
75
|
+
export declare function wrunRowLaneAddMemoWhole(memo: WrunRowLaneAddMemo): WrunRowLaneAddMemo;
|
|
35
76
|
/** Test seam: forget every memo. */
|
|
36
77
|
export declare function __resetWrunRowLaneAddMemosForTests(): void;
|
|
37
78
|
/** The asks over the bars `keep` keeps: each ask cut into the runs of its kept bars (a bar belongs to the ask its span
|
|
@@ -41,17 +82,23 @@ export declare function wrunRowLaneAsksOverBars(asks: readonly WrunHostGridAsk[]
|
|
|
41
82
|
intervalMs: number;
|
|
42
83
|
}, sessionGrid: LiveBucketVenue | null | undefined): WrunHostGridAsk[];
|
|
43
84
|
/**
|
|
44
|
-
* The add's memo after one of its reads
|
|
45
|
-
* partial mark on its row
|
|
46
|
-
*
|
|
47
|
-
*
|
|
85
|
+
* The add's memo after one of its reads, whatever its role and whether or not a budget applies: every bar the read
|
|
86
|
+
* asked that landed whole (not partial for the read, no partial mark on its row, and a row at all unless an empty bar
|
|
87
|
+
* is quiet for the instance) and final under the instance's dependency (`WrunRowLaneRowDependency`: the lag after the
|
|
88
|
+
* bar's own end, its trade date's end, or its next bar with rows' being whole and final too) joins the landed bars and
|
|
89
|
+
* leaves the cut; every bar the read's budget cut joins the cut unless it is landed; a budgeted read adds what it
|
|
90
|
+
* downloaded and names its share (a whole run and a live read add nothing: the add's budget is its budgeted runs').
|
|
48
91
|
*/
|
|
49
92
|
export declare function wrunRowLaneAddMemoAfter(args: {
|
|
50
93
|
previous: WrunRowLaneAddMemo | undefined;
|
|
51
94
|
fingerprint: string;
|
|
95
|
+
dependency: Exclude<WrunRowLaneRowDependency, {
|
|
96
|
+
kind: 'never';
|
|
97
|
+
}>;
|
|
52
98
|
window: {
|
|
53
99
|
intervalMs: number;
|
|
54
100
|
nowMs: number;
|
|
101
|
+
barOpens: readonly number[];
|
|
55
102
|
};
|
|
56
103
|
sessionGrid: LiveBucketVenue | null | undefined;
|
|
57
104
|
askedBars: Iterable<number>;
|
|
@@ -3,7 +3,8 @@ const MINUTE_MS = 60_000;
|
|
|
3
3
|
/** A landed bar is final once it ended this long before the read: a delayed route serves a bar's last buckets up to 15
|
|
4
4
|
* minutes after its close, so a bar closer to the clock is asked again by the add's next read. */
|
|
5
5
|
export const WRUN_ROW_LANE_FINAL_LAG_MS = 20 * MINUTE_MS;
|
|
6
|
-
/** The memos kept, the oldest dropped first: one for each
|
|
6
|
+
/** The memos kept, the oldest dropped first: one for each row lane instance of a mounted indicator. An add whose memo
|
|
7
|
+
* went asks its window whole on its next read and leaves a new one. */
|
|
7
8
|
const MEMOS_KEPT = 32;
|
|
8
9
|
const memos = new Map();
|
|
9
10
|
/** The add's memo, or undefined when it holds none or one of another fingerprint (dropped then). */
|
|
@@ -23,9 +24,18 @@ export function rememberWrunRowLaneAdd(key, memo) {
|
|
|
23
24
|
while (memos.size > MEMOS_KEPT)
|
|
24
25
|
memos.delete(memos.keys().next().value);
|
|
25
26
|
}
|
|
26
|
-
/**
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
/** The memo a whole run of the add reads (no budget applies: its plan fits, or the cut is off): the landed bars are
|
|
28
|
+
* still reused, the bars a budgeted read cut are asked again, and the add's spend and share start over. */
|
|
29
|
+
export function wrunRowLaneAddMemoWhole(memo) {
|
|
30
|
+
if (memo.cut.size === 0 && memo.spentBytes === 0 && memo.shareBytes === undefined)
|
|
31
|
+
return memo;
|
|
32
|
+
return {
|
|
33
|
+
fingerprint: memo.fingerprint,
|
|
34
|
+
landed: memo.landed,
|
|
35
|
+
cut: new Set(),
|
|
36
|
+
spentBytes: 0,
|
|
37
|
+
shareBytes: undefined,
|
|
38
|
+
};
|
|
29
39
|
}
|
|
30
40
|
/** Test seam: forget every memo. */
|
|
31
41
|
export function __resetWrunRowLaneAddMemosForTests() {
|
|
@@ -58,22 +68,56 @@ export function wrunRowLaneAsksOverBars(asks, keep, window, sessionGrid) {
|
|
|
58
68
|
return out;
|
|
59
69
|
}
|
|
60
70
|
/**
|
|
61
|
-
* The add's memo after one of its reads
|
|
62
|
-
* partial mark on its row
|
|
63
|
-
*
|
|
64
|
-
*
|
|
71
|
+
* The add's memo after one of its reads, whatever its role and whether or not a budget applies: every bar the read
|
|
72
|
+
* asked that landed whole (not partial for the read, no partial mark on its row, and a row at all unless an empty bar
|
|
73
|
+
* is quiet for the instance) and final under the instance's dependency (`WrunRowLaneRowDependency`: the lag after the
|
|
74
|
+
* bar's own end, its trade date's end, or its next bar with rows' being whole and final too) joins the landed bars and
|
|
75
|
+
* leaves the cut; every bar the read's budget cut joins the cut unless it is landed; a budgeted read adds what it
|
|
76
|
+
* downloaded and names its share (a whole run and a live read add nothing: the add's budget is its budgeted runs').
|
|
65
77
|
*/
|
|
66
78
|
export function wrunRowLaneAddMemoAfter(args) {
|
|
67
79
|
const landed = new Map(args.previous?.landed ?? []);
|
|
68
80
|
const cut = new Set(args.previous?.cut ?? []);
|
|
81
|
+
const { dependency } = args;
|
|
69
82
|
const finalBefore = args.window.nowMs - WRUN_ROW_LANE_FINAL_LAG_MS;
|
|
70
|
-
|
|
83
|
+
const asked = new Set(args.askedBars);
|
|
84
|
+
const endOf = (stampMs) => wrunHostBarSpanOf(stampMs, args.window.intervalMs, args.sessionGrid).toMs;
|
|
85
|
+
/** A bar this read landed whole, or one the add's memo already held (whole when it was admitted). A bar the answer
|
|
86
|
+
* left with no row is whole only where an empty bar is quiet (`emptyIsQuiet`: a flow's, never a snapshot's). */
|
|
87
|
+
const wholeAt = (stampMs) => {
|
|
88
|
+
if (!asked.has(stampMs))
|
|
89
|
+
return args.previous?.landed.has(stampMs) === true;
|
|
90
|
+
if (args.partialBars.has(stampMs))
|
|
91
|
+
return false;
|
|
71
92
|
const row = args.landedRows.get(stampMs);
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
93
|
+
return row === undefined || row.length <= 1 ? dependency.emptyIsQuiet : !args.marked(row);
|
|
94
|
+
};
|
|
95
|
+
const bars = [...args.window.barOpens].sort((a, b) => a - b);
|
|
96
|
+
const indexOf = new Map(bars.map((stampMs, at) => [stampMs, at]));
|
|
97
|
+
/** Whether a bar's row can no longer change: its own end, then what it depends on, the lag behind the read's clock. */
|
|
98
|
+
const finalAt = (stampMs) => {
|
|
99
|
+
if (endOf(stampMs) > finalBefore)
|
|
100
|
+
return false;
|
|
101
|
+
if (dependency.kind === 'bar')
|
|
102
|
+
return true;
|
|
103
|
+
if (dependency.kind === 'session')
|
|
104
|
+
return dependency.sessionEndMs(stampMs) <= finalBefore;
|
|
105
|
+
// The next bar with rows decides what this bar carries: every bar up to it must be whole and final, and it must be
|
|
106
|
+
// in the window (a bar whose next rows the read cannot see stays asked).
|
|
107
|
+
for (let at = (indexOf.get(stampMs) ?? bars.length) + 1; at < bars.length; at += 1) {
|
|
108
|
+
const next = bars[at];
|
|
109
|
+
if (endOf(next) > finalBefore || !wholeAt(next))
|
|
110
|
+
return false;
|
|
111
|
+
const row = args.landedRows.get(next);
|
|
112
|
+
if (row !== undefined && dependency.hasRows(row))
|
|
113
|
+
return true;
|
|
114
|
+
}
|
|
115
|
+
return false;
|
|
116
|
+
};
|
|
117
|
+
for (const stampMs of asked) {
|
|
118
|
+
if (!wholeAt(stampMs) || !finalAt(stampMs))
|
|
75
119
|
continue;
|
|
76
|
-
landed.set(stampMs,
|
|
120
|
+
landed.set(stampMs, args.landedRows.get(stampMs));
|
|
77
121
|
cut.delete(stampMs);
|
|
78
122
|
}
|
|
79
123
|
for (const stampMs of args.cutBars)
|
|
@@ -84,6 +128,6 @@ export function wrunRowLaneAddMemoAfter(args) {
|
|
|
84
128
|
landed,
|
|
85
129
|
cut,
|
|
86
130
|
spentBytes: (args.previous?.spentBytes ?? 0) + Math.max(0, args.spentBytes),
|
|
87
|
-
shareBytes: args.shareBytes ?? args.previous?.shareBytes
|
|
131
|
+
shareBytes: args.shareBytes ?? args.previous?.shareBytes,
|
|
88
132
|
};
|
|
89
133
|
}
|
|
@@ -44,6 +44,7 @@ import type { OpraOptionPlaneStop } from '../../../host-ports.types.js';
|
|
|
44
44
|
import type { WrunPollLaneFetchAsk } from './wrun-poll-lane.types.js';
|
|
45
45
|
import { type WrunLaneChainPlane, type WrunRowLaneCellInput, type WrunRowLaneDescriptor, type WrunRowLaneHorizon, type WrunRowLaneId, type WrunRowLaneInstance, type WrunRowLaneRowBudget } from './wrun-row-lane.types.js';
|
|
46
46
|
import { type WrunRunOptionsMarket } from '../derived-roots.util.js';
|
|
47
|
+
import type { WrunRowLaneRowDependency } from './wrun-row-lane-add-memo.util.js';
|
|
47
48
|
import type { WrunMissingFeed } from '../wrun-run-health.util.js';
|
|
48
49
|
import type { WrunLaneDownloadMeter } from '../wrun-download-plan.util.js';
|
|
49
50
|
import { type WrunBackendTier, type WrunHostGridAsk } from '../wrun-tier-grid.util.js';
|
|
@@ -263,19 +264,21 @@ export interface WrunRowLaneFetchOptions {
|
|
|
263
264
|
* A budgeted run's hold on this read (OPTLOAD W3 R2, `WrunRowLaneDownload`; wrun-download-plan.util): the newest slice
|
|
264
265
|
* is asked first and alone, then the newest older bars the read's share fits by the slice's own wire bytes, and no
|
|
265
266
|
* 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):
|
|
267
|
+
* the asks landed. Absent (a whole run, the flag off): the plan's asks, over the bars the add's memo does not hold.
|
|
267
268
|
*/
|
|
268
269
|
download?: WrunRowLaneDownload;
|
|
269
270
|
/**
|
|
270
|
-
* The add this read belongs to (OPTLOAD W3
|
|
271
|
-
*
|
|
272
|
-
*
|
|
273
|
-
*
|
|
274
|
-
*
|
|
275
|
-
*
|
|
276
|
-
* add's
|
|
277
|
-
*
|
|
278
|
-
*
|
|
271
|
+
* The add this read belongs to (OPTLOAD W3; wrun-row-lane-add-memo.util): `key` names the chart, the mounted
|
|
272
|
+
* indicator and the instance (`wrunRowLaneAddKey`), `role` the read. Every read that names its add leaves the add a
|
|
273
|
+
* memo of the bars it landed whole and final, and every later read of the add (a run's, the live start, a live
|
|
274
|
+
* reconcile) reuses them and asks only the rest: a new bar at the head, a bar still forming. Whether a download
|
|
275
|
+
* budget applies changes none of that; a budgeted run's read also leaves the bars its budget cut (kept partial by
|
|
276
|
+
* every later read) and what it downloaded (a later budgeted run reads within what is left of the add's share), and a
|
|
277
|
+
* run with no `download` (the add's plan is whole, or the cut is off) asks the cut bars again and starts the add's
|
|
278
|
+
* spend over. Absent (a read of no add: a spec, a probe): no memo is read or left. A replay's read (`replayCursorMs`)
|
|
279
|
+
* never reads or leaves the add's memo: it keeps one of its own (`role: 'replay'`, keyed by the lane, the acquisition
|
|
280
|
+
* and the bar span), so a later read at the same or a later cursor reuses the bars it landed and asks the rest. Every
|
|
281
|
+
* memo admits only the bars of asks the chart's fetch confirmed whole (`ask`'s verdict).
|
|
279
282
|
*/
|
|
280
283
|
addMemo?: {
|
|
281
284
|
key: string;
|
|
@@ -364,7 +367,8 @@ export interface WrunRowLaneBudgetCut {
|
|
|
364
367
|
* row budget (the smaller cut wins), the read asks its newest slice first and alone, then the newest older bars its
|
|
365
368
|
* share fits by the slice's own wire bytes, and no others; every bar it leaves unasked reads partial (bit 14 with the
|
|
366
369
|
* 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:
|
|
370
|
+
* (`onBudgetCut`, `budget: 'download'`). No early handover in that mode. Absent: the plan's asks, over the bars the
|
|
371
|
+
* add's memo does not hold (`opts.addMemo`).
|
|
368
372
|
*
|
|
369
373
|
* A replay's window (`window.replayCursorMs`, plan L6a): a flow or snapshot lane's bars end at the replay's cursor
|
|
370
374
|
* (`wrunRowLaneWindowAtReplayCursor`), so nothing after it is asked, and the read keeps a replay memo (the add memo's
|
|
@@ -381,6 +385,25 @@ export declare function fetchWrunRowLaneRows(lane: WrunRowLaneDescriptor, extras
|
|
|
381
385
|
fromTs: number;
|
|
382
386
|
toTs: number;
|
|
383
387
|
}, ask: (extras: Readonly<Record<string, unknown>>, fromTs: number, toTs: number, whole?: (whole: boolean) => void) => Promise<ReadonlyArray<ReadonlyArray<unknown>>>, opts?: WrunRowLaneFetchOptions): Promise<unknown[][]>;
|
|
388
|
+
/**
|
|
389
|
+
* What one host bar's landed row depends on beyond its own span, read off a row lane instance's acquisition: the add
|
|
390
|
+
* memo's ONE eligibility rule (wrun-row-lane-add-memo.util `WrunRowLaneRowDependency`), so no read reuses a row a later
|
|
391
|
+
* read would answer otherwise (LIVE-REREAD review 2026-10-28). By the acquisition's own words, whatever the lane:
|
|
392
|
+
* - a window-wide cut (`newest`, and `newestTailMs` beside it: the window's N newest prints, option_prints): a bar's
|
|
393
|
+
* rows depend on every newer print of the read's window: `never`;
|
|
394
|
+
* - `history: "today"` (the flow lanes): which bars hold rows depends on the trade date of the chart's newest bar (the K
|
|
395
|
+
* control's `todayFromMs`), which no bar's clock settles: `never`;
|
|
396
|
+
* - `span: "session"` (the flow lanes): one sum per contract per trade date on the session's first bar, growing all
|
|
397
|
+
* session: `session`, its trade date's end on the chain's clock (`optionTradeDateClockOf`, the clock the worker
|
|
398
|
+
* twins group by); `never` for a chain the acquisition names no exchange of;
|
|
399
|
+
* - a kit fold carrying the next bar's strikes (`wrunOptionLaneCarriesNext`): `next-bar`, its rows read as the paging
|
|
400
|
+
* seam reads them (`wrunOptionKitBarHasRows`);
|
|
401
|
+
* - anything else: `bar`, final the lag after its own end.
|
|
402
|
+
* And by the lane's landing, an empty bar: quiet on a flow (nothing traded), never final on a snapshot (`emptyIsQuiet`
|
|
403
|
+
* false: a picture not shown yet, a failed read answered empty, a folded kit read's older bars past its cap, a CME
|
|
404
|
+
* surface bar whose settlement row is not published yet; LIVE-REREAD sweep 2026-10-28).
|
|
405
|
+
*/
|
|
406
|
+
export declare function wrunRowLaneRowDependencyOf(lane: Pick<WrunRowLaneDescriptor, 'sourceClass' | 'chain' | 'landing'>, extras: Readonly<Record<string, unknown>>): WrunRowLaneRowDependency;
|
|
384
407
|
/**
|
|
385
408
|
* A landed row with every packed block (a Float64Array a worker handed the page by transfer, `count x width` values back
|
|
386
409
|
* to back: OPTLOAD G5 O6) split into plain tuples of `width` values, every other cell as it is; a new array. The one
|