Skip to content

Conversation

@seansica
Copy link
Contributor

Summary

  • Implements uniqueArray() utility function using Zod v4's check() method for array uniqueness validation
  • Applies uniqueness constraints to all STIX reference list properties (*_refs suffix):
    • object_marking_refs
    • x_mitre_tactic_refs
    • x_mitre_analytic_refs
  • Updates test expectations to reflect duplicate prevention behavior
  • Adds support for ATT&CK v18 SDO types (x-mitre-analytic, x-mitre-detection-strategy) in test data

The uniqueArray() function provides detailed error messages that specify which values are duplicated, improving the debugging experience. This prevents duplicate embedded relationships in STIX objects, ensuring data integrity across all reference properties.

Test plan

  • Verify uniqueArray() function correctly identifies and reports duplicate values
  • Confirm all *_refs properties enforce uniqueness constraints
  • Validate updated test expectations for detection-strategy schema
  • Ensure ATT&CK v18 SDO types are properly recognized in test data validation
  • Run full test suite to verify no regressions

- Add uniqueArray() utility function to validate array uniqueness with detailed error messages
- Apply uniqueness validation to all _refs properties (object_marking_refs, x_mitre_tactic_refs, x_mitre_analytic_refs)
- Update detection-strategy test expectations to align with new duplicate prevention behavior
- Add support for new ATT&CK v18 SDO types (x-mitre-analytic, x-mitre-detection-strategy) in test data validation

The uniqueArray() function uses Zod v4's check() method to report which specific values are duplicated, improving developer experience when validation fails. Reference list properties now properly enforce uniqueness constraints, preventing duplicate embedded relationships in STIX objects.
@seansica seansica requested a review from adpare November 21, 2025 16:29
@seansica seansica self-assigned this Nov 21, 2025
@seansica seansica added bug Something isn't working enhancement New feature or request labels Nov 21, 2025
@seansica seansica linked an issue Nov 21, 2025 that may be closed by this pull request
@seansica
Copy link
Contributor Author

Closes #57

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Detect duplicate mutable elements for analytics

2 participants