Story: Restore the trading guards the versioned model dropped

Table of Contents

This page documents a story in Sprint 28, carried unfinished from Sprint 27 at close. It captures the goal, current status, acceptance criteria, and the tasks that compose it.

1. Goal

Two guarantees went out with the immutable profiles, and nothing replaced them:

  • A trade is no longer refused when it is reported into another party's portfolio. The check and its message are gone from the generated SQL, so the report is accepted.
  • A raw update rewrites every version of a trading row in place. The history a versioned table exists to keep can be written over.

2. Status

Field Value
State ABANDONED
Parent sprint Sprint 28
Now Nothing.
Waiting on Nothing.
Next Nothing.
Last touched 2026-10-24

3. Acceptance

Nothing shipped under this story. Its one finished task only scaffolded the story. The tasks that carry the work moved to the story named in Decisions.

4. Tasks

Task State Start End Description
Scaffold story: Restore the trading guards the versioned model dropped DONE 2026-10-09 2026-10-09 Story scaffolding rides this task: documents, sprint wiring, and the scaffold PR. Close it before merging that PR.

5. Decisions

6. Out of scope

7. Notes

Two smaller consequences of the same refactor, found while repairing the pgTAP suites. Neither is worth a task of its own yet:

  • ores_utility_allow_immutable_purge_fn() is inert for trading. Nothing in a trading table consults it any more, so a delete closes the current version with the switch on or off. The pgTAP case that used to purge now asserts that the switch changes nothing.
  • The structures insert trigger checks that a structure is not its own parent after it checks that the parent exists, so a self-parent write is refused as a missing parent and the self-parent branch never runs. The check is unreachable rather than wrong.

Emacs 29.3 (Org mode 9.6.15)