Skip to content

feat: Watch Duty enrichment: WD names, app links, drop cause line (Group A) - #167

Merged
zvx-echo6 merged 1 commit into
mainfrom
feat/watchduty-enrichment
Sep 16, 2026
Merged

zvx-echo6 merged 1 commit into
mainfrom
feat/watchduty-enrichment

Conversation

@zvx-echo6

Copy link
Copy Markdown
Owner

Summary

Watch Duty enrichment for WFIGS fire alerts (Group A of 3). Watch Duty never creates a fire; its incidents are matched to fires meshai already tracks, by location only. The WFIGS name can be a placeholder like "IA 2" while Watch Duty calls the same fire "Buckhorn Fire", so name matching does not work.

  • Matched fires use Watch Duty's name and end with the Watch Duty app link on its own line. The link is never truncated; other lines are trimmed first.
  • The Cause/Discovered line is removed from all fire alerts.
  • Polling happens only while there is something to poll for; zero requests otherwise. It backs off on errors, and Watch Duty failures never affect WFIGS alerts.
  • Migration v31 includes the columns and table for the evacuation (B) and report (C) groups.
  • environmental.watchduty.enabled defaults to false. Enabling it is a config change after deploy.

Notes

  • Watch Duty has no public API. This uses the app's own endpoint with app-style headers (same approach as Integration: WatchDuty app alerts agessaman/meshcore-bot#175). app_version is a hot setting in case they start requiring a newer client version.
  • fires.status is never written, and the native path never emits the all-clear, so the all-clear changes here are currently inert.
  • Example rendered update for a matched fire (106 of 140 chars): "Buckhorn Fire -- Update / 161 ac, containment 27% / 20 mi NW of Fairfield / https://app.watchduty.org/i/119989"

Tests

2151 passed, 0 failed (baseline 2090). New: test_watchduty_helpers, test_watchduty_match, test_watchduty_adapter, test_watchduty_render. Updated: the Cause/Discovered assertions now assert absence; the ADAPTER_META count went from 23 to 24.

🤖 Generated with Claude Code

https://claude.ai/code/session_01CfJYSn4wcmPKhVb6MfSQnr

…oup A)

Adds Watch Duty (watchduty.org) as an enrichment source for WFIGS fires
meshai already tracks. It never creates a fire.

- env/watchduty.py: client for WD's app API, location-only one-to-one
  matching (default 3 km, prescribed burns skipped), match stored on the
  fires row. Polls only while matched fires are active or recently
  broadcast fires are unmatched; zero requests otherwise. Backoff on
  errors. An immediate lookup runs after each WFIGS New/Update emit.
- Fire alerts about a matched fire use Watch Duty's name and end with the
  WD app link on its own line; the link is never truncated
  (fit_to_budget_with_suffix). Applies to incident, growth, halted and
  spotting alerts.
- Removes the Cause/Discovered line from all fire alerts (rendering only;
  DB columns kept).
- Migration v31: watchduty_* columns on fires (including evacuation
  columns for the next group) and the watchduty_reports_sent table.
- Settings: environmental.watchduty (enabled, default off; tick_seconds
  900) and hot adapter_config keys match_radius_km,
  recency_window_seconds, app_version.

Evacuation alerts (Group B) and report messages (Group C) follow in
separate PRs.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CfJYSn4wcmPKhVb6MfSQnr
@zvx-echo6
zvx-echo6 merged commit 37d6338 into main Sep 16, 2026
1 of 2 checks passed
@zvx-echo6
zvx-echo6 deleted the feat/watchduty-enrichment branch September 16, 2026 20:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant