Fix interstate detection: use carrier_operation code A, not text match

FMCSA census carrier_operation is single-letter: A=Interstate,
B=Intrastate Hazmat, C=Intrastate Non-Hazmat. Previous code searched
for "interstate" in text which never matched. Now 22,089 interstate
carriers will be properly flagged for IRP/IFTA.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
justin 2026-05-29 14:01:18 -05:00
parent 3b2ae6b050
commit 4aff121c0b
2 changed files with 6 additions and 3 deletions

View file

@ -163,7 +163,8 @@ def flag_carriers(dry_run: bool = False) -> dict:
stats["zero_fleet"] += 1
# State-level flags based on carrier's physical state
is_interstate = carrier_op and "interstate" in (carrier_op or "").lower()
# carrier_operation: A = Interstate, B = Intrastate Hazmat, C = Intrastate Non-Hazmat
is_interstate = (carrier_op or "").upper() == "A"
sr = state_reqs.get(state) if state else None
if sr:
# Interstate carriers need IRP and IFTA