pub mod comparative;
mod explainer;
mod scorer;
pub mod similarity;
pub use comparative::{
compute_deviation_score, compute_effectiveness, get_baseline_expectations,
infer_skill_category, DeviationEvidence, DeviationScore, EffectivenessMetric, ExpectedOutcome,
OutcomeMetrics, SkillCategory,
};
pub use explainer::{generate_explanation, summarize_recommendations};
pub use scorer::{RecommendationScorer, Scorer};
pub use similarity::{
compute_similarity, find_similar_skills, has_similar_skill, match_skill, MatchedField,
SkillInfo, SkillMatch, DEFAULT_THRESHOLD,
};
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct SmartRecommendation {
pub uri: String,
pub name: String,
pub score: f64,
pub score_breakdown: ScoreBreakdown,
pub explanation: String,
pub signals: Vec<RecommendationSignal>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct ScoreBreakdown {
pub dependency_score: f64,
pub usage_score: f64,
pub context_score: f64,
pub quality_score: f64,
}
impl ScoreBreakdown {
pub fn total(&self) -> f64 {
self.dependency_score + self.usage_score + self.context_score + self.quality_score
}
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub enum RecommendationSignal {
Dependency,
Dependent,
Sibling,
CoUsed {
count: u64,
},
ProjectMatch {
matched: Vec<String>,
},
RecentlyUsed {
last_used: u64,
},
PromptMatch {
keywords: Vec<String>,
},
HighQuality {
score: f64,
},
SimilarityMatch {
query: String,
similarity: f64,
},
}
impl RecommendationSignal {
pub fn label(&self) -> &'static str {
match self {
Self::Dependency => "dependency",
Self::Dependent => "dependent",
Self::Sibling => "sibling",
Self::CoUsed { .. } => "co-used",
Self::ProjectMatch { .. } => "project-match",
Self::RecentlyUsed { .. } => "recently-used",
Self::PromptMatch { .. } => "prompt-match",
Self::HighQuality { .. } => "high-quality",
Self::SimilarityMatch { .. } => "similarity-match",
}
}
}
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct SkillGapAnalysis {
pub gaps: Vec<SkillGap>,
pub suggestions: Vec<String>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct SkillGap {
pub area: String,
pub evidence: Vec<String>,
pub priority: String,
}