ci: make ty type checking blocking#223
Conversation
Signed-off-by: Aaron Gonzales <aagonzales@nvidia.com>
Signed-off-by: Aaron Gonzales <aagonzales@nvidia.com>
Signed-off-by: Aaron Gonzales <aagonzales@nvidia.com>
Signed-off-by: Aaron Gonzales <aagonzales@nvidia.com>
Signed-off-by: Aaron Gonzales <aagonzales@nvidia.com>
Signed-off-by: Aaron Gonzales <aagonzales@nvidia.com>
Greptile SummaryThis PR promotes
Confidence Score: 4/5Safe to merge; the fixes are narrow and runtime-preserving with good test coverage for the new serialization path. All changes are mechanical type-correctness fixes or CI wiring. The three findings are minor: an assert that can be stripped under -O, a duplicate private protocol across five files, and resolve_model_aliases returning the original list by reference rather than a copy. None affect correctness in normal execution. src/anonymizer/interface/anonymizer.py (assert-based narrowing and duplicated protocol); src/anonymizer/engine/ndd/model_loader.py (list returned by reference). Important Files Changed
|
| privacy_goal = config.rewrite.privacy_goal | ||
| assert privacy_goal is not None # populated by Rewrite's model validator | ||
| rewrite_result = self._rewrite_runner.run( |
There was a problem hiding this comment.
assert for type narrowing can be stripped at runtime
assert privacy_goal is not None is valid as a type-checker hint, but Python's -O flag removes assert statements, so if the process is ever launched with optimizations the assertion is silently skipped and privacy_goal=None flows into rewrite_runner.run(). Prefer an explicit early-return or a short if ... raise guard that survives optimization mode.
Related Issue
No linked issue required: maintainer-owned CI, type-safety, and contributor-workflow maintenance.
Plan Document
No plan required: this is a bounded enforcement and boundary-hardening change developed and validated through review.
Summary
Type of Change
Contributor Checklist
Validation
make checkmake test— 1085 passed on the prior implementation headE2E model-service tests were not run because the changes do not alter model-provider or external-service execution.