Skip to main content

Crate doiget_core

Crate doiget_core 

Source
Expand description

§doiget-core

Core library for doiget: an Open Access first paper-fetcher with strict capability gating, fail-closed provenance logging, and a BiblioFetch.jl-compatible store layout.

Phase 0 ships only this skeleton. Real implementations land in Phase 1. See docs/PUBLIC_API.md for the semver-locked surface and docs/ARCHITECTURE.md for the high-level design.

Re-exports§

pub use crate::canonical::CanonicalRef;
pub use crate::canonical::SourceType;

Modules§

canonical
Canonical-tuple audit identity for fetched papers (ADR-0021 §1, ADR-0024).
dry_run
Dry-run preview shape for --dry-run CLI fetches and the doiget_metadata_only / doiget_fetch_paper MCP tools.
http
Centralized HTTP client wrapper. All Source impls fetch through here.
orchestrator
Cross-source orchestrators that compose multiple Source impls into a single user-facing operation.
provenance
JSON Lines + SHA-256 hash-chained provenance log.
rate_limiter
Process-wide rate limiter for HTTP fetches across all Source impls.
refs
Bibliography input adapters per ADR-0030.
source
Source abstraction. Each Tier 1/2/3 fetcher implements this trait.
sources
Source implementations.
store
Filesystem-backed metadata store.
user_extension
User-extensible capability gate (ADR-0028, #220).

Structs§

AlwaysOn
Marker for the always-on Open Access tier. See docs/CAPABILITY.md.
ArxivId
A validated arXiv id string.
CapabilityProfile
Runtime gate for which sources may be invoked. See docs/CAPABILITY.md.
DenialContext
Structured machine-parseable companion to error.message for recoverable denials.
Doi
A validated DOI string.
MetadataAccess
Which Tier 2 metadata sources are enabled this session. See docs/CAPABILITY.md.
RateLimits
Process-wide rate limits. Hard-coded; not configurable.
Safekey
A filesystem-safe key derived deterministically from a Ref.
TdmGrant
A successful TDM grant.

Enums§

CapabilityError
Errors that can arise during CapabilityProfile::from_env.
DenialReason
Closed-set reasons a denial-class error envelope can carry on its optional denial_context.reason field.
ErrorCode
The closed set of error codes doiget surfaces.
Ref
A reference to a paper, either by DOI or arXiv id.
RefParseError
Reasons a Doi::parse / ArxivId::parse / Ref::parse call can fail.

Constants§

CITATION_CACHE_TTL_DAYS
Time-to-live for entries in ~/.cache/doiget/citations/. See docs/CACHE.md §3.
DOI_SUFFIX_MAX_LEN
Maximum DOI suffix length accepted at validation. See docs/SECURITY.md §1.1.
MAX_BATCH_REFS
Slice 2 alias for MCP_BATCH_MAX_SIZE using the spec-language name (docs/MCP_TOOLS.md §1 / Slice 2 plan). The numeric value MUST equal MCP_BATCH_MAX_SIZE; an internal test pins the equivalence so the two constants cannot drift.
MAX_CONCURRENT_FETCHES
Hard-coded rate limit. See docs/LEGAL.md §6 safeguard 8.
MAX_FETCHES_PER_SECOND
Hard-coded rate limit. See docs/LEGAL.md §6 safeguard 8.
MCP_BATCH_MAX_SIZE
Maximum batch size for doiget batch and doiget_batch_fetch.
MCP_QUEUE_DEPTH_MAX
Maximum queued MCP requests beyond MAX_CONCURRENT_FETCHES. Excess returns ErrorCode::RateLimited. See docs/SECURITY.md §1.4 / docs/MCP_TOOLS.md.
MCP_STDIN_EOF_SHUTDOWN_SEC
MCP server stdin-EOF graceful-shutdown deadline, in seconds. See ADR-0001 and docs/MCP_TOOLS.md §8.
PDF_MAX_BYTES
Maximum PDF body size accepted by the fetcher, in bytes. See docs/SECURITY.md §1.2 (Oversized PDF).
RESOLVER_CACHE_TTL_DAYS
Time-to-live for entries in ~/.cache/doiget/resolver/. See docs/CACHE.md §3.
SCHEMA_VERSION
TOML schema version this build writes. See docs/STORE.md §3.
VERSION
Crate version. Used by doiget-cli --version and doiget_health.