Task: Namespace feed source_name/NATS subject by collection

Table of Contents

This page documents a task in the Synthetic data collections: Basic and Realistic story. It captures the goal, current status, acceptance, and any notes or results.

Goal

Today source_name=/NATS subjects are per-pair only (e.g. =synthetic.eurusd), so two collections configuring the same pair would collide. Prefix with the owning collection: synthetic.basic.eurusd / synthetic.realistic.eurusd, in projects/ores.synthetic/service/src/feed_controller.hpp and wherever source_name is derived/displayed in the Qt client (FxSpotRateEditor, MarketSimulatorWindow).

Status

Field Value
State DONE
Parent story Synthetic data collections: Basic and Realistic
Now Nothing.
Waiting on Nothing.
Next Nothing.
Last touched 2026-07-03

Acceptance

  • Running the same pair (e.g. EUR/USD) under both Basic and Realistic collections concurrently produces two distinct, non-colliding NATS subjects and market_observation.source values.
  • Existing single-collection deployments (ore_analytics) keep working — namespacing is additive, not a breaking rename without a migration path.

Plan

Delivered as two layers rather than one, once the real requirement became clear mid-implementation (the tree needed to show/act on the hierarchy, not just avoid subject collisions):

  1. source_name is now synthetic.<collection>.<pair> (e.g. synthetic.basic.eurusd / synthetic.realistic.eurusd), set both by ores_synthetic_publish_fx_spot_configs_from_dq_fn and by FxSpotRateEditor::defaultSourceName() for manual creation.
  2. A generic ores.synthetic.folder entity (self-referencing hierarchy, see the sibling folder/vintage-validity tasks) gives the collection/ asset-class/instrument-type structure real, queryable identity instead of being encoded in the string at all – source_name ended up staying a simple display/NATS-subject string once folder_id existed to carry the actual hierarchy.

Notes

PRs

PR Title
#1611 [synthetic] Generic folder hierarchy, folder-cascade start/stop, vintage-validity indicator

Review

Comment summary File Decision Notes
       

Result

Two collections (Basic + Realistic) verified concurrently side by side for the same party, correctly namespaced (synthetic.basic.*=/ =synthetic.realistic.*), no subject/source collisions. Superseded the original string-only design with a real folder hierarchy once it became clear the Market Simulator tree grouping and folder-scoped start/stop (sibling tasks) needed queryable structure, not just a namespaced string.

Emacs 29.3 (Org mode 9.6.15)