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/// Grep-style search over Ito change artifacts using ripgrep crates.
49pub mod grep;
50
51/// Client-side forwarding of local audit events to the backend.
52pub mod event_forwarder;
53
54/// Filesystem-backed backend project store implementation.
55pub mod fs_project_store;
56
57/// SQLite-backed backend project store proof-of-concept.
58pub mod sqlite_project_store;
59
60/// YAML front matter parsing, writing, and metadata utilities for artifacts.
61pub mod front_matter;
62
63/// Git synchronization helpers for coordination workflows.
64pub mod git;
65
66/// Resolve repository and worktree path roots.
67pub mod repo_paths;
68
69/// Infer Ito change/module target context for harness sessions.
70pub mod harness_context;
71
72mod error_bridge;
73
74/// Process execution boundary and default runner.
75pub mod process;
76
77/// Installers for project/home templates and harness assets.
78pub mod installers;
79
80/// List/query project entities (modules, changes, tasks).
81pub mod list;
82
83/// Filesystem-backed module repository implementation.
84pub mod module_repository;
85
86/// Planning directory initialization (filesystem I/O).
87pub mod planning_init;
88
89/// Filesystem-backed task repository implementation.
90pub mod task_repository;
91
92/// Clock helpers (`now_time`, `now_date`).
93pub mod time;
94
95/// Task-focused orchestration use-cases.
96pub mod tasks;
97
98/// Ralph Wiggum loop support.
99pub mod ralph;
100
101/// Indexing helpers for repository contents.
102pub mod repo_index;
103
104/// Display and inspection commands.
105pub mod show;
106
107/// Statistics collection and computation for command usage.
108pub mod stats;
109
110/// Validation utilities for on-disk state.
111pub mod validate;
112
113/// Schema templates execution and planning.
114pub mod templates;
115
116// Re-export domain types for CLI and adapter convenience
117pub use ito_domain::backend::{
118    AllocateResult, ArchiveResult, ArtifactBundle, BackendArchiveClient, BackendChangeReader,
119    BackendError, BackendEventIngestClient, BackendLeaseClient, BackendProjectStore,
120    BackendSyncClient, BackendTaskReader, ClaimResult, EventBatch, EventIngestResult,
121    LeaseConflict, PushResult, ReleaseResult, RevisionConflict,
122};
123pub use ito_domain::changes::{Change, ChangeRepository, ChangeSummary, ChangeTargetResolution};
124pub use ito_domain::errors::DomainError;
125pub use ito_domain::modules::{Module, ModuleRepository, ModuleSummary};
126pub use ito_domain::tasks::{
127    ProgressInfo, TaskItem, TaskRepository as DomainTaskRepository, TaskStatus, TasksFormat,
128    TasksParseResult,
129};
130
131/// Harness integrations for running AI-assisted workflows.
132pub mod harness;
133
134/// Re-exported schema types from [`ito_domain::schemas`].
135pub mod schemas {
136    pub use ito_domain::schemas::*;
137}
138
139/// Re-exported domain modules
140pub mod domain {
141    /// Planning domain module
142    pub use ito_domain::planning;
143}
144
145// Re-export utility functions for CLI convenience
146pub use ito_common::id::parse_change_id;
147pub use ito_common::id::parse_module_id;
148pub use ito_common::match_::nearest_matches;
149
150/// Re-exported path utilities from [`ito_common::paths`].
151pub mod paths {
152    pub use ito_common::paths::changes_dir;
153    pub use ito_common::paths::spec_markdown_path;
154    pub use ito_common::paths::specs_dir;
155}