chore: rip out the stats feature (rebuild later) #556
Labels
No labels
area:agents
area:dashboard
area:database
area:design
area:design-review
area:flows
area:infra
area:meta
area:security
area:sessions
area:webhook
area:workdir
security
type:bug
type:chore
type:meta
type:user-story
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
charles/claude-hooks#556
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
As an operator, I want the entire current stats surface removed from the codebase so that we can rebuild a clean version later without dragging the existing 2.2K LOC of debt forward.
The current stats stack is a mix of merged-in panels (stats + quota), client-side aggregation, and orphan tables. Rather than refactor it incrementally, we are deleting it wholesale and starting fresh in a follow-up milestone.
Acceptance criteria
Server
apps/server/src/main.tsGET /statsroute registration andhandleStats()handler (~lines 1465–1473, 1880).apps/server/src/domain/analytics/task-analytics.ts(581 LOC).apps/server/src/domain/analytics/task-analytics.test.ts(653 LOC).apps/server/src/infrastructure/storage.ts::getStorageStats()if no other caller.task_historycost / token columns in the schema (no migration); they're re-usable when the rebuild lands.Web
apps/web/src/routes/stats.tsxandapps/web/src/routes/stats.test.tsx.apps/web/src/routes/usage.tsx(stats + quota merged into the same surface — both go).apps/web/src/components/stats/quota-panel.tsxand thecomponents/stats/folder if empty.apps/web/src/components/storage-strip.tsxand remove its callers.fetchStats,StatsResponse,StatsWindowfromapps/web/src/lib/api.ts.{ to: "/stats", label: "Stats", testId: "nav-stats" }entry fromapps/web/src/components/app-shell.tsx.apps/web/e2e/stats-usage.spec.ts.Docs
/statsand/usagereferences fromdocs/api.mdanddocs/modules.md.Verification
just qapasses (typecheck + lint + tests)./stats404 in logs from internal callers./statsin the web app surfaces a clean 404, not a stale layout.Out of scope
cost_usd, token columns ontask_history) — keep, the rebuild will reuse them.References
apps/server/src/domain/analytics/,apps/web/src/components/stats/,apps/web/src/routes/stats*,apps/web/src/routes/usage*.Dispatch coordination
Parallel with #558. No blockers either way — minimal overlap (only
apps/web/src/components/app-shell.tsxnav entries; trivial merge).Routing: dev (deletion sweep, no architectural judgment calls).
Conflict points to watch:
apps/web/src/components/app-shell.tsx— drop the/statsnav entry. #557 will later renameSpecs+Planner→Workspace; #558 will add a mobile hamburger drawer. Different lines, mergeable.apps/web/src/routeTree.gen.ts— auto-regenerated; expected to conflict on rebase, just regenerate.apps/web/src/lib/api.ts—fetchStats/StatsResponse/StatsWindowremoval section is far from anything #557 will touch.Independent of: #557 (specs/planner unification — different feature folders).