_No description in Cargo.toml._
| Tier | operations |
| Role | unclassified (baselined) |
| Path | crates/operations/assessments |
| Edition | 2021 |
| Targets | operations_assessments |
| Public items | 0 across 0 modules |
| Tests | 34 |
What it is for
Library crates for audit/evaluation assessments.
This crate provides reusable types for storing and tracking assessments across different domains: security scans, compliance audits, performance checks, accessibility evaluations, and more.
# Features
- Assessment workflow: Pending -> InProgress -> Completed/Failed/Cancelled
- Findings with severity: Track individual issues discovered during assessments
- Cached summaries: Pre-aggregated statistics for quick dashboard access
- Entity-agnostic: Attach assessments to any entity via EntityRef pattern
- Domain events: Integration points for notifications and external systems
# Example
use operations_assessments::{Assessment, Finding, Severity, AssessmentStatus, HasId};
use uuid::Uuid;
// Create and run an assessment
let entity_id = Uuid::new_v4();
let mut assessment = Assessment::new(
Uuid::new_v4(),
"website",
entity_id,
"security",
);
// Start the assessment
assessment.start().unwrap();
assert_eq!(assessment.status, AssessmentStatus::InProgress);
// Create findings
let finding = Finding::new(
Uuid::new_v4(),
assessment.id(),
Severity::High,
"ssl",
"Missing HSTS header",
"The server does not return a Strict-Transport-Security header",
)
.with_recommendation("Add HSTS header with max-age of at least 1 year");
// Complete the assessment with a score
assessment.complete(Some(75)).unwrap();
assert_eq!(assessment.status, AssessmentStatus::Completed);
assert_eq!(assessment.overall_score, Some(75));
# Database Schema
The migration in migrations/001_assessments_init.sql creates:
assessments- Main assessment recordsfindings- Individual issues found during assessmentsassessment_summaries- Cached aggregate statistics
# Repository Pattern
Implement AssessmentRepository for your storage backend:
use operations_assessments::{AssessmentRepository, Assessment};
struct MyRepository { /* ... */ }
#async_trait
impl AssessmentRepository for MyRepository {
async fn create_assessment(&self, assessment: &Assessment) -> Result<()> {
// Your implementation
Ok(())
}
// ... other methods
}
Capabilities
No public items.
How to use it
From this crate's own rustdoc:
use operations_assessments::{Assessment, Finding, Severity, AssessmentStatus, HasId};
use uuid::Uuid;
// Create and run an assessment
let entity_id = Uuid::new_v4();
let mut assessment = Assessment::new(
Uuid::new_v4(),
"website",
entity_id,
"security",
);
// Start the assessment
assessment.start().unwrap();
assert_eq!(assessment.status, AssessmentStatus::InProgress);
// Create findings
let finding = Finding::new(
Uuid::new_v4(),
assessment.id(),
Severity::High,
"ssl",
"Missing HSTS header",
"The server does not return a Strict-Transport-Security header",
)
.with_recommendation("Add HSTS header with max-age of at least 1 year");
// Complete the assessment with a score
assessment.complete(Some(75)).unwrap();
assert_eq!(assessment.status, AssessmentStatus::Completed);
assert_eq!(assessment.overall_score, Some(75));
From this crate's own rustdoc:
use operations_assessments::{AssessmentRepository, Assessment};
struct MyRepository { /* ... */ }
#[async_trait]
impl AssessmentRepository for MyRepository {
async fn create_assessment(&self, assessment: &Assessment) -> Result<()> {
// Your implementation
Ok(())
}
// ... other methods
}
Module structure
No public modules: the crate root is its whole surface.
Public surface
No public items.
Re-exports. Exported here, defined elsewhere.
| Export | Defined in |
|---|---|
AssessmentEvent | events::AssessmentEvent |
Uuid | uuid::Uuid |
{Assessment,AssessmentListQuery,AssessmentStatus,AssessmentSummary,CreateAssessmentInput,CreateFindingInput,Finding,FindingStatus,Severity,} | models::{Assessment,AssessmentListQuery,AssessmentStatus,AssessmentSummary,CreateAssessmentInput,CreateFindingInput,Finding,FindingStatus,Severity,} |
{AssessmentError,Result} | error::{AssessmentError,Result} |
{AssessmentRepository,AssessmentRepositoryExt} | repository::{AssessmentRepository,AssessmentRepositoryExt} |
{HasId,SoftDeletable,Timestamped} | foundation_basemodels::{HasId,SoftDeletable,Timestamped} |
Boundary
Reaches into foundation.
Shares tier operations with 40 other crates: operations-approval-workflow, operations-block-imaging, operations-boot-media, operations-browser-agent-worker, operations-camera-discovery, operations-camera-liveview, operations-camera-registry, operations-compliance, … (40 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) | operations |
| Architectural role (taxonomy) | unclassified (baselined) |
| Location | crates/operations/assessments |
| Vocabulary in force (lexicon) | current |
Tier flow. Which tiers this crate's own edges cross.
flowchart LR n_operations["operations"] --> n_foundation["foundation"]
Dependencies
Runtime, in this workspace.
| Crate | Tier | Optional | Only on |
|---|---|---|---|
| `foundation-basemodels` | foundation | no | always |
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 |
Build. None.
Depended on by. 2 workspace crates.
Signal flow — what reaches this crate, and what it reaches.
flowchart LR n_application_assessments["application-assessments"] -->|uses| SELF n_platform_privacy_scan_api["platform-privacy-scan-api"] -->|uses| SELF SELF["operations-assessments"] SELF -->|runtime| n_foundation_basemodels["foundation-basemodels"] 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 | operations_assessments | `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
| 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
2 workspace crates depend on this one: application-assessments, platform-privacy-scan-api.
Verification
| Kind | Count |
|---|---|
| Unit tests | 34 |
| Integration tests | 0 |
| Examples | 0 |
| Doctests | 2 |
What the tests establish, by name:
test_assessment_created_event—src/events.rstest_event_serialization—src/events.rstest_finding_added_event—src/events.rstest_finding_status_changed_event—src/events.rstest_summary_refreshed_has_no_assessment_id—src/events.rstest_assessment_category_scores—src/models.rstest_assessment_has_id—src/models.rstest_assessment_invalid_state_transitions—src/models.rstest_assessment_list_query—src/models.rstest_assessment_score_validation—src/models.rstest_assessment_soft_delete—src/models.rstest_assessment_status_display—src/models.rstest_assessment_status_parse—src/models.rstest_assessment_status_state_checks—src/models.rstest_assessment_workflow—src/models.rstest_create_assessment_input_validation—src/models.rstest_create_finding_input_validation—src/models.rstest_finding_builder—src/models.rstest_finding_reopen—src/models.rstest_finding_status_parse—src/models.rstest_finding_status_resolved—src/models.rstest_finding_wont_fix—src/models.rstest_finding_workflow—src/models.rstest_severity_actionable—src/models.rstest_severity_ordering—src/models.rstest_severity_parse—src/models.rstest_severity_weight—src/models.rstest_summary_actionable_findings—src/models.rstest_summary_is_improving—src/models.rstest_summary_risk_level—src/models.rs- _… 4 more_
Documentation coverage
| Measure | Documented | Total |
|---|---|---|
| Public items with rustdoc | 0 | 0 |
Public modules with a //! block | 0 | 0 |
Metrics
| Metric | Value |
|---|---|
| Rust source files | 5 |
| Source lines | 2333 |
| Code lines | 1672 |
| Public API items | 0 |
| Public modules | 0 |
| Tests | 34 |
| Examples | 0 |
| Cargo features | 0 |
| Direct runtime dependencies | 7 |
| Workspace reverse dependencies | 2 |
pie showData
title Rust source composition
"Code" : 1672
"Blank or comment" : 661
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.