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 diff;
46pub mod events;
47pub mod export;
48pub mod github;
49pub mod hooks;
50pub mod init;
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 diff::{
66    ApplyResult, GraphPatch, PatchDocument, PatchEdge, PatchNode, PatchNodeTheme, PatchTheme,
67};
68pub use events::{
69    generate_edge_id, get_current_author, Checkpoint, CheckpointDocument, CheckpointEdge,
70    CheckpointNode, CheckpointNodeTheme, CheckpointTheme, Event, EventLog, EventLogError,
71    MaterializedState, RebuildResult,
72};
73pub use export::{
74    filter_graph_by_ids, filter_graph_from_roots, generate_pr_writeup, graph_to_dot,
75    parse_node_range, DotConfig, WriteupConfig,
76};
77pub use hooks::{hooks_status, install_hooks, integration_status, uninstall_hooks};
78pub use narratives::PivotChain;
79pub use opencode::{install_opencode, opencode_status, uninstall_opencode, update_opencode};
80pub use pulse::PulseReport;
81
82// Re-export TS trait for downstream use
83#[cfg(feature = "ts-rs")]
84pub use ts_rs::TS;
85
86#[cfg(test)]
87mod tests {
88    use super::*;
89
90    #[test]
91    fn test_public_exports() {
92        // Verify core types are re-exported from crate root
93        let _ = CURRENT_SCHEMA;
94    }
95}