Repository navigation
feat: job orchestration refactor - dependencies, blocked state, duplicate prevention - #50
Merged
Merged
Conversation
…cate prevention - Add job dependency support (extract_entities, extract_locations, generate_embeddings require extract_text) - Add BLOCKED status for jobs waiting on prerequisites - Add duplicate prevention across QUEUED, IN_PROGRESS, BLOCKED - Add artifact type validation (images get no text extraction, text gets no vision) - Add scan idempotency with scan_snapshots table - Add worker_version tracking for reprocessing - Add comprehensive logging for duplicates and blocked jobs - Fix retry termination at MAX_RETRIES (5) - Create migration 007_job_orchestration.sql Success criteria: - Import 10,000 JPG files without queue growth loops - Stable queue size, no infinite retries - No duplicate jobs, no invalid jobs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR implements comprehensive job orchestration improvements to fix:
Changes
Job Dependency Support
extract_entities,extract_locations,generate_embeddingsnow requireextract_textto complete firstBLOCKED State
BLOCKEDinstead of being retriedDuplicate Prevention
Artifact Type Validation
Scan Idempotency
scan_snapshotstable tracks processed filesRetry Termination
MAX_RETRIES(5) attemptsLogging
Skipping duplicate job: document=XXX job=YYYBlocking job: document=XXX job=YYY reason=missing ZZZFiles Changed
storage/postgres_backend.py- Core orchestration logicstorage/migrations/007_job_orchestration.sql- New migrationingestion/collection_watcher.py- Scan idempotencytests/test_job_orchestration.py- New tests (20 passing tests)Success Criteria
@tamzrod can click here to continue refining the PR