Skip to content

Do not reserve a second DOI for a note already being asked about - #46

Merged
lmoresi merged 1 commit into
mainfrom
bugfix/deposit-ready-guard
Sep 2, 2026
Merged

lmoresi merged 1 commit into
mainfrom
bugfix/deposit-ready-guard

Conversation

@lmoresi

@lmoresi lmoresi commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

I dropped this guard when I rewrote the step in #43. It had been added in #42
for the queue design, and the rewrite replaced the whole step without carrying
it across.

unreserved() reads main, and a reserved record only reaches main when a
request is merged. So between opening a request and merging it, the note
still looks unreserved — and the next run of the reminder creates a second
figshare draft, reserves a second DOI, and opens a second request, abandoning
the first draft. That is the duplicate-mint hazard the whole flow exists to
prevent.

It is already wrong on the push trigger: two metadata pushes before a merge are
enough. It would be worse on a schedule, which is what prompted looking — a
weekly run would mint a fresh DOI for every waiting request, every week.

An open request now counts as having asked, and the reminder subtracts those
before it reserves anything. The test asserts the guard rather than its
wording, since this is the second time the mechanism around it has been
rewritten.

Underworld development team with AI support from Claude Code

I dropped this guard when I rewrote the step in #43. It had been added in
#42 for the queue design, and the rewrite replaced the whole step without
carrying it across.

`unreserved()` reads main, and a reserved record only reaches main when a
request is MERGED. So between opening a request and merging it the note
still looks unreserved, and the next run of the reminder creates a second
figshare draft, reserves a second DOI, and opens a second request --
abandoning the first draft. That is the duplicate-mint hazard the whole
flow exists to prevent.

It is already wrong on the push trigger, where two metadata pushes before
a merge are enough. It would be worse on a schedule, which is what
prompted looking: a weekly run would mint a fresh DOI for every waiting
request, every week.

So an OPEN request counts as having asked, and the reminder subtracts
those before it reserves anything. The test asserts the guard rather than
its wording, since this is the second time the mechanism has been
rewritten around it.

Underworld development team with AI support from Claude Code
@lmoresi
lmoresi merged commit 943e1d6 into main Sep 2, 2026
3 checks passed
lmoresi added a commit that referenced this pull request Sep 2, 2026
* Ask about undeposited notes weekly, not only when metadata changes

The push trigger fires on a metadata CHANGE, and the condition it cares
about is a STATE: archival, published, holding no record. A note that
reached that state before this workflow existed -- or whose metadata has
simply not moved since -- is never asked about at all.

Retrofitting the boundary-conditions note is what showed it. Nothing in
the repository would have offered it a DOI; it had to be asked for by
hand, and the only reason it was ever offered before that was an
unrelated backfill that happened to touch its metadata.

So the same question is asked weekly. That is only safe because of the
guard merged in #46: a request already open counts as asked, so a note
waiting on a decision is not asked again and does not accumulate drafts.
Verified before adding this -- two further runs against the live API
reported "already asked" and created nothing.

Scheduled an hour before the `outstanding` report, so a request opened on
Monday appears in that week's issue rather than waiting for the next.

Underworld development team with AI support from Claude Code

* Read the workflow triggers as text, not YAML

pyyaml is not in the test environment, and the triggers are a flat block
at the top of the file. I pushed this test failing: the pipe into `tail`
masked pytest exit status, so the chain that committed it carried on.

Underworld development team with AI support from Claude Code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant