infrastructure tier

infrastructure-web-ingest

Composed website-content ingester: fetch (infrastructure-fetcher -- SSRF-hardened, rate-limited, sha256-deduped, preserve-before-parse) -> decode/extract/chunk (infrastructure-html-text) -> transactional index (infrastructure-knowledge-index), with stored-artifact identity in the report for replay/re-extract without refetch. Non-goals (v1): crawling/link-following, JS rendering, robots.txt policy, PDF/media ingestion -- HTML only.

Composed website-content ingester: fetch (infrastructure-fetcher -- SSRF-hardened, rate-limited, sha256-deduped, preserve-before-parse) -> decode/extract/chunk (infrastructure-html-text) -> transactional index (infrastructure-knowledge-index), with stored-artifact identity in the report for replay/re-extract without refetch. Non-goals (v1): crawling/link-following, JS rendering, robots.txt policy, PDF/media ingestion -- HTML only.

Tierinfrastructure
Roleunclassified (baselined)
Pathcrates/infrastructure/web-ingest
Edition2021
Targetsinfrastructure_web_ingest, e2e_db, pipeline_offline, support
Public items10 across 2 modules
Tests21

What it is for

infrastructure-web-ingest -- composed website-content ingester.

Thin orchestration over five existing layer crates: infrastructure-fetcher (fetch, SSRF-hardened, rate-limited, sha256-deduped, content-addressed storage), infrastructure-html-text (decode/extract/chunk), and infrastructure-knowledge-index (transactional index write). See pipeline::ingest_url for the composed entry point and docs/userstories/sprint-3.24-web-ingest.md for the full design + Gate 1.5 consensus log.

Non-goals (v1)

is a different mechanism (frontier, politeness, dedup-at-scale) layered ON TOP of this, not inside it.

sites that need a real browser, but this crate does not select it -- FetchHints::html_page()'s ExecutorPreference::Auto may still promote to it on a bot-challenge retry, but no code here targets rendering.

v1 scope.

-- anything else is WebIngestError::NotHtml.

Concurrency contract

Two concurrent ingest_url calls for the SAME (tenant, corpus, source_ref) are last-write-wins: IndexService::index_doc's per-doc advisory lock (keyed by (tenant, corpus, source_ref)) plus its single transaction guarantee no torn write -- one call's full doc+chunks commit atomically before or after the other's, never interleaved. Neither call is told it lost the race; whichever committed last is what search sees until the next ingest. This is a deliberate v1 simplification (Gate 1.5 round 2, unanimous): a fetch-generation recheck is DEFERRED until a scheduled/concurrent ingester actually exists to need it. Self-healing: the next ingest_url call re-establishes the current state regardless of what a prior race left behind.

Capabilities

pipeline (other)

The composed pipeline: fetch -> decode/extract/chunk -> index.

Item
pub const SOURCE_KIND_WEBPAGE: & str
pub const DEFAULT_BYTE_CAP: u64
async fn ingest_url <E : KnowledgeEmbedder + ? Sized>(fetcher : & Fetcher, storage : & dyn StorageBackend, pool : & PgPool, embedder : & E, cfg : & WebIngestConfig, url : & Url,) -> Result <WebIngestReport, WebIngestError>

WebIngestConfig

The composed pipeline: fetch -> decode/extract/chunk -> index.

Item
pub struct WebIngestConfig
WebIngestConfig :: fn default() -> Self

WebIngestError

The composed pipeline: fetch -> decode/extract/chunk -> index.

Item
pub enum WebIngestError

WebIngestReport

The composed pipeline: fetch -> decode/extract/chunk -> index.

Item
pub struct WebIngestReport

TitleSource

Naming a fetched document (B-079).

Item
pub enum TitleSource
TitleSource :: const fn as_str(self) -> & 'static str
fn resolve_title(title : Option <& str>, og_title : Option <& str>, first_h1 : Option <& str>, final_url : & Url,) ->(String, TitleSource)

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

infrastructure_web_ingest

flowchart TD
  n_infrastructure_web_ingest["infrastructure_web_ingest"]
  n_infrastructure_web_ingest --> n_pipeline["pipeline"]
  n_infrastructure_web_ingest --> n_title["title"]

Public surface

`pipeline`

ItemWhat it is
pub const SOURCE_KIND_WEBPAGE: & strThe source_kind stamped on every doc this pipeline indexes.
pub const DEFAULT_BYTE_CAP: u64Default page byte cap (Gate 1.5.6 input limits): 8 MiB
pub struct WebIngestConfigPipeline configuration
WebIngestConfig :: fn default() -> Self
pub enum WebIngestErrorIngest-pipeline failures
pub struct WebIngestReportWhat one ingest_url call did
async fn ingest_url <E : KnowledgeEmbedder + ? Sized>(fetcher : & Fetcher, storage : & dyn StorageBackend, pool : & PgPool, embedder : & E, cfg : & WebIngestConfig, url : & Url,) -> Result <WebIngestReport, WebIngestError>Fetch, decode, extract, chunk, and index one URL

`title`

ItemWhat it is
pub enum TitleSourceWhich rule produced the stored title
TitleSource :: const fn as_str(self) -> & 'static strThe snake_case wire name, for front_matter and CLI output.
fn resolve_title(title : Option <& str>, og_title : Option <& str>, first_h1 : Option <& str>, final_url : & Url,) ->(String, TitleSource)Choose the stored title: <title> -> og:title -> first <h1> -> URL segment

Re-exports. Exported here, defined elsewhere.

ExportDefined in
{ingest_url,WebIngestConfig,WebIngestError,WebIngestReport,DEFAULT_BYTE_CAP,SOURCE_KIND_WEBPAGE,}pipeline::{ingest_url,WebIngestConfig,WebIngestError,WebIngestReport,DEFAULT_BYTE_CAP,SOURCE_KIND_WEBPAGE,}
{resolve_title,TitleSource}title::{resolve_title,TitleSource}

Boundary

Depends on no other workspace tier.

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/web-ingest
Vocabulary in force (lexicon)current

Dependencies

Runtime, in this workspace.

CrateTierOptionalOnly on
`infrastructure-embeddings`infrastructurenoalways
`infrastructure-fetcher`infrastructurenoalways
`infrastructure-html-text`infrastructurenoalways
`infrastructure-knowledge-index`infrastructurenoalways
`infrastructure-storage`infrastructurenoalways

Runtime, from outside the workspace.

CrateRequirementFeaturesOptionalOnly on
chrono^0.4serdenoalways
mime^0.3noalways
serde^1derive, derivenoalways
serde_json^1noalways
sqlx^0.8runtime-tokio, postgres, chrono, uuid, jsonnoalways
thiserror^2noalways
url^2noalways
uuid^1v4, v7, serde, js, v4, serdenoalways

Development, in this workspace.

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

Development, from outside the workspace.

CrateRequirementFeaturesOptionalOnly on
async-trait^0.1noalways
flate2^1noalways
http^1noalways
tempfile^3noalways
tokio^1full, macros, rt-multi-threadnoalways
wiremock^0.6noalways

Build. None.

Depended on by. 1 workspace crate.

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

flowchart LR
  n_application_wiki["application-wiki"] -->|uses| SELF
  SELF["infrastructure-web-ingest"]
  SELF -->|development| n_infrastructure_fetcher["infrastructure-fetcher"]
  SELF -->|development| n_operations_rate_limit["operations-rate-limit"]
  SELF -->|runtime| n_infrastructure_embeddings["infrastructure-embeddings"]
  SELF -->|runtime| n_infrastructure_fetcher["infrastructure-fetcher"]
  SELF -->|runtime| n_infrastructure_html_text["infrastructure-html-text"]
  SELF -->|runtime| n_infrastructure_knowledge_index["infrastructure-knowledge-index"]
  SELF -->|runtime| n_infrastructure_storage["infrastructure-storage"]
  classDef self fill:#1f883d,stroke:#1f883d,color:#fff;
  class SELF self;

Feature flags

No Cargo features are defined: every capability is unconditional, so no consumer can receive a half-wired crate.

Targets

KindNameSource
libinfrastructure_web_ingest`src/lib.rs`
teste2e_db`tests/e2e_db.rs`
testpipeline_offline`tests/pipeline_offline.rs`
testsupport`tests/support.rs`

Error model

Error typeNamed by
WebIngestErroringest_url

Operational characteristics

PropertyEvidence
async public surfaceyes
async runtimenone detected
database accessyes
network I/Onone detected
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.

1 workspace crate depends on this one: application-wiki.

Verification

KindCount
Unit tests13
Integration tests8
Examples0
Doctests0

Evidence by module. How often each public module is named by something executable.

ModuleTestsExamplesConsumers
pipeline605
title200

What the tests establish, by name:

Documentation coverage

MeasureDocumentedTotal
Public items with rustdoc910
Public modules with a //! block22
pie showData
    title Public items with rustdoc
    "Documented" : 9
    "No rustdoc detected" : 1

Metrics

MetricValue
Rust source files3
Source lines671
Code lines390
Public API items10
Public modules2
Tests21
Examples0
Cargo features0
Direct runtime dependencies13
Workspace reverse dependencies1
pie showData
    title Public API by kind
    "constant" : 2
    "enum" : 2
    "function" : 2
    "method" : 2
    "struct" : 2
pie showData
    title Rust source composition
    "Code" : 390
    "Blank or comment" : 281

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.

All infrastructure · Manual