A decided suggestion stays decided when a different file with the same grade is suggested
Problem/motivation
Since #102 (closed), DisclosureRecorder::suggest() keeps an accepted or dismissed row when the same source suggests the same grade again. The check compares only the grade. A different file with the same grade lands on the decided row: it keeps the old status, nobody is asked, and the note is rewritten with the new file's details. The suggestions page then shows the editor dismissing a file they never saw.
Reported and diagnosed by @Maurice1969, who also proposed the fix below.
Steps to reproduce
- Upload image A, fully AI generated, to a media item. Content Credentials suggests
ai_generated_autonomous. - Dismiss the suggestion.
- Replace image A with image B, also fully AI generated.
- Content Credentials suggests
ai_generated_autonomousagain, with a note about B. - The row stays dismissed, with B's note. B never reaches an editor.
Proposed resolution
suggest() already loads the existing row. Keep its status only when the grade and the note are both the same. Reading the same file again gives the same note, so the case from #102 (closed) still works. A new file normally gives a different note, so it goes back to pending. No schema change.
Two files with identical credentials still share one decision. The docs say so.
Remaining tasks
- Review of the merge request.
User interface changes
A suggestion for a replaced file shows up as pending again.
API changes
suggest() keeps its signature. It now compares the note as well as the grade before keeping a decided row.
cc @Maurice1969
AI Compliance
🤖 Generated with the help of an LLM, reviewed and approved by me before posting.