peppa/openspec/changes/pep-39-rotation/tasks.md
Асель c7283063c9 PEP-39: rotate a limited session to a free subscription of the pool at the turn boundary
Limit marks the subscription «лимит до …»; the watchdog relaunches the session on another
usable subscription of the same provider (Claude/OpenCode resume the conversation, Codex
starts afresh), threshold banner switches after the turn, max 3 switches/hour, simple
fairness between projects, subscription_switched events + Telegram message, web shows
subscription and switch history. Migration 0004 (sessions.rotate_reason).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 05:31:22 +05:00

18 lines
1.4 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.

# Tasks: PEP-39
## 1. Данные и core
- [x] 1.1 Схема `sessions.rotate_reason` + миграция 0004
- [x] 1.2 core: пометка лимита подписки, кандидаты для ротации, справедливость в pickSubscription, `subscriptionSwitches` в SessionView, сессии по проектам в listSubscriptions
## 2. Раннер
- [x] 2.1 rotation.ts: бюджет, выбор кандидата, `rotateSession` (Claude/OpenCode resume, Codex заново), событие, сообщение PM
- [x] 2.2 recordLimit помечает подписку и планирует ротацию; вачдог: ротация, ожидание, порог; Stop-хук не подталкивает при ожидании ротации
## 3. Моки и тесты
- [x] 3.1 mock-agent: лимит только на входе с подстрокой (`credential`), предупреждение о пороге
- [x] 3.2 testkit rotation.test.ts: переключение Claude с resume, нет свободных, Codex заново, порог, предел, справедливость
## 4. Веб
- [x] 4.1 Раннеры: подписка, ожидание переключения, история; карточка сессии; события стори; Подписки — сессии по проектам
- [x] 4.2 AGENTS.md