@orangecharts/wrun-chart-host 0.11.1 → 0.15.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.
- package/README.md +1 -0
- package/dist/constants/feature-flags.constants.d.ts +4 -4
- package/dist/constants/feature-flags.constants.js +38 -52
- package/dist/constants/feature-limits.constants.d.ts +1 -1
- package/dist/constants/feature-limits.constants.js +5 -4
- package/dist/constants/interval.constants.d.ts +7 -0
- package/dist/constants/interval.constants.js +7 -0
- package/dist/constants/scriptEditor/cme-official-scripts.constants.d.ts +20 -149
- package/dist/constants/scriptEditor/cme-official-scripts.constants.js +20 -309
- package/dist/constants/stocks-compliance.constants.d.ts +15 -0
- package/dist/constants/stocks-compliance.constants.js +15 -0
- package/dist/host-env.d.ts +69 -3
- package/dist/host-env.js +21 -0
- package/dist/host-ports.types.d.ts +36 -3
- package/dist/index.d.ts +18 -0
- package/dist/index.js +19 -0
- package/dist/indicators/controls/tpo-session.util.d.ts +52 -12
- package/dist/indicators/controls/tpo-session.util.js +113 -16
- package/dist/instances/script-engine-worker-ohlcv-transfer.d.ts +6 -0
- package/dist/instances/script-engine-worker-ohlcv-transfer.js +16 -0
- package/dist/interfaces/cme-realtime.interface.d.ts +8 -0
- package/dist/interfaces/cme-realtime.interface.js +2 -1
- package/dist/interfaces/feed.interface.d.ts +15 -1
- package/dist/interfaces/replay.interface.d.ts +5 -0
- package/dist/interfaces/stocks-realtime.interface.d.ts +4 -3
- package/dist/interfaces/stocks-realtime.interface.js +5 -4
- package/dist/interfaces/wrun-runtime.interface.d.ts +141 -20
- package/dist/kscript-data/controls/live-ohlcv-merge.util.d.ts +17 -0
- package/dist/kscript-data/controls/live-ohlcv-merge.util.js +22 -0
- package/dist/kscript-data/controls/live-trades-merge.util.d.ts +46 -40
- package/dist/kscript-data/controls/live-trades-merge.util.js +80 -107
- package/dist/market-data/billing.interface.d.ts +9 -1
- package/dist/market-data/venue.d.ts +1 -1
- package/dist/market-data/venues/index.d.ts +5 -5
- package/dist/market-data/venues/opra.js +3 -3
- package/dist/market-data/venues/stocks.contract.copy.json +6 -5
- package/dist/market-data/venues/stocks.d.ts +5 -5
- package/dist/market-data/venues/stocks.js +21 -18
- package/dist/settings-templates/frvp-fields.d.ts +12 -1
- package/dist/settings-templates/frvp-fields.js +15 -4
- package/dist/settings-templates/index.js +12 -5
- package/dist/settings-templates/indicator-fields.js +43 -2
- package/dist/settings-templates/tool-rules.d.ts +17 -8
- package/dist/settings-templates/tool-rules.js +15 -8
- package/dist/settings-templates/tool-tables.generated.js +4 -2
- package/dist/utility/auth/server-clock.util.d.ts +3 -1
- package/dist/utility/auth/server-clock.util.js +3 -1
- package/dist/utility/chart/book-live-bucket.util.js +2 -2
- package/dist/utility/chart/cache-alignment.util.d.ts +38 -7
- package/dist/utility/chart/cache-alignment.util.js +50 -13
- package/dist/utility/chart/chart-data-fetch-generation.util.d.ts +2 -0
- package/dist/utility/chart/chart-data-fetch-generation.util.js +16 -0
- package/dist/utility/chart/cme-session-bucket.util.d.ts +18 -75
- package/dist/utility/chart/cme-session-bucket.util.js +25 -332
- package/dist/utility/chart/continuous-contracts.util.js +6 -5
- package/dist/utility/chart/display-offset.leaf.d.ts +24 -0
- package/dist/utility/chart/display-offset.leaf.js +41 -0
- package/dist/utility/chart/effective-chart-session.util.d.ts +2 -1
- package/dist/utility/chart/effective-chart-session.util.js +13 -5
- package/dist/utility/chart/feed-interval.util.d.ts +6 -20
- package/dist/utility/chart/feed-interval.util.js +13 -22
- package/dist/utility/chart/fetch-dedupe-policy.util.d.ts +27 -7
- package/dist/utility/chart/fetch-dedupe-policy.util.js +86 -11
- package/dist/utility/chart/footprint-band.util.d.ts +21 -5
- package/dist/utility/chart/footprint-band.util.js +53 -14
- package/dist/utility/chart/host-bar-placement.util.d.ts +7 -4
- package/dist/utility/chart/host-bar-placement.util.js +8 -2
- package/dist/utility/chart/indicator-inflight-registry.util.d.ts +32 -0
- package/dist/utility/chart/indicator-inflight-registry.util.js +52 -0
- package/dist/utility/chart/indicator-run-interval.util.d.ts +10 -4
- package/dist/utility/chart/indicator-run-interval.util.js +21 -12
- package/dist/utility/chart/interval-registry.util.d.ts +1 -1
- package/dist/utility/chart/interval-registry.util.js +1 -1
- package/dist/utility/chart/kscript-legend-entries.util.d.ts +12 -0
- package/dist/utility/chart/kscript-legend-entries.util.js +16 -0
- package/dist/utility/chart/kscript-run-interval-projection.util.d.ts +1 -1
- package/dist/utility/chart/kscript-run-interval-projection.util.js +4 -2
- package/dist/utility/chart/kscript-venue-policy.util.d.ts +53 -62
- package/dist/utility/chart/kscript-venue-policy.util.js +85 -94
- package/dist/utility/chart/live-bucket.util.d.ts +39 -17
- package/dist/utility/chart/live-bucket.util.js +103 -57
- package/dist/utility/chart/local-kscript-source-revalidation.util.d.ts +58 -20
- package/dist/utility/chart/local-kscript-source-revalidation.util.js +98 -23
- package/dist/utility/chart/local-kscript-warmup-depth.util.d.ts +35 -11
- package/dist/utility/chart/local-kscript-warmup-depth.util.js +24 -3
- package/dist/utility/chart/market-session-schedule.util.d.ts +8 -0
- package/dist/utility/chart/market-session-schedule.util.js +39 -1
- package/dist/utility/chart/market-session.util.d.ts +136 -0
- package/dist/utility/chart/market-session.util.js +341 -0
- package/dist/utility/chart/om-panel.util.d.ts +5 -3
- package/dist/utility/chart/om-panel.util.js +42 -7
- package/dist/utility/chart/om-target.util.d.ts +14 -1
- package/dist/utility/chart/om-target.util.js +22 -5
- package/dist/utility/chart/opra-read-access.leaf.d.ts +16 -1
- package/dist/utility/chart/opra-read-access.leaf.js +22 -0
- package/dist/utility/chart/profile-row-height.util.d.ts +49 -16
- package/dist/utility/chart/profile-row-height.util.js +74 -37
- package/dist/utility/chart/rth-session.util.d.ts +55 -20
- package/dist/utility/chart/rth-session.util.js +94 -46
- package/dist/utility/chart/session-lattice.util.d.ts +150 -0
- package/dist/utility/chart/session-lattice.util.js +488 -0
- package/dist/utility/chart/trading-day.util.d.ts +40 -2
- package/dist/utility/chart/trading-day.util.js +84 -7
- package/dist/utility/chart/us-equities-session.util.d.ts +32 -11
- package/dist/utility/chart/us-equities-session.util.js +44 -15
- package/dist/utility/chart/window-geometry.leaf.d.ts +28 -7
- package/dist/utility/chart/window-geometry.leaf.js +57 -8
- package/dist/utility/chart/wrun-bar-session-facts.util.d.ts +21 -14
- package/dist/utility/chart/wrun-bar-session-facts.util.js +32 -38
- package/dist/utility/chart/wrun-run-result.util.d.ts +38 -13
- package/dist/utility/chart/wrun-run-result.util.js +97 -27
- package/dist/utility/common/time.util.js +5 -4
- package/dist/utility/market-events/earnings-scope.util.d.ts +10 -5
- package/dist/utility/market-events/earnings-scope.util.js +17 -9
- package/dist/utility/market-events/market-events.util.d.ts +14 -7
- package/dist/utility/market-events/market-events.util.js +30 -17
- package/dist/utility/number-format.util.d.ts +14 -21
- package/dist/utility/number-format.util.js +38 -24
- package/dist/utility/options/option-venue-disclosure.util.d.ts +40 -6
- package/dist/utility/options/option-venue-disclosure.util.js +71 -11
- package/dist/utility/options/option-venue.util.d.ts +1 -1
- package/dist/utility/options/option-venue.util.js +1 -1
- package/dist/utility/pool-symbol.leaf.d.ts +7 -0
- package/dist/utility/pool-symbol.leaf.js +50 -5
- package/dist/utility/stocks/stock-display.util.d.ts +15 -0
- package/dist/utility/stocks/stock-display.util.js +37 -0
- package/dist/utility/symbol-selection/contract-expiry.util.js +5 -4
- package/dist/utility/v2/gate-plane.util.d.ts +6 -0
- package/dist/utility/v2/gate-plane.util.js +11 -1
- package/dist/utility/v2/gate-session-latch.util.d.ts +1 -1
- package/dist/utility/v2/gate-session-latch.util.js +3 -3
- package/dist/utility/v2/governed-tier.leaf.d.ts +17 -16
- package/dist/utility/v2/governed-tier.leaf.js +17 -16
- package/dist/utility/v2/stocks-governed.util.d.ts +5 -0
- package/dist/utility/v2/stocks-governed.util.js +14 -0
- package/dist/utility/v2/v2-enums.leaf.d.ts +13 -0
- package/dist/utility/v2/v2-enums.leaf.js +458 -0
- package/dist/utility/wrun/derived-roots.leaf.d.ts +21 -1
- package/dist/utility/wrun/derived-roots.leaf.js +27 -1
- package/dist/utility/wrun/derived-roots.util.d.ts +44 -32
- package/dist/utility/wrun/derived-roots.util.js +97 -56
- package/dist/utility/wrun/run-schedule/wrun-late-reads.util.d.ts +4 -3
- package/dist/utility/wrun/run-schedule/wrun-late-reads.util.js +4 -3
- package/dist/utility/wrun/sources/lanes/option_daily.d.ts +2 -1
- package/dist/utility/wrun/sources/lanes/option_daily.js +2 -1
- package/dist/utility/wrun/sources/lanes/options_flow.d.ts +3 -0
- package/dist/utility/wrun/sources/lanes/options_flow.js +23 -5
- package/dist/utility/wrun/sources/opra-option-lanes.util.d.ts +3 -4
- package/dist/utility/wrun/sources/row-lane-registry.js +9 -4
- package/dist/utility/wrun/sources/row-lanes/dark_pool.d.ts +19 -0
- package/dist/utility/wrun/sources/row-lanes/dark_pool.js +104 -0
- package/dist/utility/wrun/sources/row-lanes/index.js +2 -0
- package/dist/utility/wrun/sources/wrun-lane-fetch-abort.util.d.ts +20 -0
- package/dist/utility/wrun/sources/wrun-lane-fetch-abort.util.js +103 -0
- package/dist/utility/wrun/sources/wrun-poll-lane.types.d.ts +19 -2
- package/dist/utility/wrun/sources/wrun-poll-lanes.util.d.ts +15 -13
- package/dist/utility/wrun/sources/wrun-poll-lanes.util.js +49 -23
- package/dist/utility/wrun/sources/wrun-row-lane.types.d.ts +14 -9
- package/dist/utility/wrun/sources/wrun-row-lanes.util.d.ts +75 -27
- package/dist/utility/wrun/sources/wrun-row-lanes.util.js +139 -82
- package/dist/utility/wrun/wrun-app-layer.leaf.d.ts +78 -0
- package/dist/utility/wrun/wrun-app-layer.leaf.js +89 -0
- package/dist/utility/wrun/wrun-bar-count.util.d.ts +11 -7
- package/dist/utility/wrun/wrun-bar-count.util.js +12 -8
- package/dist/utility/wrun/wrun-batched-kinds.leaf.d.ts +13 -0
- package/dist/utility/wrun/wrun-batched-kinds.leaf.js +18 -0
- package/dist/utility/wrun/wrun-batched-marks.util.d.ts +46 -23
- package/dist/utility/wrun/wrun-batched-marks.util.js +260 -62
- package/dist/utility/wrun/wrun-batched-readout.util.d.ts +26 -19
- package/dist/utility/wrun/wrun-batched-readout.util.js +81 -27
- package/dist/utility/wrun/wrun-book-bands.leaf.d.ts +8 -0
- package/dist/utility/wrun/wrun-book-bands.leaf.js +7 -0
- package/dist/utility/wrun/wrun-candle-equal.leaf.d.ts +19 -0
- package/dist/utility/wrun/wrun-candle-equal.leaf.js +40 -0
- package/dist/utility/wrun/wrun-canvas-readout.util.d.ts +4 -2
- package/dist/utility/wrun/wrun-canvases.util.d.ts +24 -7
- package/dist/utility/wrun/wrun-canvases.util.js +99 -30
- package/dist/utility/wrun/wrun-chart-context-names.util.d.ts +6 -3
- package/dist/utility/wrun/wrun-chart-context-names.util.js +8 -4
- package/dist/utility/wrun/wrun-chart-market-facts.util.d.ts +47 -29
- package/dist/utility/wrun/wrun-chart-market-facts.util.js +201 -201
- package/dist/utility/wrun/wrun-child-overlay-id.util.js +2 -1
- package/dist/utility/wrun/wrun-cme-legs-note.util.d.ts +15 -0
- package/dist/utility/wrun/wrun-cme-legs-note.util.js +49 -0
- package/dist/utility/wrun/wrun-cme-root-specs.util.d.ts +38 -0
- package/dist/utility/wrun/wrun-cme-root-specs.util.js +81 -0
- package/dist/utility/wrun/wrun-coin-lane-live.util.js +3 -0
- package/dist/utility/wrun/wrun-color-settings.util.d.ts +6 -1
- package/dist/utility/wrun/wrun-color-settings.util.js +32 -7
- package/dist/utility/wrun/wrun-dark-pool.util.d.ts +50 -0
- package/dist/utility/wrun/wrun-dark-pool.util.js +127 -0
- package/dist/utility/wrun/wrun-declared-warmup.util.d.ts +67 -12
- package/dist/utility/wrun/wrun-declared-warmup.util.js +165 -13
- package/dist/utility/wrun/wrun-draft-legend-note.util.d.ts +18 -8
- package/dist/utility/wrun/wrun-draft-legend-note.util.js +57 -11
- package/dist/utility/wrun/wrun-draft-overlay.util.d.ts +14 -10
- package/dist/utility/wrun/wrun-draft-overlay.util.js +26 -14
- package/dist/utility/wrun/wrun-earnings-facts.util.js +3 -2
- package/dist/utility/wrun/wrun-etf-funds.util.d.ts +2 -0
- package/dist/utility/wrun/wrun-etf-funds.util.js +4 -0
- package/dist/utility/wrun/wrun-held-lanes.util.js +8 -2
- package/dist/utility/wrun/wrun-history-as-of.util.d.ts +77 -0
- package/dist/utility/wrun/wrun-history-as-of.util.js +108 -0
- package/dist/utility/wrun/wrun-host.service.d.ts +64 -14
- package/dist/utility/wrun/wrun-host.service.js +137 -27
- package/dist/utility/wrun/wrun-hosted-wire-caps.d.ts +3 -3
- package/dist/utility/wrun/wrun-hosted-wire-caps.js +12 -2
- package/dist/utility/wrun/wrun-hover.util.d.ts +8 -2
- package/dist/utility/wrun/wrun-hover.util.js +24 -13
- package/dist/utility/wrun/wrun-inert-legend.util.d.ts +13 -0
- package/dist/utility/wrun/wrun-inert-legend.util.js +31 -3
- package/dist/utility/wrun/wrun-input-requirements.leaf.d.ts +7 -5
- package/dist/utility/wrun/wrun-input-requirements.leaf.js +16 -6
- package/dist/utility/wrun/wrun-install-pacer.util.d.ts +26 -0
- package/dist/utility/wrun/wrun-install-pacer.util.js +145 -0
- package/dist/utility/wrun/wrun-kit-refusal-stages.types.d.ts +22 -0
- package/dist/utility/wrun/wrun-kit-refusal-stages.types.js +1 -0
- package/dist/utility/wrun/wrun-lane-refusal.leaf.d.ts +12 -5
- package/dist/utility/wrun/wrun-lane-refusal.leaf.js +23 -5
- package/dist/utility/wrun/wrun-lane-warmup.util.js +22 -4
- package/dist/utility/wrun/wrun-leg-close.util.d.ts +6 -5
- package/dist/utility/wrun/wrun-leg-close.util.js +11 -9
- package/dist/utility/wrun/wrun-leg-fetch.util.d.ts +3 -1
- package/dist/utility/wrun/wrun-leg-fetch.util.js +9 -2
- package/dist/utility/wrun/wrun-levels-child.util.d.ts +2 -0
- package/dist/utility/wrun/wrun-levels-child.util.js +6 -0
- package/dist/utility/wrun/wrun-lifecycle.contract.d.ts +4 -0
- package/dist/utility/wrun/wrun-live-intake.util.d.ts +15 -6
- package/dist/utility/wrun/wrun-live-intake.util.js +167 -47
- package/dist/utility/wrun/wrun-live-tick.util.d.ts +52 -8
- package/dist/utility/wrun/wrun-live-tick.util.js +655 -97
- package/dist/utility/wrun/wrun-market-facts.util.d.ts +16 -2
- package/dist/utility/wrun/wrun-market-facts.util.js +32 -3
- package/dist/utility/wrun/wrun-market-size-defaults.leaf.d.ts +27 -27
- package/dist/utility/wrun/wrun-market-size-defaults.leaf.js +28 -16
- package/dist/utility/wrun/wrun-market-size-defaults.util.js +34 -5
- package/dist/utility/wrun/wrun-oi-lane.util.d.ts +10 -7
- package/dist/utility/wrun/wrun-oi-lane.util.js +16 -10
- package/dist/utility/wrun/wrun-option-strike-flow.util.js +1 -1
- package/dist/utility/wrun/wrun-option-views.util.d.ts +2 -2
- package/dist/utility/wrun/wrun-option-views.util.js +5 -2
- package/dist/utility/wrun/wrun-options-flow-underlying.leaf.d.ts +5 -0
- package/dist/utility/wrun/wrun-options-flow-underlying.leaf.js +16 -0
- package/dist/utility/wrun/wrun-options-stop.util.d.ts +3 -2
- package/dist/utility/wrun/wrun-options-stop.util.js +6 -4
- package/dist/utility/wrun/wrun-output-words.util.d.ts +14 -0
- package/dist/utility/wrun/wrun-output-words.util.js +51 -0
- package/dist/utility/wrun/wrun-overlay-drivers.util.d.ts +116 -11
- package/dist/utility/wrun/wrun-overlay-drivers.util.js +208 -43
- package/dist/utility/wrun/wrun-overlay-lifecycle.util.js +20 -10
- package/dist/utility/wrun/wrun-overlay-park.util.d.ts +84 -0
- package/dist/utility/wrun/wrun-overlay-park.util.js +135 -0
- package/dist/utility/wrun/wrun-overlay-recovery.util.d.ts +37 -4
- package/dist/utility/wrun/wrun-overlay-recovery.util.js +26 -14
- package/dist/utility/wrun/wrun-overlay-result.util.d.ts +6 -1
- package/dist/utility/wrun/wrun-overlay-result.util.js +2 -0
- package/dist/utility/wrun/wrun-overlay-run.util.d.ts +247 -26
- package/dist/utility/wrun/wrun-overlay-run.util.js +2234 -408
- package/dist/utility/wrun/wrun-pack.util.d.ts +8 -5
- package/dist/utility/wrun/wrun-panel-mount.util.d.ts +11 -2
- package/dist/utility/wrun/wrun-panel-mount.util.js +122 -19
- package/dist/utility/wrun/wrun-panel-style.util.d.ts +4 -2
- package/dist/utility/wrun/wrun-panel-style.util.js +3 -2
- package/dist/utility/wrun/wrun-pin-spelling.util.d.ts +7 -0
- package/dist/utility/wrun/wrun-pin-spelling.util.js +18 -4
- package/dist/utility/wrun/wrun-pin-venues.util.d.ts +26 -17
- package/dist/utility/wrun/wrun-pin-venues.util.js +43 -36
- package/dist/utility/wrun/wrun-pinned-lanes.util.d.ts +58 -0
- package/dist/utility/wrun/wrun-pinned-lanes.util.js +72 -0
- package/dist/utility/wrun/wrun-prefix-cohort.util.js +2 -1
- package/dist/utility/wrun/wrun-prefix-lanes.util.d.ts +22 -9
- package/dist/utility/wrun/wrun-prefix-lanes.util.js +145 -26
- package/dist/utility/wrun/wrun-prefix-proof.util.d.ts +29 -0
- package/dist/utility/wrun/wrun-prefix-proof.util.js +23 -5
- package/dist/utility/wrun/wrun-refusal-surface.util.d.ts +9 -1
- package/dist/utility/wrun/wrun-refusal-surface.util.js +15 -1
- package/dist/utility/wrun/wrun-refusal.util.d.ts +19 -1
- package/dist/utility/wrun/wrun-refusal.util.js +103 -16
- package/dist/utility/wrun/wrun-registry-errors.util.d.ts +20 -6
- package/dist/utility/wrun/wrun-registry-errors.util.js +20 -6
- package/dist/utility/wrun/wrun-replay-rows.util.js +6 -10
- package/dist/utility/wrun/wrun-run-health.util.d.ts +95 -5
- package/dist/utility/wrun/wrun-run-health.util.js +209 -3
- package/dist/utility/wrun/wrun-run-interval-session.util.d.ts +2 -2
- package/dist/utility/wrun/wrun-run-interval-session.util.js +2 -2
- package/dist/utility/wrun/wrun-run-interval.util.d.ts +9 -8
- package/dist/utility/wrun/wrun-run-interval.util.js +13 -11
- package/dist/utility/wrun/wrun-sandbox-row-source.js +5 -2
- package/dist/utility/wrun/wrun-script-inputs.util.d.ts +38 -11
- package/dist/utility/wrun/wrun-script-inputs.util.js +194 -56
- package/dist/utility/wrun/wrun-session-composition.util.d.ts +81 -0
- package/dist/utility/wrun/wrun-session-composition.util.js +169 -0
- package/dist/utility/wrun/wrun-setting-words.util.d.ts +10 -7
- package/dist/utility/wrun/wrun-setting-words.util.js +25 -7
- package/dist/utility/wrun/wrun-source-rows.util.d.ts +94 -28
- package/dist/utility/wrun/wrun-source-rows.util.js +738 -93
- package/dist/utility/wrun/wrun-stream-clock.util.d.ts +45 -0
- package/dist/utility/wrun/wrun-stream-clock.util.js +108 -0
- package/dist/utility/wrun/wrun-style-names.util.d.ts +23 -0
- package/dist/utility/wrun/wrun-style-names.util.js +74 -0
- package/dist/utility/wrun/wrun-tape-coins.util.d.ts +116 -0
- package/dist/utility/wrun/wrun-tape-coins.util.js +110 -0
- package/dist/utility/wrun/wrun-tape-source.util.d.ts +62 -32
- package/dist/utility/wrun/wrun-tape-source.util.js +72 -34
- package/dist/utility/wrun/wrun-tier-grid.util.d.ts +13 -5
- package/dist/utility/wrun/wrun-tier-grid.util.js +23 -13
- package/dist/utility/wrun/wrun-tpo-rows.util.js +2 -1
- package/dist/utility/wrun/wrun-trades-lane.util.d.ts +73 -0
- package/dist/utility/wrun/wrun-trades-lane.util.js +82 -0
- package/dist/utility/wrun/wrun-twin-compute-inputs.util.d.ts +5 -0
- package/dist/utility/wrun/wrun-twin-compute-inputs.util.js +9 -2
- package/dist/utility/wrun/wrun-visibility-table.d.ts +13 -0
- package/dist/utility/wrun/wrun-visibility-table.js +9 -0
- package/dist/utility/wrun/wrun-volume-profile.util.js +7 -3
- package/dist/utils/replay/replay-buffer-math.d.ts +16 -6
- package/dist/utils/replay/replay-buffer-math.js +60 -30
- package/dist/workers/constants/socket-slots.d.ts +11 -7
- package/dist/workers/constants/socket-slots.js +6 -5
- package/package.json +5 -5
|
@@ -35,7 +35,9 @@
|
|
|
35
35
|
* asking for rows the last good run already computed over the same main rows
|
|
36
36
|
* is skipped (the kScript wave's duplicate-range rule, widened to coverage: a
|
|
37
37
|
* pan-back page's live rebuild already computed the rows its wave then asks
|
|
38
|
-
* for)
|
|
38
|
+
* for), and one the live tick's open backward-extension rebuild episode takes
|
|
39
|
+
* in runs nothing (WRUN-PANBACK A2: the episode's one handoff rebuilds every
|
|
40
|
+
* page of the gesture). Settled runs and successful computes are announced through hooks, so
|
|
39
41
|
* the lifecycle door and the recovery ladders follow the executor without
|
|
40
42
|
* this module importing them.
|
|
41
43
|
*
|
|
@@ -81,8 +83,10 @@ import { WrunChartGoneError, WrunDeadlineError } from './wrun-registry-errors.ut
|
|
|
81
83
|
import { closeWrunRefusalAttempts, concludeWrunRefusalAttempt, liveWrunRefusalAttempt, openWrunRefusalAttempt, wrunRefusalAttemptOrigin, } from './wrun-refusal-surface.util.js';
|
|
82
84
|
import { attachWrunRefusal, stampWrunRefusalTelemetry } from './wrun-refusal.util.js';
|
|
83
85
|
import { wrunRunFailedIdentityOf } from './wrun-cap-notice.util.js';
|
|
86
|
+
import { __resetWrunHistoryAsOfForTests, forgetWrunHistoryAsOf } from './wrun-history-as-of.util.js';
|
|
84
87
|
import { effectiveChartSessionType } from '../chart/effective-chart-session.util.js';
|
|
85
|
-
import {
|
|
88
|
+
import { wrunMainCandleSourceOf } from './run-schedule/wrun-own-candles.util.js';
|
|
89
|
+
import { hasWrunChartHostEnv, wrunChartHostEnv } from '../../host-env.js';
|
|
86
90
|
const drivers = new Map();
|
|
87
91
|
/** The executor's merge rank (wrun-lifecycle.contract.ts): settings > switch
|
|
88
92
|
* > theme > resume = retry > heal > live-rebuild > the range reasons.
|
|
@@ -121,11 +125,20 @@ function wrunRunRequestOf(options) {
|
|
|
121
125
|
...(options?.prefix && reason === 'lazy-range-refresh' ? { prefix: options.prefix } : {}),
|
|
122
126
|
// Only a source-recovery rung answers its episode's attempt.
|
|
123
127
|
...(options?.episode && reason === 'source-recovery' ? { episode: options.episode } : {}),
|
|
128
|
+
...wrunGestureHeldOf(options?.gestureHeldMs),
|
|
124
129
|
};
|
|
125
130
|
}
|
|
126
|
-
/** The
|
|
131
|
+
/** The pan hold a request carries (`gestureHeldMs`): a positive finite number of ms, else nothing. */
|
|
132
|
+
function wrunGestureHeldOf(gestureHeldMs) {
|
|
133
|
+
return gestureHeldMs !== undefined && Number.isFinite(gestureHeldMs) && gestureHeldMs > 0 ? { gestureHeldMs } : {};
|
|
134
|
+
}
|
|
135
|
+
/** The options a driver's rerun receives: the reason, the window and the pan hold the episode already spent. */
|
|
127
136
|
function wrunRerunOptionsOf(request) {
|
|
128
|
-
return
|
|
137
|
+
return {
|
|
138
|
+
reason: request.reason,
|
|
139
|
+
...(request.window ? { window: request.window } : {}),
|
|
140
|
+
...wrunGestureHeldOf(request.gestureHeldMs),
|
|
141
|
+
};
|
|
129
142
|
}
|
|
130
143
|
/** Latest-wins by rank: the higher-ranked reason wins and a tie goes to the
|
|
131
144
|
* newer request; the wider window wins (a tie to the newer), and an absent
|
|
@@ -143,12 +156,33 @@ function mergeWrunRunRequests(pending, incoming) {
|
|
|
143
156
|
// A rung's episode survives only while the merged request is still a rung (the newer rung's).
|
|
144
157
|
const rungEpisode = reason === 'source-recovery' ? (incoming.episode ?? pending.episode) : undefined;
|
|
145
158
|
const episode = rungEpisode !== undefined ? { episode: rungEpisode } : {};
|
|
159
|
+
// One ceiling per rebuild episode: the merged run waits at most what the longer-held request has left.
|
|
160
|
+
const held = wrunGestureHeldOf(Math.max(pending.gestureHeldMs ?? 0, incoming.gestureHeldMs ?? 0));
|
|
146
161
|
if (!pending.window || !incoming.window)
|
|
147
|
-
return { reason, ...origin, ...prefix, ...episode };
|
|
162
|
+
return { reason, ...origin, ...prefix, ...episode, ...held };
|
|
148
163
|
const window = incoming.window.toMs - incoming.window.fromMs >= pending.window.toMs - pending.window.fromMs
|
|
149
164
|
? incoming.window
|
|
150
165
|
: pending.window;
|
|
151
|
-
return { reason, window, ...origin, ...prefix, ...episode };
|
|
166
|
+
return { reason, window, ...origin, ...prefix, ...episode, ...held };
|
|
167
|
+
}
|
|
168
|
+
/** The reasons a person (a settings save, a switch, a theme, a Resume, a Retry), the mount's first run or the replay
|
|
169
|
+
* lane asks a run for: a held install yields to one of them queued behind it (`hasQueuedWrunUserRun`). */
|
|
170
|
+
const WRUN_USER_RUN_REASONS = new Set([
|
|
171
|
+
'initial',
|
|
172
|
+
'settings',
|
|
173
|
+
'switch',
|
|
174
|
+
'theme',
|
|
175
|
+
'resume',
|
|
176
|
+
'retry',
|
|
177
|
+
'replay',
|
|
178
|
+
]);
|
|
179
|
+
/** Whether the overlay's queued follow-up is a run a person, the mount or the replay lane asked for
|
|
180
|
+
* (`WRUN_USER_RUN_REASONS`): an install held for the gesture (wrun-overlay-run `holdWrunInstallForGesture`) drops its
|
|
181
|
+
* result as superseded instead of making that run wait out the pan. */
|
|
182
|
+
export function hasQueuedWrunUserRun(indicatorId) {
|
|
183
|
+
const state = drivers.get(indicatorId);
|
|
184
|
+
const queued = state?.pendingAgain === true ? state.pendingOptions : undefined;
|
|
185
|
+
return queued !== undefined && WRUN_USER_RUN_REASONS.has(queued.reason);
|
|
152
186
|
}
|
|
153
187
|
/** Merge a request into the queued follow-up; a prefix tag the merge dropped will never run. */
|
|
154
188
|
function queueWrunRunRequest(indicatorId, state, incoming) {
|
|
@@ -259,6 +293,31 @@ function isWrunCoveredWaveRequest(indicatorId, state, request) {
|
|
|
259
293
|
return false;
|
|
260
294
|
return readWrunChartRowsIdentity(state.driver.chartIndex, indicatorId) === coverage.rowsIdentity;
|
|
261
295
|
}
|
|
296
|
+
// The live tick's pan-wave absorber, registered at its import (this registry stays off the tick's imports). Without
|
|
297
|
+
// one, every wave runs.
|
|
298
|
+
let lazyWaveAbsorber = null;
|
|
299
|
+
/** Register (or clear, with null) the live tick's pan-wave absorber (`isWrunWaveAbsorbed`). */
|
|
300
|
+
export function setWrunLazyWaveAbsorber(absorber) {
|
|
301
|
+
lazyWaveAbsorber = absorber;
|
|
302
|
+
}
|
|
303
|
+
/** Whether the live tick takes a pan wave into the overlay's open rebuild episode (WRUN-PANBACK A2): the chart's
|
|
304
|
+
* lazy wave asks every overlay for a run per lazy page, a second dispatcher beside the tick's rebuild. Only a whole
|
|
305
|
+
* wave the chart asked for is offered (a planned prefix page computes its page alone, a person's request is answered
|
|
306
|
+
* by its own run); a wave already queued or in flight is left alone, every other reason runs, and an absorber that
|
|
307
|
+
* throws takes nothing in. */
|
|
308
|
+
function isWrunWaveAbsorbed(indicatorId, state, request) {
|
|
309
|
+
if (request.reason !== 'lazy-range-refresh' || request.prefix !== undefined || request.userOrigin === true) {
|
|
310
|
+
return false;
|
|
311
|
+
}
|
|
312
|
+
if (lazyWaveAbsorber === null)
|
|
313
|
+
return false;
|
|
314
|
+
try {
|
|
315
|
+
return lazyWaveAbsorber(state.driver.chartIndex, indicatorId, request.window) === true;
|
|
316
|
+
}
|
|
317
|
+
catch {
|
|
318
|
+
return false;
|
|
319
|
+
}
|
|
320
|
+
}
|
|
262
321
|
const runSettledHooks = new Set();
|
|
263
322
|
const computeSucceededHooks = new Set();
|
|
264
323
|
/** Run every subscriber; a throwing one is logged and never breaks the
|
|
@@ -306,7 +365,8 @@ const chartTeardownHooks = new Set();
|
|
|
306
365
|
* step is a no-op. This module never imports the host (its worker, packer and kit stay off the
|
|
307
366
|
* boot graph, docs/features/kscript/wrun/wrun-browser-runtime.md "Boot doors"). */
|
|
308
367
|
let endHostLiveSeries;
|
|
309
|
-
/** The host's side of the teardown door: bound once, when the host service evaluates.
|
|
368
|
+
/** The host's side of the teardown door: bound once, when the host service evaluates. With `epoch` it ends that
|
|
369
|
+
* generation's series only (a parked session's end), without it whatever the key holds (the teardown). */
|
|
310
370
|
export function bindWrunHostLiveSeriesEnd(end) {
|
|
311
371
|
endHostLiveSeries = end;
|
|
312
372
|
}
|
|
@@ -370,14 +430,52 @@ export function withWrunOverlaySessionLock(indicatorId, fn) {
|
|
|
370
430
|
* nothing. Read from the chart metadata the caller hands in (the store stays
|
|
371
431
|
* out of this registry's eager graph); metadata without the word reads as
|
|
372
432
|
* the market's default.
|
|
433
|
+
* A sixth term, the market the rows come from when not the chart's own
|
|
434
|
+
* (`wrunMainCandleSourceOf`: a US stock on Trades rides its tape), makes a
|
|
435
|
+
* feed switch an identity change too; other charts keep five terms. INT
|
|
436
|
+
* 2026-11-05: a Trades session drew tape prints again after Price only.
|
|
373
437
|
*/
|
|
374
438
|
export function wrunChartMarketIdentity(metadata) {
|
|
375
439
|
if (!metadata)
|
|
376
440
|
return '';
|
|
377
441
|
const session = effectiveChartSessionType(metadata.exchange, metadata.symbol, metadata.interval, metadata.sessionType);
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
442
|
+
const terms = [metadata.exchange, metadata.symbol, metadata.interval, metadata.transformations, session];
|
|
443
|
+
const rows = wrunMainCandleSourceOf(metadata);
|
|
444
|
+
if (rows)
|
|
445
|
+
terms.push(`${rows.exchange}:${rows.symbol}`);
|
|
446
|
+
return terms.map((part) => (part === undefined || part === null ? '' : String(part))).join('|');
|
|
447
|
+
}
|
|
448
|
+
/**
|
|
449
|
+
* The picture a pass's rows show, as the run or the live session that computed them knew it: the compute settings
|
|
450
|
+
* revision (`kScriptSettingsRevision`, C1) and the market identity (`wrunChartMarketIdentity`). The one derivation
|
|
451
|
+
* every caller of the child mount hands it (wrun-panel-mount.util `pictureIdentity`: a mounted heatmap keeps its
|
|
452
|
+
* colour scale through a pass of the picture that decided it): a full run from what it computed with
|
|
453
|
+
* (`computed.generation` and its own market identity), a live session's passes (a tick, a reseed, a refine, a style
|
|
454
|
+
* repaint, an adoption) from the session's `settingsRevision` and `marketIdentity`, which its full run stamped at
|
|
455
|
+
* install.
|
|
456
|
+
*
|
|
457
|
+
* Why these two facts and nothing else (2026-11-07, Kyle's "decide the scale once per load, then never move it on its
|
|
458
|
+
* own"): every save that changes what the module computes or reads bumps the revision (a param, a symbol or text
|
|
459
|
+
* param, a Timeframe, a pin, a `style_targets` param such as one bound to a heatmap's quantile), while a paint-only
|
|
460
|
+
* save never does (a Style row, an om style knob, the Sensitivity row itself, a window split, an eye), so presentation
|
|
461
|
+
* keys are never identity and no list of keys can drift. The market identity covers the symbol, the interval, the
|
|
462
|
+
* exchange, the transformations, the session and the candle source. The script itself: an editor draft's Run replaces
|
|
463
|
+
* the parent overlay (its children unmount and install afresh) and a version change is a compute save. The facts are
|
|
464
|
+
* the rows' own, never the settings' current ones: a save leaves the session ticking on the previous computation until
|
|
465
|
+
* its rerun installs, and those ticks hand the session's identity, so no scale is ever decided from them under the new
|
|
466
|
+
* picture.
|
|
467
|
+
*
|
|
468
|
+
* Undefined when the market is unknown (a context stored before the field existed), and for a partial picture
|
|
469
|
+
* (`picturePartial`: a run, or the session it installed, that drew over a row lane's first-paint slice or a lane
|
|
470
|
+
* degraded to empty): the fill's or the recovery's run is a whole run of the same revision and market, so a scale
|
|
471
|
+
* decided from the slice under the final identity would be carried onto the whole history (the seed freeze the
|
|
472
|
+
* options heatmap's `seed` stage avoids). Every heatmap a pass without a picture rebuilds decides its scale again and
|
|
473
|
+
* stamps none, the rule before the hold, so the completing run decides and holds.
|
|
474
|
+
*/
|
|
475
|
+
export function wrunPictureIdentityOf(source) {
|
|
476
|
+
if (source.marketIdentity === undefined || source.picturePartial === true)
|
|
477
|
+
return undefined;
|
|
478
|
+
return `${source.settingsRevision ?? 0}|${source.marketIdentity}`;
|
|
381
479
|
}
|
|
382
480
|
export function registerWrunOverlayDriver(indicatorId, driver) {
|
|
383
481
|
const existing = drivers.get(indicatorId);
|
|
@@ -438,6 +536,19 @@ export function noteWrunOverlayRunSettle(indicatorId, note) {
|
|
|
438
536
|
}
|
|
439
537
|
export function setWrunOverlayLiveContext(context) {
|
|
440
538
|
liveContexts.set(context.indicatorId, context);
|
|
539
|
+
// The host's session re-reads whether it may own the overlay's lanes (a settings run may have moved them between
|
|
540
|
+
// contracts and dollars). Absent seams: nothing. A failing seam never fails the install.
|
|
541
|
+
if (!hasWrunChartHostEnv())
|
|
542
|
+
return;
|
|
543
|
+
const session = wrunChartHostEnv().session;
|
|
544
|
+
if (session === undefined)
|
|
545
|
+
return;
|
|
546
|
+
try {
|
|
547
|
+
session.onLiveContextInstalled(context.indicatorId);
|
|
548
|
+
}
|
|
549
|
+
catch (error) {
|
|
550
|
+
console.warn(`[wrun] the session seam failed on '${context.indicatorId}':`, error);
|
|
551
|
+
}
|
|
441
552
|
}
|
|
442
553
|
export function getWrunOverlayLiveContext(indicatorId) {
|
|
443
554
|
return liveContexts.get(indicatorId);
|
|
@@ -480,7 +591,11 @@ export function suspendWrunOverlayLiveSession(indicatorId) {
|
|
|
480
591
|
return;
|
|
481
592
|
releaseWrunOverlayLiveSession(indicatorId, 'suspend');
|
|
482
593
|
}
|
|
483
|
-
function releaseWrunOverlayLiveSession(indicatorId,
|
|
594
|
+
function releaseWrunOverlayLiveSession(indicatorId, mode) {
|
|
595
|
+
// The overlay leaves its chart on a park as on a teardown: every hook releases what it holds for that chart (the
|
|
596
|
+
// feed channels, the timers, the queues, the held row source, the chrome). Only this module tells the two apart,
|
|
597
|
+
// below: the worker's series stays open and the context goes to the park instead of away.
|
|
598
|
+
const cause = mode === 'park' ? 'teardown' : mode;
|
|
484
599
|
// The identity being torn down: read before anything moves, so the bump
|
|
485
600
|
// and the hooks act on the live context (a hook may still read it).
|
|
486
601
|
const context = liveContexts.get(indicatorId);
|
|
@@ -500,6 +615,8 @@ function releaseWrunOverlayLiveSession(indicatorId, cause) {
|
|
|
500
615
|
}
|
|
501
616
|
if (cause === 'teardown') {
|
|
502
617
|
drivers.delete(indicatorId);
|
|
618
|
+
// The overlay's history session goes with it: an overlay mounted again pins its lanes afresh.
|
|
619
|
+
forgetWrunHistoryAsOf(indicatorId);
|
|
503
620
|
// The overlay's refusal attempts and verdicts go with it: a settlement
|
|
504
621
|
// landing after this claims nothing, and a later tenant starts clean.
|
|
505
622
|
if (chartIndex !== undefined)
|
|
@@ -511,6 +628,9 @@ function releaseWrunOverlayLiveSession(indicatorId, cause) {
|
|
|
511
628
|
}
|
|
512
629
|
}
|
|
513
630
|
liveContexts.delete(indicatorId);
|
|
631
|
+
// A park keeps the worker's series for the adoption (its handle ends it, by its epoch, on every other way out).
|
|
632
|
+
if (mode === 'park')
|
|
633
|
+
return;
|
|
514
634
|
// Unconditional once the host exists: live-end is idempotent in the
|
|
515
635
|
// worker, and a context that was never stored here can still shadow a
|
|
516
636
|
// session opened by an earlier mount under the same id. No host yet: no
|
|
@@ -553,6 +673,32 @@ export function onWrunChartTeardown(fn) {
|
|
|
553
673
|
chartTeardownHooks.delete(fn);
|
|
554
674
|
};
|
|
555
675
|
}
|
|
676
|
+
/**
|
|
677
|
+
* The warm switch's park (wrun-overlay-park.util): release an overlay from its chart as a teardown while its worker
|
|
678
|
+
* series stays open, and hand back its live context (out of the registry, its last patch dropped: it names the outgoing
|
|
679
|
+
* chart's plots). Undefined, releasing nothing, for a session that cannot be kept whole: none, a run in flight, a held,
|
|
680
|
+
* replaying or repaint-owed session, a pan page's prefix run not landed, or a session operation holding its lock (a
|
|
681
|
+
* tick's worker call, a reseed, a repaint: it would end, reopen or advance the series after the park).
|
|
682
|
+
*/
|
|
683
|
+
export function releaseWrunOverlayLiveSessionForPark(indicatorId) {
|
|
684
|
+
const context = liveContexts.get(indicatorId);
|
|
685
|
+
const state = drivers.get(indicatorId);
|
|
686
|
+
if (context === undefined || state === undefined || state.inFlight !== null)
|
|
687
|
+
return undefined;
|
|
688
|
+
if (sessionLocks.has(indicatorId))
|
|
689
|
+
return undefined;
|
|
690
|
+
if (context.liveSuspended || context.replay === true || context.repaintOwed)
|
|
691
|
+
return undefined;
|
|
692
|
+
if (context.prefixOwner?.state === 'pending')
|
|
693
|
+
return undefined;
|
|
694
|
+
releaseWrunOverlayLiveSession(indicatorId, 'park');
|
|
695
|
+
context.liveApplied = undefined;
|
|
696
|
+
return context;
|
|
697
|
+
}
|
|
698
|
+
/** End one generation's worker series (a parked session's end): a later run's series under the id stays. */
|
|
699
|
+
export function endWrunOverlayLiveSeriesAt(indicatorId, epoch) {
|
|
700
|
+
endHostLiveSeries?.(indicatorId, epoch);
|
|
701
|
+
}
|
|
556
702
|
/** The lane buffers a live context keeps one array of rows for. */
|
|
557
703
|
const WRUN_CENSUS_LANE_BUFFERS = [
|
|
558
704
|
'bookRows',
|
|
@@ -573,6 +719,7 @@ const WRUN_CENSUS_LANE_BUFFERS = [
|
|
|
573
719
|
const WRUN_CENSUS_KEYED_BUFFERS = [
|
|
574
720
|
'pollLaneRows',
|
|
575
721
|
'tradeLegRows',
|
|
722
|
+
'pinnedLaneRows',
|
|
576
723
|
'pinnedCandleRows',
|
|
577
724
|
'pinnedLiveCandleRows',
|
|
578
725
|
'intrabarRows',
|
|
@@ -603,44 +750,55 @@ function wrunCensusBufferBytes(rows) {
|
|
|
603
750
|
return Math.round((numbers / sampled) * rows.length * 8);
|
|
604
751
|
}
|
|
605
752
|
/** The data rows of a built result, over its outputs. */
|
|
606
|
-
function wrunCensusResultRows(result) {
|
|
753
|
+
export function wrunCensusResultRows(result) {
|
|
607
754
|
let rows = 0;
|
|
608
755
|
for (const output of Object.values(result?.outputs ?? {})) {
|
|
609
756
|
rows += Array.isArray(output.data) ? output.data.length : 0;
|
|
610
757
|
}
|
|
611
758
|
return rows;
|
|
612
759
|
}
|
|
760
|
+
/** A context's lane buffers, counted and sampled (rows, and bytes at 8 a number). */
|
|
761
|
+
export function wrunCensusLaneBytes(context) {
|
|
762
|
+
const buffers = [];
|
|
763
|
+
for (const key of WRUN_CENSUS_LANE_BUFFERS) {
|
|
764
|
+
const rows = context[key];
|
|
765
|
+
if (rows !== undefined)
|
|
766
|
+
buffers.push(rows);
|
|
767
|
+
}
|
|
768
|
+
for (const key of WRUN_CENSUS_KEYED_BUFFERS)
|
|
769
|
+
buffers.push(...Object.values(context[key] ?? {}));
|
|
770
|
+
if (context.formingPreRoll !== undefined)
|
|
771
|
+
buffers.push(context.formingPreRoll.rows);
|
|
772
|
+
let laneRows = 0;
|
|
773
|
+
let laneBytes = 0;
|
|
774
|
+
for (const rows of buffers) {
|
|
775
|
+
laneRows += rows.length;
|
|
776
|
+
laneBytes += wrunCensusBufferBytes(rows);
|
|
777
|
+
}
|
|
778
|
+
return { laneRows, laneBytes };
|
|
779
|
+
}
|
|
780
|
+
/** One context's census entry: `shown` is the result it keeps when no live patch is applied (a parked session's). */
|
|
781
|
+
export function wrunLiveContextCensusOf(context, shown) {
|
|
782
|
+
const applied = context.liveApplied;
|
|
783
|
+
const build = applied?.build?.result;
|
|
784
|
+
return {
|
|
785
|
+
id: context.indicatorId,
|
|
786
|
+
chartIndex: context.chartIndex,
|
|
787
|
+
liveRows: context.outputRows.length,
|
|
788
|
+
...wrunCensusLaneBytes(context),
|
|
789
|
+
liveAppliedRows: wrunCensusResultRows(applied?.result ?? shown) + (build !== applied?.result ? wrunCensusResultRows(build) : 0),
|
|
790
|
+
};
|
|
791
|
+
}
|
|
792
|
+
/** Sessions held outside the registry that the census lists too (the warm switch's parks), registered at import. */
|
|
793
|
+
const censusContributors = new Set();
|
|
794
|
+
export function onWrunOverlayMemoryCensus(contribute) {
|
|
795
|
+
censusContributors.add(contribute);
|
|
796
|
+
}
|
|
613
797
|
/** Every live session's retention (memory spec 4.4), read-only: rows counted, bytes sampled, nothing created. */
|
|
614
798
|
export function wrunOverlayMemoryCensus() {
|
|
615
|
-
const entries = [];
|
|
616
|
-
for (const
|
|
617
|
-
|
|
618
|
-
for (const key of WRUN_CENSUS_LANE_BUFFERS) {
|
|
619
|
-
const rows = context[key];
|
|
620
|
-
if (rows !== undefined)
|
|
621
|
-
buffers.push(rows);
|
|
622
|
-
}
|
|
623
|
-
for (const key of WRUN_CENSUS_KEYED_BUFFERS)
|
|
624
|
-
buffers.push(...Object.values(context[key] ?? {}));
|
|
625
|
-
if (context.formingPreRoll !== undefined)
|
|
626
|
-
buffers.push(context.formingPreRoll.rows);
|
|
627
|
-
let laneRows = 0;
|
|
628
|
-
let laneBytes = 0;
|
|
629
|
-
for (const rows of buffers) {
|
|
630
|
-
laneRows += rows.length;
|
|
631
|
-
laneBytes += wrunCensusBufferBytes(rows);
|
|
632
|
-
}
|
|
633
|
-
const applied = context.liveApplied;
|
|
634
|
-
const build = applied?.build?.result;
|
|
635
|
-
entries.push({
|
|
636
|
-
id: context.indicatorId,
|
|
637
|
-
chartIndex: context.chartIndex,
|
|
638
|
-
liveRows: context.outputRows.length,
|
|
639
|
-
laneRows,
|
|
640
|
-
laneBytes,
|
|
641
|
-
liveAppliedRows: wrunCensusResultRows(applied?.result) + (build !== applied?.result ? wrunCensusResultRows(build) : 0),
|
|
642
|
-
});
|
|
643
|
-
}
|
|
799
|
+
const entries = [...liveContexts.values()].map((context) => wrunLiveContextCensusOf(context));
|
|
800
|
+
for (const contribute of censusContributors)
|
|
801
|
+
entries.push(...contribute());
|
|
644
802
|
return entries;
|
|
645
803
|
}
|
|
646
804
|
let prefixRuntime = null;
|
|
@@ -1143,9 +1301,11 @@ function beginExecutorRun(indicatorId, state, planned) {
|
|
|
1143
1301
|
* (every request queued behind one run shares it), so a settings save's tail
|
|
1144
1302
|
* waits for its own settings to land, not for the run that read the older
|
|
1145
1303
|
* ones. Undefined when the overlay has no driver, is no longer mounted (which
|
|
1146
|
-
* also tears it down),
|
|
1304
|
+
* also tears it down), the request is a pan wave whose window the last
|
|
1147
1305
|
* good run already computed over the same main rows while nothing is in
|
|
1148
|
-
* flight (the coverage skip)
|
|
1306
|
+
* flight (the coverage skip), or a pan wave the live tick's open rebuild
|
|
1307
|
+
* episode took in (`isWrunWaveAbsorbed`, WRUN-PANBACK A2: its one handoff
|
|
1308
|
+
* rebuilds the page).
|
|
1149
1309
|
*/
|
|
1150
1310
|
export function rerunWrunOverlayForChartWave(indicatorId, options) {
|
|
1151
1311
|
const state = drivers.get(indicatorId);
|
|
@@ -1156,6 +1316,9 @@ export function rerunWrunOverlayForChartWave(indicatorId, options) {
|
|
|
1156
1316
|
return undefined;
|
|
1157
1317
|
}
|
|
1158
1318
|
const request = wrunRunRequestOf(options);
|
|
1319
|
+
// Asked before anything queues or starts: a wave already queued or in flight stays as it is.
|
|
1320
|
+
if (isWrunWaveAbsorbed(indicatorId, state, request))
|
|
1321
|
+
return undefined;
|
|
1159
1322
|
if (state.inFlight) {
|
|
1160
1323
|
queueWrunRunRequest(indicatorId, state, request);
|
|
1161
1324
|
return followUpWaitersOf(state).promise;
|
|
@@ -1210,6 +1373,8 @@ export function __resetWrunOverlayDriversForTests() {
|
|
|
1210
1373
|
liveContexts.clear();
|
|
1211
1374
|
liveGenerations.clear();
|
|
1212
1375
|
sessionLocks.clear();
|
|
1376
|
+
// Every overlay's history session goes with its driver: a spec's next run pins its lanes afresh.
|
|
1377
|
+
__resetWrunHistoryAsOfForTests();
|
|
1213
1378
|
// The teardown hooks are module registrations (the intake and the tick
|
|
1214
1379
|
// register at import), never per-test state: they stay.
|
|
1215
1380
|
}
|
|
@@ -349,10 +349,10 @@ const revalidationTimers = new Map();
|
|
|
349
349
|
const revalidationCharts = new Map();
|
|
350
350
|
/**
|
|
351
351
|
* After an integrated wrun run: when any of its lanes was served from the
|
|
352
|
-
* replay cache (the shared acquisition marked the overlay), arm
|
|
353
|
-
* revalidation the SWR contract owes, once per mark. Replay
|
|
354
|
-
* (replay owns its own data plane). The kScript scheduler's
|
|
355
|
-
* (data-fetching.util maybeScheduleLocalKScriptSourceRevalidation).
|
|
352
|
+
* replay cache (the shared acquisition marked the overlay with the lane), arm
|
|
353
|
+
* the one-shot revalidation the SWR contract owes, once per mark. Replay
|
|
354
|
+
* drops the mark (replay owns its own data plane). The kScript scheduler's
|
|
355
|
+
* rules verbatim (data-fetching.util maybeScheduleLocalKScriptSourceRevalidation).
|
|
356
356
|
*/
|
|
357
357
|
function maybeScheduleWrunSourceRevalidation(indicatorId, chartIndex) {
|
|
358
358
|
if (!hasWrunOverlayDriver(indicatorId))
|
|
@@ -381,10 +381,12 @@ function maybeScheduleWrunSourceRevalidation(indicatorId, chartIndex) {
|
|
|
381
381
|
/**
|
|
382
382
|
* The owed revalidation: guards run before the mark is taken (an
|
|
383
383
|
* undispatchable moment disarms so the next integrated run re-arms); the
|
|
384
|
-
* mark is taken, the
|
|
385
|
-
*
|
|
386
|
-
* the
|
|
387
|
-
*
|
|
384
|
+
* mark is taken with its lanes, the bypass token installed over those lanes
|
|
385
|
+
* (the take comes first, so the lane set travels inside the token) so only
|
|
386
|
+
* the lanes the replay cache served reach the wire and every other lane of
|
|
387
|
+
* the run takes its normal ladder, the run goes through the door
|
|
388
|
+
* ('loaded-range-refresh'), the token is released in finally, and the mark is
|
|
389
|
+
* restored, lane by lane, when the door held or skipped the run.
|
|
388
390
|
*/
|
|
389
391
|
async function runWrunSourceRevalidation(chartIndex, indicatorId, armedGeneration) {
|
|
390
392
|
const bail = () => disarmLocalKScriptSourceRevalidation(chartIndex, indicatorId);
|
|
@@ -400,16 +402,24 @@ async function runWrunSourceRevalidation(chartIndex, indicatorId, armedGeneratio
|
|
|
400
402
|
if (!pending)
|
|
401
403
|
return;
|
|
402
404
|
const restoreMark = () => {
|
|
403
|
-
|
|
405
|
+
// Every lane of the take owes the revalidation again, over the same window. A take with no lanes restores as a
|
|
406
|
+
// mark naming no lane (''), so its overlay-wide revalidation is never lost either.
|
|
407
|
+
const laneKeys = pending.lanes.size > 0 ? [...pending.lanes] : [''];
|
|
408
|
+
for (const laneKey of laneKeys) {
|
|
409
|
+
markLocalKScriptSourceCacheHit(chartIndex, indicatorId, pending.fromMs, pending.toMs, laneKey);
|
|
410
|
+
}
|
|
404
411
|
disarmLocalKScriptSourceRevalidation(chartIndex, indicatorId);
|
|
405
412
|
};
|
|
406
|
-
|
|
413
|
+
// Only the lanes the replay cache served; an empty set installs a token over every lane (never a silent skip).
|
|
414
|
+
const token = installLocalKScriptSourceCacheBypass(chartIndex, indicatorId, pending.lanes);
|
|
407
415
|
ring('wrun-source-revalidation-start', {
|
|
408
416
|
chartIndex,
|
|
409
417
|
indicatorId,
|
|
410
418
|
fromMs: pending.fromMs,
|
|
411
419
|
toMs: pending.toMs,
|
|
412
420
|
markedAt: pending.markedAt,
|
|
421
|
+
lanes: pending.lanes.size,
|
|
422
|
+
laneKeys: [...pending.lanes].sort().slice(0, 32),
|
|
413
423
|
});
|
|
414
424
|
try {
|
|
415
425
|
const outcome = await dispatchWrunOverlayRerun(chartIndex, indicatorId, 'loaded-range-refresh');
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The warm workspace switch's park (SWITCH-COST U1): an overlay's live session kept through its chart's teardown, so
|
|
3
|
+
* the switch back takes it back (wrun-overlay-run.util adoptWrunParkedLiveSession) instead of running the package
|
|
4
|
+
* over the whole history again.
|
|
5
|
+
*
|
|
6
|
+
* A park releases the overlay from its chart exactly as a teardown does (every live teardown hook hears 'teardown': the
|
|
7
|
+
* feed channels, the timers, the queues, the held row source, the chrome go; the driver and the refusal attempts go),
|
|
8
|
+
* except that the worker's live series stays open under its epoch and the live context leaves the registry for the
|
|
9
|
+
* handle (wrun-overlay-drivers.util releaseWrunOverlayLiveSessionForPark). The handle keeps the context (its lane
|
|
10
|
+
* buffers, carry seed, session seed and output rows), the picture the chart showed, the chart's bars the adoption
|
|
11
|
+
* judges the return against (its first, its newest closed and its newest) and the overlay's history as-of pins: no
|
|
12
|
+
* chart engine, no mounted meta, no DOM. It names the worker series by the epoch its live-start opened it under
|
|
13
|
+
* (`seriesEpoch`), which an adoption keeps while it moves the generation, so a session parked again after an adoption
|
|
14
|
+
* still names its series. It is settled exactly once: taken by the adoption, or ended
|
|
15
|
+
* (endWrunParkedLiveSession: that epoch's worker series only, never a later run's under the same id). The web side
|
|
16
|
+
* (src/utility/wrun/wrun-run-park.util.ts) decides when, bounds the parks and ends a handle on every other way out.
|
|
17
|
+
*
|
|
18
|
+
* Off the pre-candle path: the registry loader and the run pass import it, and both load with the first Indicator.
|
|
19
|
+
*/
|
|
20
|
+
import { type WrunRunResult } from '../chart/wrun-run-result.util.js';
|
|
21
|
+
import type { WrunRunWindow } from './wrun-lifecycle.contract.js';
|
|
22
|
+
import { type WrunHistoryAsOfSnapshot } from './wrun-history-as-of.util.js';
|
|
23
|
+
import { type WrunOverlayLiveContext } from './wrun-overlay-drivers.util.js';
|
|
24
|
+
/** What a parked session's chart showed at the park: the result as built (the live tick's last applied build, else
|
|
25
|
+
* the last full integrate's: wrun-overlay-run.util `wrunMountedRunResultOf`) and the window it computed over. */
|
|
26
|
+
export interface WrunParkedShown {
|
|
27
|
+
runResult: WrunRunResult;
|
|
28
|
+
window?: WrunRunWindow;
|
|
29
|
+
}
|
|
30
|
+
/** The bars the chart showed at the park, which the adoption judges the chart against: its first bar, its newest
|
|
31
|
+
* closed bar (the one before its newest; null on a chart of one bar) and its newest. */
|
|
32
|
+
export interface WrunParkedBars {
|
|
33
|
+
firstTs: number;
|
|
34
|
+
lastClosedTs: number | null;
|
|
35
|
+
lastTs: number;
|
|
36
|
+
}
|
|
37
|
+
/** A parked live session (see the header). Its pieces are cleared when it is taken or ended. */
|
|
38
|
+
export interface WrunParkedLiveSession {
|
|
39
|
+
readonly indicatorId: string;
|
|
40
|
+
/** The worker series' epoch: the live-start that opened it (`seriesEpoch`, else the generation). Never the
|
|
41
|
+
* generation an adoption moved the context to: the series keeps its epoch until a live-start replaces it. */
|
|
42
|
+
readonly epoch: number;
|
|
43
|
+
readonly parkedAt: number;
|
|
44
|
+
readonly bars: WrunParkedBars;
|
|
45
|
+
/** The rough bytes the park keeps (wrunParkedLiveSessionBytes), read once at the park. */
|
|
46
|
+
readonly bytes: number;
|
|
47
|
+
/** The CME authorisation at the park (cme-user-scripts-gate.util `captureCmeStudyAuth`) of a session that read CME:
|
|
48
|
+
* its adoption judges the gate and the epoch again (wrun-overlay-run.util `adoptWrunParkedLiveSession`). */
|
|
49
|
+
readonly cmeAuth?: {
|
|
50
|
+
epoch: number;
|
|
51
|
+
};
|
|
52
|
+
context: WrunOverlayLiveContext | undefined;
|
|
53
|
+
shown: WrunParkedShown | undefined;
|
|
54
|
+
historyAsOf: WrunHistoryAsOfSnapshot | undefined;
|
|
55
|
+
}
|
|
56
|
+
/** What an adoption takes from a parked session, once. */
|
|
57
|
+
export interface WrunParkedLiveSessionTake {
|
|
58
|
+
context: WrunOverlayLiveContext;
|
|
59
|
+
shown: WrunParkedShown;
|
|
60
|
+
historyAsOf: WrunHistoryAsOfSnapshot | undefined;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Park an overlay's live session at a warm workspace switch's teardown, while it still stands, with `shown`, the
|
|
64
|
+
* picture its chart shows. Undefined, with nothing released, for a session the drivers refuse to keep whole (see
|
|
65
|
+
* releaseWrunOverlayLiveSessionForPark). The caller settles the handle exactly once: adopted, or ended on every other
|
|
66
|
+
* way out. A session parked earlier under the same id is ended first: one parked series per id.
|
|
67
|
+
*/
|
|
68
|
+
export declare function parkWrunOverlayLiveSession(indicatorId: string, shown: WrunParkedShown, bars: WrunParkedBars, nowMs?: number, cmeAuth?: {
|
|
69
|
+
epoch: number;
|
|
70
|
+
}): WrunParkedLiveSession | undefined;
|
|
71
|
+
/** Take a parked session's pieces for its adoption, once: undefined once it was adopted or ended. An adoption that
|
|
72
|
+
* refuses after the take ends the series itself (endWrunParkedLiveSeries). */
|
|
73
|
+
export declare function takeWrunParkedLiveSession(parked: WrunParkedLiveSession): WrunParkedLiveSessionTake | undefined;
|
|
74
|
+
/** End a parked session that will not be adopted: its pieces go and the worker's series of its epoch ends.
|
|
75
|
+
* Idempotent: a settled handle ends nothing more. */
|
|
76
|
+
export declare function endWrunParkedLiveSession(parked: WrunParkedLiveSession): void;
|
|
77
|
+
/** End a parked session's worker series by its epoch: the end's last step, and a refused adoption's after its take. */
|
|
78
|
+
export declare function endWrunParkedLiveSeries(parked: Pick<WrunParkedLiveSession, 'indicatorId' | 'epoch'>): void;
|
|
79
|
+
/** The rough bytes one park keeps (see wrunParkedSessionBytesOf). */
|
|
80
|
+
export declare function wrunParkedLiveSessionBytes(parked: WrunParkedLiveSession): number;
|
|
81
|
+
/** Specs only: the sessions parked now. */
|
|
82
|
+
export declare function __wrunParkedLiveSessionsForTests(): WrunParkedLiveSession[];
|
|
83
|
+
/** Specs only: forget every parked session (nothing ends: a spec's worker is a fake). */
|
|
84
|
+
export declare function __resetWrunParkedLiveSessionsForTests(): void;
|