Task: Give each owning component its configuration document store

Table of Contents

This page documents a task in the Model the ORE report configuration as entities story. It captures the goal, current status, acceptance, and any notes or results.

1. Goal

Each component stores and reads its own configuration documents, and ores.ore holds only the mapping between ORE XML and those documents.

2. Status

Field Value
State DONE
Parent story Model the ORE report configuration as entities
Now Nothing.
Waiting on Nothing.
Next Nothing.
Last touched 2026-10-04

3. Acceptance

  • refdata owns the curve configuration and conventions document types and stores; analytics owns pricing engines and today's market; reporting owns the run document, its configuration rows and bindings.
  • The ores.ore mappers produce and consume the owners' document types.
  • The corpus round trips in ores.ore exercise every owner's store, and each owner tests the rules ORE does not drive: the run document's refusals and bindings in reporting, the world and party conventions rule in refdata.
  • ores.ore.core's run store calls the owners' services instead of their repositories; Package the run input through the owners' operations removes it.

4. Plan

(Implementation strategy. Written when work starts; key decisions are distilled into the parent story's * Decisions at close, but the plan itself stays — it is the historical record of what we did.)

5. Measurements

Every number this task claims about a tree, with the command that produced it and the commit it was measured at. A number without both is not a measurement, because a clean-up record describes a tree and trunk moves under a branch: a consumer count, a gate's component count and a suite's size all change with no code changing, and the reader of a bare number cannot tell which tree it came from. Where the raw output matters, put it in an evidence/ file beside the task and name that file in the Command column.

What Value Command Commit
       

6. Notes

Part of the redesign the operator asked for on 2026-10-04, after ruling that a service reading or writing another component's tables is an architectural error (No service reads or writes another component's tables). Order: this store move, the owners' operations, the import saga, then the package step.

7. Test Scenarios

Manual QA scenarios (scaffolded via compass add test_scenario) that verify this task. Link new ones here as they're created; the scenario doc itself links back via its "Verifies task" field.

Scenario State Notes
     

8. PRs

PR Title
#2624 [refdata,analytics,reporting] Store each configuration document in its owner

9. Review

# Comment summary File Decision Notes
1 get throws a bare out_of_range for an unknown parameter definition run_document_service.cpp Accept Throws a message naming the analytic and the definition id.
2 save is not atomic and two imports can race run_document_service.cpp Accept Written into the import saga task's acceptance, which is where it is fixed.
3 A parse error after the first write leaves a half-imported run run_store.cpp Accept Every document is parsed and mapped before the run document is saved; a test proves a run with an unparseable document writes nothing.
4 Convention reads scan whole tables; world conventions are never replaced conventions_document_service.cpp Decline Documented and tested; Read each document's rows by its parent covers the scans.
5 No owner-level tests for pricing engines, today's market and curves analytics, refdata Decline here Written into the operations task's acceptance: each owner tests its documents through its operations.
6 header_of copies the service run_store.cpp Accept Takes the service by reference.
7 Two conventions bindings give the same output run_store.cpp Decline By design: a conventions binding means the session's conventions.

10. Result

Each configuration document's type and store now live with the component that owns its tables, and ores.ore maps ORE XML to and from those types.

  • Types: refdata::domain::curve_configuration_document, conventions_document (with fx_convention), analytics::domain::pricing_engines_document, todays_market_document and reporting::domain::run_document (with run_analytic and run_parameter). The mapped_* structs in ores.ore are gone; the conventions mapper reports its unmodelled categories through its own function, since they are not stored data.
  • Stores: curve_configuration_document_service and conventions_document_service in refdata, which owns the world and party conventions rule; pricing_engines_document_service and todays_market_document_service in analytics; run_document_service in reporting, which also creates the configuration rows and their bindings.
  • assign_party and the document read helpers moved to ores.database, so the owners stamp parties without depending on ores.ore.
  • ores.ore.core's document_store is deleted. Its run_store calls the owners' services; it remains only until Package the run input through the owners' operations puts the package step on the owners' NATS operations.

The corpus round trips in ores.ore exercise every store; reporting and refdata test the rules ORE does not drive. ctest 90/90 after a database recreate.

Emacs 29.3 (Org mode 9.6.15)