Fall back to a safe prompt when image moderation blocks a cover or portrait #2
All Vouch review confidence checks passed
Residual risk 0.19 = Change Risk (0.47) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.47 · 323 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.346
Shallow Review Depth
shallow_review_depth
0.289
Ai Authored
ai_authored
0.050
Real PR Conversation Timeline
1 comments
"Review active on #2"
general
weight: 0.35
justin-schroeder
Problem
A fresh library build can end in "Library building paused — Something went wrong." with no explanation, even though almost every artist was made (in the reported case, 106 of 110 artists were ready).
Root cause
OpenAI's Images endpoint blocks some cover prompts with:
All four failures were posed dance-pop covers of a solo woman: a bodysuit or mini-dress, a hand on her hip. The block happens at the output stage, and the same prompt gets blocked on every try. So:
1.
client.imagethrew a generic.http(400, …).2.
writeAllretried the whole artist 3 times, with the same cover prompt each time, then marked the artistfailed.3.
run()set the batch to.failedbut only filled inactivity, noterror.BuildingViewandSidebarViewshowstatus.error ?? "Something went wrong.", so the real reason never reached the UI.Try Again couldn't fix it either, because it sends the same prompt again.
Fix
ChatGPTError.moderationBlocked([String]), parsed from the Images endpoint's 400 body byChatGPTError.from(status:body:). It is not retryable.LibraryBuilder.paint(_:fallback:generate:): if a cover or portrait is blocked, it tries once more with a fallback prompt that has no people in it:- covers: a typographic, abstract design that keeps the title, artist name, year and genre
- portraits: a wide environmental shot with everyday clothes
error(and stores it ongenerationBatch.error), for example "4 artists couldn't be finished." It used to show a generic message. This also fixes "1 artists".Verification
ImageModerationTests(6 tests): parsing the real blocked response body, keeping the body for other 4xx errors, using the fallback only on a moderation block, the content of the safe prompt, and the partial-failure message. They were written first and failed to compile before the fix.swift testinPackages/StandardKit: 53 tests in 14 suites passed.sm-dev image: the original Plastic Tiara cover prompt reproducesmoderation_blocked. The fallback prompt generated a cover for all 4 previously blocked albums (Plastic Tiara, Paradise at Full Volume, Pleasure Audit, Chrome Tempo), with names spelled correctly.Libraries that are already affected recover with Try Again:
resumeUnfinished(retryFailed:)→complete→paintCovernow takes the fallback path.