pub struct AssessmentService { /* private fields */ }Expand description
Project assessment service.
Scans a project directory for code quality signals, complexity
warnings, and structural issues. Uses a pluggable AnalyzerRegistry
so that external crates can register custom analyzers. Optionally
uses tree-sitter for Rust symbol extraction and complexity analysis.
Implementations§
Source§impl AssessmentService
impl AssessmentService
pub fn new() -> Self
Sourcepub fn with_mesh(node_id: String, project_name: String) -> Self
pub fn with_mesh(node_id: String, project_name: String) -> Self
Create a new service with mesh coordination enabled.
Sourcepub fn with_mesh_coordinator(coordinator: Arc<MeshCoordinator>) -> Self
pub fn with_mesh_coordinator(coordinator: Arc<MeshCoordinator>) -> Self
Create a service that shares an existing mesh coordinator (WEFT-117).
Used by kernel boot so [AssessmentTransport] and the service
hold the same mesh::MeshCoordinator.
Sourcepub fn mesh_coordinator(&self) -> Option<&MeshCoordinator>
pub fn mesh_coordinator(&self) -> Option<&MeshCoordinator>
Returns a reference to the mesh coordinator, if enabled.
Sourcepub fn mesh_coordinator_arc(&self) -> Option<Arc<MeshCoordinator>>
pub fn mesh_coordinator_arc(&self) -> Option<Arc<MeshCoordinator>>
Shared Arc to the mesh coordinator (for wiring AssessmentTransport).
Sourcepub fn queue_mesh_propagation(&self, report: &AssessmentReport)
pub fn queue_mesh_propagation(&self, report: &AssessmentReport)
Queue mesh propagation for a completed report.
Prefer FindingDiff (changed findings only) when a previous report is available; otherwise queue a lightweight gossip message.
Sourcepub fn set_previous_report_path(&self, path: PathBuf)
pub fn set_previous_report_path(&self, path: PathBuf)
Set the path to a previous assessment report JSON file.
When set, run_assessment will load it and pass it to analyzers
via AnalysisContext, and diff_latest will use it to compute
an AssessmentDiff.
Sourcepub fn diff_latest(&self) -> Option<AssessmentDiff>
pub fn diff_latest(&self) -> Option<AssessmentDiff>
Compute a diff between the latest report and the previous one.
Sourcepub fn run_assessment(
&self,
project_dir: &Path,
scope: &str,
_format: &str,
) -> Result<AssessmentReport, String>
pub fn run_assessment( &self, project_dir: &Path, scope: &str, _format: &str, ) -> Result<AssessmentReport, String>
Run the full assessment pipeline on project_dir.
scope selects what to scan:
"full"— all files under project_dir"commit"— only files changed in the last git commit"ci"— CI config files only"dependency"— dependency manifests only
format is reserved for future output formatting (currently ignored).
Sourcepub fn run_assessment_with_registry(
&self,
project_dir: &Path,
scope: &str,
_format: &str,
registry: AnalyzerRegistry,
) -> Result<AssessmentReport, String>
pub fn run_assessment_with_registry( &self, project_dir: &Path, scope: &str, _format: &str, registry: AnalyzerRegistry, ) -> Result<AssessmentReport, String>
Run assessment with a custom analyzer registry.
Sourcepub fn load_config(&self, project: &Path) -> Option<AssessmentConfig>
pub fn load_config(&self, project: &Path) -> Option<AssessmentConfig>
Load and parse .weftos/weave.toml from the given project directory.
Returns None if the file does not exist or cannot be parsed.
Sourcepub fn get_latest(&self) -> Option<AssessmentReport>
pub fn get_latest(&self) -> Option<AssessmentReport>
Returns the latest assessment report, if any.
Sourcepub fn list_peers(&self) -> Vec<PeerInfo>
pub fn list_peers(&self) -> Vec<PeerInfo>
Returns all linked peers.
Sourcepub fn link_peer(&self, name: String, location: String) -> Result<(), String>
pub fn link_peer(&self, name: String, location: String) -> Result<(), String>
Link a peer project for comparison.
Sourcepub fn compare_with_peer(
&self,
peer_name: &str,
) -> Result<ComparisonReport, String>
pub fn compare_with_peer( &self, peer_name: &str, ) -> Result<ComparisonReport, String>
Run assessment on a peer and compare with the latest local assessment.
Sourcepub fn run_progressive(
&self,
project: &Path,
scope: &str,
max_rounds: usize,
) -> AssessmentReport
pub fn run_progressive( &self, project: &Path, scope: &str, max_rounds: usize, ) -> AssessmentReport
Run the assessment pipeline in progressive rounds.
Each round runs all analyzers on scoped files. After each round,
new file/directory references discovered in findings (topology,
network, data_source) are collected. If they point to files not
yet scanned, a follow-up round is executed on those files.
Repeats until no new files are discovered or max_rounds is reached.
Sourcepub fn generate_insights(
&self,
report: &AssessmentReport,
) -> Option<Vec<Finding>>
pub fn generate_insights( &self, report: &AssessmentReport, ) -> Option<Vec<Finding>>
Generate LLM-powered insights from assessment findings.
When a kernel daemon is running with an LLM provider configured, this method spawns a worker agent via the supervisor that analyzes the findings and produces higher-order insights (architectural patterns, risk assessment, recommendations).
Returns None if no LLM is available (local-only mode).
Trait Implementations§
Source§impl Default for AssessmentService
impl Default for AssessmentService
Source§impl SystemService for AssessmentService
impl SystemService for AssessmentService
Source§fn service_type(&self) -> ServiceType
fn service_type(&self) -> ServiceType
Source§fn start<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn start<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn stop<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn stop<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn health_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = HealthStatus> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn health_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = HealthStatus> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn health_detail(&self) -> Option<String>
fn health_detail(&self) -> Option<String>
Source§fn liveness_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ProbeResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn liveness_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ProbeResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn readiness_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ProbeResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn readiness_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ProbeResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Auto Trait Implementations§
impl !Freeze for AssessmentService
impl RefUnwindSafe for AssessmentService
impl Send for AssessmentService
impl Sync for AssessmentService
impl Unpin for AssessmentService
impl UnsafeUnpin for AssessmentService
impl UnwindSafe for AssessmentService
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more