Story: Entity classification and drift baseline: ores.trading

Table of Contents

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

1. Goal

Bring ores.trading to the same proven state as the ores.refdata pilot: every codegen-eligible entity (discovered once, under projects/ores.trading/modeling – the trade and trading-cpp catalogue entries share the same modeling_dir and no longer have a live legacy-JSON split, so this is one survey, not two) bound to a profile or recorded as a genuine no-match, zero-diff regeneration verified, and any real gap the check surfaces fixed rather than skipped. Once trusted, trade and trading-cpp are added to the CI regeneration-drift check.

2. Status

Field Value
State DONE
Parent sprint Sprint 25
Now Nothing.
Waiting on Nothing.
Next Merge the bind PR, then post-merge system testing per task phase 5.
Last touched 2026-09-06

3. Acceptance

  • Every ores.trading entity is bound to a matching Variability Profile, or recorded as a genuine no-match with a documented reason.
  • Every rebound entity is regenerated and diffed against its pre-rebind checked-in output; zero diff is the pass condition, and any non-zero diff is fixed, not worked around.
  • Full local build clean, validate_schemas.sh green, full ctest suite green after regeneration.
  • check_component_drift.py –components is extended to include trade and trading-cpp, and the refdata-codegen-drift CI job is updated so future PRs touching ores.trading fail on any regeneration drift.
  • The superseded ad hoc task 'Apply safe drift to trading-cpp' is marked ABANDONED, pointing here.
  • The known starting-point wrinkles already recorded for trading-cpp (service_pagination/service_batch_get flags, per-model flags on 21 instrument and lookup entities, restoring documented exclusions trade_service and fra_instrument_service) are resolved as part of reaching zero drift, not left outstanding.

4. Tasks

Task State Start End Description
Bind ores.trading entities to profiles; verify zero-diff regen DONE 2026-09-06 2026-09-06 Implement profile binding for ores.trading's org-mode entity set (trade and trading-cpp catalogue entries share the same modeling_dir), rebind every matching entity, regenerate, and confirm byte-identical output, following the ores.refdata pilot method exactly.

5. Decisions

  • Trade and trading-cpp stay out of the known-drift-free registry (2026-09-06). The CI-extension acceptance is reframed: trade's hand-authored whole estate – five-way rfl::Flatten composition beyond org vocabulary, bespoke trade_service=/=trade_handler=/ =fra_instrument_service, nine Qt files – is not org-reproducible (37 clobbered outputs measured at bind, commit 4a02aeca6f), so registering either catalogue entry would make the drift check fail by construction. The registry stays seeded with refdata,reporting,marketdata,compute-cpp,iam,iam-cpp, re-verified green (--all exit 0, clean tree) under this branch's generator changes. Registry entry for trading awaits an estate rework story.
  • A genuine no-match with recorded feature values beats a forced bind (2026-09-06). trade_party_role (no uuid detail-form widget in the Qt drawer vocabulary for non-null soft-FK columns), trade_identifier (uuid-identified-lookup features vs string natural key) and trade (whole estate) stay unbound with their exclusions documented and, for trade, verified by measured clobber rather than assumed.
  • Repository entity headers emit org "Entity includes" blocks through a standard-token filter (2026-09-06). The filter drops the template's own tokens plus legacy staleness (sqlgen/Timestamp.hpp arrives via db_types.hpp; boost/uuid/uuid.hpp is never needed because uuid columns and PK/FK sides render as std::string; <cstdint> is a stale transcription the canonical headers compile without), and the junction loader path applies the same set, so the registered components regenerate byte-identical. Includes the template cannot derive – e.g. trade_type's product_type.hpp – pass through verbatim. A real future need for a filtered header belongs in the template's fixed include set, not an org block.

6. Out of scope

Emacs 29.3 (Org mode 9.6.15)