Task: Read a run's results at trade, book or counterparty level

Table of Contents

This page documents a task in the Prove the report grid run end to end — the remaining work story. It captures the goal, current status, acceptance, and any notes or results.

1. Goal

A reader chooses whether to read a run's figures trade by trade, rolled up to books, or rolled up to counterparties, and each level names the records behind its rows.

2. Status

Field Value
State DONE
Parent story Prove the report grid run end to end — the remaining work
Now Nothing.
Waiting on Nothing.
Next Nothing.
Last touched 2026-10-26

3. Acceptance

  • One control in the results header chooses trade, book or counterparty.
  • The chosen level is in the address, so a refresh and a shared link keep it.
  • Book rows carry the book's name, its trade count, its NPV and its notional.
  • Counterparty rows carry the counterparty's name, its trade count, its NPV and its notional.
  • A row opens its record, and a row's Show the trades reads the trades beneath it at trade level.
  • A trade with no booking is shown as unbooked, not dropped.

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

PR Title
   

9. Review

Comment summary File Decision Notes
       

10. Result

A run's results are read at the level the reader chooses, and the server does the rolling up.

One control in the results header says Aggregate by and offers Trade, Book and Counterparty. The choice sits in the address as ?by, so a refresh keeps it and a colleague can be sent the book view.

Level Row Columns
Trade a trade TradeId, TradeType, NPV, NPV(Base), Notional, Book, CounterParty
Book a book Book, Trades, NPV, Notional
Counterparty a counterparty CounterParty, Trades, NPV, Notional

Each level is sorted largest first. The totals line always states the run's trade count and its NPV in each currency, so a level's rows and the run's whole are read together.

A row opens its record: a book to its page, a counterparty to its page. Show the trades then reads that book's or counterparty's trades at trade level, with the filter stated above the table and a way to clear it.

The run that shows it is 9ff0e92e-f21d-4137-bb24-ad4956fa99f0. At book level it shows one book, Liquidity Buffer Bonds, with eight trades, 31,607,092.99 HKD of NPV and 31,719,872.60 HKD of notional. At counterparty level it shows eight names, largest first, from The Bank of East Asia, Limited at 9,690,510.31 HKD down to one at 1,142,973.71 HKD.

Two facts the levels state rather than hide. A trade with no booking is grouped under an unbooked row rather than dropped, so the books cannot add up to less than the run. And the exposure the counterparty prototype shows is absent here, because an NPV report runs no SA-CCR analytic to produce it.

Emacs 29.3 (Org mode 9.6.15)