Deduplication Strategy
Identify duplicate records
- Duplicates likely occur on combination of: Package + Version + CVE_ID
- Keep only one record per unique combination
Deduplication process
- Track seen combinations using set:
{(package, version, cve_id)} - Skip record if combination already seen
- Keep first occurrence or apply priority rules if needed
- Track seen combinations using set:
Ordering
- Check if ground-truth expects specific sort order
- Likely order: by Package name, then Version, then CVE_ID
- Implement stable sort:
sorted(records, key=lambda x: (x['Package'], x['Version'], x['CVE_ID']))
Validation
- No duplicate (Package, Version, CVE_ID) combinations
- Order matches test expectations
- Record count matches ground-truth