2026-04-25
Session 33: get_config / set_config drain
Engineering log for session 33.
Baseline: session 32 drained add_metric / remove_metric. Session 33 drains the last two drainable secondary verbs — get_config / set_config. Every drainable verb on the public surface is now native; only setup() inside fit() and the Phase-3 plot verbs remain on _legacy.
CHANGED — engine#
CHANGED—Experiment.get_config(variable=None)drained. Reads fromself._fit_state(data accessors, transformed splits, registries) + constructor params onself. Withvariable=Nonereturns the sorted list of accessible names. RaisesValueErrorfor unknown names. Includes legacy aliases:seed→self.session_id,pipeline→_fit_state["preprocess_pipeline"].CHANGED, BREAKING—Experiment.set_config(variable=None, value=None, **kwargs)drained, with a tight allowlist._SETTABLE_CONFIG_KEYS = {"session_id", "n_jobs", "verbose", "fold", "log_experiment"}. Anything outside this set raisesValueError(with a message pointing to re-creating the Experiment). Underscore-prefixed names are explicitly rejected. Mixing positionalvariable+**kwargsraises (legacy semantics).CHANGED, BREAKING—set_configno longer silently mutates snapshot-invalidating params. Legacyset_config("target", "newcol")would silently updateself.targetbut NOT propagate to the snapshot, leading to a confusing partial-mutation state. The new version refuses + tells the user.
ADDED — tests#
ADDED—packages/engine/tests/test_session33_config.py— 10 tests covering: full-listget_config(None), snapshot identity reads (get_config("X_train") is exp.X_train),seed/pipelinealiases, unknown-variable rejection, single + bulkset_config, non-settable / underscore / mixed-call-shape rejection. Drain-locks for both verbs.
INTERNAL#
INTERNAL— Tight allowlist rationale. Legacyset_configallowed mutation of any_variable_keys.difference(_property_keys)entry, which was a moving target. Tight allowlist makes the contract explicit + future-proof: adding a new safe-to-mutate param is one line in_SETTABLE_CONFIG_KEYS. Mutating something that affects the snapshot (target, train_size, fold_strategy) is properly an error in 4.0 because the snapshot won't update.INTERNAL— Why aliases.seedis more idiomatic thansession_id(sklearn / numpy convention), but the constructor takessession_idfor clarity (it doesn't seed a global state — it's the per-Experiment session ID that becomes the random_state for downstream models). Supporting both names inget_configmatches what notebook code already uses.
Session 33 delta summary#
| Metric | Session 32 end | Session 33 end |
|---|---|---|
Drainable secondary verbs still on _legacy | 2 | 0 ✅ |
| Engine tests (fast + slow) | 131 | 141 |
| Combined tests | 277 | 287 |