@orangecharts/wrun-chart-host 0.1.0 → 0.2.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
@@ -10,7 +10,7 @@ Peers, pinned exactly (install them beside the package):
10
10
 
11
11
  | Peer | Version | Why |
12
12
  | --- | --- | --- |
13
- | `@orangecharts/indicator-kit` | 0.78.1 | the shared host's types (`@orangecharts/indicator-kit/host`); the host module itself comes through the env |
13
+ | `@orangecharts/indicator-kit` | 0.80.0 | the shared host's types (`@orangecharts/indicator-kit/host`); the host module itself comes through the env |
14
14
  | `dayjs` | 1.11.23 | sessions and trading days (the `utc`, `timezone` and `isoWeek` plugins) |
15
15
  | `lodash-es` | 4.18.1 | the color settings |
16
16
 
@@ -70,3 +70,28 @@ pnpm -F @orangecharts/wrun-chart-host consumer-check <tarball> <empty directory
70
70
  `build` compiles with tsc, then `scripts/esm-dist.mjs` gives every specifier the file Node's ESM loader needs.
71
71
  `consumer-check` installs the tarball with only the peers, compiles `consumer-check/consumer.ts` (skipLibCheck off,
72
72
  Bundler and NodeNext resolution) and runs `consumer-check/run.mjs` under Node.
73
+
74
+ ## Versions
75
+
76
+ What each published version holds. A host installs a version with the peers of its row, at exactly those versions.
77
+
78
+ | Version | Peers | What changed |
79
+ | --- | --- | --- |
80
+ | 0.2.0 | `@orangecharts/indicator-kit` 0.80.0, `dayjs` 1.11.23, `lodash-es` 4.18.1 | The kit peer moves from 0.78.1 to 0.80.0. Three modules join, 101 in all: `utility/wrun/wrun-symbol-code.util` (the symbol codec of the options source classes), `utility/wrun/wrun-row-market.util` (the market a table row or feed line is about) and `utility/wrun/wrun-failure-cause` (why a run failed, as one closed word). The 12 package commits since 0.1.0, listed below. Lodash by subpath: the color settings import `lodash-es/isEqual`, never the `lodash-es` root, so a bundler that does not shake trees keeps one lodash module, not the library (`tests/packages/wrun-chart-host/lodash-subpath.spec.ts` refuses a root import in the package). |
81
+ | 0.1.0 | `@orangecharts/indicator-kit` 0.78.1, `dayjs` 1.11.23, `lodash-es` 4.18.1 | The first cut, packed from web 89fadab981: 98 modules, the wrun result reader and painter model with the host env. |
82
+
83
+ The 12 package commits in 0.2.0 since 0.1.0, newest first, as listed before the 0.2.0 landing by
84
+ `git log --oneline 89fadab981..origin/main -- packages/wrun-chart-host`:
85
+
86
+ - `102bb75757` fix(wrun): ride out temporary cloud-run failures instead of showing Could not draw
87
+ - `1c00e54ed8` feat(wrun): stamp a cloud run's opra provenance from its result mark
88
+ - `883dedb8bd` feat(wrun): scroll wrun tables and feeds, and name their rows by the frame's markets
89
+ - `c6de878290` refactor(wrun): move the symbol codec into the wrun chart-host package
90
+ - `fed5dfcd15` chore(deps): bump @orangecharts/indicator-kit to 0.80.0
91
+ - `da3e170efd` feat(wrun): fill the earnings facts from the market-events earnings rows
92
+ - `064468bce8` feat(wrun): serve option_stats_10m from the ten-minute underlying statistics
93
+ - `a1c654c0a9` feat(wrun): serve option_daily from the daily underlying statistics
94
+ - `c503724837` feat(wrun): serve options_flow from the opra flow scope rows
95
+ - `0814f8ccc9` feat(wrun): degrade a lane answer the data plane refused by name, once
96
+ - `bcf922e09c` feat(wrun): refuse a source whose protocol type is pending by name
97
+ - `31e61dc395` feat(wrun): serve new celled sources through descriptor lanes and one opra rule
package/dist/index.d.ts CHANGED
@@ -57,6 +57,7 @@ export * from './utility/wrun/wrun-child-overlay-id.util.js';
57
57
  export * from './utility/wrun/wrun-color-facts.util.js';
58
58
  export * from './utility/wrun/wrun-color-settings.lazy.js';
59
59
  export * from './utility/wrun/wrun-color-settings.util.js';
60
+ export * from './utility/wrun/wrun-failure-cause.js';
60
61
  export * from './utility/wrun/wrun-footprint-modes.util.js';
61
62
  export * from './utility/wrun/wrun-handles.util.js';
62
63
  export * from './utility/wrun/wrun-heatmap-cell-budget.util.js';
@@ -79,11 +80,13 @@ export * from './utility/wrun/wrun-param-values.util.js';
79
80
  export * from './utility/wrun/wrun-refusal.util.js';
80
81
  export * from './utility/wrun/wrun-registry-errors.util.js';
81
82
  export * from './utility/wrun/wrun-render-select.util.js';
83
+ export * from './utility/wrun/wrun-row-market.util.js';
82
84
  export * from './utility/wrun/wrun-script-inputs.util.js';
83
85
  export * from './utility/wrun/wrun-setting-words.lazy.js';
84
86
  export * from './utility/wrun/wrun-setting-words.util.js';
85
87
  export * from './utility/wrun/wrun-socket-row-store.js';
86
88
  export * from './utility/wrun/wrun-style-flags.util.js';
89
+ export * from './utility/wrun/wrun-symbol-code.util.js';
87
90
  export * from './utility/wrun/wrun-table-look.util.js';
88
91
  export * from './utility/wrun/wrun-text-look.util.js';
89
92
  export * from './utility/wrun/wrun-text-params.util.js';
package/dist/index.js CHANGED
@@ -60,6 +60,7 @@ export * from './utility/wrun/wrun-child-overlay-id.util.js';
60
60
  export * from './utility/wrun/wrun-color-facts.util.js';
61
61
  export * from './utility/wrun/wrun-color-settings.lazy.js';
62
62
  export * from './utility/wrun/wrun-color-settings.util.js';
63
+ export * from './utility/wrun/wrun-failure-cause.js';
63
64
  export * from './utility/wrun/wrun-footprint-modes.util.js';
64
65
  export * from './utility/wrun/wrun-handles.util.js';
65
66
  export * from './utility/wrun/wrun-heatmap-cell-budget.util.js';
@@ -82,11 +83,13 @@ export * from './utility/wrun/wrun-param-values.util.js';
82
83
  export * from './utility/wrun/wrun-refusal.util.js';
83
84
  export * from './utility/wrun/wrun-registry-errors.util.js';
84
85
  export * from './utility/wrun/wrun-render-select.util.js';
86
+ export * from './utility/wrun/wrun-row-market.util.js';
85
87
  export * from './utility/wrun/wrun-script-inputs.util.js';
86
88
  export * from './utility/wrun/wrun-setting-words.lazy.js';
87
89
  export * from './utility/wrun/wrun-setting-words.util.js';
88
90
  export * from './utility/wrun/wrun-socket-row-store.js';
89
91
  export * from './utility/wrun/wrun-style-flags.util.js';
92
+ export * from './utility/wrun/wrun-symbol-code.util.js';
90
93
  export * from './utility/wrun/wrun-table-look.util.js';
91
94
  export * from './utility/wrun/wrun-text-look.util.js';
92
95
  export * from './utility/wrun/wrun-text-params.util.js';
@@ -701,6 +701,12 @@ export function translatePanelToEngine(frame, ctx = {}) {
701
701
  cellPadding: panel.cell_padding ?? PANEL_TABLE_CELL_PADDING_PX,
702
702
  borderWidth: panel.border_width ?? 1,
703
703
  fontFamily,
704
+ // Rows past the pane scroll under the header with the wheel (the engine's
705
+ // payload `scroll`; a table that fits draws and takes the wheel as before).
706
+ scroll: true,
707
+ // A wrun frame's markets name its rows (UW-PARITY H4): the engine emits
708
+ // table-row-click with the row's key, null for the header row.
709
+ ...(chrome?.markets !== undefined ? { rowKeys: [null, ...chrome.markets] } : {}),
704
710
  };
705
711
  mergeSettings(payload, style.wrunTableStyle(panel, ctx));
706
712
  return { plot: 'table', rows: [[null, payload]], settings: {}, name, hooks: hooks('table') };
@@ -1,3 +1,4 @@
1
+ import type { WrunRowMarket } from '../wrun/wrun-row-market.util.js';
1
2
  export declare const OM_WIDGET_MAX_ROWS = 12;
2
3
  export declare const OM_WIDGET_MAX_BYTES: number;
3
4
  export declare const OM_WIDGET_MAX_PER_PANE = 8;
@@ -44,6 +45,9 @@ export type FeedLine = [timeMs: number, text: string, color?: string];
44
45
  export interface FeedProps extends AnchoredWidgetProps {
45
46
  title: string;
46
47
  lines: FeedLine[];
48
+ /** A wrun feed frame's markets (UW-PARITY H4), one per line as written:
49
+ * null or the market a click on the line opens (wrun-row-market.util). */
50
+ markets?: (WrunRowMarket | null)[];
47
51
  }
48
52
  interface FeedWidget extends FeedProps {
49
53
  kind: 'feed';
@@ -4672,6 +4672,16 @@ function adaptWrunDrawing(drawing, pane, look) {
4672
4672
  const { declaration, sheetId, presentation } = look;
4673
4673
  if (drawing.kind === 'card' || drawing.kind === 'ladder' || drawing.kind === 'feed' || drawing.kind === 'meter') {
4674
4674
  const props = { ...drawing.props };
4675
+ if (drawing.kind === 'feed') {
4676
+ // A feed's lines scroll past the pane (the engine's props `scroll`), and a
4677
+ // frame's markets name them for the row click (UW-PARITY H4): the engine
4678
+ // reads them as `lineKeys`, one per line as written.
4679
+ const markets = props.markets;
4680
+ delete props.markets;
4681
+ props.scroll = true;
4682
+ if (Array.isArray(markets))
4683
+ props.lineKeys = markets;
4684
+ }
4675
4685
  const words = declaration;
4676
4686
  // The widget look (DW01 DW04 DW05 DW06 DW11 DW38): the engine `style`
4677
4687
  // block from the sheet words (a ladder's own style), then the record
@@ -79,7 +79,7 @@
79
79
  * any other number, a width or an opacity, is no colour and stays), so a
80
80
  * colour param bound through `style_targets` and a `colors` row paint either.
81
81
  */
82
- import { isEqual } from 'lodash-es';
82
+ import isEqual from 'lodash-es/isEqual.js';
83
83
  import { HEATMAP_SENSITIVITY_MAX, HEATMAP_SENSITIVITY_MIN } from '../indicators/heatmap-sensitivity.util.js';
84
84
  import { WRUN_SOURCE_FIELD_WORDS, wrunInputGateOn } from './wrun-market-facts.util.js';
85
85
  import { wrunParamValuesFromSettings } from './wrun-param-values.util.js';
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Why a wrun run failed, as one closed word every failure event carries (`feature:failed`, `wrun_lane_mount`,
3
+ * `wrun_failure_shown`): the attempt reason says what kind of failure it was, the cause says what produced it, so a
4
+ * readout can tell a dropped socket from a slow permission or a server refusal without joining server logs.
5
+ *
6
+ * Closed set, pinned two-way on the `WRUN_FAILURE_CAUSES:` and `WRUN_TRANSIENT_FAILURE_CAUSES:` lines of
7
+ * docs/features/diagnostics/analytics-taxonomy/events.md. Never message text: a cause is one of these words, or
8
+ * `server:<row>` for a cloud answer, where `<row>` is an answer-table row id (wrun-hosted-wire-caps
9
+ * `WRUN_SERVER_ANSWER_ROW_IDS`, listed on the same page's `WRUN_FAILURE_SERVER_ROWS:` line). The refusal record
10
+ * reads it off a failure (wrun-refusal.util `wrunFailureCauseOf`) and carries it at `refusal.telemetry.cause`.
11
+ */
12
+ import { type WrunServerAnswerRowId } from './wrun-hosted-wire-caps.js';
13
+ export declare const WRUN_FAILURE_CAUSES: readonly ["no-reply", "session-kicked", "connection-unavailable", "connection-lost", "dial-failed", "socket-stale", "worker-restarted", "chart-gone", "capability-unavailable", "request-timeout", "paging-incomplete", "aborted", "superseded", "access-denied", "session-expired", "backend-unavailable", "reply-unreadable", "worker-dead", "chunk-load", "network", "none", "other"];
14
+ export type WrunFailureBaseCause = (typeof WRUN_FAILURE_CAUSES)[number];
15
+ /** A cloud answer's cause: `server:` and the answer-table row the frame matched. */
16
+ export type WrunFailureServerCause = `server:${WrunServerAnswerRowId}`;
17
+ export type WrunFailureCause = WrunFailureBaseCause | WrunFailureServerCause;
18
+ /**
19
+ * The causes a later attempt usually gets past without the person doing anything: the connection, the permission,
20
+ * the worker or the network was briefly unavailable. A refusal with one of these causes waits out the transient grace
21
+ * (wrun-transient-rerun.util) before it shows. A cloud answer the answer table retries (`server:<row>` of a `retry`
22
+ * row: `[INTERNAL]`, the rate limit, a busy rebind) is transient too (`isWrunTransientFailureCause`), except a cap the
23
+ * person must act on (WRUN_PERSON_ACTION_SERVER_ROWS).
24
+ */
25
+ export declare const WRUN_TRANSIENT_FAILURE_CAUSES: readonly WrunFailureBaseCause[];
26
+ /**
27
+ * The answer-table rows that retry but wait on the person, never on time: the tab's foreign-source and instance caps
28
+ * (`tab-full`) clear only once an overlay leaves the tab, so no rerun inside a grace gets past them. Their refusal
29
+ * (with Retry) shows at once.
30
+ */
31
+ export declare const WRUN_PERSON_ACTION_SERVER_ROWS: readonly WrunServerAnswerRowId[];
32
+ /** The cause of a cloud answer by the answer-table row that read it. */
33
+ export declare function wrunServerFailureCause(row: WrunServerAnswerRowId): WrunFailureServerCause;
34
+ /** True for a word of the closed set: a base cause, or `server:` and a row id of the answer table. */
35
+ export declare function isWrunFailureCause(value: unknown): value is WrunFailureCause;
36
+ /** True when a refusal with this cause should wait out the transient grace before it shows: a transient base cause,
37
+ * or a cloud answer whose answer-table row says the same ask may pass (`retry`) without the person acting first
38
+ * (never a row of WRUN_PERSON_ACTION_SERVER_ROWS). */
39
+ export declare function isWrunTransientFailureCause(cause: string | null | undefined): boolean;
@@ -0,0 +1,94 @@
1
+ /**
2
+ * Why a wrun run failed, as one closed word every failure event carries (`feature:failed`, `wrun_lane_mount`,
3
+ * `wrun_failure_shown`): the attempt reason says what kind of failure it was, the cause says what produced it, so a
4
+ * readout can tell a dropped socket from a slow permission or a server refusal without joining server logs.
5
+ *
6
+ * Closed set, pinned two-way on the `WRUN_FAILURE_CAUSES:` and `WRUN_TRANSIENT_FAILURE_CAUSES:` lines of
7
+ * docs/features/diagnostics/analytics-taxonomy/events.md. Never message text: a cause is one of these words, or
8
+ * `server:<row>` for a cloud answer, where `<row>` is an answer-table row id (wrun-hosted-wire-caps
9
+ * `WRUN_SERVER_ANSWER_ROW_IDS`, listed on the same page's `WRUN_FAILURE_SERVER_ROWS:` line). The refusal record
10
+ * reads it off a failure (wrun-refusal.util `wrunFailureCauseOf`) and carries it at `refusal.telemetry.cause`.
11
+ */
12
+ import { WRUN_SERVER_ANSWER_ROW_IDS, wrunServerAnswerRowVerdict, } from './wrun-hosted-wire-caps.js';
13
+ export const WRUN_FAILURE_CAUSES = Object.freeze([
14
+ 'no-reply',
15
+ 'session-kicked',
16
+ 'connection-unavailable',
17
+ 'connection-lost',
18
+ 'dial-failed',
19
+ 'socket-stale',
20
+ 'worker-restarted',
21
+ 'chart-gone',
22
+ 'capability-unavailable',
23
+ 'request-timeout',
24
+ 'paging-incomplete',
25
+ 'aborted',
26
+ 'superseded',
27
+ 'access-denied',
28
+ 'session-expired',
29
+ 'backend-unavailable',
30
+ 'reply-unreadable',
31
+ 'worker-dead',
32
+ 'chunk-load',
33
+ 'network',
34
+ 'none',
35
+ 'other',
36
+ ]);
37
+ /**
38
+ * The causes a later attempt usually gets past without the person doing anything: the connection, the permission,
39
+ * the worker or the network was briefly unavailable. A refusal with one of these causes waits out the transient grace
40
+ * (wrun-transient-rerun.util) before it shows. A cloud answer the answer table retries (`server:<row>` of a `retry`
41
+ * row: `[INTERNAL]`, the rate limit, a busy rebind) is transient too (`isWrunTransientFailureCause`), except a cap the
42
+ * person must act on (WRUN_PERSON_ACTION_SERVER_ROWS).
43
+ */
44
+ export const WRUN_TRANSIENT_FAILURE_CAUSES = Object.freeze([
45
+ 'no-reply',
46
+ 'session-kicked',
47
+ 'connection-unavailable',
48
+ 'connection-lost',
49
+ 'dial-failed',
50
+ 'socket-stale',
51
+ 'worker-restarted',
52
+ 'capability-unavailable',
53
+ 'request-timeout',
54
+ 'paging-incomplete',
55
+ 'aborted',
56
+ 'backend-unavailable',
57
+ 'network',
58
+ ]);
59
+ /**
60
+ * The answer-table rows that retry but wait on the person, never on time: the tab's foreign-source and instance caps
61
+ * (`tab-full`) clear only once an overlay leaves the tab, so no rerun inside a grace gets past them. Their refusal
62
+ * (with Retry) shows at once.
63
+ */
64
+ export const WRUN_PERSON_ACTION_SERVER_ROWS = Object.freeze(['tab-full']);
65
+ const SERVER_PREFIX = 'server:';
66
+ const PERSON_ACTION_ROWS = new Set(WRUN_PERSON_ACTION_SERVER_ROWS);
67
+ const BASE_CAUSES = new Set(WRUN_FAILURE_CAUSES);
68
+ const TRANSIENT_CAUSES = new Set(WRUN_TRANSIENT_FAILURE_CAUSES);
69
+ const SERVER_ROWS = new Set(WRUN_SERVER_ANSWER_ROW_IDS);
70
+ /** The cause of a cloud answer by the answer-table row that read it. */
71
+ export function wrunServerFailureCause(row) {
72
+ return `${SERVER_PREFIX}${row}`;
73
+ }
74
+ /** True for a word of the closed set: a base cause, or `server:` and a row id of the answer table. */
75
+ export function isWrunFailureCause(value) {
76
+ if (typeof value !== 'string')
77
+ return false;
78
+ if (BASE_CAUSES.has(value))
79
+ return true;
80
+ return value.startsWith(SERVER_PREFIX) && SERVER_ROWS.has(value.slice(SERVER_PREFIX.length));
81
+ }
82
+ /** True when a refusal with this cause should wait out the transient grace before it shows: a transient base cause,
83
+ * or a cloud answer whose answer-table row says the same ask may pass (`retry`) without the person acting first
84
+ * (never a row of WRUN_PERSON_ACTION_SERVER_ROWS). */
85
+ export function isWrunTransientFailureCause(cause) {
86
+ if (typeof cause !== 'string')
87
+ return false;
88
+ if (TRANSIENT_CAUSES.has(cause))
89
+ return true;
90
+ if (!cause.startsWith(SERVER_PREFIX))
91
+ return false;
92
+ const row = cause.slice(SERVER_PREFIX.length);
93
+ return SERVER_ROWS.has(row) && !PERSON_ACTION_ROWS.has(row) && wrunServerAnswerRowVerdict(row) === 'retry';
94
+ }
@@ -22,6 +22,7 @@ import type { WrunFontWeight, WrunLevels, WrunMatrix, WrunPanel, WrunPanelGuide,
22
22
  import { type ParsedPanel } from '../chart/om-panel.util.js';
23
23
  import type { FeedLine, LadderProps, LadderRow } from '../chart/om-widget.util.js';
24
24
  import type { WrunMiniChartsFrame } from '@orangecharts/indicator-kit/host';
25
+ import { type WrunRowMarket } from './wrun-row-market.util.js';
25
26
  export declare const WRUN_FRAME_DEFAULT_MAX_BYTES = 98304;
26
27
  export declare const WRUN_FRAME_MAX_SLOTS = 8;
27
28
  /** Rows per levels frame on the pane dock, and per span (g2, g6). */
@@ -107,11 +108,13 @@ export interface WrunLadderFrame {
107
108
  divider?: LadderProps['divider'];
108
109
  title?: string;
109
110
  }
110
- /** A feed frame: 1..50 lines of [time ms, text, colour word?] and an
111
- * optional per-run title (DW15). */
111
+ /** A feed frame: 1..50 lines of [time ms, text, colour word?], an optional
112
+ * per-run title (DW15) and optional markets, one per line (UW-PARITY H4,
113
+ * wrun-row-market.util): the market a click on the line opens. */
112
114
  export interface WrunFeedFrame {
113
115
  lines: FeedLine[];
114
116
  title?: string;
117
+ markets?: (WrunRowMarket | null)[];
115
118
  }
116
119
  /** A heatmap summary row (SC18, frame only): values follow the columns in
117
120
  * first-seen order. */
@@ -141,6 +144,9 @@ export interface WrunPanelFrameChrome {
141
144
  summary?: WrunPanelSummaryRow[];
142
145
  hole_text?: string;
143
146
  hole_caption?: string;
147
+ /** A table's rows' markets (UW-PARITY H4), one per row: null or the market
148
+ * a click on the row opens (wrun-row-market.util). */
149
+ markets?: (WrunRowMarket | null)[];
144
150
  }
145
151
  export type WrunPanelFrameWord = keyof WrunPanelFrameChrome;
146
152
  /** A styled matrix cell: at least one field. */
@@ -2,6 +2,7 @@ import { isPanelClearFrame, parseSetPanelData } from '../chart/om-panel.util.js'
2
2
  import { wrunChartHostEnv } from '../../host-env.js';
3
3
  import { isWrunColorWord, WRUN_FONT_WEIGHTS } from './wrun-style-words.util.js';
4
4
  import { wrunPlainText } from './wrun-text-params.util.js';
5
+ import { parseWrunRowMarkets, wrunRowMarketsLengthMessage } from './wrun-row-market.util.js';
5
6
  export const WRUN_FRAME_DEFAULT_MAX_BYTES = 98_304;
6
7
  export const WRUN_FRAME_MAX_SLOTS = 8;
7
8
  // ---------------------------------------------------------------------------
@@ -387,6 +388,7 @@ export const WRUN_PANEL_FRAME_WORD_KINDS = {
387
388
  summary: ['heatmap'],
388
389
  hole_text: ['pie'],
389
390
  hole_caption: ['pie'],
391
+ markets: ['table'],
390
392
  };
391
393
  const PANEL_FRAME_WORDS = Object.keys(WRUN_PANEL_FRAME_WORD_KINDS);
392
394
  /** The frame keys this panel's kind accepts beside `rows`. */
@@ -709,6 +711,15 @@ export function parseWrunPanelChrome(frame, declaration, slot) {
709
711
  case 'hole_caption':
710
712
  chrome[word] = panelText(value, word, WRUN_PANEL_MAX_LABEL_CHARS, at, [word]);
711
713
  break;
714
+ case 'markets': {
715
+ // The entries here; their count against the rows once the rows parsed (parseWrunPanelFrame).
716
+ const parsed = parseWrunRowMarkets(value, 'row', Array.isArray(value) ? value.length : 0);
717
+ if ('message' in parsed)
718
+ at(parsed.path, parsed.message);
719
+ else
720
+ chrome.markets = parsed.markets;
721
+ break;
722
+ }
712
723
  }
713
724
  }
714
725
  refinePanelChrome(declaration, chrome, at);
@@ -736,13 +747,16 @@ export function parseWrunPanelFrame(raw, slot, declaration) {
736
747
  return invalidWrunFrame(slot, result.rejectReason);
737
748
  if (isPanelClearFrame(result.data))
738
749
  return invalidWrunFrame(slot, 'unexpected clear frame');
750
+ if (chrome.markets !== undefined && chrome.markets.length !== result.data.rows.length) {
751
+ refuser(slot)(['markets'], wrunRowMarketsLengthMessage('row', result.data.rows.length));
752
+ }
739
753
  return Object.keys(chrome).length > 0 ? { ...result.data, chrome } : result.data;
740
754
  }
741
755
  // ---------------------------------------------------------------------------
742
756
  // Ladder and feed frames (g3 DW15, DW38)
743
757
  // ---------------------------------------------------------------------------
744
758
  const LADDER_KEYS = ['rows', 'divider', 'title'];
745
- const FEED_KEYS = ['lines', 'title'];
759
+ const FEED_KEYS = ['lines', 'title', 'markets'];
746
760
  const DIVIDER_KEYS = ['label', 'price'];
747
761
  const WIDGET_TITLE_MESSAGE = `title takes 1 to ${WRUN_MAX_WIDGET_TITLE_CHARS} characters`;
748
762
  function widgetTitle(value, at) {
@@ -793,7 +807,7 @@ export function parseWrunFeedFrame(raw, slot) {
793
807
  const unknown = unknownKey(frame, FEED_KEYS);
794
808
  if (unknown !== undefined)
795
809
  at([], `unknown frame key '${unknown}'`);
796
- const { lines, title } = frame;
810
+ const { lines, title, markets } = frame;
797
811
  if (!Array.isArray(lines) || lines.length < 1 || lines.length > WRUN_MAX_FEED_LINES) {
798
812
  return invalidWrunFrame(slot, `lines must contain 1..${WRUN_MAX_FEED_LINES} feed entries`);
799
813
  }
@@ -811,7 +825,19 @@ export function parseWrunFeedFrame(raw, slot) {
811
825
  at(['lines', k, 2], WRUN_COLOR_WORD_MESSAGE);
812
826
  return [...line];
813
827
  });
814
- return { lines: parsedLines, ...(title !== undefined ? { title: widgetTitle(title, at) } : {}) };
828
+ let parsedMarkets;
829
+ if (markets !== undefined) {
830
+ const parsed = parseWrunRowMarkets(markets, 'line', parsedLines.length);
831
+ if ('message' in parsed)
832
+ at(parsed.path, parsed.message);
833
+ else
834
+ parsedMarkets = parsed.markets;
835
+ }
836
+ return {
837
+ lines: parsedLines,
838
+ ...(title !== undefined ? { title: widgetTitle(title, at) } : {}),
839
+ ...(parsedMarkets !== undefined ? { markets: parsedMarkets } : {}),
840
+ };
815
841
  }
816
842
  // ---------------------------------------------------------------------------
817
843
  // Matrix frames (g6 MX-price-matrix)
@@ -131,8 +131,9 @@ export interface WrunServerAnswerFrame {
131
131
  /** One frame's verdict and what decided it. */
132
132
  export interface WrunServerAnswer {
133
133
  verdict: WrunServerAnswerVerdict;
134
- /** The table row that decided (the catalog spec and the debug ring name it). */
135
- row: string;
134
+ /** The table row that decided (the catalog spec and the debug ring name it; a failure's cause names it as
135
+ * `server:<row>`, wrun-failure-cause). */
136
+ row: WrunServerAnswerRowId;
136
137
  /** The frame's own code, when it carried one. */
137
138
  frameCode?: string;
138
139
  /** The refusal the frame names: its relayed details, an older server's leading code, the no-candles answer. */
@@ -146,6 +147,167 @@ export interface WrunServerAnswer {
146
147
  /** No row knows the frame's code (or the refusal's): shown as a refusal that names it. */
147
148
  unknownCode?: true;
148
149
  }
150
+ /**
151
+ * The table, first match wins, one row per answer of kscript-backend's catalog. The order keeps the precedence
152
+ * the readers kept before it existed: a superseded create first; the answers off the request path by their
153
+ * reason; the retried refusals on any frame; `INTERNAL` and `FORBIDDEN` over any refusal they carry; the
154
+ * remembered refusals; an eligibility frame over the kit's stage of a refusal it carries; the kit's stages; then
155
+ * the uncoded frames by code and sentence, and the fallback. Its row ids are the closed set a failure's cause
156
+ * names a cloud answer by (`server:<row>`, WRUN_SERVER_ANSWER_ROW_IDS below): typed from the rows themselves, so a
157
+ * row added here is a cause word with no second list to keep.
158
+ */
159
+ declare const WRUN_SERVER_ANSWER_ROWS: readonly [{
160
+ readonly id: "superseded";
161
+ readonly verdict: "stale";
162
+ readonly reason: "superseded";
163
+ }, {
164
+ readonly id: "superseded-run";
165
+ readonly verdict: "stale";
166
+ readonly codes: ReadonlySet<string>;
167
+ readonly message: RegExp;
168
+ }, {
169
+ readonly id: "superseded-preflight";
170
+ readonly verdict: "stale";
171
+ readonly codes: ReadonlySet<string>;
172
+ readonly message: RegExp;
173
+ }, {
174
+ readonly id: "source-withdrawn";
175
+ readonly verdict: "show";
176
+ readonly reason: "source-access-withdrawn";
177
+ }, {
178
+ readonly id: "test-run-busy";
179
+ readonly verdict: "retry";
180
+ readonly reason: "wrun-test-run-busy";
181
+ }, {
182
+ readonly id: "test-run";
183
+ readonly verdict: "show";
184
+ readonly reason: ReadonlySet<string>;
185
+ }, {
186
+ readonly id: "no-candles";
187
+ readonly verdict: "retry";
188
+ readonly refusal: ReadonlySet<string>;
189
+ }, {
190
+ readonly id: "tab-full";
191
+ readonly verdict: "retry";
192
+ readonly refusal: ReadonlySet<string>;
193
+ }, {
194
+ readonly id: "rebind-busy";
195
+ readonly verdict: "retry";
196
+ readonly refusal: ReadonlySet<string>;
197
+ }, {
198
+ readonly id: "internal";
199
+ readonly verdict: "retry";
200
+ readonly codes: ReadonlySet<string>;
201
+ }, {
202
+ readonly id: "capability-denied";
203
+ readonly verdict: "retry";
204
+ readonly codes: ReadonlySet<string>;
205
+ readonly reason: "capability-invalid";
206
+ }, {
207
+ readonly id: "capability-denied-words";
208
+ readonly verdict: "retry";
209
+ readonly codes: ReadonlySet<string>;
210
+ readonly message: RegExp;
211
+ }, {
212
+ readonly id: "enterprise-principal";
213
+ readonly verdict: "fatal";
214
+ readonly codes: ReadonlySet<string>;
215
+ readonly message: RegExp;
216
+ }, {
217
+ readonly id: "forbidden";
218
+ readonly verdict: "show";
219
+ readonly codes: ReadonlySet<string>;
220
+ }, {
221
+ readonly id: "window-sized";
222
+ readonly verdict: "show";
223
+ readonly refusal: ReadonlySet<string>;
224
+ readonly memory: "window";
225
+ }, {
226
+ readonly id: "identity";
227
+ readonly verdict: "show";
228
+ readonly refusal: ReadonlySet<string>;
229
+ readonly memory: "identity";
230
+ }, {
231
+ readonly id: "source-unsupported";
232
+ readonly verdict: "show";
233
+ readonly codes: ReadonlySet<string>;
234
+ readonly memory: "identity";
235
+ }, {
236
+ readonly id: "eligibility";
237
+ readonly verdict: "show";
238
+ readonly codes: ReadonlySet<string>;
239
+ }, {
240
+ readonly id: "support-protocol";
241
+ readonly verdict: "fatal";
242
+ readonly codes: ReadonlySet<string>;
243
+ }, {
244
+ readonly id: "coded";
245
+ readonly verdict: "show";
246
+ readonly refusal: "known";
247
+ }, {
248
+ readonly id: "coded-unknown";
249
+ readonly verdict: "show";
250
+ readonly refusal: "any";
251
+ readonly unknownCode: true;
252
+ }, {
253
+ readonly id: "malformed-request";
254
+ readonly verdict: "fatal";
255
+ readonly codes: ReadonlySet<string>;
256
+ readonly message: RegExp;
257
+ }, {
258
+ readonly id: "latest-too-large";
259
+ readonly verdict: "fatal";
260
+ readonly codes: ReadonlySet<string>;
261
+ readonly message: RegExp;
262
+ }, {
263
+ readonly id: "bad-request-transient";
264
+ readonly verdict: "retry";
265
+ readonly codes: ReadonlySet<string>;
266
+ readonly message: RegExp;
267
+ }, {
268
+ readonly id: "latest-busy";
269
+ readonly verdict: "retry";
270
+ readonly codes: ReadonlySet<string>;
271
+ readonly message: RegExp;
272
+ }, {
273
+ readonly id: "bad-request";
274
+ readonly verdict: "show";
275
+ readonly codes: ReadonlySet<string>;
276
+ }, {
277
+ readonly id: "token-expired";
278
+ readonly verdict: "retry";
279
+ readonly codes: ReadonlySet<string>;
280
+ readonly message: RegExp;
281
+ }, {
282
+ readonly id: "unauthorized";
283
+ readonly verdict: "show";
284
+ readonly codes: ReadonlySet<string>;
285
+ }, {
286
+ readonly id: "script-timeout";
287
+ readonly verdict: "show";
288
+ readonly codes: ReadonlySet<string>;
289
+ }, {
290
+ readonly id: "protocol";
291
+ readonly verdict: "fatal";
292
+ readonly codes: ReadonlySet<string>;
293
+ }];
294
+ /** The answer for a frame code no row knows: a refusal shown with its code. */
295
+ declare const UNKNOWN_CODE_ROW: {
296
+ readonly id: "unknown-code";
297
+ readonly verdict: "show";
298
+ readonly unknownCode: true;
299
+ };
300
+ /** The id of an answer-table row: one of the table's rows, or the fallback for a code no row knows. */
301
+ export type WrunServerAnswerRowId = (typeof WRUN_SERVER_ANSWER_ROWS)[number]['id'] | (typeof UNKNOWN_CODE_ROW)['id'];
302
+ /**
303
+ * Every answer-table row id, in the table's order with the fallback last: the closed set a cloud answer's failure
304
+ * cause names (`server:<row>`, wrun-failure-cause). docs/features/diagnostics/analytics-taxonomy/events.md lists
305
+ * them on its `WRUN_FAILURE_SERVER_ROWS:` line, pinned two-way by tests/utility/wrun/wrun-failure-cause.util.spec.ts.
306
+ */
307
+ export declare const WRUN_SERVER_ANSWER_ROW_IDS: readonly WrunServerAnswerRowId[];
308
+ /** The verdict an answer-table row gives (`retry`: the same ask may pass), or undefined for a word that names no
309
+ * row. */
310
+ export declare function wrunServerAnswerRowVerdict(row: string): WrunServerAnswerVerdict | undefined;
149
311
  /**
150
312
  * The verdict of one error frame (see the table above): undefined for a value that names neither a frame code
151
313
  * nor a coded refusal (no server answer at all). A frame code no row knows answers `show` with `unknownCode`.
@@ -216,3 +378,4 @@ export declare function wrunForeignSupersedeOf(output: unknown): WrunStaleAnswer
216
378
  export declare function onWrunAnswerStale(note: WrunStaleAnswerNote): void;
217
379
  /** Subscribe to the stale-settle hook (onWrunAnswerStale); returns the unsubscribe. */
218
380
  export declare function subscribeWrunAnswerStale(listener: (note: WrunStaleAnswerNote) => void): () => void;
381
+ export {};
@@ -258,7 +258,9 @@ const codes = (...names) => new Set(names);
258
258
  * the readers kept before it existed: a superseded create first; the answers off the request path by their
259
259
  * reason; the retried refusals on any frame; `INTERNAL` and `FORBIDDEN` over any refusal they carry; the
260
260
  * remembered refusals; an eligibility frame over the kit's stage of a refusal it carries; the kit's stages; then
261
- * the uncoded frames by code and sentence, and the fallback.
261
+ * the uncoded frames by code and sentence, and the fallback. Its row ids are the closed set a failure's cause
262
+ * names a cloud answer by (`server:<row>`, WRUN_SERVER_ANSWER_ROW_IDS below): typed from the rows themselves, so a
263
+ * row added here is a cause word with no second list to keep.
262
264
  */
263
265
  const WRUN_SERVER_ANSWER_ROWS = [
264
266
  // A create the server superseded: the reason a newer server names, else the sentence it answers with.
@@ -335,7 +337,23 @@ const WRUN_SERVER_ANSWER_ROWS = [
335
337
  { id: 'protocol', verdict: 'fatal', codes: codes('NOT_FOUND', 'TIME_RANGE_INVALID', 'UNKNOWN_MESSAGE') },
336
338
  ];
337
339
  /** The answer for a frame code no row knows: a refusal shown with its code. */
338
- const UNKNOWN_CODE_ROW = { id: 'unknown-code', verdict: 'show', unknownCode: true };
340
+ const UNKNOWN_CODE_ROW = {
341
+ id: 'unknown-code',
342
+ verdict: 'show',
343
+ unknownCode: true,
344
+ };
345
+ /**
346
+ * Every answer-table row id, in the table's order with the fallback last: the closed set a cloud answer's failure
347
+ * cause names (`server:<row>`, wrun-failure-cause). docs/features/diagnostics/analytics-taxonomy/events.md lists
348
+ * them on its `WRUN_FAILURE_SERVER_ROWS:` line, pinned two-way by tests/utility/wrun/wrun-failure-cause.util.spec.ts.
349
+ */
350
+ export const WRUN_SERVER_ANSWER_ROW_IDS = Object.freeze([...WRUN_SERVER_ANSWER_ROWS, UNKNOWN_CODE_ROW].map((row) => row.id));
351
+ const ROW_VERDICTS = new Map([...WRUN_SERVER_ANSWER_ROWS, UNKNOWN_CODE_ROW].map((row) => [row.id, row.verdict]));
352
+ /** The verdict an answer-table row gives (`retry`: the same ask may pass), or undefined for a word that names no
353
+ * row. */
354
+ export function wrunServerAnswerRowVerdict(row) {
355
+ return ROW_VERDICTS.get(row);
356
+ }
339
357
  function textOf(value) {
340
358
  return typeof value === 'string' && value !== '' ? value : undefined;
341
359
  }
@@ -34,7 +34,10 @@ export interface WrunHostedRunLevel {
34
34
  * served from the history wall, `{ fetchKey, askedStartMs, servedStartMs, note }`, on a create or range reply
35
35
  * only), unread; absent when it has none. */
36
36
  wrunServedLegs?: unknown;
37
+ /** The reply's OPRA mark (UW-PARITY contract opra-server-lanes 10b): true when the run's plan reads OPRA, on every
38
+ * frame of such a run. Only the JSON boolean `true` counts; anything else reads as absent. */
39
+ wrunOpra?: true;
37
40
  }
38
- /** Read a reply's run-level keys beside the wire: each own key exactly as the reply carries it, never a key
39
- * inside `wrunHost`. A reply that is not a record carries none. */
41
+ /** Read a reply's run-level keys beside the wire: each own key exactly as the reply carries it (the OPRA mark only as
42
+ * the boolean `true`), never a key inside `wrunHost`. A reply that is not a record carries none. */
40
43
  export declare function readWrunHostedRunLevel(output: unknown): WrunHostedRunLevel;
@@ -6,8 +6,8 @@ export async function readWrunHostedWire(output) {
6
6
  const { decodeWrunHostedWire } = await wrunChartHostEnv().loadSharedHost();
7
7
  return decodeWrunHostedWire(output);
8
8
  }
9
- /** Read a reply's run-level keys beside the wire: each own key exactly as the reply carries it, never a key
10
- * inside `wrunHost`. A reply that is not a record carries none. */
9
+ /** Read a reply's run-level keys beside the wire: each own key exactly as the reply carries it (the OPRA mark only as
10
+ * the boolean `true`), never a key inside `wrunHost`. A reply that is not a record carries none. */
11
11
  export function readWrunHostedRunLevel(output) {
12
12
  if (!isRecord(output))
13
13
  return {};
@@ -20,6 +20,8 @@ export function readWrunHostedRunLevel(output) {
20
20
  if (Object.hasOwn(output, 'wrunServedLegs') && output.wrunServedLegs !== undefined) {
21
21
  level.wrunServedLegs = output.wrunServedLegs;
22
22
  }
23
+ if (Object.hasOwn(output, 'wrunOpra') && output.wrunOpra === true)
24
+ level.wrunOpra = true;
23
25
  return level;
24
26
  }
25
27
  function isRecord(value) {