Story: Hotfix: the export joins on a trade id nobody mints

Table of Contents

This page documents a story in Sprint 27. It captures the goal, current status, acceptance criteria, and the tasks that compose it.

1. Goal

Let the XML roundtrip walk and the exporter tests join each trade to its own instrument, so the ORE corpus imports stop resolving a trade onto another trade's instrument.

2. Status

Field Value
State DONE
Parent sprint Sprint 27
Now Nothing.
Waiting on Nothing.
Next Nothing.
Last touched 2026-10-09

3. Acceptance

  • xml::roundtrip() mints a trade id per trade and stamps it on the instrument.
  • The exporter tests build their payloads through one helper that does the same.
  • The importer's nil-id contract is unchanged.

4. Tasks

Task State Start End Description
Scaffold story: Hotfix: the export joins on a trade id nobody mints 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.
Implement Hotfix: the export joins on a trade id nobody mints DONE   2026-10-09 Initial task for: Hotfix: the export joins on a trade id nobody mints

5. Decisions

  • Mint in the two builders that bypass the planner, and leave the importer alone. The importer leaving ids unset is a contract xml_trade_import_tests asserts; the planner is what fills them on the import path. The roundtrip walk and the exporter tests have no planner, so they mint their own, mirroring what it does.

6. Out of scope

  • The importer's nil-id contract.
  • trade_export_item.anchor.id being the join key while the batch is keyed by trade_id. The two are made equal here; whether one should be derived from the other is a change of its own.

7. Result

Done. xml::roundtrip() stamps a minted id onto each instrument, and the exporter tests share a make_export_payload helper with their assertions unchanged.

Emacs 29.3 (Org mode 9.6.15)