- Runner settings with inheritance system → project → story (settings rows):
mode story (default, one runner per story) / queue, context fresh / continue,
workspace shared / worktree, maxRunners. No rows = behaviour as before.
- runner_tasks: a runner's story history and queue; sessions.name, sessions.workspace_path
(migration 0007_runners).
- moveTask → startTaskOnRunner; runnerTick in the watchdog moves free queue runners to
their next story (fresh: same tmux, new generation without resume; continue: message),
reassigns queues of dead runners, removes finished runners' worktrees (clean + pushed).
- Free runners («Новый терминал»), rename, «Оформить стори»; the Stop hook doesn't ping
for free runners or stories that left work.
- Web: «Новый терминал» (runners page, project sessions tab) with voice input,
project/story runner settings, runner stories in the details panel; CLI peppa runner …
- e2e: packages/testkit/test/runners.test.ts
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>
peppa platform release-offers on|off (setting platform.release_offers, default on). Off closes the
open offer and hides the button on the project's releases tab. Turned off now: Peppa runs as
next dev from the working copy and has no prod yet.
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>
- 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>
- 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>
- platform.allowed_logins (default asel, 7601978, dana): allowlisted logins,
project invitees and members, and local CLI accounts may log in
- enforced in the Gitea OAuth callback, on every web request (removal takes
effect at once) and on every remote MCP request (401)
- CLI: peppa platform allowlist | allow <login> | deny <login>
- tests: one per spec scenario (69 e2e total, green)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- bot: own Bot API client, long polling with persisted offset, updates
claimed before acting (no replay after restart), outbox with retries
(429 retry_after, 5xx), /start pairing code (hashed, single use, 10 min),
only the paired chat/user is served
- PM questions rendered per kind: approve button / reply to reject,
option buttons, allow/always/deny, alerts with continue or resume/stop;
messages are closed with who answered what, incl. terminal answers
- stopping/resuming a session expires its open questions
- CLI: peppa telegram pair|status|unpair; launchd agent for the bot
- testkit: mock-telegram + 11 bot journeys (32 e2e tests, all green)
- fix: keep the tmux server alive when empty (exit-empty off) — a new
session could die with a server shutting down after the last kill
- fix: test env must load before runner modules (no leaks to real tmux)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- runner: provider abstraction (claude | codex); per-run launch.sh keeps
long argv out of tmux; Codex via notify callback + -c config for rules
and the peppa MCP server; session env carries DATABASE_URL/PEPPA_HOME
- testkit: mock-claude / mock-codex driven by scenarios — real hooks,
notify, MCP calls, raw-mode TUI input with bracketed paste, permission
dialog, usage limits, hangs, crashes, /clear
- 21 CJM tests on an isolated DB, tmux server and state dir (all green)
- fix: watchdog crash/stall alerts showed blank lines instead of the tail
- bins load .env without overriding the caller's env; tmux socket option
- AGENTS.md (was CLAUDE.md) and shared RULES.md: mock-first rule with a
mock prefix for anything blocked on external dependencies
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- peppa-bot account: repos peppa-bot/peppa and peppa-bot/template
- git-credential-peppa: per-repo credential helper with the bot token
- template split: RULES.md (shared, stays in Gitea) + AGENTS.md (project)
- runner fetches RULES.md from Gitea on each launch (cached fallback) and
passes it via --append-system-prompt-file; MCP get_rules for manual runs
- bootstrap-project.sh clones the template from Gitea
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- hooks move from the project template to a per-run --settings file
- PermissionRequest / AskUserQuestion hooks wait for the PM's answer in the
DB and return the decision to Claude; fall back to the terminal dialog
after PEPPA_HOOK_WAIT_SEC (awaiting_hook prevents double delivery)
- sessions.generation + PEPPA_GENERATION: stale hooks are ignored;
peppa session resume relaunches with claude --resume
- SessionEnd no longer marks the process done (/clear, /resume)
- StopFailure rate_limit -> rate_limited status
- MCP: agents cannot set done or approve their own proposal
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- startSession: trusts the workspace in ~/.claude.json, runs interactive
claude in tmux with PEPPA_SESSION_ID, remain-on-exit for crash status
- answerAndDeliver: PM answers go into the terminal (permission menu keys,
approval -> task status + instruction, free text via bracketed paste)
- peppa-hook: session-start/prompt/notification/stop/session-end update
session status and raise PM questions; never fails the Claude session
- watchdog: detects dead panes, vanished sessions, stalls, usage limits;
launchd agent under caffeinate (scripts/install-launchd.sh)
- CLI: peppa session start|list|send|attach|stop, peppa watchdog
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>