# ADR-0004: Cost tracking is open; self-learning and optimizer are excluded - Status: Accepted - Date: 2026-10-14, amended 2026-10-15 (`optimizer` classified as self-learning) ## Context Waggle tracks model costs and budget limits (execution traces, cost reservation, the `CostTracker` in the agent). It also has a self-learning subsystem: behaviour evolution, improvement signals, learning from user corrections, judge and eval loops, and the `packages/optimizer` package for GEPA prompt optimization, called from the chat route through `packages/server/src/local/services/optimizer-service.ts`. ## Decision - Cost tracking and budget limits are part of the community edition, under MIT. - Self-learning is excluded, including `packages/optimizer`. The project owner reworks it separately. ## Consequences - P1.2 and P1.5 move cost tracking to `waggle.db`. - P1.4 removes the self-learning modules, `packages/optimizer` and the optimizer service. The tables `evolution_runs` and `improvement_signals` are not carried into `waggle.db`. - P1.4 decides whether the optimization log (`optimization_log`) is still needed without `optimizer`.