ralph/contracts/mod.rs
1//! Contracts module for Ralph configuration and queue/task JSON structures.
2//!
3//! Responsibilities:
4//! - Own the canonical data models for config, queue, and task contracts.
5//! - Re-export the public contract types for crate-wide access.
6//!
7//! Not handled here:
8//! - Queue persistence and IO (see `crate::queue`).
9//! - CLI argument parsing or command behavior (see `crate::cli`).
10//!
11//! Invariants/assumptions:
12//! - Public contract types remain stable and are re-exported from this module.
13//! - Serde/schemars attributes define the wire contract and must not drift.
14
15#![allow(clippy::struct_excessive_bools)]
16
17mod cli_spec;
18mod config;
19mod model;
20mod queue;
21mod runner;
22mod session;
23mod task;
24
25// Re-exports from config module (core config types)
26// All config types are now re-exported from config::mod.rs for backward compatibility
27pub use config::{
28 AgentConfig, CiGateConfig, Config, GitRevertMode, LoopConfig, NotificationConfig,
29 ParallelConfig, PhaseOverrideConfig, PhaseOverrides, PluginConfig, PluginsConfig, ProjectType,
30 QueueAgingThresholds, QueueConfig, RunnerRetryConfig, ScanPromptVersion, WebhookConfig,
31 WebhookEventSubscription, WebhookQueuePolicy,
32};
33
34// Re-exports from cli_spec module (versioned; suitable for tooling consumption)
35pub use cli_spec::{ArgSpec, CLI_SPEC_VERSION, CliSpec, CommandSpec};
36
37// Re-exports from model module (model types)
38pub use model::{Model, ModelEffort, ReasoningEffort};
39
40// Re-exports from queue module
41pub use queue::QueueFile;
42
43// Re-exports from runner module (runner types)
44pub use runner::{
45 ClaudePermissionMode, Runner, RunnerApprovalMode, RunnerCliConfigRoot, RunnerCliOptionsPatch,
46 RunnerOutputFormat, RunnerPlanMode, RunnerSandboxMode, RunnerVerbosity,
47 UnsupportedOptionPolicy,
48};
49
50// Re-exports from session module
51pub use session::{PhaseSettingsSnapshot, SessionState};
52
53// Re-export SESSION_STATE_VERSION from constants for backward compatibility
54pub use crate::constants::versions::SESSION_STATE_VERSION;
55
56// Re-exports from task module
57pub use task::{Task, TaskAgent, TaskPriority, TaskStatus};