Skip to main content

converge_tool/
lib.rs

1// Copyright 2024-2025 Aprio One AB, Sweden
2// Author: Kenneth Pernyer, kenneth@aprio.one
3// SPDX-License-Identifier: MIT
4// See LICENSE file in the project root for full license information.
5
6//! Development tools for Converge.
7//!
8//! This crate provides tooling for developing Converge applications:
9//!
10//! - [`gherkin`]: Converge Truths validation (business sense, compilability, conventions)
11//!
12//! # Converge Truths Validation
13//!
14//! Converge uses `.truth` files (or `.feature`) containing business specifications.
15//! The validator uses LLMs to check specs for:
16//!
17//! 1. **Business Sense**: Does the spec describe a meaningful invariant?
18//! 2. **Compilability**: Can this be translated to a Rust invariant?
19//! 3. **Conventions**: Does it follow Converge's patterns?
20//!
21//! # Example
22//!
23//! ```ignore
24//! use converge_tool::gherkin::{GherkinValidator, ValidationConfig};
25//! use converge_core::llm::MockProvider;
26//! use std::sync::Arc;
27//!
28//! let provider = Arc::new(MockProvider::constant("Valid spec", 0.9));
29//! let validator = GherkinValidator::new(provider, ValidationConfig::default());
30//!
31//! let result = validator.validate_file("specs/money.truth")?;
32//! println!("Valid: {}", result.is_valid);
33//! ```
34
35pub mod gherkin;
36
37pub use gherkin::{
38    GherkinValidator, SpecGenerator, SpecValidation, ValidationConfig, ValidationIssue,
39};