Repair duplicate rows left by concurrent bot merges - #72
Merged
Conversation
main was failing validate.py with 7 duplicate-id errors. Two separate causes, both from inv/* branches that were cut from the same base and merged without a merge-time check: 1. Verification stamps text-merged as added lines rather than in-place edits, leaving both the pre- and post-verification copy of a row. Affects itm-00041..itm-00044 and locations 209-CAB-15, 209-CAB-16. Kept the stamped copy, dropped the stale one. 2. itm-00500 was allocated twice. next_item_id() is max+1 over the branch's own copy of items.csv, so two adds off one base collided. PR #51 (Glass bottles) merged first and keeps itm-00500; PR #59 (10 loop needle) becomes itm-00501 -- what the allocator would have produced had it seen the merge. Also restores item_id/location_id sort order, which both files held everywhere except at these two damage points. No row content was altered and no id was removed: every surviving row is byte-identical to one that already existed, and itm-00501 is the only id added. items 505 -> 501, locations 175 -> 173. validate.py passes. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This was referenced Aug 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
mainhas been failingscripts/validate.pywith 7 duplicate-id errors. This repairs the data. It does not yet fix the workflow gap that caused it — see the note at the bottom.Two causes, both from concurrent
inv/*branches1. Verification stamps merged as added lines instead of in-place edits
PRs #52 and #53 were each cut from the same base and stamped a verification. Git kept both the old and the new version of every row they touched:
Affects
itm-00041–itm-00044and locations209-CAB-15,209-CAB-16. Kept the stamped copy, dropped the stale one.2.
itm-00500was allocated twicenext_item_id()inscripts/apply_issue.pyismax+1over the branch's own copy ofitems.csv, so two adds branched from one base picked the same id for different items:itm-00500itm-00501First merge keeps the id; the later one takes the next, which is what the allocator would have produced had it seen the merged file.
This also restores
item_id/location_idsort order — both files held it everywhere except at these two damage points.Verification
Files are CRLF; I confirmed a byte-identical CSV round-trip before editing, so the rewrite introduces no formatting churn. The diff is 3 insertions / 9 deletions.
Follow-ups, not in this PR
itm-00114–itm-00122and209-CAB-48/49, which already exist onmain, and re-adds some of them with stale pre-verification values. Issue Verify a location #65 can regenerate it against a fixedmain.issue-to-pr.ymlnotes, a PR opened withGITHUB_TOKENdoesn't triggervalidate.yml, so validation runs before the PR exists and never again. A stale branch can therefore merge dirty — which is exactly what happened here. Worth closing before any bulk retrigger of the ~29 issues that never got PRs.🤖 Generated with Claude Code