Task: Codegen the history-provider registrar wiring

Table of Contents

This page documents a task in the Close systemic codegen gaps story. It captures the goal, current status, acceptance, and any notes or results.

Goal

projects/ores.refdata/core/src/messaging/registrar.cpp has grown into a single monolithic hand-maintained file registering NATS CRUD handlers, per-entity registrars, and (after wiring history providers for the entities migrated in task AA97E310) history providers for every refdata entity — 100+ #include lines and dozens of near-identical register_history_provider() lambda blocks, differing only by entity name, service method name (get_<x>_history, with several entity-specific irregular spellings like get_type_history or get_centre_history), and mapper function name (render_<entity>_fields). This is a clear codegen candidate: a per-entity archetype emitting the include/registration snippet (matching the entity_type_of()=/history-field-mapper pattern already codegen'd), assembled by the registrar the same way per-entity =*_registrar.hpp handler registrations already are, rather than continuing to hand-edit one giant file for every entity that migrates onto the generic HistoryDialog.

Status

Field Value
State BACKLOG
Parent story Close systemic codegen gaps
Now Not yet started.
Waiting on Nothing.
Next Begin implementation.
Last touched 2026-08-06

Acceptance

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
   

Review

Comment summary File Decision Notes
       

Result

Promoted from capture

Captured 2026-07-15 in the product backlog; promoted preserving the UUID.

What

projects/ores.refdata/core/src/messaging/registrar.cpp has grown into a single monolithic hand-maintained file registering NATS CRUD handlers, per-entity registrars, and (after wiring history providers for the entities migrated in task AA97E310) history providers for every refdata entity — 100+ #include lines and dozens of near-identical register_history_provider() lambda blocks, differing only by entity name, service method name (get_<x>_history, with several entity-specific irregular spellings like get_type_history or get_centre_history), and mapper function name (render_<entity>_fields). This is a clear codegen candidate: a per-entity archetype emitting the include/registration snippet (matching the entity_type_of()=/history-field-mapper pattern already codegen'd), assembled by the registrar the same way per-entity =*_registrar.hpp handler registrations already are, rather than continuing to hand-edit one giant file for every entity that migrates onto the generic HistoryDialog.

Why

Found while wiring server-side history providers for the entities migrated in Delete per-entity history-dialog codegen archetypes and reconcile dynamic_combo drift: client-side controller migration and server-side history-provider registration turned out to be two separate, easy-to-miss steps (a migrated entity compiles and opens its History window fine, but shows "No history provider registered for entity_type: …" until this file is hand-updated too). As more entities migrate, this file keeps growing linearly by hand — exactly the kind of repetitive, entity-parameterised boilerplate the rest of this story already codegens (client model, controller, detail dialog, history-field mapper). Codegen'ing this registration removes both the manual toil and the "forgot to wire the server side" failure mode entirely.

References

  • projects/ores.refdata/core/src/messaging/registrar.cpp — the file in question.
  • projects/ores.refdata/core/include/ores.refdata.core/presentation/*_history_field_mapper.hpp — the sibling codegen'd artefact this registration consumes.

Emacs 29.3 (Org mode 9.6.15)