Skip to main content

Module verify

Module verify 

Source
Expand description

doiget verify <path> — check that every DOI / arXiv reference in a bibliography file resolves to real metadata, WITHOUT downloading any PDF or writing to the store.

Each entry is classified:

  • valid — the id resolved to metadata (Crossref / arXiv).
  • illegal — the id is malformed (Ref::parse rejected it, e.g. a typo like 1O.1234), or the whole file failed to parse. Always counts toward the exit code: a malformed id is a definite source error, independent of the network.
  • absent — a well-formed id that the metadata source authoritatively reports does not exist (HTTP 404 / 410, surfaced as ErrorCode::NotFound). Network-independent and reproducible, so it is a definite dead reference and always counts toward the exit code — independent of --strict.
  • unreachable — a well-formed id whose resolution failed for any transient reason (transport / DNS / TLS error, 429, 5xx, timeout). This is tolerated by default (a flaky network must not fail a build over a reference that is probably fine) and fails the run only under --strict (the network-stable lane that demands every id resolve).
  • unverifiable — the entry carried no DOI / arXiv id at all. Warning by default; fails under --strict / on_missing_id="error".

The split between absent and unreachable is the load-bearing distinction: it lets the default mode catch a genuinely dead DOI while still passing when the network merely hiccuped on a real id.

Exit code = number of failing entries, capped at 255 (mirrors doiget batch). “Failing” = illegal + absent always; plus unreachable when --strict; plus unverifiable when --strict or on_missing_id = "error". JSON-Lines (one record per entry) is written to stdout regardless of mode; the summary goes to stderr unless --quiet.

Functions§

run
Entry point for doiget verify <path> [--format] [--strict].