concept_analyzer/
concept_registry.rs

1//! Concept registry for managing abstractions across projects
2
3use serde::{Deserialize, Serialize};
4use std::collections::HashMap;
5
6use crate::Abstraction;
7
8#[derive(Debug, Clone, Serialize, Deserialize)]
9pub struct Gap {
10    pub concept: String,
11    pub missing_in_projects: Vec<String>,
12    pub severity: String,
13}
14
15#[derive(Debug, Clone, Default, Serialize, Deserialize)]
16pub struct ConceptRegistry {
17    concepts: HashMap<String, Vec<String>>, // concept -> projects
18}
19
20impl ConceptRegistry {
21    pub fn new() -> Self {
22        Self::default()
23    }
24
25    pub fn add_project(&mut self, project: &str, abstractions: Vec<Abstraction>) {
26        for abstraction in abstractions {
27            self.concepts
28                .entry(abstraction.name.clone())
29                .or_default()
30                .push(project.to_string());
31        }
32    }
33
34    pub fn detect_gaps(&self) -> Vec<Gap> {
35        // Stub implementation
36        vec![]
37    }
38}