Task: Generate sub-registrars for all refdata entities

Table of Contents

This page documents a task in the Introduce per-entity NATS sub-registrars story. It captures the goal, current status, acceptance, and any notes or results.

1. Goal

Run the nats-sub-registrar codegen profile over the refdata-cpp component to emit a <entity>_registrar.hpp/cpp pair for every refdata entity that has a NATS handler. These are consumed by the top-level registrar.cpp in the next task.

2. Status

Field Value
State DONE
Parent story Introduce per-entity NATS sub-registrars
Now Nothing.
Waiting on Nothing.
Next Nothing.
Last touched 2026-06-27

3. Acceptance

  • nats-sub-registrar profile run over refdata-cpp; a <entity>_registrar.hpp/cpp pair generated per entity that has a handler, under ores.refdata/core/{include,src}/.../messaging/.
  • Every generated registrar references only symbols that exist: handler ctor, handler methods (list/save/remove/history), and protocol request subjects — verified statically.
  • Entities without a history protocol carry no_history so the registrar skips the history subscription.
  • Entities without a NATS handler are excluded (no registrar) and the gap is captured in the backlog.
  • No CMakeLists edits required (src/ is GLOB_RECURSE).

4. Plan

  1. Dry-run compass codegen regenerate --component refdata-cpp --profile nats-sub-registrar to confirm output paths.
  2. Generate for real (28 domain_entity models; table/junction types are skipped by the profile's model_types filter).
  3. Static cross-check each registrar against its handler + protocol.
  4. Fix mismatches:
    • currency, counterparty_identifier, party_identifier have no history protocol → add :no_history: true to their C++ ** Flags drawer and regenerate (flag lifts onto the domain_entity context via org_loader and is read by {{^no_history}}).
    • counterparty_contact_information, party_contact_information have no handler header → delete their generated registrars; file a backlog capture for the missing handler decision.
  5. Confirm all remaining registrars are fully satisfied.

5. Notes

6. PRs

PR Title
   

7. Review

Comment summary File Decision Notes
       

8. Result

Generated 26 <entity>_registrar.hpp/cpp pairs under ores.refdata/core/{include,src}/ores.refdata.core/messaging/ via the nats-sub-registrar profile. table and junction models are skipped by the profile's model_types filter (the 14 "incompatible" log lines are expected, not failures).

Five entities needed special handling:

  • currency, counterparty_identifier, party_identifier — no history protocol; added :no_history: true to their C++ ** Flags drawer and regenerated, so their registrars wire list/save/remove only.
  • counterparty_contact_information, party_contact_information — no generated handler header, so a registrar cannot reference a handler type. Excluded (registrars deleted). Captured for follow-up: doc/agile/product_backlog/inbox/the_nats_sub_registrar_codegen_profile_excludes_co.org.

All 26 registrars were statically cross-checked: every referenced handler ctor, handler method (list/save/remove/history) and protocol request subject exists. No CMakeLists changes were needed (src/ is GLOB_RECURSE). Not yet compiled — the build is exercised when the top-level registrar wires these in (next task). Committed in ea0e4c334.

Emacs 29.3 (Org mode 9.6.15)