Story: ores.shell command for market data import

Table of Contents

This page documents a story in Sprint 22. It captures the goal, current status, acceptance criteria, and the tasks that compose it.

Goal

import_market_data_request (projects/ores.marketdata/api/include/ores.marketdata.api/messaging/import_protocol.hpp, served by ores.marketdata.core::service::import_service) is only ever triggered by the Qt ImportTradeDialog (projects/ores.qt/trading/src/ImportTradeDialog.cpp) — there's no non-interactive way to run a market data import. This blocks Synthetic data collections: Basic and Realistic's "import the 2016-02-05 vintage" task, and more generally blocks any scripted or provisioning-time import. Add an ores.shell command that reads a market.txt=/=fixings.txt file (or stdin) and an optional source tag, and sends the same import_market_data_request over NATS that the Qt dialog already sends.

Status

Field Value
State DONE
Parent sprint Sprint 22
Now Done — all tasks closed.
Waiting on Nothing.
Next Nothing.
Last touched 2026-07-04

Acceptance

  • A new ores.shell command (e.g. marketdata import --file <path> [--fixings <path>] [--source <tag>]) sends an import_market_data_request over NATS via the existing shell client infrastructure, reusing import_service as-is — no new server-side code.
  • Running it against a representative ORE example vintage with --source ore.reference produces the expected series_count=/=observation_count response and queryable market_observation rows. Met against Academy/TA002_IR_Swap and MarketRisk/HistSimVar; Legacy/Example_56 specifically still fails on a separate, pre-existing import_service bug tracked at Full market.txt import hits duplicate observation key.
  • Documented in a recipe (doc/recipes/), following existing ores.shell command documentation conventions.

Tasks

Task State Start End Description
Implement ores.shell market data import command DONE 2026-07-04 2026-07-04 Add a shell command sending import_market_data_request (file/stdin content, optional source tag) over NATS, reusing the existing import_service.

Decisions

  • Command sends the whole file (or files) in one import_market_data_request, matching what ImportTradeDialog already sends — no chunking or streaming, since import_service already handles the full parse/persist server-side.
  • Reused bundles_commands.cpp's process_publish as the template for the parse_args → authenticated_request → rfl::json round-trip shape, keeping a local per-file do_auth_request<Response> helper rather than extracting a shared one (matches existing convention: no shared helper exists across command files today).
  • Documented against three representative ORE example vintages rather than only the story's originally-named Legacy/Example_56, since that vintage's full file hits a separate, pre-existing import_service bug — captured rather than silently worked around.

Out of scope

Emacs 29.3 (Org mode 9.6.15)