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