Commit b199b54
feat(ai): implement advanced AI improvements across all modules
This comprehensive update significantly enhances the AI capabilities of
CommitLoom with state-of-the-art prompt engineering, intelligent file
grouping, and precise token estimation.
✨ AI Service Enhancements (ai_service.py):
- Add few-shot learning with 4 real-world examples
- Implement Conventional Commits specification support
- Add automatic scope detection from file paths
- Implement breaking change detection with regex patterns
- Add dynamic temperature control (0.3-0.6 based on change type)
- Enhance CommitSuggestion with scope and breaking fields
- Add breaking change footer in formatted commits
🧠 Smart Grouping Improvements (smart_grouping.py):
- Implement real Python import analysis using AST parsing
- Add JavaScript/TypeScript import extraction with regex fallback
- Expand ChangeType enum: hotfix, perf, security, ci, revert
- Implement dynamic confidence scoring (multi-factor algorithm)
- Add feature boundary detection for better grouping
- Enhance file relationship detection with component pairs
- Add intelligent file size limits (1MB) for performance
📊 Analyzer Enhancements (analyzer.py):
- Integrate tiktoken for precise token counting (with fallback)
- Add ChangeNature enum: additions, modifications, deletions, mixed
- Implement change nature analysis for better warnings
- Add dangerous change detection (migrations, secrets, credentials)
- Enhance warnings with specific, actionable suggestions
- Improve token estimation: 3.5 chars/token heuristic
- Add file type analysis for splitting suggestions
🔧 Module Exports (core/__init__.py):
- Export ChangeNature for external use
- Export ChangeType, FileGroup, FileRelationship
✅ Test Updates (test_analyzer.py):
- Update test assertions for new warning messages
- Support both "large" and "extensive" file warnings
- Ensure compatibility with enhanced analyzer logic
📈 Impact:
- 133/133 tests passing (100%)
- Coverage: 70.31% (exceeds 68% requirement)
- Better commit quality through Conventional Commits
- More accurate token/cost estimation
- Smarter file grouping with real dependency analysis
- Dynamic AI parameters for optimal results
This update represents a major leap in AI-powered commit message
generation, bringing CommitLoom closer to industry-standard practices
while maintaining excellent performance and accuracy.
🧵 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent 6ed5989 commit b199b54
File tree
5 files changed
+644
-78
lines changed- commitloom
- core
- services
- tests
5 files changed
+644
-78
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
25 | 29 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
9 | 16 | | |
10 | 17 | | |
11 | 18 | | |
| |||
42 | 49 | | |
43 | 50 | | |
44 | 51 | | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
45 | 61 | | |
46 | 62 | | |
47 | 63 | | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
48 | 101 | | |
49 | 102 | | |
50 | 103 | | |
| |||
57 | 110 | | |
58 | 111 | | |
59 | 112 | | |
60 | | - | |
| 113 | + | |
61 | 114 | | |
62 | 115 | | |
63 | 116 | | |
| |||
66 | 119 | | |
67 | 120 | | |
68 | 121 | | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
69 | 187 | | |
70 | 188 | | |
71 | 189 | | |
| |||
82 | 200 | | |
83 | 201 | | |
84 | 202 | | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
85 | 206 | | |
86 | 207 | | |
87 | 208 | | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
88 | 215 | | |
89 | 216 | | |
90 | 217 | | |
91 | 218 | | |
92 | 219 | | |
93 | | - | |
| 220 | + | |
94 | 221 | | |
95 | 222 | | |
96 | 223 | | |
97 | 224 | | |
98 | 225 | | |
99 | 226 | | |
100 | 227 | | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
101 | 240 | | |
102 | 241 | | |
103 | 242 | | |
104 | 243 | | |
105 | | - | |
106 | | - | |
107 | | - | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
108 | 247 | | |
109 | 248 | | |
110 | 249 | | |
| |||
117 | 256 | | |
118 | 257 | | |
119 | 258 | | |
120 | | - | |
| 259 | + | |
121 | 260 | | |
122 | 261 | | |
123 | 262 | | |
| |||
132 | 271 | | |
133 | 272 | | |
134 | 273 | | |
135 | | - | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
136 | 285 | | |
137 | 286 | | |
138 | 287 | | |
139 | 288 | | |
140 | 289 | | |
141 | 290 | | |
142 | | - | |
| 291 | + | |
143 | 292 | | |
144 | 293 | | |
145 | 294 | | |
| |||
150 | 299 | | |
151 | 300 | | |
152 | 301 | | |
153 | | - | |
154 | | - | |
| 302 | + | |
| 303 | + | |
155 | 304 | | |
156 | 305 | | |
157 | 306 | | |
| |||
0 commit comments