Task: Fix synthetic entity model drift: update to latest format and regenerate
Table of Contents
This page documents a task in the Codegen developer experience improvements story. It captures the goal, current status, acceptance, and any notes or results.
Goal
Mirror Fix refdata entity model drift for ores.synthetic: regenerate every
ores.synthetic domain_entity and junction model (compass codegen entity
list) against current codegen templates. Where a model uses an
outdated format/convention rather than the templates having simply
moved on, update the model to the current convention before
regenerating. Commit the resulting clean tree.
Along the way, apply the same lessons learned fixing refdata's
drift: check whether any entity's SQL/domain/messaging layer is
explicitly hand-maintained (a doc comment flagging missing
paste-block coverage) before doing a full regen – prefer
--address-scoped regen for anything so flagged; grep synthetic
generators for hardcoded/fabricated soft-FK values (coding scheme
codes, lookup-table codes) that don't match what a freshly-recreated
default database actually seeds.
Status
| Field | Value |
|---|---|
| State | DONE |
| Parent story | Codegen developer experience improvements |
| Now | Nothing. |
| Waiting on | Nothing. |
| Next | Nothing. |
| Last touched | 2026-07-30 |
Acceptance
- Every ores.synthetic
domain_entityandjunctionmodel is regenerated viacompass codegen entity generateand shows zero diff on a second regen (idempotent). - Any model found using an outdated format/convention is updated to the current one before regenerating.
- Any entity whose SQL/domain/messaging layer is hand-maintained
(flagged in its own model doc, mirroring
party's) is excluded from a full regen and only its safe facets (e.g. Qt) are regenerated, same asparty's treatment in the refdata task. - Synthetic generators for FK-referencing fields are checked against
actual seed SQL (the default
db recreatechain, not optional artefact/dataset scripts) and fixed if they fabricate values that don't exist there. compass buildand fullratpass after the regenerated files are committed.- No entity outside synthetic is touched.
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.)
Notes
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 |
|---|---|
| #1757 | [synthetic] Fix synthetic entity model drift |
Review
| # | Comment summary | File | Decision | Notes |
|---|---|---|---|---|
| 1 | 9 orphaned per-entity HistoryDialog files left dead by the generic-HistoryDialog migration, still picked up by CMakeLists.txt's GLOB_RECURSE | FxSpotGenerationConfigHistoryDialog/GmmComponentHistoryDialog/MarketDataGenerationConfigHistoryDialog (.hpp/.cpp/.ui) | Fixed | Deleted all 9; build clean, full rat 0 failures (33fecad06). |
Result
All 7 ores.synthetic entities (folder, fx_spot_generation_config,
gmm_component, ir_curve_generation_config,
ir_curve_template_entry, market_data_generation_config,
yield_curve_process_type) had drifted onto a structural convention
current codegen no longer recognises: a top-level * Primary key /
* Natural keys org heading instead of :primary_key:=/:natural_key:=
field flags inside * Columns. None of them could be regenerated at
all (validator: "Missing primary key"). Migrated each model's key
fields into * Columns (preserving every property, prose, and
generator block byte-for-byte otherwise), then regenerated all 7
fully. No entity outside synthetic touched, no hand-maintained-SQL
flags found on any of the 7 models.
Regenerating also surfaced a second template gap in
cpp_history_field_mapper: its natural_keys branch didn't handle an
int natural key (gmm_component.component_index,
ir_curve_template_entry.sequence_index) – same class of bug as the
date/timestamp gap found fixing refdata's calendar_exception. Added
the missing is_int branch.
Because these entities had never successfully regenerated before, several downstream generated layers (messaging registrars, history-field-mappers, a changed-event) didn't exist on disk yet; committing the regen creates them for the first time.
compass build and full rat green after every commit.
Task-ID: 6C67EAF7-B863-42D7-A571-CD6DA82242EC