AI Implementation feature(1089): Scheduled Execution with Cron and Retry Handling (#9)

This commit was merged in pull request #9.
This commit is contained in:
2026-08-04 20:48:16 +00:00
parent 3545b81546
commit 5f6ddf76a4
27 changed files with 644 additions and 272 deletions
+6 -9
View File
@@ -97,15 +97,12 @@ characters); the runner fails safely (raises) rather than truncating.
# Retry Behaviour (`_run_with_retry`)
* `attempts = max(1, config.max_retries + 1)` — at least one attempt
even if `MAX_RETRIES=0`.
* Any exception inside `_run_once` is caught (`noqa: BLE001`
intentional, the whole pass is opaque to the runner).
* Each failed attempt is recorded via
`log_error("pipeline_error", exc=exc, attempt=attempt, max_attempts=attempts)`.
* When the budget is exhausted, the runner emits
`log_error("pipeline_failed", exc=last_exc, attempts=attempts)` and
returns `None` so `main` can translate it to `exit 1`.
* `attempts = max(1, config.max_retries)` — at least one attempt even if `MAX_RETRIES=0`.
* The runner owns the unified retry budget; `_run_once` calls `ensure_repo` with `max_retries=0`.
* Transient Git and Mastodon failures are retried with delays of `2 ** (attempt - 1)` seconds between attempts.
* Each failed attempt emits `retry_attempt` with `operation`, `attempt`, and the exception `error` text.
* Fatal configuration, local repository, and publishing validation errors emit `retry_exhausted` immediately without retrying.
* When the budget is exhausted, `retry_exhausted` includes the final operation, total attempts, and error text, and `main` returns exit code `1`.
# Silent-on-No-Matches Contract