Materialize Google TN accepted corpus shards - #19
Merged
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
premove-write-google-tn-shardto materialize accepted Google TN records as immutable JSONL corpus shardsGoogleTnTrainingRecordliterally inside a provenance wrapperWhy
This creates the durable accepted-corpus pool between trusted Google ingestion and later dataset selection. These shards are not final train/validation data. They preserve every passing compiler record so balancing, deduplication, and stable split assignment can happen later without repeatedly scanning the raw corpus.
The final equivalence pass removes only presentation differences that preserve semantic value. It does not broaden unsupported classes or accept arbitrary punctuation changes.
Invariants
source_end_exclusiverecords the actual processed end, including short final rangesWithout these rules, partial files could look complete, multiple source files could collide, generation metadata could leak into the model record contract, or unsafe formatter disagreements could enter training labels.
Narrow equivalence policies
11,331==11331)5,661.38==5661.38)$7,000==$7000)(hour_24, minute), including hour-leading zeroes, 12/24-hour conversion, and AM/PM case/space/period variantsExplicit regressions keep these rejected:
11,33vs1133)$62,500vs$6200500)$7,000vsUSD 7000)00:12vs12:12)04:12vs04:13,4:02vs4:2)Two-batch result
The same final policy was rerun against both independent 10k batches:
[0, 10,000)[10,000, 20,000)The dangerous MONEY example remains rejected. Unsupported classes and the established rejection taxonomy remain unchanged. Generated shards and audits stay ignored by Git.
Validation
uv run ruff format --checkuv run ruff check .uv run pytest— 158 passedcargo test --manifest-path rust/Cargo.toml— 17 passedgit diff --checkuv run ruff format --check .— existing unrelated formatting failures remain intests/test_golden.pyandtests/test_types.py