@orangecharts/wrun-chart-host 0.14.0 → 0.16.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/economic.constants.d.ts +2 -0
- package/dist/constants/economic.constants.js +2 -0
- package/dist/constants/feature-flags.constants.d.ts +11 -0
- package/dist/constants/feature-flags.constants.js +56 -4
- package/dist/constants/feature-limits.constants.d.ts +72 -4
- package/dist/constants/feature-limits.constants.js +98 -20
- package/dist/constants/interval.constants.js +5 -0
- package/dist/constants/kscript-data-interval-restrictions.constants.d.ts +12 -0
- package/dist/constants/kscript-data-interval-restrictions.constants.js +14 -0
- package/dist/constants/typed-width-fold.leaf.d.ts +50 -0
- package/dist/constants/typed-width-fold.leaf.js +99 -0
- package/dist/constants/typed-width-source.leaf.d.ts +24 -0
- package/dist/constants/typed-width-source.leaf.js +126 -0
- package/dist/constants/typed-width.leaf.d.ts +57 -0
- package/dist/constants/typed-width.leaf.js +78 -0
- package/dist/host-env.d.ts +24 -0
- package/dist/host-env.js +22 -0
- package/dist/host-ports.types.d.ts +11 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +4 -0
- package/dist/interfaces/kscript-diagnostics.interface.d.ts +28 -0
- package/dist/interfaces/wrun-runtime.interface.d.ts +107 -4
- package/dist/interfaces/wrun-runtime.interface.js +11 -0
- package/dist/kscript-data/controls/live-trades-merge.util.d.ts +13 -0
- package/dist/kscript-data/controls/live-trades-merge.util.js +16 -1
- package/dist/market-data/billing.interface.d.ts +12 -45
- package/dist/market-data/billing.interface.js +2 -2
- package/dist/market-data/venues/index.d.ts +2 -2
- package/dist/market-data/venues/opra.js +3 -3
- package/dist/market-data/venues/stocks.contract.copy.json +3 -2
- package/dist/market-data/venues/stocks.d.ts +2 -2
- package/dist/market-data/venues/stocks.js +10 -9
- package/dist/replay/replayLadder.js +7 -4
- package/dist/settings-templates/footprint-rows.d.ts +6 -0
- package/dist/settings-templates/footprint-rows.js +6 -0
- package/dist/settings-templates/frvp-fields.js +14 -0
- package/dist/settings-templates/indicator-fields.js +46 -0
- package/dist/settings-templates/tool-tables.generated.js +19 -1
- package/dist/utility/chart/__fixtures__/live-bucket-regular-golden.json +1706 -0
- package/dist/utility/chart/cache-alignment.util.d.ts +65 -0
- package/dist/utility/chart/cache-alignment.util.js +124 -24
- package/dist/utility/chart/calendar-interval.util.d.ts +83 -1
- package/dist/utility/chart/calendar-interval.util.js +152 -4
- package/dist/utility/chart/candle-bar-end.util.d.ts +11 -4
- package/dist/utility/chart/candle-bar-end.util.js +17 -6
- package/dist/utility/chart/chart-time-domain.util.d.ts +3 -0
- package/dist/utility/chart/chart-time-domain.util.js +13 -4
- package/dist/utility/chart/feed-interval.util.d.ts +4 -2
- package/dist/utility/chart/feed-interval.util.js +5 -2
- package/dist/utility/chart/fetch-dedupe-policy.util.d.ts +3 -1
- package/dist/utility/chart/fetch-dedupe-policy.util.js +19 -1
- 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/footprint-display-mode.util.d.ts +2 -0
- package/dist/utility/chart/footprint-display-mode.util.js +5 -0
- package/dist/utility/chart/governed-lanes-gate.util.d.ts +46 -0
- package/dist/utility/chart/governed-lanes-gate.util.js +71 -0
- package/dist/utility/chart/governed-lanes-reader-seat.d.ts +14 -0
- package/dist/utility/chart/governed-lanes-reader-seat.js +14 -0
- package/dist/utility/chart/history-wall.util.d.ts +13 -2
- package/dist/utility/chart/history-wall.util.js +11 -4
- package/dist/utility/chart/interval-ladder.util.d.ts +5 -2
- package/dist/utility/chart/interval-ladder.util.js +44 -4
- package/dist/utility/chart/interval-registry.util.d.ts +22 -1
- package/dist/utility/chart/interval-registry.util.js +50 -2
- package/dist/utility/chart/kscript-data-interval-restriction.leaf.d.ts +32 -4
- package/dist/utility/chart/kscript-data-interval-restriction.leaf.js +22 -5
- package/dist/utility/chart/kscript-drawing-safe-area.util.d.ts +10 -0
- package/dist/utility/chart/kscript-drawing-safe-area.util.js +30 -3
- package/dist/utility/chart/kscript-legend-entries.util.d.ts +21 -4
- package/dist/utility/chart/kscript-legend-entries.util.js +27 -5
- package/dist/utility/chart/kscript-main-grid-stages.util.js +74 -24
- package/dist/utility/chart/kscript-row-name.leaf.d.ts +13 -0
- package/dist/utility/chart/kscript-row-name.leaf.js +18 -0
- package/dist/utility/chart/kscript-venue-policy.util.d.ts +61 -26
- package/dist/utility/chart/kscript-venue-policy.util.js +138 -37
- package/dist/utility/chart/live-bucket.util.d.ts +29 -4
- package/dist/utility/chart/live-bucket.util.js +45 -12
- package/dist/utility/chart/market-session.util.d.ts +62 -10
- package/dist/utility/chart/market-session.util.js +93 -13
- package/dist/utility/chart/marketKind.util.d.ts +1 -7
- package/dist/utility/chart/marketKind.util.js +6 -8
- package/dist/utility/chart/mixed-mode.util.d.ts +17 -0
- package/dist/utility/chart/om-target.util.js +6 -4
- package/dist/utility/chart/price-precision.util.d.ts +20 -6
- package/dist/utility/chart/price-precision.util.js +34 -7
- package/dist/utility/chart/profile-frame-window.util.d.ts +15 -0
- package/dist/utility/chart/profile-frame-window.util.js +12 -0
- package/dist/utility/chart/rth-session.util.d.ts +3 -1
- package/dist/utility/chart/rth-session.util.js +3 -1
- package/dist/utility/chart/script-source-session.util.d.ts +43 -0
- package/dist/utility/chart/script-source-session.util.js +61 -0
- package/dist/utility/chart/typed-width-grid.util.d.ts +23 -0
- package/dist/utility/chart/typed-width-grid.util.js +203 -0
- package/dist/utility/chart/wrun-run-result.util.d.ts +9 -1
- package/dist/utility/chart/wrun-run-result.util.js +8 -2
- package/dist/utility/common/transformations.util.d.ts +6 -0
- package/dist/utility/common/transformations.util.js +28 -4
- package/dist/utility/number-format.util.d.ts +14 -1
- package/dist/utility/number-format.util.js +22 -4
- package/dist/utility/scriptEditor/wrun-runtime-diagnostics.leaf.d.ts +24 -1
- package/dist/utility/scriptEditor/wrun-runtime-diagnostics.leaf.js +113 -0
- package/dist/utility/v2/v2-enums.leaf.js +3 -0
- package/dist/utility/wrun/wrun-batched-marks.util.d.ts +15 -5
- package/dist/utility/wrun/wrun-batched-marks.util.js +70 -20
- package/dist/utility/wrun/wrun-canvases.util.d.ts +28 -9
- package/dist/utility/wrun/wrun-canvases.util.js +99 -39
- package/dist/utility/wrun/wrun-cap-notice.util.d.ts +5 -0
- package/dist/utility/wrun/wrun-cap-notice.util.js +23 -0
- package/dist/utility/wrun/wrun-card-style.util.d.ts +1 -1
- package/dist/utility/wrun/wrun-card-style.util.js +2 -2
- package/dist/utility/wrun/wrun-chart-market-facts.util.d.ts +8 -0
- package/dist/utility/wrun/wrun-chart-market-facts.util.js +13 -1
- package/dist/utility/wrun/wrun-child-overlay-id.util.d.ts +10 -0
- package/dist/utility/wrun/wrun-child-overlay-id.util.js +24 -0
- package/dist/utility/wrun/wrun-cloud-cme-stamp.util.d.ts +72 -0
- package/dist/utility/wrun/wrun-cloud-cme-stamp.util.js +151 -0
- package/dist/utility/wrun/wrun-color-facts.util.d.ts +3 -3
- package/dist/utility/wrun/wrun-color-facts.util.js +8 -5
- package/dist/utility/wrun/wrun-colour-tone.lazy.d.ts +20 -0
- package/dist/utility/wrun/wrun-colour-tone.lazy.js +23 -0
- package/dist/utility/wrun/wrun-colour-tone.util.d.ts +14 -0
- package/dist/utility/wrun/wrun-colour-tone.util.js +119 -0
- package/dist/utility/wrun/wrun-dark-pool.util.d.ts +3 -2
- package/dist/utility/wrun/wrun-dark-pool.util.js +5 -4
- package/dist/utility/wrun/wrun-frames.d.ts +1 -1
- package/dist/utility/wrun/wrun-frames.js +2 -2
- package/dist/utility/wrun/wrun-handles.util.d.ts +1 -1
- package/dist/utility/wrun/wrun-handles.util.js +1 -1
- package/dist/utility/wrun/wrun-host.service.d.ts +32 -2
- package/dist/utility/wrun/wrun-host.service.js +44 -2
- package/dist/utility/wrun/wrun-hosted-wire-caps.d.ts +20 -0
- package/dist/utility/wrun/wrun-hosted-wire-caps.js +85 -2
- package/dist/utility/wrun/wrun-hosted-wire.util.d.ts +37 -0
- package/dist/utility/wrun/wrun-hosted-wire.util.js +54 -0
- 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-hud-looks.util.d.ts +1 -0
- package/dist/utility/wrun/wrun-hud-looks.util.js +6 -11
- package/dist/utility/wrun/wrun-integration-route.util.d.ts +24 -0
- package/dist/utility/wrun/wrun-integration-route.util.js +19 -0
- package/dist/utility/wrun/wrun-live-intake.util.js +17 -1
- package/dist/utility/wrun/wrun-live-patch.util.d.ts +6 -1
- package/dist/utility/wrun/wrun-live-patch.util.js +10 -4
- package/dist/utility/wrun/wrun-live-tick.util.js +81 -19
- 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 +41 -0
- package/dist/utility/wrun/wrun-overlay-drivers.util.js +35 -0
- 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 +23 -2
- package/dist/utility/wrun/wrun-overlay-run.util.js +305 -51
- package/dist/utility/wrun/wrun-panel-mount.util.d.ts +10 -2
- package/dist/utility/wrun/wrun-panel-mount.util.js +144 -18
- package/dist/utility/wrun/wrun-pin-venues.util.js +5 -1
- package/dist/utility/wrun/wrun-refusal.util.d.ts +4 -0
- package/dist/utility/wrun/wrun-refusal.util.js +102 -13
- package/dist/utility/wrun/wrun-registry-errors.util.d.ts +5 -3
- package/dist/utility/wrun/wrun-registry-errors.util.js +5 -3
- package/dist/utility/wrun/wrun-row-source-factory.js +17 -1
- package/dist/utility/wrun/wrun-row-source.d.ts +8 -1
- package/dist/utility/wrun/wrun-run-health.util.d.ts +6 -3
- package/dist/utility/wrun/wrun-run-health.util.js +5 -2
- package/dist/utility/wrun/wrun-sandbox-row-source.d.ts +1 -1
- package/dist/utility/wrun/wrun-sandbox-row-source.js +9 -0
- package/dist/utility/wrun/wrun-script-inputs.util.d.ts +25 -8
- package/dist/utility/wrun/wrun-script-inputs.util.js +145 -45
- package/dist/utility/wrun/wrun-setting-words.util.d.ts +12 -5
- package/dist/utility/wrun/wrun-setting-words.util.js +25 -8
- package/dist/utility/wrun/wrun-socket-row-source.d.ts +26 -1
- package/dist/utility/wrun/wrun-socket-row-source.js +125 -12
- package/dist/utility/wrun/wrun-source-rows.util.d.ts +3 -3
- package/dist/utility/wrun/wrun-source-rows.util.js +8 -7
- 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-style-words.util.d.ts +31 -9
- package/dist/utility/wrun/wrun-style-words.util.js +46 -15
- package/dist/utility/wrun/wrun-trades-lane.util.js +2 -1
- package/dist/utility/wrun/wrun-trap-replay.util.d.ts +42 -0
- package/dist/utility/wrun/wrun-trap-replay.util.js +63 -0
- package/dist/utility/wrun/wrun-volume-profile.util.js +6 -5
- package/dist/utility/wrun-display-name.util.d.ts +10 -0
- package/dist/utility/wrun-display-name.util.js +21 -0
- package/dist/utils/replay/replay-buffer-math.d.ts +2 -0
- package/dist/utils/replay/replay-buffer-math.js +2 -0
- package/dist/workers/constants/socket-slots.d.ts +1 -1
- package/dist/workers/utils/time.worker.util.js +2 -2
- package/dist/workers/utils/volume-profile.worker.util.d.ts +9 -0
- package/dist/workers/utils/volume-profile.worker.util.js +20 -0
- package/dist/workers/wrun/wrun-abi-host.d.ts +3 -0
- package/dist/workers/wrun/wrun-abi-host.js +82 -5
- package/dist/workers/wrun/wrun-engine-handler.js +53 -4
- package/dist/workers/wrun/wrun-trap-frames.leaf.d.ts +28 -0
- package/dist/workers/wrun/wrun-trap-frames.leaf.js +108 -0
- package/package.json +11 -11
|
@@ -86,7 +86,7 @@ import { isStocksTapeGoverned } from '../v2/stocks-governed.util.js';
|
|
|
86
86
|
import { noteWrunGatePlaneStopped, noteWrunGatePlanesRead } from './wrun-gate-plane-readers.util.js';
|
|
87
87
|
import { wrunGateLatchedThunks, wrunLaneGatePlanes, wrunLaneGateStopOf, wrunSessionStopPlaneOf, } from './wrun-options-stop.util.js';
|
|
88
88
|
import { annotateWrunRunFailedIdentity, noteWrunRunRetained, wrunRunIdentityOf } from './wrun-cap-notice.util.js';
|
|
89
|
-
import { wrunIntegrationRoute } from './wrun-integration-route.util.js';
|
|
89
|
+
import { wrunIntegrationRoute, wrunRunDrawingsPlan, wrunRunOwesFullIntegration, } from './wrun-integration-route.util.js';
|
|
90
90
|
import { placeWrunTablesOnChart } from './wrun-table-chrome.util.js';
|
|
91
91
|
import { projectKScriptRunResultOntoChartBars } from '../chart/kscript-run-interval-projection.util.js';
|
|
92
92
|
import { runBarSpan } from '../chart/indicator-run-interval.util.js';
|
|
@@ -148,14 +148,14 @@ import { WRUN_PINNED_LANE_SPECS, isWrunPinnedLaneId, wrunPinnedLaneExtras, wrunP
|
|
|
148
148
|
import { WRUN_LEG_STREAM_CLASSES, isWrunLegStreamClass, wrunLegStreamPayloadWords } from './wrun-leg-stream-classes.js';
|
|
149
149
|
import { isWrunTradesLegLane, planWrunTradeLegAsk, WRUN_TRADES_LANES, wrunLegPlacementLeadMs, wrunLegStraddlesChartBars, wrunLegVenueOf, wrunTradesLegOf, } from './wrun-trades-lane.util.js';
|
|
150
150
|
import { substituteWrunChartNames, wrunChartContextHostFill, wrunChartIntervalMsOf, } from './wrun-chart-context.util.js';
|
|
151
|
-
import { forgetWrunMarketReadFailures, warmWrunMarketDollarFacts, warmWrunMarketFacts, wrunChartSizeUnit, wrunLaneDemandNeedsDirectory, wrunMarketDollarReadFailure, wrunMarketDollarUnit, wrunMarketReadMark, wrunMarketFactsFor, wrunMarketFactsNeedDirectory, wrunReadsDollarMultiplier, wrunReadsMarketFacts, wrunCoinLegsOf, wrunCoinLegVenues, wrunSheetWithCoinLegs, wrunSheetWithLaneCurrencies, wrunSheetWithLaneDemand, wrunSheetWithLaneGate, WRUN_DOLLAR_MULTIPLIER_FILL, WRUN_DOLLAR_MULTIPLIER_UNPROVEN_CODE, } from './wrun-chart-market-facts.util.js';
|
|
151
|
+
import { forgetWrunMarketReadFailures, warmWrunMarketDollarFacts, warmWrunMarketFacts, wrunChartSizeUnit, wrunLaneDemandNeedsDirectory, wrunMarketDollarReadFailure, wrunMarketDollarUnit, wrunMarketReadMark, wrunMarketFactsFor, wrunMarketFactsNeedDirectory, wrunReadsDollarMultiplier, wrunReadsMarketFacts, wrunStrategyPointValue, wrunCoinLegsOf, wrunCoinLegVenues, wrunSheetWithCoinLegs, wrunSheetWithLaneCurrencies, wrunSheetWithLaneDemand, wrunSheetWithLaneGate, WRUN_DOLLAR_MULTIPLIER_FILL, WRUN_DOLLAR_MULTIPLIER_UNPROVEN_CODE, } from './wrun-chart-market-facts.util.js';
|
|
152
152
|
import { wrunFollowsCoin, wrunInputGateOn, wrunRowVisibleHere } from './wrun-market-facts.util.js';
|
|
153
153
|
import { wrunRowsKeepingMarketDefaults } from './wrun-market-size-defaults.leaf.js';
|
|
154
154
|
import { reconcileWrunMarketSizeDefaults } from './wrun-market-size-defaults.util.js';
|
|
155
155
|
import { rememberWrunSessionChartNames, resolveWrunChartNames, wrunSessionChartNamesOf, } from './wrun-chart-context-names.util.js';
|
|
156
156
|
import { assertWrunBrowserSources, getWrunBrowserHost, } from './wrun-host.service.js';
|
|
157
157
|
import { applyWrunInertLegendState } from './wrun-inert-legend.util.js';
|
|
158
|
-
import { annotateWrunErrorRefusal, attachWrunRefusal, serializeWrunRefusal, stampWrunRefusalTelemetry, wrunAuthorRuleSeed, wrunLeftOutRefusalSeed, wrunOptionsStopSeed, wrunOverlayEditable, wrunRefusalFor, wrunRefusalOf, wrunRefusalSeedFor, wrunRefusalSeedOf, WRUN_REFUSAL_EVENT_MARKET_KEY, } from './wrun-refusal.util.js';
|
|
158
|
+
import { annotateWrunErrorRefusal, attachWrunRefusal, serializeWrunRefusal, stampWrunRefusalTelemetry, wrunAuthorRuleSeed, wrunLeftOutRefusalSeed, wrunOptionsStopSeed, wrunOverlayEditable, wrunRefusalFor, wrunRefusalOf, wrunRefusalSeedFor, wrunRefusalSeedOf, wrunTapeIntervalSeed, WRUN_REFUSAL_EVENT_MARKET_KEY, } from './wrun-refusal.util.js';
|
|
159
159
|
import { claimWrunRefusalNotice, emitWrunRefusalChange, liveWrunRefusalAttempt, projectWrunRefusal, retractWrunRefusal, } from './wrun-refusal-surface.util.js';
|
|
160
160
|
import { WRUN_ETF_COVERED_COINS, wrunInputDrawsWithoutLane, wrunInputReadsFillOverEmptyLane, wrunInputRequirements, wrunPredictionMarketWalledInput, wrunRunMarketReadOfFetchType, wrunSheetReadsRunMarket, wrunUnservedLanes, } from './wrun-input-requirements.leaf.js';
|
|
161
161
|
import { getWrunOverlayMetadata, rememberWrunOverlayMetadata } from './wrun-overlay-metadata.util.js';
|
|
@@ -174,7 +174,7 @@ import { FeatureFlag } from '../../constants/feature-flags.constants.js';
|
|
|
174
174
|
import { clearedColorCustomizationFlags } from '../chart/color-customization.leaf.js';
|
|
175
175
|
import { WRUN_LATEST_HISTORY_LENGTH } from './wrun-latest-history.leaf.js';
|
|
176
176
|
import { resolveChartPricePrecision } from '../chart/price-precision.util.js';
|
|
177
|
-
import { currentWrunOverlayLiveGeneration, getWrunOverlayLiveContext, hasQueuedWrunUserRun, isWrunOverlayFullRerunInFlight, isWrunOverlayReplacementPending, markWrunOverlayComputeSucceeded, nextWrunOverlayLiveGeneration, noteWrunOverlayRunSettle, noteWrunOverlayWholeWindowDrawn, onWrunChartTeardown, onWrunOverlayLiveTeardown, rerunWrunOverlayForChartWave, setWrunOverlayLiveContext, setWrunPrefixRuntime, setWrunUnansweredDropSurface, suspendWrunOverlayLiveSession, withWrunOverlaySessionLock, wrunChartMarketIdentity, } from './wrun-overlay-drivers.util.js';
|
|
177
|
+
import { currentWrunOverlayLiveGeneration, getWrunOverlayLiveContext, hasQueuedWrunUserRun, isWrunOverlayFullRerunInFlight, isWrunOverlayReplacementPending, markWrunOverlayComputeSucceeded, nextWrunOverlayLiveGeneration, noteWrunOverlayRunSettle, noteWrunOverlayWholeWindowDrawn, onWrunChartTeardown, onWrunOverlayLiveTeardown, rerunWrunOverlayForChartWave, setWrunOverlayLiveContext, setWrunPrefixRuntime, setWrunUnansweredDropSurface, suspendWrunOverlayLiveSession, withWrunOverlaySessionLock, wrunChartMarketIdentity, wrunPictureIdentityOf, } from './wrun-overlay-drivers.util.js';
|
|
178
178
|
import { __resetWrunInstallPacerForTests, admitWrunInstall, dropWrunInstallPacer, noteWrunInstallWrite, wrunInstallLastAdmission, } from './wrun-install-pacer.util.js';
|
|
179
179
|
import { claimWrunWarmupHead, readWrunWarmupHeadBars, readWrunWarmupHeadSpan, storeWrunWarmupHeadSpan, wrunWarmupHeadStored, } from './wrun-warmup-head-store.util.js';
|
|
180
180
|
import { protectedKScriptMountedRowCount } from '../chart/protected-kscript-empty-output.util.js';
|
|
@@ -189,9 +189,10 @@ import { getMarketKind } from '../chart/marketKind.util.js';
|
|
|
189
189
|
import { isCmeGoverned } from '../chart/cme-realtime.util.js';
|
|
190
190
|
import { wrunBarSessionFactsResolver, wrunBarVenueOf } from '../chart/wrun-bar-session-facts.util.js';
|
|
191
191
|
import { wrunPresentIsPartial } from './wrun-present-bits.util.js';
|
|
192
|
-
import { assertWrunPinnedLegVenues, partitionWrunLegsByVenue, wrunLegFetchedRowReaders, wrunLegRidesNativeRows, wrunPinMarketsOf, wrunPinnedLegRefusalOf, wrunPinVenueVerdict, } from './wrun-pin-venues.util.js';
|
|
192
|
+
import { assertWrunPinnedLegVenues, partitionWrunLegsByVenue, wrunLegFetchedRowReaders, wrunLegRidesNativeRows, wrunPinMarketsOf, wrunPinnedLegRefusalOf, wrunPinVenueRefusalMessage, wrunPinVenueVerdict, } from './wrun-pin-venues.util.js';
|
|
193
|
+
import { captureCmeLanesFence, isCmeLanesFenceCurrent } from '../chart/governed-lanes-gate.util.js';
|
|
193
194
|
import { annotateWrunErrorFailureRow, annotateWrunErrorIndicatorId, isWrunOverlayPausedError, isWrunQuarantinedError, isWrunWorkerPoisonError, WrunChartGoneError, WrunDeadlineError, WrunIntegrationError, WrunLaneVenueBlockedError, WrunNoBarsError, WrunOverlayPausedError, WrunPredictionMarketBlockedError, WrunSourceDataUnavailableError, WrunStrategyVenueBlockedError, WrunVenueBlockedError, } from './wrun-registry-errors.util.js';
|
|
194
|
-
import { cmePinRefusalVariant, createKScriptVenueBlockedError, isCmeChartStudyRun, isCmeReadableKScriptRun, isCmeUserScriptCandidate, isCmeUserScriptRun, isKScriptDisplayBlockedOnExchange, isOfficialWrunOverlay, isOpraUserScriptCandidate, isOpraUserScriptRun, payloadTouchesCmeVenue, payloadTouchesOpraVenue, } from '../chart/kscript-venue-policy.util.js';
|
|
195
|
+
import { cmePinRefusalVariant, cmeServerLanesOpen, createKScriptVenueBlockedError, isFirstPartyKScriptRun, isUserKScriptBlockedOnExchange, userRunServerLaneOf, isCmeChartStudyRun, isCmeReadableKScriptRun, isCmeUserScriptCandidate, isCmeStrategyClosed, isCmeUserScriptRun, isKScriptDisplayBlockedOnExchange, isOfficialWrunOverlay, isOpraUserScriptCandidate, isOpraUserScriptRun, payloadTouchesCmeVenue, payloadTouchesOpraVenue, } from '../chart/kscript-venue-policy.util.js';
|
|
195
196
|
import { planeReadFactsOf } from '../chart/opra-read-access.leaf.js';
|
|
196
197
|
import { isOpraUserScriptsFlagOn } from '../chart/opra-user-scripts-gate.util.js';
|
|
197
198
|
import { captureCmeStudyAuth, cmeStudyStopReason, isCmeStudyAuthCurrent, isCmeUserScriptsFlagOn, } from '../chart/cme-user-scripts-gate.util.js';
|
|
@@ -205,6 +206,7 @@ import { resolveWrunTapeAcquisition, WRUN_TAPE_COINS_UNPRICED_CODE, WRUN_TAPE_IN
|
|
|
205
206
|
import { wrunChartSession, wrunLegCandleClose, wrunPrimaryRowBounds } from './wrun-leg-close.util.js';
|
|
206
207
|
import { isWrunRowSourceTransientError, wrunRowBatchDeliveredSheet, wrunRowSourceSettingsLeftBy, } from './wrun-row-source.js';
|
|
207
208
|
import { wrunOverlayOpraStamped } from './wrun-cloud-opra-stamp.util.js';
|
|
209
|
+
import { stampWrunHostedCme, wrunBatchGovernedOf, wrunFailureGovernedOf, wrunGovernedReadsCme, wrunHostedRunReadsCme, } from './wrun-cloud-cme-stamp.util.js';
|
|
208
210
|
// The run's one options market (the row lanes' planner holds the module on this graph already).
|
|
209
211
|
import { decideWrunRunOptionsMarket, noteWrunRunOptionsMarket, wrunDecidedOptionsExchange, } from './derived-roots.util.js';
|
|
210
212
|
import { wrunRowSourceFor } from './wrun-row-source-factory.js';
|
|
@@ -228,8 +230,9 @@ import { wrunTwinOriginalLookbackBars } from './wrun-twin-lookback.util.js';
|
|
|
228
230
|
import { overlayWrunRunInterval, wrunSettingsForRunInterval, wrunTimeframeIsChartOrFiner, wrunTwinLookbackBars, } from './wrun-run-interval.util.js';
|
|
229
231
|
import { planWrunRunIntervalRows, rememberWrunRunIntervalSession, wrunRunIntervalComputeRows, wrunRunIntervalCoverageKey, wrunRunIntervalProjectionOf, wrunRunIntervalRowsThrough, wrunRunIntervalSentRow, wrunRunIntervalSessionOf, } from './wrun-run-interval-session.util.js';
|
|
230
232
|
import { isWrunBandedBookSource } from './wrun-book-bands.leaf.js';
|
|
231
|
-
import { attachWrunLive, wrunLiveOf, } from '../../interfaces/wrun-runtime.interface.js';
|
|
232
|
-
import { normalizeRuntimeDiagnostics, shouldNoticeWrunRefusal, WRUN_RUN_FAILURE_ROW_CODES, WRUN_RUN_TIMEOUT_CODE, wrunAbortRuntimeDiagnostic, wrunRunFailureRuntimeDiagnostic, } from '../scriptEditor/wrun-runtime-diagnostics.leaf.js';
|
|
233
|
+
import { attachWrunLive, wrunLiveOf, wrunTrapOf, } from '../../interfaces/wrun-runtime.interface.js';
|
|
234
|
+
import { normalizeRuntimeDiagnostics, shouldNoticeWrunRefusal, WRUN_RUN_FAILURE_ROW_CODES, WRUN_RUN_TIMEOUT_CODE, WRUN_ABORT_DIAGNOSTIC_CODE, WRUN_UNREACHABLE_TRAP_CODE, wrunAbortRuntimeDiagnostic, wrunRunFailureRuntimeDiagnostic, wrunTrapRuntimeDiagnostic, } from '../scriptEditor/wrun-runtime-diagnostics.leaf.js';
|
|
235
|
+
import { parkWrunTrapSeed, wrunTrapSeedOf } from './wrun-trap-replay.util.js';
|
|
233
236
|
import { buildWrunOverlayRunResult, withCanvasHostFill, } from './wrun-overlay-result.util.js';
|
|
234
237
|
import { applyWrunIntegrationBudgetPolicy, wrunIntegratedRowsView } from './wrun-integration-budget.util.js';
|
|
235
238
|
// The result build lives in wrun-overlay-result.util (the result reader core); its importers keep this path.
|
|
@@ -565,10 +568,61 @@ export async function runWrunOverlayOnChart(target) {
|
|
|
565
568
|
// that opens later judges the walled CME studies again (`armCmeUserScriptsRejudge`). A host that binds neither port
|
|
566
569
|
// judges by the map as it stands.
|
|
567
570
|
const cmeCandidate = isCmeUserScriptCandidate(provenance);
|
|
568
|
-
//
|
|
569
|
-
//
|
|
570
|
-
|
|
571
|
-
|
|
571
|
+
// A server-lane user run (the decider's `userRunServerLaneOf`: a Cloud record), which no browser lane admits a leg
|
|
572
|
+
// for, and a first-party run, which reads a CME pin on any lane: both have their CME read marked from the head (the
|
|
573
|
+
// browser lanes mark a browser user run's as they admit its legs).
|
|
574
|
+
const serverLaneUser = userRunServerLaneOf(provenance) !== undefined;
|
|
575
|
+
const marksPinAtHead = serverLaneUser || isFirstPartyKScriptRun(provenance);
|
|
576
|
+
// The sheet as the prediction wall reads it pins a CME market: read for a user run the gate may open CME to (the runs
|
|
577
|
+
// a CME pin's flag wait and authorisation are for), and for every run whose pin is marked at the head.
|
|
578
|
+
const pinSheet = cmeCandidate || marksPinAtHead
|
|
579
|
+
? wrunSheetWithLaneDemand(wrunSheetWithSettings(target.metadata, meta.settings), wrunChartSizeUnit(chartMetadata), meta.settings)
|
|
580
|
+
: undefined;
|
|
581
|
+
const pinExchange = typeof chartExchange === 'string' ? chartExchange : undefined;
|
|
582
|
+
const effectiveSheetPinsCme = pinSheet !== undefined && wrunSheetPinsCme(pinSheet, pinExchange);
|
|
583
|
+
const sheetPinsCme = cmeCandidate && effectiveSheetPinsCme;
|
|
584
|
+
// Such a run whose effective sheet pins a CME market reads CME whatever the chart (a hosted one on the server): its
|
|
585
|
+
// CME provenance is set from its head (`computed.cme`), before execution is asked, so every outcome of the run, a
|
|
586
|
+
// failure included, carries the mark (the AI boundary never opens on CME), for every author.
|
|
587
|
+
if (marksPinAtHead && effectiveSheetPinsCme)
|
|
588
|
+
computed.cme = true;
|
|
589
|
+
// ...and, under a lit `cme-lanes` flag, it passes the one CME decision every CME user run passes (invariant 2: the
|
|
590
|
+
// data wall's `isCmeReadableKScriptRun`, the `cme-user-scripts` gate with its kill switch, sign-in and the CME data
|
|
591
|
+
// terms) before anything is sent: no browser pin judge stands in a hosted run's way. Refused as the browser pin
|
|
592
|
+
// judge refuses (`pin-refused`, in the gate's words, `cmePinRefusalVariant`). Judged per pinned venue by the data
|
|
593
|
+
// wall (`isUserKScriptBlockedOnExchange`), so a venue the cutover never opens (GLOBEX) stays closed. While
|
|
594
|
+
// `cme-lanes` is dark (`cmeServerLanesOpen`) the cloud refuses the pin itself, as before.
|
|
595
|
+
const cmePins = serverLaneUser && effectiveSheetPinsCme && pinSheet !== undefined
|
|
596
|
+
? pinSheet.inputs.flatMap((input) => {
|
|
597
|
+
if (!wrunSheetPinsCme({ inputs: [input], inputSources: pinSheet.inputSources }, pinExchange))
|
|
598
|
+
return [];
|
|
599
|
+
const source = pinSheet.inputSources[input.name];
|
|
600
|
+
const venue = typeof source?.exchange === 'string' && source.exchange !== '' ? source.exchange : 'CME';
|
|
601
|
+
return [{ name: input.name, venue, pin: String(source?.symbol ?? venue) }];
|
|
602
|
+
})
|
|
603
|
+
: [];
|
|
604
|
+
/** The pin refusal of one CME pin, in the gate's words as they read when it is raised. */
|
|
605
|
+
const cmePinRefusal = (pinned) => attachWrunRefusal(new Error(wrunPinVenueRefusalMessage(pinned.name, pinned.venue)), {
|
|
606
|
+
cls: 'pin-refused',
|
|
607
|
+
variant: cmePinRefusalVariant(provenance),
|
|
608
|
+
params: { pin: pinned.pin },
|
|
609
|
+
});
|
|
610
|
+
if (cmeServerLanesOpen()) {
|
|
611
|
+
const pinned = cmePins.find((entry) => isUserKScriptBlockedOnExchange(entry.venue, provenance));
|
|
612
|
+
if (pinned !== undefined)
|
|
613
|
+
throw cmePinRefusal(pinned);
|
|
614
|
+
}
|
|
615
|
+
// The CME lanes fence (governed-lanes-gate.util, 2026-11-11): a server-lane user run reading CME (on a CME chart, or
|
|
616
|
+
// pinning a CME market) captures it here; the `cme-lanes` flag going dark moves it, so this run's answer, in flight
|
|
617
|
+
// and stamped or not, never lands after the rollback (`assertWrunCmeStudyAuthCurrent`): it ends as the wall the
|
|
618
|
+
// decider now answers (on a CME chart the display wall the lifecycle paints, off one its pin refusal), never a blank
|
|
619
|
+
// pane or a live session. A browser run never captures it: the flag does not govern its lane.
|
|
620
|
+
if (serverLaneUser && (payloadTouchesCmeVenue(chartExchange) || cmePins.length > 0)) {
|
|
621
|
+
computed.cmeLanes = captureCmeLanesFence();
|
|
622
|
+
computed.cmeLanesClosed = () => payloadTouchesCmeVenue(chartExchange) || cmePins.length === 0
|
|
623
|
+
? withCmeStudyStopSeed(new WrunVenueBlockedError(createKScriptVenueBlockedError(String(chartExchange)).message, chartExchange), target.chartIndex, target.indicatorId, chartExchange)
|
|
624
|
+
: cmePinRefusal(cmePins[0]);
|
|
625
|
+
}
|
|
572
626
|
const cmeWallAhead = payloadTouchesCmeVenue(chartExchange)
|
|
573
627
|
? isKScriptDisplayBlockedOnExchange(chartExchange, provenance)
|
|
574
628
|
: sheetPinsCme && !isCmeUserScriptRun(provenance);
|
|
@@ -588,11 +642,13 @@ export async function runWrunOverlayOnChart(target) {
|
|
|
588
642
|
if (isKScriptDisplayBlockedOnExchange(candleVenue, provenance)) {
|
|
589
643
|
throw withCmeStudyStopSeed(new WrunVenueBlockedError(createKScriptVenueBlockedError(String(candleVenue)).message, candleVenue), target.chartIndex, target.indicatorId, candleVenue);
|
|
590
644
|
}
|
|
591
|
-
// Strategy testing is no CME chart study (Kyle 2026-10-29): on a CME
|
|
592
|
-
// OpenMarket package's included, here at the head before the loader is
|
|
593
|
-
// touched (the broker feed, `wrunStrategyRunInputFor`, is never built), on
|
|
594
|
-
// the wall's, with its own record on the legend (`cme-wall` `strategy`: no
|
|
595
|
-
|
|
645
|
+
// Strategy testing is no CME chart study while the `cme-lanes` cutover flag is dark (Kyle 2026-10-29): on a CME
|
|
646
|
+
// chart every strategy sheet is refused, an OpenMarket package's included, here at the head before the loader is
|
|
647
|
+
// raised, a lane is asked or the sandbox is touched (the broker feed, `wrunStrategyRunInputFor`, is never built), on
|
|
648
|
+
// every lane. A venue refusal held like the wall's, with its own record on the legend (`cme-wall` `strategy`: no
|
|
649
|
+
// wall painter stands behind it). Under a lit flag (`isCmeStrategyClosed` reads false) a strategy sheet on a CME
|
|
650
|
+
// chart runs through the ordinary CME study rule above: the display wall and the gate (sign-in, the CME terms).
|
|
651
|
+
if (wrunCmeStrategyClosedOn(chartExchange) && isWrunStrategySheet(target.metadata)) {
|
|
596
652
|
throw attachWrunRefusal(new WrunStrategyVenueBlockedError(createKScriptVenueBlockedError(String(chartExchange)).message, chartExchange), WRUN_CME_STRATEGY_REFUSAL_SEED);
|
|
597
653
|
}
|
|
598
654
|
// The prediction-market wall (Kyle 2026-10-29: options indicators on a Polymarket chart make no sense): on a
|
|
@@ -877,10 +933,15 @@ function wrunRunRejectionAsSettled(error, run) {
|
|
|
877
933
|
dropped.cause = WRUN_SUPERSEDED_RUN_CAUSE;
|
|
878
934
|
return dropped;
|
|
879
935
|
}
|
|
880
|
-
/** The record seed of a strategy sheet the run head refuses on a CME chart
|
|
881
|
-
* wall's `strategy` variant ("Strategy testing isn't available on CME markets"), its way out the class's own (switch
|
|
936
|
+
/** The record seed of a strategy sheet the run head refuses on a CME chart while the `cme-lanes` flag is dark
|
|
937
|
+
* (`isCmeStrategyClosed`, `WrunStrategyVenueBlockedError`): the CME wall's `strategy` variant ("Strategy testing isn't available on CME markets"), its way out the class's own (switch
|
|
882
938
|
* the market, or the works-on list). */
|
|
883
939
|
const WRUN_CME_STRATEGY_REFUSAL_SEED = Object.freeze({ cls: 'cme-wall', variant: 'strategy' });
|
|
940
|
+
/** The strategy rule on CME (`isCmeStrategyClosed`) over the chart's exchange in either form the CME predicates read
|
|
941
|
+
* (a string, or the multi-exchange array, BLOCKING semantics: any closed CME leg refuses). */
|
|
942
|
+
function wrunCmeStrategyClosedOn(exchange) {
|
|
943
|
+
return (Array.isArray(exchange) ? exchange : [exchange]).some((entry) => typeof entry === 'string' && isCmeStrategyClosed(entry));
|
|
944
|
+
}
|
|
884
945
|
/** The record seed of a sheet the run head refuses on a prediction market (`WrunPredictionMarketBlockedError`, the rule
|
|
885
946
|
* wrunPredictionMarketWalls): the wall family's `prediction` variant, its way out the class's own (switch the market,
|
|
886
947
|
* or the works-on list). */
|
|
@@ -920,6 +981,12 @@ function assertWrunCmeStudyAuthCurrent(computed, indicatorId) {
|
|
|
920
981
|
if (!wrunCmeStudyAuthStands(computed)) {
|
|
921
982
|
throw new WrunChartGoneError(`wrun overlay '${indicatorId}' was superseded during its run (cme-auth)`);
|
|
922
983
|
}
|
|
984
|
+
// A server-lane CME run whose lanes went dark since its head (the CME lanes fence): its answer never lands; it ends
|
|
985
|
+
// as the wall the decider answers now.
|
|
986
|
+
if (computed.cmeLanes !== undefined && !isCmeLanesFenceCurrent(computed.cmeLanes)) {
|
|
987
|
+
throw (computed.cmeLanesClosed?.() ??
|
|
988
|
+
new WrunChartGoneError(`wrun overlay '${indicatorId}' was superseded during its run (cme-lanes)`));
|
|
989
|
+
}
|
|
923
990
|
}
|
|
924
991
|
/** The console provenance a run's outputs carry (`setIndicatorPrintOutputs`): its OPRA fact always, its CME fact only
|
|
925
992
|
* when set, so an output of a run that read no CME reads exactly as before. */
|
|
@@ -936,6 +1003,24 @@ function isWrunVenueWallPainted(error) {
|
|
|
936
1003
|
!(error instanceof WrunPredictionMarketBlockedError) &&
|
|
937
1004
|
!(error instanceof WrunLaneVenueBlockedError));
|
|
938
1005
|
}
|
|
1006
|
+
/** The trap row of an editor draft run that carried a replay seed (wrun-trap-replay.util: a full run or a live start
|
|
1007
|
+
* that trapped in the sandbox): the seed parks under a token the row carries in `details.trap.token`, which the
|
|
1008
|
+
* editor's replay controller takes it by. Any other row (a published Indicator, an app layer, no seed) as it is, and
|
|
1009
|
+
* nothing parks for it. */
|
|
1010
|
+
export function wrunTrapRowWithReplayToken(trap, error, overlay) {
|
|
1011
|
+
const seed = wrunTrapSeedOf(error);
|
|
1012
|
+
const record = trap.details?.trap;
|
|
1013
|
+
if (seed === undefined || typeof record !== 'object' || record === null)
|
|
1014
|
+
return trap;
|
|
1015
|
+
if (trap.code !== WRUN_ABORT_DIAGNOSTIC_CODE && trap.code !== WRUN_UNREACHABLE_TRAP_CODE)
|
|
1016
|
+
return trap;
|
|
1017
|
+
if (!isWrunDraftOverlaySettings(overlay.settings) || isWrunAppLayerOverlaySettings(overlay.settings))
|
|
1018
|
+
return trap;
|
|
1019
|
+
return {
|
|
1020
|
+
...trap,
|
|
1021
|
+
details: { ...trap.details, trap: { ...record, token: parkWrunTrapSeed(seed, overlay.indicatorId) } },
|
|
1022
|
+
};
|
|
1023
|
+
}
|
|
939
1024
|
/** A run's runtime trap row with the run's console provenance on it (`RuntimeDiagnostic.opra` and `.cme`): the row as
|
|
940
1025
|
* it is for a run that read neither plane. */
|
|
941
1026
|
function wrunTrapRowWithProvenance(trap, provenance) {
|
|
@@ -1052,7 +1137,10 @@ export async function surfaceWrunRunFailureOnLegend(chartIndex, indicatorId, err
|
|
|
1052
1137
|
// The write waits on the store's module, so the rejection can outrun it: it rides the error, and the
|
|
1053
1138
|
// editor's Run awaits it before it reads the row (wrunErrorFailureRowWritten). The author's abort text can
|
|
1054
1139
|
// carry what the run computed: a run over OPRA or CME data marks the row (every console export strips it).
|
|
1055
|
-
const written = publishWrunRuntimeTrapDiagnostic(chartIndex, indicatorId, wrunTrapRowWithProvenance(trap,
|
|
1140
|
+
const written = publishWrunRuntimeTrapDiagnostic(chartIndex, indicatorId, wrunTrapRowWithProvenance(wrunTrapRowWithReplayToken(trap, error, {
|
|
1141
|
+
indicatorId,
|
|
1142
|
+
settings: tc.metadata?.find((meta) => meta.id === indicatorId)?.settings,
|
|
1143
|
+
}), context));
|
|
1056
1144
|
annotateWrunErrorFailureRow(error, written);
|
|
1057
1145
|
await written;
|
|
1058
1146
|
if (isCurrent())
|
|
@@ -1677,7 +1765,9 @@ export function wrunChartRunHealth(metadata, settings, outputRows, sourceAbsent,
|
|
|
1677
1765
|
...output,
|
|
1678
1766
|
visible: wrunOutputShownOnChart(output, settings, owned) && wrunRowVisibleHere(output.visible_by, sizeUnit),
|
|
1679
1767
|
})),
|
|
1680
|
-
}, outputRows
|
|
1768
|
+
}, outputRows,
|
|
1769
|
+
// The chip names a silent line by the words the legend does: a built-in's port in its built-in's words.
|
|
1770
|
+
builtinPortOf(settings));
|
|
1681
1771
|
if (!sourceAbsent || watched.silentOutputs.length === 0)
|
|
1682
1772
|
return { watched, health: watched };
|
|
1683
1773
|
return {
|
|
@@ -2128,6 +2218,20 @@ export function wrunRuntimeTrapDiagnostic(error, context = {}) {
|
|
|
2128
2218
|
const message = error instanceof Error ? error.message : typeof error === 'string' ? error : '';
|
|
2129
2219
|
if (!message)
|
|
2130
2220
|
return null;
|
|
2221
|
+
// The ABI host's record (what failed, the phase, the bar) builds the row when the rejection carries one: the plain
|
|
2222
|
+
// words and the bar, the host's words kept in `details.hostMessage`. A rejection without one (a run that never
|
|
2223
|
+
// reached a guest call) reads its words as before, and so does a record whose words cannot be built.
|
|
2224
|
+
const trap = wrunTrapOf(error);
|
|
2225
|
+
if (trap !== undefined) {
|
|
2226
|
+
try {
|
|
2227
|
+
const row = wrunTrapRuntimeDiagnostic(trap, message, (key, params) => wrunChartHostEnv().t(key, params), context);
|
|
2228
|
+
if (row !== null)
|
|
2229
|
+
return row;
|
|
2230
|
+
}
|
|
2231
|
+
catch (translateError) {
|
|
2232
|
+
console.warn('[wrun] trap row words failed:', translateError);
|
|
2233
|
+
}
|
|
2234
|
+
}
|
|
2131
2235
|
return wrunAbortRuntimeDiagnostic(message) ?? wrunRunFailureRuntimeDiagnostic(message, context);
|
|
2132
2236
|
}
|
|
2133
2237
|
async function publishWrunRuntimeTrapDiagnostic(chartIndex, indicatorId, diagnostic) {
|
|
@@ -5332,7 +5436,7 @@ async function prepareWrunSandboxRun(passTarget, tc, meta, refusal, computed, ow
|
|
|
5332
5436
|
// does: the Strategy Tester's first bar is the head's), the chart interval
|
|
5333
5437
|
// and the display name (contract section 2).
|
|
5334
5438
|
const strategy = isWrunStrategySheet(target.metadata)
|
|
5335
|
-
? await wrunStrategyRunInputFor(target.chartIndex, target.title, rows, computeOhlcvRows)
|
|
5439
|
+
? await wrunStrategyRunInputFor(target.chartIndex, target.title, rows, computeOhlcvRows, chartMetadata)
|
|
5336
5440
|
: undefined;
|
|
5337
5441
|
// A Retry or a settings run may dispatch a package the host quarantined
|
|
5338
5442
|
// after a timeout (C5); every other run respects the quarantine.
|
|
@@ -6150,7 +6254,15 @@ async function integrateWrunRunAsk(runTarget, tc, meta, refusal, computed, owner
|
|
|
6150
6254
|
const { source } = ask;
|
|
6151
6255
|
// The source computes the batch (the browser lanes' preparation moves the stage to its lanes, then back).
|
|
6152
6256
|
computed.stage = 'compute';
|
|
6153
|
-
const batch = await ask.call().catch((error) => {
|
|
6257
|
+
const batch = await ask.call().catch(async (error) => {
|
|
6258
|
+
// The server's governed-plane mark on the failure (the error frame's relayed `details.wrunGoverned`, or the
|
|
6259
|
+
// overlay's sticky mark the socket source attached, wrun-cloud-cme-stamp.util `wrunFailureGovernedOf`, fail closed):
|
|
6260
|
+
// a run that read CME surfaces its failure CME-marked (`computed.cme`), and its overlay is stamped as a marked
|
|
6261
|
+
// success's is; a stamp that cannot be written still leaves the failure marked, so it is withheld, never raw.
|
|
6262
|
+
if (wrunGovernedReadsCme(wrunFailureGovernedOf(error))) {
|
|
6263
|
+
computed.cme = true;
|
|
6264
|
+
await stampWrunFailedRunCme(runTarget, tc, meta, owner, head);
|
|
6265
|
+
}
|
|
6154
6266
|
// An ask the source merged nothing from (no reply: a laundered kick, a socket that is not open, a
|
|
6155
6267
|
// failed worker) is a cause a second run gets past: the run fails with Retry, the heal ladder's
|
|
6156
6268
|
// retryable class, never an empty success.
|
|
@@ -6219,6 +6331,11 @@ async function integrateWrunRunAsk(runTarget, tc, meta, refusal, computed, owner
|
|
|
6219
6331
|
// run's copy only), so the live context's ticks and reseeds plan the legs this run fetched.
|
|
6220
6332
|
const sheetNow = wrunSheetWithRespelledPins(wrunSheetWithSettings(runTarget.metadata, meta.settings), respelledPins);
|
|
6221
6333
|
assertWrunRunMayPaint(target.chartIndex, target.indicatorId, replay);
|
|
6334
|
+
// A picture over a lane still filling (a row lane's first-paint slice, its older bars loading) or degraded to
|
|
6335
|
+
// empty is not final: the fill's or the recovery's run (a whole run, same generation and market) completes it.
|
|
6336
|
+
// It names no picture, and neither does the session it installs, so no heatmap scale decided from the partial
|
|
6337
|
+
// rows is held as the final picture's (wrunPictureIdentityOf).
|
|
6338
|
+
const picturePartial = fillingLanes.length > 0 || degraded.length > 0;
|
|
6222
6339
|
const integrateOptions = {
|
|
6223
6340
|
tc,
|
|
6224
6341
|
meta,
|
|
@@ -6226,6 +6343,9 @@ async function integrateWrunRunAsk(runTarget, tc, meta, refusal, computed, owner
|
|
|
6226
6343
|
indicatorId: target.indicatorId,
|
|
6227
6344
|
metadata: sheetNow,
|
|
6228
6345
|
outputRows,
|
|
6346
|
+
// What these rows were computed for (the settings generation and the market the run read, the live
|
|
6347
|
+
// context's identity below): a mounted heatmap keeps its colour scale through a rerun of the same picture.
|
|
6348
|
+
pictureIdentity: wrunPictureIdentityOf({ settingsRevision: computed.generation, marketIdentity, picturePartial }),
|
|
6229
6349
|
params: paramValues,
|
|
6230
6350
|
title: target.title,
|
|
6231
6351
|
position: target.position,
|
|
@@ -6661,6 +6781,8 @@ async function integrateWrunRunAsk(runTarget, tc, meta, refusal, computed, owner
|
|
|
6661
6781
|
// degraded ones, and the ones the capability rule never dispatched.
|
|
6662
6782
|
...(window ? { window } : {}),
|
|
6663
6783
|
...(degradedLanes.size > 0 ? { degradedLanes } : {}),
|
|
6784
|
+
// The run drew a partial picture (a filling or degraded lane): the session's passes name none either.
|
|
6785
|
+
...(picturePartial ? { picturePartial: true } : {}),
|
|
6664
6786
|
...(unservedLanes.length > 0 || unservedTradeLegs.size > 0
|
|
6665
6787
|
? { unservedLanes: new Set([...unservedLanes, ...unservedTradeLegs]) }
|
|
6666
6788
|
: {}),
|
|
@@ -6835,6 +6957,8 @@ async function integrateWrunRunAsk(runTarget, tc, meta, refusal, computed, owner
|
|
|
6835
6957
|
meta: mounted,
|
|
6836
6958
|
metadata: sheetAtRefine,
|
|
6837
6959
|
...fill,
|
|
6960
|
+
// The run's own rows again: its drawings keep or replace the mounted set as the run's did.
|
|
6961
|
+
drawingsRun: { reason, hasGoodResult },
|
|
6838
6962
|
});
|
|
6839
6963
|
if (refined.childOverlays !== undefined &&
|
|
6840
6964
|
!(await awaitWrunChildOverlays(chart, target.indicatorId))) {
|
|
@@ -6943,6 +7067,16 @@ const wrunSourceDiagnosticCodes = new WeakMap();
|
|
|
6943
7067
|
* the pass took the batch), in place of the rows its last verdict wrote. A part not given keeps its rows.
|
|
6944
7068
|
* Advisory, like every owned row set.
|
|
6945
7069
|
*/
|
|
7070
|
+
/** A batch's verdict with the CME row mark on each of its diagnostics (`RuntimeDiagnostic.cme`): the rows a result
|
|
7071
|
+
* that read CME carries (wrun-cloud-cme-stamp.util). */
|
|
7072
|
+
function wrunVerdictWithCmeMark(batch) {
|
|
7073
|
+
return {
|
|
7074
|
+
refusals: batch.refusals,
|
|
7075
|
+
...(batch.diagnostics !== undefined
|
|
7076
|
+
? { diagnostics: batch.diagnostics.map((row) => ({ ...row, cme: true })) }
|
|
7077
|
+
: {}),
|
|
7078
|
+
};
|
|
7079
|
+
}
|
|
6946
7080
|
async function publishWrunSourceVerdict(chartIndex, indicatorId, meta, verdict, indicatorName) {
|
|
6947
7081
|
const owned = new Set();
|
|
6948
7082
|
const rows = [];
|
|
@@ -7238,10 +7372,32 @@ async function integrateWrunRowSourceBatch(asked, tc, meta, refusal, computed, o
|
|
|
7238
7372
|
// The cloud read OPRA for these rows (its mark): the run's console provenance from here (`computed.opra`).
|
|
7239
7373
|
if (batch.opra === true)
|
|
7240
7374
|
computed.opra = true;
|
|
7375
|
+
// The CME twin (wrun-cloud-cme-stamp.util, the AI boundary that never opens): a result that read CME, by the head
|
|
7376
|
+
// mark (the chart on the CME plane, the sheet pinning a CME market) or the server's (`wrunGoverned.cme`), is
|
|
7377
|
+
// stamped before any row of the batch lands, whoever wrote it and whatever lane ran it; a stamp that cannot be
|
|
7378
|
+
// written fails the batch (fail closed). Sticky for the mount: no result sheds it.
|
|
7379
|
+
const readsCme = wrunHostedRunReadsCme({
|
|
7380
|
+
chartExchange,
|
|
7381
|
+
sheetPinsCme: [runTarget.metadata, batch.sheet].some((sheet) => sheet !== undefined &&
|
|
7382
|
+
wrunSheetPinsCme(wrunSheetWithLaneDemand(wrunSheetWithSettings(sheet, meta.settings), wrunChartSizeUnit(chartMetadata), meta.settings), chartExchange)),
|
|
7383
|
+
governed: wrunBatchGovernedOf(batch),
|
|
7384
|
+
});
|
|
7385
|
+
if (readsCme) {
|
|
7386
|
+
const owns = await wrunRunOwnsOverlayReader(chartIndex, { owner, tc, meta, marketIdentity });
|
|
7387
|
+
if (!(await stampWrunHostedCme(chartIndex, indicatorId, meta, owns))) {
|
|
7388
|
+
throw new WrunChartGoneError(`wrun overlay '${indicatorId}' left its chart before its CME provenance was stamped (superseded)`);
|
|
7389
|
+
}
|
|
7390
|
+
// The run's console provenance from here (`computed.cme`): its debug lines, its trap rows, its live session.
|
|
7391
|
+
computed.cme = true;
|
|
7392
|
+
}
|
|
7241
7393
|
// The write boundary (WRUN-PANBACK-2 S1), as on the browser lane: the chart's install turn after the last await,
|
|
7242
7394
|
// the gesture read again (a drag that started while the turn waited holds the batch again while the episode's
|
|
7243
7395
|
// ceiling lasts), then the commit checks and the titan write with no await between them.
|
|
7244
7396
|
const { heldMs, pacedMs } = await awaitWrunInstallWriteTurn(runTarget, reason, edge);
|
|
7397
|
+
// A CME chart study's answer lands only under the authorisation its head captured (`computed.cmeAuth`), asserted
|
|
7398
|
+
// in the task of the titan write as on the browser lane: a hosted answer computed before a move of the viewer's
|
|
7399
|
+
// access (the terms, the account, the served tier, the `cme-lanes` flag) is dropped as superseded.
|
|
7400
|
+
assertWrunCmeStudyAuthCurrent(computed, indicatorId);
|
|
7245
7401
|
const identityLeft = wrunRunIdentityLeft(chartIndex, tc, meta, marketIdentity, readChartMetadata);
|
|
7246
7402
|
const settingsStale = kScriptSettingsRevision(meta.settings) !== computed.generation;
|
|
7247
7403
|
// The sheet and the params as the overlay's settings read NOW (a paint-only save restyled the
|
|
@@ -7266,6 +7422,8 @@ async function integrateWrunRowSourceBatch(asked, tc, meta, refusal, computed, o
|
|
|
7266
7422
|
indicatorId,
|
|
7267
7423
|
metadata: sheetNow,
|
|
7268
7424
|
outputRows,
|
|
7425
|
+
// What the batch was computed for, as on the browser lane (the session installs the same identity).
|
|
7426
|
+
pictureIdentity: wrunPictureIdentityOf({ settingsRevision: computed.generation, marketIdentity }),
|
|
7269
7427
|
params: paramValues,
|
|
7270
7428
|
title: runTarget.title,
|
|
7271
7429
|
position: runTarget.position,
|
|
@@ -7360,7 +7518,9 @@ async function integrateWrunRowSourceBatch(asked, tc, meta, refusal, computed, o
|
|
|
7360
7518
|
await publishWrunOwnedDiagnostics(chartIndex, indicatorId, WRUN_PIN_ROW_CODES, []);
|
|
7361
7519
|
await publishWrunOwnedDiagnostics(chartIndex, indicatorId, WRUN_ROW_BUDGET_ROW_CODES, []);
|
|
7362
7520
|
const indicatorName = typeof delivered.name === 'string' ? delivered.name : '';
|
|
7363
|
-
|
|
7521
|
+
// A result that read CME marks every row the cloud answered beside it (its execution errors can carry what the run
|
|
7522
|
+
// computed): every console export strips it, as the OPRA rows' mark (the socket source's).
|
|
7523
|
+
await publishWrunSourceVerdict(chartIndex, indicatorId, meta, readsCme ? wrunVerdictWithCmeMark(batch) : batch, indicatorName);
|
|
7364
7524
|
await publishWrunCanvasNotices(chartIndex, indicatorId, runResult);
|
|
7365
7525
|
// The draw calls the cloud skipped (its answer frame's `skipped`), the browser lane's one row.
|
|
7366
7526
|
if (window?.partial !== true)
|
|
@@ -7481,11 +7641,16 @@ async function integrateWrunRowSourceBatch(asked, tc, meta, refusal, computed, o
|
|
|
7481
7641
|
const ranSheet = batch.sheet ?? runTarget.metadata;
|
|
7482
7642
|
liveTick.markWrunSourceFedLiveContext(context, {
|
|
7483
7643
|
refusals: batch.refusals,
|
|
7484
|
-
...(batch.diagnostics !== undefined
|
|
7644
|
+
...(batch.diagnostics !== undefined
|
|
7645
|
+
? { diagnostics: readsCme ? wrunVerdictWithCmeMark(batch).diagnostics : batch.diagnostics }
|
|
7646
|
+
: {}),
|
|
7485
7647
|
...(session?.generation !== undefined ? { generation: session.generation } : {}),
|
|
7486
7648
|
sheetFor: (refusals, settings) => wrunSheetWithSettings(wrunRowBatchDeliveredSheet(ranSheet, refusals, sectionKinds), settings),
|
|
7487
7649
|
publish: (verdictMeta, verdict) => publishWrunSourceVerdict(chartIndex, indicatorId, verdictMeta, verdict, indicatorName),
|
|
7488
7650
|
});
|
|
7651
|
+
// The source-fed live context installs under the same authorisation (the awaits since the write gave it room to
|
|
7652
|
+
// move): a study the lifecycle stopped meanwhile gets no live session behind it.
|
|
7653
|
+
assertWrunCmeStudyAuthCurrent(computed, indicatorId);
|
|
7489
7654
|
setWrunOverlayLiveContext(context);
|
|
7490
7655
|
// A source-fed session holds no poll lane: the live channels of the session it replaced close.
|
|
7491
7656
|
openWrunPollLaneLiveChannels(context);
|
|
@@ -8238,21 +8403,20 @@ async function assertWrunTapeServedOnInterval(metadata, inputName, chartInterval
|
|
|
8238
8403
|
input: inputName,
|
|
8239
8404
|
value: chartInterval,
|
|
8240
8405
|
});
|
|
8241
|
-
|
|
8242
|
-
|
|
8243
|
-
|
|
8244
|
-
|
|
8245
|
-
params: { feed: 'tape', interval: '1M', chartInterval },
|
|
8246
|
-
});
|
|
8247
|
-
}
|
|
8406
|
+
// The record names the chart's kind (calendar, typed, finer) through the one tape seed the cloud lane reads too.
|
|
8407
|
+
const seed = wrunTapeIntervalSeed(chartInterval);
|
|
8408
|
+
if (isCalendarIntervalLabel(chartInterval))
|
|
8409
|
+
throw attachWrunRefusal(refused(hostWords()), seed);
|
|
8248
8410
|
const { isKScriptDataRestrictedForInterval } = await import('../chart/kscript-data-interval-restriction.leaf.js');
|
|
8249
8411
|
if (!isKScriptDataRestrictedForInterval('TRADES', chartInterval))
|
|
8250
8412
|
return;
|
|
8413
|
+
// A one-second chart reads the shared host's words; any other names what the raw trade lane serves.
|
|
8414
|
+
const serves = seed.variant === 'typed' ? 'no typed interval' : 'no chart finer than a minute';
|
|
8251
8415
|
throw attachWrunRefusal(refused(chartInterval === '1s'
|
|
8252
8416
|
? hostWords()
|
|
8253
8417
|
: `${WRUN_TAPE_INTERVAL_UNSUPPORTED_CODE}: input '${inputName}' reads tape on the interval ` +
|
|
8254
8418
|
`'${chartInterval}', which the chart's browser lane does not serve: the raw trade lane (K_TRADES) ` +
|
|
8255
|
-
|
|
8419
|
+
`serves ${serves}`), seed);
|
|
8256
8420
|
}
|
|
8257
8421
|
/** The chart interval in ms: the store's interval, else the trailing bar
|
|
8258
8422
|
* spacing of the candles, else one minute. */
|
|
@@ -8661,10 +8825,8 @@ runMarket) {
|
|
|
8661
8825
|
/** The strategy half a reseed retains: everything but the bars (rebuilt
|
|
8662
8826
|
* from the chart's candles per reseed). */
|
|
8663
8827
|
function wrunStrategySeedOf(strategy) {
|
|
8664
|
-
|
|
8665
|
-
|
|
8666
|
-
...(strategy.title !== undefined ? { title: strategy.title } : {}),
|
|
8667
|
-
};
|
|
8828
|
+
const { bars: _bars, ...seed } = strategy;
|
|
8829
|
+
return seed;
|
|
8668
8830
|
}
|
|
8669
8831
|
/**
|
|
8670
8832
|
* Subscribe the overlay's own live channels through the technical-script
|
|
@@ -9181,6 +9343,8 @@ export async function reseedWrunOverlayFromBuffers(indicatorId, reason, options
|
|
|
9181
9343
|
indicatorId,
|
|
9182
9344
|
metadata: context.metadata,
|
|
9183
9345
|
outputRows,
|
|
9346
|
+
// The session's own picture: a reseed redraws what the session computed, so a heatmap keeps its scale.
|
|
9347
|
+
pictureIdentity: wrunPictureIdentityOf(context),
|
|
9184
9348
|
title: context.title,
|
|
9185
9349
|
position: context.position,
|
|
9186
9350
|
axis: context.axis,
|
|
@@ -9203,6 +9367,8 @@ export async function reseedWrunOverlayFromBuffers(indicatorId, reason, options
|
|
|
9203
9367
|
...withPriceTick(reseedHostFill.tickSize),
|
|
9204
9368
|
...withCanvasHostFill(canvasFill),
|
|
9205
9369
|
...(clamped ? { window: { fromMs: clamped.fromMs, toMs: lastRowTs, partial: true } } : {}),
|
|
9370
|
+
// The session's own set, the one its ticks mount: it replaces the mounted drawings (wrunRunDrawingsPlan).
|
|
9371
|
+
sessionRedraw: true,
|
|
9206
9372
|
});
|
|
9207
9373
|
// A replay lane's paint keeps to the replay's bars, in this task.
|
|
9208
9374
|
if (context.replay)
|
|
@@ -9930,6 +10096,37 @@ async function wrunOptionsChainLaneExtrasFor(metadata, chartMetadata, facts, par
|
|
|
9930
10096
|
...wrunOptionsChainImplicitViewFields(gatewayScope),
|
|
9931
10097
|
};
|
|
9932
10098
|
}
|
|
10099
|
+
/**
|
|
10100
|
+
* Whether a run still owns its overlay, judged in the task that reads it by the evidence the OPRA writer reads
|
|
10101
|
+
* (`wrunOpraProvenanceWriter`): the mount epoch, the chart instance and the market identity (`wrunRunOwnerLeft`, the
|
|
10102
|
+
* main series read from the store right there) and the overlay's own mounted meta. The CME stamp of a hosted result
|
|
10103
|
+
* reads it (wrun-cloud-cme-stamp.util `stampWrunHostedCme`).
|
|
10104
|
+
*/
|
|
10105
|
+
async function wrunRunOwnsOverlayReader(chartIndex, ownership) {
|
|
10106
|
+
const { useChartStore } = await wrunChartHostEnv().chart.loadChartStore();
|
|
10107
|
+
return () => {
|
|
10108
|
+
const chartMetadataNow = useChartStore().mergedAllCharts[chartIndex]?.metadata;
|
|
10109
|
+
if (wrunRunOwnerLeft(ownership.owner, chartMetadataNow, ownership.marketIdentity))
|
|
10110
|
+
return false;
|
|
10111
|
+
const mounted = ownership.tc.metadata;
|
|
10112
|
+
return !(Array.isArray(mounted) && !mounted.includes(ownership.meta));
|
|
10113
|
+
};
|
|
10114
|
+
}
|
|
10115
|
+
/**
|
|
10116
|
+
* Stamp the overlay of a hosted run whose FAILURE carried the server's CME mark (`stampWrunHostedCme`, the marked
|
|
10117
|
+
* success's stamp, sticky for the mount), judged by the run's own ownership. Best effort: the failure is CME-marked
|
|
10118
|
+
* (`computed.cme`) whatever the stamp answers, so a stamp that cannot be written never surfaces the failure raw.
|
|
10119
|
+
*/
|
|
10120
|
+
async function stampWrunFailedRunCme(runTarget, tc, meta, owner, head) {
|
|
10121
|
+
try {
|
|
10122
|
+
const marketIdentity = wrunChartMarketIdentity(head.chartMetadata);
|
|
10123
|
+
const owns = await wrunRunOwnsOverlayReader(runTarget.chartIndex, { owner, tc, meta, marketIdentity });
|
|
10124
|
+
await stampWrunHostedCme(runTarget.chartIndex, runTarget.indicatorId, meta, owns);
|
|
10125
|
+
}
|
|
10126
|
+
catch (error) {
|
|
10127
|
+
console.warn(`[wrun] the CME stamp of failed run '${runTarget.indicatorId}' was not written:`, error);
|
|
10128
|
+
}
|
|
10129
|
+
}
|
|
9933
10130
|
/**
|
|
9934
10131
|
* One run's OPRA provenance writer (options-overlay-provenance.util `setOptionsOverlayOpraProvenance`, both
|
|
9935
10132
|
* settings copies), its modules loaded once: `opra` true stamps, false clears. It writes only while the run still
|
|
@@ -10551,6 +10748,8 @@ async function reintegrateWrunSession(indicatorId, context, fill, current, optio
|
|
|
10551
10748
|
indicatorId,
|
|
10552
10749
|
metadata: context.metadata,
|
|
10553
10750
|
outputRows: context.outputRows,
|
|
10751
|
+
// The session's own picture: a refine or a style repaint redraws what the session computed.
|
|
10752
|
+
pictureIdentity: wrunPictureIdentityOf(context),
|
|
10554
10753
|
title: context.title,
|
|
10555
10754
|
position: context.position,
|
|
10556
10755
|
axis: context.axis,
|
|
@@ -10577,6 +10776,9 @@ async function reintegrateWrunSession(indicatorId, context, fill, current, optio
|
|
|
10577
10776
|
...withCanvasHostFill(fill),
|
|
10578
10777
|
...(clamped ? { window: { fromMs: clamped.fromMs, toMs: context.lastRowTs, partial: true } } : {}),
|
|
10579
10778
|
...(options.keepOverlaySettings === true ? { keepOverlaySettings: true } : {}),
|
|
10779
|
+
// The session's own set under the new sheet or fill, the one its ticks mount: it replaces the mounted drawings
|
|
10780
|
+
// (wrunRunDrawingsPlan), so a style repaint lands the new look.
|
|
10781
|
+
sessionRedraw: true,
|
|
10580
10782
|
});
|
|
10581
10783
|
if (context.replay)
|
|
10582
10784
|
cutWrunReplayRowsAfterApply(tc, indicatorId);
|
|
@@ -10921,6 +11123,8 @@ export async function adoptWrunParkedLiveSession(parked, target) {
|
|
|
10921
11123
|
indicatorId,
|
|
10922
11124
|
metadata: context.metadata,
|
|
10923
11125
|
outputRows: context.outputRows,
|
|
11126
|
+
// The parked session's own picture (the adoption refused a session whose identity moved).
|
|
11127
|
+
pictureIdentity: wrunPictureIdentityOf(context),
|
|
10924
11128
|
prebuilt: shown.runResult,
|
|
10925
11129
|
title: context.title,
|
|
10926
11130
|
position: context.position,
|
|
@@ -11068,16 +11272,22 @@ export function wrunChartPriceDigits(chartIndex) {
|
|
|
11068
11272
|
* candle is a non-finite bar, which the engine handles as such: no fills,
|
|
11069
11273
|
* intents rejected and counted, equity carried), the chart interval for the
|
|
11070
11274
|
* annualized stats (the store's interval, else the trailing bar spacing),
|
|
11071
|
-
*
|
|
11072
|
-
*
|
|
11073
|
-
|
|
11275
|
+
* the display name for `declared.title` and the chart market's point value
|
|
11276
|
+
* (wrunStrategyPointValue: sizes in contracts on a point-valued market).
|
|
11277
|
+
* The store is loaded lazily: only a strategy package needs it on this lane. */
|
|
11278
|
+
async function wrunStrategyRunInputFor(chartIndex, title, rows, ohlcvRows, market) {
|
|
11074
11279
|
const bars = wrunStrategyBarsFor(rows, ohlcvRows);
|
|
11075
11280
|
const { useChartStore } = await wrunChartHostEnv().chart.loadChartStore();
|
|
11076
11281
|
const interval = useChartStore().mergedAllCharts[chartIndex]?.metadata?.interval ?? '';
|
|
11077
11282
|
const declaredMs = Intervals.map_unit[interval];
|
|
11078
11283
|
const trailingMs = rows.length >= 2 ? rows[rows.length - 1].ts - rows[rows.length - 2].ts : Number.NaN;
|
|
11079
11284
|
const intervalMs = declaredMs ?? (Number.isFinite(trailingMs) && trailingMs > 0 ? trailingMs : undefined);
|
|
11080
|
-
return {
|
|
11285
|
+
return {
|
|
11286
|
+
bars,
|
|
11287
|
+
title,
|
|
11288
|
+
...(intervalMs !== undefined ? { intervalMs } : {}),
|
|
11289
|
+
pointValue: wrunStrategyPointValue(market),
|
|
11290
|
+
};
|
|
11081
11291
|
}
|
|
11082
11292
|
/** The broker feed for input rows: the chart's own candles joined by
|
|
11083
11293
|
* timestamp (a row with no candle is a non-finite bar, which the engine
|
|
@@ -11403,7 +11613,7 @@ function wrunIntegrationErrorOf(diagnostics) {
|
|
|
11403
11613
|
* carried a window (a pan wave's, clamped or the whole loaded range) hands it as the
|
|
11404
11614
|
* `historyWindow`: a mounted heatmap then merges the run's rows inside that window and keeps the
|
|
11405
11615
|
* rest (wrun-panel-mount.util), so a pan-back page lands. */
|
|
11406
|
-
function mergeWrunChildOverlays(tc, indicatorId, runResult, projection, priceDigits, childMount, chartIndex, historyWindow) {
|
|
11616
|
+
function mergeWrunChildOverlays(tc, indicatorId, runResult, projection, priceDigits, childMount, pictureIdentity, chartIndex, historyWindow) {
|
|
11407
11617
|
const children = runResult.childOverlays;
|
|
11408
11618
|
if (children === undefined)
|
|
11409
11619
|
return;
|
|
@@ -11441,6 +11651,7 @@ function mergeWrunChildOverlays(tc, indicatorId, runResult, projection, priceDig
|
|
|
11441
11651
|
replaceFrames: false,
|
|
11442
11652
|
...(historyWindow ? { historyWindow } : {}),
|
|
11443
11653
|
...(projection ? { projection } : {}),
|
|
11654
|
+
...(pictureIdentity !== undefined ? { pictureIdentity } : {}),
|
|
11444
11655
|
...(priceDigits ? { priceDigits } : {}),
|
|
11445
11656
|
onMainThreadMs: (ms) => {
|
|
11446
11657
|
childMount.applyMs += ms;
|
|
@@ -11534,33 +11745,71 @@ function wrunMountReachesBefore(meta, ts) {
|
|
|
11534
11745
|
return reachesBefore(record.rawData ?? record.activeData ?? record.data);
|
|
11535
11746
|
});
|
|
11536
11747
|
}
|
|
11748
|
+
/** The result with no drawings of its own (`wrunRunDrawingsPlan` 'keep-mounted'): what reaches the route's renderables
|
|
11749
|
+
* check, the budget and the adapter, which is told `keepMountedDrawings` and leaves the mounted set alone. */
|
|
11750
|
+
function withoutWrunDrawings(result) {
|
|
11751
|
+
const kept = { ...result };
|
|
11752
|
+
delete kept.drawings;
|
|
11753
|
+
delete kept.drawingsBudget;
|
|
11754
|
+
return kept;
|
|
11755
|
+
}
|
|
11756
|
+
/** The RAW drawing records of the build the overlay's mounted set came from (hidden records included, never the
|
|
11757
|
+
* door's filtered, capped and normalized copy): the live tick's last applied build, else this lane's last applied
|
|
11758
|
+
* result (which a keep-mounted apply carries forward). Undefined: no build of this lane is known to stand behind the
|
|
11759
|
+
* mounted set. */
|
|
11760
|
+
function wrunShownDrawingsOf(indicatorId, meta) {
|
|
11761
|
+
const context = getWrunOverlayLiveContext(indicatorId);
|
|
11762
|
+
if (context?.repaintOwed !== true && context?.liveApplied !== undefined)
|
|
11763
|
+
return context.liveApplied.result.drawings;
|
|
11764
|
+
return wrunMountMemos.get(meta)?.lastResult?.drawings;
|
|
11765
|
+
}
|
|
11537
11766
|
function integrateWrunRunThroughRouteOnce(options, childMount) {
|
|
11538
11767
|
// The chart's price digits (WRUN-STYLE X7), read once per integrate: the
|
|
11539
11768
|
// selection text and the children print with them.
|
|
11540
11769
|
const priceDigits = options.priceDigits ?? wrunChartPriceDigits(options.chartIndex);
|
|
11541
11770
|
// The overlay's flat param settings are what the rows were computed with
|
|
11542
11771
|
// (the run's init() arguments derive from them the same way). An adoption hands the picture its session showed.
|
|
11543
|
-
const
|
|
11772
|
+
const built = options.prebuilt ??
|
|
11544
11773
|
buildWrunOverlayRunResult({
|
|
11545
11774
|
...options,
|
|
11546
11775
|
params: options.params ?? wrunParamValuesFromSettings(options.metadata, options.meta.settings),
|
|
11547
11776
|
texts: options.texts ?? wrunTextParamValuesFromSettings(options.metadata, options.meta.settings),
|
|
11548
11777
|
// An editor draft's legend says it is one (and only in this browser); the tick repeats it.
|
|
11549
11778
|
legendNote: options.legendNote ?? wrunDraftLegendNote(options.meta.settings),
|
|
11779
|
+
// A built-in's port names its lines in its built-in's words (wrun-output-words.util): builtinPortOf, the
|
|
11780
|
+
// resolver the alert words and the settings page read (the `builtinTwinOf` stamp, else the package's port).
|
|
11781
|
+
builtIn: builtinPortOf(options.meta.settings),
|
|
11550
11782
|
...(options.projection ? { runTimeline: true } : {}),
|
|
11551
11783
|
...(priceDigits !== undefined ? { priceDigits } : {}),
|
|
11552
11784
|
overlayId: options.overlayId ?? options.indicatorId,
|
|
11553
11785
|
});
|
|
11554
|
-
if (
|
|
11555
|
-
throw new WrunIntegrationError(
|
|
11786
|
+
if (built.failureReason !== undefined)
|
|
11787
|
+
throw new WrunIntegrationError(built.failureReason);
|
|
11556
11788
|
const { tc, meta, indicatorId, projection, chartIndex } = options;
|
|
11789
|
+
const facts = options.integration;
|
|
11790
|
+
// The drawings rule (wrunRunDrawingsPlan): a partial window's drawings never replace the mounted set. Every caller
|
|
11791
|
+
// states its facts: the full run its route facts, a run's own refine the run's (`drawingsRun`), a redraw of the live
|
|
11792
|
+
// session `sessionRedraw`; a caller that states none asks a new question and replaces. 'keep-mounted' leaves the
|
|
11793
|
+
// mounted set alone: the adapter gets a result with no drawings and `keepMountedDrawings` on both apply routes, so
|
|
11794
|
+
// nothing projects, normalizes or mounts a drawing; the render-equal check and the lane's memo read the result as
|
|
11795
|
+
// shown (its rows, the raw records the mounted set was built from).
|
|
11796
|
+
const drawingsFacts = facts ?? options.drawingsRun;
|
|
11797
|
+
const keepMountedDrawings = wrunRunDrawingsPlan({
|
|
11798
|
+
partialWindow: options.window?.partial === true,
|
|
11799
|
+
owedFullIntegration: drawingsFacts
|
|
11800
|
+
? wrunRunOwesFullIntegration(drawingsFacts.reason, drawingsFacts.hasGoodResult)
|
|
11801
|
+
: true,
|
|
11802
|
+
sessionRedraw: options.sessionRedraw === true,
|
|
11803
|
+
}) === 'keep-mounted';
|
|
11804
|
+
const runResult = keepMountedDrawings ? withoutWrunDrawings(built) : built;
|
|
11805
|
+
const shownDrawings = keepMountedDrawings ? wrunShownDrawingsOf(indicatorId, meta) : undefined;
|
|
11806
|
+
const shown = (result) => keepMountedDrawings && shownDrawings !== undefined ? { ...result, drawings: shownDrawings } : result;
|
|
11557
11807
|
// The run window's bars beside the cost (the slow chip's card: "rows on N bars").
|
|
11558
11808
|
if (chartIndex !== undefined) {
|
|
11559
11809
|
recordKScriptPerfVolumeExtras(overlayExecutionGuardKey(chartIndex, indicatorId), {
|
|
11560
11810
|
bars: options.outputRows.length,
|
|
11561
11811
|
});
|
|
11562
11812
|
}
|
|
11563
|
-
const facts = options.integration;
|
|
11564
11813
|
const routed = facts
|
|
11565
11814
|
? wrunIntegrationRoute({
|
|
11566
11815
|
reason: facts.reason,
|
|
@@ -11570,7 +11819,7 @@ function integrateWrunRunThroughRouteOnce(options, childMount) {
|
|
|
11570
11819
|
settingsStale: facts.settingsStale,
|
|
11571
11820
|
outputRowCount: options.outputRows.length,
|
|
11572
11821
|
hasRenderables: wrunRunResultHasRenderables(runResult),
|
|
11573
|
-
renderEqual: () => wrunRenderEqualToMount(meta, runResult, options.window),
|
|
11822
|
+
renderEqual: () => wrunRenderEqualToMount(meta, shown(runResult), options.window),
|
|
11574
11823
|
mountedPlotSetFits: () => wrunMountedPlotSetFits(meta, runResult),
|
|
11575
11824
|
})
|
|
11576
11825
|
: { action: 'apply-remount' };
|
|
@@ -11585,7 +11834,7 @@ function integrateWrunRunThroughRouteOnce(options, childMount) {
|
|
|
11585
11834
|
? { action: 'apply-remount' }
|
|
11586
11835
|
: routed;
|
|
11587
11836
|
if (route.action === 'skip')
|
|
11588
|
-
return { runResult, route, applied: false };
|
|
11837
|
+
return { runResult: shown(runResult), route, applied: false };
|
|
11589
11838
|
// Read before any chart mutation: a strip word off the vocabulary refuses the run by name.
|
|
11590
11839
|
const stripSettings = wrunStatsStripSettings(options.metadata);
|
|
11591
11840
|
applyWrunIntegrationBudget(runResult, chartIndex, indicatorId);
|
|
@@ -11618,6 +11867,7 @@ function integrateWrunRunThroughRouteOnce(options, childMount) {
|
|
|
11618
11867
|
meta: meta,
|
|
11619
11868
|
...projection,
|
|
11620
11869
|
...(partialSpan ? { preserveMountedRowsOutsideWindow: partialSpan } : {}),
|
|
11870
|
+
...(keepMountedDrawings ? { keepMountedDrawings: true } : {}),
|
|
11621
11871
|
postApply: render,
|
|
11622
11872
|
});
|
|
11623
11873
|
if (!integration.ok)
|
|
@@ -11638,6 +11888,7 @@ function integrateWrunRunThroughRouteOnce(options, childMount) {
|
|
|
11638
11888
|
runResult,
|
|
11639
11889
|
...(partialSpan ? { historyWindow: partialSpan } : {}),
|
|
11640
11890
|
...(projection ? { projection } : {}),
|
|
11891
|
+
...(options.pictureIdentity !== undefined ? { pictureIdentity: options.pictureIdentity } : {}),
|
|
11641
11892
|
...(childPriceDigits ? { priceDigits: childPriceDigits } : {}),
|
|
11642
11893
|
onMainThreadMs: (ms) => {
|
|
11643
11894
|
childMount.applyMs += ms;
|
|
@@ -11662,11 +11913,12 @@ function integrateWrunRunThroughRouteOnce(options, childMount) {
|
|
|
11662
11913
|
...projection,
|
|
11663
11914
|
ignoreUnmountedOutputKeys: wrunMountMemos.get(meta)?.unmountable,
|
|
11664
11915
|
mergeMountedRows: route.action === 'apply-rows-merge',
|
|
11916
|
+
...(keepMountedDrawings ? { keepMountedDrawings: true } : {}),
|
|
11665
11917
|
});
|
|
11666
11918
|
if (!refresh.ok)
|
|
11667
11919
|
throw wrunIntegrationErrorOf(refresh.diagnostics);
|
|
11668
11920
|
if (refresh.applied) {
|
|
11669
|
-
mergeWrunChildOverlays(tc, indicatorId, runResult, projection, childPriceDigits, childMount, options.chartIndex, runSpan);
|
|
11921
|
+
mergeWrunChildOverlays(tc, indicatorId, runResult, projection, childPriceDigits, childMount, options.pictureIdentity, options.chartIndex, runSpan);
|
|
11670
11922
|
render();
|
|
11671
11923
|
return true;
|
|
11672
11924
|
}
|
|
@@ -11681,11 +11933,11 @@ function integrateWrunRunThroughRouteOnce(options, childMount) {
|
|
|
11681
11933
|
: withWrunOverlayExecutionMeasure(chartIndex, indicatorId, 'wrun-integrate', apply);
|
|
11682
11934
|
if (applied) {
|
|
11683
11935
|
const memo = wrunMountMemoOf(meta);
|
|
11684
|
-
memo.lastResult = runResult;
|
|
11936
|
+
memo.lastResult = shown(runResult);
|
|
11685
11937
|
memo.lastRows = meta.rawData;
|
|
11686
11938
|
memo.lastWindow = runWindow === undefined ? undefined : { ...runWindow };
|
|
11687
11939
|
}
|
|
11688
|
-
return { runResult: placed, route, applied };
|
|
11940
|
+
return { runResult: shown(placed), route, applied };
|
|
11689
11941
|
}
|
|
11690
11942
|
// ---------------------------------------------------------------------------
|
|
11691
11943
|
// Prefix runs (C1 v3): a pan-back page computes only the bars it added
|
|
@@ -13998,6 +14250,8 @@ async function prepareWrunPrefixRun(runTarget, tc, meta, window, landings, start
|
|
|
13998
14250
|
...withPriceTick(hostFill.tickSize),
|
|
13999
14251
|
...withCanvasHostFill(wrunSessionCanvasFillOf(context)),
|
|
14000
14252
|
overlayId: indicatorId,
|
|
14253
|
+
// The words the full run's integrate names a built-in port's lines by, so the landed window reads the same.
|
|
14254
|
+
builtIn: builtinPortOf(meta.settings),
|
|
14001
14255
|
};
|
|
14002
14256
|
let runResult = buildWrunOverlayRunResult(resultOptions);
|
|
14003
14257
|
if (runResult.failureReason !== undefined)
|