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 server authentication setup and token resolution.
16pub mod backend_auth;
17
18/// Backend API client factory, runtime, and coordination services.
19pub mod backend_client;
20
21/// Backend-backed change repository adapter.
22pub mod backend_change_repository;
23
24/// Backend HTTP client for repository reads.
25pub mod backend_http;
26
27/// Backend-backed module repository adapter.
28pub mod backend_module_repository;
29
30/// Backend-backed promoted spec repository adapter.
31pub mod backend_spec_repository;
32
33/// Backend-backed task repository adapter.
34pub mod backend_task_repository;
35
36/// Backend coordination use-cases (claim, release, allocate, sync).
37pub mod backend_coordination;
38
39/// Backend health-check client for connectivity and auth validation.
40pub mod backend_health;
41
42/// Artifact synchronization (pull/push) for backend mode.
43pub mod backend_sync;
44
45/// Audit log infrastructure: writer, reader, reconciliation, worktree discovery.
46pub mod audit;
47
48/// Filesystem-backed change repository implementation.
49pub mod change_repository;
50
51/// JSON configuration file CRUD operations.
52pub mod config;
53
54/// Create new modules/changes and initial scaffolding.
55pub mod create;
56
57/// Distribution/build metadata helpers.
58pub mod distribution;
59
60/// Core-layer error types and result alias.
61pub mod errors;
62
63/// Grep-style search over Ito change artifacts using ripgrep crates.
64pub mod grep;
65
66/// Client-side forwarding of local audit events to the backend.
67pub mod event_forwarder;
68
69/// Filesystem-backed backend project store implementation.
70pub mod fs_project_store;
71
72/// SQLite-backed backend project store proof-of-concept.
73pub mod sqlite_project_store;
74
75/// YAML front matter parsing, writing, and metadata utilities for artifacts.
76pub mod front_matter;
77
78/// Git synchronization helpers for coordination workflows.
79pub mod git;
80
81/// Resolve repository and worktree path roots.
82pub mod repo_paths;
83
84/// Infer Ito change/module target context for harness sessions.
85pub mod harness_context;
86
87mod error_bridge;
88
89/// Process execution boundary and default runner.
90pub mod process;
91
92/// Installers for project/home templates and harness assets.
93pub mod installers;
94
95/// List/query project entities (modules, changes, tasks).
96pub mod list;
97
98/// Filesystem-backed module repository implementation.
99pub mod module_repository;
100
101/// Planning directory initialization (filesystem I/O).
102pub mod planning_init;
103
104/// Filesystem-backed task repository implementation.
105pub mod task_repository;
106
107/// Filesystem-backed promoted spec repository implementation.
108pub mod spec_repository;
109
110/// Task mutation services for filesystem and backend persistence.
111pub mod task_mutations;
112
113/// Remote task repository backed by the backend API.
114pub mod remote_task_repository;
115
116/// Clock helpers (`now_time`, `now_date`).
117pub mod time;
118
119/// Cryptographic token generation for backend server authentication.
120pub mod token;
121
122/// Task-focused orchestration use-cases.
123pub mod tasks;
124
125/// Ralph Wiggum loop support.
126pub mod ralph;
127
128/// Indexing helpers for repository contents.
129pub mod repo_index;
130
131/// Display and inspection commands.
132pub mod show;
133
134/// Repository runtime selection and composition.
135pub mod repository_runtime;
136
137/// Statistics collection and computation for command usage.
138pub mod stats;
139
140/// Validation utilities for on-disk state.
141pub mod validate;
142
143/// Schema templates execution and planning.
144pub mod templates;
145
146// Re-export domain types for CLI and adapter convenience
147pub use ito_domain::backend::{
148    AllocateResult, ArchiveResult, ArtifactBundle, BackendArchiveClient, BackendChangeReader,
149    BackendError, BackendEventIngestClient, BackendLeaseClient, BackendModuleReader,
150    BackendProjectStore, BackendSpecReader, BackendSyncClient, BackendTaskReader, ClaimResult,
151    EventBatch, EventIngestResult, LeaseConflict, PushResult, ReleaseResult, RevisionConflict,
152};
153pub use ito_domain::changes::{
154    Change, ChangeLifecycleFilter, ChangeRepository, ChangeSummary, ChangeTargetResolution,
155};
156pub use ito_domain::errors::DomainError;
157pub use ito_domain::modules::{Module, ModuleRepository, ModuleSummary};
158pub use ito_domain::specs::{SpecDocument, SpecRepository, SpecSummary};
159pub use ito_domain::tasks::{
160    ProgressInfo, TaskInitResult, TaskItem, TaskKind, TaskMutationError, TaskMutationResult,
161    TaskMutationService, TaskMutationServiceResult, TaskRepository as DomainTaskRepository,
162    TaskStatus, TasksFormat, TasksParseResult,
163};
164
165/// Harness integrations for running AI-assisted workflows.
166pub mod harness;
167
168/// Re-exported schema types from [`ito_domain::schemas`].
169pub mod schemas {
170    pub use ito_domain::schemas::*;
171}
172
173/// Re-exported domain modules
174pub mod domain {
175    /// Planning domain module
176    pub use ito_domain::planning;
177}
178
179// Re-export utility functions for CLI convenience
180pub use ito_common::id::parse_change_id;
181pub use ito_common::id::parse_module_id;
182pub use ito_common::match_::nearest_matches;
183
184/// Re-exported path utilities from [`ito_common::paths`].
185pub mod paths {
186    pub use ito_common::paths::changes_dir;
187    pub use ito_common::paths::spec_markdown_path;
188    pub use ito_common::paths::specs_dir;
189}