Story: Populate the ACME books with a realistic trade population

Table of Contents

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

1. Goal

ACME's books hold no trades, so a report package is structurally valid and substantively empty. Populate them from a synthetic generator in present time, referencing ACME's own books, counterparties and staff, starting with bonds and extending to every instrument.

The investigation this story commissioned is Investigation: Populating ACME with a trade population. It is the record of what was measured and which mechanism was chosen. It is a snapshot, not a description of the system.

2. Status

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

3. Acceptance

The story closes on the tasks it finished:

  • Fix composite versioning for the bond hierarchy.
  • Wire trading staff to their party.
  • Broaden the tradeable party-counterparty links.
  • Confirm the writing party comes from the token.
  • Model the trade generation config.
  • Write generated trades through the trading operation.
  • Anchor the dates and seed the content.
  • Resolve the references the trade names.
  • Give each trade a deterministic Internal identifier.
  • Generate the bond population into the ACME books.
  • Prove a bond rewrite versions the parent.
  • Add the generate_trades step to the ACME profile.
  • Prove the population converges across two provisions.
  • File the ACME trade population analysis as an investigation.
  • Stream the workflow execution step subjects.
  • Write a bond issue as one unit.
  • Book a bond trade as one unit.
  • Generate the instrument writer for every kind.

4. Tasks

Task State Start End Description
Fix composite versioning for the bond hierarchy DONE 2026-10-19 2026-10-19 bump_parent_version is in the seven trade-anchor parts and in no bond child, so rewriting a leg leaves the parent version still and the as-of read cannot say which legs were current. Make every bond child bump its parent and give the hierarchy an as-of read.
Wire trading staff to their party DONE   2026-10-15 59 of 61 ACME accounts carry no default_party_id and their membership is many-to-many, so a trade cannot name the person who entered it. Populate the party for the staff who trade.
Broaden the tradeable party-counterparty links DONE   2026-10-15 ACME holds 2454 counterparties and only 38 tradeable party-to-counterparty links, covering 23 of them. Widen the links so a generated book faces many counterparties rather than its default.
Confirm the writing party comes from the token DONE   2026-10-16 The trading write path sets NEW.party_id from app.current_party_id, so a caller cannot state the party on the row. Confirm a token naming a party sets it, and that a token naming none is refused rather than defaulting.
Model the trade generation config DONE   2026-10-15 Every other capability in ores.synthetic is driven by a generation config entity. Model one for trades: booking party, book scope, instrument family, counterparty scope, tenor and notional bands, as-of anchor and seed.
Write generated trades through the trading operation DONE   2026-10-15 ores.synthetic holds no trading dependency today. Reach trading through its authenticated operation rather than its repositories, so the owning component keeps its storage semantics and the party on the token does its job.
Anchor the dates and seed the content DONE   2026-10-15 Take the as-of date as an input and derive every trade date from it. Derive the economic content from a stable seed, so a second provision writes no new version rather than reading every trade as customer-amended.
Resolve the references the trade names DONE   2026-10-15 A generated trade resolves its book, its counterparty and its trader from ACME's real data and refuses to invent one, so a missing reference fails loudly instead of producing a fixture.
Give each trade a deterministic Internal identifier DONE   2026-10-15 Derive an Internal trade identifier from stable inputs so a re-provision upserts rather than duplicates. Build the trade and its identifier in one write, because the identifier is a composite child that bumps its parent.
Generate the bond population into the ACME books DONE 2026-10-19 2026-10-20 Bonds first, into each party's bond book, across a range of counterparties and tenors, so the pattern is proved on one instrument family before it is repeated.
Prove a bond rewrite versions the parent DONE   2026-10-16 Rewrite a bond leg and show the parent version moves and the as-of read reports the right legs. This is what demonstrates the versioning fix on real generated data rather than declaring it done.
Add the generate_trades step to the ACME profile DONE   2026-10-16 ACME provisioning runs the population, so the step belongs in the acme_demo profile after load_staff and start_market_feeds. One step or one per party depends on the party question, which decide rather than discover.
Prove the population converges across two provisions DONE   2026-10-16 Provision ACME twice and assert that no trade duplicated and no trade's version advanced. This is the acceptance that catches an unstable seed and the shift-after-insert design at once.
File the ACME trade population analysis as an investigation DONE   2026-10-15 The analysis under doc/analysis was written at the wrong level, so it is the story's record and belongs beside the story. Scaffold it as an investigation, move the content into the six required sections, and delete the analysis.
Stream the workflow execution step subjects DONE   2026-10-15 The step-command stream mechanism covers each service's publish-from-DQ steps only. The operational steps an execution workflow dispatches have no stream, so js_publish times out and the workflow never starts. Reporting declares its two publish subjects and omits reporting.v1.ops.gather_market_data, and ore and compute declare none at all.
Write a bond issue as one unit DONE 2026-10-21 2026-10-22 One trading operation writes a bond issue with its leg, amounts, rate and schedule in one unit of work, so a security is whole or absent.
Book a bond trade as one unit DONE 2026-10-23 2026-10-23 book_trade takes the identifiers and the instrument of the trade and writes them with the anchor in one unit of work. Synthetic and the final booking use the same call.
Generate the instrument writer for every kind DONE 2026-10-23 2026-10-23 Generate the dispatch from instrument_batch to the repositories for all instrument kinds, so book_trade books any trade the export can read.

5. Decisions

6. Out of scope

Emacs 29.3 (Org mode 9.6.15)