boundaries

This commit is contained in:
John Lancaster
2026-06-28 12:33:57 -05:00
parent c409b42077
commit 4e4bf50219
5 changed files with 46 additions and 61 deletions
@@ -67,6 +67,8 @@ Atomicity rules:
Separation of concerns:
- Worker modules should stay lightweight and delegate lifecycle transitions to service/workflow orchestration functions.
- In `workflows.py`, `process_queued_job` should own one complete attempt lifecycle: `QUEUED -> PROCESSING -> TRANSCRIBED|FAILED`.
- In `workflows.py`, `advance_job` should coordinate broader status progression around attempts (for example retry scheduling from `FAILED -> QUEUED`).
- Services should expose session-aware write helpers (flush on caller-owned session) so orchestration controls commit boundaries.
- Backoff/sleep behavior must run outside transactional scopes.