Skip to content

Scenario-eval pipeline (charts/metrics + per-scenario words) is maintained but has no consumer #2824

Description

@thedavidmeister

Two subsystems that fed the removed tauri strategy studio are still on main — parsed, validated, tested, and type-exported — with nothing consuming them. The UI that drew each of them went away with the tauri app; the Rust behind both did not.

They are filed together because they are one decision, not two: is the studio coming back?

Part 1 — charts: / metrics: and the fuzz runner

file size tests
crates/settings/src/chart.rs 1,924 lines 14 #[test]
crates/settings/src/plot_source.rs 375 lines 3 #[test]
crates/common/src/fuzz/impls.rs 1,337 lines 11 #[tokio::test(flavor = "multi_thread", worker_threads = 10)]
crates/common/src/fuzz/mod.rs 79 lines

chart.rs still enforces ALLOWED_CHART_KEYS = ["metrics", "plots", "scenario"] and parses MetricCfg. crates/settings/src/yaml/dotrain.rs exposes get_charts(), get_chart(), get_chart_keys(). crates/common/src/fuzz defines FuzzRunner, FuzzRunnerContext, and the result shapes ChartData, FuzzResultFlat, DeploymentsDebugDataMap, DeploymentDebugData, DeploymentDebugPairData — each with impl_wasm_traits! and a Tsify derive, so TypeScript definitions are generated for all of them.

Those are exactly the shapes the removed studio's Charts and Debug tabs consumed.

Consumers: none. Grepping the whole tree for FuzzRunner, get_charts, ChartData and DeploymentsDebugDataMap returns hits in only crates/common/src/fuzz/* (itself) and crates/settings/src/yaml/dotrain.rs (the getters, plus one test at dotrain.rs:805). Nothing in crates/js_api, crates/cli, crates/integration_tests, or any .ts/.svelte. (PairTradesChartData and HistoricalOrderChartData in packages/ui-components/src/lib/services/ are locally-defined, unrelated types — trade history, not scenario evaluation.)

crates/js_api does depend on raindex_common, so pub mod fuzz still compiles into the wasm build and still emits its TS definitions — for an API surface with no caller on either side of the boundary.

A user can still write this today:

charts:
  buy-initial-deployment:
    scenario: polygon
    metrics:
      - label: Initial BLUE sold
        value: 0.0

It parses. It validates. Unknown keys are rejected by the sanitizer. Nothing draws it.

Part 2 — the per-scenario words resolvers

crates/common/src/dotrain_order.rs carries the pipeline that fed the studio's Words tab:

495  get_pragmas_for_scenario
511  get_contract_authoring_meta_v2_for_scenario
527  get_rainlang_words_for_scenario
542  get_pragma_words_for_scenario
563  get_all_words_for_scenario
597  get_all_scenarios_all_words

Consumers: none. All six have zero external references — nothing in crates/js_api, crates/cli, crates/quote, or any .ts/.svelte calls any of them. DotrainOrder itself is live (crates/js_api/src/raindex_order_builder/state_management.rs:91, registry.rs), but only via create() and other methods, never these.

Six tests (test_get_pragmas_for_scenario through test_get_all_scenarios_all_words, lines 1412–1694) exercise them on every CI pass.

There is a latent defect in here too, which is why this half matters beyond line count. get_all_scenarios_all_words loops get_scenario_keys() and ?-propagates, so one bad scenario kills the entire listing. Nested scenarios are supported by the config layer (scenario.rs:21 allows a nested scenarios key; 181-184 stores children under dotted parent.child keys), and the test at line 1694 uses two flat siblings — the nested path is untested. That is exactly the failure #969 reported before the UI was removed. Unreachable today, but it comes back the moment anything calls these again.

Why this is worth a decision rather than a shrug

Roughly 3,700 lines and 34 tests — 14 + 3 + 11 + 6 — are maintained and run on every CI pass for code no shipped surface reaches. They will keep passing while the thing they protect is unreachable, which is the state where a green suite stops meaning anything. And the config half is indistinguishable from a working feature right up until the user looks for the output.

Proposed fix

Decide which it is, and make the tree say so:

  • If the studio is coming back — say so in CLAUDE.md and the crate docs, so the next person reading chart.rs or dotrain_order.rs knows this is parked rather than live, and so nobody deletes it as dead. Fix the get_all_scenarios_all_words short-circuit and add nested-scenario coverage before it ships again, not after.
  • If it is not — remove chart.rs, plot_source.rs, crates/common/src/fuzz, the three DotrainYaml chart getters, and the six words resolvers with their tests; and reject charts: at parse time with an error saying the feature is gone, rather than silently accepting config that does nothing.

Either way ALLOWED_CHART_KEYS should stop silently accepting a section with no consumer.

Context

Found while ruling on two close-candidates, both now closed:

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions