#[non_exhaustive]pub enum PdfLegStatus {
Fetched,
NoOaUrl,
Blocked {
code: ErrorCode,
message: String,
denial: Option<DenialContext>,
suggested_arxiv_id: Option<String>,
},
PreprintFallback {
arxiv_id: String,
original_block: String,
found_by: FoundBy,
},
PreprintDoiFallback {
preprint_doi: Doi,
platform: Option<String>,
original_block: String,
found_by: FoundBy,
},
TdmFetched {
source: String,
original_block: String,
},
}Expand description
Outcome of a successful fetch_paper call.
Wire shape mirrors docs/MCP_TOOLS.md §5 FetchResult minus the
envelope chrome the MCP server wraps it in (ok: true, ref,
optional error).
path is the absolute path of the resource the orchestrator wrote to
the store. For arXiv refs and successful DOI OA-PDF fetches this is
<root>/<safekey>.pdf; for the DOI metadata-only fallback (OA URL
host off the oa-publisher allowlist, or PDF leg failed for another
transport reason — docs/REDIRECT_ALLOWLIST.md §3 informed-best-
effort posture) this is <root>/.metadata/<safekey>.toml.
Outcome of the DOI OA-PDF leg, carried on FetchPaperOutcome so a
caller can NEVER silently report a blocked PDF as a plain
“metadata-only” success (issue #118). The product promise is
“immediately explain WHY a paper can’t be fetched” — the distinction
between “there was no OA PDF to fetch” and “an OA PDF existed but we
were blocked, and here is the reason” is exactly that explanation.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Fetched
A PDF was fetched and written to disk (arXiv always; DOI when the OA-publisher leg succeeded).
NoOaUrl
No OA URL was discovered (Unpaywall reported no
best_oa_location). Metadata-only is the correct, expected
result here — not a failure.
Blocked
An OA URL was discovered but the PDF could not be retrieved (host outside the oa-publisher allowlist, not-a-PDF body, transport failure, …). Metadata was still written, but the caller MUST surface this reason rather than pretending the fetch was a clean metadata-only success.
Fields
code: ErrorCodeClosed-set code, mapped from the underlying transport error
via the canonical From<FetchError> for ErrorCode.
denial: Option<DenialContext>Structured denial side-channel (ADR-0023) when the failure
was an allowlist / scheme denial; None otherwise.
PreprintFallback
The OA publisher PDF was blocked (403, allowlist denial, etc.) but
the suggested_arxiv_id pointed to an arXiv preprint that was
successfully fetched and stored under the DOI entry (issue #325).
The stored PDF came from arXiv, not the publisher; callers SHOULD
surface a note so the user knows the file is a preprint.
Fields
PreprintDoiFallback
Nothing open for the DOI itself, and no arXiv preprint: a non-arXiv preprint (bioRxiv, medRxiv, Research Square, OSF, …) was found and fetched through the OA location its own DOI reports (#640).
Fields
TdmFetched
The OA chain was blocked and a Tier-3 TDM source served the publisher’s own copy under the user’s TDM agreement (#458).
Distinct from Self::Fetched on purpose. The bytes did not come
from an OA host, they are not necessarily openly licensed, and the
user obtained them under an agreement they signed — provenance
that says oa-publisher here would be wrong in all three
respects.
Fields
source: StringThe Tier-3 source that served it ("tdm-aps", …). Matches
crate::source::Source::name.
Trait Implementations§
Source§impl Clone for PdfLegStatus
impl Clone for PdfLegStatus
Source§fn clone(&self) -> PdfLegStatus
fn clone(&self) -> PdfLegStatus
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more