Task: Add structure kinds and templates
Table of Contents
This page documents a task in the Model trade structures story. It captures the goal, current status, acceptance, and any notes or results.
1. Goal
The kinds of structure and the templates that constrain their legs are reference data.
2. Status
| Field | Value |
|---|---|
| State | DONE |
| Parent story | Model trade structures |
| Now | Nothing. |
| Waiting on | Nothing. |
| Next | Nothing. |
| Last touched | 2026-10-05 |
3. Acceptance
- structure_kind is an immutable lookup seeded with strategy, typed, dynamic and package, each stating whether it confirms as a whole.
- structure_template names its kind and its roles with minimum and maximum leg counts, seeded for the common strategies.
4. Plan
(Implementation strategy. Written when work starts; key decisions
are distilled into the parent story's * Decisions at close, but the
plan itself stays — it is the historical record of what we did.)
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 |
|---|---|---|---|
| static checks on this branch | 5 of 5 pass | compass check --only handler-permissions --only create-reachability --only model-drift --only sql-hygiene --only populate-refs |
62a88df679 |
| create files the reachability check reports unreachable | 0 | check_sql_create_reachability.py |
62a88df679 |
| permission codes the handler check reports unseeded | 0, from 15 | check_handler_permissions.py |
62a88df679 |
6. Notes
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 |
|---|---|
| #2822 | [trading] Add the structure kinds and templates |
9. Review
| Comment summary | File | Decision | Notes |
|---|---|---|---|
10. Result
structure_kind states the four rungs of the composition ladder and which of
them confirms as a whole. structure_template names its kind from that
catalogue, and structure_template_role states each role's leg counts, with
the counts checked and a maximum of zero meaning no upper bound.
The seed carries the four rungs, the four common strategies the composition page names plus one typed product, and nine role rows. The nine handler permissions are seeded too, which the previous task's entities were missing.
The task closed on static validation alone, with its nine pgTAP cases written and never executed, and the seed data verified only by inspection. A follow-up ran them against a rebuilt database: all nine pass, so the seed and the template and role constraints are now proven by execution.
No build and no ctest ran on this task. The hourly build and test on main belongs to swift curie.