Synchronous --sync CLI tick loop for VPS-driven generation over a held-open SSH session (survives Hostinger's ~10-min background-kill); $sync_mode guard on both tick handlers prevents double-drive; Run_Reaper UTC-vs-site-tz fix; one-shot self-heal migration restoring the maintenance crons that vanished after the 06-15/16 deploy (daily-generation excluded — VPS owns it).
QA: APPROVE @ 0689989 (qa-reviews/prautoblogger/2026-06-23-0689989.md). CEO greenlight 2026-06-22.
Agent-Session: prab-reliability-merge-20260622
3.1 KiB
PRAutoBlogger — Domain Glossary
Quick reference for the generation pipeline domain model. For full design rationale
see ARCHITECTURE.md (§21–§25) and CONVENTIONS.md.
Core Domain Terms
run
A single end-to-end article generation cycle: orchestrate → generate idea(s) →
finalize. Represented as a row in wp_prautoblogger_runs (status, cost ceiling,
timestamps). One run may produce multiple articles if the daily idea-count > 1.
run_stages (wp_prautoblogger_run_stages)
Sub-steps within a run (research, analysis, generation, publish). Each stage has
its own status and can be replayed independently via Rerun_Executor. Generation
checkpoint runs populate stages as Article_Worker progresses.
checkpoint
The persistence boundary between pipeline ticks. After each tick the idea queue
and run state are written to wp_options so a process kill cannot lose work. The
next tick reads the queue option and continues. See §25 of ARCHITECTURE.md.
idea queue (prautoblogger_article_queue option)
Serialized array of Article_Idea objects written by on_orchestrate_tick() and
consumed one-at-a-time by successive on_generate_tick() calls. Deleted on
finalize or cleanup.
Generation_Lock (wp_prautoblogger_generation_lock or wp_options)
DB mutex that prevents two concurrent runs. Acquired at the start of
on_orchestrate_tick(), released by Helpers::finalize() or on error/halt.
Execution Modes
Async (wp-cron driven)
Default path for the Board "New Article" button and the plain
wp prautoblogger generate WP-CLI command.
kick_off()schedulesprautoblogger_gen_orchestrateand callsfire_cron_now().on_orchestrate_tick()runs in a background PHP process, schedulesprautoblogger_gen_tick, and callsfire_cron_now()to spawn the next process.- Each
on_generate_tick()spawns the next until the queue drains.
Limitation: Hostinger kills background PHP processes at ~10 min. Orchestrate tick (LLM-free) and individual generate ticks (one LLM call each) are both well within this limit; the checkpoint design is the mitigation.
Sync (VPS-driven / --sync)
Used by the Coolify KVM8 VPS systemd timer via infra/vps/orchestrate-generation.sh
in peptide-e2e. Introduced v0.22.1.
run_sync()setsGeneration_Checkpoint_Runner::$sync_mode = true.- Calls
on_orchestrate_tick()in-process (no background spawn). - Loops calling
on_generate_tick()directly until queue empty or terminal state. $sync_mode = truesuppresses allwp_schedule_single_event+fire_cron_nowcalls inside both tick methods, preventing a competing background cron chain from forming in parallel.
The VPS SSH session is held open; the process is not subject to Hostinger's background-kill constraint.
Table Shorthand
Throughout the codebase wp_prautoblogger_* tables are referenced by their
$wpdb-> property names (e.g. $wpdb->prab_runs, $wpdb->prab_run_stages).
Full table names are defined in class-activator.php.
See also: ARCHITECTURE.md §25 (checkpoint design), CONVENTIONS.md (coding rules).