Repository navigation
Phase 5: DOI version-mint reconciliation (#900) - #940
Merged
neuromechanist merged 2 commits intoJul 6, 2026
Merged
neuromechanist merged 2 commits into
neuromechanist merged 2 commits into
Conversation
Epic #896 Phase 5 (#900). In createEzidVersionDoi, if createIdentifier (reserved) succeeded but a prior attempt crashed before makePublic, the retry hit the 'already exists' branch and returned the still-reserved identifier early -- a permanent, non-resolving DOI recorded as the dataset's latest version. - Core fix: on 'already exists', fetch the identifier and inspect status. Only return early when it's already public; when still reserved, fall through to makePublic to finish the transition. - Backstop: reconcileReservedVersionDois daily cron sweep (mirrors archiveRetrySweep) checks the most-recently-updated datasets carrying an EZID version DOI, and completes any still stuck reserved. No new D1 column (avoids a migration-number clash with the paused #923 epic's 0057). - Pure helper tests (version/shoulder parsing). Full backend unit green.
📦 Package PreviewYour package is ready to test! bun install -g nemar-cli@PR940Version: 🤖 Updated on each push. |
- Reconcile sweep now day-rotates over ALL version-DOI datasets (rotationOffset) instead of ORDER BY updated_at DESC LIMIT 25. A stuck reserved DOI is exactly the row that stops being updated, so the recency window could permanently starve it under unrelated churn; rotation guarantees full coverage within ceil(total/batch) days. - classifyExistingVersionDoi() makes the already-exists branch explicit: public->return, reserved->complete, anything else (unavailable/tombstone) ->throw, so a deliberately-tombstoned DOI is never silently resurrected. - Dropped the redundant, silently-swallowing getDatasetsToken gate (per-row resolveEzidAuth already guards missing secrets). - Pure tests for classifyExistingVersionDoi + rotationOffset coverage.
Contributor
Author
Review (sonnet) — findings addressed in 6cc5492
|
neuromechanist
merged commit Jul 6, 2026
68406af
into
feature/issue-896-epic-arch-hardening
1 check passed
This branch was previously deployed
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.
Summary
Fixes orphaned
reservedversion DOIs (permanent, non-resolving) and adds a backstop sweep.doi.tscreateEzidVersionDoi): ifcreateIdentifier(statusreserved) succeeded but a prior attempt crashed beforemakePublic, the retry hit the"already exists"branch and returned the still-reservedidentifier early — a permanent DOI that doesn't resolve, recorded as the dataset's latest version. Now it fetches the identifier and inspects status: return early only when alreadypublic; when stillreserved, fall through tomakePublicto finish the transition (returnspublic).reconcileReservedVersionDois, daily cron, mirrorsarchiveRetrySweep): checks the most-recently-updated datasets carrying an EZID version DOI (a fresh mint-crash bumpsupdated_at), asks EZID each DOI's status, and completes any still stuckreserved. Per-DOI prod/sandbox shoulder routing.Scope note
No new D1 column: a
latest_version_doi_statuscolumn would collide on migration number0057with the paused #923 epic. The recency-biased sweep is sufficient (a stuck DOI is a fresh crash) and self-correcting; a status-column optimization can land later without the clash.Test plan
backend/test/doi-reconcile.test.ts— version/shoulder parsing (versionFromVersionDoi,isSandboxDoi,isEzidNemarDoi).tsc+ Biome clean. The core fix's makePublic-on-reserved path is exercised by the sandbox-EZID integration tests.Closes #900. Part of epic #896.