US02-06: Deliver Workflow, Safety, Library, Analysis, and Stats Views #59
Reference in New Issue
Block a user
Delete Branch "us/US02-06-workflow-safety-library-analysis-stats-views"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Stacked on #58 (US02-05). Ports safety review and the Photo Analyzer Library/Analyze/Stats views onto the shared API + service layer, adds the Workflow home, and enforces the pipeline gates + one-mutating-job policy.
Backend
safety_reviews(append-only; latest row is the current decision) andanalysis_results(donorphotosschema re-keyed toasset_id).sfw/nsfwkeyword written, read back,current_sha256refreshed) that upload eligibility depends on.photo_analyzer.analyze_image; a fake in tests).webapp/query.py(LIKE search instead of FTS5; facets, top tags, years, albums, people).GET /api/v1/workflow— per-stage readiness derived from source tables (counts, blockers, last-run, action,active_job). Safety scoring and analysis run as durable jobs under thelibrary_writelock; a second mutating job is refused.Frontend
Five views (
frontend/js/views.js) on the US02-05 shell: Workflow stepper (status text+icon, not colour alone; actions disabled with a reason while a job runs), Safety review (filter tabs, decide, persists across reload), Library (search + cards), Analyze (counts + live job log via the SSE adapter), Stats. Shared DOM helpers →dom.js. Workflow is the home route.Acceptance
Tests (215 pass)
test_safety_analysis.py: provider-call privacy (nsfw never reaches the provider), sfw→nsfw flip drops eligibility, decision persistence, one-mutating-job rejection, workflow counts, exiftool safety-keyword write/verifytest_workflow_views.py: Workflow cards, actions disabled+explained during a job, safety decide-persists-across-reload, Library search, Stats, Analyze counts🤖 Generated with Claude Code