Task: Nest the portfolios into a tree
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 sees where a book sits in the portfolio hierarchy and reads each level's total against the level above and below it.
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
- A portfolio nests under its parent portfolio.
- A portfolio's figure is its own books plus the portfolios under it.
- Each row states its depth, and the screen indents it.
- A book in no portfolio stands at the top.
- The trade count stays the run's own, not the sum of the 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 |
|---|---|---|---|
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 |
|---|---|
| #3897 | [web] Nest the portfolios into a tree |
9. Review
| Comment summary | File | Decision | Notes |
|---|---|---|---|
10. Result
The book level reads as a tree.
A portfolio nests under its parent portfolio, and its figure is its own books plus the portfolios under it, so each level can be checked against the level above and below. Each row states its depth and the screen indents it. A book in no portfolio, or in one whose name was not read, stands at the top rather than under a guess.
On run c2a86671 the level draws four rows: Global Portfolio over Banking
Book over Liquidity Buffer Portfolio over Liquidity Buffer Bonds, each at
33,709,129.46 HKD over the same eight trades, which is what one book under one
chain of portfolios should say.
The totals line states the run's own trade count rather than the sum of the rows, because a tree's rows state the same trades once per level above them.