Skip to content

Add Google TN ingestion audit milestone - #18

Merged
aryamantodkar merged 1 commit into
mainfrom
codex/add-google-tn-audit
Aug 23, 2026
Merged

Add Google TN ingestion audit milestone#18
aryamantodkar merged 1 commit into
mainfrom
codex/add-google-tn-audit

Conversation

@aryamantodkar

Copy link
Copy Markdown
Contributor

Summary

  • add a bounded premove-audit-google-tn command for reproducible Google TN ingestion audits
  • package the production Rust realizer as premove_itn._rust through Maturin and test the Python/Rust boundary
  • preserve Google PUNCT rows as context with punctuation-aware sentence assembly
  • accept only narrow DATE formatting equivalence (case, commas, and whitespace), while retaining the Rust realization as the training replacement
  • expose trusted candidate and match-kind information for acceptance analysis

Why

This freezes the first 10,000 Google TN sentences as the development milestone before evaluating a different 10,000-sentence generalization batch.

The objective is not to eliminate every rejection. It is to extract a large subset where every training label is trustworthy. Unsupported or semantically incompatible rows must continue to reject the whole sentence.

Invariants

  • LETTERS, VERBATIM, FRACTION, and ADDRESS remain quarantined.
  • Any quarantine or candidate rejection rejects the whole sentence.
  • Unsupported text is never silently converted to an O label.
  • DATE canonical matching removes only case, comma, and whitespace differences.
  • DATE order or semantic differences remain rejected.
  • The Rust realization, not the Google representation, becomes the accepted replacement.
  • Generated source data and audit reports remain outside Git.

Without these rules, the importer could accept semantically different written forms or train unsupported rows as context. The tests prove punctuation offsets remain exact, canonical DATE matches use the Rust target, DATE order/value mismatches fail closed, and the packaged Rust extension is the production realizer.

First 10k audit

  • processed: 10,000 sentences
  • accepted: 7,835 sentences (78.35%)
  • rejected: 2,165 sentences (21.65%)
  • all rejected sentences were captured in a local ignored audit artifact

The next 10k must be run without policy changes first. It is a generalization batch used to compare acceptance rate, quarantine distribution, DATE matching, and rejection taxonomy. New equivalence policies should be narrow, class-specific, semantically lossless, and verified against both batches.

Validation

  • uv run ruff check .
  • uv run pytest — 126 passed
  • cargo test --manifest-path rust/Cargo.toml — 17 passed
  • git diff --check
  • changed Python files pass uv run ruff format --check
  • uv run ruff format --check . — blocked by two pre-existing unformatted files not modified by this PR: tests/test_golden.py and tests/test_types.py

@aryamantodkar
aryamantodkar merged commit 9197099 into main Aug 23, 2026
@aryamantodkar
aryamantodkar deleted the codex/add-google-tn-audit branch August 23, 2026 10:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant