fix(members): read the default-branch roster as an inherited root after the reports switch - #741
Merged
Conversation
…er the reports switch The orphan-branch switch (Tencent#489) made members list and projects members read only the teamai-reports worktree, so a team whose roster still lives on the default branch saw "No team members registered" right after upgrading (Tencent#735). The default-branch clone now stays a read-only inherited member root, the way learnings' already is (Tencent#485): listing unions both roots (the reports-branch copy wins when the same file exists on both), nothing is copied or deleted, and read-only commands still never publish the reports branch. Member registration merges against the inherited copy too, so a re-init keeps the original registeredAt/projects and converges the data onto the branch. Fixes Tencent#735
jimpablo
force-pushed
the
fix/members-legacy-roster
branch
from
September 23, 2026 03:12
f4ebe06 to
3e8dc3a
Compare
|
Findings
The PR description includes both a test plan and real-CLI end-to-end records, so it satisfies the testing-documentation requirement. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A team whose roster was written to the default branch by a pre-#489 CLI loses every member from
members list/projects membersonce it upgrades past the orphan-branch split: the commands read only theteamai-reportsworktree, which has nomembers/yet, and the pre-switch copy onmainwas deliberately ignored (#489). The roster, unlike stats/sessions/votes, is never regenerated automatically — those come back as members report usage, while the roster needs oneinitper member — so an upgrading team just loses its member list.This PR keeps the default-branch clone as a read-only inherited member root, the same pattern learnings already use (#485,
learnings-roots.ts):memberReadRoots()/readMemberConfig()insrc/members.ts— primary root first (reports worktree, or the clone for HTTP), default-branch clone as the lowest-precedence inherited root.members listandprojects memberslist the union of both roots; when the same file exists on both, the reports-branch copy wins.init, self-modebootstrap) merges against the inherited copy, so a re-init preserves the originalregisteredAt/displayName/projectsand writes the merged file to the reports branch — the data converges onto the branch gradually, one member at a time, with no migration step.Type of Change
Test Plan
npx tsc --noEmitpassesnpx vitest runpasses — 272 files, 3885 passed | 1 skippedsrc/__tests__/members.test.ts— the two tests that pinned "ignore leftover clone members" now pin the union + branch-copy-wins behavior; newmemberReadRoots/readMemberConfigdescribes.src/__tests__/git-kind-reports.test.ts— new real-git describeinherited member root (#735): pre-switch roster listed without copying/publishing, union + conflict through a real worktree. The existing "not copied or deleted" test is kept (renamed; its assertions are unchanged and still hold).src/__tests__/projects-members.test.ts(new) —projects membersinherited-root fallback.src/__tests__/e2e/members-legacy-roster.test.ts(new) — built-CLI repro of [bug] 0.25.0版本 teamai members list报No team members registered #735 with a bare origin + isolated HOME.npm run build+ full e2e:npx vitest run --config vitest.e2e.config.ts— 41 files passed | 3 skipped (live-provider files need credentials), 177 passed | 26 skipped, exit 0.Real-CLI end-to-end records (built
dist/index.js, macOS 15, Node v24.19.0, sandbox with a local bare origin):1. The #735 repro — roster on
main, noteamai-reportsbranch anywhere:2. A teammate registers on the new CLI (origin grows
teamai-reportswithbob+ a newercarolcopy) — union, branch copy wins:3. Writer absorption — fresh machine, roster only on
main, realteamai init(generic git provider):Related Issues
Fixes #735
Notes for Reviewers
members/only — argued in the Summary: the roster cannot self-heal the way stats/sessions/votes do, and the inherited-root pattern is the one the repo already established for learnings in Writelearnings/to ateamai-learningsbranch (direct push, no PR) #485. The usage guide now documents the asymmetry the other way:members/keeps being read, other reports stay ignored.isNewMember(the "Register member" vs "Update member roster" message) still keys off the worktree path only — a re-registering pre-switch member reports as newly registered on the branch, which seemed fine to keep surgical; say if you want that to consider the inherited root too.