- 3-step OpenRouter pipeline: Gatekeeper scoring/classification, PubMed+Google URL extraction, Markdown summary generation - REST worker routes /wp-json/peptide-news/v1/worker/* with X-Peptide-News-Token auth - Standalone Coolify worker (tools/vps-worker) with Dockerfile + docker-compose - CLI commands, content extractor, pubmed extractor, google url resolver - 89 PHPUnit tests passing
5.2 KiB
5.2 KiB
Peptide News Aggregator v2.6.0 — Complete Implementation & Deployment Plan
Target Architecture:
- Shared Hosting Server: Prepaid WordPress hosting (MySQL Database
wp_peptide_news_articles, public WordPress frontend, Admin UI). - Hostinger KVM8 VPS (Coolify): Dedicated VPS running Coolify to execute the standalone worker (
tools/vps-worker/) for heavy 3-step OpenRouter LLM processing, PubMed XML extraction, and Google News URL redirect unwrapping.
1. Current Codebase Status (100% Implemented & Verified)
All v2.6.0 features and adversarial security hardenings have been implemented in c:\Users\terence\Projects\peptidenews:
- 89/89 PHPUnit tests passing (
vendor/bin/phpunit). - REST API Worker Routes (
/wp-json/peptide-news/v1/worker/*): Authenticated viaX-Peptide-News-Token(with timing-safe comparison and automatic token decryption). - Standalone Coolify Worker (
tools/vps-worker/): Complete withDockerfile,docker-compose.yml, andworker.phpsupporting both CLI arguments and Coolify environment variables (WP_URL,VPS_TOKEN,OPENROUTER_KEY,OPENROUTER_MODEL,WORKER_ACTION,BATCH_SIZE). - 3-Step AI Pipeline:
- Step 1 (Gatekeeper): Assigns scientific rigor score (1–10) and classifies study type. Rejects low-quality/promotional spam (
score < 3oris_spam = true) by setting'is_active' => 0. - Step 2 (Extraction): Extracts target peptides, mechanism, experimental model, and keywords, saving checkpoint to
ai_metadata. - Step 3 (Generation): Creates a 300–500 word structured Markdown summary (
## Executive Summary,## Scientific Context & Mechanism, etc.).
- Step 1 (Gatekeeper): Assigns scientific rigor score (1–10) and classifies study type. Rejects low-quality/promotional spam (
2. Instructions for the Agent: Step-by-Step Execution
Step 1: Package as an Installable WordPress Plugin ZIP
Before deploying to WordPress, create a clean, installable ZIP archive (peptidenews-v2.6.0.zip) that can be uploaded directly via WordPress Admin -> Plugins -> Add New -> Upload Plugin:
- From the parent directory of
peptidenews, generate a clean zip archive containing thepeptidenews/root folder while excluding development, test, and git files:(On Windows PowerShell, use# Linux / macOS / Bash: zip -r peptidenews-v2.6.0.zip peptidenews/ \ -x "peptidenews/.git/*" \ -x "peptidenews/tests/*" \ -x "peptidenews/phpunit.xml*" \ -x "peptidenews/.phpunit*" \ -x "peptidenews/scratch/*" \ -x "peptidenews/*.md"Compress-Archive -Path .\peptidenews -DestinationPath .\peptidenews-v2.6.0.zipafter excludingtestsand.git). - Verify ZIP Archive Structure: Ensure
peptidenews/peptide-news-plugin.phpis located at the top level inside the zip archive so WordPress correctly recognizes it as a valid plugin.
Step 2: Deploy & Configure WordPress on Shared Hosting
- Upload and install
peptidenews-v2.6.0.zipvia WordPress Admin or extract it into/wp-content/plugins/peptidenews/on the shared WordPress server. - In WordPress Admin -> Settings -> Peptide News:
- Under NCBI API Key, enter an NCBI API key (optional, increases PubMed rate limit to 10 req/sec).
- Under VPS Worker Integration, enter a strong secret token (e.g.,
coolify_secret_token_2026) and save.
- Verify the REST API endpoint responds correctly:
curl -i -H "X-Peptide-News-Token: coolify_secret_token_2026" \ "https://your-wordpress-site.com/wp-json/peptide-news/v1/worker/pending?limit=5"
Step 3: Deploy Worker Application to Coolify (Hostinger KVM8 VPS)
Use the Coolify UI or Coolify MCP to create and configure the standalone worker:
- Create Application in Coolify:
- Add a new Application and point it to the repository (or upload
tools/vps-worker/). - Set Build Pack to
Dockerfilewith pathtools/vps-worker/Dockerfile.
- Add a new Application and point it to the repository (or upload
- Configure Environment Variables in Coolify:
WP_URL=https://your-wordpress-site.com VPS_TOKEN=coolify_secret_token_2026 WORKER_ACTION=process-llm OPENROUTER_KEY=sk-or-v1-your-openrouter-api-key OPENROUTER_MODEL=google/gemini-2.0-flash-001 BATCH_SIZE=25 - Configure Scheduled Task (Coolify Cron):
- Under Scheduled Tasks / Cron Jobs for the application, create a new schedule:
- Cron Expression:
0 * * * *(runs hourly) - Command:
php /app/worker.php
- Cron Expression:
- Click Deploy to build and launch the Alpine PHP container.
- Under Scheduled Tasks / Cron Jobs for the application, create a new schedule:
3. Automated Verification Checklist for the Agent
- Verify Plugin ZIP Installation: Confirm
peptidenews-v2.6.0.zipinstalls and activates cleanly in WordPress Admin without warnings or missing dependencies. - Run Unit Tests Locally: Execute
vendor/bin/phpunitand confirmOK (89 tests, 231 assertions). - Test One-Off Execution in Coolify:
- Trigger the Coolify scheduled job or run
php /app/worker.php --action="pending"inside the container. - Confirm it connects to WordPress without HTTP 403 or 500 errors.
- Trigger the Coolify scheduled job or run
- Check Gatekeeper Database State:
- Confirm in WordPress Admin that legitimate scientific articles (
rigor_score >= 3) receive structured Markdown summaries and tags. - Confirm that rejected promotional spam (
rigor_score < 3oris_spam) is automatically updated with'is_active' => 0and excluded from frontend widgets.
- Confirm in WordPress Admin that legitimate scientific articles (