peptiderepo d922a8368f infra/vps: PRAB generation orchestrator (VPS-driven SSH, systemd timer)
Adds the VPS-side orchestrator for Option A (ADR 2026-06-22):
the Coolify KVM8 VPS (76.13.220.15) drives PRAutoBlogger generation
on prod synchronously over a held-open SSH session, escaping
Hostinger's ~10-min background-PHP-process kill.

Files:
  infra/vps/orchestrate-generation.sh
    - SSH to Hostinger; reaper sweep; wp prautoblogger generate --sync
    - Lock-aware: skips if run in-flight (plugin DB mutex)
    - Structured log lines (captured by systemd journal)
    - Failure alert: email to cto@peptiderepo.com via system mail
    - DRY_RUN=1 mode: echoes commands without executing generation
    - All config via env vars (SSH_KEY, SSH_HOST, etc.); no hardcoded secrets
    - SSH key referenced by PATH (/root/.ssh/hostinger_prod_ed25519)

  infra/vps/install-orchestrator.sh
    - Installs orchestrator to /opt/prab-orchestrator/
    - Installs systemd .service and .timer to /etc/systemd/system/
    - Does NOT enable or start timer (explicit post-QA cutover step)

  infra/vps/prab-generation.service
    - Type=oneshot, User=root, TimeoutStartSec=7200 (covers 32-min LLM calls)
    - Restart=no (timer retries next day on failure)

  infra/vps/prab-generation.timer
    - OnCalendar=*-*-* 06:00:00 UTC, Persistent=true, RandomizedDelaySec=300

DO NOT install or enable on the VPS this round — QA-gated, hold for CTO review.

Agent-Session: prab-reliability-20260622
2026-06-22 16:33:55 +00:00

peptide-e2e

Playwright smoke tests and shared CI/CD pipelines for the peptiderepo.com estate.

Reusable workflows

This repo hosts shared GitHub Actions workflows called by all 7 app repos.

deploy-app.yml — shared deploy pipeline

Handles staging rsync → Playwright smoke → production rsync → inventory guard → LiteSpeed cache purge → health check. Called by every app's deploy.yml via uses: peptiderepo/peptide-e2e/.github/workflows/deploy-app.yml@main.

ci.yml — reusable CI (PHP lint, PHPCS, 300-line, PHPUnit, JS lint)

Standardised CI for every estate repo. Consistent job names so deploy-app.yml can gate on them uniformly.

Adopt in any repo — create .github/workflows/ci.yml in the caller repo:

name: CI

on:
  push:
    branches: [main]
  pull_request:
    branches: [main]

# Required: the called ci.yml phpcs job declares contents: write for phpcbf
# commit-back. GitHub enforces that callers must grant at least the permission
# level the reusable workflow's jobs request.
permissions:
  contents: write

jobs:
  ci:
    uses: peptiderepo/peptide-e2e/.github/workflows/ci.yml@main
    with:
      tests: stubs        # stubs | wp-framework | brain-monkey | none
      has_js: false       # set true if the repo ships JS
    secrets: inherit

Full input reference:

Input Type Default Description
php_versions string '["8.1","8.2","8.3"]' JSON array of PHP versions to matrix over
tests string stubs PHPUnit environment: stubs, wp-framework, brain-monkey, or none
enforce_300 boolean true Fail if any tracked *.php file under line_limit_paths exceeds 300 lines
line_limit_paths string includes Space-separated paths the 300-line rule applies to
has_js boolean false Whether to run JS linting (npm run lint or node --check)
phpcs_autofix boolean true On PRs: run phpcbf and commit fixes back before strict PHPCS

PHPUnit tests values explained:

  • stubs — WP stubs only (fast, no DB); just runs composer test.
  • brain-monkey — Brain Monkey mocking; no DB; runs composer test.
  • wp-framework — Full WordPress test framework: provisions MySQL service, installs svn, runs bin/install-wp-tests.sh, then composer test. Handles the three known gotchas: svn install, --skip-db-create with MySQL service, WP_CORE_DIR trailing slash.
  • none — Skips the phpunit job entirely (temporary; repos without a suite yet; remove at rollout).

phpcbf auto-commit: on pull_request events, phpcbf runs first and commits any auto-fixable violations back to the PR branch via GITHUB_TOKEN. GitHub prevents loops — bot commits do not trigger a new CI run. Strict PHPCS then runs and fails only on non-auto-fixable violations.

Job names (fixed — callers and deploy-app.yml needs: these): lint-php, phpcs, file-size, phpunit, lint-js.

Smoke tests

The tests/ directory contains Playwright specs that run against https://staging.peptiderepo.com (via deploy-app.yml) and can also target production. See playwright.config.ts for environment configuration.

tests/
  00-homepage.spec.ts
  01-reconstitution-calculator.spec.ts
  02-peptide-search.spec.ts
  03-admin-plugins.spec.ts
  04-rest-api.spec.ts
  05-dossier-edit.spec.ts
  06-board-generate-now.spec.ts

Development

npm ci
npx playwright install --with-deps chromium
BASE_URL=https://staging.peptiderepo.com npm test
Description
Playwright smoke tests for peptiderepo.com staging and production
Readme 520 KiB
Languages
TypeScript 73.6%
Shell 13.2%
Python 11.7%
Dockerfile 1.5%