Expand description
§NexVigilant Core — anatomy
Structural anatomy analysis for Rust workspaces — dependency graph metrics, layer classification, boundary violation detection, criticality scoring, and health reporting.
§Primitive Foundation
- σ (Sequence): Topological ordering, layer hierarchy
- μ (Mapping): Crate → layer/score/node classification
- κ (Comparison): Ranking, threshold-based tier assignment
- ∂ (Boundary): Layer boundaries, violation detection
- ρ (Recursion): Cycle detection in dependency graph
- N (Quantity): Fan-in/out counts, criticality scores, density
- Σ (Sum): Aggregation of metrics across workspace
- π (Persistence): Serializable reports
§Architecture (Chomsky Level: Type-1)
The dependency graph is a DAG analyzed via Kahn’s algorithm (σ + ρ). Layer classification adds context-sensitivity (κ) for boundary enforcement. Generators used: {σ, Σ, ρ, κ} → Type-1 (context-sensitive validation).
§Usage
use nexcore_anatomy::{DependencyGraph, LayerMap, WorkspaceMetrics, AnatomyReport};
// Build from cargo metadata
let metadata = cargo_metadata::MetadataCommand::new().exec().unwrap();
let graph = DependencyGraph::from_metadata(&metadata);
let report = AnatomyReport::from_graph(graph);
println!("Health: {}", report.summary.health.label());
println!("Violations: {}", report.summary.violation_count);
println!("Bottleneck: {} (fan-in: {})", report.summary.bottleneck, report.summary.max_fan_in);Re-exports§
pub use blast_radius::BlastRadius;pub use blast_radius::BlastRadiusReport;pub use chomsky::ChomskyLevel;pub use chomsky::ChomskyReport;pub use chomsky::CrateChomskyProfile;pub use chomsky::Generator;pub use graph::CrateNode;pub use graph::DependencyGraph;pub use layer::BoundaryViolation;pub use layer::Layer;pub use layer::LayerMap;pub use metrics::CriticalityScore;pub use metrics::CriticalityTier;pub use metrics::WorkspaceMetrics;pub use report::AnatomyReport;pub use report::HealthStatus;pub use report::ReportSummary;