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