Your browser sucks, JavaScript disabled! Gunnar's console needs JavaScript and WebAssembly. Git over SSH on port 2222 does not.

nordisk/nornir

src/clone_signals/mod.rs

//! **The clone signals** — clones are about what a function DOES, not what it
//! is called. Three signals, each answerable on its own, none of them the raw
//! text model:
//!
//! 1. **The normalised body** ([`norm`]): the function's tokens with every name
//!    the workspace chose replaced by its role. Its hash is the EXACT key
//!    (`exact_clones`: Type-1/2, consistent renames); a MinHash over its role
//!    shingles ([`minhash`]) finds the NEAR ones (`near_clones`: Type-3).
//!    Computed per consumed commit for the functions whose body changed
//!    ([`feed`], the `clone_shapes` feed), stored beside the function node
//!    ([`store`], `fn_shape_events`).
//! 2. **The structure in the graph** ([`structure`]): what a function touches —
//!    its parameter and return types, the types it uses, the fields it reads,
//!    the functions it calls — each feature weighted by how RARE it is in the
//!    code room (IDF). Sharing a rare struct or field is strong evidence;
//!    sharing `Result<(), Error>` or `&str` is almost none (`structural_clones`).
//! 3. **The model without the names**: the normalised body embedded by the
//!    same model and worker as the raw text (`embeddings_norm`).
//!    `semantic_clones` = normalised-model cosine ≥ its floor AND agreement of
//!    signal 1 or 2. The raw model, names included, stays as a separately
//!    labelled NAME-DRIVEN view (`same_intent`).

pub mod minhash;
pub mod norm;
pub mod store;
#[cfg(feature = "code-room")]
pub mod feed;
#[cfg(feature = "code-room")]
pub mod backfill;
#[cfg(feature = "code-room")]
pub mod structure;