Skip to content

bug(sdk): parseTeamMarkdown leaks auxiliary tables into the roster #2079

Closed

Description

@AmittaiShapira

Defect

parseTeamMarkdown() treats every pipe-delimited row after any Name-headed table as a roster row, including tables in later, unrelated Markdown sections. squad health imports that parser and reports its result as the valid-member count.

Reproduction

Given this structure:

## Members
| Name | Role |
|---|---|
| Alpha | Developer |

## References
| Existing Agent | Reused By |
|---|---|
| Legacy Agent | Alpha |

parseTeamMarkdown() returns alpha, existing-agent, and legacy-agent rather than only alpha.

The installed @bradygaster/squad-cli 0.13.1 reproduces this against philips-internal/org-chart-automation-JavaScript's current .squad/team.md: it returns 21 entries — squad, 12 actual members, amittai-shapira, existing-agent, and six reuse-table rows. squad health consequently reports team.md is valid (21 members).

Cause

packages/squad-sdk/src/config/markdown-migration.ts's parseTeamTable() scans the entire document. It sets headerCols whenever it sees a Name column, but does not limit parsing to ## Members/## Roster or reset its mapping upon a new Markdown section. A later table without a Name header therefore inherits the prior mapping; its header itself is also parsed as data.

The comment that says it resets "for each roster table" is inaccurate: it only resets on another Name-headed table, regardless of section.

Expected

Only the declared roster table should produce ParsedAgent values. Tables under ## Human Members, ## Existing Project Agents Reused, or arbitrary later sections must not contribute members. Add regression coverage that keeps both a Name-headed non-roster table and a non-Name auxiliary table out of the parsed roster, and make squad health report the actual roster count.

Downstream

This blocks https://github.com/philips-internal/org-chart-automation-JavaScript/issues/1007 from providing a truthful squad health roster count. A local Markdown/HTML workaround can hide the symptom, but cannot repair the globally installed SDK/CLI parser behavior.

Activity

  1. added a commit that references this issue on Oct 3, 2026
    b127c7a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions