Task: Split the ER diagram by package

Table of Contents

This page documents a task in the Split the ER diagram by group story. It captures the goal, current status, acceptance, and any notes or results.

1. Goal

The generator writes one diagram per package plus an index, so a reader opens the part of the schema they want and every file renders.

2. Status

Field Value
State DONE
Parent story Split the ER diagram by group
Now Nothing.
Waiting on Nothing.
Next Nothing.
Last touched 2026-10-09

3. Acceptance

  • One .puml per package, named for it, plus an index that names the groups and the tables each holds.
  • Every generated diagram renders on this machine, with no raster overflow.
  • The policy for an edge that leaves its package is stated and implemented.

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
Diagrams generated 22: one per package and the index plantuml_er_generate.py --index-template 334f9acbfc
Diagrams that render 22 of 22, no exception plantuml -tpng at PLANTUML_LIMIT_SIZE=131072 over every file 334f9acbfc
Largest diagram dq_staging, 20436 x 11090 (226.6M px) same 334f9acbfc
Next largest refdata 4432 x 27026, trading 2743 x 26303 same 334f9acbfc
Index 6709 x 2483 (16.7M px) same 334f9acbfc
The old single diagram failed at about 2.68e9 px same -
codegen-tests pass, 51.9 s compass check --only codegen-tests da901c61e8
er-diagram, tangle-templates, org-links pass compass check --only er-diagram --only tangle-templates --only org-links da901c61e8

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
#2937 [codegen,sql] Split the ER diagram into one file per group

9. Review

Comment summary File Decision Notes
       

10. Result

The diagram is drawn one file per package, from the grouping the model already carried, and ores_schema.puml is the index over them. Every one of the 22 renders; the largest, dq_staging, is 226.6M pixels, against the single 463-table diagram that overflowed a 32-bit pixel count at about 2.68e9.

The policy for a key that leaves its package. A group draws its own tables and the keys with both ends inside it. A key that leaves is not drawn, because its other end is in another file; the group's note names those tables and the group each belongs to, so the reader knows where to go next. The note is emitted from both sides, so alpha names c_tbl (beta) and beta names b_tbl (alpha).

The index. It names every group, the file that group is drawn in and the tables it holds, and draws no columns and no keys, so it stays the starting point without being another picture to read.

The generator writes the group files beside --output and the index to --output itself, so the shell script, the CMake target and the check needed only the new --index-template. --check now walks every file and reports each stale or missing one rather than the first.

Emacs 29.3 (Org mode 9.6.15)