Skip to content

Cal drift: threshold-based alerts on new cal runs #58

@RFingAdam

Description

@RFingAdam

Background

The v1 drift tracker auto-captures every active-cal generation and lets operators compare any two runs manually. It does not proactively flag when a new run crosses an operator-defined drift threshold vs. historical baseline.

Goal

When a new cal is auto-captured, automatically compare it against a rolling reference (e.g. 12-month median) and raise an alert when H or V pol drift crosses a configurable threshold (default: any point > 1 dB from reference).

Acceptance Criteria

  • New settings in ~/.config/RFlect/user_settings.json under cal_drift.thresholds: warn_db (default 0.5), alert_db (default 1.0), baseline_policy ("first" | "previous" | "rolling_median_12mo"), enabled (default true).
  • cal_drift.record_run() runs a post-capture evaluation when thresholds are enabled and the new run has a comparable historical run; writes alert_triggered + alert_details columns to runs.csv.
  • GUI dialog shows a red-dot badge on rows where alert_triggered != "".
  • Optional: OS notification (via plyer or similar) or an entry in a cal_drift_alerts.log file when triggered.
  • MCP: cal_drift_list_alerts() tool returning alerted runs.
  • Tests: inject a shift > 1 dB, assert alert_triggered is populated.
  • Documentation in the dialog's help tooltip + MCP help resource describes threshold configuration.

Notes

  • Keep alerting opt-in-ish: enabled = true by default but the first run of each band is a no-op (no comparable history yet).
  • Consider per-antenna / per-band threshold overrides — some bands legitimately drift more (e.g. 5.8 GHz chamber modes).

Related: v1 tracker at plot_antenna/cal_drift.py, auto-capture hook in plot_antenna/file_utils.py:generate_active_cal_file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions