Expand description
Migrating profiles written before raw-φ logging.
A schema-1 log stored standardized φ under a 30-coordinate feature set,
with no names. That is recoverable, because the profile persisted the
standardizer alongside it: raw = z·σ + μ inverts the transform exactly,
and the schema-1 coordinate order is known and fixed (SCHEMA1_NAMES).
What is not a pure re-labelling is that two of the current coordinates changed units. Those conversions are applied here rather than being papered over, because a value silently carried across a unit change is worse than a dropped one — it is evidence pointing the wrong way:
centroid_mean,rolloff_mean,zcr_meanmoved from a linear-Hz fraction of Nyquist to the octave axis. Exact: recover the frequency, re-map it.centroid_stdwas the spread of a linear-Hz quantity and is now the spread of a log one. There is no exact inverse for a spread, so it goes through the delta method — the local derivative of the axis map at the observation’s own centroid. First-order, and honest about it.crest,tail_ratio,attack_sare now logged. Exact.sizewas dropped from φ entirely (it was exactly collinear with the module counts). Dropped here too.n_mix,n_foldandn_chorusno longer exist as φ coordinates: the first left for the same collinearity reason assize, and the other two were folded into then_drive/n_mod_fxfamilies. A schema-1 vote carries no value for a family coordinate — it was never measured — so they are imputed at the mean like any other absent coordinate, rather than being re-derived from a count that answered a different question.
A φ coordinate that is renamed rather than dropped is a third case, and
the one that fails silently if nobody handles it. Both the schema-1 table
and every raw-φ observation already on disk store their coordinate names,
and FitSet::build matches on those names
— so renaming n_delay to n_time in wave 2A would have quietly imputed
that column at the mean for every vote ever cast, which reads as “this user
has no opinion about delays” rather than as a rename.
RENAMES carries the value across instead. That is exact, not a
convenience: n_time counts delays and granulators, and no observation
predating this wave can contain a granulator, so the old n_delay count
is the new coordinate’s value for every row being migrated.
Anything the migration cannot place is left at the new standardizer’s mean
by FitSet::build, which standardizes to
zero: “this vote says nothing about that axis”.
Constants§
- RENAMES
- φ coordinates that were renamed, as
(old name, current name). - SCHEM
A1_ NAMES - φ coordinate names as of schema 1, in vector order.
Functions§
- apply_
renames - Rewrite
RENAMES’d coordinate names in a log’s stored name lists. - migrate_
log - Rewrite a schema-1 log into the current schema, in place.
- needs_
migration - True when the log holds anything written before raw-φ logging.
- repair_
log - Pull out-of-domain cells in a stored log back inside their coordinate’s
range, and drop the rows that cannot be repaired. Returns
(cells clamped, observations dropped). - repair_
phi_ pair - The same repair for the implicit-event stream’s stored
phi_before/phi_afterpairs — the fourth carrier of raw φ in a saved session, after the pool, the log and the HELD tray, and the one that is easiest to forget because nothing reads it yet. - stamp_
names - Stamp current-schema observations that carry no names with
names— the synthetic-user and headless paths log raw φ without them, and a named log is what makes the next feature-set change survivable. - v1_
names - φ names as of the v1 stimulus: the 12 un-tagged audio coordinates plus the current (stimulus-independent) structural set.