Skip to main content

termivar_core/
lib.rs

1//! Inward-facing, transport-neutral contracts shared by Termivar crates.
2//!
3//! The default crate surface contains evidence, reasoning, ontology, outcome,
4//! predicate, and run-report records. Execution behavior and transport models
5//! belong in higher-level crates. The pre-quarantine configuration, error,
6//! event, finding, and raw HTTP/result records remain available only through
7//! the non-default `legacy-contracts` compatibility feature.
8
9//!
10//! # Example
11//!
12//! ```rust
13//! use termivar_core::ConfidenceScore;
14//!
15//! let confidence = ConfidenceScore::from_basis_points(8_500)?;
16//! assert_eq!(confidence.basis_points(), 8_500);
17//! # Ok::<(), termivar_core::ReasoningModelError>(())
18//! ```
19
20#![forbid(unsafe_code)]
21#![deny(rustdoc::broken_intra_doc_links)]
22
23#[cfg(feature = "legacy-contracts")]
24pub mod config;
25#[cfg(feature = "legacy-contracts")]
26pub mod error;
27#[cfg(feature = "legacy-contracts")]
28pub mod events;
29#[cfg(feature = "legacy-contracts")]
30pub mod models;
31pub mod ontology;
32pub mod outcome;
33pub mod predicates;
34pub mod reasoning;
35pub mod run_report;
36
37#[cfg(feature = "legacy-contracts")]
38pub use config::{Config, ConfigBuilder, ConfigError, ScanIntensity};
39#[cfg(feature = "legacy-contracts")]
40pub use error::{Error, Result};
41#[cfg(feature = "legacy-contracts")]
42pub use events::{Event, EventBuilder, EventSeverity, EventType};
43#[cfg(feature = "legacy-contracts")]
44pub use models::{HttpRequest, HttpResponse, ScanFinding, ScanResult, Vulnerability};
45pub use ontology::{
46    ConceptId, Ontology, OntologyAxiom, OntologyConcept, OntologyError, OntologyRecordKind,
47    OntologyRelationType, OntologyStats, OntologyWrite, RelationSemantics, RelationTypeId,
48};
49pub use outcome::{Outcome, OutcomeError, OutcomeStatus, VerificationStage};
50pub use predicates::{
51    ApiEvidencePredicate, ApiKnowledgePredicate, ApiResponseFormat, ApiSurfaceKind,
52    ApiVisibilityBoundaryKind, ApiVisibilityComparison, ApiVisibilityDimension,
53    ApiVisibilityObservation, ApiVisibilityPairKind, ApiVisibilityResult, ApiVocabularyError,
54    ComparisonId, HttpEvidencePredicate, OpaqueContextId, PredicateDescriptor, ResourceScopeId,
55    WebKnowledgePredicate,
56};
57pub use reasoning::{
58    BayesianBelief, BayesianEvidence, BayesianUpdate, BeliefWrite, ConfidenceScore,
59    ContributionDirection, DerivationAlgorithm, EntityId, EntityKind, Evidence,
60    EvidenceContribution, EvidenceDerivation, EvidenceId, EvidenceKind, EvidenceOrigin,
61    EvidenceSource, EvidenceValue, Fact, Hypothesis, HypothesisState, HypothesisStrength,
62    KnowledgeEntity, KnowledgePredicate, KnowledgeRelation, Probability, ReasoningModelError,
63    RelationId, RelationKind, MAX_DERIVATION_ALGORITHM_BYTES, MAX_DERIVATION_PARENTS,
64};
65pub use run_report::{
66    ResourceAccounting, ResourceAccountingMode, RunAccounting, RunOutcomeRecord, RunReport,
67    RunReportError, RunReportInput, RunStatus, RunStepReport, RunStepStatus, RunStopCode,
68    RunStopReason, SecuritySeverity, MAX_RUN_REPORT_EVIDENCE_IDS, MAX_RUN_REPORT_OUTCOMES,
69    MAX_RUN_REPORT_STEPS, MAX_RUN_REPORT_TEXT_BYTES, RUN_REPORT_SCHEMA,
70};