Task: Prove the credit round trip over the corpus

Table of Contents

This page documents a task in the Prove the credit round trip over the corpus story. It captures the goal, current status, acceptance, and any notes or results.

1. Goal

Every credit trade of Example_Trades comes back as the same family rows, and the proof states its coverage.

2. Status

Field Value
State DONE
Parent story Prove the credit round trip over the corpus
Now Nothing.
Waiting on Nothing.
Next Nothing.
Last touched 2026-10-11

3. Acceptance

  • The corpus test walks the eight credit documents and pins eight documents and eight trades.
  • A closed set of known differences is empty or names each loss with its reason.
  • The measurements carry their commands and the commit they were taken at.

4. Plan

  1. Port the rates proof. The credit proof walks Example_Trades, imports each credit document, exports each trade as a document of its own, imports it again and compares the family rows of the two imports. The rows are every table the family writes: the header, the six facts, the basket, the legs and their amounts and rates, the option rows and their children, the schedules and the strikes.
  2. Pin the corpus. A document that stops importing drops out of the walk, so the proof pins eight documents and eight trades.
  3. Close the set of known differences. The set is empty and fails in both directions: a name that differs fails the suite, and a name listed that stops differing fails it too.
  4. Show it can fail. Each trade must render a header row and a leg row, and a control changes one stored field and expects the rendering to change.

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
Credit documents and trades the proof walks 8 documents, 8 trades ctest --preset linux-clang-release-ninja -R ores.ore.core.tests (the case "every credit trade in the corpus comes back as the same family rows") 71ab465278
Trades whose family rows change on the round trip 0 the same case; the set of known differences is empty 71ab465278
ORE core suite 667 cases, 483,161 assertions, all pass the same command; raw output in evidence/credit_corpus_roundtrip_test_output.txt 71ab465278

6. Notes

  • The proof passed on its first run, so it carries a control. Each trade has to render a header row and a leg row, and a second case changes the recovery rate of a credit default swap and expects the rendering to change.
  • The proof compares the family rows of two imports. It does not compare the document text, so a spelling the table does not keep, such as false for a flag, is not a difference.
  • The treasury lock of an agreement's underlying is not in the corpus, so the proof does not cover it. The unit 7 task records the limit.
  • The proof needs a database only for the rest of the suite; it reads the corpus and the mappers.

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
#3358 [ore] Prove the credit round trip over the corpus

9. Review

# Comment summary File Decision Notes
1 The proof could pass without comparing anything xml_credit_corpus_roundtrip_tests.cpp accept Each trade must render a header and a leg row, and a control changes one field and expects a different rendering.
2 The compared rows are claimed to cover every table the family writes xml_credit_corpus_roundtrip_tests.cpp accept Checked each table against the Goal: the header, six facts, the basket, the legs with amounts and rates, the option block with its five children, the schedules with their dates, and the strikes are all rendered. The claim holds.
3 The measurements named a commit the rebase left behind task_prove-the-credit-round-trip-over-the-corpus.org accept The measurements now name the commit the suite was run at.
4 The test file failed clang-format xml_credit_corpus_roundtrip_tests.cpp accept Formatted. The `format` check is now clean.
5 `cmake-sources` fails: `ores.service/src/component_files.cmake` omits `step_command_stream.hpp` projects/ores.service/src/component_files.cmake accept Pre-existing on main, not from this branch: the header is on main and no branch lists it. Regenerated the file. Fixed here because the gate is the only gate and it blocks the change.
6 A document whose import throws is skipped without a word xml_credit_corpus_roundtrip_tests.cpp decline The rates corpus test, already merged, reads the same way. The `documents == 8` pin catches a document that drops out of the walk, so the silence cannot hide a loss.
7 The scratch directory is left behind when a `REQUIRE` aborts xml_credit_corpus_roundtrip_tests.cpp decline Sibling precedent again, and the directory is a temporary path the next run clears. No effect on the proof.

10. Result

Every credit trade of Example_Trades comes back as the same family rows. The proof walks eight documents with eight trades, pins both counts, and keeps a closed set of known differences that is empty. A control shows that a changed stored field changes the rendering, and each trade must hold a header row and a leg row.

Acceptance met: the corpus test pins eight documents and eight trades, the set of known differences is empty, and the measurements carry their commands. This is the last unit of the credit rework.

Emacs 29.3 (Org mode 9.6.15)