infrastructure tier

infrastructure-web-wayback-archive

Wayback Machine / CDX API client implementing foundation-web-analysis::Analyzer -- historical snapshot summary (site age, redesign detection, change-frequency estimate) from web.archive.org's CDX index

Wayback Machine / CDX API client implementing foundation-web-analysis::Analyzer -- historical snapshot summary (site age, redesign detection, change-frequency estimate) from web.archive.org's CDX index

Tierinfrastructure
Roleunclassified (baselined)
Pathcrates/infrastructure/web-wayback-archive
Edition2021
Targetsinfrastructure_web_wayback_archive
Public items27 across 2 modules
Tests39

What it is for

# infrastructure-web-wayback-archive

Wayback Machine / CDX API client analyzer implementing foundation_web_analysis::Analyzer. Queries web.archive.org's CDX index for every known historical snapshot of a URL and derives a summary: site age, activity by year, estimated redesign dates, content-change frequency, and the set of distinct historical URLs observed.

Lifted from plumber/src/analyzers/wayback.rs and plumber/src/models/historical_data.rs (sprint 3.46, wave 3 -- see CHANGELOG.md for provenance).

Capabilities

analyzer (other)

Wayback Machine / CDX API historical-snapshot analyzer.

Item
pub const DEFAULT_MAX_BYTES: usize
pub const DEFAULT_CDX_DELAY: Duration

WaybackArchiveAnalyzer

Wayback Machine / CDX API historical-snapshot analyzer.

Item
pub struct WaybackArchiveAnalyzer
WaybackArchiveAnalyzer :: fn new() -> std::result::Result <Self, infrastructure_fetcher::SafeHttpError>
WaybackArchiveAnalyzer :: fn with_max_bytes(mut self, max_bytes : usize) -> Self
WaybackArchiveAnalyzer :: fn with_cdx_delay(mut self, delay : Duration) -> Self
WaybackArchiveAnalyzer :: fn default() -> Self
WaybackArchiveAnalyzer :: fn name(& self) -> & 'static str
WaybackArchiveAnalyzer :: async fn analyze(& self, organization_id : Uuid, website_url : & str) -> Result <AnalysisResult>
WaybackArchiveAnalyzer :: fn cache_ttl_days(& self) -> u32

CdxRecord

Historical-snapshot data model.

Item
pub struct CdxRecord
CdxRecord :: fn from_json_array(arr : & serde_json::Value) -> Option <Self>
CdxRecord :: fn parsed_timestamp(& self) -> Option <DateTime <Utc>>
CdxRecord :: fn to_snapshot(& self, organization_id : Uuid) -> Option <WaybackSnapshot>

ChangeFrequency

Historical-snapshot data model.

Item
pub enum ChangeFrequency
ChangeFrequency :: fn fmt(& self, f : & mut std::fmt::Formatter <'_>) -> std::fmt::Result

HistoricalSummary

Historical-snapshot data model.

Item
pub struct HistoricalSummary
HistoricalSummary :: fn default() -> Self
HistoricalSummary :: fn new(organization_id : Uuid, domain : & str) -> Self
HistoricalSummary :: fn site_age_years(& self) -> Option <f32>
HistoricalSummary :: fn is_established(& self) -> bool
HistoricalSummary :: fn recently_redesigned(& self) -> bool

TechHistoryEntry

Historical-snapshot data model.

Item
pub struct TechHistoryEntry

WaybackSnapshot

Historical-snapshot data model.

Item
pub struct WaybackSnapshot
WaybackSnapshot :: fn default() -> Self
WaybackSnapshot :: fn new(organization_id : Uuid, original_url : & str, archive_url : & str, timestamp : DateTime <Utc>,) -> Self
WaybackSnapshot :: fn wayback_url(& self) -> String

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_wayback_archive

flowchart TD
  n_infrastructure_web_wayback_archive["infrastructure_web_wayback_archive"]
  n_infrastructure_web_wayback_archive --> n_analyzer["analyzer"]
  n_infrastructure_web_wayback_archive --> n_models["models"]

Public surface

`analyzer`

ItemWhat it is
pub const DEFAULT_MAX_BYTES: usizeResponse body byte cap for a CDX API query (Gate 1.5.6 input limit)
pub const DEFAULT_CDX_DELAY: DurationCourtesy delay between successive CDX API calls -- be respectful to the Internet Archive's free public index, matching the source's own WAYBACK_DELAY.
pub struct WaybackArchiveAnalyzerAnalyzer for a website's historical presence in the Wayback Machine, via the CDX API (web.archive.org/cdx/search/cdx)
WaybackArchiveAnalyzer :: fn new() -> std::result::Result <Self, infrastructure_fetcher::SafeHttpError>Build an analyzer with the default byte cap (DEFAULT_MAX_BYTES), timeout (infrastructure_fetcher::safe_http::DEFAULT_TIMEOUT, 30s), and CDX courtesy delay (DEFAULT_CDX_DELAY, 500ms).
WaybackArchiveAnalyzer :: fn with_max_bytes(mut self, max_bytes : usize) -> SelfOverride the response body byte cap.
WaybackArchiveAnalyzer :: fn with_cdx_delay(mut self, delay : Duration) -> SelfOverride the courtesy delay between CDX API calls (test-only escape hatch so a two-call analyze() test isn't slowed by the production default -- matches DomainIntelAnalyzer::with_geo_delay).
WaybackArchiveAnalyzer :: fn default() -> Self# Panics Panics if the underlying SafeHttpClient cannot be built (TLS backend init failure) -- matches the source's expect-on-construction posture (Client::builder()...expect("Failed to build HTTP client")) and TechDetector/AdaChecker's same deviation.
WaybackArchiveAnalyzer :: fn name(& self) -> & 'static str
WaybackArchiveAnalyzer :: async fn analyze(& self, organization_id : Uuid, website_url : & str) -> Result <AnalysisResult>
WaybackArchiveAnalyzer :: fn cache_ttl_days(& self) -> u32

`models`

ItemWhat it is
pub struct WaybackSnapshotA single Wayback Machine snapshot of a URL.
WaybackSnapshot :: fn default() -> Self
WaybackSnapshot :: fn new(organization_id : Uuid, original_url : & str, archive_url : & str, timestamp : DateTime <Utc>,) -> Self
WaybackSnapshot :: fn wayback_url(& self) -> StringFormat as a web.archive.org playback URL for this snapshot.
pub struct HistoricalSummarySummary of a website's historical presence in the Wayback Machine.
pub enum ChangeFrequencyHow often a site's content appears to change, estimated from unique CDX digests over the observed time span.
ChangeFrequency :: fn fmt(& self, f : & mut std::fmt::Formatter <'_>) -> std::fmt::Result
pub struct TechHistoryEntryOne historical technology-detection entry (CMS/framework as observed at a point in time)
HistoricalSummary :: fn default() -> Self
HistoricalSummary :: fn new(organization_id : Uuid, domain : & str) -> Self
HistoricalSummary :: fn site_age_years(& self) -> Option <f32>Site age in years, derived from site_age_days.
HistoricalSummary :: fn is_established(& self) -> booltrue when the site has more than 3 years of Wayback history.
HistoricalSummary :: fn recently_redesigned(& self) -> booltrue when the last detected redesign was within the last year.
pub struct CdxRecordOne row of the Wayback Machine CDX API's output=json response, in the field order requested by fl=urlkey,timestamp,original,mimetype, statuscode,digest,length.
CdxRecord :: fn from_json_array(arr : & serde_json::Value) -> Option <Self>Parse one row from the CDX API's JSON-array-of-arrays response shape
CdxRecord :: fn parsed_timestamp(& self) -> Option <DateTime <Utc>>Parse the CDX timestamp field (YYYYMMDDHHMMSS, UTC) into a DateTime<Utc>.
CdxRecord :: fn to_snapshot(& self, organization_id : Uuid) -> Option <WaybackSnapshot>Convert to a WaybackSnapshot

Re-exports. Exported here, defined elsewhere.

ExportDefined in
{CdxRecord,ChangeFrequency,HistoricalSummary,TechHistoryEntry,WaybackSnapshot,}models::{CdxRecord,ChangeFrequency,HistoricalSummary,TechHistoryEntry,WaybackSnapshot,}
{WaybackArchiveAnalyzer,DEFAULT_CDX_DELAY,DEFAULT_MAX_BYTES}analyzer::{WaybackArchiveAnalyzer,DEFAULT_CDX_DELAY,DEFAULT_MAX_BYTES}

Boundary

Reaches into foundation.

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-wayback-archive
Vocabulary in force (lexicon)current

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

flowchart LR
  n_infrastructure["infrastructure"] --> n_foundation["foundation"]

Dependencies

Runtime, in this workspace.

CrateTierOptionalOnly on
`foundation-web-analysis`foundationnoalways
`infrastructure-fetcher`infrastructurenoalways

Runtime, from outside the workspace.

CrateRequirementFeaturesOptionalOnly on
async-trait^0.1noalways
chrono^0.4serdenoalways
serde^1derivenoalways
serde_json^1noalways
thiserror^2noalways
tokio^1fullnoalways
url^2noalways
uuid^1v4, v7, serde, jsnoalways

Development, from outside the workspace.

CrateRequirementFeaturesOptionalOnly on
tokio^1full, full, test-utilnoalways
tokio-test^0.4noalways

Build. None.

Depended on by. Nothing in this workspace.

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

flowchart LR
  SELF["infrastructure-web-wayback-archive"]
  SELF -->|runtime| n_foundation_web_analysis["foundation-web-analysis"]
  SELF -->|runtime| n_infrastructure_fetcher["infrastructure-fetcher"]
  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_wayback_archive`src/lib.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 surfaceyes
async runtimeyes
database accessnone detected
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.

No workspace crate depends on this one.

Verification

KindCount
Unit tests39
Integration tests0
Examples0
Doctests0

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

ModuleTestsExamplesConsumers
analyzer300
models500

What the tests establish, by name:

Documentation coverage

MeasureDocumentedTotal
Public items with rustdoc1927
Public modules with a //! block22
pie showData
    title Public items with rustdoc
    "Documented" : 19
    "No rustdoc detected" : 8

Metrics

MetricValue
Rust source files3
Source lines1099
Code lines860
Public API items27
Public modules2
Tests39
Examples0
Cargo features0
Direct runtime dependencies10
Workspace reverse dependencies0
pie showData
    title Public API by kind
    "constant" : 2
    "enum" : 1
    "method" : 19
    "struct" : 5
pie showData
    title Rust source composition
    "Code" : 860
    "Blank or comment" : 239

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