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#![allow(deprecated)] // converge_core::llm::LlmProvider is deprecated upstream
6
7//! Development tools for Converge.
8//!
9//! This crate provides tooling for developing Converge applications:
10//!
11//! - [`gherkin`]: Converge Truths validation (business sense, compilability, conventions)
12//!
13//! # Converge Truths Validation
14//!
15//! Converge uses `.truth` files (or `.feature`) containing business specifications.
16//! The validator uses LLMs to check specs for:
17//!
18//! 1. **Business Sense**: Does the spec describe a meaningful invariant?
19//! 2. **Compilability**: Can this be translated to a Rust invariant?
20//! 3. **Conventions**: Does it follow Converge's patterns?
21//!
22//! # Example
23//!
24//! ```ignore
25//! use converge_tool::gherkin::{GherkinValidator, ValidationConfig};
26//! use converge_core::llm::MockProvider;
27//! use std::sync::Arc;
28//!
29//! let provider = Arc::new(MockProvider::constant("Valid spec", 0.9));
30//! let validator = GherkinValidator::new(provider, ValidationConfig::default());
31//!
32//! let result = validator.validate_file("specs/money.truth")?;
33//! println!("Valid: {}", result.is_valid);
34//! ```
35
36pub mod codegen;
37pub mod compile;
38pub mod gherkin;
39pub mod jtbd;
40pub mod predicate;
41
42pub use gherkin::{
43    GherkinValidator, InvariantClassTag, IssueCategory, ScenarioKind, ScenarioMeta, Severity,
44    SpecGenerator, SpecValidation, ValidationConfig, ValidationIssue, extract_all_metas,
45    extract_scenario_meta,
46};