Skip to main content

deciduous/
lib.rs

1//! Deciduous - Decision graph tooling for AI-assisted development
2//!
3//! Track every decision, query your reasoning, preserve context across sessions.
4//!
5//! # Overview
6//!
7//! Deciduous provides a persistent decision graph that survives context loss.
8//! Every goal, decision, option, action, and outcome is captured and linked,
9//! creating a queryable history of your development process.
10//!
11//! # Node Types
12//!
13//! | Type | Purpose |
14//! |------|---------|
15//! | `goal` | High-level objectives |
16//! | `decision` | Choice points with options |
17//! | `option` | Approaches considered |
18//! | `action` | What was implemented |
19//! | `outcome` | What happened |
20//! | `observation` | Technical insights |
21//!
22//! # Quick Start
23//!
24//! ```no_run
25//! use deciduous::Database;
26//!
27//! let db = Database::new("deciduous.db").unwrap();
28//!
29//! // Add a goal
30//! let goal_id = db.add_node("goal", "Implement feature X", None, Some(90), None).unwrap();
31//!
32//! // Add an action linked to it
33//! let action_id = db.add_node("action", "Writing the code", None, Some(85), None).unwrap();
34//! db.add_edge(goal_id, action_id, "leads_to", None).unwrap();
35//!
36//! // Query the graph
37//! let graph = db.get_graph().unwrap();
38//! println!("Nodes: {}, Edges: {}", graph.nodes.len(), graph.edges.len());
39//! ```
40
41pub mod archaeology;
42pub mod changelog;
43pub mod config;
44pub mod db;
45pub mod events;
46pub mod export;
47pub mod github;
48pub mod hooks;
49pub mod init;
50pub mod mcp;
51pub mod narratives;
52pub mod opencode;
53pub mod pulse;
54pub mod roadmap;
55pub mod schema;
56pub mod serve;
57
58pub use config::Config;
59pub use db::{
60    build_metadata_json, get_current_git_branch, get_current_git_commit, CheckboxState, CommandLog,
61    Database, DbRecord, DbSummary, DecisionContext, DecisionEdge, DecisionGraph, DecisionNode,
62    DecisionSession, DeleteSummary, GitHubIssueCache, NodeDocument, NodeTheme, RoadmapConflict,
63    RoadmapItem, RoadmapSyncState, Theme, CURRENT_SCHEMA,
64};
65pub use events::{
66    generate_edge_id, get_current_author, Checkpoint, CheckpointDocument, CheckpointEdge,
67    CheckpointNode, CheckpointNodeTheme, CheckpointTheme, Event, EventLog, EventLogError,
68    MaterializedState, RebuildResult,
69};
70pub use export::{
71    filter_graph_by_ids, filter_graph_from_roots, generate_pr_writeup, graph_to_dot,
72    parse_node_range, DotConfig, WriteupConfig,
73};
74pub use hooks::{hooks_status, install_hooks, integration_status, uninstall_hooks};
75pub use narratives::PivotChain;
76pub use opencode::{install_opencode, opencode_status, uninstall_opencode, update_opencode};
77pub use pulse::PulseReport;
78
79// Re-export TS trait for downstream use
80#[cfg(feature = "ts-rs")]
81pub use ts_rs::TS;
82
83#[cfg(test)]
84mod tests {
85    use super::*;
86
87    #[test]
88    fn test_public_exports() {
89        // Verify core types are re-exported from crate root
90        let _ = CURRENT_SCHEMA;
91    }
92}