infrastructure capa

infrastructure-fetcher

Content-addressed URL fetcher with sha256 dedup, per-host rate limits, and reqwest→bridge executor fallback

Content-addressed URL fetcher with sha256 dedup, per-host rate limits, and reqwest→bridge executor fallback

Tierinfrastructure
Roleunclassified (baselined)
Pathcrates/infrastructure/fetcher
Edition2021
Targetsinfrastructure_fetcher, httpbin, safe_http_integration
Public items0 across 0 modules
Tests124

What it is for

infrastructure-fetcher: content-addressed URL fetching with scope-enforced dedup.

Given a URL and routing/validation hints, Fetcher drives an executor stack (reqwest → bridge → …), content-addresses the response by sha256, respects per-host rate limits, and writes the bytes to infrastructure_storage exactly once per (scope, content) pair.

Layer

Infrastructure. Depends on infrastructure_storage and operations_rate_limit.

Key types

See docs/userstories/sprint-0.1-fetcher.md for the full spec + Gate 1.5 consensus log.

Capabilities

No public items.

How to use it

No examples/ target and no doctest in this crate's rustdoc. The tests listed under Verification are the closest executable usage.

Module structure

No public modules: the crate root is its whole surface.

Public surface

No public items.

Re-exports. Exported here, defined elsewhere.

ExportDefined in
BridgeExecutorexecutors::bridge::BridgeExecutor
Fetcherfetcher::Fetcher
FetcherBuilderbuilder::FetcherBuilder
ReqwestExecutorexecutors::reqwest::ReqwestExecutor
TenantScopedFetchertenant_scoped::TenantScopedFetcher
{AttemptOutcome,AutoFallbackSelector,ExecutorSelector,SelectionContext,SelectionPlan,}selector::{AttemptOutcome,AutoFallbackSelector,ExecutorSelector,SelectionContext,SelectionPlan,}
{Executor,ExecutorResponse}executor::{Executor,ExecutorResponse}
{ExecutorError,FetchError,FetcherBuildError,NetworkError}errors::{ExecutorError,FetchError,FetcherBuildError,NetworkError}
{ExecutorKind,FetchOutcome,FetchStatus}outcome::{ExecutorKind,FetchOutcome,FetchStatus}
{ExecutorPreference,FetchHints,RateLimitScope,ResponseMeta,RoutingHints,TargetKind,ValidationPolicy,}hints::{ExecutorPreference,FetchHints,RateLimitScope,ResponseMeta,RoutingHints,TargetKind,ValidationPolicy,}
{is_safe_ip,is_safe_url,SsrfError}netguard::{is_safe_ip,is_safe_url,SsrfError}
{read_body_capped,InternalEndpoints,InternalHttpClientBuilder,SafeHttpClient,SafeHttpClientBuilder,SafeHttpError,DEFAULT_MAX_REDIRECTS,DEFAULT_TIMEOUT,}safe_http::{read_body_capped,InternalEndpoints,InternalHttpClientBuilder,SafeHttpClient,SafeHttpClientBuilder,SafeHttpError,DEFAULT_MAX_REDIRECTS,DEFAULT_TIMEOUT,}

Boundary

Reaches into operations.

Shares tier infrastructure with 82 other crates: infrastructure-acquire, infrastructure-adapters-google-calendar, infrastructure-adapters-google-gmail, infrastructure-adapters-google-places, infrastructure-adapters-google-trends, infrastructure-adapters-shodan, infrastructure-adapters-yelp, infrastructure-agent, … (82 total).

_What this crate deliberately does NOT own is a judgment. No committed registry records one for it, so none is stated here._

Where it sits

Tier (ontology)infrastructure
Architectural role (taxonomy)unclassified (baselined)
Locationcrates/infrastructure/fetcher
Vocabulary in force (lexicon)current

Tier flow. Which tiers this crate's own edges cross.

flowchart LR
  n_infrastructure["infrastructure"] --> n_operations["operations"]

Dependencies

Runtime, in this workspace.

CrateTierOptionalOnly on
`infrastructure-storage`infrastructurenoalways
`operations-rate-limit`operationsnoalways

Runtime, from outside the workspace.

CrateRequirementFeaturesOptionalOnly on
async-trait^0.1noalways
bytes^1noalways
chrono^0.4serdenoalways
futures-util^0.3noalways
hex^0.4noalways
http^1noalways
mime^0.3noalways
reqwest^0.12json, rustls-tls, streamnoalways
serde^1derivenoalways
serde_json^1noalways
sha2^0.10noalways
thiserror^2noalways
tokio^1full, fs, net, syncnoalways
tracing^0.1noalways
url^2noalways
uuid^1v4, v7, serde, jsnoalways

Development, from outside the workspace.

CrateRequirementFeaturesOptionalOnly on
reqwest^0.12gzipnoalways
tempfile^3noalways
tokio^1full, full, test-utilnoalways
wiremock^0.6noalways

Build. None.

Depended on by. 29 workspace crates.

Signal flow — what reaches this crate, and what it reaches.

flowchart LR
  consumers["29 consumer crates"] -->|uses| SELF
  SELF["infrastructure-fetcher"]
  SELF -->|runtime| runtime_deps["2 workspace crates"]
  classDef self fill:#1f883d,stroke:#1f883d,color:#fff;
  class SELF self;

Feature flags

FeatureEnablesOn by default
test-utilno
flowchart LR
  n_test_util["test-util"]

Targets

KindNameSource
libinfrastructure_fetcher`src/lib.rs`
testhttpbin`tests/httpbin.rs`
testsafe_http_integration`tests/safe_http_integration.rs`

Error model

No public error type was detected: no public item declares a type named *Error, and no public signature returns one.

Operational characteristics

PropertyEvidence
async public surfacenone detected
async runtimeyes
database accessnone detected
network I/Oyes
unsafe codenone detected
environment variablesnone detected

No unsafe block, unsafe fn, unsafe impl or unsafe trait was found by the parser anywhere in this crate's source.

Configuration

No environment variable is read with a literal name anywhere in this crate. A variable whose key is computed at run time cannot be listed here, and is not claimed to be absent.

29 workspace crates depend on this one: application-fetcher, application-party-discovery, application-wiki, content-assets, infrastructure-acquire, infrastructure-adapters-google-gmail, infrastructure-adapters-google-places, infrastructure-adapters-google-trends, infrastructure-adapters-shodan, infrastructure-adapters-yelp, infrastructure-agent, infrastructure-ai, … (29 total).

Verification

KindCount
Unit tests114
Integration tests10
Examples0
Doctests0

What the tests establish, by name:

Documentation coverage

MeasureDocumentedTotal
Public items with rustdoc00
Public modules with a //! block00

Metrics

MetricValue
Rust source files15
Source lines4304
Code lines3010
Public API items0
Public modules0
Tests124
Examples0
Cargo features1
Direct runtime dependencies18
Workspace reverse dependencies29
pie showData
    title Rust source composition
    "Code" : 3010
    "Blank or comment" : 1294

Generation

Rendered by tools-corpus corpus readme from repository evidence alone, renderer schema 2, lexicon current. No model, network service or database was consulted. Regenerate with tools-corpus corpus readme --write; verify with --check.

Todas las infrastructure · Manual