Industry-agnostic website analysis trait and types for multi-analyzer composition
| Tier | foundation |
| Role | unclassified (baselined) |
| Path | crates/foundation/web-analysis |
| Edition | 2021 |
| Targets | foundation_web_analysis |
| Public items | 21 across 3 modules |
| Tests | 20 |
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
Analyzer— trait for implementing website analyzersAnalysisResult— result of a single analyzer runAnalysisStatus— outcome status of an analysisManualReviewItem— findings that require human reviewComprehensiveAnalysis— aggregates results from multiple analyzers
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
analyzererrortypes
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`
| Item | What it is |
|---|---|
pub trait Analyzer | Trait for all website analyzers Implementors analyze an organization's website and return structured results |
`error`
| Item | What it is |
|---|---|
pub type Result<T>: std::result::Result <T, AnalysisError> | Result type for web analysis operations. |
pub enum AnalysisError | Errors that can occur during website analysis. |
`types`
| Item | What it is |
|---|---|
pub struct AnalysisResult | Result of running an analyzer against an organization's website |
pub enum AnalysisStatus | — |
pub struct ManualReviewItem | Item flagged for human review |
pub enum ReviewCategory | Category 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 ComprehensiveAnalysis | Aggregates 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.
| Export | Defined in |
|---|---|
AnalysisError | error::AnalysisError |
Analyzer | analyzer::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) |
| Location | crates/foundation/web-analysis |
| Vocabulary in force (lexicon) | current |
Dependencies
Runtime, from outside the workspace.
| Crate | Requirement | Features | Optional | Only on |
|---|---|---|---|---|
async-trait | ^0.1 | — | no | always |
chrono | ^0.4 | serde | no | always |
serde | ^1 | derive | no | always |
serde_json | ^1 | — | no | always |
thiserror | ^2 | — | no | always |
uuid | ^1 | v4, v7, serde, js | no | always |
Development, from outside the workspace.
| Crate | Requirement | Features | Optional | Only on |
|---|---|---|---|---|
tokio | ^1 | full | no | always |
tokio-test | ^0.4 | — | no | always |
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
| Kind | Name | Source |
|---|---|---|
| lib | foundation_web_analysis | `src/lib.rs` |
Error model
| Error type | Named by |
|---|---|
AnalysisError | Result |
Operational characteristics
| Property | Evidence |
|---|---|
| async public surface | none detected |
| async runtime | none detected |
| database access | none detected |
| network I/O | none detected |
| unsafe code | none detected |
| environment variables | none 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.
Related capabilities
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
| Kind | Count |
|---|---|
| Unit tests | 20 |
| Integration tests | 0 |
| Examples | 0 |
| Doctests | 0 |
Evidence by module. How often each public module is named by something executable.
| Module | Tests | Examples | Consumers |
|---|---|---|---|
analyzer | 1 | 0 | 9 |
error | 2 | 0 | 17 |
types | 6 | 0 | 26 |
What the tests establish, by name:
test_analysis_result_add_error—src/lib.rstest_analysis_result_add_manual_review—src/lib.rstest_analysis_result_add_warning—src/lib.rstest_analysis_result_creation—src/lib.rstest_analysis_result_fail—src/lib.rstest_analysis_result_serialization—src/lib.rstest_analysis_result_with_data—src/lib.rstest_analysis_status_default—src/lib.rstest_analyzer_trait_implementation—src/lib.rstest_comprehensive_analysis_add_failed_result—src/lib.rstest_comprehensive_analysis_add_successful_result—src/lib.rstest_comprehensive_analysis_all_failed_results—src/lib.rstest_comprehensive_analysis_all_manual_review_items—src/lib.rstest_comprehensive_analysis_creation—src/lib.rstest_comprehensive_analysis_has_errors—src/lib.rstest_comprehensive_analysis_serialization—src/lib.rstest_review_priority_ordering—src/lib.rsreview_category_other_carries_consumer_owned_tag—src/types.rsreview_category_other_equality_is_by_tag_value—src/types.rsreview_category_variant_set_is_generic_only—src/types.rs
Documentation coverage
| Measure | Documented | Total |
|---|---|---|
| Public items with rustdoc | 7 | 21 |
Public modules with a //! block | 2 | 3 |
pie showData
title Public items with rustdoc
"Documented" : 7
"No rustdoc detected" : 14
Metrics
| Metric | Value |
|---|---|
| Rust source files | 4 |
| Source lines | 586 |
| Code lines | 407 |
| Public API items | 21 |
| Public modules | 3 |
| Tests | 20 |
| Examples | 0 |
| Cargo features | 0 |
| Direct runtime dependencies | 6 |
| Workspace reverse dependencies | 9 |
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.