-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
Description
Context
Part of the --suggest recommendations engine (see #135). Depends on #137, #138.
What to Build
1. src/suggest/config.rs — SuggestConfig
Load configuration from .semfora/suggest.yaml (fall back to defaults if absent):
pub struct SuggestConfig {
pub rules: HashMap<String, RuleConfig>, // per-rule enable/disable + thresholds
pub groups: HashMap<String, bool>, // group-level enable/disable
pub confidence_threshold: f64, // global minimum confidence (default: 0.0)
pub scope: ScopeConfig, // include/exclude paths
pub precommit: PrecommitConfig, // pre-commit settings (used in Phase 4)
}
pub struct RuleConfig {
pub enabled: bool,
pub threshold: Option<f64>, // rule-specific threshold override
}
pub struct ScopeConfig {
pub include: Vec<String>, // glob patterns
pub exclude: Vec<String>, // glob patterns
}2. Config file format
.semfora/suggest.yaml:
rules:
combine-functions: true
dead-code: true
complexity-reduction:
enabled: true
threshold: 15
rename-for-discoverability: false
groups:
naming: false
confidence_threshold: 0.7
scope:
include: ["src/"]
exclude: ["src/generated/", "vendor/"]3. Integration
SuggestEngine::new()loads config from.semfora/suggest.yamlif present- Rules check
config.rules[name].enabledandconfig.groups[group]before evaluating - Scope filtering: skip symbols outside
scope.include/ insidescope.exclude semfora config suggest --initgenerates a default config file
4. CLI overrides
--suggest-confidence 0.8to override confidence threshold from CLI--suggest-group duplicatesto run only one group
Acceptance Criteria
- Config loads from
.semfora/suggest.yamlwith serde - Missing config file = all defaults (everything enabled, threshold 0.0)
- Individual rule enable/disable works
- Group enable/disable works
- Confidence threshold filtering works
- Scope include/exclude filters symbols correctly
-
semfora config suggest --initcreates default config - Unit tests for config parsing, including partial configs
References
- Architecture: Research: Recommendations Engine Architecture (--suggest system) #135
- Existing config pattern:
src/config.rs
Reactions are currently unavailable