Fix ways a run could create duplicate items #77
All Vouch review confidence checks passed
Residual risk 0.21 = Change Risk (0.52) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.52 · 650 lines diff across 8 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.388
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #77"
general
weight: 0.35
connorshea
Fixes from a bug hunt through the recent changes. Most of them stop the tool from creating duplicate items, or adding wrong statements, on Wikidata.
A restart during a create no longer invites a duplicate (
a12cee9)wikidata_editsrow is written as "unknown" before the request goes out, then updated when Wikidata answers. Before, the row was only written after the answer. If a deploy restarted the server mid-create, the run was marked "interrupted", the UI said to start it again, and the item could be created twice.markInterruptednow ends such a run "unknown", with "The server restarted while creating this, so it may have been created anyway." The check before the next run then asks the user to confirm, as it already does after a timeout.runPlancould reject unhandled and take the whole process down, cutting off every other user's run. The run now has a.catch, and that write is retried twice. The user's run guard is only let go once the run's end is saved, so another tab can't start the same form while the run still says "running" (531e4d8).checkUnknownRunnow also sets the run'salbum_qid, so the album list shows it as created.Leaving the page during a run keeps its QIDs (
addbb43)A reused track isn't given a second composition (
af0bcd3)74c26dd). The message names the rows and the composition to use. This costs onewbgetentitiesrequest per 50 reused tracks, and none when no tracks are reused.Two rows of the same MusicBrainz work creating two compositions is tracked separately in #76.
Two tabs can't overwrite each other's form (
ed5175e)Testing
vp checkandvp testpass, with new tests for the composition check, the fill and the review step.markInterrupted, and a failed final status write. 4 of these 6 fail onmain. They're scratch tests, not in this PR, since the repo has no database test setup.src/lib/own-run.ts, with tests for saving and loading it, when its QIDs go back into the form (only the form it started from), dropping it on a 404, and writing QIDs by plan key.RunSectiononly wires these to its state and polling, and that wiring has no tests.checkUnknownRunalbum link.🤖 Generated with Claude Code