@orangecharts/wrun-chart-host 0.6.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (136) hide show
  1. package/README.md +13 -5
  2. package/dist/constants/marketCapabilities.constants.d.ts +5 -0
  3. package/dist/constants/marketCapabilities.constants.js +16 -0
  4. package/dist/host-ports.types.d.ts +35 -3
  5. package/dist/index.d.ts +11 -1
  6. package/dist/index.js +11 -1
  7. package/dist/indicators/controls/tpo-session.util.js +42 -18
  8. package/dist/market-data/billing.interface.d.ts +2 -1
  9. package/dist/settings-templates/indicator-fields.js +10 -0
  10. package/dist/utility/chart/crypto-index.leaf.d.ts +16 -0
  11. package/dist/utility/chart/crypto-index.leaf.js +19 -0
  12. package/dist/utility/chart/index-mode-admission.util.js +9 -1
  13. package/dist/utility/chart/index-mode.util.d.ts +11 -5
  14. package/dist/utility/chart/index-mode.util.js +22 -10
  15. package/dist/utility/chart/kscript-source-answer-budget.leaf.d.ts +36 -0
  16. package/dist/utility/chart/kscript-source-answer-budget.leaf.js +39 -0
  17. package/dist/utility/chart/kscript-source-degrade.leaf.d.ts +38 -1
  18. package/dist/utility/chart/kscript-source-degrade.leaf.js +39 -1
  19. package/dist/utility/chart/live-bucket.util.d.ts +2 -1
  20. package/dist/utility/chart/live-bucket.util.js +47 -15
  21. package/dist/utility/chart/local-kscript-warmup-depth.util.d.ts +15 -1
  22. package/dist/utility/chart/local-kscript-warmup-depth.util.js +9 -0
  23. package/dist/utility/chart/market-session-schedule.util.d.ts +3 -1
  24. package/dist/utility/chart/market-session-schedule.util.js +24 -2
  25. package/dist/utility/chart/marketKind.util.d.ts +12 -7
  26. package/dist/utility/chart/marketKind.util.js +15 -5
  27. package/dist/utility/chart/ny-calendar.util.d.ts +104 -0
  28. package/dist/utility/chart/ny-calendar.util.js +346 -0
  29. package/dist/utility/chart/om-panel.util.d.ts +14 -2
  30. package/dist/utility/chart/om-panel.util.js +108 -40
  31. package/dist/utility/chart/rth-session.util.d.ts +10 -7
  32. package/dist/utility/chart/rth-session.util.js +17 -22
  33. package/dist/utility/chart/trading-day.util.js +90 -18
  34. package/dist/utility/chart/us-equities-session.util.js +20 -67
  35. package/dist/utility/chart/wrun-bar-session-facts.util.js +14 -1
  36. package/dist/utility/common/time.util.d.ts +7 -1
  37. package/dist/utility/common/time.util.js +11 -41
  38. package/dist/utility/number-format.util.d.ts +17 -7
  39. package/dist/utility/number-format.util.js +18 -8
  40. package/dist/utility/options/option-symbol.util.js +13 -2
  41. package/dist/utility/symbol-selection/contract-expiry.util.js +9 -1
  42. package/dist/utility/watchlist/import/import-request.leaf.d.ts +4 -1
  43. package/dist/utility/watchlist/import/import-request.leaf.js +5 -2
  44. package/dist/utility/watchlist/import/tradingview-symbols.leaf.d.ts +25 -4
  45. package/dist/utility/watchlist/import/tradingview-symbols.leaf.js +62 -4
  46. package/dist/utility/wrun/run-schedule/wrun-chart-gate-reader.util.d.ts +19 -0
  47. package/dist/utility/wrun/run-schedule/wrun-chart-gate-reader.util.js +57 -0
  48. package/dist/utility/wrun/run-schedule/wrun-gate-reader-warm.util.d.ts +23 -0
  49. package/dist/utility/wrun/run-schedule/wrun-gate-reader-warm.util.js +90 -0
  50. package/dist/utility/wrun/run-schedule/wrun-lane-groups.util.d.ts +39 -0
  51. package/dist/utility/wrun/run-schedule/wrun-lane-groups.util.js +60 -0
  52. package/dist/utility/wrun/run-schedule/wrun-late-reads.util.d.ts +77 -0
  53. package/dist/utility/wrun/run-schedule/wrun-late-reads.util.js +195 -0
  54. package/dist/utility/wrun/run-schedule/wrun-own-candles.util.d.ts +56 -0
  55. package/dist/utility/wrun/run-schedule/wrun-own-candles.util.js +70 -0
  56. package/dist/utility/wrun/run-schedule/wrun-prefix-feeds.util.d.ts +53 -0
  57. package/dist/utility/wrun/run-schedule/wrun-prefix-feeds.util.js +239 -0
  58. package/dist/utility/wrun/sources/lanes/option_stats_10m.d.ts +16 -0
  59. package/dist/utility/wrun/sources/lanes/option_stats_10m.js +14 -0
  60. package/dist/utility/wrun/sources/lanes/options_flow.d.ts +43 -18
  61. package/dist/utility/wrun/sources/lanes/options_flow.js +209 -72
  62. package/dist/utility/wrun/sources/lanes/token_supply.js +5 -31
  63. package/dist/utility/wrun/sources/opra-option-lanes.util.d.ts +3 -18
  64. package/dist/utility/wrun/sources/opra-option-lanes.util.js +12 -57
  65. package/dist/utility/wrun/sources/row-lane-registry.d.ts +1 -1
  66. package/dist/utility/wrun/sources/row-lane-registry.js +22 -8
  67. package/dist/utility/wrun/sources/row-lanes/option_contract_flow.d.ts +61 -0
  68. package/dist/utility/wrun/sources/row-lanes/option_contract_flow.js +103 -8
  69. package/dist/utility/wrun/sources/row-lanes/option_contract_state.d.ts +5 -0
  70. package/dist/utility/wrun/sources/row-lanes/option_contract_state.js +24 -12
  71. package/dist/utility/wrun/sources/row-lanes/option_prints.d.ts +55 -0
  72. package/dist/utility/wrun/sources/row-lanes/option_prints.js +95 -18
  73. package/dist/utility/wrun/sources/row-lanes/option_strikes.d.ts +15 -1
  74. package/dist/utility/wrun/sources/row-lanes/option_strikes.js +23 -8
  75. package/dist/utility/wrun/sources/row-lanes/option_surface.js +11 -11
  76. package/dist/utility/wrun/sources/wrun-poll-lane.types.d.ts +14 -2
  77. package/dist/utility/wrun/sources/wrun-poll-lane.types.js +6 -3
  78. package/dist/utility/wrun/sources/wrun-poll-lanes.util.d.ts +43 -8
  79. package/dist/utility/wrun/sources/wrun-poll-lanes.util.js +77 -11
  80. package/dist/utility/wrun/sources/wrun-row-lane.types.d.ts +31 -16
  81. package/dist/utility/wrun/sources/wrun-row-lane.types.js +2 -0
  82. package/dist/utility/wrun/sources/wrun-row-lanes.util.d.ts +52 -12
  83. package/dist/utility/wrun/sources/wrun-row-lanes.util.js +110 -46
  84. package/dist/utility/wrun/wrun-browser-sources.leaf.d.ts +10 -0
  85. package/dist/utility/wrun/wrun-browser-sources.leaf.js +12 -0
  86. package/dist/utility/wrun/wrun-coin-lane-live.util.d.ts +3 -3
  87. package/dist/utility/wrun/wrun-coin-lane-live.util.js +53 -18
  88. package/dist/utility/wrun/wrun-color-settings.util.d.ts +6 -0
  89. package/dist/utility/wrun/wrun-color-settings.util.js +45 -0
  90. package/dist/utility/wrun/wrun-draft-overlay.util.js +14 -8
  91. package/dist/utility/wrun/wrun-failure-cause.d.ts +1 -1
  92. package/dist/utility/wrun/wrun-failure-cause.js +14 -0
  93. package/dist/utility/wrun/wrun-frames.js +6 -2
  94. package/dist/utility/wrun/wrun-host.service.d.ts +26 -18
  95. package/dist/utility/wrun/wrun-host.service.js +49 -52
  96. package/dist/utility/wrun/wrun-hosted-wire-caps.d.ts +1 -1
  97. package/dist/utility/wrun/wrun-hosted-wire-caps.js +2 -0
  98. package/dist/utility/wrun/wrun-input-requirements.leaf.js +7 -4
  99. package/dist/utility/wrun/wrun-kit-run-tables.util.d.ts +24 -0
  100. package/dist/utility/wrun/wrun-kit-run-tables.util.js +87 -0
  101. package/dist/utility/wrun/wrun-lifecycle.contract.d.ts +2 -1
  102. package/dist/utility/wrun/wrun-live-tick.util.d.ts +8 -2
  103. package/dist/utility/wrun/wrun-live-tick.util.js +35 -16
  104. package/dist/utility/wrun/wrun-opra-flow.leaf.d.ts +40 -13
  105. package/dist/utility/wrun/wrun-opra-flow.leaf.js +39 -12
  106. package/dist/utility/wrun/wrun-option-contract-flow.util.d.ts +70 -21
  107. package/dist/utility/wrun/wrun-option-contract-flow.util.js +257 -112
  108. package/dist/utility/wrun/wrun-option-prints.util.d.ts +62 -22
  109. package/dist/utility/wrun/wrun-option-prints.util.js +148 -46
  110. package/dist/utility/wrun/wrun-option-views.util.d.ts +262 -0
  111. package/dist/utility/wrun/wrun-option-views.util.js +356 -0
  112. package/dist/utility/wrun/wrun-options-chain.util.d.ts +23 -2
  113. package/dist/utility/wrun/wrun-options-chain.util.js +37 -3
  114. package/dist/utility/wrun/wrun-overlay-drivers.util.d.ts +18 -3
  115. package/dist/utility/wrun/wrun-overlay-drivers.util.js +32 -7
  116. package/dist/utility/wrun/wrun-overlay-recovery.util.d.ts +9 -3
  117. package/dist/utility/wrun/wrun-overlay-recovery.util.js +146 -18
  118. package/dist/utility/wrun/wrun-overlay-run.util.d.ts +50 -6
  119. package/dist/utility/wrun/wrun-overlay-run.util.js +816 -243
  120. package/dist/utility/wrun/wrun-pin-spelling.util.d.ts +5 -0
  121. package/dist/utility/wrun/wrun-pin-spelling.util.js +28 -12
  122. package/dist/utility/wrun/wrun-pin-venues.util.js +4 -6
  123. package/dist/utility/wrun/wrun-present-bits.util.d.ts +9 -0
  124. package/dist/utility/wrun/wrun-present-bits.util.js +39 -0
  125. package/dist/utility/wrun/wrun-refusal-surface.util.d.ts +3 -2
  126. package/dist/utility/wrun/wrun-refusal-surface.util.js +5 -4
  127. package/dist/utility/wrun/wrun-refusal.util.d.ts +66 -6
  128. package/dist/utility/wrun/wrun-refusal.util.js +335 -40
  129. package/dist/utility/wrun/wrun-source-rows.util.js +11 -0
  130. package/dist/utility/wrun/wrun-tier-grid.util.d.ts +28 -3
  131. package/dist/utility/wrun/wrun-tier-grid.util.js +79 -19
  132. package/dist/utility/wrun/wrun-transient-rerun.util.d.ts +14 -3
  133. package/dist/utility/wrun/wrun-transient-rerun.util.js +33 -8
  134. package/package.json +5 -5
  135. package/dist/utility/wrun/wrun-opra-underlying.util.d.ts +0 -12
  136. package/dist/utility/wrun/wrun-opra-underlying.util.js +0 -1
@@ -18,6 +18,11 @@ export interface WrunPinCandidate {
18
18
  exchange: string;
19
19
  rawSymbol?: string;
20
20
  normalizedSymbol?: string;
21
+ /**
22
+ * The market the run reads when the catalog lists this identity, where that market is not the row itself: a
23
+ * CRYPTOCAP coin's market cap (`CRYPTOCAP|MCAP.BTC`, never listed) proven by the coin's dominance row (`BTC.D`).
24
+ */
25
+ market?: string;
21
26
  }
22
27
  /** A market the catalog answered (venue names, never enum numbers). */
23
28
  export interface WrunPinCatalogRow {
@@ -14,13 +14,15 @@
14
14
  * (`BTCUSDT.P`), our key typed into the symbol half (`COINBASE|BTC-USD`), a stock or forex symbol without its
15
15
  * `/` (`POLYGON:AAPL`, `FX_OTC:EURUSD`), or a crypto pair whose form the venue's catalog spelling does not vouch for
16
16
  * (`venue-presets.constants`: Coinbase and OKX write `BTC-USD`, Binance and Bybit `BTCUSDT`; a pair on a venue the
17
- * presets do not describe is confirmed by the catalog). Everything else is ours and skips the catalog.
17
+ * presets do not describe is confirmed by the catalog), or a CRYPTOCAP symbol TradingView spells unlike us
18
+ * (`CRYPTOCAP:HYPEH.D`, the coin cap `CRYPTOCAP:BTC`). Everything else is ours and skips the catalog.
18
19
  * - `resolveWrunPinMarket` (sync over an already-loaded catalog): the written spelling first (our own spelling always
19
20
  * wins), then the same instrument through the TradingView prefix tables (tradingview-symbols.leaf, the watchlist
20
- * import's own: the venue map, the quote split, the perpetual ids, the metals), checked against the catalog; never a
21
- * stand-in on another venue (the watchlist import's "closest market"), never an inverted forex pair (`USD/JPY` is
22
- * not `JPY/USD`). No catalog loaded: `catalog-pending` with the candidates to ask, so a caller awaits the catalog
23
- * only for a foreign spelling.
21
+ * import's own: the venue map, the quote split, the perpetual ids, the metals, the CRYPTOCAP ticker renames, where
22
+ * `CRYPTOCAP:HYPEH.D` is our `HYPE.D` and the coin cap `CRYPTOCAP:BTC` our `MCAP.BTC`, proven by its listed
23
+ * dominance row), checked against the catalog; never a stand-in on another venue (the watchlist import's "closest
24
+ * market"), never an inverted forex pair (`USD/JPY` is not `JPY/USD`). No catalog loaded: `catalog-pending` with
25
+ * the candidates to ask, so a caller awaits the catalog only for a foreign spelling.
24
26
  * - Refused by name before any fetch: `wrun_pin_unresolvable` (a venue we know, or one the tables map, with no market
25
27
  * of ours under that spelling) and `wrun_pin_venue_unknown` (a venue word no table maps, the venue judge's own
26
28
  * words). A CME Group market (ours as written, or the one a TradingView CME prefix names, `CME_MINI:ES1!` read as
@@ -36,8 +38,9 @@ import { Category, Exchange } from '@orangecharts/orange-v2-pb-common';
36
38
  import { PERP_PRESET_VENUE_QUOTES, SPOT_PRESET_VENUE_QUOTES } from '../../constants/venue-presets.constants.js';
37
39
  import { normalizeLegacyExchange } from '../chart/legacy-exchange.leaf.js';
38
40
  import { EXCHANGE_DISPLAY_SUFFIXES, formatDisplayToExchange } from '../exchange-normalization.util.js';
39
- import { BASE_ALIASES, CME_PREFIXES, CRYPTO_VENUES, FX_PREFIXES, NATIVE_PREFIX, PERP_SUFFIX_RE, TVC_SPOT_METALS, US_STOCK_PREFIXES, VENUE_TO_TRADINGVIEW, cmeContinuousKeyOf, cryptoCandidate, fxPair, splitCryptoSymbol, } from '../watchlist/import/tradingview-symbols.leaf.js';
41
+ import { BASE_ALIASES, CME_PREFIXES, CRYPTO_VENUES, CRYPTOCAP_PREFIX, FX_PREFIXES, NATIVE_PREFIX, PERP_SUFFIX_RE, TVC_SPOT_METALS, US_STOCK_PREFIXES, VENUE_TO_TRADINGVIEW, cmeContinuousKeyOf, cryptoCandidate, cryptoCapSeriesOf, fxPair, splitCryptoSymbol, } from '../watchlist/import/tradingview-symbols.leaf.js';
40
42
  import { WRUN_PIN_VENUE_UNKNOWN_CODE, wrunPinMarketIsLiteral, wrunPinVenueOnWire, wrunPinVenueUnknownMessage, wrunPinVenueUnknownSeed, } from './wrun-pin-venues.util.js';
43
+ import { wrunAuthorRuleSeed } from './wrun-refusal.util.js';
41
44
  import { wrunChartHostEnv } from '../../host-env.js';
42
45
  import { WRUN_LEG_STREAM_CLASS_NAMES, isWrunLegStreamClass } from './wrun-leg-stream-classes.js';
43
46
  /** A pin no market of ours answers to, as written or as the tables map it: refused by name before any fetch. */
@@ -131,6 +134,11 @@ function provablyForeign(reading) {
131
134
  return false;
132
135
  return GLUED_RE.test(reading.symbol.toUpperCase()) && splitCryptoSymbol(reading.symbol) !== null;
133
136
  }
137
+ /** A CRYPTOCAP symbol TradingView spells unlike us (`HYPEH.D` is our `HYPE.D`, the cap `BTC` our `MCAP.BTC`). */
138
+ function cryptoCapForeign(symbol) {
139
+ const ours = cryptoCapSeriesOf(symbol);
140
+ return ours !== null && ours.series !== upper(symbol);
141
+ }
134
142
  /** Whether a written spelling needs the catalog before any fetch (see the header). */
135
143
  function writtenNeedsCatalog(reading) {
136
144
  const { exchange, symbol } = reading;
@@ -138,6 +146,8 @@ function writtenNeedsCatalog(reading) {
138
146
  return false;
139
147
  if (!wrunPinVenueOnWire(exchange) || symbol.includes('|') || provablyForeign(reading))
140
148
  return true;
149
+ if (exchange === CRYPTOCAP_PREFIX)
150
+ return cryptoCapForeign(symbol);
141
151
  if (exchange === 'POLYGON' || exchange === 'FX_OTC')
142
152
  return !symbol.includes('/');
143
153
  if (!isOurCryptoVenue(exchange) || splitCryptoSymbol(symbol) === null)
@@ -231,6 +241,16 @@ function readingCandidates(reading) {
231
241
  const metal = venue === 'TVC' ? TVC_SPOT_METALS[symbol] : undefined;
232
242
  if (metal)
233
243
  out.push({ exchange: 'FX_OTC', rawSymbol: metal });
244
+ // TradingView's crypto indices, through the watchlist import's table: a renamed coin's dominance as ours, and a
245
+ // coin's market cap read as our `MCAP.<TICKER>` once its dominance row answers (the catalog lists no cap).
246
+ const cryptoCap = venue === CRYPTOCAP_PREFIX ? cryptoCapSeriesOf(symbol) : null;
247
+ if (cryptoCap) {
248
+ out.push({
249
+ exchange: CRYPTOCAP_PREFIX,
250
+ rawSymbol: cryptoCap.proof,
251
+ ...(cryptoCap.series !== cryptoCap.proof ? { market: `${CRYPTOCAP_PREFIX}|${cryptoCap.series}` } : {}),
252
+ });
253
+ }
234
254
  for (const id of cryptoVenueIds(venue, perp))
235
255
  out.push(...cryptoCandidates(id, symbol));
236
256
  return out;
@@ -284,7 +304,7 @@ export function resolveWrunPinMarket(input, lookup, chartExchange) {
284
304
  if (answer === 'unavailable')
285
305
  unavailable = true;
286
306
  else if (answer !== null && !unavailable) {
287
- const market = `${answer.exchange}|${answer.rawSymbol}`;
307
+ const market = candidate.market ?? `${answer.exchange}|${answer.rawSymbol}`;
288
308
  return { market, respelled: market !== writtenKey };
289
309
  }
290
310
  }
@@ -372,11 +392,7 @@ function pinRefusal(leg, code, chartExchange) {
372
392
  seed: wrunPinVenueUnknownSeed(venue, settingBound),
373
393
  };
374
394
  }
375
- const seed = {
376
- cls: 'run-failed',
377
- variant: 'generic',
378
- ...(settingBound ? { out: { kind: 'open-settings' } } : {}),
379
- };
395
+ const seed = wrunAuthorRuleSeed(WRUN_PIN_UNRESOLVABLE_CODE, settingBound ? { kind: 'open-settings' } : undefined);
380
396
  return {
381
397
  message: `Input '${leg.inputName}' pins ${pin} (${WRUN_PIN_UNRESOLVABLE_CODE}): no market our data serves answers to ` +
382
398
  `that spelling, as written or as the TradingView name maps it; pin the market the symbol search names ` +
@@ -53,7 +53,7 @@ import { checkIsIndexMode } from '../chart/index-mode.util.js';
53
53
  import { normalizeLegacyExchange } from '../chart/legacy-exchange.leaf.js';
54
54
  import { extractTokensFromTransformations, parsedTransformations } from '../common/transformations.util.js';
55
55
  import { wrunChartHostEnv } from '../../host-env.js';
56
- import { attachWrunRefusal } from './wrun-refusal.util.js';
56
+ import { attachWrunRefusal, wrunAuthorRuleSeed } from './wrun-refusal.util.js';
57
57
  /** The venues the gateway serves no series for to scripts yet: a pin on one is soft-refused per
58
58
  * input with a `WRUN_LEG_UNSERVED` row naming why (never silently NaN). Remove a venue here the
59
59
  * moment the gateway lists it; nothing else gates it. */
@@ -150,9 +150,6 @@ export function wrunSymbolSettingUnknownVenue(text) {
150
150
  export function wrunPinVenueRefusalMessage(inputName, exchange) {
151
151
  return `Input '${inputName}' pins exchange ${exchange}: ${wrunChartHostEnv().sharedHost().wrunPinVenueRefusedMessage(exchange)}`;
152
152
  }
153
- /** The failed-run seed of a pin rule the author fixes in the code (not one literal market, a
154
- * multi-day leg on a session venue). */
155
- const WRUN_PIN_AUTHOR_RULE_SEED = Object.freeze({ cls: 'run-failed', variant: 'generic' });
156
153
  /** The failed-run seed of an unknown venue: its own words (the venue named), and the settings as
157
154
  * the way out when a symbol setting holds the market (a served pick fixes it), else the class's
158
155
  * ladder (the source, else the report). */
@@ -199,7 +196,8 @@ export function wrunPinnedLegRefusalOf(leg, inputName, chartExchange, settingBou
199
196
  return {
200
197
  message: `Input '${inputName}' pins the market '${exchange}/${symbol}' (${wrunChartHostEnv().sharedHost().WRUN_PIN_SYMBOL_LITERAL_CODE}): ` +
201
198
  `a pin names one market as a literal exchange and symbol, never an expression`,
202
- seed: WRUN_PIN_AUTHOR_RULE_SEED,
199
+ // A pin rule the author fixes in the code: a failed run, by the code its words print.
200
+ seed: wrunAuthorRuleSeed(wrunChartHostEnv().sharedHost().WRUN_PIN_SYMBOL_LITERAL_CODE),
203
201
  };
204
202
  }
205
203
  if (wrunPinVenueVerdict(exchange) === 'unknown') {
@@ -216,7 +214,7 @@ export function wrunPinnedLegRefusalOf(leg, inputName, chartExchange, settingBou
216
214
  `a multi-day candle on a session venue groups trading days (a Friday bar runs into Monday) and would be ` +
217
215
  `confirmed at its open plus the span, early and still forming (${WRUN_PIN_SESSION_INTERVAL_UNSERVED_CODE}); ` +
218
216
  `pin 1d or 1w instead`,
219
- seed: WRUN_PIN_AUTHOR_RULE_SEED,
217
+ seed: wrunAuthorRuleSeed(WRUN_PIN_SESSION_INTERVAL_UNSERVED_CODE),
220
218
  };
221
219
  }
222
220
  return null;
@@ -35,3 +35,12 @@ export declare function wrunTuplesMarkedPartial(tuples: ReadonlyArray<ReadonlyAr
35
35
  * mask column.
36
36
  */
37
37
  export declare function wrunPartialMarkerTuple(width: number): number[];
38
+ /**
39
+ * A reconcile answer whose bar holds only the partial marker (one tuple, every value 0 but the `present` mask, bit 14
40
+ * alone) carries no data: the reconcile's own plan left that bar out (the source answer budget cut its narrower
41
+ * window, a heavier forming bar pushing a closed one out), not the backend losing it. Where the session holds that bar
42
+ * with data, the held row stands; a bar held as a marker too, or not held, keeps the answer's marker. Without this a
43
+ * live reconcile on SPY 1h replaced bars the full run painted with markers, and flipped them back as the forming bar's
44
+ * tier moved (OPTFLOW-HANG review, 2026-10-20).
45
+ */
46
+ export declare function wrunAnswerKeepsHeldOverMarkers<Row extends ArrayLike<unknown>>(held: ReadonlyArray<Row>, answer: ReadonlyArray<Row>): ReadonlyArray<Row>;
@@ -71,3 +71,42 @@ export function wrunPartialMarkerTuple(width) {
71
71
  tuple[tuple.length - 1] = wrunPresentWithPartial(0);
72
72
  return tuple;
73
73
  }
74
+ /**
75
+ * A reconcile answer whose bar holds only the partial marker (one tuple, every value 0 but the `present` mask, bit 14
76
+ * alone) carries no data: the reconcile's own plan left that bar out (the source answer budget cut its narrower
77
+ * window, a heavier forming bar pushing a closed one out), not the backend losing it. Where the session holds that bar
78
+ * with data, the held row stands; a bar held as a marker too, or not held, keeps the answer's marker. Without this a
79
+ * live reconcile on SPY 1h replaced bars the full run painted with markers, and flipped them back as the forming bar's
80
+ * tier moved (OPTFLOW-HANG review, 2026-10-20).
81
+ */
82
+ export function wrunAnswerKeepsHeldOverMarkers(held, answer) {
83
+ if (held.length === 0 || !answer.some(isWrunPartialMarkerRow))
84
+ return answer;
85
+ const heldByTs = new Map();
86
+ for (const row of held)
87
+ heldByTs.set(Number(row[0]), row);
88
+ return answer.map((row) => {
89
+ if (!isWrunPartialMarkerRow(row))
90
+ return row;
91
+ const kept = heldByTs.get(Number(row[0]));
92
+ return kept !== undefined && !isWrunPartialMarkerRow(kept) ? kept : row;
93
+ });
94
+ }
95
+ /** Whether a celled row is `[ts, marker]`: one tuple whose last value (the `present` mask) is bit 14 alone and every
96
+ * other value 0 (`wrunPartialMarkerTuple`). */
97
+ function isWrunPartialMarkerRow(row) {
98
+ if (row.length !== 2)
99
+ return false;
100
+ const tuple = row[1];
101
+ if (tuple === null || typeof tuple !== 'object' || typeof tuple.length !== 'number') {
102
+ return false;
103
+ }
104
+ const cells = tuple;
105
+ const last = cells.length - 1;
106
+ if (last < 0 || cells[last] !== wrunPresentWithPartial(0))
107
+ return false;
108
+ for (let at = 0; at < last; at += 1)
109
+ if (cells[at] !== 0)
110
+ return false;
111
+ return true;
112
+ }
@@ -17,8 +17,9 @@ export declare function onWrunRefusalChange(fn: (chartIndex: number) => void): (
17
17
  * Project a record for its owner: the legend (the higher of the overlay's run and tick verdicts),
18
18
  * the change event, and a toast when `notify` is true AND the record is paused. `isCurrent` and the
19
19
  * target are re-checked after every await; false when the projection went stale or the overlay is
20
- * gone. A record whose cause is transient waits out the overlay's grace instead (true: it stands for
21
- * its owner as a shown one does, so a later retraction of the owner reaches it).
20
+ * gone. A record whose cause is transient, on an overlay a rerun driver runs, waits out the
21
+ * overlay's grace instead (true: it stands for its owner as a shown one does, so a later retraction
22
+ * of the owner reaches it).
22
23
  */
23
24
  export declare function projectWrunRefusal(target: WrunRefusalOverlayTarget, r: WrunRefusal, opts: {
24
25
  owner: 'run' | 'tick';
@@ -112,8 +112,9 @@ const liveAttemptFacts = (t) => wrunRefusalAttemptFacts(liveWrunRefusalAttempt(t
112
112
  * Project a record for its owner: the legend (the higher of the overlay's run and tick verdicts),
113
113
  * the change event, and a toast when `notify` is true AND the record is paused. `isCurrent` and the
114
114
  * target are re-checked after every await; false when the projection went stale or the overlay is
115
- * gone. A record whose cause is transient waits out the overlay's grace instead (true: it stands for
116
- * its owner as a shown one does, so a later retraction of the owner reaches it).
115
+ * gone. A record whose cause is transient, on an overlay a rerun driver runs, waits out the
116
+ * overlay's grace instead (true: it stands for its owner as a shown one does, so a later retraction
117
+ * of the owner reaches it).
117
118
  */
118
119
  export async function projectWrunRefusal(target, r, opts) {
119
120
  if (!opts.isCurrent())
@@ -177,8 +178,8 @@ function isWrunTransientRefusal(r) {
177
178
  return isWrunTransientFailureCause(wrunRefusalCauseOf(r));
178
179
  }
179
180
  /** Hold a transient record inside the overlay's grace: true when it waits, false when it shows now
180
- * (the overlay's grace ran out and it has not painted since). The owner's latest record waits, and
181
- * a toast an earlier record of the grace owed goes with it. */
181
+ * (no rerun driver runs the overlay, or its grace ran out and it has not painted since). The
182
+ * owner's latest record waits, and a toast an earlier record of the grace owed goes with it. */
182
183
  function waitOutWrunTransientGrace(resolved, r, opts) {
183
184
  const key = overlayKey(resolved);
184
185
  if (!holdWrunTransientRefusal(resolved, () => showWaitingWrunRefusals(key)))
@@ -54,6 +54,11 @@ export type WrunRefusalOut = {
54
54
  | {
55
55
  kind: 'report';
56
56
  }
57
+ /** Nothing brings the Indicator back here (a package its publisher withdrew, a source that declines the chart's
58
+ * market): it leaves the chart, the legend card's own Remove. Never Retry, which could only fail again. */
59
+ | {
60
+ kind: 'remove';
61
+ }
57
62
  /** The app cannot read what the cloud answered (a reply without the hosted wire): reload the page,
58
63
  * which loads the app the cloud speaks to. */
59
64
  | {
@@ -154,6 +159,10 @@ export interface WrunRefusalContext {
154
159
  inputClassAt?: (inputIndex: number) => string | undefined;
155
160
  /** The caller's `wrunSwitchTargetFor` answer (C5), so this module stays pure. */
156
161
  switchTarget?: WrunRefusalOut;
162
+ /** The Indicator is a built-in's twin (its `builtinTwinOf` stamp, wrun-builtin-twin.util): an official version the
163
+ * registry yanked or no longer serves was not withdrawn by a publisher in the person's eyes, and a Retry can reach a
164
+ * pin that moved since, so its record keeps the generic words and Retry (`seedOfVerdict`). */
165
+ builtinTwin?: boolean;
157
166
  }
158
167
  export type WrunRefusalAttemptToken = {
159
168
  key: string;
@@ -183,8 +192,10 @@ export declare const WRUN_REFUSAL_EVENT_MARKET_KEY = "wrun.refusal.market.event"
183
192
  /**
184
193
  * The words of every row-builder class and registered poll lane (C4 `feed`): a `feed` param holds
185
194
  * a builtin class (`trade_volume_by_size`) or a lane key (`bitfinex_margin_rate`; a class served
186
- * by several lanes is named by the lane its input reads). Full literal keys, so the boot scanner
187
- * harvests them. The spec fails when a builtin class or a registered lane has no row here.
195
+ * by several lanes is named by the lane its input reads), or a class the browser lane refuses by
196
+ * its own code (wrun-browser-sources.leaf `WRUN_BROWSER_REFUSED_CLASS_CODES`, whose record names
197
+ * the class). Full literal keys, so the boot scanner harvests them. The spec fails when a builtin
198
+ * class, a registered lane or a refused class has no row here.
188
199
  */
189
200
  export declare const WRUN_REFUSAL_FEED_KEYS: Readonly<Record<string, string>>;
190
201
  /** Replace the descriptor-registered feed words (the row-lane registry's, at load and in its spec hook). A
@@ -257,6 +268,21 @@ export declare const WRUN_SESSION_LOST_CODE = "wrun_session_lost";
257
268
  /** The `session-lost` record's seed: a note whose way out is Retry. Never retried on its own: the heal reads the
258
269
  * socket row source's refusal as one the same ask repeats, and another chart's session would go the same way. */
259
270
  export declare function wrunSessionLostSeed(): WrunRefusalSeed;
271
+ /**
272
+ * The seed of a failed run a closed code names: an author's rule the raiser's words print (`wrun_pin_unresolvable`,
273
+ * `wrun_lane_knob_invalid`), a loader phase (`registry_404`, `wrunLoaderFailureCodeOf`), a fallback this module words
274
+ * itself. The generic words with the code at `params.code` (the record keeps it, the words never say it), and the way
275
+ * out when the raiser gives one. The code is the verdict: `wrun_failure_shown` reports it as its code, the lane row as
276
+ * `refused:<code>` when it is an author's rule (`wrun_*`, minus the internal fallbacks) and as `failed:<reason>` for
277
+ * any other code (a loader phase, an engine trap: the reason classifier and the record's cause say why), and the cause
278
+ * read takes the seed as a typed verdict. A
279
+ * run-failed seed in the generic words without a code names nothing
280
+ * (tests/structure/wrun-run-failed-seed-has-code.spec.ts pins every such literal).
281
+ */
282
+ export declare function wrunAuthorRuleSeed(code: string, out?: WrunRefusalOut): WrunRefusalSeed;
283
+ /** The code of an engine trap no runtime row explains (`RuntimeError: memory access out of bounds`): the record and
284
+ * the events name it, and its cause reads `other`, never `none` (nothing explains which line of the code broke). */
285
+ export declare const WRUN_ENGINE_TRAP_CODE = "engine_trap";
260
286
  /**
261
287
  * The record seed of a refusal the cloud answered, by its code and the facts its frame carried
262
288
  * (wrun-hosted-wire-caps `WrunFrameRefusal`), never its sentence: the no-candles answer is the browser
@@ -283,6 +309,18 @@ export declare function wrunPinFinerSeed(pinMs: number, strictlyFiner: boolean):
283
309
  * class is one (`candles`, `oi_candles`, `volume_profile_candles`: hand-copied from the web app's
284
310
  * wrun-leg-stream-classes.ts, which the package cannot import; the web spec pins the copy). */
285
311
  export declare const WRUN_REFUSAL_LEG_CLASSES: ReadonlySet<string>;
312
+ /**
313
+ * The codes of a package its publisher withdrew since the save (`wrunLoaderFailureCodeOf`): a resolve the registry
314
+ * answered 404 or 410, the registry's own deleted code, a yanked version. A run-failed record in the generic words
315
+ * that names one is the `package-withdrawn` record (a built-in's twin's excepted: `seedOfVerdict`).
316
+ */
317
+ export declare const WRUN_WITHDRAWN_PACKAGE_CODES: ReadonlySet<string>;
318
+ /**
319
+ * The codes of the source ladder's terminal record (wrun-overlay-run.util `wrunTerminalDegradeRefusalFor`, its seed
320
+ * built with `wrunAuthorRuleSeed(code)`), each with the `service-no-answer` variant that words it: the source did not
321
+ * answer within its budget, its read failed, it declined the chart's market.
322
+ */
323
+ export declare const WRUN_SOURCE_REFUSAL_VARIANTS: Readonly<Record<string, string>>;
286
324
  /** The seed `wrunRefusalFor` reads off a rejection (a cloud refusal by its code included). Never throws. */
287
325
  export declare function wrunRefusalSeedFor(error: unknown, ctx: WrunRefusalContext): WrunRefusalSeed;
288
326
  /**
@@ -308,6 +346,24 @@ export declare function wrunRefusalFor(errorOrSeed: unknown, ctx: WrunRefusalCon
308
346
  * that head is read.
309
347
  */
310
348
  export declare const WRUN_TRANSPORT_CODE_CAUSES: Readonly<Record<string, WrunFailureBaseCause>>;
349
+ /**
350
+ * What stopped a package the loader owns, as a word of the closed cause set, or null for a failure it does not own:
351
+ * the registry's refusal by its status (404 and 410 `package-withdrawn`, 401, 402 and 403 `access-denied`, 429 and
352
+ * 5xx `backend-unavailable`; its own `hosted_only` code `package-hosted`), a version gone hosted (`package-hosted`)
353
+ * or yanked (`package-withdrawn`), a module this device could not compile or link (`compile-failed`), a built-in's
354
+ * twin that declined (`twin-declined`), the adapter's refusal of the output (`integration-error`), a package the
355
+ * sandbox quarantined (`worker-dead`: the aftermath of a sandbox it killed). Read by name (a module duplicate under
356
+ * test still matches), never by the words around a code. Never throws.
357
+ */
358
+ export declare function wrunLoaderFailureCauseOf(error: unknown): WrunFailureCause | null;
359
+ /**
360
+ * The phase a package the loader owns stopped in, as a closed code word, or null for a failure it does not own: the
361
+ * registry's refusal (`tarball_<status>` for a download, else the registry's own code when it names one, else
362
+ * `registry_<status>`), `hosted_only`, `yanked`, `compile_failed`, `twin_pin_mismatch` (a twin whose resolve failed
363
+ * names the failure under it), `integration_error`, `quarantined`. A record carries it at `params.code`
364
+ * (`wrunAuthorRuleSeed`), so `wrun_failure_shown` names the phase where it said `run-failed`. Never throws.
365
+ */
366
+ export declare function wrunLoaderFailureCodeOf(error: unknown): string | null;
311
367
  /**
312
368
  * Why a failure happened, as one word of the closed set (wrun-failure-cause): what produced it, beside the attempt
313
369
  * reason and the refusal class that say what kind of failure it was. Read in this order:
@@ -317,10 +373,13 @@ export declare const WRUN_TRANSPORT_CODE_CAUSES: Readonly<Record<string, WrunFai
317
373
  * 2. a cause its raiser stamped (`stampWrunRefusalTelemetry`);
318
374
  * 3. its own type, by name (the socket row source's transient reasons, a stopped or unreadable ask, a denied
319
375
  * capability, the cloud's whole-run refusal, a dead sandbox, an abort its ask's signal did not cause), the kScript
320
- * socket's codes (`WRUN_TRANSPORT_CODE_CAUSES`) and our worker's one fixed literal (`backend-unavailable`);
376
+ * socket's codes (`WRUN_TRANSPORT_CODE_CAUSES`) and our worker's one fixed literal (`backend-unavailable`), then a
377
+ * package the loader could not load (`wrunLoaderFailureCauseOf`: the registry's refusal by its status, a version
378
+ * gone hosted or yanked, a module this device could not compile, a declined twin, the adapter's refusal);
321
379
  * 4. the server's answer through the one answer table: `server:<row>`, a superseded create's answer `superseded`;
322
380
  * 5. a dropped connection under the run: a lazy chunk (`chunk-load`) or a fetch (`network`);
323
- * 6. `none` for a typed verdict (`isTypedVerdict`), else `other`.
381
+ * 6. `none` for a typed verdict (`isTypedVerdict`: never a run-failed seed in the generic words without a code),
382
+ * else `other`.
324
383
  * Closed words only, never the message. Never throws.
325
384
  */
326
385
  export declare function wrunFailureCauseOf(error: unknown): WrunFailureCause;
@@ -339,8 +398,9 @@ export declare function wrunRefusalDetailOf(r: Pick<WrunRefusal, 'cls' | 'varian
339
398
  * The ONE text path: chip, sentence, OUT label and severity word of a record, in the injected
340
399
  * translate's locale, and its detail line (`wrunRefusalDetailOf`, the raiser's own words, never
341
400
  * translated). `name` and `market` render from the record when the variant does not carry
342
- * them as params; a `feed` param renders as its `wrun.refusal.feed.*` words; plural keys pass the
343
- * record's `count` / `n` as the plural choice. A note has no severity word.
401
+ * them as params; a `feed` param renders as its `wrun.refusal.feed.*` words (a variant's
402
+ * `feedFallback` when the record names no feed with words); plural keys pass the record's
403
+ * `count` / `n` as the plural choice. A note has no severity word.
344
404
  */
345
405
  export declare function wrunRefusalTexts(r: WrunRefusal, t: WrunRefusalTranslate): {
346
406
  chip: string;