Skip to content

[3/7] Markdown & JSON output for N-level headings #179

Description

@shouze

Context

src/output.ts buildMarkdownOutput 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.

Part of EPIC #125. Depends on #177, #178.

Solution

  • Update buildMarkdownOutput to 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).
  • 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.

Definition of Done

Activity

  1. added theissue type on Aug 23, 2026
  2. self-assigned this
    on Aug 23, 2026
  3. changed the title [-][3/7] Markdown & JSON output for N-level headings[/-] [+][3/7] Markdown & JSON output for N-level headings[/+] on Aug 23, 2026
  4. shouze commented on Sep 19, 2026

    @shouze
    ContributorAuthor

    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.)

    Closing as completed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions