Story: refdata fixtures depend on a currency row no fixture writes

Table of Contents

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

1. Goal

No refdata fixture depends on synthetic state another test may or may not have written: every currency code a fixture references is seeded by that same fixture.

2. Status

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

3. Acceptance

  • The book and portfolio generators carry no invented parent code, and their comments state the real rule.
  • Every fixture that writes a generated book or portfolio seeds each currency that row references.
  • ores.refdata.core.tests and the full suite pass, and no suite depends on the synthetic-currency counter's first value.

4. Tasks

Task State Start End Description
Seed every currency the refdata fixtures reference DONE 2026-09-11 2026-09-11 The eventing-test template seeds a soft-FK parent's own mandatory soft FKs and its country sentinel, but not the currency the parent's insert trigger validates. Adds a parent_seed_currency block to the template, wired through core.py, and corrects the generator comments that claimed every tenant already holds X-0.

5. Decisions

5.1. The fix belongs in the eventing-test template, not in the generated files

The test and the generators are codegen output: the test comes from cpp_nats_integration_test.cpp.mustache, tangled from ores.cpp.eventing-integration-test.nats_integration_test.org, and the generators from the entity orgs. An edit to a generated file is lost on the next regeneration, so the seed went into the template and its flag into core.py, and both entities were then regenerated.

5.2. X-0 stays, as a documented sentinel

Emptying the generators' currency field was the alternative. The column is non-nullable, no fixture can rely on a fixed code being valid, and the fixtures overwrite or seed the field anyway. So the generators keep X-0 and the comments now state what it is: a sentinel the fixtures seed, not a code the tenant is guaranteed to hold. The old comments asserted the opposite, and that false invariant is what hid the flake.

6. Out of scope

7. Result

Status at close: Complete.

Emacs 29.3 (Org mode 9.6.15)