Story: Model trade structures

Table of Contents

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

1. Goal

Implement section 11 of the trade shape investigation, so a structure is a group with an identity whose legs reference it, as Trade Structures and Deal Composition requires.

2. Status

Field Value
State DONE
Parent sprint Sprint 27
Now Nothing.
Waiting on Nothing.
Next Nothing.
Last touched 2026-10-02

3. Acceptance

  • structure is an immutable anchor with party, counterparty, kind and template; its legs share its party and counterparty.
  • structure_member is keyed by the trade and temporal, so a trade sits in at most one structure at a time and can be linked and unlinked.
  • A template's roles and leg counts are checked when a leg is linked; structures nest one level at most.
  • The structure's internal version is read from its legs; its external version lives on the agreement.

4. Tasks

Task State Start End Description
Add structure kinds and templates DONE 2026-10-08 2026-10-08 Add structure_kind, which states whether a kind confirms as a whole (strategy, typed, dynamic) or trade by trade (package), and structure_template, which states the roles and leg counts a strategy or typed product allows.
Add the immutable structure DONE 2026-10-08 2026-10-08 Add structure, an immutable anchor keyed by tenant and id with party, counterparty, kind, template and a nullable parent, nested one level at most.
Link trades into structures DONE 2026-10-08 2026-10-08 Add structure_member, temporal and keyed by the trade, with role and sequence; pin each leg's party and counterparty to the structure's, and check the template's roles and leg counts when a leg is linked.
Read a structure's version from its legs DONE 2026-10-08 2026-10-09 Derive a structure's internal version from the versions of its legs and its membership, so no stored counter can drift; the external version belongs to the agreement and is out of this story.

5. Decisions

6. Out of scope

  • The structure's external version and confirmation status, which live on the agreement and belong to the authorisation and agreement work.

7. Result

Closed on the tasks' state, in the sprint's bookkeeping pass: every task is DONE with its work merged, and the tasks carry the outcomes. The owner had moved on before closing the story, so this close records the tasks' state rather than a fresh verification of the goal.

Emacs 29.3 (Org mode 9.6.15)