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
{{ message }}
Repository navigation
[3/7] Markdown & JSON output for N-level headings #179
src/output.tsbuildMarkdownOutput currently hardcodes ## ${group.sectionLabel} with no depth concept. buildJsonOutput has no section/team information at all today (flat results[]). ReplayOptions / buildReplayCommand serialize --group-by-team-prefix as a flat comma-separated string.
Design and implement a JSON output shape carrying the hierarchy (nested sections tree, or a flat list with level/path per repo - decide and document as a breaking change).
Update ReplayOptions / buildReplayCommand to serialize the chain syntax (/ for depth, , for independent chains) and the consolidation flag from [2/7] Advanced consolidated rendering #178.
Keep docs/usage/team-grouping.md markdown example blocks in sync (full doc rewrite is issue v1.0.4 #7, but keep code samples correct here to ease review).
Acceptance Criteria
A 2-level grouped result renders ## for the top level and ### for the nested level in markdown output.
A 3-level grouped result renders up to ####.
JSON output exposes the hierarchy in a documented, stable shape.
The replay command reproduces the exact chain + consolidation flags used for the original run.
Resolved by #187 (merged into main in df81d56 as part of the hierarchical team-prefix grouping stack):
flattenTeamHierarchy (src/group.ts) + buildMarkdownOutput (src/output.ts) emit consecutive heading levels (##, ###, ####, …, capped at H6) per hierarchy depth, without repeating an unchanged ancestor heading — see docs/usage/team-grouping.md.
buildJsonOutput exposes the full root→leaf hierarchy per result as a section: string[] array.
ReplayOptions / buildReplayCommand serialize the chain syntax (/ for depth, , for independent chains) so a replayed run reproduces the same grouping.
Full src/output.test.ts / src/group.test.ts coverage for 2/3-level headings, JSON shape, and replay round-trip.
(Note: the original consolidation flag mentioned in this issue's description was later removed entirely in #198, superseded by --pick-team-auto — this doesn't affect the heading/JSON/replay acceptance criteria above.)
Context
src/output.ts
buildMarkdownOutputcurrently hardcodes## ${group.sectionLabel}with no depth concept.buildJsonOutputhas no section/team information at all today (flatresults[]).ReplayOptions/buildReplayCommandserialize--group-by-team-prefixas a flat comma-separated string.Part of EPIC #125. Depends on #177, #178.
Solution
buildMarkdownOutputto emit heading depth derived from the tree level from [1/7] Data model & core hierarchical grouping algorithm #177 (##,###,####, ...), capped at a sane max (e.g. H6).sectionstree, or a flat list withlevel/pathper repo - decide and document as a breaking change).ReplayOptions/buildReplayCommandto serialize the chain syntax (/for depth,,for independent chains) and the consolidation flag from [2/7] Advanced consolidated rendering #178.docs/usage/team-grouping.mdmarkdown example blocks in sync (full doc rewrite is issue v1.0.4 #7, but keep code samples correct here to ease review).Acceptance Criteria
##for the top level and###for the nested level in markdown output.####.Definition of Done
src/output.test.tscoverage: 2/3-level markdown headings, JSON shape, replay command round-trip.bun test,bun run lint,bun run format:check,bun run knip,bun run build.tsall green.