# MyBurn Roadmap — Prioritized TODO (updated Feb 24, 2026)

Princípio orientador: **ship Layer 1 polido → viralizar com meme cards → Layer 2 social é o moat.**
A ordem importa: não faz sentido ter push/leaderboard sem users. Users vêm do viral. Viral vem dos cards.

---

## Grand Plan — Visão Completa (o fio condutor)

### Layer 1: Dashboard Local ← ESTAMOS AQUI

| Peça | Estado | Notas |
|------|--------|-------|
| Dashboard base (KPIs, charts, heatmap) | ✅ | 6 KPIs, daily chart, heatmap, sessions table |
| Scorecard system (14 estilos) | ✅ | Modal, share on X, save PNG, copy |
| Wrapped experience | ✅ | `wrapped.html`, Spotify-style slides |
| RPG rank + achievements | ✅ | 8 ranks, 7 badges, progress bar |
| Projection + cache analytics | ✅ | EOM projection, cache gauge, model economics |
| Live monitor | ✅ | Real-time ticker, auto-refresh |
| Native JSONL parser (Pass 1 + 2) | ✅ | Dual-run, 16K+ turns, costs match |
| YOLO mode frontend | ✅ | Hero badge + card com 2 tabs |
| Tool Usage card | ✅ | Top tools + categories, horizontal bars |
| Turn Insights card | ✅ | Duration, thinking, errors, sessions |
| Delta sync bug fix | ✅ | Scoped deletes instead of wipe |
| Cost → Burn rebrand | ✅ | Framing como valor extraído, não despesa |
| Local Profile (settings panel) | ✅ | Profile modal, avatar grid, plan migrado |
| VU Meter + Live Burn Counter | ✅ | v0.2: personal scale, 3 bars (burn hero/input cold/speed), zone line, YOLO 24h badge |
| Hourly Pattern (activity card) | ✅ | 24-bar chart, `/api/hourly-pattern`, 3-col layout |
| Mobile UX Overhaul | ✅ | Hero sub-row, kebab menu, sticky header, VU detach, KPI carousel, responsive type |
| Burn Format Scaling | ✅ | Adaptive: micro-decimals <$10K, clean $10K-$999K, suffix $1M+ |
| **Kill ccusage dependency** | **✅** | **ccusage fully removed, native parser is sole source** |
| Meme energy nos scorecards | ✅ | Metrics in all 14 cards, dynamic roasts, YOLO Mode card |
| Share Flow (OG tags, landing, CTA) | ✅ | Landing page, OG meta, share text, brand link |
| Open Source (pip/npx, CLI, package) | ✅ | `myburn/` package, CLI, npx wrapper, README, MIT |

### Layer 2: Social / Push (o moat) ← LAYER 2 FECHADO

| Peça | Estado | Notas |
|------|--------|-------|
| Push architecture (design) | ✅ | Documentado em `push-architecture.md` |
| CLI `myburn push` (local + cloud) | ✅ | Payload, dry-run, receipts, cloud push, 268 tests |
| GitHub OAuth | ✅ | Device Flow, `myburn login/logout` |
| Public profiles (myburn.cc/u/username) | ✅ | HTML + JSON, dark theme, OG tags |
| Leaderboard / rankings | ✅ | 5 metrics, 3 periods, percentiles, auth rank, HTML page |
| Push button no dashboard local | ✅ | Settings, preview JSON, push history |
| Trust infra (validation, hash chains) | ✅ | Tier 1: 8 checks, hash chains, Benford's Law |
| `myburn verify` (local vs server) | ✅ | Chain integrity, hash comparison, cost/token/session diff |
| Privacy toggles | ✅ | hideCost, hideTokens, hideModels, hideDays — profile redaction |
| Auto-push | ✅ | Off/Daily/Weekly/Monthly, sync loop integration |

### Layer 3: B2B (o business model)

| Peça | Estado | Notas |
|------|--------|-------|
| Team dashboards (CTO view) | 🔲 | Precisa de Layer 2 com users |
| Aggregate benchmarks | 🔲 | Anonymized |
| Enterprise pricing | 🔲 | Futuro |

---

## P0 — Fechar Layer 1

Objectivo: dashboard local à prova de bala, sem dependências externas.

### P0.1 — Kill ccusage ⏳
- [ ] Correr dual-run mais 2-3 dias, validar que native parser é fiel
- [ ] Fix session divergence (subagent grouping) no native parser
- [ ] Cortar os 4 `npx ccusage` subprocess calls do `_sync_loop()`
- [ ] Migrar endpoints `/api/monthly`, `/api/daily`, `/api/sessions` para ler das tabelas `native_*`
- [ ] Remover tabelas `daily_usage`, `sessions`, `blocks` (legacy ccusage)
- [ ] Remover `comparison_log` e `/api/debug/compare` (já não precisa)
- **Risco**: se native parser tiver bugs subtis, dados ficam errados sem safety net
- **Mitigação**: manter ccusage como fallback 1 semana, flag `USE_NATIVE=true`

### P0.2 — Tool Analytics Card ✅ (Feb 24)
- [x] Card "Tool Usage" no dashboard com dados de `/api/metrics`
- [x] Top 8 tools com horizontal bars, cor por categoria (read=azul, write=amarelo, exec=vermelho, agent=roxo)
- [x] Tab "Categories" com 4 grupos (Read & Search, Write & Edit, Execute, Agent)
- [x] Big number: total tool calls + avg tools/turn + error rate

### P0.3 — Turn Insights Card ✅ (Feb 24)
- [x] Card com 2 tabs: Overview + Performance
- [x] Overview: avg/median duration hero, bars para thinking %, errors, interrupted %, subagents
- [x] Performance: total turns hero, bars para avg cost, thinking count, tools/turn
- [x] `_fmtDuration()` helper (Xm Ys / Xs / — para null)
- [x] Tab persistence via sessionStorage

### P0.4 — Native JSONL Parser + Pass 2 ✅ (Feb 24)
- [x] Native Python JSONL parser (dual-run com ccusage) — `_scan_jsonl_entries()`, `_aggregate_to_daily()`, `_aggregate_to_sessions()`
- [x] Shadow tables: `native_daily_usage`, `native_sessions`, `comparison_log`
- [x] Pass 2: `_scan_jsonl_turns()` — 16K+ turns extraídos, 1 row per assistant turn
- [x] Table `native_turns` com permission_mode, duration_ms, tools, thinking, cost
- [x] Endpoints: `/api/metrics` (full aggregation), `/api/metrics/yolo` (breakdown by project/day)
- [x] JSONL schema spike: `docs/jsonl-spike-report.md`, `docs/parser-gotchas.md`, `docs/extraction-strategy.md`, `docs/metrics-catalog.md`

### P0.5 — YOLO Mode Frontend ✅ (Feb 24)
- [x] Hero badge ☠️ com YOLO % quando > 0
- [x] Dashboard card com Overview tab (big % hero, permission mode bars) + Projects tab (per-project breakdown)
- [x] Green/red color coding, tab persistence

### P0.6 — Delta Sync Bug Fix ✅ (Feb 24)
- [x] Fix: `_persist_turns()` fazia `DELETE FROM` em cada delta sync, wipando 16K rows
- [x] Mesmo bug em `native_daily_usage`/`native_sessions`
- [x] Fix: delta syncs delete only by scanned `session_file`, full syncs wipe+rebuild

### P0.7 — Cost → Burn Rebrand ✅ (Feb 24)
- [x] Hero KPI: "💰 Cost" → "🔥 Burn" + tooltip reescrito
- [x] Recent KPI: "24h Spent" / "7d Spent" → "24h Burn" / "7d Burn"
- [x] ROI subtitle: "API value for $200/mo" → "burned for $200/mo"
- [x] Chart toggle: "Cost" → "Burn", chart title "Daily Burn"
- [x] Donut center: "Total Cost" → "Total Burn"
- [x] Sessions table: "Total Cost" → "Total Burn"
- [x] Scorecards: "API value" / "Total cost" → "Total burn", "burned this month"
- [x] Tweet text: "💰 API cost" → "🔥 burned"
- [x] All card tooltips updated (Model Distribution, Project Breakdown, Projection)

### P0.8 — Local Profile ✅ (Feb 24)
- [x] Settings panel/modal acessível do dashboard (gear icon ⚙️ + tecla G)
- [x] Campos: display name, AI name, avatar (16 emoji grid)
- [x] Plano integrado (plan selector migrado do header para modal)
- [x] Persistência em localStorage (`myburn_profile_{name,avatar,ai_name}`)
- [x] Scorecards usam profile data via `getProfile()` centralizado
- [x] Tweet text personalizado com username
- [x] Scorecard username input → read-only profile badge (click abre profile)
- [x] Legacy migration: `scorecard_username` → `myburn_profile_name`
- [x] Mobile responsive (≤480px)

### P0.9 — VU Meter + Live Burn Counter ✅ (Feb 24, upgraded Feb 25)
- [x] 32-segment LED bar (green→yellow→orange→red) in live ticker, left-aligned
- [x] 3s unified poll — VU piggybacks on ticker fetch, fewer total requests
- [x] Spring animation @30fps with idle breathing (~0.8Hz), peak hold (2s decay)
- [x] Noise floor: <$1/h burn rate → idle breathing mode
- [x] Piecewise normalization: $0→0, $5/h→40%, $15→60%, $30→80%, $40+→100%
- [x] Hot glow (>85%): red pulse 1.2s cycle. Critical (>95%): 0.5s cycle
- [x] Live burn counter: hero cost interpolates between API updates (gas pump effect)
- [x] Counter never decreases — `_burnLastShown` tracking, `max(real, current)` on sync
- [x] Micro-decimals: 4 decimal places, last 2 in small font, baseline-aligned
- [x] Mobile responsive (120px @768px, full-width @480px)
- [x] **Feb 25 upgrade**: 3 unique meter personalities:
  - INPUT: cold gradient (blue→cyan→white), flash-up + slow bleed decay, 4s peak hold, cyan glow, reads full context (input+cache tokens), label "in"→"input"
  - OUT: recalibrated scale (500→35K tok/min), warm glow at >85%/95%
  - BURN: unchanged (master meter)
  - Backend: timeline buckets now include cacheReadTokens + cacheCreationTokens

### P0.10 — Hourly Pattern (Activity Card) ✅ (Feb 24)
- [x] Backend: `GET /api/hourly-pattern` — SQL on `native_turns`, 24 entries (hour, avgCost, totalCost, turns)
- [x] Frontend: 24 vertical bars in activity card, height ∝ avgCost, orange intensity
- [x] 3-column layout: `[Weekly 180px] | [Hourly 200px] | [Calendar flex:1]`
- [x] Sparse labels (0h, 6h, 12h, 18h), tooltips with details per hour
- [x] Mobile responsive: stacks vertically at ≤1024px

### P0.11 — Mobile UX Overhaul ✅ (Feb 24)
- [x] Hero sub-row: 3-column grid (VU 1/4 | badges 1/4 | LIVE 2/4) aligned under KPIs
- [x] Kebab menu (⋮): hides 🏆 ✴ ⚙️ on mobile, keeps ↻ and 🌙 visible, preserves tagline
- [x] Sticky header: `position: fixed` on mobile with padding-top spacer
- [x] VU detach/attach: IntersectionObserver moves VU to sticky bar on scroll (DOM relocation, not clone)
- [x] KPI carousel: scroll-snap with dot indicators, full-width cards `calc(100vw - 40px)`
- [x] Responsive typography: `clamp()` for fluid font scaling across phone sizes
- [x] Mobile sub-row reorder: instruments (VU → LIVE) grouped above identity badges via CSS `order`

### P0.12 — Burn Format Scaling ✅ (Feb 24)
- [x] <$10K: micro-decimals ($970.42³⁷) — current behavior preserved
- [x] $10K-$999K: clean 2 decimals ($250,000.77) — no micro-decimals at meaningless scale
- [x] $1M+: compact suffix ($1.23M) — no overflow
- [x] Both `fmtCostLive()` and `fmtCost()` updated
- [x] Verified across 5 phone viewports (360-430px) + desktop via Playwright

---

## P1 — Motor Viral

Objectivo: cada card partilhado no X = 1 user novo. Os cards são o marketing.

### P1.1 — Meme Energy nos Scorecards ✅ (Feb 24)
- [x] `_getScoreCardData()` extended: 20+ metrics fields from `state.metrics` with `hasMetrics` fallback
- [x] Roast Card V2: 23-roast dynamic pool filtered by real stats, 3-pick with stride spread
- [x] 5 new violation codes (YOL-069, THK-042, BAS-666, ERR-911, ACP-100)
- [x] 6 new achievement badges (YOLO Cowboy, Script Kiddie, Overthinking, Bookworm, Speed Demon, Trust Fall)
- [x] All 13 existing cards enhanced with metrics (tools, YOLO%, thinking%, duration, errors)
- [x] NEW: YOLO Mode card (#14) — "I TEST IN PROD", hazard stripes, danger level bar, time saved estimate
- [x] Share text includes YOLO% or turn count
- [x] Fix: totalWaitHours uses median * 0.4 factor (was inflated 4x with avg)
- **14 scorecard styles total**

### P1.2 — Share Flow Optimization ✅ (Feb 25)
- [x] Open Graph meta tags em myburn.cc para preview bonito quando partilhado
- [x] "Compare with friends" CTA no card (teaser para Layer 2)
- [x] Landing page myburn.cc com demo/preview para quem vê o card no X
- [x] Share text inclui `pip install myburn` line
- [x] Brand icon link back to `/` no dashboard

### P1.3 — Open Source Prep ✅ (Feb 25)
- [x] Package restructure: `myburn/` package com `server.py`, `cli.py`, `__main__.py`
- [x] `pip install myburn` + `npx myburn` — instalação em 10 segundos
- [x] CLI com `--port`, `--host`, `--no-browser`, `--version`, auto-opens browser
- [x] README com install commands, feature list, MIT license
- [x] LICENSE (MIT), CONTRIBUTING.md
- [x] `app.py` backward-compat shim (production keeps working)
- [x] npx wrapper (Node shim → pip install → python -m myburn)

---

## P2 — Layer 2: Push + Social

Objectivo: o moat. Rankings e "Top 3%" só funcionam centralizados.

### P2.1 — Push Command ✅ (Feb 25-26)
- [x] `myburn push` — dry-run obrigatório na primeira vez
- [x] Payload: só números agregados (ver push-architecture.md)
- [x] Local receipt em `~/.myburn/receipts/`
- [x] CLI subcommands: `myburn push [--dry-run] [--month MM] [--yes]`
- [x] POST ao server via cloud push (auto-publishes if logged in)
- [x] `myburn verify` — compare local receipts vs server (hash, cost, tokens, sessions)
- [x] Dashboard: botão "Push" + preview JSON + history
- [x] 68 unit tests (payload, formatting, receipts, CLI parsing, verify, auto-push)

### P2.2 — Auth + Profiles ✅ (Feb 25-26)
- [x] GitHub OAuth Device Flow (`myburn login` / `myburn logout`)
- [x] `myburn/auth.py` — Device Flow + `~/.myburn/config.json` management
- [x] `myburn/cloud.py` — cloud.db (users + pushes), cloud routes
- [x] `POST /api/auth/github` — exchange GH token → MyBurn API token
- [x] `POST /api/push` — validate + upsert, Bearer auth
- [x] `GET /api/u/{username}` — JSON profile data (with privacy redaction)
- [x] `GET /u/{username}` — HTML public profile (dark theme, OG tags, privacy)
- [x] Privacy toggles: hideCost, hideTokens, hideModels, hideDays
- [x] `GET/POST /api/privacy` — server endpoints, local proxy `/api/push/privacy`
- [x] Dashboard checkboxes in push section for privacy settings
- [x] Cloud routes conditional (only load with `GITHUB_CLIENT_ID` env var)

### P2.3 — Leaderboard ✅ (Feb 25)
- [x] Rankings: by cost, by tokens, by sessions, by active_days, by streak
- [x] Percentiles: "Top X%"
- [x] Time periods: current month, last month, all time
- [x] Auth integration: `you` rank in response when authenticated
- [x] HTML leaderboard page with OG tags

### P2.4 — Push Button + Auto-Push ✅ (Feb 25-26)
- [x] Settings modal: profile section, push section, privacy toggles
- [x] Push history com status (synced ✓ / local ○)
- [x] Auto-push toggle (Off/Daily/Weekly/Monthly) — sync loop integration
- [x] Transparency: "View exact JSON" button
- [x] `GET/POST /api/push/auto` — config endpoints

### P2.5 — Trust Infra ✅ (Feb 25-26)
- [x] `myburn/trust.py` — 8 checks: model names, price consistency, daily sum, tokens, active days, Benford's Law, hash chain
- [x] Hash chains: `payload_hash` + `prev_hash` stored in pushes table
- [x] Trust score: 1.0 = perfect, soft flags -0.1, hard flags -0.5
- [x] `myburn verify` — local chain integrity + server comparison

---

## P3 — Layer 3: B2B (futuro, quando Layer 2 tiver traction)

- [ ] Team dashboards (CTO view)
- [ ] Aggregate benchmarks (anonymized)
- [ ] Enterprise pricing

---

## Dependências & Ordem Crítica

```
P0.8 (profile) ──→ P0.9 (VU meter) ──→ P0.10 (hourly) ──→ P0.11 (mobile UX) ──→ P0.12 (burn fmt) ──→ P1.1 (meme cards) ──→ P1.2 (share flow) ──→ P1.3 (open source) ──→ P2.*
P0.1 (kill ccusage) ──→ (runs in parallel, not blocking)
```

- P0.8 (profile) alimenta P1.1 (cards personalizados com username)
- P0.1 (kill ccusage) corre em paralelo — dual-run a validar, não bloqueia nada
- P1.1 alimenta P1.2 (share flow precisa de cards que valham a pena partilhar)
- P1.3 pode correr em paralelo com P1.1/P1.2
- P2 só faz sentido depois de Layer 1 estar polida e a viralizar

---

## Status Tracking

| ID | Task | Status | Updated |
|----|------|--------|---------|
| P0.1 | Kill ccusage | ✅ | Feb 25 |
| P0.2 | Tool Analytics Card | ✅ | Feb 24 |
| P0.3 | Turn Insights Card | ✅ | Feb 24 |
| P0.4 | Native JSONL Parser + Pass 2 | ✅ | Feb 24 |
| P0.5 | YOLO Mode Frontend | ✅ | Feb 24 |
| P0.6 | Delta Sync Bug Fix | ✅ | Feb 24 |
| P0.7 | Cost → Burn Rebrand | ✅ | Feb 24 |
| P0.8 | Local Profile | ✅ | Feb 24 |
| P0.9 | VU Meter + Live Burn Counter | ✅ | Feb 24 |
| P0.10 | Hourly Pattern (Activity Card) | ✅ | Feb 24 |
| P0.11 | Mobile UX Overhaul | ✅ | Feb 24 |
| P0.12 | Burn Format Scaling | ✅ | Feb 24 |
| P1.1 | Meme Energy Scorecards | ✅ | Feb 24 |
| P1.2 | Share Flow Optimization | ✅ | Feb 25 |
| P1.3 | Open Source Prep | ✅ | Feb 25 |
| P2.1 | Push Command (local) | ✅ | Feb 25 |
| P2.2 | Auth + Profiles | ✅ | Feb 25 |
| P2.3 | Leaderboard | ✅ | Feb 25 |
| P2.4 | Push Button + Auto-Push | ✅ | Feb 26 |
| P2.5 | Trust Infra | ✅ | Feb 26 |
| BUNKER.1 | Solidificar (cache, health, backups, systemd) | ✅ | Feb 26 |
| BUNKER.2 | Viral Push (compare, challenge, share, PWA) | ✅ | Feb 26 |
| P3 | B2B | 🔲 | — |

---

## Changelog — Feb 24, 2026

**18 commits, 1 massive day.** Backend parser + 3 new dashboard cards + bug fix + rebrand + VU meter + hourly pattern + mobile UX overhaul + burn format scaling.

| Commit | Description |
|--------|-------------|
| `ce7283d` | Native JSONL parser (dual-run), schema spike, metrics catalog |
| `b3fe7f5` | Pass 2 turn-level metrics — YOLO, tools, duration, `/api/metrics` |
| `715eedb` | YOLO mode frontend — hero badge + dashboard card with tabs |
| `00a6d1b` | Delta sync bug fix — no longer wipes native_turns/daily/sessions |
| `9542f68` | Tool Usage card — top tools + categories with horizontal bars |
| `243d13a` | Turn Insights card — response times, thinking/error bars, sessions |
| `207024b` | Cost → Burn rebrand — hero, charts, sessions, scorecards, tooltips |
| `ae082a6` | P0.8 local profile — settings modal, avatar, plan migrado, getProfile() |
| `1a616a8` | VU meter — 32-seg LED bar, 3s poll, glow effects, live burn counter |
| `e78df4d` | VU fix — counter never decreases, micro-decimals aligned, unified poll |
| `c8225c6` | Changelog page + burn counter micro-decimal alignment |
| `09994a9` | Hourly pattern — 24-bar chart in activity card, `/api/hourly-pattern` |
| `128cb7f` | Hero sub-row — 3-col grid (VU | badges | LIVE) aligned under KPIs |
| `4714ca9` | Mobile kebab menu — ⋮ dropdown, preserves tagline |
| `dc80c3e` | Mobile UX — sticky header, VU detach/attach, KPI carousel with dots |
| `fd30082` | KPI full-width + responsive typography with clamp() |
| `e7f0ecd` | Mobile sub-row reorder — instruments grouped above badges |
| `bfd1cdd` | Burn format scaling — adaptive decimals at $10K+, suffix at $1M+ |
| `6c54c02` | Changelog update — mobile UX + burn format + hourly pattern |

## Changelog — Feb 25, 2026

**Layer 2 kickoff + VU meter upgrade.**

| Commit | Description |
|--------|-------------|
| `9cdf7c2` | feat: `myburn push` — Layer 2 local side (payload + dry-run + receipts, 49 tests) |
| `1b9f5ba` | update: VU meters — unique personalities per bar, real data scales |
| `f1116df` | feat: P2.2 GitHub OAuth + public profiles — cloud layer (auth.py, cloud.py, 101 tests) |
| `7ad60d3` | fix: delta colors — up=green, down=red (burn more = good) |
| `86237fa` | update: ROI emoji to avoid confusion with Leaderboard |
| `0e35899` | fix: VU meters not updating after tab switch on desktop |
| `d024d80` | update: header buttons — Leaderboard, Scorecards, Settings |
| `4e672f6` | feat: VU Meter v0.2 — personal scale, zones, YOLO 24h badge |
