Task: Migrate remaining ores.qt.refdata entities without a codegen model onto the generic HistoryDialog
Table of Contents
This page documents a task in the Migrate ores.qt.refdata onto the generic HistoryDialog story. It captures the goal, current status, acceptance, and any notes or results.
Goal
Retire the last 2 hand-rolled per-entity *HistoryDialog classes left
in projects/ores.qt/refdata once the codegen-model-backed batch
closed: floating_index_type and leg_type. Both had a codegen model
under ores.trading while their Qt controller (and all hand-written
NATS wiring) lived under ores.qt/refdata — the same organizational
mismatch Book/BusinessCentre had before their own moves. Resolved by
moving the backend to match, not the other way round: reassigned
#+component: to refdata in both models, relocated their
domain/repository/service/protocol/generator/eventing layers and SQL
table/schema from ores.trading to ores.refdata, then migrated via
the exact same full-regeneration process as every other entity in
this story.
2026-07-17 re-scope: this task was originally scoped to 17 entities
(this description said 5 model-backed + 12 model-less). Investigation
on pickup found that 15 of those 17 — payment_frequency_type (a
naming error; the actual entity, payment_frequency, already
migrated on 2026-07-15, before this task even existed) and all 14
DQ-owned entities (code_domain, dataset_bundle, and the 12
"model-less" ones) — are not ores.qt.refdata work at all. The 14 DQ
entities were already moved out of RefdataPlugin into
ores.qt.data_management by a prior task in this same story, which
this task's original scoping missed. See Notes for where that work
now lives. That leaves exactly floating_index_type and leg_type
as this task's actual scope.
Status
| Field | Value |
|---|---|
| State | DONE |
| Parent story | Migrate ores.qt.refdata onto the generic HistoryDialog |
| Now | Nothing. |
| Waiting on | Nothing. |
| Next | Nothing. |
| Last touched | 2026-07-17 |
Acceptance
floating_index_typeandleg_type's backend moved fromores.tradingtoores.refdata(model, domain, repository, service, protocol, generator, eventing, SQL create/drop/populate/RLS scripts) and migrated onto the genericHistoryDialogvia full codegen regeneration, following the same process as task 9605CFDB. ✅- Zero remaining
*HistoryDialog.{hpp,cpp,ui}files inprojects/ores.qt/refdatafor these two entities. ✅ - Full build green;
ores.refdata.*,ores.trading.*, andores.cli.testsall pass;validate_schemas.shzero warnings; DB recreates clean with both entities' seed data. ✅
Plan
Per entity (floating_index_type, then leg_type):
- Author a new
ores.refdata.modeling/ores.refdata.<entity>.orgmodel (#+component: refdata, all Qt-section request/response classes and includes renamed fromtrading::torefdata::),git rmthe oldores.tradingmodel file. - Add an explicit
Detail fieldstable (code,descriptiononly) — without one, a pre-existing codegen default-fields bug (core.py,Auto-generate default detail_fields if not provided) unconditionally injects anamefield even when the entity has nonamecolumn, breaking the build. Worked around at the model level rather than touching the shared codegen driver. compass codegen entity generate <entity>;git rmthe legacy per-entity*HistoryDialog.{hpp,cpp,ui}files (regeneration confirmed the controller wires the genericHistoryDialogdirectly).git rmthe now-supersededores.tradingbackend files (domain/repository/service/protocol/generator/eventing) and SQL create/drop/populate scripts; wire the freshly generated SQL intorefdata_create.sql=/=refdata_drop.sql=/=refdata_populate.sql(codegen doesn't auto-wire new entities into the schema manifests).- Wire the generated per-entity registrar/event-registrar/history
provider into
ores.refdata.core's sharedregistrar.cppandores.refdata.service'sevent_registrar.cpp(the same manual step every other refdata entity's own registration required — not automatic fromentity generate). - Fix
ores.trading's hand-writteninstrument_ref_handler.hpp=/ =registrar_trades.cpp, which also servedtrade_type(staying in trading) — removed only the two entities' methods/subscriptions, lefttrade_type's untouched. - Fix
ores.cli/src/app/application.cpp's hand-writtentrading::domain=/=trading::repositoryincludes and namespace usages (CLI support isn't part of the automatic codegen sweep). - Hand-patch
ores.trading.swap_leg's create SQL: its trigger callsores_trading_validate_{leg_type,floating_index_type}_fnby name (a hand-authored FK-validator, not part of the standard codegen template output) — renamed to the newores_refdata_validate_*_fnnames rather than regeneratingswap_legitself (explicit decision to avoid snowballing into an unrelated trading-entity regen). Moved/renamed the two validator create/drop files themselves fromores.sql/{create,drop}/trading/to.../refdata/, and removed the now-staleRLS_001ignore entries for the old trading table names fromvalidation_ignore.txt(replaced with real RLS policies inrefdata_rls_policies_create.sql, not another ignore entry — the "no exceptions" policy applies to RLS too). - Full rebuild (required a
cmake --presetreconfigure first — the file-glob-basedCMakeLists.txtdon't useCONFIGURE_DEPENDS, so a deleted source file needs an explicit reconfigure, not just a rebuild),db recreate,validate_schemas.sh, and theores.refdata=/=ores.trading=/ =ores.clitest suites.
Notes
Re-scope: 15 of the original 17 entities are not ores.qt.refdata work
Discovered on pickup (2026-07-17), before any migration work started:
payment_frequency_typedoesn't exist under that name — the actual entity ispayment_frequency, owned byores.refdataitself (ores.refdata.payment_frequency.org, created 2026-07-15). It already constructs the genericHistoryDialogdirectly inPaymentFrequencyController::showHistoryWindow— already migrated, nothing to do. (The original task description's "ores.trading" attribution for this one was simply wrong.)code_domain,dataset_bundle, and all 12 "no codegen model" entities (catalog,change_reason,change_reason_category,coding_scheme,coding_scheme_authority_type,data_domain,dataset,methodology,nature_dimension,origin_dimension,subject_area,treatment_dimension) — all 14 DQ-owned entities — no longer have a Qt controller anywhere underores.qt/refdataat all. This story's own D5DF4CFA task already moved every one of them into the newores.qt.data_managementplugin; this task's original scoping was written without noticing that move had already happened. Verified directly:find projects/ores.qt/data_management -iname "*Controller.cpp"lists all 14; none remain underores.qt/refdata.
That work isn't abandoned, just relocated: filed as
Migrate ores.qt.data_management's history dialogs to the generic
HistoryDialog under Commission ores.qt.dq — full-stack codegen for the
DQ component — the story already standing up ores.qt.dq as the
proper plugin ores.qt.data_management is a stepping stone toward.
The "every entity gets a real codegen model, no exceptions" policy
(including how change_reason=/=change_reason_category's
self-referential change-reason-cache wrinkle doesn't warrant an
exemption — same category of problem business_unit_type solved for
a different self-referential FK validator in task D4A868F5, via a
backward-compatible trailing paste-block template extension) carries
over to that task, not this one.
That leaves this task's actual, final scope: floating_index_type
and leg_type only — both confirmed still on a legacy per-entity
*HistoryDialog (FloatingIndexTypeHistoryDialog,
LegTypeHistoryDialog), both with an existing ores.trading codegen
model.
Test Scenarios
Manual QA scenarios (scaffolded via compass add test_scenario, run
through the QA Validation Runner panel) 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 |
|---|---|---|
PRs
| PR | Title |
|---|---|
| #1619 | [refdata,trading,qt,cli,sql] Migrate floating_index_type/leg_type to refdata + generic HistoryDialog |
Review
| Comment summary | File | Decision | Notes |
|---|---|---|---|
Result
Re-scoped on pickup from 17 entities to 2 (floating_index_type,
leg_type) — the other 15 turned out to already be out of
ores.qt.refdata entirely (a naming error for one already-migrated
entity, and 14 DQ-owned entities already relocated to
ores.qt.data_management by a prior task); that work is now tracked
under a new task on the DQ commissioning story instead.
Both entities' full backend (domain, repository, service, protocol,
generator, NATS eventing/history) moved from ores.trading to
ores.refdata to match where their Qt UI already lived — mirroring
Book/BusinessCentre's precedent, matching direction rather than
copying it verbatim (their mismatch ran the other way). This
surfaced and fixed a real pre-existing gap along the way: neither
entity's NATS handler/registrar/event-registrar/history-field-mapper
had ever actually been wired anywhere — the only NATS support that
existed was a hand-written combined handler
(instrument_ref_handler.hpp) shared with trade_type, with no
history support at all. Both now have complete, codegen-generated
stacks wired through ores.refdata's standard shared registrar
pattern.
Also fixed along the way (pre-existing, surfaced only once these
tables were actually exercised through the standard pipeline for the
first time): missing RLS policies for both tables (previously masked
by stale RLS_001 ignore-list entries under the old trading table
names, now replaced with real tenant-isolation policies), and a
codegen default-fields bug that unconditionally injects a name
field even for entities with no name column (worked around via an
explicit Detail fields model table rather than touching the shared
codegen driver).
Verification: full build green (linux-clang-debug-make, after a
cmake reconfigure to pick up deleted source files);
validate_schemas.sh 0 warnings (was 2); db recreate clean with
both entities' seed data (13 floating index types, 10 leg types);
ores.refdata.{api,client,core,service}.tests,
ores.trading.{api,core,service}.tests, and ores.cli.tests all
pass (8/8 suites, 0 failures).