peppa/openspec/changes/archive/2026-11-12-pep-12-project-sharing/design.md
Асель 56b6224587 PEP-12: share projects with other users
- project_members / project_invites; owner adds people by Gitea login,
  invitations are applied at first login; members get the owner's access
  except member management; a member can leave
- access everywhere via projectForUser / userProjectIds (owner or member):
  web inbox, sessions, project pages, MCP
- shareProject / unshareProject: login checked in Gitea, repo collaborator
  (write) added by the owner's client or peppa-bot; missing admin rights
  don't block membership (repoAccess flag)
- web: Members block on the project page, 'shared' badge; MCP:
  list_members, add_member, remove_member; Help updated
- tests: 5 sharing journeys on mock-gitea (64 e2e total, green); test DB
  now also clears users and OAuth clients between files
- OpenSpec: pep-12 archived (project-sharing, web-auth)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-11-12 22:35:56 +05:00

1.3 KiB

Design: PEP-12

Decisions

  1. projects.owner_id остаётся (владелец — чей Claude и кто админ репо), участники — таблица project_members; приглашения по логину — project_invites, принимаются в upsertUserFromGitea. Одна точка доступа — projectForUser (владелец или участник); списки — через userProjectIds.
  2. Gitea: существование логина проверяется API; соавтор добавляется клиентом владельца проекта, при отказе — клиентом peppa-bot (проекты в пространстве бота). Неудача прав не блокирует участие — возвращается флаг repoAccess: false.
  3. Сессии по-прежнему на подписке владельца проекта — менять плательщика без решения PM не будем.

Risks / Trade-offs

  • [Участник тратит лимит Claude владельца] → явно написано в UI блока «Участники».
  • [Вопросы агентов в Telegram получает только привязанный чат] → PEP-2.