You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
dispatch stats prints a readable summary and --json for scripts, but there is no format that drops straight into a spreadsheet or a plotting tool. The per-repo, per-branch, and per-host breakdowns and the --calendar day counts are exactly the kind of tabular data people want to chart, and JSON makes that an extra parsing step for a quick pivot table.
flowchart TD
A[dispatch stats --csv] --> B[Build stats report]
B --> C[Emit section,label,count rows]
A2[dispatch stats --csv --calendar] --> D[Add date,count,intensity rows]
C --> E[CSV to stdout]
D --> E
Loading
Proposed solution
Add a --csv output format to dispatch stats:
Emit the repository, branch, and host-type breakdowns as CSV rows with a section,label,count shape, using encoding/csv so labels with commas or quotes are escaped correctly.
Include a totals row (sessions, turns, files) so the summary numbers are present too.
When combined with --calendar, append the per-day series as date,count,intensity rows under a calendar section.
Reject combining --csv with --json, since they are two output formats.
Honor the existing --repo, --branch, --folder, --since, and --until filters exactly as the text and JSON paths do.
Acceptance criteria
dispatch stats --csv writes the totals and the repo/branch/host breakdowns as valid CSV.
dispatch stats --csv --calendar appends the per-day counts and intensity.
The filter flags narrow the CSV the same way they narrow text and JSON output.
Labels containing commas or quotes are escaped per RFC 4180 (via encoding/csv).
Passing both --csv and --json is rejected with a clear error.
Help text documents --csv; unit tests cover the breakdowns, the calendar rows, and the conflicting-flag case.
Notes
buildStatsReport and buildActivityCalendar already produce the structured data; this change only adds a renderer next to writeStatsJSON/writeStatsText.
Problem
dispatch statsprints a readable summary and--jsonfor scripts, but there is no format that drops straight into a spreadsheet or a plotting tool. The per-repo, per-branch, and per-host breakdowns and the--calendarday counts are exactly the kind of tabular data people want to chart, and JSON makes that an extra parsing step for a quick pivot table.flowchart TD A[dispatch stats --csv] --> B[Build stats report] B --> C[Emit section,label,count rows] A2[dispatch stats --csv --calendar] --> D[Add date,count,intensity rows] C --> E[CSV to stdout] D --> EProposed solution
Add a
--csvoutput format todispatch stats:section,label,countshape, usingencoding/csvso labels with commas or quotes are escaped correctly.--calendar, append the per-day series asdate,count,intensityrows under a calendar section.--csvwith--json, since they are two output formats.Honor the existing
--repo,--branch,--folder,--since, and--untilfilters exactly as the text and JSON paths do.Acceptance criteria
dispatch stats --csvwrites the totals and the repo/branch/host breakdowns as valid CSV.dispatch stats --csv --calendarappends the per-day counts and intensity.encoding/csv).--csvand--jsonis rejected with a clear error.--csv; unit tests cover the breakdowns, the calendar rows, and the conflicting-flag case.Notes
buildStatsReportandbuildActivityCalendaralready produce the structured data; this change only adds a renderer next towriteStatsJSON/writeStatsText.