-
Notifications
You must be signed in to change notification settings - Fork 23
feat: per-fault_code debounce threshold configuration #275
Description
Summary
PR #274 adds per-entity debounce thresholds (longest-prefix matching on source_id). This works well when subsystems have distinct fault codes, but has a subtle limitation: the debounce counter is per-fault_code, while config resolution is per-source_id. When two entities with different configs report the same fault_code, the last reporter's config determines the status transition - bypassing the other entity's debounce policy.
Per-fault_code threshold configuration would complement per-entity thresholds by mapping directly to how faults are stored (each fault_code has its own counter), avoiding cross-entity interference entirely.
Proposed solution (optional)
Add a fault_thresholds section to the entity thresholds YAML config (or a separate file) that maps fault codes to debounce overrides:
# fault_thresholds.yaml
MOTOR_OVERHEAT:
confirmation_threshold: -5
healing_threshold: 10
LIDAR_FAIL:
confirmation_threshold: -1
healing_threshold: 1Resolution priority: fault_code override > entity override > global default.
This would reuse the existing DebounceConfig/EntityDebounceOverride infrastructure. The resolver would check fault_code first (exact match), then fall back to the existing source_id longest-prefix matching.
Additional context (optional)
- Relates to Per-entity confirmation and healing thresholds #269 and PR feat: per-entity confirmation and healing thresholds #274
- Per-entity thresholds are useful when you don't know fault codes ahead of time but know which subsystems are noisy
- Per-fault_code thresholds are useful when you know your fault codes and want precise control without cross-entity interference
- Both approaches can coexist