ID: d8fbc165-807 Priority: 80 Type: one_shot Status: done
Build image_generator.py: provider abstraction over MiniMax image-01 (primary, free subscription) and GLM CogView-4 (fallback). Core generate_image() function saves to site/figures/, registers as artifact. Error handling with automatic fallback. CLI interface for testing.
scidex/forge/image_generator.py (blob c9cc7b06). Contains:_minimax_generate()) as primary (free subscription)_glm_generate()) as fallbackgenerate_image() saves to site/figures/, registers via register_artifact()if __name__ == "__main__" argparseevaluate_image_quality()batch_generate_for_analysis() and batch_generate_entity_portraits()git ls-tree origin/main:scidex/forge/ | grep image confirms file exists? placeholders, PRAGMA journal_mode, kg_edges table name vs knowledge_edges, CURRENT_TIMESTAMP)import sqlite3 + from scidex.core.database import get_db (top-level) with lazy imports inside each function using get_db()db.row_factory = sqlite3.Row (not needed for dict(row) access in PostgreSQL)? placeholders to %s (PostgreSQL)CURRENT_TIMESTAMP with NOW()kg_edges table → knowledge_edges (correct SciDEX table name)_fetch_kg_edges: uses source_id, relation, target_id columns instead of old subject, predicate, object_fetch_hypothesis and _fetch_analysis to use %s placeholdersevaluate_and_update_artifact: removed PRAGMA journal_mode = WALfrom artifact_registry import → from scidex.atlas.artifact_registry importpsycopg2.sql import
python3 tests/test_image_generator_prompts.py → 8/8 passed[Forge] Fix image_generator.py PostgreSQL compatibility [task:d8fbc165-807c-4a63-b4a7-e87d5d8a62bb]{
"requirements": {
"coding": 7,
"image_generation": 5
},
"_reset_note": "This task was reset after a database incident on 2026-04-17.\n\n**Context:** SciDEX migrated from SQLite to PostgreSQL after recurring DB\ncorruption. Some work done during Apr 16-17 may have been lost.\n\n**Before starting work:**\n1. Check if the task's goal is ALREADY satisfied (run the relevant checks)\n2. Check `git log --all --grep=task:YOUR_TASK_ID` for prior commits\n3. If complete, verify and mark done. If partial, continue. If not done, proceed.\n\n**DB change:** SciDEX now uses PostgreSQL. `get_db()` auto-detects via\nSCIDEX_DB_BACKEND=postgres env var.",
"_reset_at": "2026-04-18T06:29:22.046013+00:00",
"_reset_from_status": "done"
}