Story: Temporal composite entity versioning

Table of Contents

This page documents a story in Sprint 22. It captures the goal, current status, acceptance criteria, and the tasks that compose it.

Goal

Produce a comprehensive architecture document under doc/architecture laying out the target state for complex/composite object versioning (option A: child saves bump the parent's version; loading a parent as-of version N composes children as of that same version), and work out how to enforce it across SQL (triggers), codegen (templates/facets), and the Qt UI (including how a composite entity's version/history dialog should look, e.g. a unified children-version view).

Status

Field Value
State DONE
Parent sprint Sprint 22
Now Nothing.
Waiting on Nothing.
Next Nothing.
Last touched 2026-07-07

Acceptance

  • Architecture document written under doc/architecture covering: (1) the target temporal-composite versioning model, (2) SQL enforcement approach (trigger cascade to bump parent version on child insert/update), (3) codegen facet/template changes needed to generate this consistently, (4) how composite as-of reads compose parent+children by matching valid_from/valid_to windows, (5) Qt UX design for composite version/history dialogs. Document reviewed and captured decisions distilled for follow-up implementation stories (party/counterparty first, as the reference case).

Tasks

Task State Start End Description
Write temporal composite entity versioning architecture document DONE 2026-07-06 2026-07-07 Write the target-state architecture document under doc/architecture for composite (parent+child) entity versioning: option A (child saves bump the parent's version), as-of composition on load, enforcement across SQL/codegen, and Qt composite version/history dialog UX.

Decisions

  • Option A confirmed: child writes bump the parent's version, in the same transaction, rather than the reverse.
  • "As of parent version N" composition is a two-step fetch (get parent row's [valid_from, valid_to) window, then fetch each child table filtered to that same window) — not a mechanism requiring a version-mapping table.
  • Multi-level cascading (grandchild → child → parent) is out of scope for v1; single-level (party/counterparty → identifiers/contacts) only.
  • Follow-up implementation tracked as a separate story: Implement temporal composite entity versioning (see that story for the open decisions on child-delete bumping, flag names, and reason-code stamping, resolved there before implementation starts).

Out of scope

Emacs 29.3 (Org mode 9.6.15)