Commit Graph

35 Commits

Author SHA1 Message Date
e8c87ec04d PEP-222: образ и compose платформы, выкатка контейнерами, раннеры в контейнерах по умолчанию
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-20 19:52:59 +05:00
9d1c4f0de2 PEP-209: самолечение застрявших задач, расписание повторов, кнопки задержек
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 16:43:13 +05:00
ffd4e4c171 PEP-202: Observability — сервис мониторингов peppa-observer, раздел для суперадмина, MCP
Сервис peppa-observer (своя база observe.db, журнал 7 дней): мониторинги HTTP(S),
TCP, DNS (системный против 1.1.1.1), «Интернет», heartbeat; состояние меняется
после N неудач/удач подряд, одно сообщение в канал платформы на смену, упавшие
вместе с интернетом молчат. Раздел /observability и MCP-инструменты — только
суперадмину и агентам платформы. Встроенные: «Интернет», «eGov relay» (HTTP, DNS).
Проверка сети из вачдога (PEP-201) переехала сюда.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 21:15:36 +05:00
c410016e37 PEP-188: Codex запускается без сбоев — кавычки в .env, доверие папке, отказ на параметрах
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-17 11:03:30 +05:00
d2903db557 PEP-181: the live-copy pre-commit hook blocks only the live copy itself — worktrees share the hooks directory and kept failing to commit
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 23:09:45 +05:00
Асель
fd909a9951 PEP-172: OpenSpec change (archived), health waits for heartbeats after the restart, project memory compacted
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 20:23:53 +05:00
Асель
c36b351e93 PEP-172: deploys go through scripts/live-deploy.sh — clean main, green CI, migrations, build, health and page checks with rollback; no agent runs in Peppa's own live copy
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 19:08:03 +05:00
Асель
b1c13e739e PEP-165: the live site runs next start; deploy builds before restarting web
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 14:50:47 +05:00
Асель
9052f3245f Merge main into task/pep-98: PEP-112…124 texts through the dictionary
Main's new wording (PEP-123 «Продакт» words) kept and wrapped in t()/m();
wording(mode, locale) gives English words for {task}/{runner} placeholders;
glossary check (pnpm lint) passes; English for all new keys (en/merge-*.ts).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 22:04:39 +05:00
Асель
c47a26745d PEP-124: glossary check in CI — pnpm lint, checks.lint, the lint step of the workflow and ci.sh
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-15 21:18:44 +05:00
Асель
96b5422a56 PEP-105: «Peppa FACTORY» instead of «Пеппа» in Russian UI texts; i18n-check guards Russian keys; archive change, memory
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 15:56:55 +05:00
Асель
1f16286dca PEP-98: English for web, bot, notifications and runner messages; product name «Peppa FACTORY» everywhere
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 14:47:50 +05:00
Асель
355c5b19b2 PEP-98: i18n core — dictionaries, localizeText, user locale, web provider, bot and push localization, i18n-check
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 14:25:03 +05:00
Асель
5af93d7438 PEP-4: platform repo address from GITEA_PLATFORM_REPO, template defaults to peppa/template
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-15 00:11:31 +05:00
Асель
ca57f9543b PEP-17/40: agent sandbox per runner (docker + agent relay) and runner hosts over SSH
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 07:57:28 +05:00
Асель
0941a9f4b7 PEP-63: Bugsink on SQLite (volume peppa-bugsink-data), migration script, postgres under the legacy profile
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 07:11:13 +05:00
Асель
616ce28c70 infra: one compose project peppa (postgres, bugsink, act-runner) — one group in OrbStack
The runner and Bugsink ran from compose files in old worktrees (projects peppa-ci, peppa-bugsink).
Container names and the runner's registration volume are kept. scripts/infra-up.sh, pnpm infra:up.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 02:10:53 +05:00
Асель
c4952b2011 Pre-launch live mode: PEPPA_WEB_MODE=dev runs next dev (HMR) from the working copy
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 22:56:02 +05:00
Асель
03aee432fb PEP-18: separate Peppa prod — release dir, PM button, DB backup, auto-rollback
- 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>
2026-11-13 17:58:34 +05:00
Асель
3a282b8054 PEP-36 stage 2: SQLite (node:sqlite, WAL) instead of Postgres
- 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>
2026-11-13 17:23:24 +05:00
Асель
8dc82859c7 PEP-36 stage 1: run Peppa with Node 26 type stripping instead of tsx
- 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>
2026-11-13 16:51:22 +05:00
Асель
961cb558a4 PEP-22: CI job uses host Postgres with a per-run database, installs openspec
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 15:00:28 +05:00
Асель
8fee68f8eb PEP-22: Gitea Actions workflow for Peppa on the PEP-57 runner; testkit creates its DB over SQL
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 15:00:28 +05:00
Асель
93f38bbcba PEP-22: harden timing-sensitive e2e steps, archive change
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 15:00:28 +05:00
Асель
56a7756e71 PEP-22: scripts/ci.sh, PR status peppa/ci, mock-act-runner
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 15:00:28 +05:00
Асель
498013472f PEP-58: Bugsink — production errors become Peppa incidents and tasks
- 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>
2026-11-13 14:31:32 +05:00
Асель
3ab408eb70 PEP-57: CI for factory projects — act_runner, template workflow, connect CI
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 14:19:11 +05:00
Асель
2b0f2fd984 PEP-1: web platform with Gitea login, projects, goals, tasks, sessions
- web: Gitea OAuth2 login, signed session cookie, everything behind login;
  inbox with answers, project board (goals → tasks), task page with
  OpenSpec artifacts, questions and session controls; new project form;
  auto-refresh, light/dark, mobile
- users + projects.owner_id; tokens AES-256-GCM encrypted; owner-only access
- provisionProject (runner): new or existing Gitea repo, peppa-bot
  collaborator, template + openspec init, push, rollback; used by web and
  peppa project create (replaces scripts/bootstrap-project.sh)
- peppa web login-link, peppa project owner; Gitea OAuth app script
- bins/template resolved via PEPPA_ROOT (works inside the Next build)
- testkit: mock-gitea + 10 tests (42 e2e total, all green)
- OpenSpec: pep-1-web-platform archived into specs web-auth,
  project-provisioning, web-workspace

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 20:55:02 +05:00
Асель
9cf0d53303 Add Telegram bot: pairing, durable outbox, answers from buttons and replies
- 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>
2026-11-12 20:26:58 +05:00
Асель
1df550bb86 Add Codex provider, mock agents and end-to-end CJM suite
- 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>
2026-11-12 20:09:43 +05:00
Асель
e1384a4c6f Push Peppa to Gitea; shared RULES.md loaded live into every session
- 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>
2026-11-12 19:50:45 +05:00
Асель
145eb2311a Add Traefik route and launchd agent for peppa.telecom.quest
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 19:36:13 +05:00
Асель
967f70ac09 Add runner: tmux sessions, Claude hook ingestion and watchdog
- 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>
2026-11-12 19:28:07 +05:00
Асель
9824ce4c18 Add Peppa MCP server, core domain package and peppa CLI
- @peppa/core: projects, goals, tasks (atomic per-project numbering),
  PM questions, progress events, pg NOTIFY on peppa_events
- @peppa/mcp (peppa-mcp): get_task, list_tasks, list_goals, create_task,
  update_task, request_approval, ask_pm, report_progress
- @peppa/cli (peppa): project/goal/task/q commands
- questions/events now link to project and task; session is optional
- scripts/install-bins.sh; bootstrap-project.sh registers the project

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 19:18:35 +05:00
Асель
4168e8c867 Bootstrap Peppa monorepo, DB schema, OpenSpec and project template
- pnpm workspace: apps/web (Next.js), apps/bot, packages/{db,shared,mcp,runner}
- Drizzle schema: projects, goals, tasks, sessions, questions, events
- Postgres via infra/docker-compose.yml
- template/: AGENTS.md workflow on OpenSpec, Claude hooks, peppa MCP config
- scripts to push template and bootstrap projects in Gitea

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 19:13:16 +05:00