foundation tier

foundation-web-analysis

Industry-agnostic website analysis trait and types for multi-analyzer composition

Industry-agnostic website analysis trait and types for multi-analyzer composition

Tierfoundation
Roleunclassified (baselined)
Pathcrates/foundation/web-analysis
Edition2021
Targetsfoundation_web_analysis
Public items21 across 3 modules
Tests20

What it is for

# foundation-web-analysis

Industry-agnostic website analysis trait and types for multi-analyzer composition.

This crate provides the core abstraction for analyzing websites, extracted from plumber's proven analyzer trait pattern. The Analyzer trait is completely industry-agnostic: it takes only an opaque organization ID and a URL, making it reusable across any domain that needs website analysis.

Core Types

Usage

use foundation_web_analysis::{Analyzer, AnalysisResult};
use uuid::Uuid;

struct MyAnalyzer;

#async_trait::async_trait
impl Analyzer for MyAnalyzer {
fn name(&self) -> &'static str {
"my-analyzer"
}

async fn analyze(&self, org_id: Uuid, url: &str) -> foundation_web_analysis::error::Result<AnalysisResult> {
let mut result = AnalysisResult::new(org_id, self.name());
// ... perform analysis ...
Ok(result.complete())
}
}

Capabilities

Analyzer

Analyzer trait for website analysis operations.

Item
pub trait Analyzer

AnalysisError

Error types for web analysis operations.

Item
pub enum AnalysisError

Result

Error types for web analysis operations.

Item
pub type Result<T>: std::result::Result <T, AnalysisError>

AnalysisResult

_No module-level documentation is present in the source._

Item
pub struct AnalysisResult
AnalysisResult :: fn new(organization_id : Uuid, analyzer_name : & str) -> Self
AnalysisResult :: fn with_data <T : Serialize>(mut self, data : T) -> Result <Self, serde_json::Error>
AnalysisResult :: fn add_error(& mut self, error : impl Into <String>)
AnalysisResult :: fn add_warning(& mut self, warning : impl Into <String>)
AnalysisResult :: fn add_manual_review(& mut self, item : ManualReviewItem)
AnalysisResult :: fn fail(mut self, error : impl Into <String>) -> Self
AnalysisResult :: fn complete(mut self) -> Self

AnalysisStatus

_No module-level documentation is present in the source._

Item
pub enum AnalysisStatus

ComprehensiveAnalysis

_No module-level documentation is present in the source._

Item
pub struct ComprehensiveAnalysis
ComprehensiveAnalysis :: fn new(organization_id : Uuid, website_url : & str) -> Self
ComprehensiveAnalysis :: fn add_result(& mut self, result : AnalysisResult)
ComprehensiveAnalysis :: fn complete(mut self) -> Self
ComprehensiveAnalysis :: fn all_manual_review_items(& self) -> Vec <& ManualReviewItem>
ComprehensiveAnalysis :: fn has_errors(& self) -> bool

ManualReviewItem

_No module-level documentation is present in the source._

Item
pub struct ManualReviewItem

ReviewCategory

_No module-level documentation is present in the source._

Item
pub enum ReviewCategory

ReviewPriority

_No module-level documentation is present in the source._

Item
pub enum ReviewPriority

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

foundation_web_analysis

flowchart TD
  n_foundation_web_analysis["foundation_web_analysis"]
  n_foundation_web_analysis --> n_analyzer["analyzer"]
  n_foundation_web_analysis --> n_error["error"]
  n_foundation_web_analysis --> n_types["types"]

Public surface

`analyzer`

ItemWhat it is
pub trait AnalyzerTrait for all website analyzers Implementors analyze an organization's website and return structured results

`error`

ItemWhat it is
pub type Result<T>: std::result::Result <T, AnalysisError>Result type for web analysis operations.
pub enum AnalysisErrorErrors that can occur during website analysis.

`types`

ItemWhat it is
pub struct AnalysisResultResult of running an analyzer against an organization's website
pub enum AnalysisStatus
pub struct ManualReviewItemItem flagged for human review
pub enum ReviewCategoryCategory of a ManualReviewItem
pub enum ReviewPriority
AnalysisResult :: fn new(organization_id : Uuid, analyzer_name : & str) -> Self
AnalysisResult :: fn with_data <T : Serialize>(mut self, data : T) -> Result <Self, serde_json::Error>
AnalysisResult :: fn add_error(& mut self, error : impl Into <String>)
AnalysisResult :: fn add_warning(& mut self, warning : impl Into <String>)
AnalysisResult :: fn add_manual_review(& mut self, item : ManualReviewItem)
AnalysisResult :: fn fail(mut self, error : impl Into <String>) -> Self
AnalysisResult :: fn complete(mut self) -> Self
pub struct ComprehensiveAnalysisAggregates results from multiple analyzers
ComprehensiveAnalysis :: fn new(organization_id : Uuid, website_url : & str) -> Self
ComprehensiveAnalysis :: fn add_result(& mut self, result : AnalysisResult)
ComprehensiveAnalysis :: fn complete(mut self) -> Self
ComprehensiveAnalysis :: fn all_manual_review_items(& self) -> Vec <& ManualReviewItem>
ComprehensiveAnalysis :: fn has_errors(& self) -> bool

Re-exports. Exported here, defined elsewhere.

ExportDefined in
AnalysisErrorerror::AnalysisError
Analyzeranalyzer::Analyzer
{AnalysisResult,AnalysisStatus,ComprehensiveAnalysis,ManualReviewItem,ReviewCategory,ReviewPriority,}types::{AnalysisResult,AnalysisStatus,ComprehensiveAnalysis,ManualReviewItem,ReviewCategory,ReviewPriority,}

Boundary

Depends on no other workspace tier.

Shares tier foundation with 27 other crates: foundation-audit-log, foundation-basemodels, foundation-bounded-io, foundation-conversation-closure, foundation-crypto-sign, foundation-decisioning, foundation-encounter-vocabulary, foundation-fs-metadata, … (27 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)foundation
Architectural role (taxonomy)unclassified (baselined)
Locationcrates/foundation/web-analysis
Vocabulary in force (lexicon)current

Dependencies

Runtime, from outside the workspace.

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

Development, from outside the workspace.

CrateRequirementFeaturesOptionalOnly on
tokio^1fullnoalways
tokio-test^0.4noalways

Build. None.

Depended on by. 9 workspace crates.

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

flowchart LR
  n_application_party_discovery["application-party-discovery"] -->|uses| SELF
  n_infrastructure_web_ada_compliance["infrastructure-web-ada-compliance"] -->|uses| SELF
  n_infrastructure_web_backlink_finder["infrastructure-web-backlink-finder"] -->|uses| SELF
  n_infrastructure_web_domain_intel["infrastructure-web-domain-intel"] -->|uses| SELF
  n_infrastructure_web_performance_analyzer["infrastructure-web-performance-analyzer"] -->|uses| SELF
  n_infrastructure_web_security_audit["infrastructure-web-security-audit"] -->|uses| SELF
  n_infrastructure_web_tech_detector["infrastructure-web-tech-detector"] -->|uses| SELF
  n_infrastructure_web_wayback_archive["infrastructure-web-wayback-archive"] -->|uses| SELF
  n_operations_link_graph["operations-link-graph"] -->|uses| SELF
  SELF["foundation-web-analysis"]
  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
libfoundation_web_analysis`src/lib.rs`

Error model

Error typeNamed by
AnalysisErrorResult

Operational characteristics

PropertyEvidence
async public surfacenone detected
async runtimenone detected
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.

9 workspace crates depend on this one: application-party-discovery, infrastructure-web-ada-compliance, infrastructure-web-backlink-finder, infrastructure-web-domain-intel, infrastructure-web-performance-analyzer, infrastructure-web-security-audit, infrastructure-web-tech-detector, infrastructure-web-wayback-archive, operations-link-graph.

Verification

KindCount
Unit tests20
Integration tests0
Examples0
Doctests0

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

ModuleTestsExamplesConsumers
analyzer109
error2017
types6026

What the tests establish, by name:

Documentation coverage

MeasureDocumentedTotal
Public items with rustdoc721
Public modules with a //! block23
pie showData
    title Public items with rustdoc
    "Documented" : 7
    "No rustdoc detected" : 14

Metrics

MetricValue
Rust source files4
Source lines586
Code lines407
Public API items21
Public modules3
Tests20
Examples0
Cargo features0
Direct runtime dependencies6
Workspace reverse dependencies9
pie showData
    title Public API by kind
    "enum" : 4
    "method" : 12
    "struct" : 3
    "trait" : 1
    "type alias" : 1
pie showData
    title Rust source composition
    "Code" : 407
    "Blank or comment" : 179

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 foundation · Manual