peppa/openspec/changes/archive/2026-11-13-pep-2-telegram-per-user/proposal.md
Асель 824ba56b74 PEP-2: Telegram per user — pairing from Settings, delivery by project access
- users.telegram_* replace the single global binding; one-time /start code
  per user (web Settings → Telegram, or peppa telegram pair <login>);
  a chat belongs to one user
- agent questions go to the project's owner and members who paired; an
  answer (button or reply) is accepted only from someone with access to
  the project; messages are closed for every recipient; /status is scoped
- CLI: telegram pair|status|unpair <login>, user ensure mock-<name>;
  dev stand pairs its test PM per user
- tests: several-users journey (bob without access, then as a member);
  70 e2e total, green
- BREAKING: the old global binding is removed; users pair again in Settings

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 03:44:30 +05:00

31 lines
1.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Proposal: PEP-2 — Telegram по пользователям
Задача Пеппы: **PEP-2** · Цель #2.
## Why
У бота одна глобальная привязка: вопросы агентов из всех проектов всех пользователей
уходят в один чат. Это утечка чужих данных и мешает работать нескольким людям.
## What Changes
- Привязка Telegram — у каждого пользователя своя, из «Настроек» веба: кнопка ведёт в
бота с одноразовым кодом. Отвязка там же. **BREAKING**: прежняя глобальная привязка
удаляется, пользователям нужно привязаться заново.
- Вопрос агента получают владелец и участники проекта, у кого привязан Telegram.
Ответить (кнопкой или реплаем) может только тот, у кого есть доступ к проекту;
после ответа сообщение закрывается у всех получателей.
- `/status` показывает только проекты пользователя.
## Capabilities
### New Capabilities
- `telegram-notifications`: привязка Telegram пользователя и доставка вопросов агентов участникам проекта.
### Modified Capabilities
## Impact
`packages/db` (поля Telegram у users), `packages/core/telegram.ts`, `apps/bot`,
`apps/web` (Настройки), CLI, dev-стенд, тесты бота.