feat(registry): implement Canonicalizer with NFC normalization and SHA-1 hashing #36

Merged
CoreRasurae merged 1 commits from feature/m1-registry-canonicalization into master 2026-06-10 10:58:39 +00:00

1 Commits

Author SHA1 Message Date
CoreRasurae 8fa9e7652d feat(registry): implement Canonicalizer with NFC normalization and SHA-1 hashing
CI / quality (pull_request) Successful in 42s
CI / lint (pull_request) Successful in 46s
CI / security (pull_request) Successful in 47s
CI / build (pull_request) Successful in 50s
CI / typecheck (pull_request) Successful in 1m4s
CI / integration_tests (pull_request) Successful in 1m9s
CI / unit_tests (pull_request) Successful in 3m43s
CI / coverage (pull_request) Successful in 3m42s
CI / status-check (pull_request) Successful in 3s
CI / lint (push) Successful in 59s
CI / typecheck (push) Successful in 58s
CI / quality (push) Successful in 1m5s
CI / security (push) Successful in 1m9s
CI / build (push) Successful in 51s
CI / integration_tests (push) Successful in 1m40s
CI / unit_tests (push) Successful in 3m53s
CI / coverage (push) Successful in 3m35s
CI / status-check (push) Successful in 3s
Create Canonicalizer class implementing Package Registry Standard v1.0.0 §6:
- NFC normalization of all string values via unicodedata.normalize
- Lexicographic key sorting for deterministic output
- Lifecycle field stripping (version, release_date)
- RFC-8785 canonical JSON serialization (no whitespace, sorted keys)
- SHA-1 content-addressed hashing via compute_package_id()
- Internal reference resolution with configurable resolver callback

10 integration test cases covering:
- Complex content canonicalization with lifecycle stripping
- Deterministic output across multiple runs
- Key sorting enforcement
- Unicode NFC normalization
- PackageId computation for all 8 package types
- Different content produces different output

ISSUES CLOSED: #25
2026-06-10 11:33:50 +01:00