Skip to main content

Module orchestrator

Module orchestrator 

Source
Expand description

Cross-source orchestrators that compose multiple Source impls into a single user-facing operation.

Slice 2 of the doiget roadmap promotes fetch_paper and batch_fetch from doiget-cli into this module so the MCP server (doiget-mcp) and the CLI share one source of truth for the per-ref orchestration. The CLI’s commands::fetch::fetch_one is now a thin wrapper that delegates here and adds the human-facing stderr print line. Dry-run preview helpers live as fetch_paper_plan and batch_fetch_plans.

Structs§

BatchOutcome
Outcome of a successful batch_fetch call.
BatchResultEntry
Per-ref outcome carried inside BatchOutcome::results.
FetchPaperOutcome
What fetch_paper wrote to disk and how.
MetadataOnlyOutcome
Outcome of a successful metadata_only call.

Enums§

PdfLegStatus
Outcome of a successful fetch_paper call.

Functions§

batch_fetch
Iterate over refs through fetch_paper, collecting one BatchResultEntry per ref.
batch_fetch_plans
Dry-run preview for a batch — one FetchPlan per ref. Enforces the same MAX_BATCH_REFS cap batch_fetch does.
fetch_paper
Resolve a Ref to a PDF (or metadata-only fallback) and write it through store.
fetch_paper_plan
Build the dry-run preview (FetchPlan) for a single ref without touching the network, store, or provenance log. Thin re-export of crate::dry_run::build_fetch_plan under the slice-2 naming the MCP tool surfaces use; kept here so the MCP doiget_fetch_paper tool method does not have to reach across two modules.
metadata_only
Resolve a Ref to metadata WITHOUT triggering a publisher PDF fetch.
metadata_only_to_store
Resolve a Ref to metadata and persist the metadata TOML to the store — the docs/MCP_TOOLS.md §11 doiget_metadata_only SIDE EFFECT (#139).
resolve_only
Resolve a Ref to metadata with no local persistence.
try_fetch_paper_plan
Fallible sibling of fetch_paper_plan — propagates an internal allowlist-contract drift as a typed FetchError::SourceSchema instead of degrading to an empty candidate_hosts list (issue #156 ②). Thin re-export of crate::dry_run::try_build_fetch_plan. Added alongside the infallible fetch_paper_plan rather than changing its signature, because fetch_paper_plan is pub and called from doiget-mcp, which is out of scope for this batch.