ores.history.api

Table of Contents

1. Diagram

ores.history.api component diagram

Figure 1: ores.history.api

2. Summary

ores.history.api is the genuinely client-visible half of ores.history: the one shared NATS request/response pair every entity's history uses (get_entity_history_request=/ =get_entity_history_response, keyed by an entity_type string rather than a typed per-entity subject), and build_entity_history_versions(), the shared rendering/diffing glue every server-side history_provider needs. A dependency-free leaf — matching ores.diff's dependency discipline — so any frontend (shell, HTTP) can decode the response without pulling in server-only machinery.

3. Inputs

  • A domain type's newest-first version list and its codegen'd render_{entity}_fields() mapper, fed into build_entity_history_versions().

4. Outputs

  • get_entity_history_response: an ordered list of entity_history_version (version, modified_by, recorded_at, rendered fields, and changes vs the previous version), or a failure message when no provider is registered for the requested entity_type.

5. Entry points

  • include/ores.history.api/messaging/history_protocol.hpp — the shared request/response types and the history.v1.get subject constant.
  • include/ores.history.api/service/version_builder.hpp — build_entity_history_versions(versions, render): renders each newest-first version's fields, diffs each against the next-older one via ores.diff::engine::compute (empty diff for the oldest), and numbers versions descending from the count — matching every *_repository::read_all(id)'s version DESC ordering.

6. Dependencies

  • ores.diff — field_value=/=diff_result embedded in entity_history_version.
  • std only beyond that — deliberately a leaf so every frontend and domain service depends on it without cycles.

7. Build dependencies

What the shared profile cannot know, declared here rather than hand-edited into the generated build file. Each block is spliced into its generated file after the profile's baseline.

8. See also

9. Test dependencies

The suites link what the profile cannot know about.

target_link_libraries(${lib_target_name}
    PUBLIC
        ores.diff.lib
        ores.utility.lib)
target_link_libraries(${tests_target_name}
    PRIVATE
        ${lib_target_name}
        ores.utility.lib
        ores.testing.lib
        ores.logging.lib
        Catch2::Catch2
        faker-cxx::faker-cxx
        Threads::Threads)

Emacs 29.3 (Org mode 9.6.15)