feat: replace MeaningUnitAspect enum with open-ended str#206
feat: replace MeaningUnitAspect enum with open-ended str#206asteier2026 wants to merge 2 commits into
Conversation
The enum was causing record loss when the model returned values like "goal" or "symptom" that weren't enumerated. Aspect is now an unvalidated str to accommodate open-ended LLM output. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: asteier2026 <asteier@nvidia.com>
Greptile SummaryThis PR replaces the closed
Confidence Score: 4/5Safe to merge for the aspect fix, but the importance field on both MeaningUnitSchema and QualityQAItemSchema remains a 2-value closed enum that can still silently drop records for the same reason the PR was written. The PR correctly opens up aspect validation, but MeaningUnitImportance is still a closed 2-value enum on both schemas. Any LLM response with an importance value outside 'critical'/'important' will cause a Pydantic validation failure and silently drop the record — the exact failure mode the PR's motivation describes. src/anonymizer/engine/schemas/rewrite.py — the MeaningUnitImportance enum and its usage in both MeaningUnitSchema and QualityQAItemSchema warrants a second look. Important Files Changed
|
…hema.aspect Empty strings are structurally valid but semantically meaningless; guard against them consistently with the other non-id string fields in these schemas. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: asteier2026 <asteier@nvidia.com>
Summary
MeaningUnitAspectenum fromEntityDispositionSchemaandschemas/__init__.pyMeaningUnitSchema.aspectfromMeaningUnitAspecttostrMotivation
The enum was causing record loss: the model returns open-ended aspect values like
"goal","symptom","diagnosis"that can't be exhaustively enumerated. Validation errors were silently dropping records.