preprocessing.plan: frozen PreprocessPlan (steps, variants, state, gates,
bads, reasons) with checks, to_dict/from_dict (schema 1, unknown keys
refused) and a content hash; defaults DIRECTOR_CLUSTER and DIRECTOR_CLI
turn the route differences into data.
legacy.preprocessing maps the plan dict onto the director's
preproceso.procesar (vendored unchanged), refuses what his code cannot do
(zapline, other notch threshold, manual bads), returns MNE Raw variants and
the window grid flagged from his 4 s QC. Identical to the submodule for
both default plans.
The director's scripts (biomarcadores-tea/preproceso @ 7dfc641) are vendored
unchanged except imports by tools/vendor_legacy.py, one copy per legacy
module; --check re-derives them from the pinned submodule.
LegacyValidation runs steps 1-4 of un_estudio.procesar for an EDF
(edf_convert, lote.excluidos_para_qc + qc_estudio + veredicto, triaje.triar,
60% clean windows) plus preproceso.MIN_CUERO, and returns an R4B FHIR Bundle
and 0/1. Tests: identical to the submodule on a synthetic EDF, contract
suite, not-valid case, vendor check.
Step 3 of the plan. Spatially mixed pink noise, posterior rhythm in wake,
frontal slow waves and 13 Hz spindles in sleep, blinks, EKG, mains line,
channel faults (flat, frozen, clipped, bridge, loud, bursts) and
BAD_ACQ_SKIP gaps, written like ktlx2edf. Read by MNE and by the director's
edf_convert.leer_edf.
Step 2 of the plan. src/eeg/utils copied into tea_modulo.export with only the
imports changed; outside the EDF pipeline (extra `export`, script ktlx2edf).
Synthetic tests (ktlx_synth, edf export, patient) carried over: 43 pass.
Step 1 of the tea_modulo plan: Recording (MNE Raw from EDF), ValidationSummary,
Preprocessed, Labels, Study, the Validator/Preprocessor/Process/Biomarker
protocols with check_module(), reusable contract suites in contracts.testing,
and an AST test that enforces the module boundary rule.