Task: Build the cut data model
Table of Contents
This page documents a task in the Rework the market data feeds into a market data service with adapters — the remaining work story. It captures the goal, current status, acceptance, and any notes or results.
1. Goal
The cut and its type exist as data, a report selects a cut, the run resolves it, and the resolved cut and retention are recorded.
2. Status
| Field | Value |
|---|---|
| State | DONE |
| Parent story | Rework the market data feeds into a market data service with adapters — the remaining work |
| Now | Nothing. |
| Waiting on | Nothing. |
| Next | Nothing. |
| Last touched | 2026-10-31 |
3. Acceptance
- The cut type lookup exists with its approval_kind_code FK, its resolution rule and its retention.
- The cut entity records the body references, the acts, the gaps and the retention copy, and its state is derived.
- A report definition carries a cut selection, and the run resolves and records it.
- The retention is copied on take and read by nothing yet; the archive is a later task.
- The codegen, the SQL populate, the tests and the checks pass.
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 |
|---|---|---|---|
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 |
|---|---|
| #4212 | [reporting] Build the cut data model |
9. Review
| Comment summary | File | Decision | Notes |
|---|---|---|---|
10. Result
The cut data model is built, reviewed and repaired.
- The cut kinds: the family, resolution-rule and kind lookups, the seven types (EOD, EOM, EOY, SOD, IPV, FLASH, LIVE), the two signed approval kinds and the per-kind retention. The kind's approval is a nullable FK to the inbox approval kinds; the signed-or-not is derived from it.
- The report's selection on the definition (cut_kind_code, cut_id) and the run's resolved cut (cut_id, cut_label, cut_kind_code, cut_timepoint).
- The cut entity: the body references, the gaps, the acts, the indicative mark and the retention copy; the state derived and stored nowhere; supersession computed in production.
- The resolution operation for EOD (with the month-end and year-end fallbacks), EOM, EOY, SOD, IPV, LIVE (minted at the run) and a pinned cut, serving the preview and the run. The report-instance trigger resolves and records the cut where the covered date, scope and centre are stated.
- The widened unique index (tenant, kind, party, scope, centre, timepoint, ordinal), and the cut's generic writes removed with client_read_only, so nothing bypasses the copy rule.
- The two-axis review (Standards and Spec) was run; every finding was closed: the permissions seeded and granted (the gate passes), the indicative mark on the cut and in the resolution, supersession in production, the permission inversion, the unique index, the copy bypass, the ER diagrams, the test conventions and coverage, the cut_book claim and the grammar.
- Checks: the handler-permission gate, lint, the codegen, the SQL validators, the ER diagram check, and the reporting core/api/service and scheduler suites (213 + 69 + 10 + 24 cases) passing on the rebased tree.
Left deliberately: a scheduled firing records no resolved cut (the covered date, scope and centre are the run's and the schedule does not carry them); the take raises no inbox approval request (the hand-take surface does not exist in this component); the configuration_market_binding retirement is deferred because the run document still builds its market data from those rows.