Skip to main content

Crate spec_drift

Crate spec_drift 

Source
Expand description

spec-drift — semantic coherence analysis between a project’s specification surfaces (README, AGENTS.md, examples, CI) and its Rust code.

The library exposes the domain model, analyzers, and reporters so they can be embedded in editors or other tools. The spec-drift binary is a thin CLI wrapper over run.

Re-exports§

pub use config::Config;
pub use context::ProjectContext;
pub use domain::Attribution;
pub use domain::ClaimKind;
pub use domain::CodeFact;
pub use domain::Confidence;
pub use domain::Divergence;
pub use domain::FactKind;
pub use domain::Location;
pub use domain::RuleId;
pub use domain::Severity;
pub use domain::SpecClaim;
pub use error::SpecDriftError;

Modules§

analyzers
baseline
--baseline support.
blame
--blame divergence attribution via git blame --porcelain.
config
spec-drift.toml configuration.
context
domain
error
llm
LLM-backed rule support.
parsers
reporters
sources
suppress
Inline-ignore filtering.
workspace
Workspace member discovery via cargo metadata.

Functions§

apply_config
Apply a Config to a divergence set: drop suppressed items and apply severity overrides.
apply_strict
Promote every non-deterministic divergence one severity level. Mirrors the --strict CLI flag — deterministic rules stay untouched because they already carry unambiguous verdicts.
run
Execute every analyzer in parallel and return divergences sorted deterministically by (file, line, rule) so output can be diffed between runs.