Task: Seed the stress shift families and shift types
Table of Contents
This page documents a task in the Model the ORE report configuration as entities story. It captures the goal, current status, acceptance, and any notes or results.
1. Goal
The database refuses a stress shift family or shift type ORE does not have.
2. Status
| Field | Value |
|---|---|
| State | DONE |
| Parent story | Model the ORE report configuration as entities |
| Now | Nothing. |
| Waiting on | Nothing. |
| Next | Nothing. |
| Last touched | 2026-10-02 |
3. Acceptance
- Seeded lookups hold the shift families and shift types
stress.xsddefines, derived with the command recorded. stress_test_shift.familyandstress_test_shift.shift_typerefer to them, and an unknown value is refused on insert.- The stress test corpus and database round trips still pass.
4. Plan
- The families are the sixteen children of the
stresstesttype inexternal/ore/xsd/stress.xsd, apart fromDate. They are exactly the sixteen strings the stress test mapper writes intostress_test_shift.family. - The shift types are the
shiftTypeenumeration inexternal/ore/xsd/ore_types.xsd:Relative,Absolute,EqualTo. The sensitivity configuration uses the same enumeration, so the lookup is namedshift_type, not after stress. - Both are analytics lookups seeded for the system tenant and readable by every
tenant, as
pricing_engine_typeis, and the shift's foreign keys resolve under the system tenant. - No stress database round trip existed, so this task adds one, over the corpus file that applies shifts in ten families and uses all three types, with a refusal case for each column and a test that pins both seeds to the schemas.
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 |
|---|---|---|---|
| Shift families in the schema | 16 | children of stresstest in stress.xsd, apart from Date |
4b5499c45d |
| Shift types in the schema | 3 (Relative, Absolute, EqualTo) |
shiftType enumeration in ore_types.xsd |
4b5499c45d |
| Corpus shift type values | Absolute 252, Relative 61, EqualTo 2, over 19 documents |
corpus walk of ShiftType in StressTesting roots |
4b5499c45d |
Families and types in MarketRisk/Input/stresstest.xml |
14 family elements, 10 of them holding shifts; 3 types | the same walk, per document; shift rows counted by the database round trip | 4b5499c45d |
6. Notes
stress_test_shiftalso carries anextrascolumn of name and value pairs, which the story's acceptance rules out. It is outside this task, which is about the family and the shift type: Replace the stress shift extras with typed rows.
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 |
|---|---|
| #2541 | [analytics] Seed the stress shift families and shift types |
9. Review
| # | Comment summary | File | Decision | Notes |
|---|---|---|---|---|
| 1 | Unrelated generated shell scripts in the diff | projects/ores.shell/scripts/library | No change | The tangle regenerates every script from the recipes, and the shell script drift gate fails a PR whose scripts lag the recipes; these caught up with recipes merged in PR 2539. |
| 2 | The migration guard skips a null family | analytics_stress_shift_vocabulary_migration.sql | No change | family is not null in the model and the table. |
| 3 | The follow-up must remove the in-memory comparison | task_type-the-stress-shift-extras.org | Accept | Added to that task's acceptance. |
| 4 | Generated lookup code is near-identical | generated files | No change | Generated; fixes belong in the templates. |
10. Result
- New analytics lookups
stress_shift_family(16 rows) andshift_type(3 rows), seeded for the system tenant fromstress.xsdandore_types.xsd, readable by every tenant. stress_test_shift.familyandstress_test_shift.shift_typeare soft foreign keys resolved under the system tenant; an unknown value is refused on insert.- New tests: the seeds pinned to the schemas; a stress database round trip over
MarketRisk/Input/stresstest.xml, ten families and three types, compared with the mapper's in-memory round trip; one refusal case per column. - Migration
analytics_stress_shift_vocabulary_migration.sqlfor existing databases, refusing while a current shift names a value outside the schemas. - Build clean; ctest 89/89 after a database recreate.
- Found on the way and filed: the shift's
extrascolumn of name and value pairs, and the mapper dropping an empty family element, in Replace the stress shift extras with typed rows.