| Crates.io | sara-core |
| lib.rs | sara-core |
| version | 0.4.0 |
| created_at | 2026-01-16 11:59:09.755304+00 |
| updated_at | 2026-01-24 00:20:35.75453+00 |
| description | Core library for Sara - Requirements Knowledge Graph CLI |
| homepage | |
| repository | https://github.com/cledouarec/sara |
| max_upload_size | |
| id | 2048484 |
| size | 345,970 |
Core library for SARA - Solution Architecture Requirement for Alignment.
This crate provides the business logic for managing architecture documents and requirements as an interconnected knowledge graph.
Add this to your Cargo.toml:
[dependencies]
sara-core = "0.1"
use std::path::Path;
use sara_core::{
config::load_config,
repository::parse_directory,
graph::GraphBuilder,
validation::Validator,
traverse_upstream,
ItemId, TraversalOptions,
};
fn main() -> sara_core::Result<()> {
// Load configuration
let config = load_config(Path::new("sara.toml"))?;
// Discover and parse documents from a directory
let items = parse_directory(Path::new("./docs"))?;
// Build the knowledge graph
let graph = GraphBuilder::new()
.add_items(items)
.build()?;
// Validate integrity
let validator = Validator::new(config.validation);
let report = validator.validate(&graph);
println!("Errors: {}, Warnings: {}", report.error_count(), report.warning_count());
// Query traceability
let options = TraversalOptions::default();
let item_id = ItemId::new("SYSREQ-001")?;
if let Some(result) = traverse_upstream(&graph, &item_id, &options) {
println!("Found {} upstream items", result.items.len());
}
Ok(())
}
The library supports 9 document types forming a requirements hierarchy:
| Type | Description |
|---|---|
| Solution | Customer-facing solution |
| Use Case | Customer/market need |
| Scenario | Abstract system behavior |
| System Requirement | Quantifiable system-level need |
| System Architecture | Platform implementation |
| Hardware Requirement | Hardware-specific need |
| Software Requirement | Software-specific need |
| HW Detailed Design | Hardware implementation |
| SW Detailed Design | Software implementation |
Solution
-> Use Case
-> Scenario
-> System Requirement
-> System Architecture
-> Hardware Requirement
| -> HW Detailed Design
-> Software Requirement
-> SW Detailed Design
Licensed under the Apache-2.0 License. See LICENSE for details.