From dd1c38b6cfa88724a0dd341f43fcd22fa36bdd7e Mon Sep 17 00:00:00 2001 From: peptiderepo Date: Fri, 12 Jun 2026 03:51:43 +0000 Subject: [PATCH] fix: document STATUS_TTL/API_TIMEOUT/MAX_RETRIES safety invariant (v0.18.3) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add comment at the PRAUTOBLOGGER_MAX_RETRIES + PRAUTOBLOGGER_API_TIMEOUT_SECONDS constant definitions documenting the dependency: API_TIMEOUT_SECONDS × MAX_RETRIES (540s) must stay < STATUS_TTL (600s) Current product: 180s × 3 = 540s — 60s margin. Prevents constant-drift regression: raising either constant without checking the inequality could cause a fully-retrying LLM call to exhaust the status-transient TTL within a single stage, triggering a false orphan-run abort (R2b path in poller). Agent-Session: prab-v0183-20260612 --- prautoblogger.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/prautoblogger.php b/prautoblogger.php index 5c1a78e..d179067 100644 --- a/prautoblogger.php +++ b/prautoblogger.php @@ -42,6 +42,11 @@ define( 'PRAUTOBLOGGER_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); define( 'PRAUTOBLOGGER_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); define( 'PRAUTOBLOGGER_PLUGIN_BASENAME', plugin_basename( __FILE__ ) ); // API and retry limits — named constants instead of magic numbers. +// SAFETY INVARIANT: API_TIMEOUT_SECONDS × MAX_RETRIES must stay < STATUS_TTL (600s, +// defined in PRAutoBlogger_Generation_Status_Poller). The current product +// (180s × 3 = 540s) leaves a 60s margin. If either constant is raised, verify the +// inequality still holds — otherwise a fully-retrying LLM call can exhaust the +// status transient TTL within a single stage and trigger a false orphan-run abort. define( 'PRAUTOBLOGGER_MAX_RETRIES', 3 ); // Pipeline v2 Phase 1 (v0.18.0) defaults. Both are SETTINGS-backed at every // read site (prautoblogger_per_run_cost_ceiling_usd /