Task: Guard every reflected struct against the C1202 limit

Table of Contents

This page documents a task in the Teach the code generator the trade shape story. It captures the goal, current status, acceptance, and any notes or results.

1. Goal

Turn the nine-field rule of Data-Oriented Design in ORE Studio into a check, so a model that would break the MSVC build fails before it is generated.

Abandoned: the rule does not hold. See the Result.

2. Status

Field Value
State ABANDONED
Parent story Teach the code generator the trade shape
Now Nothing.
Waiting on Nothing.
Next Nothing.
Last touched 2026-10-03

3. Acceptance

  • A check counts each model's effective fields, a nested field group counting as one.
  • The check runs in the codegen test suite and fails above nine.
  • Every model in the tree passes, or carries a recorded exception.

4. Plan

Before building the check, render every model's reflected struct and count its top-level members, to size the set of exceptions.

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
Reflected structs rendered from models (entities and field groups) 287 A scratch script rendering cpp_domain_type_class.hpp and cpp_field_group.hpp for every projects/*/modeling/*.org and counting top-level members 7f78712d27
Of those, structs with more than nine members 220 Same script 7f78712d27
Largest member count 59 (commodity_future_convention) Same script; confirmed by counting the committed header 7f78712d27
Type in today's MSVC C1202 bond_instrument_data, 27 members, hand-written gh run view on the continuous-windows.yml run of 2026-10-02 17:36, instrument_payload.cpp:81 main

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
#2532 [agile] Abandon the C1202 guard and close the code generator story

9. Review

# Comment summary File Decision Notes
1 Stale C1202 claims elsewhere investigation, dq capture Accept Pointers to the correction added.
2 Line 81 not in instrument_payload.cpp capture Clarify The CI log puts the rfl::json::write call at instrument_payload.cpp(81); the capture now names the file for each line.
3 Sprint row start date empty sprint.org Accept Filled; the row description now matches the re-scoped story.
4 Goal reads as live task Accept Pointer to the Result under the goal.
5 Cause stated from the CI log only capture Accept Worded as per the CI log, not reproduced locally.
6 Schedule the capture soon capture Leave A prioritisation call for the product owner.

10. Result

Abandoned before any code was written. The nine-member rule it set out to enforce does not hold:

  • 220 of the 287 reflected structs the models generate have more than nine members, up to 59, and the Windows build compiles them.
  • The C1202 that fails main today is in instrument_payload.cpp, on bond_instrument_data, a hand-written carrier. reflect-cpp writes it as a tagged variant alternative and builds one literal over every field name reachable from it.

A cap on generated structs would need 220 recorded exceptions and would still not see the failing type. Instead:

  • The decomposition section of Data-Oriented Design now states what the limit counts, with these measurements.
  • The field group doc template no longer cites the nine-member figure.
  • Section 16 of the trade shape investigation carries a dated note that supersedes it.
  • The story's acceptance line now asks for the measured rule, not the guard.
  • MSVC fails C1202 on the bond export carrier files the Windows break, which no sprint-26 story owned.

Emacs 29.3 (Org mode 9.6.15)