feat(#375): multi-project management (P3) — member roster + projects commands + push --project - #444
Conversation
fbba80e to
568750e
Compare
|
已修复 review 指出的 P1(清空项目会解除过滤)。commit 568750e。 根因: 修复(
真机复现验证(TGit,完全按 review 步骤,建仓→验证→删仓):
回归单测: 门禁:tsc 0 · build OK · 单测 2769 全绿。 |
568750e to
94a5856
Compare
|
已修复 review 指出的第二个 P1(清空项目后 pull 删除未推送的 skill 内容 → 数据丢失)。commit 94a5856。 根因:pull 有两条 skill 清理路径,都盲目
清空项目后两条都命中该 skill → 目录连同本地改动 + 修复(
一致性判断用
真机复现验证(TGit,完全按 review 步骤,建仓→验证→删仓):
回归单测: 另注:Step 3b 的盲删属 P1+P2 之前就存在的既有 tags 排除行为,本次一并纳入同一数据安全门。 |
94a5856 to
f36b83b
Compare
|
已修复 review 指出的第三个 P1(skill 目录内的本地 .git / stash / 未推送历史被删)。commit f36b83b。 根因:数据安全门 修复( 真机复现验证(TGit,完全按 review 步骤,建仓→验证→删仓):
回归单测: 至此本 PR 的清理逻辑对以下四类本地状态均安全:本地修改、未推送新增文件、本地 git 元数据(stash/历史)、以及无法验证来源时——全部保留 + 告警,只删与团队源逐字节一致(忽略部署生成的 CONTRIBUTORS)且无 VCS 元数据的干净副本。 |
f36b83b to
5c85c0c
Compare
…ds + push --project - members.ts: mergeMemberConfig (append+dedupe project membership) - init.ts: member registration merges active projects into members/<user>.yaml (both non-self and self/reports-branch paths), no longer no-op on re-init - projects-cmd.ts: projects list / set / members commands - index.ts: register projects subcommand + push --project option - push.ts: --project resolves to the project's manifest skills namespace (manifest-resolved, not raw id) and reuses the --role landing logic - tests: mergeMemberConfig union/dedupe/role cases
5c85c0c to
f11e2d1
Compare
|
已修复 review 指出的嵌套 Git 仓库遗漏。commit f11e2d1。 根因:上一轮的 修复:
真机复现验证(TGit,完全按 review 步骤,建仓→验证→删仓):
回归单测:
门禁:tsc 0 · build OK · 单测 2780 全绿。 |
What & why
Implements issue #375 P3 (the final phase; P1+P2 landed in #426). Makes multi-project membership real and adds the low-frequency management commands.
Before this,
members/<user>.yamlwas a placeholder —initwrote it only when absent and recorded neither role nor project, so the team could not answer "who is on project X".Changes
members.ts,init.ts):init --project <id>now merges the active project(s) intomembers/<user>.yamlwith append + dedupe semantics, on both the non-self and self (reports-branch) paths. Re-runninginitin another project directory adds that project to the roster instead of being a no-op.mergeMemberConfigis a pure helper (preservesregisteredAt/displayName, dedupes projects, reports whether anything changed so we only write+push on a real change).projectscommand family (projects-cmd.ts,index.ts) — mirrorsteamai roles …:projects list— defined projects + the ones active in this directoryprojects set [ids...]— set active project(s) for this directory (overwrite; comma-separated or repeated; empty to clear; invalidates the pull cache so the next pull cleans up now-inactive resources)projects members <id>— who is registered on a projectpush --project <id>(push.ts,index.ts): resolves to the project's manifest skills namespace (not the raw id — the same Proposal: 一个团队仓库承载多个项目(project 作为与 role 正交的维度) #375 P2 lesson) and reuses the existing--rolelanding logic; mutually exclusive with--role.docs/usage-guide.md/.zh-CN.md— commands + membership behavior added to the multi-project section.Test plan
tsc --noEmitclean ·npm run buildOK · 2765 unit tests pass (single-threaded; parallel mode has a pre-existing fs-fixture flakiness unrelated to this change). NewmergeMemberConfigunit tests cover union/dedupe/role/empty cases.Real-CLI end-to-end (TGit, repo created + verified + deleted)
Seeded a team repo with a projects manifest (
hai,billing) and namespaced skills, theninit --projectin two business dirs:members/jeffyxu.yamlhasprojects: [hai, billing](append)projects list→ both projects with their skills/knowledge/learnings namespacesprojects members hai→ listsjeffyxuprojects set billingin the hai dir → active projects overwritten tobillingpush --project billing→ skill lands inskills/billing/my-new-skill(manifest-resolved namespace)Closes #375 (final phase — P1+P2 in #426).