This chapter defines the data layer behind pipeline reliability. Step 3 covered operations; Step 4 explains how state is stored, moved, and validated.
data/review.db - operational queue and editor-driven lifecycle state.data/photos_info_revamp.db - local mirror of published catalog rows.photos_info_revamp - website-facing published metadata.data/prefill_qc_last.json - stage-6 prefill QC report artifact (duplicates/suspicious text summary).Design intent: run-time decisions happen in local SQLite; remote systems are touched only in approved publish flow.
Use this for fast orientation. Detailed per-column definitions are listed later in the full dictionary.
| Area | Key fields | Why it matters |
|---|---|---|
| Queue identity and routing | id, Folder, File_Name, Path, ollama_path |
Tracks where each image is and which filename/path the pipeline is currently using. |
| Queue quality and decision | QR, QC_Status, Review_Status |
Determines review readiness, quality class, and whether publish is allowed. |
| Published record identity | id (catalog key), File_Name (upsert key), Path, Thumb_Path |
Keeps website-facing records stable and prevents duplicate publish entries. |
| Published metadata | Caption, alt_text, Keywords, Location, DateTime, Camera |
Provides searchability, accessibility, and contextual quality on the website. |
| Lineage and audit | Original_File_Name |
Maintains traceability from final published asset back to source input name. |
Important: review_queue.id is operational only; publish identity is resolved in photos_info_revamp.id.
review_queue
The table is initialized from data/init/review_queue.sql in the automation repository.
A local docs copy is available at docs/review_queue.sql.
Each row represents one image moving from ingest through review to publish decision.
id, File_Name, Original_File_Name, Path, ollama_path, Thumb_Path.DateTime, Camera, Lens_model, Width, Height, Exposure, Aperture, ISO, Focal_length.Folder, Subject, Location, Caption, alt_text, Keywords.nima_score, blur_score, brightness_score, contrast_score, brisque_score, clip_aesthetic_score, QR, QC_Status.Review_Status.Status values are stage-driven and operator-driven. Common states in active code paths include:
Queued - row inserted and awaiting downstream scoring/prefill completion.Pending - row is ready for review decision (and may contain AI prefill content).Generate action (editor) - rewrites Caption/alt_text/Keywords in-place while preserving review-first flow.Approved - approved for publish path.Rejected - not published; row may be removed depending on editor flow.Error - stage failure requiring triage/retry.Published/Uploaded - may appear in editor/legacy paths; publish pipeline still enforces approved-only selection in uploader.Operational rule: queue state should be interpreted together with logs, not as a stand-alone signal.
During publish, db_uploader.py selects approved rows and writes to remote MySQL using
File_Name as the stable unique key for upsert behavior.
SELECT id FROM photos_info_revamp WHERE File_Name=? after upsert.data/photos_info_revamp.db is synchronized with canonical MySQL id.review_queue.
Consequence: review_queue.id is an operational ID only; it is not the publish catalog primary key.
A local docs copy of the publish schema is available at docs/photos_info_revamp.sql.
Editor flows can upsert into st_items (when available) for rating and review-history support.
This ledger is useful for analysis and future model learning, but it is not required for publish writes.
File_Name as a durable business key across publish and mirror synchronization.data/used_filenames.json.data/prefill_qc_last.json as operational telemetry, not as source-of-truth state.-- queue volume by status
SELECT COALESCE(Review_Status, 'NULL') AS status, COUNT(*) AS n
FROM review_queue
GROUP BY COALESCE(Review_Status, 'NULL')
ORDER BY n DESC;
-- pending rows waiting editor decision
SELECT id, File_Name, QC_Status
FROM review_queue
WHERE COALESCE(Review_Status,'Pending')='Pending'
ORDER BY id DESC;
-- approved rows ready for uploader
SELECT id, File_Name, Folder
FROM review_queue
WHERE Review_Status='Approved'
ORDER BY id ASC;
-- error rows requiring triage
SELECT id, File_Name, Review_Status, QC_Status
FROM review_queue
WHERE Review_Status='Error' OR QC_Status IN ('ResizeFailed')
ORDER BY id DESC;
docs/review_queue.sql (local docs copy)docs/photos_info_revamp.sql (local docs copy)data/init/review_queue.sqldata/init/photos_info_revamp.sqldocs/review_db_schema.sql (extended schema reference, including optional analysis tables)data/prefill_qc_last.json (stage-6 QC summary artifact)Keep init SQL aligned with runtime code whenever schema or column semantics change.
The following definitions map each column to its operational meaning.
review_queue columns (docs/review_queue.sql)id (INTEGER) - local queue row identifier (autoincrement).Folder (TEXT) - category/folder key used by workflow and publish paths.File_Name (TEXT) - deterministic working filename used for publish mapping.Path (TEXT) - local full image path in current processing state.ollama_path (TEXT) - temp resized image path for local caption model input.Thumb_Path (TEXT) - thumbnail path when available.DateTime (TEXT) - capture datetime from EXIF or derived metadata.Camera (TEXT) - camera model string.Lens_model (TEXT) - lens model string.Width (INTEGER) - image width in pixels.Height (INTEGER) - image height in pixels.Exposure (TEXT) - exposure time text (for example 1/320).Aperture (TEXT) - aperture text (for example f/5.6).ISO (INTEGER) - ISO value from EXIF.Focal_length (INTEGER) - focal length value.Keywords (TEXT) - keyword list/string for search and metadata publish.Caption (TEXT) - main caption text.alt_text (TEXT) - accessibility/SEO alternate text.Location (TEXT) - location label used in metadata context.Subject (TEXT) - subject label used for naming/metadata context.nima_score (REAL) - NIMA-based quality feature.blur_score (REAL) - blur quality feature.brightness_score (REAL) - brightness quality feature.contrast_score (REAL) - contrast quality feature.QR (REAL) - aggregate quality rating score.QC_Status (TEXT) - quality classification/state.Review_Status (TEXT) - lifecycle status (Queued/Pending/Approved/Error/etc.).Original_File_Name (TEXT) - original imported filename before automation naming.brisque_score (REAL) - BRISQUE quality feature.clip_aesthetic_score (REAL) - CLIP aesthetic feature.photos_info_revamp columns (docs/photos_info_revamp.sql)id (INTEGER) - publish catalog primary key.Folder (TEXT) - published folder/category key.File_Name (TEXT) - published filename and upsert key in publish pipeline.Path (TEXT) - public/remote image path URL.Thumb_Path (TEXT) - public/remote thumbnail URL.DateTime (TEXT) - capture datetime metadata.Camera (TEXT) - camera metadata.Lens_model (TEXT) - lens metadata.Width (INTEGER) - width in pixels.Height (INTEGER) - height in pixels.Exposure (TEXT) - exposure value text.Aperture (TEXT) - aperture text.ISO (INTEGER) - ISO value.Focal_length (INTEGER) - focal length value.Keywords (TEXT) - searchable keyword metadata.Caption (TEXT) - published caption.alt_text (TEXT) - published alt text.Location (TEXT) - published location metadata.QR (INTEGER) - quality/ranking score field in this schema export.QC_Status (TEXT) - quality class in published metadata.Original_File_Name (TEXT) - original source filename (required).nima_score (REAL) - NIMA quality metric.blur_score (REAL) - blur metric.brightness_score (REAL) - brightness metric.contrast_score (REAL) - contrast metric.brisque_score (REAL) - BRISQUE metric.clip_aesthetic_score (REAL) - CLIP aesthetic metric.Step 4 defines storage and state contracts. Step 5 defines how to extend these components safely as a developer.