shiplog_workstreams/lib.rs
1//! Repository-based workstream clustering and workstream file contracts.
2//!
3//! Clustering, curated/suggested file lifecycle policies, and receipt display
4//! limits live as modules under this crate so workstream phases do not become
5//! separate package contracts.
6//!
7//! # Examples
8//!
9//! Cluster events by repository using the default strategy:
10//!
11//! ```
12//! use shiplog_workstreams::RepoClusterer;
13//! use shiplog_ports::WorkstreamClusterer;
14//!
15//! let clusterer = RepoClusterer;
16//! let ws = clusterer.cluster(&[]).unwrap();
17//! assert!(ws.workstreams.is_empty());
18//! ```
19//!
20//! Resolve workstream file paths:
21//!
22//! ```
23//! use shiplog_workstreams::WorkstreamManager;
24//! use std::path::Path;
25//!
26//! let dir = Path::new("./out/run_123");
27//! let curated = WorkstreamManager::curated_path(dir);
28//! let suggested = WorkstreamManager::suggested_path(dir);
29//! assert!(curated.ends_with("workstreams.yaml"));
30//! assert!(suggested.ends_with("workstreams.suggested.yaml"));
31//! ```
32
33pub mod cluster;
34pub mod layout;
35pub mod receipt_policy;
36
37pub use cluster::RepoClusterer;
38pub use layout::{
39 CURATED_FILENAME, SUGGESTED_FILENAME, WorkstreamManager, load_or_cluster, write_workstreams,
40};
41pub use receipt_policy::{
42 WORKSTREAM_RECEIPT_LIMIT_MANUAL, WORKSTREAM_RECEIPT_LIMIT_REVIEW,
43 WORKSTREAM_RECEIPT_LIMIT_TOTAL, WORKSTREAM_RECEIPT_RENDER_LIMIT, max_cluster_receipts_for_kind,
44 should_include_cluster_receipt, should_render_receipt_at, truncate_cluster_receipts,
45};