Task: Compare a run with an earlier one

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 whether a book or a counterparty moved since the last run, and by how much.

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 control offers the completed runs of the same report, and none by default.
  • The chosen run is in the address, so a refresh and a shared link keep it.
  • Each row states what it was and the change against it, with the share where the earlier figure was not zero.
  • A row only the earlier run had is kept and marked as gone.
  • The totals line states the change against the earlier run.
  • A run of another report is refused as a comparison.

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
#3889 [web] Compare a run with an earlier one

9. Review

Comment summary File Decision Notes
       

10. Result

A run's book and counterparty levels can be stated against an earlier run of the same report.

A Compare to control offers the report's completed runs and no comparison by default. The chosen run sits in the address as ?baseline, so a refresh keeps it and a colleague can be sent the comparison. Each row then states the change and the change as a share of the earlier figure, the totals line states the change against the run, and a row only the earlier run had is kept and marked as gone rather than dropped.

The comparison is refused when the run named is a run of another report, when it is the run itself, and when it has not completed; it is offered only at the aggregate levels, because a trade is read on its own. A row only the earlier run had stays beside its group rather than trailing the table, and carries a gone tag. The totals line states the earlier run's figure, the change and the share.

The review asked for the last two: the page had the data but drew neither, so a gone row looked like a row that fell to zero.

The two runs on record are c2a86671 against 71d08bde, on the NPV definition of ACME Corporation HK Ltd. Both priced the same data, so the book states 33,709,129.46 HKD either side of the comparison and a change of 0.00: the control is proven, not the arithmetic.

Emacs 29.3 (Org mode 9.6.15)