chore: migrate harness dataclasses to Pydantic — 12 classes, -155 LOC (AC-489, AC-481)#596
Merged
jayscambler merged 2 commits intomainfrom Apr 1, 2026
Merged
Conversation
…481) Converted 12 dataclasses across 7 harness files from @DataClass to Pydantic BaseModel. Eliminates ~155 lines of to_dict/from_dict boilerplate. Files converted: - pipeline/objective_guardrail.py (2 classes) - pipeline/advancement.py (2 classes) - pipeline/holdout.py (2 classes) - scoring/backends.py (TrialResult only — RatingUpdate stays @DataClass) - evaluation/self_play.py (2 classes) - evaluation/dimensional.py (2 classes) NOT converted (frozen dataclasses with explicit is_dataclass tests): - adapt/types.py, audit/types.py, cost/types.py - optimizer/pareto.py (mixed Candidate @DataClass + ActionableSideInfo) Also fixed 3 test files: positional → keyword construction. 9 files changed, 72 insertions, 227 deletions (-155 net)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Migrated 12 harness dataclasses to Pydantic BaseModel, continuing the batch migration from analytics (#594) and knowledge (#595). -155 LOC net.
Changes
7 files, 12 classes converted:
pipeline/objective_guardrail.pypipeline/advancement.pypipeline/holdout.pyscoring/backends.pyevaluation/self_play.pyevaluation/dimensional.pyNOT converted (intentionally kept as @DataClass)
adapt/types.py,audit/types.py,cost/types.py— frozen dataclasses with explicitis_dataclass()testsoptimizer/pareto.py— mixed types with Candidate @DataClassVerification
ruff check src— all checks passedmypy src— zero errorspytest tests/— all tests passIssues
Continues AC-489 and AC-481 (analytics + knowledge + harness done)