- Per-task cost attribution columns + pulse-engine plumbingCloses the named rev-49 cost-attribution follow-up. Until rev 51, every layer of the cost story (rev 7 transparency, rev 8 per-cycle drill-down, rev 9 30-day projection, rev 20 hard cap, rev 21 80% warning, rev 32 spike alarm, rev 34 yesterday delta, rev 35 7-day baseline) operated at workspace scope. Operators with a noisy task that had been retried 30 times had no surface to identify the runaway cost-eater. Rev 51 closes that. New task.totalInputTokens + totalOutputTokens columns. Inside workNextTask(), snapshot the global token sink before runAiTaskSession, compute the delta after, and increment the task columns by exactly that delta via a SQL `column + delta` clause in each of the three exit paths (blocked / complete / continue). Reflection + ideation token spend is workspace-level and intentionally not attributed to any task. The global desk_run total still receives every cycle's tokens โ this delta is just the slice that belongs to the in-flight task.
- Top-cost-tasks dashboard panelNew TopCostTasksPanel sidebar component renders above the integrations panel, listing the open (non-done) tasks whose cumulative AI spend is highest, capped at 5 rows. Each row carries a brand-color proportional bar, the cost amount in tabular-num typography, the task status pill, the task title (click to scroll-into-view + flash-highlight the matching active-work card), and a meta line with session count + total tokens. Hidden when no task has accrued any cost yet โ fresh workspaces don't see it. Pairs with the rev-13 desk health widget (workspace-level cost stat) and the rev-32 cost-spike alarm for the full descriptive (top spenders) โ defensive (alarm) trio.
- Per-task cost pill on every active-work card + on stale-task panel rowsCumulative dashboard polish โ until rev 51, the staleness pill (rev 48), focus ribbon (rev 29), priority pill (rev 21), due pill (rev 22), assignee chip (rev 16), comment-count badge (rev 35), and blockers pill (rev 36) all hung off the active-work card pill row, but cost was workspace-level only. Rev 51 adds an unobtrusive ๐ธ $X.XX pill (with token-count tooltip) on every task card whose cost > 0, plus the same pill on every stale-task panel row so reviewers see 'this stale task burned $X.XX before being abandoned' inline โ strongest possible 'auto-archive saves money' signal alongside the rev-49 lifecycle.
- GET /api/v1/tasks/{id}/cost + GET /api/v1/tasks/top-cost (v1 surface) + dashboard mirrorNew bearer-auth endpoints expose per-task cost on the protocol-bound surface in lockstep with the dashboard primitive. /tasks/{id}/cost returns { totalInputTokens, totalOutputTokens, estimatedCostUsd, sessionCount, costPerSessionUsd }. /tasks/top-cost returns the same TopCostTaskRow[] shape the dashboard panel uses. New dashboard mirror at /api/tasks/{id}/cost (viewer+ auth) so external integrations + the dashboard share one server-side implementation. The /api/v1/tasks list endpoint now also projects totalInputTokens + totalOutputTokens on every row so MCP hosts can render 'task X cost $Y' without a follow-up call. Stale-task CSV export gained three new cost columns (totalInputTokens, totalOutputTokens, estimatedCostUsd) so SOC 2 / ISO 42001 reviewers reading the takeaway artefact see the cost story attached to every stale task. Pairs with the rev-13 /api/v1/runs (per-cycle cost) and rev-18 /api/v1/stats (workspace 7-day cost) as the three-axis cost-observability surface โ the upcoming MCP server's cost tooling has nothing left to design.