You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix what the review found, and teach the audit about inheritance
Five real findings, one of them hiding the others.
**A search needs a tuner, not only a target.** Both evaluation strategies
guarded on `self.optimizer and self.run_optimizable_parameters`; the units kept
only the second half. `Run.optimizer_name` is a plain string and the wizard
leaves it empty when no search is asked for, while the model may still declare
a parameter optimizable -- a combination that has always meant "fit it once
with the values given". It had become a lookup of the empty string in the
registry, surfacing as "Metric is not compatible with the Task. ''", a message
with nothing to do with what happened. Reproduced, fixed with a shared
`_will_search`, and pinned by a test.
**The nested unit was not being audited at all.** `_unit_class` matched only
classes whose direct base is literally `BaseUnit`, so a unit that extends
another unit fell out of every contract check -- and would have failed them,
because its PROVIDES are written by the parent's body rather than its own. It
is the same blindness a shared helper causes, arriving by inheritance instead:
the audit reads one class's source. It now follows the lineage for
declarations, context calls and config reads. 32 audited units became 33.
**The inner splitter was resolved unconditionally**, so a run still carrying a
nested configuration it no longer uses failed on a splitter it would never have
touched.
**The fold branch hardcoded `splits=["TEST"]`** where the holdout branch derives
it from SCORED_SPLITS. Latent today -- no strategy excludes TEST -- but it is
exactly the coupling this work exists to remove.
And a docstring describing `{split: [scores]}` for something shaped
`{split: {metric: [scores]}}`.
Two findings were left alone, deliberately. `best_parameters` is published
without being in PROVIDES, which is the already-declared limitation that there
is no way to express an optional output; the new units repeat it rather than
inventing an exception to it. And per-fold progress reporting is gone, which is
a real regression: restoring it needs a callback in a unit's contract, and a
runtime parameter the engine cannot supply makes the unit unusable as a node --
the static validator rejects it. Both are recorded rather than patched over.
Whole suite: 3692 passed.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
0 commit comments