Commit graph

10 commits

Author SHA1 Message Date
kianiadee
0f91668256 Contract checker (#13, PRD F1.10) + contract_drift_days SLO
Some checks are pending
build / lint-test (push) Waiting to run
build / build-push (push) Blocked by required conditions
Migration 18: ops.contract_check_log table — append-only log of probes
against the Tracksolid Pro endpoints we depend on.

New worker app/workers/contract_check.py — per run:
  - jimi.oauth.token.get   (token refresh succeeds)
  - jimi.user.device.location.list per configured target (parse first item
    with JimiPollFix)
  - jimi.device.location.get with a sample IMEI from the list (parse first
    item with JimiPollFix)
Each probe logs success or {error_class, error_detail, sample}; failures
are recorded, not raised.

slo_metrics now also computes contract_drift_days = days since the most-
recent successful probe of the laggard endpoint. With threshold 1d (from
mig 5), a single failed daily run flips the badge red within 24h.

cron entrypoint registers the check daily at 02:00 UTC plus once on
startup, gated on TRACKSOLID_APP_KEY + a configured target.
2026-05-27 11:58:29 +03:00
kianiadee
495bb2bd71 Rollback CSV roster import (mig 17): re-split vehicles, drop CSV columns
Some checks failed
build / lint-test (push) Has been cancelled
build / build-push (push) Has been cancelled
The CSV-based roster import (mig 15+16 and scripts/import_csv_roster.py)
merged vehicle rows that differed only by _Track / _CAM suffix, dropping
the active fleet count from 144 to 124. Reverting the whole thing.

Mig 17 in one transaction:
  - Re-splits devices by parsed plate from device_name (same regex as
    mig 14, preserving _Track as separate vehicle)
  - Restores serve.fn_live_view to its v3 body (no d.driver_name/phone
    refs that would break once the columns are gone)
  - Drops the six CSV-only columns from domain.devices
  - Deletes schema_migrations rows for the deleted 15/16
  - Logs final counts via RAISE NOTICE

Apply on VPS: psql -f db/migrations/20260601000017_rollback_csv_import.sql
2026-05-25 00:41:32 +03:00
kianiadee
4cc0ef0535 Roster import: COALESCE-fill API-managed fields (device_type/lifecycle/activation_at/model) on existing rows; CSV is authoritative only for driver/phone/iccid/expiration/device_group
Some checks are pending
build / lint-test (push) Waiting to run
build / build-push (push) Blocked by required conditions
2026-05-24 03:59:32 +03:00
kianiadee
6fd0d84560 Plate consolidation migration + projector links new devices to existing plates; SLO measurement worker (task #12)
Some checks are pending
build / lint-test (push) Waiting to run
build / build-push (push) Blocked by required conditions
2026-05-23 23:42:45 +03:00
kianiadee
8323f94a19 _driver_name: also exclude garage/workshop/service placeholders
Some checks are pending
build / lint-test (push) Waiting to run
build / build-push (push) Blocked by required conditions
2026-05-23 23:16:17 +03:00
kianiadee
9852eff985 Popup: pre-emptive driver-name extraction from device_name (until P3 roster lands)
Some checks are pending
build / lint-test (push) Waiting to run
build / build-push (push) Blocked by required conditions
2026-05-23 23:13:46 +03:00
kianiadee
2b428e8058 Migration: serve._label_short() extracts plate-tail (handles 'Driver - KDW 573B_cam' patterns)
Some checks are pending
build / lint-test (push) Waiting to run
build / build-push (push) Blocked by required conditions
2026-05-23 23:11:20 +03:00
kianiadee
45974b3810 Geocoder: cron job + state.geocoded_positions; label uses device_name last 4 (fallback plate); popup address row
Some checks are pending
build / lint-test (push) Waiting to run
build / build-push (push) Blocked by required conditions
2026-05-23 23:06:25 +03:00
kianiadee
6c5ba3b22b UI: arrow + plate-short label + cost-centre marker palette + hover popup; richer state.live_positions + serve.fn_live_view v2; multi-target poll plumbing
Some checks are pending
build / lint-test (push) Waiting to run
build / build-push (push) Blocked by required conditions
2026-05-23 09:29:04 +03:00
kianiadee
1fb2a5be5e Phase 1 — foundation, push gateway, parser, projector, live view, frontend 2026-05-23 00:53:42 +03:00