Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions crates/edda-ledger/src/ledger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,17 @@ impl Ledger {
self.sqlite.village_stats(village_id, after, before)
}

/// Detect recurring patterns in a village's decision history.
pub fn detect_village_patterns(
&self,
village_id: &str,
after: &str,
min_occurrences: usize,
) -> anyhow::Result<Vec<crate::sqlite_store::DetectedPattern>> {
self.sqlite
.detect_village_patterns(village_id, after, min_occurrences)
}

/// Find the active decision for a specific key on a branch.
pub fn find_active_decision(
&self,
Expand Down
4 changes: 2 additions & 2 deletions crates/edda-ledger/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ pub use ledger::Ledger;
pub use lock::WorkspaceLock;
pub use paths::EddaPaths;
pub use sqlite_store::{
BundleRow, ChainEntry, DecideSnapshotRow, DecisionRow, DepRow, DeviceTokenRow, ImportParams,
SuggestionRow, TaskBriefRow,
BundleRow, ChainEntry, DecideSnapshotRow, DecisionRow, DepRow, DetectedPattern, DeviceTokenRow,
ImportParams, PatternDetectionResult, PatternType, SuggestionRow, TaskBriefRow,
};
pub use tombstone::{append_tombstone, list_tombstones, make_tombstone, DeleteReason, Tombstone};
pub use view::DecisionView;
Loading
Loading