Expand description
fingerprint — deterministic fingerprint of a portable IR document (common
Generator, bc#13 — Rust port of ts/src/generator/fingerprint.ts).
Generated modules recompute the fingerprint over their embedded IR literal on first use and compare it against the constant baked in at generation time (skew is a LOUD reject — graphddb #208 prepared-artifact discipline).
Cross-language identity discipline (must match TS / Python / Go / PHP exactly):
- Lift the JSON document into the
Valuedomain. Integral numbers become int; only non-integral numbers stay float. JSON’s data model (RFC 8259) does not distinguish 1 from 1.0, so integral floats canonicalize to int (TS loses the distinction at JSON.parse time — this specifies that behavior so all languages agree).-0.0stays float (matches TS). - Serialize with
canonical_json(all-level code-point key sort — canonical-serialization.md §3). - FNV-1a 64 over the UTF-8 bytes. Representation:
"fnv1a64:" + 16 hex.
Constraint (fail-closed): integral numbers with |n| >= 2^53 are rejected
(portable-IR big integers must use the Expression IR {int:"..."} wrapper —
expression-ir.md §2.3. TS loses precision at JSON.parse, so allowing them
here would let fingerprints diverge across languages).
Structs§
- Fingerprint
Failure - A fingerprint input invariant violation (fail-closed).
Enums§
- Fingerprint
Failure Code - Fingerprint input invariant violation codes (fail-closed).
Functions§
- fingerprint_
component_ graph - Deterministic fingerprint (
"fnv1a64:<16hex>") of a portable IR document.