codeburn/tests
Trevin Chow 3f7470d29b feat(plan): subscription plan tracking with usage progress bar
Adds `codeburn plan set <id>` to configure a subscription plan (Claude Pro,
Claude Max, Cursor Pro, or custom). When set, the Overview panel renders
an API-equivalent progress bar against subscription price with a
projected month-end cost.

Closes the loudest demand signal on the repo: issue #11 ("Subscription
vs API Use") from two independent voices, plus the routing-decision use
case raised in #12.

- src/config.ts: extends CodeburnConfig with Plan, adds readPlan/savePlan/clearPlan
- src/plans.ts: presets (claude-pro $20, claude-max $200, cursor-pro $20)
- src/plan-usage.ts: getPlanUsage, resetDay-aware period math (1-28),
  median-of-7-day-trailing projection
- src/cli.ts: `codeburn plan [show|set|reset]` subcommand, plan wired
  into JSON outputs for report/today/month/status (only when active)
- src/dashboard.tsx: Plan row in Overview, color-coded (green under 80%,
  orange near, red over), with days-until-reset
- README.md: Plans section with honest framing (API-equivalent vs
  subscription price, not token allowance)
- tests/plan-usage.test.ts, tests/plans.test.ts, tests/cli-plan.test.ts:
  period math, presets, CLI round-trip

Resets respect resetDay across month boundaries. Uses median daily spend
(not mean) so one huge day doesn't distort the month-end projection.

Fixes #11
2026-04-21 04:20:50 -07:00
..
fixtures/security test(security): add failing test for HIGH-1 prototype pollution 2026-04-17 08:32:18 +02:00
providers fix: drop better-sqlite3 to remove deprecated prebuild-install (#75) 2026-04-18 01:26:23 -07:00
security feat(mac): native Swift menubar app + one-command install 2026-04-17 16:55:56 -07:00
bash-commands.test.ts chore: hoist Pi model sort + cover bash-utils edge cases 2026-04-16 02:02:32 -07:00
cli-plan.test.ts feat(plan): subscription plan tracking with usage progress bar 2026-04-21 04:20:50 -07:00
compare-stats.test.ts feat(compare): model comparison with planning rate fix 2026-04-19 08:34:49 -07:00
daily-cache.test.ts fix: recompute yesterday in daily cache to prevent stale menubar data 2026-04-19 03:07:54 -07:00
dashboard.test.ts fix: handle empty firstTimestamp in TopSessions, add dashboard tests 2026-04-16 15:48:24 +02:00
date-range-filter.test.ts feat(report): add --from/--to date range filtering and avgCostPerSession (#80) 2026-04-18 15:11:33 -07:00
day-aggregator.test.ts feat(mac): native Swift menubar app + one-command install 2026-04-17 16:55:56 -07:00
export.test.ts fix: pricing accuracy, stream leak, CSV injection hardening 2026-04-21 04:20:46 -07:00
fs-utils.test.ts fix: pricing accuracy, stream leak, CSV injection hardening 2026-04-21 04:20:46 -07:00
menubar-json.test.ts feat(mac): native Swift menubar app + one-command install 2026-04-17 16:55:56 -07:00
models.test.ts fix: pricing accuracy, stream leak, CSV injection hardening 2026-04-21 04:20:46 -07:00
optimize-fs.test.ts docs(optimize): remove references to non-existent .claudeignore 2026-04-17 08:32:07 +02:00
optimize.test.ts docs(optimize): remove references to non-existent .claudeignore 2026-04-17 08:32:07 +02:00
parser-filter.test.ts test: cover filterProjectsByName include/exclude semantics 2026-04-16 15:49:57 -07:00
plan-usage.test.ts feat(plan): subscription plan tracking with usage progress bar 2026-04-21 04:20:50 -07:00
plans.test.ts feat(plan): subscription plan tracking with usage progress bar 2026-04-21 04:20:50 -07:00
provider-registry.test.ts feat: add GitHub Copilot provider 2026-04-16 15:40:22 +03:00