ores.history.api

Table of Contents

Diagram

ores.history.api component diagram

Figure 1: ores.history.api

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 (Qt, shell, Wt, HTTP) can decode the response without pulling in server-only machinery.

Inputs

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

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.

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.hppbuild_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.

Dependencies

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

See also

Emacs 29.3 (Org mode 9.6.15)