@orangecharts/wrun-chart-host 0.17.0 → 0.18.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 CHANGED
@@ -128,6 +128,7 @@ What each published version holds. A host installs a version with the peers of i
128
128
 
129
129
  | Version | Peers | What changed |
130
130
  | --- | --- | --- |
131
+ | 0.18.0 | `@orangecharts/indicator-kit` 0.121.0, `@orangecharts/orange-v2-pb-common` 12.86.0, `dayjs` 1.11.23, `lodash-es` 4.18.1 | Same peers. Four things a host acts on. The index and yield venue's official bars: the index leaf gains `INDEX_OTC_SERVER_BUILT_BARS_FROM_MS` and `barsAreServerBuilt(exchange, intervalMs)`, the root exports `chartBarsAreServerBuilt(market, intervalMs)` (`utility/chart/server-built-bars.util`, a formula leg counts), and the live intake refuses a live fold on such a chart; a host stops folding live prints and gap rows into a bar of one day or wider there and reads the newest bar again from the server. `FeatureFlag` loses `UsEquitiesFull`, `WrunConvergingPrefix`, `DrawingAlertOneClick`, `DrawingsUnderCandles`, `ChartDraftOrder` and `TypedServerFutures` (graduated on web) and gains `FuturesNinjaTraderDepth`. `MARKET_DATA_VENUES` now lists the US stocks venue beside OPRA (it left `FLAG_GATED_MARKET_DATA_VENUES`), so a host that holds stocks behind a switch of its own keeps that switch at its own door. The env gains the optional `isSignedIn()`: the licence and broker flags read as kill switches that default on for a signed-in session, and a host without the port reads every session as a guest. The package commits landed since 0.17.0 ride along (`git log 3ad609a1a4.. -- packages/wrun-chart-host` in the web repo). |
131
132
  | 0.17.0 | `@orangecharts/indicator-kit` 0.121.0, `@orangecharts/orange-v2-pb-common` 12.86.0, `dayjs` 1.11.23, `lodash-es` 4.18.1 | Three things a host acts on. The marks section's `text.place` gains `fit` (2: the size inside the mark where the full number fits, else beside it), `fit_short` (3: as `fit`, rounded inside when only the rounded number fits) and `fit_only` (4: as `fit_short`, never beside), and the mount refuses them by name on an engine whose marks pack is below level 3 (`fit`) or 4 (the other two); 0.16.0 refuses a section that names one ("Needs a newer chart"). The data-fetching loader view supplies `mainRowsLoadedFor(chartIndex, metadata)` in place of `loadedMainIdentityOf` (`WrunLoadedMainIdentity` leaves): the host answers whether the mounted main rows are that metadata's market, so a chart whose rows come from another market (a US stock on Trades) proves its candles. The market size defaults count the last trading day on the market's own clock (whole days it stood closed are no part of it), so the first candles after a weekend or a holiday no longer read as a whole day. The peers move with web: the kit from 0.119.0 to 0.121.0 and the protocol enums from 12.84.0 to 12.86.0 (the index and yield venue, `utility/chart/index-otc.leaf`, joins the public modules). The other package commits landed since 0.16.0 ride along (`git log f9aeda13fd.. -- packages/wrun-chart-host` in the web repo). |
132
133
  | 0.16.0 | `@orangecharts/indicator-kit` 0.119.0, `@orangecharts/orange-v2-pb-common` 12.84.0, `dayjs` 1.11.23, `lodash-es` 4.18.1 | The peers web's /v3 step 3 moved to: the protocol enums peer from 12.82.0 to 12.84.0 and the kit peer from 0.116.1 (what npm's 0.15.0 declares) to 0.119.0. The package commits landed since 0.15.0 ride along (`git log 3bfefce876.. -- packages/wrun-chart-host` in the web repo). |
133
134
  | 0.12.0 | `@orangecharts/indicator-kit` 0.107.0, `@orangecharts/orange-v2-pb-common` 12.80.0, `dayjs` 1.11.23, `lodash-es` 4.18.1 | Contract F on `options_flow`: an input's `underlying` (`"auto"`, `"derived"`, a root in capitals or `"@<param>"`) reads that root's flow under scopes `ticker` and `prints` (`WRUN_UNDERLYING_CLASSES` gains `options_flow`). `utility/wrun/derived-roots.util` holds the planner step both planners call (`planWrunLaneUnderlying`, `WrunLaneUnderlyingPlan`, where the row lanes kept their own copy); `planWrunPollLanes` plans a root's input against the root's market and names the market in the instance's extras (`WRUN_POLL_LANE_UNDERLYING_FIELD`, `underlyingMarket`), so an `"auto"` input and a root's input are two instances, and an `"auto"` input's key is unchanged. The flow lane resolves one chart per run and market (a root's input never reads the chart's chain) and refuses a root beside a scope that spans underlyings by `wrun_option_knob_invalid` in om's words (`utility/wrun/wrun-options-flow-underlying.leaf`, a new module off the boot path: `WRUN_OPTIONS_FLOW_UNDERLYING_SCOPES`, `wrunOptionsFlowUnderlyingScopeTakes`), as `wrunUnderlyingKnob` does before any market. The knob's grammar (`wrunUnderlyingKnobOf`, `wrunUnderlyingSettingName`) moves to `utility/wrun/derived-roots.leaf`, re-exported by `derived-roots.util`, and the painted sheet writes a setting's pick into `underlying` (`laneWordWrites`, through `wrun-color-settings.util` `wrunSelectPickWord`, the read `resolveWrunUnderlyingSettingKnob` shares); availability (`wrunInputRequirements`) still judges every options read on the chart's own chain. `planWrunLaneUnderlying`, `wrunUnderlyingRootOf`, `wrunUnderlyingUnresolvedError` and `resolveWrunUnderlyingMarket` take the planner's fills last (optional, a celled input's `["empty"]` by default; `resolveWrunUnderlyingMarket` keeps `chartChain` fourth), so a refusal names the fill the input may declare. `wrunMetadataSourceCount` keys `options_flow` by its `underlying` too, and another root's print sums ride no print read's slot. The kit peer moves from 0.105.0 to 0.106.5 and the protocol enums peer from 12.78.0 to 12.79.0. The package commits landed since 0.11.0 ride along (`git log 099b00cf4f.. -- packages/wrun-chart-host` in the web repo). |
@@ -13,6 +13,7 @@ export declare const FeatureFlag: {
13
13
  readonly FuturesByofHistory: "futures-byof-history";
14
14
  readonly FuturesNinjaTrader: "futures-ninjatrader";
15
15
  readonly FuturesNinjaTraderData: "futures-ninjatrader-data";
16
+ readonly FuturesNinjaTraderDepth: "futures-ninjatrader-depth";
16
17
  readonly CoinbaseDerivativesExecution: "coinbase-derivatives-execution";
17
18
  readonly BrokerVenueLaneRithmic: "broker-venue-lane-rithmic";
18
19
  readonly BrokerVenueLaneNinjaTrader: "broker-venue-lane-ninjatrader";
@@ -35,7 +36,6 @@ export declare const FeatureFlag: {
35
36
  readonly PrepaidPlusCn: "prepaid-plus-cn";
36
37
  readonly ApiConsole: "api-console";
37
38
  readonly Opra: "opra";
38
- readonly UsEquitiesFull: "us-equities-full";
39
39
  readonly CmeEngine: "cme-engine";
40
40
  readonly IndicesOtc: "indices-otc";
41
41
  readonly OpraUserScripts: "opra-user-scripts";
@@ -59,14 +59,9 @@ export declare const FeatureFlag: {
59
59
  readonly StoreBuiltinRows: "store-builtin-rows";
60
60
  readonly OptionsAccessPrewarm: "options-access-prewarm";
61
61
  readonly WrunDownloadBudgetCut: "wrun-download-budget-cut";
62
- readonly WrunConvergingPrefix: "wrun-converging-prefix";
63
62
  readonly ScreenshotLegacyCapture: "screenshot-legacy-capture";
64
- readonly DrawingAlertOneClick: "drawing-alert-one-click";
65
- readonly DrawingsUnderCandles: "drawings-under-candles";
66
63
  readonly TypedIntervalWidths: "typed-interval-widths";
67
- readonly TypedServerFutures: "typed-server-futures";
68
64
  readonly DrawToTrade: "draw-to-trade";
69
- readonly ChartDraftOrder: "chart-draft-order";
70
65
  readonly PaneSides: "pane-sides";
71
66
  };
72
67
  export type FeatureFlagKey = (typeof FeatureFlag)[keyof typeof FeatureFlag];
@@ -69,13 +69,13 @@ export const FeatureFlag = {
69
69
  // - the newest gap of a delayed chart filled from Rithmic's history plant; historical data is
70
70
  // outside what Rithmic has permitted (conformance Q13), so dark until it is.
71
71
  FuturesByofHistory: 'futures-byof-history',
72
- // NinjaTrader (Tradovate) as a futures broker on top of `futures-trading`: the OAuth link, order routing from
73
- // the chart and account sync, on the Staging key until a production key exists. Read through `isOn`: unminted,
74
- // absent and guest all read off; the localStorage override lights it (`{"futures-ninjatrader": true}`).
72
+ // Kill switch of NinjaTrader (Tradovate) as a futures broker on top of `futures-trading`, default ON for a signed-in
73
+ // session (ninjatrader-flags.util isNinjaTraderOn).
75
74
  FuturesNinjaTrader: 'futures-ninjatrader',
76
- // The live quote alone from the user's own NinjaTrader market data, on top of `futures-ninjatrader` (candles, the
77
- // book and history are OpenMarket's); dark until NinjaTrader confirms how a user's own subscription may show here.
75
+ // The live quote, candles and history from the user's own NinjaTrader market data, on top of `futures-ninjatrader`.
78
76
  FuturesNinjaTraderData: 'futures-ninjatrader-data',
77
+ // The order book (depth) from the user's own NinjaTrader market data, on top of `futures-ninjatrader-data`.
78
+ FuturesNinjaTraderDepth: 'futures-ninjatrader-depth',
79
79
  // Coinbase derivatives execution (the Deribit engine for non-US accounts; Kyle 2026-10-23 took it
80
80
  // off the paper trading key to hide it). Its own key, read through `isOn` by `isCexVenueFlagOn`, in
81
81
  // Lighter's shape: unminted, absent and guest all read off, internal roles included (no document,
@@ -84,11 +84,8 @@ export const FeatureFlag = {
84
84
  // `{"coinbase-derivatives-execution": true}`). Mint it enabled to open it up. A key this browser
85
85
  // already holds keeps trading, and keeps its card to manage it.
86
86
  CoinbaseDerivativesExecution: 'coinbase-derivatives-execution',
87
- // The host-served broker venues' dark keys (trading-core 0.3.0, `rithmic` and `ninjatrader` in the venue
88
- // registry): each venue descriptor states its key, read through `isOn` by `isCexVenueFlagOn`, so unminted,
89
- // absent and guest all read off and no venue surface offers a broker yet. On, the broker trades through the
90
- // shared venue surfaces (TRADING-UNIFY plan D13); the futures lane keeps riding `futures-trading` until then.
91
- // The same string values as the package's `FeatureFlag` leaf, which the venue flag mirror hands to `isOn`.
87
+ // Kill switches of the host-served broker venues (trading-core's venue registry), default ON for a signed-in session
88
+ // (flag-answered.util killSwitchOn). The same strings as the package's `FeatureFlag` leaf.
92
89
  BrokerVenueLaneRithmic: 'broker-venue-lane-rithmic',
93
90
  BrokerVenueLaneNinjaTrader: 'broker-venue-lane-ninjatrader',
94
91
  // Trading Volume (docs/features/trading-hub/trading-volume.md): the private page inside the trading
@@ -222,16 +219,6 @@ export const FeatureFlag = {
222
219
  // affordance, contract charts and the purchase screens. Minted dark; the data tier itself is the
223
220
  // OPRA gate's and never flips with this flag (employees stay delayed like everyone).
224
221
  Opra: 'opra',
225
- // The US stocks tape on the chart (docs/features/data/us-stocks-tape.md): order flow from the tape on a US stock
226
- // chart (footprint, profiles, TPO, the CVD family read the ticker's tape market, utility/stocks/stock-tape-overlay.util),
227
- // time and sales, the exchange list, the $19 add-on surfaces, and the price alert redirect onto the free lane
228
- // (src/utility/alerts/stocks-alert-target.util.ts). Minted dark; read through `usEquitiesFullEnabled()` /
229
- // `useUsEquitiesFull()` (src/utility/stocks/us-equities-flag.util.ts) with `isOn`, so unminted and absent read off;
230
- // a guest reads the app's guest table (src/constants/guest-default-flags.constants.ts, on since the 2026-11-05
231
- // launch). With it off nothing in the app changes. The data tier is the stocks gate's
232
- // (905 s delayed for everyone today) and never flips with this flag. QA:
233
- // `localStorage.setItem('kiyo.flag-overrides', '{"us-equities-full":true}')`.
234
- UsEquitiesFull: 'us-equities-full',
235
222
  // CME real-time on the venue-generic market-data flow (ENTITLEMENT-PLANE Program B; docs/features/market-data/
236
223
  // plane.md, "CME on the plane"). While lit, the market-data registry lists the CME card
237
224
  // (`marketDataVenueIsServed('cme')`), the one CME purchase overlay mounts as the generic flow on
@@ -266,31 +253,11 @@ export const FeatureFlag = {
266
253
  // LAUNCHED 2026-10-27: the gate answers open on every build (opra-user-scripts-gate.util); this record
267
254
  // is retired and read by nothing.
268
255
  OpraUserScripts: 'opra-user-scripts',
269
- // User-authored chart studies on CME (wrun CME Chart Studies), the browser lane only. While lit, a script the
270
- // browser runs that the viewer wrote or added from the community (a kScript user script or editor draft, an
271
- // Indicator draft, a community package) reads CME futures data at the viewer's own entitlement, and on a CME chart
272
- // its CME options chains (the chart's own, another CME root's through `underlying`): the display wall, the data
273
- // wall and the engine policy lift for it on the CME plane only (kscript-venue-policy.util `isCmeUserScriptRun`, the
274
- // one decision; a chain wall reads `mayReadCmeChain`), and only for a viewer the CME plane serves (signed in, not
275
- // a guest, the CME data terms not blocked; delayed and real-time both count, the tier is the gate's). Both facts
276
- // reach the worker-safe venue policy through cme-user-scripts-gate.util (closed in a worker, for a guest and before
277
- // a reader is handed over). Refused whatever it says while `cme-lanes` is dark (reversed 2026-11-11 behind it):
278
- // hosted (Cloud) runs, protected scripts, indicator alerts, strategies and backtests. Refused always: a CME
279
- // chain read from a chart off CME, the
280
- // export of a study's results (console copies, clips), agent reads (chart_read and the MCP withhold the stamped
281
- // study) and the publish cover's capture of a chart that carries CME data. A move of the flag, the account, the
282
- // terms, the served access or the session stops a running study in place and keeps its source and settings. To be
283
- // minted dark (admin panel); read with `isOn` (absent, unloaded and guest read off) and never read server-side:
284
- // the server lanes judge a user run's CME reads on their own. QA:
285
- // `localStorage.setItem('kiyo.flag-overrides', '{"cme-user-scripts":true}')`.
256
+ // Kill switch of user-authored chart studies on CME, default ON for a signed-in session once the map answers
257
+ // (flag-answered.util licenceFlagOn; cme-user-scripts-gate.util holds the gate).
286
258
  CmeUserScripts: 'cme-user-scripts',
287
- // The governed-lanes cutover, one flag per licensed plane (governed-lanes-gate.util holds the one reader;
288
- // kscript-venue-policy.util, the one decider). While a plane's flag is lit, that plane opens to the server
289
- // lanes as well as the browser: hosted (Cloud) runs, protected scripts, strategy testing and every alert kind. While
290
- // it is dark (the default), the plane reads exactly as it did before the cutover. Each plane keeps its own decision
291
- // under a lit flag: CME still needs the `cme-user-scripts` gate (the flag, sign-in, the CME data terms) on every
292
- // lane. To be minted dark (admin panel); read with `isOn` (absent, unloaded and guest read off), never forced on in
293
- // dev. QA: `localStorage.setItem('kiyo.flag-overrides', '{"cme-lanes":true}')`.
259
+ // Kill switches of the governed-lanes cutover, one per licensed plane, default ON for a signed-in session once the
260
+ // map answers (flag-answered.util licenceFlagOn, read through governed-lanes-gate.util).
294
261
  CmeLanes: 'cme-lanes',
295
262
  OpraLanes: 'opra-lanes',
296
263
  StocksLanes: 'stocks-lanes',
@@ -401,60 +368,22 @@ export const FeatureFlag = {
401
368
  // dark until Kyle switches it on; the dev/internal localStorage override lights it for a rig (`kiyo.flag-overrides` ->
402
369
  // `{"wrun-download-budget-cut": true}`).
403
370
  WrunDownloadBudgetCut: 'wrun-download-budget-cut',
404
- // Converging warm-up stamps (STAMPS round A, docs/features/kscript/wrun/wrun-browser-runtime.md, "Exact warm-up
405
- // sessions"): a package whose sheet carries `history_warmup` of kind `converges` (a recursion the build's gate
406
- // certified to agree within 1e-6 once W accepted inputs ran) gets a hidden head of W candles on every run, and its
407
- // pan-back pages land as prefix runs whose overlap proof compares the row outputs within that tolerance. Off, a
408
- // converging stamp of any shape reads as no stamp before anything else reads it (no head, no session, no admission:
409
- // the run is today's; the capability ring line alone names the kind). Read through `isOn` (the overlay run's
410
- // `wrunConvergingPrefixOn`): unminted, absent and guest all read off, so production ships it dark until round B
411
- // proves it on a rig; the dev/internal localStorage override lights it for a rig (`kiyo.flag-overrides` ->
412
- // `{"wrun-converging-prefix": true}`).
413
- WrunConvergingPrefix: 'wrun-converging-prefix',
414
371
  // Kill switch of the in-place chart picture (src/utility/screenshot.util.ts captureLayered): ON sends every capture
415
372
  // through the legacy html2canvas path (a clone of the whole page, seconds of frozen page). Unminted and absent read
416
373
  // off, so production takes the in-place engine; mint it ON only to roll the engine back without a deploy.
417
374
  ScreenshotLegacyCapture: 'screenshot-legacy-capture',
418
- // One-click alerts on drawings (docs/features/alerts/alert-targets.md, "One click"): the quick bar's labelled
419
- // Alert pill arms at once with an Undo toast, its on state opens the Once / Every time / Turn off menu, the
420
- // right-click row, the ink chip and Alt+A arm the same way, and the engine decor bridge runs. Off: the bell
421
- // icon opens the alert dialog as before. Read through `isOn` (useDrawingAlertOneClickFlag): unminted, absent
422
- // and guest read off, so production ships it dark; `kiyo.flag-overrides` -> `{"drawing-alert-one-click": true}`.
423
- DrawingAlertOneClick: 'drawing-alert-one-click',
424
- // Send behind candles / Bring in front of candles (docs/features/object-tree/persistence-and-undo.md): the row of
425
- // the right-click Order submenu, the quick bar's "..." menu and the Objects row menu, and the action they share
426
- // (drawing-selection-actions setDrawingsUnderCandles). Off: no row and no write; a drawing already saved under the
427
- // candles still paints there (the engine reads `settings.underCandles`). Read through `isOn`
428
- // (useDrawingsUnderCandlesFlag): unminted, absent and guest read off, so production ships it dark;
429
- // `kiyo.flag-overrides` -> `{"drawings-under-candles": true}`.
430
- DrawingsUnderCandles: 'drawings-under-candles',
431
375
  // Typed candle widths (docs/features/chart/custom-intervals.md): a width off the ladder that divides a UTC day
432
376
  // (`20m`, `90m`, typed-width.leaf), asked as CUSTOM plus `barSeconds`. Read through `isOn` (typedWidthsFlagOn) and
433
377
  // mirrored to the data worker (typed-width-reads.util): unminted, absent and guest read off, so production ships it
434
378
  // dark and a saved typed width is held on the rung at or below; `kiyo.flag-overrides` ->
435
379
  // `{"typed-interval-widths": true}`.
436
380
  TypedIntervalWidths: 'typed-interval-widths',
437
- // Server-built candle history of custom sizes on the CME family (docs/features/chart/custom-intervals.md,
438
- // "Server-built history on the CME family"): the main candle history of a size under a day on CME, CBOT, NYMEX or
439
- // COMEX is asked of the gateway (CUSTOM plus `barSeconds`) instead of being folded in the data worker; the live
440
- // candle and every indicator fold stay on the app build. Read through `isOn` (typedHistoryFlagOn) and mirrored to
441
- // the data worker as its session bit (typed-width-reads.util `publishTypedSessionReads`): unminted, absent and guest
442
- // read off, so production ships it dark and every chart loads through the app build; `kiyo.flag-overrides` ->
443
- // `{"typed-server-futures": true}`.
444
- TypedServerFutures: 'typed-server-futures',
445
381
  // Draw to trade (docs/features/hyperliquid/ticket.md, "Draw to trade"): the trade ticket's Draw button (one stroke on
446
382
  // the chart fills side, take profit and stop loss, sized by Risk), the Position drawing's "Send to trade panel" on
447
383
  // the quick bar and Super Search's "Draw a trade". Off: none of them shows. Read through `isOn`:
448
384
  // unminted, absent and guest read off, so production ships it dark; `kiyo.flag-overrides` ->
449
385
  // `{"draw-to-trade": true}`.
450
386
  DrawToTrade: 'draw-to-trade',
451
- // Draft orders from the chart menu's price card (docs/features/hyperliquid/quick-trade-pill.md, "The draft on the
452
- // chart"): where the card's order would open the Confirm order dialog (the order answer of Ask before sending is on
453
- // for its lane), the press draws the order as a draft line instead (one pill, drag to move, TP and SL handles, the
454
- // pill sends, the x drops it). Off: the card asks and sends exactly as before. Read through `isOn`
455
- // (chart-menu-order.util `chartDraftOrderOn`): unminted, absent and guest read off, so production ships it dark;
456
- // `kiyo.flag-overrides` -> `{"chart-draft-order": true}`.
457
- ChartDraftOrder: 'chart-draft-order',
458
387
  // Pane on any side (PANES-ANY-SIDE-PLAN.md): an indicator's pane on the chart, left, right, top or bottom. Every
459
388
  // surface reads ONE predicate, this key AND the built-in engine's `paneSides` capability
460
389
  // (pane-sides-engine.util paneSidesActive). Read through `isOn`: unminted, absent and guest read off, so production
@@ -465,6 +465,8 @@ export interface WrunHostUser {
465
465
  isDarkMode(): unknown;
466
466
  /** 0.5.0, run. web: kscriptStandInAccount() (utility/chart/kscript-standin-account.util.ts:16; reads store/jwt). */
467
467
  standInAccount(): string;
468
+ /** Next release, optional, run. web: isSignedInSession(); a host without it reads every session as a guest. */
469
+ isSignedIn?(): boolean;
468
470
  /** 0.5.0, run. web: technicalScriptThemeLines(isDarkMode, themeMode, chartMetadata)
469
471
  * (utility/chart/builtin-script-theme-palette.util.ts:370; executor :9616). */
470
472
  themeLines(isDarkMode: boolean | undefined, themeMode: string | undefined, chartMetadata: unknown): string[];
package/dist/index.d.ts CHANGED
@@ -179,6 +179,7 @@ export * from './utility/chart/quote-perp.leaf.js';
179
179
  export * from './utility/chart/rth-session.util.js';
180
180
  export * from './utility/chart/run-interval-unservable.leaf.js';
181
181
  export * from './utility/chart/run-interval-warmup.leaf.js';
182
+ export * from './utility/chart/server-built-bars.util.js';
182
183
  export * from './utility/chart/session-interval.util.js';
183
184
  export * from './utility/chart/technical-script-legend-value.util.js';
184
185
  export * from './utility/chart/titan-constants.pin.js';
package/dist/index.js CHANGED
@@ -183,6 +183,7 @@ export * from './utility/chart/quote-perp.leaf.js';
183
183
  export * from './utility/chart/rth-session.util.js';
184
184
  export * from './utility/chart/run-interval-unservable.leaf.js';
185
185
  export * from './utility/chart/run-interval-warmup.leaf.js';
186
+ export * from './utility/chart/server-built-bars.util.js';
186
187
  export * from './utility/chart/session-interval.util.js';
187
188
  export * from './utility/chart/technical-script-legend-value.util.js';
188
189
  export * from './utility/chart/titan-constants.pin.js';
@@ -1,18 +1,3 @@
1
- /**
2
- * The market-data venue registry: every venue card the frontend serves (docs/features/market-data/plane.md). A new
3
- * exchange deal adds its card here; the purchase flow, the payment return and the openers find a venue by its key or
4
- * by a payment line item, never by a venue literal. The finders over an explicit list (`findVenueBy*`) are the same
5
- * rules the bound finders apply to the registry, for a spec that serves a venue of its own beside the registered ones.
6
- *
7
- * Two lists. `MARKET_DATA_VENUES` is served in every session. `FLAG_GATED_MARKET_DATA_VENUES` is carried dark: a card
8
- * there is listed only while its `flagKey` reads on, through ONE selector (`marketDataVenueIsServed`), so a venue whose
9
- * generic flow replaces a flow of its own (CME behind `cme-engine`), or whose add-on is not released yet (US stocks
10
- * behind `us-equities-full`), changes nothing while its flag is off: the bound finders never return it, the payment
11
- * return never takes its venue branch and its doors stay shut. The flag reader is the app's, published into this
12
- * dependency-free module when the app's market-data store module loads
13
- * (`publishMarketDataVenueFlags`); unpublished, a read that throws (no store in this realm: a worker, a bare spec) or a
14
- * card with no flag all read dark.
15
- */
16
1
  import type { FeatureFlagKey } from '../../constants/feature-flags.constants.js';
17
2
  import type { MarketDataVenue } from '../venue.js';
18
3
  /** The venues served in every session. */
@@ -85,133 +70,6 @@ export declare const MARKET_DATA_VENUES: readonly [{
85
70
  readonly storeId: "opraRealtime";
86
71
  readonly surfaces: readonly ["chain-page-subtitle", "chain-price-pill", "chain-table-marker", "chain-strike-preview", "chain-index-notice", "flow-tape", "terminal-options-tab", "options-overlay-legends", "indicator-legend-notes", "contract-chart-delay-chip", "contract-chart-delay-card", "chart-source-line", "watchlist-panel", "watchlist-cell-tooltip", "board", "purchase-live-price"];
87
72
  readonly contractRevision: "2026-10-28.1";
88
- }];
89
- /** The venues carried dark: each is listed only while its `flagKey` reads on (`marketDataVenueIsServed`). */
90
- export declare const FLAG_GATED_MARKET_DATA_VENUES: readonly [{
91
- readonly key: "cme";
92
- readonly displayName: "CME Group";
93
- readonly productGroups: readonly ["CME", "CBOT", "NYMEX", "COMEX"];
94
- readonly basePath: "/market-data/cme";
95
- readonly products: readonly [{
96
- readonly name: "cme_bundle_l1_1m";
97
- readonly key: "l1";
98
- readonly plan: "p1";
99
- readonly level: 1;
100
- readonly classifications: readonly ["non_professional"];
101
- readonly interval: "1m";
102
- readonly priceUsd: 7;
103
- readonly planCard: {
104
- readonly name: "Real-time L1";
105
- readonly level: "LEVEL 1";
106
- readonly market: "CME";
107
- readonly markets: readonly ["CME", "CBOT", "COMEX", "NYMEX"];
108
- readonly region: "🇺🇸 USA";
109
- readonly descPath: "subscription.l1Desc";
110
- };
111
- }, {
112
- readonly name: "cme_bundle_depth_1m";
113
- readonly key: "depth";
114
- readonly plan: "p2";
115
- readonly level: 2;
116
- readonly classifications: readonly ["non_professional"];
117
- readonly interval: "1m";
118
- readonly priceUsd: 45;
119
- readonly planCard: {
120
- readonly name: "Real-time depth";
121
- readonly level: "LEVEL 2";
122
- readonly market: "CME";
123
- readonly markets: readonly ["CME", "CBOT", "COMEX", "NYMEX"];
124
- readonly region: "🇺🇸 USA";
125
- readonly descPath: "subscription.depthDesc";
126
- };
127
- }, {
128
- readonly name: "cme_bundle_depth_pro_1m";
129
- readonly key: "depth_pro";
130
- readonly plan: "p2";
131
- readonly level: 3;
132
- readonly classifications: readonly ["professional"];
133
- readonly interval: "1m";
134
- readonly priceUsd: 538;
135
- readonly planCard: {
136
- readonly name: "Real-time depth";
137
- readonly level: "LEVEL 2";
138
- readonly market: "CME";
139
- readonly markets: readonly ["CME", "CBOT", "COMEX", "NYMEX"];
140
- readonly region: "🇺🇸 USA";
141
- readonly descPath: "subscription.depthDesc";
142
- };
143
- }];
144
- readonly planCard: {
145
- readonly name: "Real-time L1";
146
- readonly level: "LEVEL 1";
147
- readonly market: "CME";
148
- readonly markets: readonly ["CME", "CBOT", "COMEX", "NYMEX"];
149
- readonly region: "🇺🇸 USA";
150
- readonly descPath: "subscription.l1Desc";
151
- };
152
- readonly paymentItemPrefix: "cme_";
153
- readonly professionalPolicy: "sell";
154
- readonly internalRolePolicy: "report";
155
- readonly payFirst: false;
156
- readonly planChanges: {
157
- readonly downgradeAtPeriodEnd: true;
158
- readonly prorateUpgrades: true;
159
- };
160
- readonly offers: true;
161
- readonly questionnaire: {
162
- readonly formVersion: "v1";
163
- readonly acceptedFormVersions: readonly ["v1", ""];
164
- readonly presentation: "two-way";
165
- readonly questions: readonly [{
166
- readonly id: "individual_own_account";
167
- readonly qualifying: true;
168
- }, {
169
- readonly id: "personal_non_business_use";
170
- readonly qualifying: true;
171
- }, {
172
- readonly id: "not_registered_or_qualified";
173
- readonly qualifying: true;
174
- }, {
175
- readonly id: "not_advisor_or_asset_manager";
176
- readonly qualifying: true;
177
- }, {
178
- readonly id: "no_redistribution_or_business_application";
179
- readonly qualifying: true;
180
- }];
181
- readonly groups: readonly [];
182
- readonly addendum: {
183
- readonly id: "ila_subscriber_addendum_2026_06_accepted";
184
- readonly version: "v1";
185
- };
186
- readonly postalAddress: {
187
- readonly answerId: "postal_address";
188
- };
189
- readonly identityFields: readonly ["legalName", "employer", "occupation", "country", "address"];
190
- readonly identityLimits: {
191
- readonly legalName: 200;
192
- readonly employer: 200;
193
- readonly occupation: 200;
194
- readonly country: 2;
195
- readonly address: 300;
196
- };
197
- readonly validityDays: 365;
198
- readonly renewalWindowDays: 30;
199
- };
200
- readonly agreement: {
201
- readonly recordedAs: "registration";
202
- readonly version: "cme-data-terms-v1";
203
- readonly url: "/api/v1/market-data/cme/agreement";
204
- readonly delayedRequiresAcceptance: true;
205
- };
206
- readonly delayMinutes: 10;
207
- readonly disclosure: {
208
- readonly kind: "translated";
209
- };
210
- readonly flagKey: "cme-engine";
211
- readonly i18nNamespace: "cmeRealtimeData";
212
- readonly storeId: "cmeMarketData";
213
- readonly surfaces: readonly ["contract-chart-delay-chip", "contract-chart-delay-card", "chart-source-line", "watchlist-panel", "watchlist-cell-tooltip", "purchase-live-price"];
214
- readonly contractRevision: "2026-10-23.1";
215
73
  }, {
216
74
  readonly key: "stocks";
217
75
  readonly displayName: "US stocks";
@@ -336,12 +194,139 @@ export declare const FLAG_GATED_MARKET_DATA_VENUES: readonly [{
336
194
  readonly disclosure: {
337
195
  readonly kind: "verbatim";
338
196
  };
339
- readonly flagKey: "us-equities-full";
197
+ readonly flagKey: null;
340
198
  readonly i18nNamespace: "stocksRealtimeData";
341
199
  readonly storeId: "stocksRealtime";
342
200
  readonly surfaces: readonly ["contract-chart-delay-chip", "chart-source-line"];
343
201
  readonly contractRevision: "2026-11-08.1";
344
202
  }];
203
+ /** The venues carried dark: each is listed only while its `flagKey` reads on (`marketDataVenueIsServed`). */
204
+ export declare const FLAG_GATED_MARKET_DATA_VENUES: readonly [{
205
+ readonly key: "cme";
206
+ readonly displayName: "CME Group";
207
+ readonly productGroups: readonly ["CME", "CBOT", "NYMEX", "COMEX"];
208
+ readonly basePath: "/market-data/cme";
209
+ readonly products: readonly [{
210
+ readonly name: "cme_bundle_l1_1m";
211
+ readonly key: "l1";
212
+ readonly plan: "p1";
213
+ readonly level: 1;
214
+ readonly classifications: readonly ["non_professional"];
215
+ readonly interval: "1m";
216
+ readonly priceUsd: 7;
217
+ readonly planCard: {
218
+ readonly name: "Real-time L1";
219
+ readonly level: "LEVEL 1";
220
+ readonly market: "CME";
221
+ readonly markets: readonly ["CME", "CBOT", "COMEX", "NYMEX"];
222
+ readonly region: "🇺🇸 USA";
223
+ readonly descPath: "subscription.l1Desc";
224
+ };
225
+ }, {
226
+ readonly name: "cme_bundle_depth_1m";
227
+ readonly key: "depth";
228
+ readonly plan: "p2";
229
+ readonly level: 2;
230
+ readonly classifications: readonly ["non_professional"];
231
+ readonly interval: "1m";
232
+ readonly priceUsd: 45;
233
+ readonly planCard: {
234
+ readonly name: "Real-time depth";
235
+ readonly level: "LEVEL 2";
236
+ readonly market: "CME";
237
+ readonly markets: readonly ["CME", "CBOT", "COMEX", "NYMEX"];
238
+ readonly region: "🇺🇸 USA";
239
+ readonly descPath: "subscription.depthDesc";
240
+ };
241
+ }, {
242
+ readonly name: "cme_bundle_depth_pro_1m";
243
+ readonly key: "depth_pro";
244
+ readonly plan: "p2";
245
+ readonly level: 3;
246
+ readonly classifications: readonly ["professional"];
247
+ readonly interval: "1m";
248
+ readonly priceUsd: 538;
249
+ readonly planCard: {
250
+ readonly name: "Real-time depth";
251
+ readonly level: "LEVEL 2";
252
+ readonly market: "CME";
253
+ readonly markets: readonly ["CME", "CBOT", "COMEX", "NYMEX"];
254
+ readonly region: "🇺🇸 USA";
255
+ readonly descPath: "subscription.depthDesc";
256
+ };
257
+ }];
258
+ readonly planCard: {
259
+ readonly name: "Real-time L1";
260
+ readonly level: "LEVEL 1";
261
+ readonly market: "CME";
262
+ readonly markets: readonly ["CME", "CBOT", "COMEX", "NYMEX"];
263
+ readonly region: "🇺🇸 USA";
264
+ readonly descPath: "subscription.l1Desc";
265
+ };
266
+ readonly paymentItemPrefix: "cme_";
267
+ readonly professionalPolicy: "sell";
268
+ readonly internalRolePolicy: "report";
269
+ readonly payFirst: false;
270
+ readonly planChanges: {
271
+ readonly downgradeAtPeriodEnd: true;
272
+ readonly prorateUpgrades: true;
273
+ };
274
+ readonly offers: true;
275
+ readonly questionnaire: {
276
+ readonly formVersion: "v1";
277
+ readonly acceptedFormVersions: readonly ["v1", ""];
278
+ readonly presentation: "two-way";
279
+ readonly questions: readonly [{
280
+ readonly id: "individual_own_account";
281
+ readonly qualifying: true;
282
+ }, {
283
+ readonly id: "personal_non_business_use";
284
+ readonly qualifying: true;
285
+ }, {
286
+ readonly id: "not_registered_or_qualified";
287
+ readonly qualifying: true;
288
+ }, {
289
+ readonly id: "not_advisor_or_asset_manager";
290
+ readonly qualifying: true;
291
+ }, {
292
+ readonly id: "no_redistribution_or_business_application";
293
+ readonly qualifying: true;
294
+ }];
295
+ readonly groups: readonly [];
296
+ readonly addendum: {
297
+ readonly id: "ila_subscriber_addendum_2026_06_accepted";
298
+ readonly version: "v1";
299
+ };
300
+ readonly postalAddress: {
301
+ readonly answerId: "postal_address";
302
+ };
303
+ readonly identityFields: readonly ["legalName", "employer", "occupation", "country", "address"];
304
+ readonly identityLimits: {
305
+ readonly legalName: 200;
306
+ readonly employer: 200;
307
+ readonly occupation: 200;
308
+ readonly country: 2;
309
+ readonly address: 300;
310
+ };
311
+ readonly validityDays: 365;
312
+ readonly renewalWindowDays: 30;
313
+ };
314
+ readonly agreement: {
315
+ readonly recordedAs: "registration";
316
+ readonly version: "cme-data-terms-v1";
317
+ readonly url: "/api/v1/market-data/cme/agreement";
318
+ readonly delayedRequiresAcceptance: true;
319
+ };
320
+ readonly delayMinutes: 10;
321
+ readonly disclosure: {
322
+ readonly kind: "translated";
323
+ };
324
+ readonly flagKey: "cme-engine";
325
+ readonly i18nNamespace: "cmeRealtimeData";
326
+ readonly storeId: "cmeMarketData";
327
+ readonly surfaces: readonly ["contract-chart-delay-chip", "contract-chart-delay-card", "chart-source-line", "watchlist-panel", "watchlist-cell-tooltip", "purchase-live-price"];
328
+ readonly contractRevision: "2026-10-23.1";
329
+ }];
345
330
  type CarriedMarketDataVenue = (typeof MARKET_DATA_VENUES)[number] | (typeof FLAG_GATED_MARKET_DATA_VENUES)[number];
346
331
  /** A registered venue's key: a card the build carries, served now or dark. */
347
332
  export type MarketDataVenueKey = CarriedMarketDataVenue['key'];
@@ -2,9 +2,9 @@ import { CME_VENUE } from './cme.js';
2
2
  import { OPRA_VENUE } from './opra.js';
3
3
  import { STOCKS_VENUE } from './stocks.js';
4
4
  /** The venues served in every session. */
5
- export const MARKET_DATA_VENUES = [OPRA_VENUE];
5
+ export const MARKET_DATA_VENUES = [OPRA_VENUE, STOCKS_VENUE];
6
6
  /** The venues carried dark: each is listed only while its `flagKey` reads on (`marketDataVenueIsServed`). */
7
- export const FLAG_GATED_MARKET_DATA_VENUES = [CME_VENUE, STOCKS_VENUE];
7
+ export const FLAG_GATED_MARKET_DATA_VENUES = [CME_VENUE];
8
8
  /** Every card the build carries, served or dark, for the card lookup (`requireVenueByKey`). */
9
9
  const CARRIED_VENUES = [...MARKET_DATA_VENUES, ...FLAG_GATED_MARKET_DATA_VENUES];
10
10
  /** The venue in `venues` with this key, or null. */
@@ -122,7 +122,7 @@ export declare const STOCKS_VENUE: {
122
122
  readonly disclosure: {
123
123
  readonly kind: "verbatim";
124
124
  };
125
- readonly flagKey: "us-equities-full";
125
+ readonly flagKey: null;
126
126
  readonly i18nNamespace: "stocksRealtimeData";
127
127
  readonly storeId: "stocksRealtime";
128
128
  readonly surfaces: readonly ["contract-chart-delay-chip", "chart-source-line"];
@@ -1,8 +1,7 @@
1
1
  /**
2
2
  * The US stocks venue card (the consolidated tape: CTA for Tapes A and B, UTP for Tape C): the frontend descriptor of
3
3
  * the $19 "Real-time US stocks" add-on on the venue-generic market-data plane (docs/features/market-data/plane.md, "US
4
- * stocks on the plane"). Carried DARK: the registry lists it only while `us-equities-full` reads on
5
- * (`FLAG_GATED_MARKET_DATA_VENUES`, `marketDataVenueIsServed`), so with the flag off nothing in the app reads it.
4
+ * stocks on the plane"). Served in every session (`MARKET_DATA_VENUES`).
6
5
  *
7
6
  * OPRA's policy set (pay first, one product, a professional refused, staff on operator test grants: contract revision
8
7
  * 2026-11-08.1, no attestation, in no report), with what the tape adds: two agreements, one per set of product
@@ -17,7 +16,6 @@
17
16
  * export replaces it) and the gate's release mirror (`gate-mirror.copy.yaml` beside the spec) by
18
17
  * tests/packages/wrun-chart-host/market-data/venues/stocks.contract.spec.ts.
19
18
  */
20
- import { FeatureFlag } from '../../constants/feature-flags.constants.js';
21
19
  import { STOCKS_GOVERNED_EXCHANGES, STOCKS_TAPE_OF_EXCHANGE } from '../../interfaces/stocks-realtime.interface.js';
22
20
  // The product groups are the frontend's tape codes (the gate's wire names are the listing venues: the service and the
23
21
  // gate mirror's copy name those, STOCKS_TAPE_WIRE_EXCHANGE maps them). CTA licenses Tapes A and B, UTP Tape C.
@@ -111,7 +109,7 @@ export const STOCKS_VENUE = {
111
109
  // The CTA Delayed Market Data Policy's exact statement: STOCKS_DELAY_STATEMENT in
112
110
  // constants/stocks-compliance.constants.ts ("Delayed 15 minutes").
113
111
  disclosure: { kind: 'verbatim' },
114
- flagKey: FeatureFlag.UsEquitiesFull,
112
+ flagKey: null,
115
113
  i18nNamespace: 'stocksRealtimeData',
116
114
  storeId: 'stocksRealtime',
117
115
  // For now the delay statement shows on a tape chart's delay chip and its source line only.
@@ -5,10 +5,9 @@
5
5
  * stays worker-safe and store-free, so the main thread hands it readers instead.
6
6
  *
7
7
  * The gate is open only while BOTH of its facts answer `true`, each read live on every call:
8
- * - The flag. The flags store registers its override-aware `isOn` as the fallback when it is created, and publishes
9
- * its reader again after every successful fetch. Until a fetch publishes, the fallback answers, so the dev and
10
- * internal `kiyo.flag-overrides` lens reaches the walls before the map lands and through a failed fetch, exactly as
11
- * it reaches every surface that reads `isOn`: the walls and the surfaces never disagree.
8
+ * - The flag. The flags store registers `licenceFlagOn` as the fallback when it is created, read live: an explicit
9
+ * override answers, so the dev and internal `kiyo.flag-overrides` lens reaches the walls before the map lands, and
10
+ * once the map has answered an absent or archived record reads on. A published reader (a spec's) answers over it.
12
11
  * - The viewer's CME entitlement. The web hands its `viewerMayReadCme()` reader: signed in, not a guest, the CME data
13
12
  * terms not blocked. Delayed and real-time access both count: the tier a read rides is the gate plane's, decided per
14
13
  * socket, never this answer's.
@@ -26,8 +25,8 @@
26
25
  * its answer (titan-charts' dataFetch result, the script engine's result, the wrun run's `isCurrent`) compares the
27
26
  * token and drops an answer from a previous authorisation context, so a late answer never lands after access changed.
28
27
  * A missing token is never current. The epoch is main-thread state: a worker's copy of this module never sees a bump,
29
- * so a worker carries the captured token back and never judges it. Publishing a reader never moves the epoch (a flag
30
- * fetch publishes after every fetch, moved or not): only the watcher bumps it, on a move it saw.
28
+ * so a worker carries the captured token back and never judges it. Publishing a reader never moves the epoch: only the
29
+ * watcher bumps it, on a move it saw.
31
30
  *
32
31
  * The stopped-study register (`markCmeStudyStopped`, `clearCmeStudyStopped`, `cmeStudyStopReason`,
33
32
  * `isCmeStudyStopped`): the studies the lifecycle watcher stopped in place when the gate closed (the viewer's access
@@ -57,9 +56,10 @@ export declare function cmeStudyRemountStash(chartIndex: number, overlayId: stri
57
56
  export declare function cmeStudyStopReason(chartIndex: number, overlayId: string): CmeStudyStopReason | undefined;
58
57
  /** Whether the lifecycle stopped this study and nothing has mounted it again since. */
59
58
  export declare function isCmeStudyStopped(chartIndex: number, overlayId: string): boolean;
60
- /** Called by the flags store after a successful fetch (and by specs); null unpublishes. */
59
+ /** Called by specs (and a host that hands its own reader); null unpublishes. */
61
60
  export declare function publishCmeUserScriptsFlag(next: (() => boolean) | null): void;
62
- /** Called by the flags store when it is created: its override-aware `isOn`, read until a fetch publishes. */
61
+ /** Called by the flags store when it is created: `licenceFlagOn`, which reads an absent or archived record as on once
62
+ * the map has answered; read whenever nothing is published. */
63
63
  export declare function setCmeUserScriptsFlagFallback(next: (() => boolean) | null): void;
64
64
  /** Called by the web with its `viewerMayReadCme()` reader (signed in, not a guest, CME data terms not blocked); null
65
65
  * unregisters, and no reader reads closed. */
@@ -5,10 +5,9 @@
5
5
  * stays worker-safe and store-free, so the main thread hands it readers instead.
6
6
  *
7
7
  * The gate is open only while BOTH of its facts answer `true`, each read live on every call:
8
- * - The flag. The flags store registers its override-aware `isOn` as the fallback when it is created, and publishes
9
- * its reader again after every successful fetch. Until a fetch publishes, the fallback answers, so the dev and
10
- * internal `kiyo.flag-overrides` lens reaches the walls before the map lands and through a failed fetch, exactly as
11
- * it reaches every surface that reads `isOn`: the walls and the surfaces never disagree.
8
+ * - The flag. The flags store registers `licenceFlagOn` as the fallback when it is created, read live: an explicit
9
+ * override answers, so the dev and internal `kiyo.flag-overrides` lens reaches the walls before the map lands, and
10
+ * once the map has answered an absent or archived record reads on. A published reader (a spec's) answers over it.
12
11
  * - The viewer's CME entitlement. The web hands its `viewerMayReadCme()` reader: signed in, not a guest, the CME data
13
12
  * terms not blocked. Delayed and real-time access both count: the tier a read rides is the gate plane's, decided per
14
13
  * socket, never this answer's.
@@ -26,8 +25,8 @@
26
25
  * its answer (titan-charts' dataFetch result, the script engine's result, the wrun run's `isCurrent`) compares the
27
26
  * token and drops an answer from a previous authorisation context, so a late answer never lands after access changed.
28
27
  * A missing token is never current. The epoch is main-thread state: a worker's copy of this module never sees a bump,
29
- * so a worker carries the captured token back and never judges it. Publishing a reader never moves the epoch (a flag
30
- * fetch publishes after every fetch, moved or not): only the watcher bumps it, on a move it saw.
28
+ * so a worker carries the captured token back and never judges it. Publishing a reader never moves the epoch: only the
29
+ * watcher bumps it, on a move it saw.
31
30
  *
32
31
  * The stopped-study register (`markCmeStudyStopped`, `clearCmeStudyStopped`, `cmeStudyStopReason`,
33
32
  * `isCmeStudyStopped`): the studies the lifecycle watcher stopped in place when the gate closed (the viewer's access
@@ -87,11 +86,12 @@ export function cmeStudyStopReason(chartIndex, overlayId) {
87
86
  export function isCmeStudyStopped(chartIndex, overlayId) {
88
87
  return stopped.has(stoppedKey(chartIndex, overlayId));
89
88
  }
90
- /** Called by the flags store after a successful fetch (and by specs); null unpublishes. */
89
+ /** Called by specs (and a host that hands its own reader); null unpublishes. */
91
90
  export function publishCmeUserScriptsFlag(next) {
92
91
  published = next;
93
92
  }
94
- /** Called by the flags store when it is created: its override-aware `isOn`, read until a fetch publishes. */
93
+ /** Called by the flags store when it is created: `licenceFlagOn`, which reads an absent or archived record as on once
94
+ * the map has answered; read whenever nothing is published. */
95
95
  export function setCmeUserScriptsFlagFallback(next) {
96
96
  fallback = next;
97
97
  }
@@ -6,14 +6,14 @@
6
6
  *
7
7
  * Store-free on purpose, the shape of the `cme-user-scripts` gate leaf (cme-user-scripts-gate.util): the venue policy
8
8
  * stays worker-safe, so the main thread hands it a reader instead. Its one import is the fallback reader's seat
9
- * (governed-lanes-reader-seat, itself dependency-free), which the flags store fills with its override-aware `isOn`
10
- * when it is evaluated, so the dev and internal `kiyo.flag-overrides` lens reaches the walls exactly as it reaches
11
- * every surface reading `isOn`. A published reader (a spec's, or a host that hands one) answers over the seat's.
9
+ * (governed-lanes-reader-seat, itself dependency-free), which the flags store fills with `licenceFlagOn` when it is
10
+ * evaluated: an explicit override answers, and once the map has answered an absent or archived record reads on. A
11
+ * published reader (a spec's, or a host that hands one) answers over the seat's.
12
12
  *
13
13
  * Fail closed everywhere: no reader (a worker, a spec without a store), a reader that throws, a reader that answers
14
- * anything but `true`, an unloaded or guest map (the store's `isOn` reads those false) and a plane this module does
15
- * not name all read dark. The flags never open a lane on their own: each plane's own decision still holds (the CME
16
- * plane keeps the `cme-user-scripts` gate: the flag, sign-in and the CME data terms).
14
+ * anything but `true`, an unanswered or failed map or a guest (`licenceFlagOn` reads those off) and a plane this
15
+ * module does not name all read dark. The flags never open a lane on their own: each plane's own decision still holds
16
+ * (the CME plane keeps the `cme-user-scripts` gate: the flag, sign-in and the CME data terms).
17
17
  */
18
18
  /** A licensed plane the cutover opens to the server lanes. */
19
19
  export type GovernedLanePlane = 'cme' | 'opra' | 'stocks';
@@ -6,14 +6,14 @@
6
6
  *
7
7
  * Store-free on purpose, the shape of the `cme-user-scripts` gate leaf (cme-user-scripts-gate.util): the venue policy
8
8
  * stays worker-safe, so the main thread hands it a reader instead. Its one import is the fallback reader's seat
9
- * (governed-lanes-reader-seat, itself dependency-free), which the flags store fills with its override-aware `isOn`
10
- * when it is evaluated, so the dev and internal `kiyo.flag-overrides` lens reaches the walls exactly as it reaches
11
- * every surface reading `isOn`. A published reader (a spec's, or a host that hands one) answers over the seat's.
9
+ * (governed-lanes-reader-seat, itself dependency-free), which the flags store fills with `licenceFlagOn` when it is
10
+ * evaluated: an explicit override answers, and once the map has answered an absent or archived record reads on. A
11
+ * published reader (a spec's, or a host that hands one) answers over the seat's.
12
12
  *
13
13
  * Fail closed everywhere: no reader (a worker, a spec without a store), a reader that throws, a reader that answers
14
- * anything but `true`, an unloaded or guest map (the store's `isOn` reads those false) and a plane this module does
15
- * not name all read dark. The flags never open a lane on their own: each plane's own decision still holds (the CME
16
- * plane keeps the `cme-user-scripts` gate: the flag, sign-in and the CME data terms).
14
+ * anything but `true`, an unanswered or failed map or a guest (`licenceFlagOn` reads those off) and a plane this
15
+ * module does not name all read dark. The flags never open a lane on their own: each plane's own decision still holds
16
+ * (the CME plane keeps the `cme-user-scripts` gate: the flag, sign-in and the CME data terms).
17
17
  */
18
18
  import { governedLanesFallbackSeat } from './governed-lanes-reader-seat.js';
19
19
  /** Every governed lane plane, in the order the planes shipped. */
@@ -35,3 +35,16 @@ export declare function isIndexOtcSymbol(symbol: string | undefined | null): boo
35
35
  * unknown symbol never gains a percent sign.
36
36
  */
37
37
  export declare function indexOtcUnit(symbol: string | undefined | null): IndexOtcUnit;
38
+ /**
39
+ * From this bar width up (one day), the venue's bars are the server's official bars: a day keyed at 00:00 UTC of its
40
+ * trade date, weeks and months rolled up from official days, today's bar rewritten by the server about every 15
41
+ * minutes. Live prints run around the clock on most of the instruments, so a bar built from them would hold
42
+ * overnight prices the official bar never has.
43
+ */
44
+ export declare const INDEX_OTC_SERVER_BUILT_BARS_FROM_MS = 86400000;
45
+ /**
46
+ * Whether bars of `exchange` at this bar width are the server's alone: no live print may create or change one, and
47
+ * the newest bar is read again from the server. True only for the index and yield venue at one day and wider; a
48
+ * missing or non-finite width is false, so an unknown interval keeps today's behaviour.
49
+ */
50
+ export declare function barsAreServerBuilt(exchange: string | undefined | null, intervalMs: number | undefined | null): boolean;
@@ -66,3 +66,21 @@ export function isIndexOtcSymbol(symbol) {
66
66
  export function indexOtcUnit(symbol) {
67
67
  return typeof symbol === 'string' && INDEX_OTC_PERCENT_SYMBOLS_SET.has(symbol.toUpperCase()) ? 'percent' : 'points';
68
68
  }
69
+ /**
70
+ * From this bar width up (one day), the venue's bars are the server's official bars: a day keyed at 00:00 UTC of its
71
+ * trade date, weeks and months rolled up from official days, today's bar rewritten by the server about every 15
72
+ * minutes. Live prints run around the clock on most of the instruments, so a bar built from them would hold
73
+ * overnight prices the official bar never has.
74
+ */
75
+ export const INDEX_OTC_SERVER_BUILT_BARS_FROM_MS = 86_400_000;
76
+ /**
77
+ * Whether bars of `exchange` at this bar width are the server's alone: no live print may create or change one, and
78
+ * the newest bar is read again from the server. True only for the index and yield venue at one day and wider; a
79
+ * missing or non-finite width is false, so an unknown interval keeps today's behaviour.
80
+ */
81
+ export function barsAreServerBuilt(exchange, intervalMs) {
82
+ return (checkIsIndexOtc(exchange) &&
83
+ typeof intervalMs === 'number' &&
84
+ Number.isFinite(intervalMs) &&
85
+ intervalMs >= INDEX_OTC_SERVER_BUILT_BARS_FROM_MS);
86
+ }
@@ -0,0 +1,4 @@
1
+ export declare function chartBarsAreServerBuilt(market: {
2
+ exchange?: string | null;
3
+ transformations?: unknown;
4
+ } | undefined | null, intervalMs: number | undefined | null): boolean;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * The chart-level reading of "these bars are the server's" (`barsAreServerBuilt` in index-otc.leaf): a chart's bars
3
+ * are server-built when its own venue is, or when any leg of its series formula is. A formula chart names only its
4
+ * first leg in `exchange`, and one leg with overnight prints is enough to put overnight prices into the formula's
5
+ * daily bar, so every door that decides for a whole chart (the main live fold, the poll, replay) asks here.
6
+ *
7
+ * The legs are walked by `transformationsTouchVenue`, the same walk the fetch path and the licence doors use, so a
8
+ * leg the chart loads is a leg this sees.
9
+ */
10
+ import { transformationsTouchVenue } from '../common/transformations.util.js';
11
+ import { barsAreServerBuilt } from './index-otc.leaf.js';
12
+ export function chartBarsAreServerBuilt(market, intervalMs) {
13
+ if (!market)
14
+ return false;
15
+ if (barsAreServerBuilt(market.exchange, intervalMs))
16
+ return true;
17
+ return transformationsTouchVenue(market.transformations, (exchange) => barsAreServerBuilt(exchange, intervalMs));
18
+ }
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * The `dark_pool` row lane's identity and fetch (sources/row-lanes/dark_pool.ts loads this module inside them, so the
3
3
  * lane file on the boot path stays light). Both read the chart port (web: titan-charts):
4
- * - `wrunDarkPoolMarket(chart, { official })`: the Tape's market resolver under `us-equities-full` and the venue policy:
4
+ * - `wrunDarkPoolMarket(chart, { official })`: the Tape's market resolver under the venue policy:
5
5
  * the tape market on a US stock Trades chart, the venue policy's stop (a user run on a tape closed to scripting, on
6
6
  * either feed), the Price only stop, or null for a chart that reads no US stock tape;
7
7
  * - `wrunDarkPoolPrints(market, window, { signal })`: the window read (stock-tape-dark-pool-read.util
@@ -39,7 +39,7 @@
39
39
  * alone (the browser compile pipeline's stamp writer, which never writes a converging value), W is the same
40
40
  * arithmetic for both (`wrunHistoryWarmupBars`), and `wrunHistoryStampExactColumns` names the selector columns the
41
41
  * overlap proof compares exactly whatever the tolerance. Whether a chart honors a converging stamp is the overlay
42
- * run's question (`wrun-converging-prefix`, default off), never this reader's.
42
+ * run's question (`wrunConvergingPrefixOn`, signed-in sessions), never this reader's.
43
43
  */
44
44
  import type { WrunHistoryWarmup, WrunHistoryWarmupExact, WrunIndicatorMetadata } from '../../interfaces/wrun-runtime.interface.js';
45
45
  /**
@@ -217,6 +217,9 @@ export declare function wrunLiveOhlcvPoint(point: unknown): {
217
217
  * widen high/low, replace the close and ADD volume), bucketed by the chart
218
218
  * rule on the leg's own `market` (a WEEK bucket on its Monday, a CME Group
219
219
  * leg on the session lattice). Never mutates its inputs.
220
+ *
221
+ * Bars the server alone builds (`barsAreServerBuilt`: the index venue at one day and wider) are never folded: no live
222
+ * print may create or change one. A script on such a leg reads its newest bars again on every lane reconcile.
220
223
  */
221
224
  export declare function foldWrunLegCandleRows(base: ReadonlyArray<ArrayLike<number>>, points: readonly unknown[], intervalMs: number, market?: WrunLiveBucketMarket | null): FoldResult | null;
222
225
  /**
@@ -95,6 +95,7 @@ import { serverNowMs } from '../auth/server-clock.util.js';
95
95
  import { wrunRowLaneByKey } from './sources/row-lane-registry.js';
96
96
  import { wrunHostBarOf } from './wrun-tier-grid.util.js';
97
97
  import { barStartMs } from '../chart/calendar-interval.util.js';
98
+ import { barsAreServerBuilt } from '../chart/index-otc.leaf.js';
98
99
  import { getWrunOverlayLiveContext, onWrunOverlayLiveTeardown, } from './wrun-overlay-drivers.util.js';
99
100
  import { WRUN_TYPED_PINNED_SOURCES, wrunDeclaredSourceLanes, wrunLegRowHostBar, wrunLaneAcquisitionIntervalMs, wrunPinnedIntervalOf, } from './wrun-source-rows.util.js';
100
101
  import { getProfileBucketHeight, normalizeTicksPerBar } from '../../workers/utils/volume-profile.worker.util.js';
@@ -598,10 +599,15 @@ export function wrunLiveOhlcvPoint(point) {
598
599
  * widen high/low, replace the close and ADD volume), bucketed by the chart
599
600
  * rule on the leg's own `market` (a WEEK bucket on its Monday, a CME Group
600
601
  * leg on the session lattice). Never mutates its inputs.
602
+ *
603
+ * Bars the server alone builds (`barsAreServerBuilt`: the index venue at one day and wider) are never folded: no live
604
+ * print may create or change one. A script on such a leg reads its newest bars again on every lane reconcile.
601
605
  */
602
606
  export function foldWrunLegCandleRows(base, points, intervalMs, market) {
603
607
  if (!Number.isFinite(intervalMs) || intervalMs <= 0)
604
608
  return null;
609
+ if (barsAreServerBuilt(market?.exchange, intervalMs))
610
+ return null;
605
611
  const indexByTs = new Map();
606
612
  for (let at = 0; at < base.length; at += 1)
607
613
  indexByTs.set(Number(base[at][0]), at);
@@ -2938,7 +2938,7 @@ async function prepareWrunSandboxRun(passTarget, tc, meta, refusal, computed, ow
2938
2938
  // context exists (D4): the run starts with a hidden head of W candles before its first landed row (a clamped
2939
2939
  // window's head included), the chart's own candles asked through the main candle request. Any `history_warmup`
2940
2940
  // key reaches the verdict (a torn stamp answers `warmup-invalid` there, never reads as no stamp; a converging one
2941
- // reads as no stamp there before anything else while `wrun-converging-prefix` is off, so no head is planned), and W
2941
+ // reads as no stamp there before anything else for a guest session, so no head is planned), and W
2942
2942
  // reads the settings the package computes with (`wrunWarmupSettings`: a run at another interval, and a twin whose
2943
2943
  // Timeframe is at or below the chart's, take their chart arm, as the init args below send them).
2944
2944
  const warmupVerdict = target.metadata.history_warmup === undefined
@@ -12118,7 +12118,7 @@ function wrunWarmupStampCorroborated(module, sheet) {
12118
12118
  * reason) and the capability line, where it used to read as no stamp at all (the roster's silent `not-audited`); it
12119
12119
  * still corroborates nothing (no W reads off it, and the per-bar stamp refuses any sheet carrying the key). A record
12120
12120
  * of another kind is a later round's stamp and reads as no stamp, as it always has (`wrunHistoryWarmupOf`), and so
12121
- * does a converging one while its flag is off: every caller asks `wrunConvergingStampDark` first (R2-13). */
12121
+ * does a converging one for a guest session: every caller asks `wrunConvergingStampDark` first (R2-13). */
12122
12122
  function wrunWarmupStampTorn(sheet) {
12123
12123
  if (sheet === null || typeof sheet !== 'object')
12124
12124
  return false;
@@ -12130,11 +12130,11 @@ function wrunWarmupStampTorn(sheet) {
12130
12130
  const kind = raw.kind;
12131
12131
  return (kind === 'exact' || kind === 'converges') && wrunWarmupStampOf(sheet) === undefined;
12132
12132
  }
12133
- /** Whether the chart honors a converging warm-up stamp (`FeatureFlag.WrunConvergingPrefix`, STAMPS round A, default
12134
- * off); a host whose flag store is not up reads off. */
12133
+ /** Whether the chart honors a converging warm-up stamp: a signed-in session; a host without `user.isSignedIn`, or whose
12134
+ * session is not up, reads off. */
12135
12135
  function wrunConvergingPrefixOn() {
12136
12136
  try {
12137
- return wrunChartHostEnv().user.isFeatureOn(FeatureFlag.WrunConvergingPrefix);
12137
+ return wrunChartHostEnv().user.isSignedIn?.() === true;
12138
12138
  }
12139
12139
  catch {
12140
12140
  return false;
@@ -12145,7 +12145,7 @@ function wrunWarmupStampConverges(sheet) {
12145
12145
  const raw = sheet !== null && typeof sheet === 'object' ? sheet.history_warmup : undefined;
12146
12146
  return (raw !== null && typeof raw === 'object' && !Array.isArray(raw) && raw.kind === 'converges');
12147
12147
  }
12148
- /** A converging stamp its flag leaves unread (STAMPS round A, R2-13): while `wrun-converging-prefix` is off, a
12148
+ /** A converging stamp a guest session leaves unread (STAMPS round A, R2-13): while `wrunConvergingPrefixOn` is off, a
12149
12149
  * `converges` record of ANY shape reads as no stamp, exactly as an unknown kind always has (never torn, never
12150
12150
  * planned, never admitted), so the run, its head, its rows and its admission are today's. Asked first by every reader
12151
12151
  * that plans or admits on a stamp, before any other reading of it (the torn check included). */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orangecharts/wrun-chart-host",
3
- "version": "0.17.0",
3
+ "version": "0.18.0",
4
4
  "description": "The wrun chart-host layer shared by the kiyotaka web app and the mobile app: the wrun result reader and painter model, cut from the web app (its reference implementation).",
5
5
  "type": "module",
6
6
  "files": [