Task: Mop up the codegen snags the parts guard left
Table of Contents
This page documents a task in the Add entity groups and finish the remaining codegen work story. It captures the goal, current status, acceptance, and any notes or results.
1. Goal
Delete the guard in generate.py that keeps the codegen graph out of a sub-component project's CMake. Every part's src/CMakeLists.txt and tests/CMakeLists.txt is generated from its model again, and the two files main hand-wrote against their templates are reconciled rather than reverted.
2. Status
| Field | Value |
|---|---|
| State | DONE |
| Parent story | Add entity groups and finish the remaining codegen work |
| Now | Nothing. |
| Waiting on | Nothing. |
| Next | Nothing. |
| Last touched | 2026-10-16 |
3. Acceptance
- The ores.cmake.* guard in generate.py is gone, and the graph renders a part's CMake the way it renders any other component's.
- Every component's link list is model-derived: the api, core and service src templates carry the baseline, and a component that deviates says so in extra_dependencies. No component's links change.
- ores.cmake.component.api_src and .core_src emit component_files.cmake rather than file(GLOB_RECURSE), completing the 2026-07-30 migration that 88 of the 94 checked-in files already follow.
- ores.geo's CMake is regenerated from its model, with the ores.database and ores.telemetry.core links its sources need, and the component builds.
- ores.history/api declares header_only, so its template emits the INTERFACE library it is hand-written as.
- compass check passes, whole-tree build and ctest included.
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
Work in progress on feature/mop-up-the-codegen-snags-the-parts-guard-left.
The guard is lifted, the link libraries are modelled, and no
src/CMakeLists.txt loses a link. It does not build yet, and the reason is
the finding below.
6.1. Lifting the guard exposed more than link lists
Two things the task did not anticipate.
- No part declared
#+component_kind:, so all of them defaulted toflatand the flat archetype served every one – deleting the service executables and using the wrong baseline. 47 parts now declareapi,coreorservice, and the 17 that becameservicecarry:ores.cpp.service-app.enabled: nilso the service-app facet does not overwrite theapp,configandmain.cppthey own by hand.ores.telemetry/corestays flat on purpose: the core template links a siblingores.telemetry.api.liband there is no api part. - 59 components lost links – 281 tokens – because the hand-maintained files
carry links the baseline does not. 56
extra_dependenciesblocks now declare them.
6.2. Still open: hand-written CMake that is not a link
Regeneration also deletes hand-written content the templates cannot express.
Each of these needs a paste point, the mechanism ores.storage/service uses:
- Every api part loses
-fvisibility=hidden -fvisibility-inlines-hidden, which the hand files carry andores.cmake.component.api_srcdoes not emit. ores.http/serverloses the block that installsscripts/generate_keys.shinto the runtime directory.ores.ore/coreandores.dq/corelose MSVC/bigobj;ores.ore/corealso losesset_source_files_properties(... -Wno-unused-const-variable ...).ores.trading/apiloses MSVC/constexpr:and Clang-fbracket-depth;ores.trading/coreloses its WIN32STATIChandling and platform-conditional install.ores.telemetry/databaseloses twotarget_include_directoriesentries (ores.telemetry/core/include,ores.logging/include); they should arrive transitively through the linked targets, but that is not proven.ores.synthetic/coreloses${CMAKE_CURRENT_SOURCE_DIR}from its include dirs.
Five tests/CMakeLists.txt were materialised for ores.compute/client,
ores.compute/wrapper, ores.http/core, ores.http/server and
ores.iam/client; their roots gained add_subdirectory(tests).
v –sweep is clean and --component is clean for history, geo,
storage-cpp and refdata. The whole-tree build has not been run.
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 |
|---|---|
| #3436 | [ci] Drop the Xcode comment |
| #3435 | [ci] Drop the comment about the retired macos-14 runner |
| #3433 | [agile] Capture the non-systemd fleet start |
| #3432 | [codegen] Land the CMake model diagnostics |
| #3430 | [codegen] Make hidden visibility a part decision and green the build |
| #3428 | [codegen] Carry every link call a part CMake made |
| #3424 | [agile] Close the codegen mop-up task |
| #3422 | [codegen] Model the part CMake content and lift the guard |
| #3400 | [agile] File the codegen mop-up task |
9. Review
| Comment summary | File | Decision | Notes |
|---|---|---|---|
10. Result
The parts declare their CMake in the model and the templates render it, so no
part carries hand-maintained CMake any more. The CMake facet guard is gone:
every part renders its own CMakeLists.txt.
The model gained:
extra_dependenciesandextra_test_dependencieson 50 components, carrying the hand file link block verbatim: the link sections, the visibility of each library, and thefind_packagecalls that define the imported targets.cmake_prologueandcmake_finalizepaste points on every src archetype and on both branches of the header-only ones, so a hand-written prologue and a hand-written install rule survive regeneration.#+component_kind:on 47 parts,#+test_fixture: noneonores.analytics/quant,#+win32_static_library: trueonores.trading/core, and:ores.cpp.service-app.enabled: nilon the 17 service parts that keep a hand-ownedsrc/app,src/configandmain.cpp.component_files.cmakefor the five test directories the parts materialised.
Merged as 8a876fbda8: 356 files, 7083 insertions, 818 deletions, 11 commits.
The verification state is not a whole-tree build. CMake configure completed for
all 5901 targets with no error, and git merge-tree reported no conflict with
the main the PR merged into. Compilation reached object 980 of 5901 –
ores.dq/api, ores.iam/api, ores.telemetry/core and ores.refdata/api –
with no compile error, then stopped on request. The remaining 4921 objects never
compiled, ./compass.sh check never ran, and the branch was 107 commits behind
main when it merged.
11. Remaining
The merge landed without a whole-tree build. Nothing else in this task remains,
but the merge is unproven until that build runs. The four layers the hand part
CMake carried are link lists, link visibility, find_package calls, and
compiler options, includes and install rules. The first three are now modelled.
The fourth still comes from the per-component paste points, so a part that
hand-sets a compiler flag or an include directory keeps it by declaration, not by
model.
The CMake content is now covered. Two paste points, cmake_prologue before
the library target and cmake_finalize before its install rule, are in every
src archetype and in both branches of the header-only ones. The seven places
that lost content declare it, and ores.trading/core declares
#+win32_static_library: true because its WIN32 STATIC choice replaces the
template's add_library rather than adding to it.
What still stood in the way when the merge landed:
test_handler_permissionsfails two tests on main: six permission codes are not seeded and the handlers added inc759acec1freference them. Captured, and not caused by this branch.- The whole-tree build has not been run. It is the only thing that can prove the link lists, the compile options and the includes all still hold.
ores.telemetry/databaselost twotarget_include_directoriesentries that are now redeclared; whether they were needed at all, given the linked targets, was not established.