Task: Close the risk participation agreement round trip
Table of Contents
This page documents a task in the Rework the credit instruments to the instrument table rule story. It captures the goal, current status, acceptance, and any notes or results.
1. Goal
The agreement exports as valid ORE and its fields come back from the tables.
2. Status
| Field | Value |
|---|---|
| State | DONE |
| Parent story | Rework the credit instruments to the instrument table rule |
| Now | Nothing. |
| Waiting on | Nothing. |
| Next | Nothing. |
| Last touched | 2026-10-13 |
3. Acceptance
- The agreement stores its participation rate, settles-accrual flag, protection fee legs and underlying legs, and exports all of them.
- The underlying's option block and treasury lock are stored and exported, or the treasury lock is recorded as a known limit with its reason.
- The design's open question is settled and recorded: how an agreement's underlying option is told apart from a trade's own option on the shared option table.
- A mapper test holds the agreement's fields through the round trip, and the ORE suite passes.
4. Plan
- Read the binding first. The agreement's
ProtectionFeeis a list of legs, and itsUnderlyingholds legs, an optional option block, a naked-option flag and an optional treasury lock whose data is a bond. The design had a money column for the fee and no underlying, so the plan follows the binding. - Facts. The agreement's table gains the participation rate (a continuous fraction, so a binary float), the settles-accrual flag and the naked-option flag.
- Legs by group. The fee legs are the
protection_feegroup ofswap_legsand the underlying's legs are theunderlyinggroup. The shared leg mapper learns cashflow legs: a dated payment is a dated amount row, and the leg type tells it from a notional. - Schedules. An underlying leg keeps its own schedule as shared schedule rows under the swap owner, because the header's dates are the protection period and not the leg's.
- The option. The underlying's option block goes to the shared option rows. The agreement has no option of its own, so the question of telling an underlying's option from a trade's own does not arise: a trade holds one option block, and for an agreement it is the underlying's.
- Known limit. The treasury lock holds a bond, which the bond family stores. It is not stored, the import logs a warning, and the corpus has none.
- Prove it. Tests read the fields, the digits of the fee, the leg schedules and the option block back, and the directory round trip shows both agreement documents re-read.
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 |
|---|---|---|---|
| ORE core suite | all pass, with both agreement documents re-reading | ctest --preset linux-clang-debug-make -R ores.ore.core.tests |
the PR head |
| Trading core suite | all pass | ctest --preset linux-clang-debug-make -R ores.trading.core.tests |
the PR head |
| Shell trading suite | all pass | ctest --preset linux-clang-debug-make -R ores.shell.trading.tests |
the PR head |
| Build | exit 0 | compass build ores.ore.core.tests ores.trading.core.tests ores.shell.trading.tests ores.ore.service.exe |
the PR head |
6. Notes
- The two agreement documents were the credit entries of the export fidelity capture: their export dropped the required legs, so they did not re-read. They re-read now, and the directory round trip test no longer lists them as gaps.
- A cashflow leg changed in the shared leg mapper. A rates document with a cashflow leg now stores its dated amounts and exports a cashflow element instead of a notional list. The rates suites pass.
- The treasury lock of an underlying is not stored. It holds a bond, which the bond family owns. A document that carries one imports with a warning in the log. No corpus document has one.
- The participation rate is a continuous fraction, so it is a binary float in the table and the domain type.
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 |
|---|---|
| #3238 | [ore,trading,sql] Close the risk participation agreement round trip |
9. Review
| # | Comment summary | File | Decision | Notes |
|---|---|---|---|---|
| 1 | The design put a money column for the protection fee | design.org | accept | The binding shows a list of legs; the design now says so. |
| 2 | The treasury lock is not stored | credit_instrument_mapper.cpp | accept | It holds a bond; recorded as a known limit with a warning and no corpus case. |
| 3 | A shared change to the cashflow leg touches the rates family | swap_instrument_mapper.cpp | accept | The rates suites pass and the export is now valid for a cashflow leg. |
| 4 | A protection fee leg that states a schedule would lose it | credit_instrument_mapper.cpp | accept | Both leg groups now keep a stated schedule as shared schedule rows. |
| 5 | The leg numbering across the two groups is not pinned | xml_credit_mapper_roundtrip_tests.cpp | accept | A test pins fee leg 1 and underlying legs 2 and 3, and their schedule owners. |
| 6 | The participation rate is rounded through a float | credit_instrument_mapper.cpp | decline | A continuous quantity is a binary float by the family's rule, as the recovery rate is; the tests compare within a range. |
| 7 | The new not null column needs a migration | the agreement model | decline | The project recreates the database and writes no migration. |
| 8 | The shell commands changed their positional arity | the shell commands | decline | The commands are generated from the model, as in every earlier unit, and read optionals through one parser. |
| 9 | The first commit's trailer has an unexpanded variable | the commit | decline | Commits are never amended; a follow-up commit records the task. |
| 10 | The treasury lock is dropped on export | credit_instrument_mapper.cpp | decline | Recorded as a known limit: it holds a bond, the import warns, and no corpus document has one. |
| 11 | The shell, API and codegen suites were not rerun | the PR | accept | Run after the full build: the trading API, trading service, shell application and codegen suites pass, and the misspell scan of the changed files is clean. |
10. Result
The risk participation agreement stores and exports its required elements. Its
table holds the participation rate, the settles-accrual flag and the
naked-option flag. Its protection fee is the protection_fee legs and its
underlying's legs are the underlying legs, each with its own schedule. The
underlying's option block is the shared option rows, which the agreement owns
because it has no option of its own. Both corpus documents export as valid ORE
and re-read.
Acceptance met except the treasury lock, which is recorded as a known limit. The open question is settled: a trade holds one option block, and for an agreement it is the underlying's.