Expand description
Stable, position-free identifiers for clone-audit entities.
Audit continuity across scans hinges on identifiers that survive the edits
they should survive: unrelated changes elsewhere in the file, formatting
and comments, and file moves must not change an identifier, while a change
to the identified content must. Every identifier here is therefore a
128-bit BLAKE3 digest of content and analysis context only — line
numbers, byte offsets, file paths, token indices and input ordering are
never hashed. Reporting positions live in anchors (see
Instance), which are carried next to the
identifiers and updated freely on re-scan.
The identifier kinds are distinct newtypes, so a unit fingerprint can never be passed where a group fingerprint is expected; the confusion is a compile error rather than a silent mismatch. Each kind also hashes under its own domain tag, so equal content in different roles yields unrelated digests.
Hash inputs are length-prefixed and include the schema version, the normalization ruleset version, the frontend version, the analysis mode, the language and the build variant, so results from incompatible configurations never collide silently. 128 bits are persisted because these are long-lived identity keys: a truncated key that collides would fuse two clones’ histories without any symptom.
Structs§
- Clone
Group Fingerprint - Fingerprint of a clone group, derived order-independently from the deduplicated content fingerprints of its members.
- Cross
Language Comparison Id - Identity of an explicitly requested Rust-to-C++ semantic comparison.
- Cross
Language Group Id - Stable identity of one group found by a Rust-to-C++ semantic comparison.
- Cross
Language Member Id - Position-free identity of one cross-language group occurrence.
- Cross
Variant Comparison Id - Identity of an opt-in comparison across distinct build variants.
- Cross
Variant Group Id - Stable identity of one group found by a cross-variant comparison.
- Cross
Variant Member Id - Position-free identity of one cross-variant group occurrence.
- File
Context - Per-file analysis context that participates in content hashing.
- Finding
Id - Identifier of one finding: a specific occurrence of a group’s content, discriminated by its host unit and an in-host occurrence rank rather than by any source position.
- Fragment
Fingerprint - Fingerprint of a sub-unit content slice: a candidate fragment or a
matched run. Content-identical slices share one fingerprint;
occurrences are told apart by
FindingId, never by position. - Group
Ids - Stable identifiers of one clone group.
- Group
Lineage Id - Stable identity of a clone group’s history across fingerprint changes.
- Member
Ids - Stable identifiers of one group member, parallel to
CloneGroup::members. - Unit
Fingerprint - Fingerprint of one whole code unit (function, method, impl/record block, closure), hashed from its token content.
Enums§
- Content
Norm - How content is folded before hashing.
Constants§
- CROSS_
LANGUAGE_ POLICY_ VERSION - Version of the explicit Rust-to-C++ semantic comparison policy.
- CROSS_
VARIANT_ POLICY_ VERSION - Version of the policy that defines cross-build-variant comparisons.
- FP_
SCHEMA_ VERSION - Version of the identifier-hashing recipe. Bump on any change to the hash inputs, their encoding or their order.
- HASH_
ALGORITHM - The hash algorithm behind every identifier, recorded so a future algorithm change is an explicit versioned event rather than a silent one.
Functions§
- clone_
group_ fingerprint - Fingerprint a clone group from its members’ content fingerprints.
- cross_
language_ comparison_ id - Identify an explicit Rust-to-C++ semantic comparison over origin variants.
- cross_
language_ group_ id - Identify a verified group from an explicit Rust-to-C++ semantic comparison.
- cross_
language_ member_ id - Identify one occurrence inside a cross-language semantic group.
- cross_
variant_ comparison_ id - Identify an opt-in comparison over the sorted set of origin variants.
- cross_
variant_ group_ id - Identify an exact group produced by a cross-build-variant comparison.
- cross_
variant_ member_ id - Identify one occurrence inside a cross-build-variant group.
- finding_
id - Identify one occurrence of a group’s content.
- fragment_
fingerprint - Fingerprint a content slice (candidate fragment or matched run).
- group_
lineage_ id - Start a clone-group history from the fingerprint that first identified it.
- report_
ids - Compute stable identifiers for every group of an engine report.
- resolved_
fragment_ fingerprint - Fingerprint a fragment with compiler-derived name-resolution evidence.
- semantic_
clone_ group_ fingerprint - Fingerprint a restricted-semantic group after a registered rule matched.
- semantic_
fragment_ fingerprint - Fingerprint one normalized semantic graph as a finding fragment.
- semantic_
occurrence_ fingerprint - Identify one semantic fragment occurrence inside its stable host unit.
- semantic_
structure_ fingerprint - Fingerprint source structure attached to a bounded semantic window.
- structural_
clone_ group_ fingerprint - Fingerprint a Structural (Type-3) clone group, anchored on its canonical instance.
- unit_
fingerprint - Fingerprint a whole unit’s token stream.