forge_orchestrator/lib.rs
1//! # forge-orchestrator
2//!
3//! The library behind the `forge` binary. Its documented, supported surface is [`core`]: the types
4//! that read and write a project's `.forge/` directory (state and file locks, tasks, the event log,
5//! the knowledge base and the plan). Other tools can use it to inspect or drive a Forge project
6//! without shelling out to `forge`.
7//!
8//! The other modules are the binary's internals. They are public only so the binary can use them,
9//! are hidden from these docs, and may change in any release.
10//!
11//! The crate is at the alpha stage, like the binary: the API may change without notice.
12//!
13//! ```
14//! use forge_orchestrator::core::knowledge::{KnowledgeCategory, KnowledgeEntry, KnowledgeManager};
15//! use forge_orchestrator::core::task::{Task, TaskManager, TaskStatus};
16//!
17//! # fn main() -> anyhow::Result<()> {
18//! let project = tempfile::tempdir()?;
19//! let forge_dir = project.path().join(".forge");
20//!
21//! // Create a task, then read the board back.
22//! let tasks = TaskManager::new(&forge_dir);
23//! tasks.create_task(&Task::new("T-001", "Parse the config", "Read forge.toml into Config"))?;
24//! let pending: Vec<Task> = tasks
25//! .list_tasks()?
26//! .into_iter()
27//! .filter(|t| t.status == TaskStatus::Pending)
28//! .collect();
29//! assert_eq!(pending[0].id, "T-001");
30//!
31//! // Capture a decision in the knowledge base and list that category.
32//! let knowledge = KnowledgeManager::new(&forge_dir);
33//! let entry = KnowledgeEntry::new("Use TOML", "Config is TOML, not YAML.", &KnowledgeCategory::Decision)
34//! .with_task("T-001");
35//! knowledge.capture(&entry)?;
36//! assert_eq!(knowledge.list(Some("decisions"))?.len(), 1);
37//! # Ok(())
38//! # }
39//! ```
40#![allow(dead_code)] // Phase 1: many trait methods designed for future phases
41
42pub mod core;
43
44#[doc(hidden)]
45#[allow(rustdoc::broken_intra_doc_links, rustdoc::private_intra_doc_links)]
46// internals; not rendered
47pub mod adapters;
48#[doc(hidden)]
49#[allow(rustdoc::broken_intra_doc_links, rustdoc::private_intra_doc_links)]
50// internals; not rendered
51pub mod brain;
52#[doc(hidden)]
53#[allow(rustdoc::broken_intra_doc_links, rustdoc::private_intra_doc_links)]
54// internals; not rendered
55pub mod cli;
56#[doc(hidden)]
57#[allow(rustdoc::broken_intra_doc_links, rustdoc::private_intra_doc_links)]
58// internals; not rendered
59pub mod detect;
60#[doc(hidden)]
61#[allow(rustdoc::broken_intra_doc_links, rustdoc::private_intra_doc_links)]
62// internals; not rendered
63pub mod fleet;
64#[doc(hidden)]
65#[allow(rustdoc::broken_intra_doc_links, rustdoc::private_intra_doc_links)]
66// internals; not rendered
67pub mod mcp;
68// `pod` speaks tmux + flock(2) directly (Unix-only). Windows gets no pod surface — the `forge pod`
69// dispatch is stubbed there (see main.rs). Gating the whole module keeps the Windows target building
70// (v1.5.2 shipped it); the Unix codepaths are byte-identical, so the §1.5 rollback contract is
71// unchanged (DIRECTIVE-NXTG-20260719-20 follow-up: pod is Unix-only by nature).
72#[cfg(unix)]
73#[doc(hidden)]
74#[allow(rustdoc::broken_intra_doc_links, rustdoc::private_intra_doc_links)]
75// internals; not rendered
76pub mod pod;
77#[doc(hidden)]
78#[allow(rustdoc::broken_intra_doc_links, rustdoc::private_intra_doc_links)]
79// internals; not rendered
80pub mod tui;