feat: add split leakage and trajectory consistency validators#9
Open
VarshiniGunti wants to merge 2 commits into
Open
feat: add split leakage and trajectory consistency validators#9VarshiniGunti wants to merge 2 commits into
VarshiniGunti wants to merge 2 commits into
Conversation
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
This PR introduces focused data-integrity guardrails for the logs-to-training pipeline by adding two validation layers:
The scope is intentionally narrow and infrastructure-focused so it complements existing broad pipeline PRs without duplicating end-to-end ingestion/export implementations.
What’s Added
1. Split Leakage Validator
training_setup_logs/integrity.py2. Trajectory Consistency Validator
training_setup_logs/trajectory_validator.pytool_callmust includetool_call_idtool_resultmust includetool_call_idtool_resultmust map to a priortool_call3. Validator CLI
training_setup_logs/validate_cli.pyvalidate-splitsvalidate-trajectories4. Tests and Fixtures
tests/test_integrity.pytests/test_trajectory_validator.pyexamples/train_sample.jsonlexamples/val_sample.jsonlexamples/test_sample.jsonlexamples/trajectory_valid.jsonlexamples/trajectory_invalid.jsonl5. Documentation
README.mdwith usage commands and validator workflow for this PR prototypeWhy This Matters
This PR addresses two critical failure modes in training data preparation:
By adding these checks early, downstream SFT/DPO preparation can rely on cleaner, policy-aligned data.
Validation Performed
python -m py_compilefor new modules/testspython -m pytest -q(all tests passed)validate-splitsCLI run on sample split files (leakage intentionally detected)validate-trajectoriesCLI run on valid and invalid trajectory fixtures (expected pass/fail behavior)Files Included
training_setup_logs/integrity.pytraining_setup_logs/trajectory_validator.pytraining_setup_logs/validate_cli.pytests/test_integrity.pytests/test_trajectory_validator.pyexamples/train_sample.jsonlexamples/val_sample.jsonlexamples/test_sample.jsonlexamples/trajectory_valid.jsonlexamples/trajectory_invalid.jsonlREADME.md