fix(llm): restore comic verify to comic-processor parity — drop confidence, lenient yes/no (bookshelf-h2af) #713
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "bd-bookshelf-h2af"
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?
Summary
Restores the LLM comic-verify step to full parity with the reference algorithm in
comic-processor/main.go. Book 4315 ("The Avengers vs. Atlas #4") was silently rejected: the vision model replied with a verbose markdown analysis ending✅ Yes, the two comic book covers are identical. All key elements match perfectly.but pergamum parsedMatch=falsedue to the over-engineered VERDICT-format parser.Changes
Prompts (
internal/metadata/llm/llm.go): replaced the strict "same ISSUE / VERDICT: YES HIGH/MEDIUM/LOW/NO" prompt with the reference's lenient wording — same characters in roughly the same scene; colour differences are fine; answer only yes or no.VerifyResultstruct: removed theConfidencefield (Match + Raw only). Confidence was part of the broken design.parseVerifyResponse: replaced VERDICT machinery with robust yes/no parser — strip<think>blocks, accept affirmative conclusions anywhere in verbose responses (yes, identical, same cover, etc.), guarded by negation phrases (not identical, not the same, no match, etc.).Accept gate (
bulk_llm_workflow.go): changedMatch && (Confidence == "high" || Confidence == "medium")to simplyMatch— first yes wins.Original-resolution fetch (
llm_workflow.go): Verify activity now tries/original/cover URL first, falls back to/scale_medium/on failure (mirrorscomic-processor:582-587).Debug visibility: per-candidate logging (index, title, has_cover) + per-verify-verdict logging (Match, raw) in structured logs and richer audit-log detail on no-match.
Updated all affected tests to remove
Confidencefield references and match new behaviour.Regression test
verify_test.goincludes the exact book 4315 response text as a test input assertingMatch=true.Test plan
go build ./...— cleango test ./internal/metadata/llm/... ./internal/wfengine/...— 100% passmake test— all 961 specs passmake coverage— 100% on both changed packagesgolangci-lint runon changed packages — 0 issuesCloses bead bookshelf-h2af on merge.
f4b94ba895d4d88929b2