Skip to content

Collapse other's per-file reference scoping into plot_assembly #91

Description

@AlexisJanin

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

  • other/find_load_format.py no longer maps section keys to qualifier functions, and imports nothing from plot_types.
  • Per-file other::<stem> derived sections are desugared in plot_assembly, by the same code path as per-datasource ones.
  • Both config spellings stay valid — no parser change, no config migration (as in Lift PlotGroup assembly out of wrapper.main into plot_assembly.py #89).
  • Snapshot tests unchanged.
  • Evaluate whether schema.py / plot.py should 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.

Metadata

Metadata

Assignees

Labels

Code qualityImprove overall code quality (maintainability, robustness, readability)enhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions