upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/grasp-audit/src/lib.rs
blob: 5eb9b71c24511077dc32d89a0294ad64443c38dc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
//! GRASP Audit Tool
//!
//! A reusable compliance and audit testing tool for GRASP protocol implementations.
//!
//! # Features
//!
//! - **Isolated Testing**: Tests run in parallel with unique audit IDs
//! - **Production Audit**: Test live services with minimal impact
//! - **Clean Audit Events**: Special tags for easy cleanup without deletion trails
//! - **Spec-Mirrored Tests**: Test structure matches GRASP protocol exactly
//!
//! # Usage
//!
//! ```no_run
//! use grasp_audit::*;
//!
//! #[tokio::main]
//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
//!     // Create audit client for CI testing
//!     let config = AuditConfig::ci();
//!     let client = AuditClient::new("ws://localhost:7000", config).await?;
//!     
//!     // Run smoke tests
//!     let results = specs::nip01_smoke::Nip01SmokeTests::run_all(&client).await;
//!     results.print_report();
//!     
//!     Ok(())
//! }
//! ```

pub mod audit;
pub mod client;
pub mod fixtures;
pub mod isolation;
pub mod result;
pub mod specs;

pub use audit::{AuditConfig, AuditMode};
pub use client::AuditClient;
pub use fixtures::{
    // Git operation helpers
    clone_repo, create_commit, create_deterministic_commit, create_deterministic_commit_with_variant,
    try_push,
    // Verification helpers
    send_and_verify_accepted, send_and_verify_rejected,
    // Types and constants
    CommitVariant, ContextMode, FixtureKind, TestContext,
    DETERMINISTIC_COMMIT_HASH, MAINTAINER_DETERMINISTIC_COMMIT_HASH,
    RECURSIVE_MAINTAINER_DETERMINISTIC_COMMIT_HASH,
};
pub use result::{AuditResult, TestResult};

// Re-export commonly used types
pub use anyhow::{anyhow, Result};
pub use nostr_sdk::prelude::*;