Skip to content

feat: Phase 6 — Cost Control & Telemetry - #11

Merged
getdownandcode merged 3 commits into
mainfrom
feat
Sep 18, 2026
Merged

getdownandcode merged 3 commits into
mainfrom
feat

Conversation

@getdownandcode

Copy link
Copy Markdown
Owner

Summary

Implements Phase 6 (Cost Control & Telemetry) for gitmate.

Deliverables

  • Model Pricing Table & Cost Estimation: Model pricing registry for known models (gemini-3.5-flash-lite, gemini-3-flash, claude-3-5-sonnet, etc.) with $0.00 for cache hits and template fallbacks.
  • SQLite Schema Evolution: Non-destructive ALTER TABLE migration adding estimated_cost_usd REAL to invocations table in ~/.local/share/gitmate/metrics.db.
  • Monthly Spend & Budget Cap Enforcement: Checks monthly spend against configured budget_cap_usd, halting with exit code 1 if exceeded and issuing early warning at 80% threshold.
  • gitmate stats CLI Command: Rich formatted table displaying total runs, cache hit rate, token counts, estimated spend, average latency (hit vs miss), and breakdowns by command and model. Supports --days, --month, and --raw (JSON).
  • Code Quality & Clean-up: Exposes public .underlying property on CachedProvider replacing private _provider access across modules.

Verification

  • 218 tests passing (100%), expanding test suite with 11 new Phase 6 tests.
  • ruff check . clean, ruff format --check . clean, and mypy src tests (strict mode) clean.
  • Manual verification of gitmate stats and gitmate stats --raw.

@getdownandcode
getdownandcode merged commit d651e37 into main Sep 18, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant