Task: Migrate the portfolio documents
Table of Contents
This page documents a task in the Decide the XML strategy for ORE documents story. It captures the goal, current status, acceptance, and any notes or results.
1. Goal
Move trades, envelopes and the instrument families. This is the largest mapper group and the one the bond work touched, so it lands after the reference data has proved the shape.
2. Status
| Field | Value |
|---|---|
| State | DONE |
| Parent story | Decide the XML strategy for ORE documents |
| Now | Nothing. |
| Waiting on | Nothing. |
| Next | Nothing. |
| Last touched | 2026-10-17 |
3. Acceptance
- Trades and every instrument family are read through the codec.
- The instrument mappers are deleted in the same change.
- Every portfolio document in the corpus round trips and validates.
4. Plan
(Implementation strategy. Written when work starts; key decisions
are distilled into the parent story's * Decisions at close, but the
plan itself stays — it is the historical record of what we did.)
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 |
|---|---|---|---|
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
9. Review
| Comment summary | File | Decision | Notes |
|---|---|---|---|
10. Result
This task was done inside the reference data task. Its PRs are listed there: #3549, #3555, #3556 and #3560.
The portfolio table and portfolio_projection read and write the document.
Eight instrument projections (bond, commodity, composite, credit, equity, fx,
rate, scripted) sit beside it in projects/ores.ore/core/src/domain. The
importer and the exporter call the projection. No hand-written
instrument mapper remains in that directory. The census reports Portfolio as
supported.
Proof recorded on that task: every portfolio in the example corpus exports a document that binds. This record does not claim schema validation of the exported documents.