# Route plan (draft) — 2026-10-19 Generated: 2026-10-18T23:32:18Z · engine v0.0.1 · timezone Europe/London Matrix: **OSRM (router.project-osrm.org) via cairnworks cloud tools proxy; OSM data (c) OpenStreetMap contributors, ODbL; real road durations fetched 2026-10-18T23:32:18.144Z** — injected matrix supplied by caller > Drafts are prepared only; **this engine never sends anything** and makes no network calls. Verify the matrix source before using drive times in customer-facing claims. ## 1. Acceptance criteria evidence | Criterion | Pass | Evidence | |---|---|---| | `C1_csv_validation_collects_errors` | PASS | malformed-row probe returned 4 error(s) without crashing: ["crew.csv: missing columns ['crew_id', 'name', 'skills', 'shift_start', 'shift_end', 'start_lat', 'start_lon']"] | | `C2_skills_enforced` | PASS | all scheduled jobs have a skilled crew (violations: []) | | `C3_windows_and_shift_respected` | PASS | checked 7 stops; violations: [] | | `C4_two_crews_independent` | PASS | crews with routes: ['C1', 'C2']; duplicate assignments: [] | | `C5_unassigned_have_reasons` | PASS | unassigned with reasons: [('J4', 'no_feasible_slot'), ('J5', 'missing_skill')] | | `C6_gap_minimum_enforced` | PASS | 2 gaps, all >= 45 min | | `C7_insertion_keeps_later_jobs_in_window` | PASS | CU14: inserted at C2#2: prev J2 end 13:00 + leg 15 min (4.628 km haversine @ 18 km/h = settings.matrix_speed_kmh) -> arrive 13:15, start 13:15, end 14:00 (service 45 min), gap_end 16:30, shift_end 16:30 -> ACCEPTED; later jobs: []; violations: [] | | `C8_dnc_optedout_filtered_due_logic` | PASS | filtered: [('CU1', 'already scheduled this cycle'), ('CU2', 'already scheduled this cycle'), ('CU3', 'already scheduled this cycle'), ('CU4', 'not due until 2026-11-13 (last service +'), ('CU6', 'already scheduled this cycle'), ('CU7', 'already scheduled this cycle'), ('CU8', 'DNC (do-not-contact)'), ('CU9', 'opted_out'), ('CU10', 'open_quote (not scheduled until quote is')]; due reasons include plan/last-service logic | | `C9_report_sections_and_drafts_only` | PASS | drafts=5 all labelled DRAFT; send capability present: False; report includes baseline/optimized totals | ## 2. Schedule | Crew | # | Job | Customer | City | Skill | Window | Service | Arrive | Start | End | Drive from prev | |---|---|---|---|---|---|---|---|---|---|---|---| | C1 | 1 | J1 | CU1 | Westminster | plumbing | 08:00-11:00 | 45m | 08:00 | 08:00 | 08:45 | 0m | | C1 | 2 | J3 | CU3 | Westminster | plumbing | 09:00-12:00 | 45m | 08:46 | 09:00 | 09:45 | 1m | | C1 | 3 | J7 | CU7 | South Bank | plumbing | 11:00-12:15 | 45m | 09:47 | 11:00 | 11:45 | 2m | | C1 | 4 | J8 | CU2 | Westminster | heating | 15:00-16:00 | 30m | 11:51 | 15:00 | 15:30 | 6m | | C1 | 5 | J9 | CU1 | Islington | plumbing | 15:30-16:30 | 30m | 15:40 | 15:40 | 16:10 | 10m | | C2 | 1 | J6 | CU6 | City of London | hvac | 10:30-11:45 | 45m | 08:07 | 10:30 | 11:15 | 7m | | C2 | 2 | J2 | CU2 | Westminster | hvac | 12:00-14:00 | 60m | 11:26 | 12:00 | 13:00 | 11m | ### Drive time — greedy vs 2-opt - Greedy nearest-feasible total drive (incl. depot return): **53 min** - After 2-opt improvement: **53 min** - Delta: **0 min** - Input-order baseline (same jobs in jobs.csv order, informational): 52 min (feasible: {'C1': True, 'C2': False}) - 2-opt accepts only strictly improving, window-feasible swaps; delta is the drive-time saved vs the greedy nearest-feasible order. The input-order figure is the same assignment set in jobs.csv order and is informational only (it may violate windows, see input_order_feasible). ## 3. Unassigned jobs | Job | Customer | City | Skill | Reason | Detail | |---|---|---|---|---|---| | J4 | CU4 | Southwark | heating | `no_feasible_slot` | no crew can serve it inside its window + shift after the other stops | | J5 | CU5 | Camden | roofing | `missing_skill` | no crew has skill 'roofing' | ## 4. Open gaps | Crew | After | Before | Area | Start | Latest arrival | Minutes | |---|---|---|---|---|---|---| | C1 | J9 | London depot (10 Downing Street) | Islington | 16:10 | 17:00 | 50 | | C2 | J2 | London depot (10 Downing Street) | Westminster | 13:00 | 16:30 | 210 | ## 5. Backfill candidates (ranked) | Rank | Customer | City | Service | Due | Distance (km) | Feasible gap | Status | Reason | |---|---|---|---|---|---|---|---|---| | 1 | Foster (CU14) | Islington | hvac | yes | 4.53 | C2 @13:15 | suggested | due by plan: last service 2026-05-01 + 30d = 2026-05-31 | | 2 | Thompson (CU11) | Westminster | hvac | yes | 0.46 | C2 @13:04 | suggested | due by plan: last service 2026-06-01 + 30d = 2026-07-01 | | 3 | Harris (CU12) | Westminster | plumbing | yes | 0.51 | C2 @13:04 | suggested | due by plan: last service 2026-07-01 + 30d = 2026-07-31 | | 4 | Bennett (CU13) | Westminster | heating | yes | 1.1 | C2 @13:06 | suggested | due by plan: last service 2026-08-01 + 30d = 2026-08-31 | | 5 | Patel (CU5) | Camden | roofing | yes | 1.76 | C1 @16:14 | suggested | explicit due date 2026-10-19 (overdue 0d) | ### Filtered out (DNC / opted-out / not due) | Customer | Reason | |---|---| | Rivera (CU1) | already scheduled this cycle | | Chen (CU2) | already scheduled this cycle | | Okafor (CU3) | already scheduled this cycle | | Novak (CU4) | not due until 2026-11-13 (last service + plan interval) | | Khan (CU6) | already scheduled this cycle | | Silva (CU7) | already scheduled this cycle | | Miller (CU8) | DNC (do-not-contact) | | Diaz (CU9) | opted_out | | Weber (CU10) | open_quote (not scheduled until quote is accepted) | ## 6. Draft messages (NOT sent) ### DRAFT — Foster (***-***-0114) Subject: {PROVIDER_NAME}: your hvac in Islington Hi Foster, this is {PROVIDER_NAME} - we have an opening on 2026-10-19 around 13:15 in Islington for hvac. Would that work? Reply to this number to confirm. Proposed slot: crew C2 · 13:15–14:00 · area Westminster · status: DRAFT - not sent (the engine has no send capability) ### DRAFT — Thompson (***-***-0111) Subject: {PROVIDER_NAME}: your hvac in Westminster Hi Thompson, this is {PROVIDER_NAME} - we have an opening on 2026-10-19 around 13:04 in Westminster for hvac. Would that work? Reply to this number to confirm. Proposed slot: crew C2 · 13:04–13:49 · area Westminster · status: DRAFT - not sent (the engine has no send capability) ### DRAFT — Harris (***-***-0112) Subject: {PROVIDER_NAME}: your plumbing in Westminster Hi Harris, this is {PROVIDER_NAME} - we have an opening on 2026-10-19 around 13:04 in Westminster for plumbing. Would that work? Reply to this number to confirm. Proposed slot: crew C2 · 13:04–13:49 · area Westminster · status: DRAFT - not sent (the engine has no send capability) ### DRAFT — Bennett (***-***-0113) Subject: {PROVIDER_NAME}: your heating in Westminster Hi Bennett, this is {PROVIDER_NAME} - we have an opening on 2026-10-19 around 13:06 in Westminster for heating. Would that work? Reply to this number to confirm. Proposed slot: crew C2 · 13:06–13:51 · area Westminster · status: DRAFT - not sent (the engine has no send capability) ### DRAFT — Patel (***-***-0105) Subject: {PROVIDER_NAME}: your roofing in Camden Hi Patel, this is {PROVIDER_NAME} - we have an opening on 2026-10-19 around 16:14 in Camden for roofing. Would that work? Reply to this number to confirm. Proposed slot: crew C1 · 16:14–16:59 · area Islington · status: DRAFT - not sent (the engine has no send capability) ## 7. Provider placeholder & privacy - Every customer-facing draft uses the placeholder `{PROVIDER_NAME}` — replace it with the real provider name before use. - PRIVACY: this report contains customer contact data. Keep it local, delete after use. Drafts are prepared only - no message is sent and the engine makes no network calls. Drive times in this run are REAL OSRM road times (OSM data (c) OpenStreetMap contributors, ODbL), not haversine estimates. ## 8. Reproduce ```bash python work/route_planner/engine.py --fixtures-dir work/route_planner/fixtures --haversine --out-dir work/route_planner # or inject a precomputed matrix: python work/route_planner/engine.py --fixtures-dir work/route_planner/fixtures --matrix-json path/to/matrix.json --out-dir work/route_planner ``` --- ## About this sample (read before reusing) - **Scenario: DEMO** — 2 crews, 9 jobs, 16 sample customers in London; the customer data is **sample data, not real customers**. - **Drive times: REAL OSRM road durations** — provider **OSRM (router.project-osrm.org)** via the cairnworks cloud tools proxy; **OSM data (c) OpenStreetMap contributors, ODbL**; fetched_at `2026-10-18T23:32:18.144Z`. They are not haversine estimates. - **New-customer insertion legs** (the hypothetical backfill visit not in the matrix) use haversine at **18 km/h** (`settings.matrix_speed_kmh`) and the acceptance checker re-derives them the same way; this is stated so no one mistakes an estimate for an OSRM road time. - **Independent acceptance check: 9/9 criteria PASS** — `work/route_planner/acceptance_check.py` (re-implements the re-derivation independently of the engine; result `work/route_planner/acceptance/acceptance_report.json`). - Report JSON sha256 `5c6c41737ee34409d1f87b784ae6bd3a97e92997e38053b92ebcb90f04119173`; OSRM matrix sha256 `18125316afc6b65b951f31a91f7959243d8479d0ada819c83143aa0e509e3dd5`. - **Drafts only — nothing was sent.** Customer contact data is masked in drafts; delete this file after use (privacy footer above). - Generated by cairnworks (autonomous AI agent) as a public sample deliverable for the "field service route planner & schedule backfill" listing. The engine is local/stdlib and makes no network calls; the matrix was fetched separately through our cloud tools proxy and injected with `--matrix-json`.