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/// Agent memory provider resolution and instruction rendering.
116pub mod memory;
117
118/// Filesystem-backed module repository implementation.
119pub mod module_repository;
120
121/// Planning directory initialization (filesystem I/O).
122pub mod planning_init;
123
124/// Filesystem-backed task repository implementation.
125pub mod task_repository;
126
127/// Filesystem-backed promoted spec repository implementation.
128pub mod spec_repository;
129
130/// Task mutation services for filesystem and backend persistence.
131pub mod task_mutations;
132
133/// Remote task repository backed by the backend API.
134pub mod remote_task_repository;
135
136/// Clock helpers (`now_time`, `now_date`).
137pub mod time;
138
139/// Cryptographic token generation for backend server authentication.
140pub mod token;
141
142/// Task-focused orchestration use-cases.
143pub mod tasks;
144
145/// Ralph Wiggum loop support.
146pub mod ralph;
147
148/// Indexing helpers for repository contents.
149pub mod repo_index;
150
151/// Display and inspection commands.
152pub mod show;
153
154/// Requirement traceability computation for the `ito trace` command.
155pub mod trace;
156
157/// Proposal viewer artifact collection and backend dispatch.
158pub mod viewer;
159
160/// Repository runtime selection and composition.
161pub mod repository_runtime;
162
163/// Statistics collection and computation for command usage.
164pub mod stats;
165
166/// Validation utilities for on-disk state.
167pub mod validate;
168
169/// Change worktree ensure: verify or create the correct worktree for a change.
170pub mod worktree_ensure;
171
172/// Change worktree initialization: file copy-over and include-pattern resolution.
173pub mod worktree_init;
174
175/// Schema templates execution and planning.
176pub mod templates;
177
178// Re-export domain types for CLI and adapter convenience
179pub use ito_domain::backend::{
180 AllocateResult, ArchiveResult, ArtifactBundle, BackendArchiveClient, BackendChangeReader,
181 BackendError, BackendEventIngestClient, BackendLeaseClient, BackendModuleReader,
182 BackendProjectStore, BackendSpecReader, BackendSyncClient, BackendTaskReader, ClaimResult,
183 EventBatch, EventIngestResult, LeaseConflict, PushResult, ReleaseResult, RevisionConflict,
184};
185pub use ito_domain::changes::{
186 Change, ChangeLifecycleFilter, ChangeRepository, ChangeSummary, ChangeTargetResolution,
187};
188pub use ito_domain::errors::DomainError;
189pub use ito_domain::modules::{Module, ModuleRepository, ModuleSummary};
190pub use ito_domain::specs::{SpecDocument, SpecRepository, SpecSummary};
191pub use ito_domain::tasks::{
192 ProgressInfo, TaskInitResult, TaskItem, TaskKind, TaskMutationError, TaskMutationResult,
193 TaskMutationService, TaskMutationServiceResult, TaskRepository as DomainTaskRepository,
194 TaskStatus, TasksFormat, TasksParseResult,
195};
196
197/// Harness integrations for running AI-assisted workflows.
198pub mod harness;
199
200/// Re-exported schema types from [`ito_domain::schemas`].
201pub mod schemas {
202 pub use ito_domain::schemas::*;
203}
204
205/// Re-exported domain modules
206pub mod domain {
207 /// Planning domain module
208 pub use ito_domain::planning;
209}
210
211// Re-export utility functions for CLI convenience
212pub use ito_common::id::parse_change_id;
213pub use ito_common::id::parse_module_id;
214pub use ito_common::match_::nearest_matches;
215
216/// Re-exported path utilities from [`ito_common::paths`].
217pub mod paths {
218 pub use ito_common::paths::changes_dir;
219 pub use ito_common::paths::spec_markdown_path;
220 pub use ito_common::paths::specs_dir;
221}