feat(budget): implement CostTracker service for per-session and per-plan spending tracking #10610

Merged
HAL9000 merged 3 commits from feat/v3.6.0/cost-tracker into master 2026-06-04 14:07:10 +00:00

3 Commits

Author SHA1 Message Date
HAL9000 aee4e25853 fix(budget): fix type safety, formatting, and test correctness in CostTracker
CI / build (pull_request) Successful in 44s
CI / lint (pull_request) Successful in 52s
CI / quality (pull_request) Successful in 1m5s
CI / typecheck (pull_request) Successful in 1m19s
CI / helm (pull_request) Successful in 33s
CI / security (pull_request) Successful in 1m28s
CI / push-validation (pull_request) Successful in 26s
CI / unit_tests (pull_request) Successful in 4m42s
CI / integration_tests (pull_request) Successful in 9m38s
CI / docker (pull_request) Successful in 2m10s
CI / coverage (pull_request) Successful in 10m42s
CI / status-check (pull_request) Successful in 4s
- Convert CostRecord from @dataclass to Pydantic BaseModel (architecture policy)
- Replace declarative_base() + # type: ignore[misc] with DeclarativeBase subclass
- Use Mapped/mapped_column for proper SQLAlchemy 2.0 typed columns
- Remove all cast() calls — types now flow from Mapped[T] annotations
- Change timestamp column from String to DateTime; use datetime.now(UTC)
- Fix wrong expected totals in cost_tracker_service.feature (0.00035 → 0.00075)
- Fix step_check_entries_ids AttributeError: read plan_entries when session_entries absent
- Apply ruff format to both changed files

ISSUES CLOSED: #5248
2026-06-04 09:49:11 -04:00
HAL9000 6b9e422814 fix(budget): resolve lint and typecheck failures in CostTracker service
- Add __allow_unmapped__ = True and type: ignore[misc] to CostEntry model
- Import typing.cast and use cast() for all SQLAlchemy column attribute accesses
- Wrap long __init__ signature to stay within 88-char line limit
- Wrap long docstring lines to stay within 88-char line limit
- Wrap long query chains to stay within 88-char line limit
2026-06-04 09:49:11 -04:00
HAL9000 d465389e9e feat(budget): implement CostTracker service for LLM spending tracking 2026-06-04 09:49:11 -04:00