## Property-Based Tests for Build Synthesis ## ## **Feature: nip-dependency-resolution, Property 7: Build Determinism** ## **Validates: Requirements 8.1, 8.2, 8.3** ## ## Property: For any build configuration, calculating the build hash multiple times ## produces the same result. This ensures reproducibility - same inputs always ## produce same outputs. import std/[unittest, random, strutils, sequtils, times] import ../src/nip/resolver/build_synthesis import ../src/nip/resolver/variant_types # Generator for random variant profiles proc generateRandomVariantProfile(): VariantProfile = var profile = newVariantProfile() # Add random domains let domains = @["optimization", "security", "features", "network"] let flags = @["lto", "hardened", "wayland", "vulkan", "ipv6", "ssl", "zstd"] for domain in domains: if rand(0..1) == 0: # 50% chance to include domain let numFlags = rand(1..3) for _ in 0..