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
bug(sdk): parseTeamMarkdown leaks auxiliary tables into the roster #2079
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.
Activity
Fix assignment safety, roster parsing, and Ralph authority (github#2156)