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