Skip to content

vox-drift-check API Reference (generated)

Crate: vox-drift-check · Version: 0.6.0 · Target: Library (lib.rs)

Workspace-wide multi-language drift and pattern-repetition linter

Workspace-wide multi-language drift and pattern-repetition linter.

Detects stale symbol references, naming drift, copy-paste drift, stale patterns, and diverging implementations across Rust, TypeScript, Vox source files, and the monorepo.

FeatureDefault / Enables
drift-typescriptdep:swc_ecma_parser, dep:swc_ecma_ast, dep:swc_ecma_visit, dep:swc_common
DependencyKind
vox-code-auditNormal
ModuleDescription
cache—
config—
engine—
extractor—
extractors—
features—
layers_manifest—
report—
rules—
sweep—
Dependency Topology, diagram 13 nodes, 2 edges: vox-drift-check → vox-code-audit; vox-cli → vox-drift-checkvox-drift-checkvox-code-auditvox-cli
Diagram source
graph {
direction: right
node vox_drift_check: "vox-drift-check"
node vox_code_audit: "vox-code-audit"
vox_drift_check -> vox_code_audit
node vox_cli: "vox-cli"
vox_cli -> vox_drift_check
}
Consumer CrateRole
vox-cliDirect workspace dependent
KindSymbolSignatureSourceDescription
structcache::FeatureCachepub struct FeatureCachecrates/vox-drift-check/src/cache.rs#L8-L10—
fncache::newpub fn new(dir: PathBuf) -> Selfcrates/vox-drift-check/src/cache.rs#L13-L16—
fncache::from_workspacepub fn from_workspace(root: &std::path::Path) -> Selfcrates/vox-drift-check/src/cache.rs#L18-L28—
fncache::hash_filepub fn hash_file(content: &str) -> Stringcrates/vox-drift-check/src/cache.rs#L30-L34—
fncache::storepub fn store(&self, key: &str, features: &ExtractedFeatures) -> Result<()>crates/vox-drift-check/src/cache.rs#L36-L44—
fncache::loadpub fn load(&self, key: &str) -> Option<ExtractedFeatures>crates/vox-drift-check/src/cache.rs#L46-L66—
structconfig::ConfigMetapub struct ConfigMetacrates/vox-drift-check/src/config.rs#L24-L26—
structconfig::LiteralDedupConfigpub struct LiteralDedupConfigcrates/vox-drift-check/src/config.rs#L29-L38—
structconfig::NumericDedupConfigpub struct NumericDedupConfigcrates/vox-drift-check/src/config.rs#L41-L46—
structconfig::BodyDedupConfigpub struct BodyDedupConfigcrates/vox-drift-check/src/config.rs#L49-L56—
structconfig::ForbiddenCallpub struct ForbiddenCallcrates/vox-drift-check/src/config.rs#L59-L69—
structconfig::ForbiddenLiteralpub struct ForbiddenLiteralcrates/vox-drift-check/src/config.rs#L72-L79—
structconfig::DriftConfigpub struct DriftConfigcrates/vox-drift-check/src/config.rs#L82-L94—
fnconfig::loadpub fn load(root: &std::path::Path) -> Selfcrates/vox-drift-check/src/config.rs#L127-L133—
structengine::WorkspaceFeaturespub struct WorkspaceFeaturescrates/vox-drift-check/src/engine.rs#L13-L16—
structengine::DriftEnginepub struct DriftEnginecrates/vox-drift-check/src/engine.rs#L20-L22—
fnengine::newpub fn new(root: &Path) -> Selfcrates/vox-drift-check/src/engine.rs#L25-L29—
fnengine::extract_workspacepub fn extract_workspace(&self) -> Result<WorkspaceFeatures>crates/vox-drift-check/src/engine.rs#L31-L65—
fnengine::run_allpub fn run_all(&self) -> Result<Vec<vox_code_audit::rules::Finding>>crates/vox-drift-check/src/engine.rs#L67-L97—
fnengine::detect_languagepub fn detect_language(path: &Path) -> Languagecrates/vox-drift-check/src/engine.rs#L130-L137—
traitextractor::LanguageExtractorpub trait LanguageExtractor: Send + Synccrates/vox-drift-check/src/extractor.rs#L6-L8—
fnextractor::crate_name_from_pathpub fn crate_name_from_path(path: &Path) -> Option<String>crates/vox-drift-check/src/extractor.rs#L11-L23Extract crate name from path like crates/vox-foo/src/lib.rs → "vox-foo".
fnextractor::parse_drift_allow_commentspub fn parse_drift_allow_comments(content: &str) -> HashMap<String, HashSet<usize>>crates/vox-drift-check/src/extractor.rs#L47-L83Scan source text for // drift-allow(rule-id[,rule-id…]) and the //! drift-allow(...) module-attribute variant. Returns a map keyed by rule-id whose values are the 1-indexed line numbers covered. Each annotation covers the line it sits on AND the following line. That supports both trailing-comment style: ignore Duration::from_secs(5); // drift-allow(timeout-literal): rationale and the comment-above style: ignore // drift-allow(timeout-literal): rationale Duration::from_secs(5); Rule IDs may be slash-segmented (drift/timeout-literal) or short-form (timeout-literal); both forms get stored verbatim. Rules accept either self.id() or its short suffix via [ExtractedFeatures::is_allowed] + [short_rule_id].
fnextractor::short_rule_idpub fn short_rule_id(id: &str) -> &strcrates/vox-drift-check/src/extractor.rs#L88-L90Strip the drift/ (or sweep/) prefix from a rule id. Per-line annotations accept either form, so rules whose id() returns "drift/timeout-literal" should also check "timeout-literal".
fnextractor::is_allowed_atpub fn is_allowed_at(features: &ExtractedFeatures, rule_id: &str, line: usize) -> boolcrates/vox-drift-check/src/extractor.rs#L93-L95Convenience: true if either the full rule id or its short form is allowed at line.
structfeatures::Locpub struct Loccrates/vox-drift-check/src/features.rs#L6-L9—
enumfeatures::LiteralContextpub enum LiteralContextcrates/vox-drift-check/src/features.rs#L12-L17—
enumfeatures::UnitHintpub enum UnitHintcrates/vox-drift-check/src/features.rs#L20-L26—
structfeatures::LiteralLocpub struct LiteralLoccrates/vox-drift-check/src/features.rs#L29-L33—
structfeatures::NumericLocpub struct NumericLoccrates/vox-drift-check/src/features.rs#L36-L44—
structfeatures::CallSitepub struct CallSitecrates/vox-drift-check/src/features.rs#L47-L51—
structfeatures::BodySignaturepub struct BodySignaturecrates/vox-drift-check/src/features.rs#L54-L59—
structfeatures::ImportLocpub struct ImportLoccrates/vox-drift-check/src/features.rs#L62-L66—
structfeatures::FnDefpub struct FnDefcrates/vox-drift-check/src/features.rs#L69-L74—
structfeatures::ExtractedFeaturespub struct ExtractedFeaturescrates/vox-drift-check/src/features.rs#L77-L92—
fnfeatures::newpub fn new(file: PathBuf, language: Language) -> Selfcrates/vox-drift-check/src/features.rs#L95-L108—
fnfeatures::is_allowedpub fn is_allowed(&self, rule_id: &str, line: usize) -> boolcrates/vox-drift-check/src/features.rs#L114-L118True when an in-source // drift-allow(<rule_id>) comment covers line. Annotations cover the line they sit on AND the following line, so both Duration::from_secs(5); // drift-allow(timeout-literal): … (trailing) and the comment-above style are honored.
structlayers_manifest::LayersManifestpub struct LayersManifestcrates/vox-drift-check/src/layers_manifest.rs#L33-L37In-memory view of layers.toml with sibling clusters resolved.
fnlayers_manifest::loadpub fn load(workspace_root: &Path) -> Selfcrates/vox-drift-check/src/layers_manifest.rs#L43-L50Load from <workspace_root>/docs/src/architecture/layers.toml. Returns an empty manifest if the file is missing or malformed (callers degrade to “no metadata available”, which is the safe default).
fnlayers_manifest::load_from_filepub fn load_from_file(path: &Path) -> Selfcrates/vox-drift-check/src/layers_manifest.rs#L52-L57—
fnlayers_manifest::all_in_one_sibling_clusterpub fn all_in_one_sibling_cluster<I, S>(&self, crates: I) -> boolcrates/vox-drift-check/src/layers_manifest.rs#L109True when every crate name in crates is in the same sibling cluster. Used by sweep/duplicate-body to suppress findings whose locations are confined to a declared cluster.
fnlayers_manifest::sibling_edge_countpub fn sibling_edge_count(&self) -> usizecrates/vox-drift-check/src/layers_manifest.rs#L129-L135Number of declared sibling edges (post-closure, undirected) — used by tests and debug logging.
fnlayers_manifest::default_workspace_rootpub fn default_workspace_root() -> PathBufcrates/vox-drift-check/src/layers_manifest.rs#L142-L144Stable workspace-root resolver used both by the binary and by tests that pre-bake a fixture root. Defined here so layers parsing is callable from anywhere in the crate without dragging in the binary’s CLI handling.
fnreport::print_terminalpub fn print_terminal(findings: &[Finding], min_severity: Severity)crates/vox-drift-check/src/report.rs#L3-L31—
fnreport::print_jsonpub fn print_json(findings: &[Finding])crates/vox-drift-check/src/report.rs#L33-L38—