- 
                Notifications
    You must be signed in to change notification settings 
- Fork 1
Open
Labels
Description
Context
The codebase has inconsistent naming for similar concepts, making it confusing. This issue standardizes type names.
Priority
🟡 HIGH - Improves code clarity significantly
Steps
1. Rename App to AppConfig (Remove Settings alias)
In src/config.rs:
// BEFORE
pub struct App { ... }
pub static ref APP: App = ...;
// AFTER  
pub struct AppConfig { ... }
pub static ref APP_CONFIG: AppConfig = ...;Update all references:
# Find all usages
rg "config::APP" src/
rg "App::new" src/
rg "Settings" src/
# Replace throughout:
# config::APP → config::APP_CONFIG
# App::new() → AppConfig::new()
# Settings → AppConfig (remove type alias)2. Unify File-Related Types
Create src/generation/types.rs (new file):
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct FileChange {
    pub path: String,
    pub operation: OperationType,
    pub diff_content: Option<String>,
    
    // Analysis fields (filled after analysis)
    pub lines_added: Option<u32>,
    pub lines_removed: Option<u32>,
    pub category: Option<FileCategory>,
    pub summary: Option<String>,
    pub impact_score: Option<f32>,
}
#[derive(Debug, Clone, Copy, Serialize, Deserialize)]
pub enum OperationType {
    Added, Modified, Deleted, Renamed, Binary
}
#[derive(Debug, Clone, Copy, Serialize, Deserialize)]
pub enum FileCategory {
    Source, Test, Config, Docs, Binary, Build
}Replace these types with FileChange:
- FileAnalysisResultin multi_step_analysis.rs
- FileWithScorein multi_step_analysis.rs
- FileDataForScoringin multi_step_analysis.rs
- ParsedFilein multi_step_integration.rs
3. Unify Response Types
In src/function_calling.rs or new src/generation/response.rs:
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct CommitResponse {
    pub message: String,
    pub reasoning: String,
    pub files: HashMap<String, FileChange>,
}Replace:
- openai::Response→- CommitResponse
- CommitFunctionArgs→- CommitResponse(or keep as internal parsing type)
Verification Criteria
✅ Pass:
-  No references to Appremain (all areAppConfig)
-  No references to Settingsremain
-  All file-related types consolidated to single FileChangestruct
-  Response types unified to CommitResponse
-  cargo buildsucceeds
-  cargo testpasses
-  cargo clippyshows no warnings
- All imports updated correctly
Estimated Time
4-6 hours
Dependencies
- Issue Include the repository field #1 (Remove dead code markers)
- Issue Proper token count based on model #2 (Remove commented code)
Notes
- Use IDE refactoring tools when possible for rename operations
- Commit after each major rename (e.g., App→AppConfig, then file types, then responses)
- This enables easier rollback if issues arise
Labels
- refactor
- naming
- breaking-change
Copilot