Skip to content

Commit fcc6a67

Browse files
feat(docs): deep code analysis engine with 6 supporting modules
changes: - file: reports.py area: core modified: [calculate_human_time] stats: lines: "+294/-21 (net +273)" files: 4 complexity: "+100% complexity (monitor)"
1 parent e55efcb commit fcc6a67

8 files changed

Lines changed: 306 additions & 24 deletions

File tree

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
5252

5353
## [Unreleased]
5454

55+
## [0.1.31] - 2026-03-29
56+
57+
### Docs
58+
- Update README.md
59+
60+
### Other
61+
- Update ai_costs.csv
62+
- Update project/project.toon.yaml
63+
5564
## [0.1.30] - 2026-03-29
5665

5766
### Docs

README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,14 @@
22

33
## AI Cost Tracking
44

5-
![PyPI](https://img.shields.io/badge/pypi-costs-blue) ![Version](https://img.shields.io/badge/version-0.1.30-blue) ![Python](https://img.shields.io/badge/python-3.9+-blue) ![License](https://img.shields.io/badge/license-Apache--2.0-green)
6-
![AI Cost](https://img.shields.io/badge/AI%20Cost-$0.84-orange) ![Human Time](https://img.shields.io/badge/Human%20Time-1.5h-blue) ![Model](https://img.shields.io/badge/Model-qwen3--coder--next-lightgrey)
5+
![AI Cost](https://img.shields.io/badge/AI%20Cost-$1.18-orange) ![Human Time](https://img.shields.io/badge/Human%20Time-5.4h-blue) ![LLM Cost](https://img.shields.io/badge/LLM%20Cost-$1.18-red) ![Model](https://img.shields.io/badge/Model-openrouter%2Fqwen%2Fqwen3--coder--next-lightgrey)
76

87
This project uses AI-generated code.
98

109
**Costs:**
11-
- 🤖 **LLM usage:** $0.8403 (27 commits)
12-
- 👤 **Human dev:** ~$150 (1.5h @ $100/h, 30min dedup)
13-
- 📊 **ROI:** 179x savings vs full manual
10+
- 🤖 **LLM usage:** $1.1834 (31 commits)
11+
- 👤 **Human dev:** ~$536 (5.4h @ $100/h, 30min dedup)
12+
- 📊 **ROI:** 453x savings vs full manual
1413

1514
Generated on 2026-03-29 using [openrouter/qwen/qwen3-coder-next](https://openrouter.ai/models/openrouter/qwen/qwen3-coder-next)
1615

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.1.30
1+
0.1.31

ai_costs.csv

Lines changed: 267 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,25 @@
11
cost,cost_formatted,model,mode,tokens,hours_saved,review_time,value_generated,roi,roi_formatted,commit_hash,commit_message,author,date
2+
0.0054470000000000005,$0.0054,openrouter/qwen/qwen3-coder-next,byok,"{'input': 1702, 'output': 3064, 'total': 4767}",0.4,0.1,40.0,7343.5,,e55efcb3,"docs(docs): multi-language support with 2 supporting modules
3+
4+
stats:
5+
lines: ""+6/-1 (net +5)""
6+
files: 1
7+
complexity: ""Stable complexity""",Tom Softreck,2026-03-29T12:54:57+02:00
8+
0.034126000000000004,$0.0341,openrouter/qwen/qwen3-coder-next,byok,"{'input': 10664, 'output': 19196, 'total': 29860}",3.19,0.8,319.2,9353.6,,ba777813,"feat(None): deep code analysis engine with 5 supporting modules
9+
10+
changes:
11+
- file: calculator.py
12+
area: core
13+
added: [_estimate_single_file_tokens, get_file_type_multiplier]
14+
modified: [calculate_roi, estimate_tokens, calculate_cost, batch_calculate_costs, ai_cost]
15+
- file: reports.py
16+
area: core
17+
modified: [calculate_human_time, update_readme_badge]
18+
19+
stats:
20+
lines: ""+169/-83 (net +86)""
21+
files: 4
22+
complexity: ""+186% complexity (monitor)""",Tom Softreck,2026-03-29T12:53:39+02:00
223
0.265591,$0.2656,openrouter/qwen/qwen3-coder-next,byok,"{'input': 82997, 'output': 149395, 'total': 232393}",8.61,2.15,860.8,3241.1,,fb906e54,"refactor(docs): code analysis engine
324
425
changes:
@@ -64,3 +85,249 @@ stats:
6485
lines: ""+21/-16 (net +5)""
6586
files: 5
6687
complexity: ""+20% complexity (new features)""",Tom Softreck,2026-03-29T12:34:43+02:00
88+
0.024016,$0.0240,openrouter/qwen/qwen3-coder-next,byok,"{'input': 7505, 'output': 13509, 'total': 21014}",2.62,0.66,262.4,10926.0,,da1edc0d,"refactor(docs): commit message generator
89+
90+
changes:
91+
- file: test_cost.py
92+
area: test
93+
modified: [test_aicost_auto_badge]
94+
95+
stats:
96+
lines: ""+63/-63 (net +0)""
97+
files: 4
98+
complexity: ""Stable complexity""",Tom Softreck,2026-03-29T12:26:05+02:00
99+
0.006455,$0.0065,openrouter/qwen/qwen3-coder-next,byok,"{'input': 2017, 'output': 3631, 'total': 5649}",0.94,0.24,94.4,14624.3,,80afcc78,"feat(docs): code relationship mapping with 2 supporting modules
100+
101+
stats:
102+
lines: ""+65/-2 (net +63)""
103+
files: 3
104+
complexity: ""Stable complexity""",Tom Softreck,2026-03-29T12:24:34+02:00
105+
0.013215999999999999,$0.0132,openrouter/qwen/qwen3-coder-next,byok,"{'input': 4130, 'output': 7434, 'total': 11564}",1.46,0.37,146.4,11077.5,,7b3f4bc2,"feat(tests): commit message generator
106+
107+
changes:
108+
- file: test_cost.py
109+
area: test
110+
new_tests: 3
111+
modified: [test_import]
112+
113+
testing:
114+
new_tests: 3
115+
scenarios:
116+
- aicost_auto_badge
117+
- reports_module
118+
- cost_calculator_imports
119+
120+
stats:
121+
lines: ""+111/-17 (net +94)""
122+
files: 2
123+
complexity: ""Large structural change (normalized)""",Tom Softreck,2026-03-29T12:22:36+02:00
124+
0.003856,$0.0039,openrouter/qwen/qwen3-coder-next,byok,"{'input': 1205, 'output': 2169, 'total': 3374}",0.39,0.1,39.2,10166.0,,2645351c,"docs(docs): multi-language support
125+
126+
stats:
127+
lines: ""+7/-7 (net +0)""
128+
files: 1
129+
complexity: ""Stable complexity""",Tom Softreck,2026-03-29T12:19:39+02:00
130+
0.002608,$0.0026,openrouter/qwen/qwen3-coder-next,byok,"{'input': 815, 'output': 1467, 'total': 2282}",0.32,0.08,32.0,12269.9,,f49e021b,"refactor(config): CLI interface improvements
131+
132+
changes:
133+
- file: calculator.py
134+
area: core
135+
added: [calculate_roi, calculate_cost, estimate_tokens, batch_calculate_costs, ai_cost]
136+
- file: cli.py
137+
area: cli
138+
added: [analyze, stats, auto_badge, estimate, report, init, +4 more]
139+
- file: git_parser.py
140+
area: analyzer
141+
added: [get_commit_diff, is_commit_in_date_range, is_ai_commit, get_first_commit_date, get_repo_name, get_repo_stats, +2 more]
142+
- file: models.py
143+
area: model
144+
added: [get_openrouter_headers, get_model_price, get_litellm_model_name]
145+
- file: reports.py
146+
area: core
147+
added: [update_readme_badge, generate_html_report, get_cost_color, generate_markdown_report]
148+
149+
dependencies:
150+
flow: ""cli→calculator→git_parser""
151+
- calculator.py -> git_parser.py
152+
- cli.py -> calculator.py
153+
- cli.py -> git_parser.py
154+
- cli.py -> reports.py
155+
156+
stats:
157+
lines: ""+3/-3 (net +0)""
158+
files: 7
159+
complexity: ""Large structural change (normalized)""",Tom Softreck,2026-03-29T12:18:29+02:00
160+
0.023255,$0.0233,openrouter/qwen/qwen3-coder-next,byok,"{'input': 7267, 'output': 13081, 'total': 20349}",3.78,0.94,377.6,16237.4,,1ac0bcaa,"feat(docs): commit message generator
161+
162+
stats:
163+
lines: ""+428/-0 (net +428)""
164+
files: 4
165+
complexity: ""Stable complexity""",Tom Softreck,2026-03-29T12:14:13+02:00
166+
0.014304,$0.0143,openrouter/qwen/qwen3-coder-next,byok,"{'input': 4470, 'output': 8046, 'total': 12516}",1.62,0.4,161.6,11297.5,,a54c4733,"docs(docs): CLI interface with 3 supporting modules
167+
168+
stats:
169+
lines: ""+91/-18 (net +73)""
170+
files: 1
171+
complexity: ""Stable complexity""",Tom Softreck,2026-03-29T12:09:49+02:00
172+
0.25371900000000003,$0.2537,openrouter/qwen/qwen3-coder-next,byok,"{'input': 79287, 'output': 142717, 'total': 222005}",21.0,5.25,2100.0,8276.9,,8a4760db,"feat(docs): code analysis engine
173+
174+
changes:
175+
- file: cli.py
176+
area: cli
177+
added: [auto_badge]
178+
modified: [init]
179+
180+
dependencies:
181+
flow: ""cli→reports""
182+
- cli.py -> reports.py
183+
184+
stats:
185+
lines: ""+2499/-3 (net +2496)""
186+
files: 27
187+
complexity: ""Large structural change (normalized)""",Tom Softreck,2026-03-29T12:04:52+02:00
188+
0.054672000000000005,$0.0547,openrouter/qwen/qwen3-coder-next,byok,"{'input': 17085, 'output': 30753, 'total': 47838}",6.67,1.67,667.2,12203.7,,fa69cb4b,"feat(goal): CLI interface improvements
189+
190+
changes:
191+
- file: cli.py
192+
area: cli
193+
added: [badge, report]
194+
- file: reports.py
195+
area: core
196+
added: [get_cost_color, generate_markdown_report, generate_html_report, update_readme_badge]
197+
198+
dependencies:
199+
flow: ""cli→reports""
200+
- cli.py -> reports.py
201+
202+
stats:
203+
lines: ""+796/-0 (net +796)""
204+
files: 3
205+
complexity: ""Large structural change (normalized)""",Tom Softreck,2026-03-29T12:00:35+02:00
206+
0.00328,$0.0033,openrouter/qwen/qwen3-coder-next,byok,"{'input': 1025, 'output': 1845, 'total': 2870}",0.33,0.08,32.8,10000.0,,59e60ec3,"feat(None): configuration management
207+
208+
stats:
209+
lines: ""+3/-1 (net +2)""
210+
files: 1
211+
complexity: ""Stable complexity""",Tom Softreck,2026-03-29T11:58:20+02:00
212+
0.022384,$0.0224,openrouter/qwen/qwen3-coder-next,byok,"{'input': 6995, 'output': 12591, 'total': 19586}",2.34,0.59,234.4,10471.8,,a9e4abfd,"refactor(goal): CLI interface improvements
213+
214+
changes:
215+
- file: cli.py
216+
area: cli
217+
added: [stats]
218+
modified: [analyze]
219+
- file: git_parser.py
220+
area: analyzer
221+
added: [get_first_commit_date, get_repo_stats, is_commit_in_date_range]
222+
modified: [parse_commits]
223+
224+
dependencies:
225+
flow: ""cli→git_parser""
226+
- cli.py -> git_parser.py
227+
228+
stats:
229+
lines: ""+194/-12 (net +182)""
230+
files: 4
231+
complexity: ""Large structural change (normalized)""",Tom Softreck,2026-03-29T11:57:00+02:00
232+
0.0020800000000000003,$0.0021,openrouter/qwen/qwen3-coder-next,byok,"{'input': 650, 'output': 1170, 'total': 1820}",0.31,0.08,31.2,15000.0,,ec9840c7,"docs(docs): new API capabilities
233+
234+
stats:
235+
lines: ""+0/-14 (net -14)""
236+
files: 1
237+
complexity: ""Stable complexity""",Tom Softreck,2026-03-29T11:49:44+02:00
238+
0.003056,$0.0031,openrouter/qwen/qwen3-coder-next,byok,"{'input': 955, 'output': 1719, 'total': 2674}",0.46,0.11,45.6,14921.5,,af79536b,"refactor(docs): code relationship mapping with 2 supporting modules
239+
240+
stats:
241+
lines: ""+3/-15 (net -12)""
242+
files: 3
243+
complexity: ""Stable complexity""",Tom Softreck,2026-03-29T11:48:14+02:00
244+
0.002551,$0.0026,openrouter/qwen/qwen3-coder-next,byok,"{'input': 797, 'output': 1435, 'total': 2233}",0.32,0.08,32.0,12544.1,,bdf7dff2,"chore(goal): code relationship mapping with 2 supporting modules
245+
246+
stats:
247+
lines: ""+2/-2 (net +0)""
248+
files: 2
249+
complexity: ""Stable complexity""",Tom Softreck,2026-03-29T11:47:15+02:00
250+
0.002231,$0.0022,openrouter/qwen/qwen3-coder-next,byok,"{'input': 697, 'output': 1255, 'total': 1953}",0.3,0.07,29.6,13267.6,,958a64e4,"chore(goal): configuration management
251+
252+
stats:
253+
lines: ""+1/-1 (net +0)""
254+
files: 1
255+
complexity: ""Stable complexity""",Tom Softreck,2026-03-29T11:46:35+02:00
256+
0.00304,$0.0030,openrouter/qwen/qwen3-coder-next,byok,"{'input': 950, 'output': 1710, 'total': 2660}",0.4,0.1,40.0,13157.9,,a7d6f029,"chore(goal): code relationship mapping with 2 supporting modules
257+
258+
stats:
259+
lines: ""+3/-3 (net +0)""
260+
files: 2
261+
complexity: ""Stable complexity""",Tom Softreck,2026-03-29T11:46:13+02:00
262+
0.002007,$0.0020,openrouter/qwen/qwen3-coder-next,byok,"{'input': 627, 'output': 1129, 'total': 1757}",0.25,0.06,24.8,12356.8,,37f2fc1e,"chore(config): configuration management
263+
264+
stats:
265+
lines: ""+1/-1 (net +0)""
266+
files: 1
267+
complexity: ""Stable complexity""",Tom Softreck,2026-03-29T11:43:33+02:00
268+
0.002007,$0.0020,openrouter/qwen/qwen3-coder-next,byok,"{'input': 627, 'output': 1129, 'total': 1757}",0.25,0.06,24.8,12356.8,,7c824064,"chore(config): configuration management
269+
270+
stats:
271+
lines: ""+1/-1 (net +0)""
272+
files: 1
273+
complexity: ""Stable complexity""",Tom Softreck,2026-03-29T11:40:10+02:00
274+
0.002023,$0.0020,openrouter/qwen/qwen3-coder-next,byok,"{'input': 632, 'output': 1138, 'total': 1771}",0.25,0.06,24.8,12259.0,,b28e0594,"chore(config): configuration management
275+
276+
stats:
277+
lines: ""+1/-1 (net +0)""
278+
files: 1
279+
complexity: ""Stable complexity""",Tom Softreck,2026-03-29T11:39:18+02:00
280+
0.002944,$0.0029,openrouter/qwen/qwen3-coder-next,byok,"{'input': 920, 'output': 1656, 'total': 2576}",0.42,0.11,42.4,14402.2,,8f63b60e,"chore(config): code relationship mapping with 2 supporting modules
281+
282+
stats:
283+
lines: ""+17/-3 (net +14)""
284+
files: 1
285+
complexity: ""Stable complexity""",Tom Softreck,2026-03-29T11:37:52+02:00
286+
0.005568,$0.0056,openrouter/qwen/qwen3-coder-next,byok,"{'input': 1740, 'output': 3132, 'total': 4872}",0.62,0.16,62.4,11206.9,,78a6b37e,"docs(docs): CLI interface
287+
288+
stats:
289+
lines: ""+18/-10 (net +8)""
290+
files: 1
291+
complexity: ""Stable complexity""",Tom Softreck,2026-03-29T11:35:49+02:00
292+
0.003175,$0.0032,openrouter/qwen/qwen3-coder-next,byok,"{'input': 992, 'output': 1786, 'total': 2779}",0.4,0.1,40.0,12598.4,,4c6e6565,"chore(goal): CLI interface with 2 supporting modules
293+
294+
stats:
295+
lines: ""+3/-3 (net +0)""
296+
files: 2
297+
complexity: ""Stable complexity""",Tom Softreck,2026-03-29T11:34:22+02:00
298+
0.074272,$0.0743,openrouter/qwen/qwen3-coder-next,byok,"{'input': 23210, 'output': 41778, 'total': 64988}",10.54,2.63,1053.6,14185.7,,8e685825,"refactor(goal): CLI interface improvements
299+
300+
changes:
301+
- file: calculator.py
302+
area: core
303+
added: [batch_calculate_costs, estimate_tokens, ai_cost, calculate_cost, calculate_roi]
304+
- file: cli.py
305+
area: cli
306+
added: [main, init, analyze, version_callback, estimate, callback]
307+
- file: git_parser.py
308+
area: analyzer
309+
added: [get_commit_diff, extract_ai_tag, is_ai_commit, parse_commits, get_repo_name]
310+
- file: models.py
311+
area: model
312+
added: [get_model_price, get_litellm_model_name, get_openrouter_headers]
313+
- file: test_cost.py
314+
area: test
315+
new_tests: 2
316+
317+
testing:
318+
new_tests: 2
319+
scenarios:
320+
- placeholder
321+
- import
322+
323+
dependencies:
324+
flow: ""cli→calculator→git_parser""
325+
- calculator.py -> git_parser.py
326+
- cli.py -> calculator.py
327+
- cli.py -> git_parser.py
328+
329+
stats:
330+
lines: ""+1270/-1 (net +1269)""
331+
files: 10
332+
complexity: ""Large structural change (normalized)""",Tom Softreck,2026-03-29T11:33:30+02:00
333+
0.0001,$0.0001,openrouter/qwen/qwen3-coder-next,byok,"{'input': 2, 'output': 4, 'total': 7}",0.01,0.0,0.8,8000.0,,bfcfd2a9,Initial commit,Tom Sapletta,2026-03-29T11:20:03+02:00

project/project.toon.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# cost | 41 func | 7f | 1795L | python | 2026-03-29
1+
# cost | 41 func | 7f | 1805L | python | 2026-03-29
22

33
HEALTH:
44
CC̄: 4.8
@@ -20,7 +20,7 @@ ALERTS:
2020
- "! high_fan_out ai_cost = 10 (limit:10)"
2121

2222
MODULES:
23-
- "M[src/costs/reports.py] 542L C:0 F:5 CC↑9 D:1 (python)"
23+
- "M[src/costs/reports.py] 552L C:0 F:5 CC↑9 D:1 (python)"
2424
- "M[src/costs/cli.py] 472L C:0 F:14 CC↑8 D:0 (python)"
2525
- "M[services/badge-service/badge.php] 231L C:0 F:4 CC↑14 D:0 (php)"
2626
- "M[src/costs/git_parser.py] 186L C:0 F:9 CC↑11 D:2 (python)"
@@ -41,10 +41,10 @@ HOTSPOTS:
4141
- "★ handleApiRequest fan=14 // Orchestrates 14 calls"
4242

4343
REFACTOR:
44-
- "[1] H/H Split god module src/costs/reports.py (542L, 0 classes)"
44+
- "[1] H/H Split god module src/costs/reports.py (552L, 0 classes)"
4545
- "[2] M/M Reduce update_readme_badge fan-out (currently 18)"
4646
- "[3] M/M Reduce auto_badge fan-out (currently 18)"
4747
- "[4] M/M Reduce report fan-out (currently 17)"
4848

4949
EVOLUTION:
50-
- "2026-03-29 CC̄=4.8 crit=2 1795L // Automated analysis advanced cost engine"
50+
- "2026-03-29 CC̄=4.8 crit=2 1805L // Automated analysis realistic cost tuning"

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
44

55
[project]
66
name = "costs"
7-
version = "0.1.30"
7+
version = "0.1.31"
88
description = "Zero-config AI cost calculator per commit/model with liteLLM"
99
readme = "README.md"
1010
license = "Apache-2.0"

src/costs/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
from .calculator import ai_cost, estimate_tokens
55
from .models import PRICES, DEFAULT_MODEL, DEFAULT_OPENROUTER_API_KEY, get_litellm_model_name
66

7-
__version__ = "0.1.30"
7+
__version__ = "0.1.31"
88
__all__ = ["ai_cost", "estimate_tokens", "PRICES", "DEFAULT_MODEL", "DEFAULT_OPENROUTER_API_KEY", "get_litellm_model_name"]

0 commit comments

Comments
 (0)