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/// Requirement traceability computation for the `ito trace` command.
138pub mod trace;
139
140/// Proposal viewer artifact collection and backend dispatch.
141pub mod viewer;
142
143/// Repository runtime selection and composition.
144pub mod repository_runtime;
145
146/// Statistics collection and computation for command usage.
147pub mod stats;
148
149/// Validation utilities for on-disk state.
150pub mod validate;
151
152/// Schema templates execution and planning.
153pub mod templates;
154
155// Re-export domain types for CLI and adapter convenience
156pub use ito_domain::backend::{
157 AllocateResult, ArchiveResult, ArtifactBundle, BackendArchiveClient, BackendChangeReader,
158 BackendError, BackendEventIngestClient, BackendLeaseClient, BackendModuleReader,
159 BackendProjectStore, BackendSpecReader, BackendSyncClient, BackendTaskReader, ClaimResult,
160 EventBatch, EventIngestResult, LeaseConflict, PushResult, ReleaseResult, RevisionConflict,
161};
162pub use ito_domain::changes::{
163 Change, ChangeLifecycleFilter, ChangeRepository, ChangeSummary, ChangeTargetResolution,
164};
165pub use ito_domain::errors::DomainError;
166pub use ito_domain::modules::{Module, ModuleRepository, ModuleSummary};
167pub use ito_domain::specs::{SpecDocument, SpecRepository, SpecSummary};
168pub use ito_domain::tasks::{
169 ProgressInfo, TaskInitResult, TaskItem, TaskKind, TaskMutationError, TaskMutationResult,
170 TaskMutationService, TaskMutationServiceResult, TaskRepository as DomainTaskRepository,
171 TaskStatus, TasksFormat, TasksParseResult,
172};
173
174/// Harness integrations for running AI-assisted workflows.
175pub mod harness;
176
177/// Re-exported schema types from [`ito_domain::schemas`].
178pub mod schemas {
179 pub use ito_domain::schemas::*;
180}
181
182/// Re-exported domain modules
183pub mod domain {
184 /// Planning domain module
185 pub use ito_domain::planning;
186}
187
188// Re-export utility functions for CLI convenience
189pub use ito_common::id::parse_change_id;
190pub use ito_common::id::parse_module_id;
191pub use ito_common::match_::nearest_matches;
192
193/// Re-exported path utilities from [`ito_common::paths`].
194pub mod paths {
195 pub use ito_common::paths::changes_dir;
196 pub use ito_common::paths::spec_markdown_path;
197 pub use ito_common::paths::specs_dir;
198}