Skip to main content

ito_core/
lib.rs

1//! Core Ito application behavior.
2//!
3//! `ito-core` implements the main orchestration logic behind the CLI: reading and
4//! writing Ito state on disk, running workflows, validating inputs, and
5//! delegating to installers and harness integrations.
6//!
7//! This crate is intentionally "policy heavy" but "UI light": it defines the
8//! core semantics of commands without owning the CLI argument surface.
9
10#![warn(missing_docs)]
11
12/// Archive completed changes and update specifications.
13pub mod archive;
14
15/// Backend API client factory, runtime, and coordination services.
16pub mod backend_client;
17
18/// Backend-backed change repository adapter.
19pub mod backend_change_repository;
20
21/// Backend-backed task repository adapter.
22pub mod backend_task_repository;
23
24/// Backend coordination use-cases (claim, release, allocate, sync).
25pub mod backend_coordination;
26
27/// Artifact synchronization (pull/push) for backend mode.
28pub mod backend_sync;
29
30/// Audit log infrastructure: writer, reader, reconciliation, worktree discovery.
31pub mod audit;
32
33/// Filesystem-backed change repository implementation.
34pub mod change_repository;
35
36/// JSON configuration file CRUD operations.
37pub mod config;
38
39/// Create new modules/changes and initial scaffolding.
40pub mod create;
41
42/// Distribution/build metadata helpers.
43pub mod distribution;
44
45/// Core-layer error types and result alias.
46pub mod errors;
47
48/// Client-side forwarding of local audit events to the backend.
49pub mod event_forwarder;
50
51/// Git synchronization helpers for coordination workflows.
52pub mod git;
53
54/// Resolve repository and worktree path roots.
55pub mod repo_paths;
56
57/// Infer Ito change/module target context for harness sessions.
58pub mod harness_context;
59
60mod error_bridge;
61
62/// Process execution boundary and default runner.
63pub mod process;
64
65/// Installers for project/home templates and harness assets.
66pub mod installers;
67
68/// List/query project entities (modules, changes, tasks).
69pub mod list;
70
71/// Filesystem-backed module repository implementation.
72pub mod module_repository;
73
74/// Planning directory initialization (filesystem I/O).
75pub mod planning_init;
76
77/// Filesystem-backed task repository implementation.
78pub mod task_repository;
79
80/// Clock helpers (`now_time`, `now_date`).
81pub mod time;
82
83/// Task-focused orchestration use-cases.
84pub mod tasks;
85
86/// Ralph Wiggum loop support.
87pub mod ralph;
88
89/// Indexing helpers for repository contents.
90pub mod repo_index;
91
92/// Display and inspection commands.
93pub mod show;
94
95/// Statistics collection and computation for command usage.
96pub mod stats;
97
98/// Validation utilities for on-disk state.
99pub mod validate;
100
101/// Schema templates execution and planning.
102pub mod templates;
103
104// Re-export domain types for CLI and adapter convenience
105pub use ito_domain::backend::{
106    AllocateResult, ArchiveResult, ArtifactBundle, BackendArchiveClient, BackendChangeReader,
107    BackendError, BackendEventIngestClient, BackendLeaseClient, BackendSyncClient,
108    BackendTaskReader, ClaimResult, EventBatch, EventIngestResult, LeaseConflict, PushResult,
109    ReleaseResult, RevisionConflict,
110};
111pub use ito_domain::changes::{Change, ChangeRepository, ChangeSummary, ChangeTargetResolution};
112pub use ito_domain::errors::DomainError;
113pub use ito_domain::modules::{Module, ModuleRepository, ModuleSummary};
114pub use ito_domain::tasks::{
115    ProgressInfo, TaskItem, TaskRepository as DomainTaskRepository, TaskStatus, TasksFormat,
116    TasksParseResult,
117};
118
119/// Harness integrations for running AI-assisted workflows.
120pub mod harness;
121
122/// Re-exported schema types from [`ito_domain::schemas`].
123pub mod schemas {
124    pub use ito_domain::schemas::*;
125}
126
127/// Re-exported domain modules
128pub mod domain {
129    /// Planning domain module
130    pub use ito_domain::planning;
131}
132
133// Re-export utility functions for CLI convenience
134pub use ito_common::id::parse_change_id;
135pub use ito_common::id::parse_module_id;
136pub use ito_common::match_::nearest_matches;
137
138/// Re-exported path utilities from [`ito_common::paths`].
139pub mod paths {
140    pub use ito_common::paths::changes_dir;
141    pub use ito_common::paths::spec_markdown_path;
142    pub use ito_common::paths::specs_dir;
143}