Skip to content

feat(sequences): re-run cone matching when relabeling back to wildfire_smoke#585

Draft
MateoLostanlen wants to merge 4 commits intomainfrom
feat/relabel-wildfire-reattach
Draft

feat(sequences): re-run cone matching when relabeling back to wildfire_smoke#585
MateoLostanlen wants to merge 4 commits intomainfrom
feat/relabel-wildfire-reattach

Conversation

@MateoLostanlen
Copy link
Copy Markdown
Member

  • Context: when a sequence is mis-labeled as non-wildfire (e.g. other_smoke), it's detached from its triangulating alert and a fresh single-sequence alert is created. Reverting the label to wildfire_smoke previously left the sequence stuck in that lonely alert, breaking triangulation. This PR makes the revert path drop the lonely alert and re-run cone matching so the sequence merges back with its overlapping neighbours.
  • Anchor the candidate-sequence window on the sequence's own last_seen_at (not utcnow()) so relabels done hours later still find the original neighbours within SEQUENCE_RELAXATION_SECONDS.
  • Rename _attach_sequence_to_alertattach_sequence_to_alert and extract _detach_sequence_from_alerts to deduplicate the detach/refresh block.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 5, 2026

Codecov Report

❌ Patch coverage is 95.23810% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 89.80%. Comparing base (b4fa415) to head (bb5893b).

Files with missing lines Patch % Lines
src/app/api/api_v1/endpoints/sequences.py 94.11% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #585   +/-   ##
=======================================
  Coverage   89.80%   89.80%           
=======================================
  Files          55       55           
  Lines        2422     2432   +10     
=======================================
+ Hits         2175     2184    +9     
- Misses        247      248    +1     
Flag Coverage Δ
backend 89.77% <95.23%> (+<0.01%) ⬆️
client 90.40% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant