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
Real-world team structures can have many closely related, deeply-overlapping team names under one prefix (e.g. chapter-validators-core, chapter-validators-client, chapter-validators-frontend-client, chapter-validators, plus unrelated chapter-secops, chapter-head-of-frontend, ...). When several of these co-occur on the same repos, --group-by-team-prefix produces many distinct, hard-to-read combined sections ("a + b + c"), and --pick-team-auto (#197) cannot resolve most of them because no single candidate is a literal string-prefix of every other candidate in the combo (see the investigation test added in #197: chapter-secops + chapter-validators-core, chapter-head-of-frontend + chapter-secops + chapter-validators-core, chapter-secops + chapter-validators + chapter-validators-core all stay unresolved).
Rather than trying to build a more aggressive auto-merge heuristic (which risks silently discarding real team-membership information — e.g. collapsing 3 distinct combos that share only some members into one arbitrary label), the more principled fix is to let the user exclude noisy team-name prefixes from grouping entirely before combos are even formed. This directly reduces the number of ambiguous combined sections at the source, and makes the remaining ones easier for --pick-team / --pick-team-auto to handle.
Add a new repeatable/comma-separated CLI option, --exclude-team-prefixes <prefixes> (plural, for naming consistency with --exclude-repositories / --exclude-extracts — note the original ask used the singular --exclude-team-prefix; confirm the final name before implementing), that filters out any team matching one of the given prefixes beforegroupByTeamHierarchy runs:
A new pure function in src/group.ts, e.g. excludeTeamsByPrefix(groups: RepoGroup[], excludePrefixes: string[]): RepoGroup[], returning new RepoGroup objects with teams filtered to drop any team whose name starts with one of excludePrefixes (same case-sensitive startsWith semantics as bucketSingleLevel's prefix matching, for consistency with --group-by-team-prefix).
Wire it in github-code-search.ts: parse the option (comma-separated, trimmed, same pattern as --exclude-repositories), and apply excludeTeamsByPrefix to groups right after g.teams = teamMap.get(...) is assigned and beforegroupByTeamHierarchy(groups, chains) is called.
A repo whose entire team list is excluded falls through to "other", same as a repo with no matching team today — no special-casing needed beyond the filter itself.
Only applies with --group-by-team-prefix (mirrors --pick-team / --pick-team-auto's existing "requires --group-by-team-prefix" guard and warning).
Update the replay command (ReplayOptions in src/output.ts) so a session using this flag reproduces identically.
Update src/completions.ts, docs/usage/team-grouping.md, and docs/reference/cli-options.md.
Acceptance Criteria
--exclude-team-prefixes "chapter-validators-" removes every team starting with that prefix from consideration for grouping, for every repo.
A repo left with zero matching teams after exclusion falls into "other", exactly like a repo with no matching team today.
Excluding a prefix reduces (or eliminates) combined sections that were only ambiguous because of the excluded teams, without affecting sections unrelated to the excluded prefixes.
Multiple exclude prefixes are supported (comma-separated).
A warning is emitted (and the flag is a no-op) when used without --group-by-team-prefix, mirroring --pick-team.
The replay command reproduces a session using this flag exactly.
Definition of Done
Unit tests for excludeTeamsByPrefix in src/group.test.ts: removes matching teams, keeps non-matching teams, drops a repo's entire team list correctly (falls to "other" after grouping), no-op with an empty exclude list, multiple prefixes, pure/no-mutation.
CLI wiring + replay-command test coverage (src/output.test.ts, src/completions.test.ts).
docs/usage/team-grouping.md and docs/reference/cli-options.md updated.
bun test, bun run lint, bun run format:check, bun run knip, bun run build.ts all green.
Context
Real-world team structures can have many closely related, deeply-overlapping team names under one prefix (e.g.
chapter-validators-core,chapter-validators-client,chapter-validators-frontend-client,chapter-validators, plus unrelatedchapter-secops,chapter-head-of-frontend, ...). When several of these co-occur on the same repos,--group-by-team-prefixproduces many distinct, hard-to-read combined sections ("a + b + c"), and--pick-team-auto(#197) cannot resolve most of them because no single candidate is a literal string-prefix of every other candidate in the combo (see the investigation test added in #197:chapter-secops + chapter-validators-core,chapter-head-of-frontend + chapter-secops + chapter-validators-core,chapter-secops + chapter-validators + chapter-validators-coreall stay unresolved).Rather than trying to build a more aggressive auto-merge heuristic (which risks silently discarding real team-membership information — e.g. collapsing 3 distinct combos that share only some members into one arbitrary label), the more principled fix is to let the user exclude noisy team-name prefixes from grouping entirely before combos are even formed. This directly reduces the number of ambiguous combined sections at the source, and makes the remaining ones easier for
--pick-team/--pick-team-autoto handle.Part of EPIC #125.
Solution
Add a new repeatable/comma-separated CLI option,
--exclude-team-prefixes <prefixes>(plural, for naming consistency with--exclude-repositories/--exclude-extracts— note the original ask used the singular--exclude-team-prefix; confirm the final name before implementing), that filters out any team matching one of the given prefixes beforegroupByTeamHierarchyruns:src/group.ts, e.g.excludeTeamsByPrefix(groups: RepoGroup[], excludePrefixes: string[]): RepoGroup[], returning newRepoGroupobjects withteamsfiltered to drop any team whose name starts with one ofexcludePrefixes(same case-sensitivestartsWithsemantics asbucketSingleLevel's prefix matching, for consistency with--group-by-team-prefix).github-code-search.ts: parse the option (comma-separated, trimmed, same pattern as--exclude-repositories), and applyexcludeTeamsByPrefixtogroupsright afterg.teams = teamMap.get(...)is assigned and beforegroupByTeamHierarchy(groups, chains)is called."other", same as a repo with no matching team today — no special-casing needed beyond the filter itself.--group-by-team-prefix(mirrors--pick-team/--pick-team-auto's existing "requires --group-by-team-prefix" guard and warning).ReplayOptionsinsrc/output.ts) so a session using this flag reproduces identically.src/completions.ts,docs/usage/team-grouping.md, anddocs/reference/cli-options.md.Acceptance Criteria
--exclude-team-prefixes "chapter-validators-"removes every team starting with that prefix from consideration for grouping, for every repo."other", exactly like a repo with no matching team today.--group-by-team-prefix, mirroring--pick-team.Definition of Done
excludeTeamsByPrefixinsrc/group.test.ts: removes matching teams, keeps non-matching teams, drops a repo's entire team list correctly (falls to "other" after grouping), no-op with an empty exclude list, multiple prefixes, pure/no-mutation.src/output.test.ts,src/completions.test.ts).docs/usage/team-grouping.mdanddocs/reference/cli-options.mdupdated.bun test,bun run lint,bun run format:check,bun run knip,bun run build.tsall green.