cpd-semantic 0.1.0

Semantic (Type-4) clones for cpd: functions compared by code embeddings
Documentation

Semantic clones for jscpd (--semantic, experimental): functions that do the same job written differently — renamed, restructured, or in another language, like a rule a Rust backend enforces and a Svelte frontend repeats.

  • [extract] and [units] find the functions of a source and the text a model sees for each;
  • [embed] turns those texts into vectors: a model run in-process ([Provider::Local]) or an OpenAI-compatible API ([Provider::Http]), behind an on-disk cache; [embed::catalog] holds the thresholds of the models jscpd has calibrated;
  • [search] pairs the functions whose vectors point the same way;
  • [SemanticPass] runs all of it as a clone pass of the finder ([cpd_finder::pass]).

Everything --semantic needs lives here, with every dependency it brings — the model runtime, the model's tokenizer, the tree-sitter grammars, the HTTP client — so the core, the tokenizer and the finder compile without them.