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>
- runner/terminal.ts: TerminalFeed polls the pane (capture-pane -e, one loop per runner
shared by viewers), sends changed lines, scrolled-off lines and the cursor; terminalInput
(send-keys -H / paste-buffer -p) with access, liveness, size and rate checks, resets
auto_nudges, logs terminal_input; terminalSse with 15 s pings for Cloudflare
- web: GET/POST /api/runners/[id]/terminal, RunnerTerminal (xterm.js) in the runner panel
and on the story page; help
- testkit: terminal.test.ts — real tmux into a headless xterm, history, input, access, limits, SSE
- OpenSpec change archived; new spec runner-terminal
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- users.password_hash/password_set_at/disabled_at (migration 0002_local_users)
- core/local-users.ts: scrypt, passwordLogin with attempt limits, create/reset/disable
- isSuperadmin(db, user) = platform.admins; isUserAllowed honours disabled_at
- web: /auth/password + login form, /users for superadmins, Settings → password
- Gitea login with a local user's login is refused (giteaLoginRefusal)
- local users: projects in peppa-bot namespace, members without Gitea collaboration
- CLI: peppa user add|passwd|disable|enable; tests in testkit
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Login page and Settings → eGov: relay session with a server-side challenge/nonce, QR + eGov Mobile
deep link, polling, one-shot completion; IIN from the signer's certificate (own DER reader),
users.egov_iin. The relay is trusted (PM decision): no own XMLDSig check. CLI peppa user egov,
mock-kazeds-relay, tests. Dev mode: /_next/static is no-store (Cloudflare cached stale chunks).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- scripts/peppa-release.sh: ~/peppa/{repo.git,releases/<sha>,current,shared/.env};
install → next build → checked DB backup → migrate → switch current → kickstart →
health (/api/health commit + fresh heartbeats) → rollback; --queue, --check, --no-restart
- runner/platform-release.ts: deployProd for the platform project (PEPPA_PLATFORM_KEY=PEP)
queues a request for launchd quest.telecom.peppa.release; offer after green main
- CLI: peppa db backup [file], peppa release report; backupDb verifies the copy
- install-launchd.sh: wait for unload after bootout (no "Bootstrap failed: 5"),
release agent (QueueDirectories), PEPPA_ROOT in agents
- bin wrappers: logical root so hooks/credential.helper point at ~/peppa/current
- mock-launchctl, mock-pnpm; e2e platform-release.test.ts; OpenSpec pep-18-peppa-prod
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- packages/db: schema on sqlite-core (timestamps as epoch ms → Date, JSON as text,
booleans 0/1), one baseline migration; node:sqlite client under drizzle's
better-sqlite3 session (busy_timeout first, WAL, BEGIN IMMEDIATE, retries on
SQLITE_BUSY, lazy open, async transaction callbacks refused); PEPPA_DB
(default ~/.peppa/peppa.db)
- live updates: notify() pokes the bot over a unix socket; the bot also watches
PRAGMA data_version every second (writes by other processes)
- Postgres specifics ported: createTask transaction is synchronous, no
`for update skip locked`, `count(*)`, json_extract instead of ->>, json_each
instead of @>
- `peppa db migrate` and `peppa db migrate-to-sqlite <file>` (read-only
snapshot of Postgres, FK order from the schema, row count + foreign key
checks, file appears only when they pass); old Postgres schema kept in
packages/cli/legacy-pg-migrations for the migration and its test
- daily VACUUM INTO backup from the watchdog (7 copies, admin alert on failure)
- tests: a temp SQLite file per test file; storage.test.ts (20 processes,
per-project numbering across processes, socket/data_version, migration from
Postgres incl. a dangling foreign key, backups); two test races fixed
- CI: no per-run Postgres database; PEPPA_TEST_PG only for the migration test
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- tsconfig: erasableSyntaxOnly + verbatimModuleSyntax; parameter properties
rewritten (BugsinkError, GiteaError, GiteaClient, OAuthError, TelegramError,
TelegramApi, MockGitea)
- bin wrappers (peppa, peppa-mcp, peppa-hook, peppa-bot, testkit mocks,
peppa-dev): `node --import scripts/lib/require-node.mjs` (clear error on
Node < 26, PEPPA_NODE overrides the binary); package scripts and tests on
`node` / `node --test`; tsx removed
- install-launchd.sh pins PEPPA_NODE (checked absolute path) in the plists
- fix a race the faster hooks exposed: the prompt hook answered every pending
question, including a PM question raised after Peppa itself pasted text
into the terminal; sendToSession now logs `input_sent` and the hook only
answers questions older than that input
- change pep-36-lightweight-stack: stage 1 done, hook start numbers
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
bench/sqlite (outside the workspace): Peppa-like load with 10/20 runners,
a hook process per event, MCP, bot, web and watchdog; bun:sqlite,
node:sqlite, better-sqlite3, a single-writer service and Postgres; notify
replacements (cursor polling, fs.watch on WAL, unix-socket push); a
ceiling test; a schema port to sqlite with a data copy from Postgres and
a check of drizzle transactions.
openspec/changes/pep-36-lightweight-stack: proposal, design with the
numbers, specs (platform-storage, service-monitoring), phased tasks.
No product code changes; the move waits for the PM's decision.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- infra: Bugsink 2.6.3 in docker (infra/bugsink, scripts/bugsink-up.sh), database
bugsink in Peppa's Postgres, Traefik route bugsink.telecom.quest
- packages/bugsink: REST API client + custom-webhook payload parsing
- incidents (migration 0011): incident_settings, error_sources, incidents; ingest from
webhook POST /api/hooks/bugsink/<secret> and a 2-minute poll in the watchdog
- incident policy per project: notify / backlog (default) / start / ask (Telegram
buttons) / triage (claude -p with the owner's token, falls back to ask)
- daily task cap, environments, ignore pattern; manual "fixed" until PEP-57;
REGRESSED returns the task to the backlog
- web «Ошибки» section, bot buttons, MCP tools for agents and the PM, help, RULES.md
- testkit: mock-bugsink, mock-triage, incidents.test.ts (one test per scenario,
plus a live run against the real Bugsink with PEPPA_LIVE_BUGSINK=1)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- New project form: namespace (personal/org) and visibility (private/public) with hints
- provisionProject creates the repo with the chosen visibility (existing repo keeps its own)
- After creation: notice with "Открыть в Gitea"; project page "Репозиторий" block:
path, namespace kind, visibility, who can see it (read live from Gitea, cached 60 s)
- Members without repo access are marked; owner can grant access to all members
- MCP create_project takes visibility and returns repo URL + who sees it; list_projects shows URLs
- CLI --public, /help, mock-gitea (visibility, /orgs, collaborators), e2e repo-visibility
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>