Define and regenerate the standard codegen repository method set
Table of Contents
This page is a capture in the next bucket of the product backlog — a pre-sprint idea, not yet pulled into a sprint as a story.
What
Define and document the canonical "standard" method set the C++ codegen
emits for every domain entity — the repository read/write/remove family
and the table convert_to_table adapters — then audit the templates
against that definition and regenerate all entities so the set is
applied uniformly. Concretely: (1) write down the standard repository
method set (e.g. read_latest variants, read_all(context) and
read_all(context, key), read_at_timepoint(context, as_of) and the
keyed variant, paginated read_latest(offset, limit),
get_total_*_count, scalar and batch remove) and the standard table
overloads (convert_to_table(const T&) and
convert_to_table(const std::vector<T>&)); (2) reconcile
cpp_domain_type_repository_{hpp,cpp}.org and
cpp_domain_type_table_{hpp,cpp}.org against it; (3) regenerate every
entity across all components; (4) tie this to the existing
Codegen CI zero-diff invariant
story so future drift is machine-caught rather than discovered at build
time.
Why
During the currency C++ core codegen sync, a full build surfaced that
the codegen had silently dropped several previously-standard methods —
read_all(context) (all versions across keys),
read_at_timepoint(context, as_of) (all entities at a timepoint), and
the single-object convert_to_table(const T&) overload. Hand-written
consumers broke one at a time: ores.cli (application.cpp), the
ores.refdata.api domain tests, and an ores.http route. Currency and
currency_market_tier were fixed by promoting these back to standard
template output, but every other entity (country, party, book_status,
party_status, party_type, …) still lacks them until regenerated, leaving
the codebase inconsistent. There is no agreed, written definition of the
standard method set, so this kind of silent drop can recur. A single
deliberate pass — define, reconcile, regenerate, guard — closes the gap.
References
- Surfaced during the currency codegen work:
read_all(context),read_at_timepoint(context, as_of)and the single-objectconvert_to_tablewere inconsistently present across entities. The interim fix that promoted them lived on an earlier iteration offeature/sync-cpp-core-codegen-currencythat was reset when main's own unified-model migration superseded it, so it is no longer a reachable commit; the underlying inconsistency this capture tracks stands. - Repository/table generator templates (post-refactor org sources under
projects/ores.codegen/library/templates/ores.cpp.*).
See also
- Codegen CI zero-diff invariant — machine-enforce the regenerated-output invariant.
- Commission: currency — story where this surfaced (task
8A84D304).