Repository navigation
feat(compliance): PCI/saude field patterns + learned anti-generic (#1318, #1327) - #1345
Merged
FabioLeitao merged 2 commits intoJul 27, 2026
Merged
Conversation
…1327) Enrich public compliance samples with synthetic column-header regex only: PCI tokenized metadata (scope reduction), PAN/CVV/expiry/track; CID-10 and health-plan columns for brazil_saude; LGPD address components; FELCA minor prefixed columns. Bilingual terms and recommendation_overrides preserved.
…1327) Expand _GENERIC_TERMS for migration/audit metadata; add separate *_log suffix check (exact frozenset cannot express suffix). Synthetic tests for PCI tokenized table, CID column, geoloc/minor detection, and learn noise. Update compliance-samples README (EN + pt-BR).
FabioLeitao
deleted the
fix/1318-1327-compliance-patterns-field-generalization
branch
August 28, 2026 17:35
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
PCI_CARD_COLUMN), CVV (PCI_CVV), expiry, track data, and tokenized metadata (PCI_TOKENIZED_METADATA— scope-reduction signal with INFORMATIVO override, not violation). Bilingual EN/PT terms; overrides for Req. 3 / 3.2.PHI_CID10_COLandPHI_HEALTH_PLANcolumn-header patterns; bilingual terms; HIGH overrides (LGPD Art. 11).LGPD_ADDRESS_COMPONENTfor full address schema (CEP, street, city, …);FELCA_MINOR_COLUMNfor prefixed minor fields without duplicating existing\bregex blocks.core/learned_patterns.pyexpands_GENERIC_TERMS(audit/migration metadata) plus a separate_logsuffix check — frozenset exact match cannot express suffix rules without regex inside the set.tests/test_compliance_field_patterns_1318_1327.py— synthetic tokenized card table, raw PAN column, CID column, geoloc/minor detection, audit columns excluded from learn path.learned_patterns*.yamlcommitted; allowlist entries only for sanctioned geolocation column-name tokens in public compliance samples.Closes #1318
Closes #1327
Test plan
uv run pytest tests/test_compliance_field_patterns_1318_1327.py tests/test_learned_patterns.py tests/test_compliance_samples.py -q./scripts/check-all.sh --enforcedgreen