Task: A security is named by its product

Table of Contents

This page documents a task in the Populate the ACME books with a realistic trade population — the remaining work story. It captures the goal, current status, acceptance, and any notes or results.

1. Goal

Name a security by its product as well as its term, so two bond products of one term state two securities and a provisioning run writes the bond family.

2. Status

Field Value
State DONE
Parent story Populate the ACME books with a realistic trade population — the remaining work
Now Nothing.
Waiting on Nothing.
Next Nothing.
Last touched 2026-10-31

3. Acceptance

  • A security's name states its product, so a callable bond and a plain bond of one term name two securities and two issues.
  • The bond family books, and a full provisioning run writes every family of the population.

4. Plan

The name states the product as well as the currency, the anchor and the term.

A security's own rows are what make two products different securities: a callable bond states the dates its issuer may call it, a convertible states what it may convert into, and a plain bond of the same term states neither. The store compares the issue it holds with the issue a second write states, and refuses the second when they differ — which is the run's Bond issue … is stored with other terms. So the product belongs in the name, and the pool of securities becomes one per currency, term and product.

Two consequences are stated rather than left to be discovered:

  • A term now carries as many securities as the family routes products to it. The case that asserted one security per term asserted the fault.
  • A security is no longer shared between two books by construction. With an even product count and two books, the draw gives each book half the products, so no security is shared across books; the name is still a function of the security's own facts and of nothing about a book, which is what the case now states.

5. Measurements

Every number this task claims about a tree, with the command that produced it and the commit it was measured at. A number without both is not a measurement, because a clean-up record describes a tree and trunk moves under a branch: a consumer count, a gate's component count and a suite's size all change with no code changing, and the reader of a bare number cannot tell which tree it came from. Where the raw output matters, put it in an evidence/ file beside the task and name that file in the Command column.

What Value Command Commit
Where a run on main stops the bond family: Bond issue 6fc76aae-d7d3-5f38-ba65-da466ec095da is stored with other terms, with the fx family already written the provisioning script, run 3e68f6be main at ef22248ad4
The population a fresh tenant holds 178 trades: bond 40, commodity 25, interest rates 27, fx 64, equity 17, credit 5 the family tables counted by distinct trade id, over the union branch head
Bond issues a fresh tenant holds 39 issues over the 10 routed codes, every one a distinct security select count(distinct issue_id), count(distinct security_id) from ores_trading_bond_issues_tbl branch head
The bond children the securities state 8 call dates, 4 conversion targets select count(*) from ores_trading_bond_issue_call_dates_tbl and the conversion targets beside it branch head
The provisioning run all 9 steps completed, generate_trades among them the provisioning script, run ed22f4eb branch head
Date columns at the sentinel 0 the do block that counts each date column at 0002-11-30 BC branch head
Suite synthetic.core 1006 assertions in 38 cases set -a && . ./.env && set +a && publish/bin/ores.synthetic.core.tests branch head

6. Notes

7. Test Scenarios

Manual QA scenarios (scaffolded via compass add test_scenario) that verify this task. Link new ones here as they're created; the scenario doc itself links back via its "Verifies task" field.

Scenario State Notes
     

8. PRs

PR Title
#4209 [synthetic] Name a security by its product as well as its term

9. Review

Comment summary File Decision Notes
       

10. Result

A security is named by its product, and a provisioning run writes every family.

What that bought, measured on a fresh tenant:

  • The bond family books all ten routed codes: 40 trades over 39 securities and 39 issues. Before the fix the same run stopped at the second product of one term, because two products of one term claimed one issue and the store compares the terms it holds with the terms a write states.
  • The population is 178 trades: bond 40, commodity 25, interest rates 27, fx 64, equity 17 and credit 5. The provisioning run completes all nine of its steps.
  • No date column in the tenant holds 0002-11-30 BC, which is the sentinel the previous task removed from the planner's arithmetic.
  • The bond securities state their children: 8 call dates and 4 conversion targets, which is what makes two products of one term two securities.

One consequence is stated rather than left to be found: with an even number of products per term and two books, the draw gives each book half the products, so no security is shared between two books. The name is still a function of the security's own facts and of nothing about a book or a trade, which is what the case now asserts in place of the old one that read the draw as the rule.

Emacs 29.3 (Org mode 9.6.15)