peppa/openspec/changes/pep-191-protect-main/design.md
peppa-bot 79d75e5234 PEP-191: archive change
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-17 14:08:34 +05:00

8 lines
1.2 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.

## Решения
- Модуль `runner/branch-protection.ts`: `ensureBranchProtection` (пробует клиентов по очереди: владелец → peppa-bot; нужен admin), `branchProtectionState`, `branchProtectionTick` (раз в сутки, `PEPPA_BRANCH_PROTECT=off` выключает).
- Сбой: `alertAdmins` один раз на «период поломки» (`settings` `branch.protect.failed:<id>`, снимается при успехе); `platformDelay` не берём — у него причины привязаны к задачам.
- Белый список — `GITEA_BOT_USER` (как в `ci.ts`), по умолчанию `peppa-bot`.
- `saveAgentsMd` уже перебирает клиентов: владелец получает 403 на защищённой main, запись идёт от peppa-bot (проверено тестом).
- Теги `deploy-*` не защищаем; `scripts/push-template.sh` и `git push` агентов идут от бота (credential helper).
- Мок не может запретить настоящий `git push` по пути; отказ моделируется на contents API и merge.