Skip to main content

AssessmentService

Struct AssessmentService 

Source
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

Source

pub fn new() -> Self

Source

pub fn with_mesh(node_id: String, project_name: String) -> Self

Create a new service with mesh coordination enabled.

Source

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.

Source

pub fn mesh_coordinator(&self) -> Option<&MeshCoordinator>

Returns a reference to the mesh coordinator, if enabled.

Source

pub fn mesh_coordinator_arc(&self) -> Option<Arc<MeshCoordinator>>

Shared Arc to the mesh coordinator (for wiring AssessmentTransport).

Source

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.

Source

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.

Source

pub fn diff_latest(&self) -> Option<AssessmentDiff>

Compute a diff between the latest report and the previous one.

Source

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).

Source

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.

Source

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.

Source

pub fn get_latest(&self) -> Option<AssessmentReport>

Returns the latest assessment report, if any.

Source

pub fn list_peers(&self) -> Vec<PeerInfo>

Returns all linked peers.

Link a peer project for comparison.

Source

pub fn compare_with_peer( &self, peer_name: &str, ) -> Result<ComparisonReport, String>

Run assessment on a peer and compare with the latest local assessment.

Source

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.

Source

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

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl SystemService for AssessmentService

Source§

fn name(&self) -> &str

Human-readable service name.
Source§

fn service_type(&self) -> ServiceType

Service type category.
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,

Start the service.
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,

Stop the service.
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,

Perform a health check.
Source§

fn health_detail(&self) -> Option<String>

Optional operator-facing detail (metrics, endpoints, …). Read more
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,

Liveness probe (K2b-G2, os-patterns). Read more
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,

Readiness probe (K2b-G2, os-patterns). Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Pointee for T

Source§

type Pointer = u32

Source§

fn debug( pointer: <T as Pointee>::Pointer, f: &mut Formatter<'_>, ) -> Result<(), Error>

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more