pedant-types 0.1.2

Shared types for pedant capability analysis
Documentation

crates.io docs.rs CI license

You want to consume pedant's capability analysis output without pulling in the linter.

pedant-types is the shared type library for pedant capability attestations. It defines the serialization-stable types that flow between analysis, diffing, and reporting.

Types

Type Purpose
Capability Enum of 9 capabilities a crate may exercise (network, file I/O, process exec, etc.)
CapabilityFinding A capability detected at a specific SourceLocation with evidence
CapabilityProfile Collection of findings with dedup and filtering
AttestationContent Full attestation: source hash, crate identity, analysis tier, profile
CapabilityDiff Diff between two profiles — added/removed findings and capabilities
AnalysisTier Depth of analysis: Syntactic, Semantic, DataFlow

Usage

use pedant_types::{Capability, CapabilityDiff, CapabilityProfile};

let old: CapabilityProfile = serde_json::from_str(&old_json)?;
let new: CapabilityProfile = serde_json::from_str(&new_json)?;
let diff = CapabilityDiff::compute(&old, &new);

for cap in &diff.new_capabilities {
    println!("new capability: {cap:?}");
}

Installation

cargo add pedant-types

License

MIT or Apache-2.0, at your option.