Task: Generate the curve collection wiring

Table of Contents

This page documents a task in the Standardise the curve configuration's parameters on the one contract story. It captures the goal, current status, acceptance, and any notes or results.

1. Goal

The child collections a curve entry holds, their tables and their per-kind leaves, come from the projection as every other column of the page does.

2. Status

Field Value
State DONE
Parent story Standardise the curve configuration's parameters on the one contract
Now Nothing.
Waiting on Nothing.
Next Nothing.
Last touched 2026-10-30

3. Acceptance

  • The generator emits, for each section, the collections its entries hold: the element, the table, the vector, the join column and the kind column.
  • It emits, for each kind, the leaves that kind reads, with the ORE element each column holds.
  • The BFF and the page read those rules instead of holding a table, and no hand-written map of a segment's leaves remains.
  • A check fails when the generated rules and the projection disagree.

4. Plan

1. Read the collection from the projection's own readers:
   =import_context::segment= names the row, the vector, the key back to the entry
   and the kind column; =import_quotes= names the column a quote joins by; the
   section's call to =import_segments= names the block.
2. Read the leaves each kind reads from =import_segments= and
   =common_settings=, in the order the projection reads them, so the screen
   offers a kind's leaves and not the row's columns.
3. Delete the BFF's table, its column blacklist and its column-name guess, and
   read the generated rules instead.
4. Fail the generator when a section holds a =Segments= block that its call
   pattern does not read, and when a kind reads no leaves.

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
Sections wired 19 python3 projects/ores.sql/utility/generate_curve_section_parameters.py this branch
Entry parameters 250 as above this branch
Blocks 31 as above this branch
Collections 1 as above this branch
Kinds the collection states 12 as above this branch
Leaves the kinds read 58 counted on the generated module's kinds this branch
BFF suite 1144 pass npx vitest run in packages/bff this branch
Browser suite 2333 pass, 3 fail npx vitest run in packages/web this branch
Hand-written table removed git diff -- projects/ores.web/packages/bff/src/curve-configuration.ts this branch

6. Notes

The three browser failures are src/shell/cards.test.ts, which reports synthetic: "Simulator" but the screen says "Synthetic" in all three languages. They fail on main without this change, which a stash confirmed; the fix is a product decision, so it is recorded rather than taken here.

The leaves a kind reads are not the leaves the row has columns for. A Simple segment reads Conventions, PillarChoice, Priority, MinDistance and ProjectionCurve; a FittedBond one reads no conventions at all. Reading the kind's leaves is what stops the screen offering a leaf of another kind, which the QA walk recorded as a snag.

7. Result

The collection wiring is the projection's. The generator reads the segment row, the vector, the join, the kind column, the quote join and the block from the projection's readers, and the leaves each kind reads from the projection's own dispatch. The BFF holds no table: it reads the generated wiring, and the column blacklist and the column-name guess that stood in for the kind's leaves are gone.

A section that holds a Segments block the call pattern does not read, and a kind the parser finds no leaves for, both fail the generator instead of reaching a screen with no rows.

8. 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
     

9. PRs

PR Title
#4116 [agile] Record the leaves the contract does not carry
#4113 [agile] Close the curve wiring task
#4111 [web] Read the curve collections from the projection

10. Review

Comment summary File Decision Notes
       

11. Result

Emacs 29.3 (Org mode 9.6.15)