Skip to content

refactor: architecture overhaul and dynamic pricing for v0.3.0#6

Merged
Mahiler1909 merged 2 commits intomainfrom
refactor/architecture-v0.3.0
Mar 30, 2026
Merged

refactor: architecture overhaul and dynamic pricing for v0.3.0#6
Mahiler1909 merged 2 commits intomainfrom
refactor/architecture-v0.3.0

Conversation

@Mahiler1909
Copy link
Copy Markdown
Owner

Summary

  • Dynamic pricing: Fetch model pricing from LiteLLM with 24h disk cache + bundled fallback. Fixes Opus 4.6/4.5 at 3x the real price ($15→$5 input), Haiku 4.5 at 20% under ($0.80→$1), and adds 4 missing models. New --offline global flag.
  • Provider decomposition: Split 692-LOC ClaudeCodeProvider into 5 focused modules (exchange-classifier, jsonl-parser, outcome-inferrer, path-resolver, session-builder) — same public API, independently testable.
  • Formatter split: Extract visual primitives into visual.ts with barrel re-export — all existing imports unchanged.
  • README update: Document supported/planned providers, dynamic pricing, updated command table (compare → branch variadic).
  • Version bump: 0.2.1 → 0.3.0

Test plan

  • 240/240 tests pass (37 new unit tests for extracted modules)
  • TypeScript compiles clean
  • Pre-push hooks pass (build + full test suite)
  • Verified with real projects: JSON structure identical, costs corrected (~$1222→$456 for 30d)
  • burnlog report --offline uses bundled pricing without network
  • Table output renders correctly

🤖 Generated with Claude Code

- Dynamic pricing: fetch from LiteLLM with 24h cache + bundled fallback.
  Fixes incorrect Opus 4.6 pricing (was 3x too high) and adds 4 missing
  models. New --offline flag skips network.
- Provider split: decompose 692-LOC monolith into 5 focused modules
  (exchange-classifier, jsonl-parser, outcome-inferrer, path-resolver,
  session-builder) without changing public API.
- Formatter split: extract visual primitives into visual.ts, barrel
  re-export preserves all existing imports.
- Update README: document supported/planned providers, dynamic pricing,
  branch comparison syntax, remove deprecated compare command.
- Bump version to 0.3.0.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 30, 2026

Codecov Report

❌ Patch coverage is 96.66667% with 8 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/cli/formatters/visual.ts 97.20% 4 Missing ⚠️
src/utils/pricing-tables.ts 80.00% 4 Missing ⚠️

📢 Thoughts on this report? Let us know!

Cover loadCachedPricing, savePricingCache, resolvePricing fallback chain,
and deriveDisplayName old naming pattern to fix codecov/patch failure.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Mahiler1909 Mahiler1909 merged commit 94c1235 into main Mar 30, 2026
4 checks passed
@Mahiler1909 Mahiler1909 deleted the refactor/architecture-v0.3.0 branch March 30, 2026 23:20
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