Get the worker to the point where it can accept work
The permanent worker was started with stop-when-empty-for, an option Laravel didn't support. The command now uses supported options and validates queue names and numeric controls before constructing the worker arguments.
The permanent worker and backfill drain have different jobs. One stays available for later work; the other can use stop-when-empty to exit after its initial queue is drained. The command checks preserve that distinction.
Handle generation failures inside the job
GenerateLessonStudyPack has a lesson-specific uniqueness key, three attempts, a 180-second timeout and backoff intervals. Its uniqueness window lasts 900 seconds. That limits overlapping work for a period; it isn't an exactly-once guarantee or a permanent ban on regeneration.
The job checks that AI is enabled before proceeding. A retryable provider exception releases it with the requested delay; terminal failure stores a controlled reason and message through the study-pack service. Temporary unavailability, invalid payloads and other provider exceptions remain distinct cases.
Tests include malformed JSON, failed extraction and rejection of fabricated fallback content. Failed extraction must leave no ready payload and dispatch no embedding job. Those assertions check the consequences of failure, not just that an exception was caught.
Keep startup and completion evidence separate
The June closeout records a passing Study Pack group and a worker-configuration regression with 79 assertions. The configuration test checks the command, not a live process. Startup, dispatch, provider retry and the final stored result remain separate things to check when a guide doesn't appear.
Worker startup and generation retries are different boundaries
The permanent worker must start correctly before job-level runtime, retry and failure controls can operate.
Worker process
Generation job
Provider and result
Scroll or drag the background to move. Use the zoom buttons to resize.Arrow keys move between components. Enter selects.
Choose a component to explore
Select a numbered component on the map or use the component menu. Its details and connections will appear here.
No component selected.
All connections (9)
- 01 · Worker command configuration → 02 · Laravel queue workerConstruct supported command · Direct call
- 03 · Queued generation work → 02 · Laravel queue workerDeliver queued work · Async task
- 02 · Laravel queue worker → 04 · GenerateLessonStudyPackExecute job · Async task
- 04 · GenerateLessonStudyPack → 05 · AI runtime gateCheck runtime · Direct call
- 05 · AI runtime gate → 06 · StudyPackServiceContinue when enabled · Direct call
- 06 · StudyPackService → 07 · Configured AI providerRequest generation · Direct call
- 07 · Configured AI provider → 06 · StudyPackServiceResult or provider failure · Response / return
- 06 · StudyPackService → 08 · Artifact and version statePersist result or failure · Direct call
- 04 · GenerateLessonStudyPack → 03 · Queued generation workRelease retryable work · Async task