Commit Graph
7 Commits
Author SHA1 Message Date
Magnus Hedemarkandusername b030f2607c feat(raleigh): add official public safety statistics 2026-07-26 18:30:09 -04:00
username 4eaf5aa7ea feat(raleigh): add guarded fire report lookups 2026-07-26 18:07:23 -04:00
Magnus HedemarkGitHubmagnus919 <magnus919>
1f5cd6a91c feat(raleigh): add fire protection proximity lookup (#144)
Co-authored-by: magnus919 <magnus919>
2026-07-25 01:48:53 -04:00
Magnus HedemarkGitHubmagnus919 <magnus919>
d4ab656c50 feat(raleigh): add Raleigh-Wake ECC active incident feed adapter (#142)
* feat(raleigh): add Raleigh-Wake ECC active incident feed adapter

Add an isolated, capability-limited adapter for the RWECC public
incident feed (incidents.rwecc.com/getdata). The adapter:

- Calls only the fixed public host and exact read-only endpoint
- Supports agency, incident type, and bounded result filters
- Preserves source identifiers without implying a historical archive
- Labels every response as a filtered active feed, not all 911 calls
- Fails/warns distinctly on empty, stale, malformed, and unavailable
  responses; empty feed is not reported as proof of no incidents
- Deduplicates records and guards against schema drift
- Can be disabled independently via RALEIGH_DISABLE_INCIDENTS=1
- Uses a 90-second cache lifetime

Closes #123

* chore: regenerate catalog artifacts for updated raleigh description

---------

Co-authored-by: magnus919 <magnus919>
2026-07-25 01:23:48 -04:00
Magnus HedemarkGitHubmagnus919 <magnus919>
0ca5c242ce feat(raleigh): add first-class RFD incident workflows and normalize the 2026 schema (#140)
Add a fire command group with two subcommands (incidents, response-times)
that resolve the stable ArcGIS item IDs for RFD's full public history
(2007–present) and past-month feeds, with source-aware filtering and a
normalization layer for the 2026 classification schema transition.

- New raleighlib/fire.py module with item resolution, field discovery,
  WHERE clause construction (TIMESTAMP literals; these layers reject
  epoch-ms date comparisons), and era-aware normalization
- CLI commands: fire incidents, fire response-times with --source,
  --since (now supports y), --station, --platoon, --group, --type,
  --limit, --offset
- Normalizes incident_type/incident_type_description (pre-2026) and
  incident_group_name/incident_subgroup_code/incident_type_name (2026+)
  into stable keys without fabricating cross-era mappings; raw fields
  preserved in JSON
- Response durations in labeled seconds; missing, reversed, and
  malformed timestamp pairs rejected per-pair, never zero-filled
- Documents RFD's exclusion of incident types 300–399 and 661
  (EMS/privacy)
- 45 unit tests covering both sides of the 2026 transition, injection
  safety, pagination, CLI dispatch, and error paths
- 3 new eval cases: transition normalization, response-time units,
  EMS privacy exclusion
- references/fire-reference.md with schemas, transition rules, caveats

Closes #122

Co-authored-by: magnus919 <magnus919>
2026-07-25 00:44:19 -04:00
Magnus HedemarkGitHubmagnus919 <magnus919>
50be18b8c2 feat(raleigh): add first-class RPD incident workflows (#139)
Add a police command group with four subcommands (incidents, recent,
previous-day, history) that resolve stable ArcGIS item IDs at runtime
and provide source-aware, filter-friendly access to RPD incident data.

- New raleighlib/police.py module with item resolution, field discovery,
  WHERE clause construction, and location privacy handling
- CLI commands: police incidents, police recent, police previous-day,
  police history with --since, --category, --district, --limit, --offset
- Source labeling (_source, _item_id, _retrieved_at, _location_status)
- Redacted/zero-coordinate suppression (never emits fake points)
- LIKE wildcard and SQL quote escaping for user-supplied filters
- NIBRS date boundary warning when --since predates June 2014
- 30 unit tests covering source selection, filters, injection, redaction,
  pagination, CLI dispatch, and error paths
- 5 new eval cases rejecting arrest/conviction/completeness claims
- references/police-reference.md with field schemas and caveats

Closes #121

Co-authored-by: magnus919 <magnus919>
2026-07-25 00:16:50 -04:00
magnus919 903ea0559e feat(raleigh): expand civic data skill 2026-07-23 21:11:44 -04:00