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