save progress

This commit is contained in:
StellaOps Bot
2026-01-03 11:02:24 +02:00
parent ca578801fd
commit 83c37243e0
446 changed files with 22798 additions and 4031 deletions

View File

@@ -0,0 +1,35 @@
# StellaOps.Canonicalization
Deterministic ordering and canonical JSON helpers used across StellaOps.
## Canonical JSON Defaults
`CanonicalJsonSerializer` uses these defaults unless you pass your own `JsonSerializerOptions`:
- Property naming: `JsonNamingPolicy.CamelCase`
- Dictionary key naming: `JsonNamingPolicy.CamelCase`
- Null handling: omit null values
- Encoder: `JavaScriptEncoder.UnsafeRelaxedJsonEscaping`
- Number handling: strict
These defaults are chosen for deterministic output. If you need stricter escaping or a different naming policy, use `JsonSerializerOptions` explicitly.
## Dictionary Key Handling
`StableDictionaryConverter` sorts keys using ordinal comparison of a stable string representation:
- String keys use the provided dictionary key policy (if any).
- Non-string keys use invariant formatting when possible.
- Null keys are rejected.
- Duplicate keys after canonicalization are rejected to avoid ambiguous output.
## Date/Time Handling
`Iso8601DateTimeConverter` serializes `DateTimeOffset` values as UTC using the
format `yyyy-MM-ddTHH:mm:ss.fffZ`. When parsing, offset-less values are treated
as UTC to avoid local-time ambiguity.
## Determinism Verification
`DeterminismVerifier` can compare two JSON payloads and reports structural
differences. Invalid JSON inputs are reported with context.