feat(review): link an image to a library prompt from Needs review (#536)

Images whose sampler paths could not be traced offered nothing to choose.
Add Link to a prompt: search the Library and record the reviewer's choice
under Apply's capture guards and the one-prompt-per-file rules, with
provenance that names a manual choice and never reads as file evidence.

Disabled options name the server's reason, nothing selectable says why and
leads with the picker, Leave unresolved is its own action, and each decision
opens the next item instead of returning to Images (overturns ruling R7).
This commit is contained in:
Vito Sansevero
2026-10-30 10:01:59 -07:00
parent a6d6129ec6
commit 35c87d1ed5
17 changed files with 1247 additions and 215 deletions
+11
View File
@@ -142,6 +142,14 @@ def certain_prompts(db, handler, path, metadata, output_dir):
return found
def _manually_linked(db, image_id):
"""True when a link of this image records a reviewer's manual choice."""
return any(
link["provenance"].get("kind") == "manual-link"
for link in db.get_image_prompt_pairs(image_id)
)
def judge(db, handler, row, output_dir):
"""One image's verdict dict."""
path = row["image_path"]
@@ -152,6 +160,9 @@ def judge(db, handler, row, output_dir):
"sources": {},
"target": None,
}
if _manually_linked(db, row["id"]):
# The reviewer named this prompt in Needs review (#536): not ours to undo.
return {**verdict, "verdict": "manual", "target": row["prompt_id"]}
if not os.path.isfile(path):
return {**verdict, "verdict": "missing"}
try:
+6
View File
@@ -539,6 +539,12 @@
"functions": 80,
"statements": 95
},
"workspace/review-link.mjs": {
"lines": 80,
"branches": 50,
"functions": 70,
"statements": 80
},
"workspace/review-state.mjs": {
"lines": 96,
"branches": 84,