pub struct FeatureScanner { /* private fields */ }Expand description
Scans .trees/ for active worktrees and .coda/ for merged features.
Implementations§
Source§impl FeatureScanner
impl FeatureScanner
Sourcepub fn new(project_root: &Path) -> Self
pub fn new(project_root: &Path) -> Self
Creates a scanner for the given project root.
The scanner looks for active features in <project_root>/.trees/
and merged features in <project_root>/.coda/.
Sourcepub fn list(&self) -> Result<Vec<FeatureState>, CoreError>
pub fn list(&self) -> Result<Vec<FeatureState>, CoreError>
Lists all features: active (from .trees/) and merged (from .coda/).
Active features come from worktree state files at
.trees/<slug>/.coda/<slug>/state.yml. Merged features come from
.coda/<slug>/state.yml on the main branch. If a slug appears in
both locations, the active worktree version takes precedence.
Invalid or unparseable state files are silently skipped. Results are sorted by slug within each group.
§Errors
Returns CoreError::ConfigError if neither .trees/ nor .coda/
exists.
Sourcepub fn get(&self, feature_slug: &str) -> Result<FeatureState, CoreError>
pub fn get(&self, feature_slug: &str) -> Result<FeatureState, CoreError>
Returns the state for a specific feature identified by its slug.
Looks up .trees/<slug>/.coda/<slug>/state.yml first (active),
then falls back to .coda/<slug>/state.yml (merged).
§Errors
Returns CoreError::ConfigError if .trees/ does not exist, or
CoreError::StateError if no matching feature is found.