peppa/packages/core/src
Асель 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
..
access.ts PEP-16: only allowlisted people can log into Peppa 2026-11-13 03:38:08 +05:00
backup.ts PEP-36 stage 2: SQLite (node:sqlite, WAL) instead of Postgres 2026-11-13 17:23:24 +05:00
ci.ts PEP-57: gate — Gitea client only for tasks with a PR 2026-11-13 14:37:10 +05:00
crypto.ts PEP-57: CI for factory projects — act_runner, template workflow, connect CI 2026-11-13 14:19:11 +05:00
errors.ts Add Peppa MCP server, core domain package and peppa CLI 2026-11-12 19:18:35 +05:00
gitea.ts PEP-36 stage 1: run Peppa with Node 26 type stripping instead of tsx 2026-11-13 16:51:22 +05:00
incidents.ts PEP-36 stage 2: SQLite (node:sqlite, WAL) instead of Postgres 2026-11-13 17:23:24 +05:00
index.ts PEP-36 stage 2: SQLite (node:sqlite, WAL) instead of Postgres 2026-11-13 17:23:24 +05:00
monitor.ts PEP-36 stage 2: SQLite (node:sqlite, WAL) instead of Postgres 2026-11-13 17:23:24 +05:00
notify.ts PEP-36 stage 2: SQLite (node:sqlite, WAL) instead of Postgres 2026-11-13 17:23:24 +05:00
oauth.ts PEP-36 stage 1: run Peppa with Node 26 type stripping instead of tsx 2026-11-13 16:51:22 +05:00
project-file.ts Add Peppa MCP server, core domain package and peppa CLI 2026-11-12 19:18:35 +05:00
projects.ts PEP-14: full PM toolkit over MCP and a Help page 2026-11-12 22:24:05 +05:00
repo-info.ts PEP-15: where the project's repo is in Gitea — link, visibility, namespace 2026-11-13 14:12:07 +05:00
rules.ts PEP-1: web platform with Gitea login, projects, goals, tasks, sessions 2026-11-12 20:55:02 +05:00
sessions.ts PEP-36 stage 1: run Peppa with Node 26 type stripping instead of tsx 2026-11-13 16:51:22 +05:00
settings.ts Add Telegram bot: pairing, durable outbox, answers from buttons and replies 2026-11-12 20:26:58 +05:00
tasks.ts PEP-36 stage 2: SQLite (node:sqlite, WAL) instead of Postgres 2026-11-13 17:23:24 +05:00
telegram.ts PEP-36 stage 2: SQLite (node:sqlite, WAL) instead of Postgres 2026-11-13 17:23:24 +05:00
users.ts PEP-2: Telegram per user — pairing from Settings, delivery by project access 2026-11-13 03:44:30 +05:00