Skip to main content

forge_reasoning/
lib.rs

1//! Forge Reasoning Tools
2//!
3//! Provides cognitive scaffolding for LLM debugging:
4//! - Temporal Checkpointing: Save/restore debugging state
5//! - Knowledge Gap Analysis: Track and prioritize missing information
6//! - Verification Execution: Async check execution with retry and evidence attachment
7
8// Module declarations
9pub mod belief;
10pub mod checkpoint;
11pub mod errors;
12pub mod export_import;
13pub mod gaps;
14pub mod hypothesis;
15pub mod impact;
16pub mod service;
17pub mod storage;
18pub mod storage_sqlitegraph;
19pub mod thread_safe;
20pub mod verification;
21
22#[cfg(feature = "websocket")]
23pub mod websocket;
24
25// Re-export main types
26pub use checkpoint::{
27    AutoTrigger, CheckpointId, CheckpointSummary, CheckpointTrigger, CompactionPolicy, DebugNote,
28    DebugStateSnapshot, SessionId, SessionMetrics, TemporalCheckpoint, TemporalCheckpointManager,
29    VerificationResult,
30};
31
32pub use hypothesis::{
33    Confidence, ConfidenceError,
34    Hypothesis, HypothesisBoard, HypothesisId, HypothesisStatus,
35    HypothesisStorage, InMemoryHypothesisStorage,
36    Evidence, EvidenceId, EvidenceType, EvidenceMetadata,
37    strength_to_likelihood,
38};
39
40pub use belief::{BeliefGraph, ReasoningSystem};
41
42pub use gaps::{
43    KnowledgeGapAnalyzer, KnowledgeGap, GapId, GapCriticality, GapType,
44    GapSuggestion, SuggestedAction, ScoringConfig, compute_gap_score,
45};
46
47pub use impact::{
48    // Impact analysis engine
49    ImpactAnalysisEngine,
50    // Propagation types
51    ConfidenceChange, PropagationConfig, PropagationResult,
52    // Preview types
53    CascadePreview, PreviewId, PreviewPage, PaginationState, CycleWarning,
54    // Snapshot types
55    SnapshotId, BeliefSnapshot, SnapshotStore,
56};
57
58pub use export_import::{CheckpointExporter, CheckpointImporter};
59
60pub use errors::{CheckpointError, ReasoningError, Result, StorageError};
61
62pub use storage::{create_storage, BackendKind, CheckpointStorage, StorageConfig};
63
64pub use storage_sqlitegraph::SqliteGraphStorage;
65
66pub use thread_safe::{ThreadSafeCheckpointManager, ThreadSafeStorage};
67
68pub use verification::{
69    VerificationRunner, VerificationCheck, CheckId, CheckResult, CheckStatus,
70    VerificationCommand, PassAction, FailAction, RetryConfig,
71};
72
73pub use service::{
74    AnnotationSeverity, AutoCheckpointConfig, CheckpointAnnotation, CheckpointCommand,
75    CheckpointEvent, CheckpointService, CommandResult, HealthStatus, ImportResult, ServiceMetrics,
76    AnnotatedCheckpoint, ValidationReport,
77};
78
79#[cfg(feature = "websocket")]
80pub use websocket::{
81    CheckpointWebSocketServer, WebSocketCommand, WebSocketConfig, WebSocketEvent,
82    WebSocketResponse,
83};
84
85/// Version of the reasoning tools crate
86pub const VERSION: &str = env!("CARGO_PKG_VERSION");
87
88/// Initialize the reasoning tools system
89pub fn init() {
90    tracing::info!("Forge Reasoning Tools v{}", VERSION);
91}