Task: Flip fx onto its rows

Table of Contents

This page documents a task in the Let the plan state domain rows, not a bag story. It captures the goal, current status, acceptance, and any notes or results.

1. Goal

An fx trade states its rows in the plan, and the writer translates nothing for the family.

2. Status

Field Value
State DONE
Parent story Let the plan state domain rows, not a bag
Now Nothing.
Waiting on Nothing.
Next Nothing.
Last touched 2026-10-30

3. Acceptance

  • The planner builds the fx row each type routes to, and the accumulator's range bounds, from what it draws.
  • The writer's fx arm is gone and the batch is persisted with its audit columns stamped.
  • A provisioning run books the same fx rows as before the flip: 8 forward, 4 vanilla, 4 barrier, 4 digital, 4 asian and 4 accumulator rows.

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
Fx forward rows 8 select count(*) from ores_trading_fx_forward_instruments_tbl worktree
Fx vanilla option rows 4 ...fx_vanilla_option_instruments_tbl worktree
Fx barrier option rows 12 ...fx_barrier_option_instruments_tbl worktree
Fx digital option rows 4 ...fx_digital_option_instruments_tbl worktree
Fx asian forward rows 4 ...fx_asian_forward_instruments_tbl worktree
Fx variance swap rows 0, never drawn ...fx_variance_swap_instruments_tbl worktree
Fx accumulator rows 0, never drawn ...fx_accumulator_instruments_tbl worktree
Accumulator range bounds 4 select count(*) from ores_trading_range_bounds_tbl worktree
Trade rows, latest version 127 select count(distinct id) from ores_trading_trades_tbl where valid_to = ... worktree
Planner suite 1,908 assertions in 79 cases publish/bin/ores.synthetic.core.tests worktree

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
#4088 [synthetic] Let an fx trade state its rows

9. Review

Comment summary File Decision Notes
       

10. Result

The fx family states its rows. The planner builds the row each type routes to, beside the drawing that feeds it, and the writer persists what the plan carries. The writer's fx arm is gone, and with it the per-row stamping: the walk over the batch states the audit columns on every row and on the accumulator's range bounds.

The population is unchanged: a fresh tenant books 8 forward, 4 vanilla option, 12 barrier option, 4 digital option and 4 asian forward rows with 4 range bounds, and 127 trades in total, which is what it booked before the flip.

Two fx products are absent and the flip did not remove them. The fx planner cycles sixteen routed types and each seeded config states eight slots, so the last eight types are never drawn: no fx variance swap and no fx accumulator exists in any provisioned tenant, though both construct and both route. That is the same positional defect the rate family shows with its knock-out swap, and it is captured once for both rather than fixed here.

The plan's bag narrowed again. Fx left the variant, so three remain: bond, whose security still travels in it, and the two families that have not flipped.

The run was made twice. The first, on the branch as first written, provisioned the same numbers; main then lost the legal entity publish route and no tenant could be provisioned from it, which was fixed in #4092. The numbers above were measured again after that fix, on the rebased tree, and are identical.

Emacs 29.3 (Org mode 9.6.15)