Follow-up to #83, deliberately deferred out of it. Blocked by #83 — the registry seam has to exist first.
The smell
OtherDataSource knows what a spectrogram is.
other/find_load_format.py:114-118 holds PER_FILE_DERIVED_SECTIONS, mapping each derived-plot section key to a function that walks that section's config shape and prefixes every signal reference with <stem>::. That is a datasource carrying knowledge of the plot types — a layering inversion. It is also the site of the original PSD bug: the row was forgotten, so a per-file psd section validated cleanly and rendered nothing.
other does that scoping not because it understands plot types, but because it is the only thing that knows which files exist. Those two facts are separable.
The shape of the fix
ADR-0013 already established the rule one level up: config scope is desugared once — a per-datasource section is a namespace, and plot_assembly rewrites its references as qualified global ones at the head of assembly. other::<stem> is the same rule one level down: the file stem is a namespace inside the other datasource.
So other would inject its derived sections unqualified, keyed by stem, and plot_assembly would desugar them alongside the datasource-scoped ones it already handles.
Why it is worth doing
Why it was deferred out of #83
#83 is already XL. Folding this in would make it also relitigate an ADR that landed days earlier (#89 / ADR-0013), and if the desugaring merge turned out to be wrong it would be discovered buried inside a ~900-line refactor rather than in its own diff.
Acceptance sketch
Relations
Follow-up to #83. Same area as #89 / ADR-0013.
Follow-up to #83, deliberately deferred out of it. Blocked by #83 — the registry seam has to exist first.
The smell
OtherDataSourceknows what a spectrogram is.other/find_load_format.py:114-118holdsPER_FILE_DERIVED_SECTIONS, mapping each derived-plot section key to a function that walks that section's config shape and prefixes every signal reference with<stem>::. That is a datasource carrying knowledge of the plot types — a layering inversion. It is also the site of the original PSD bug: the row was forgotten, so a per-filepsdsection validated cleanly and rendered nothing.otherdoes that scoping not because it understands plot types, but because it is the only thing that knows which files exist. Those two facts are separable.The shape of the fix
ADR-0013 already established the rule one level up: config scope is desugared once — a per-datasource section is a namespace, and
plot_assemblyrewrites its references as qualified global ones at the head of assembly.other::<stem>is the same rule one level down: the file stem is a namespace inside theotherdatasource.So
otherwould inject its derived sections unqualified, keyed by stem, andplot_assemblywould desugar them alongside the datasource-scoped ones it already handles.Why it is worth doing
plot_types/package — one module per plot type #83,other/find_load_format.pystops importingplot_typesat all.otherno longer needing a plot type's config shape, the import-reachability constraint that forced Extract aplot_types/package — one module per plot type #83's two-file split relaxes.schema.pyandplot.pycould then merge per type — cheaply, because the registry seam is already in place.Why it was deferred out of #83
#83 is already XL. Folding this in would make it also relitigate an ADR that landed days earlier (#89 / ADR-0013), and if the desugaring merge turned out to be wrong it would be discovered buried inside a ~900-line refactor rather than in its own diff.
Acceptance sketch
other/find_load_format.pyno longer maps section keys to qualifier functions, and imports nothing fromplot_types.other::<stem>derived sections are desugared inplot_assembly, by the same code path as per-datasource ones.schema.py/plot.pyshould then merge per type; if so, do it here or open a third follow-up.Relations
Follow-up to #83. Same area as #89 / ADR-0013.