Task: Scaffold story: Restore the trading guards the versioned model dropped
Table of Contents
This page documents a task in the Restore the trading guards the versioned model dropped story. It captures the goal, current status, acceptance, and any notes or results.
1. Goal
Open the story the pgTAP repair found two missing guards for, so the guarantees are recorded rather than asserted away.
2. Status
| Field | Value |
|---|---|
| State | DONE |
| Parent story | Restore the trading guards the versioned model dropped |
| Now | Nothing. |
| Waiting on | Nothing. |
| Next | Nothing. |
| Last touched | 2026-10-09 |
3. Acceptance
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 |
|---|---|
| #2977 | [agile] File the trading guards the versioned model dropped |
9. Review
| Comment summary | File | Decision | Notes |
|---|---|---|---|
10. Result
The story is in the sprint with two tasks, neither started. The guards came out of repairing the pgTAP suites on PR #2975: one case had proved that a trade is reported only in its own party's portfolios, and the check behind it is gone from the generated SQL, so the report is now accepted. The second is the unguarded version rewrite, where a raw update changes every version of a row in place. The story also carries two smaller consequences of the same refactor: the purge switch is inert for trading, and the structures self-parent check is unreachable behind the parent lookup.
The finder is on the merged PR #2975, whose summary and task record name both guards. This scaffold PR carries the documents only.