Local-first design · routing heuristics · natural language
A scheduler that answers one question: which day costs the least driving
One operator, one vehicle, recurring customers spread across a region. Given a job that needs scheduling, route-book ranks the candidate days by what adding that job actually costs — and says why, in a sentence, so the answer can be argued with.
The failure mode of a solo trade is not a bad route. It is a bad week.
The problem
A solo mobile service is a one-vehicle routing problem with human constraints. The operator already knows what has to be done. The expensive question is when — and more precisely, which day each job lands on, because that decision is what decides the driving.
Three customers in three towns on three different days is six crossings of the region. The same three on one day is one loop. The operator can feel this and cannot compute it, because the inputs are a dozen addresses, a fortnight of recurrences, and a mental map of the roads in between.
So the tool has exactly one job worth having: given a job that needs scheduling, say which day costs the least travel while still being a reasonable day to work. Everything else — the customer list, the calendar, the confirmations — is infrastructure for that decision.
How it works
A sentence goes in. One day comes out, with its reasoning attached. The model in the middle is doing the smallest job on the page.
when: “next Thursday” is the job it is reliably good at, and the result is checkable at a glance.The number the whole thing turns on is not how far is this customer but what does adding this job to this day cost:
insertion_cost(day, job) = travel(prev → job)
+ travel(job → next)
− travel(prev → next)
Two consequences of taking that seriously. A day is treated as a timeline, not a list of jobs — so changeover is modelled (packing up, locking up, loading, and the two minutes of conversation at the door that every real job ends with), a mid-day break is placed in the first feasible gap, and there are two day ceilings rather than one, because nine elapsed hours and seven hands-on hours are different numbers. And feasibility is a filter, never a score term: a day that fails the timeline inequality is discarded before scoring. A cheap day you cannot physically drive is not a low-scoring day; it is not a candidate.
What made it interesting: two decisions, and only one of them is automatic
A scheduler can be locally optimal and globally myopic. Add-one-job-at-a-time never reconsiders a job already placed, so a week can settle into a shape that is twenty minutes worse than necessary and stay there — and the standard fix, a true solver, is a heavy dependency for a problem this size: a few dozen customers with strong geographic clustering, which is exactly the regime where cheapest-insertion plus 2-opt lands within a few percent of optimal.
The interesting part is not the algorithm. It is that the gap is made visible instead of hidden, and split along the line where a human actually wants control.
That last one is a design rule rather than a feature. If the routing service is unreachable, the tool falls back to straight-line distance times a road factor — and says so on the answer, because a number that looks measured and isn't is worse than an admitted estimate. The operator disagrees with rankings sometimes; they should be able to read why in one sentence and change a weight.
What it saves
The saving is driving, and driving is the one cost in a solo trade that is purely a function of scheduling. Cleaning a house has to be done; crossing the region twice does not.
So the saving scales with two things, and both are facts about a working week rather than about the software — how many jobs there are, and how much driving each one gives back when it lands on the day that already works its area. The arithmetic is trivial, which is rather the point:
| jobs / week | 5 min each | 10 min each | 15 min each | 25 min each |
|---|---|---|---|---|
| 5 | 1.8 | 3.6 | 5.4 | 9.0 |
| 10 | 3.6 | 7.2 | 10.8 | 18.1 |
| 15 | 5.4 | 10.8 | 16.2 | 27.1 |
| 20 | 7.2 | 14.4 | 21.7 | 36.1 |
Hours, not a measurement. Pick the row and column that match reality.
Ten jobs a week at ten minutes each is most of a working day recovered every month, in the seat of a van rather than at a desk. The second-order saving is the one that matters more and counts worse: the decision itself stops being a guess, so it stops being re-made. The schedule lands in the calendar the operator already reads, over a standard feed they subscribe to once — no second app to check, and nothing to remember.
There is no headline number here, deliberately. Nobody wrote down what this week's driving cost before the tool existed, and a figure I invented would be worth less than no figure at all. That is why the table is a table of inputs: the mechanism is real, the multiplication takes seconds, and the two numbers belong to whoever runs the week.
What it does not do
The boundary is a feature, so it is worth stating plainly. It is not an invoicing system — it emits hours and does not chase payment. It is not a customer-facing booking portal, and not multi-worker: the data model leaves room, the optimiser assumes one vehicle. It is not live-traffic aware; travel times are free-flow, and the tool says so rather than pretending to a precision it cannot have. It is not a customer relationship manager, and it is not a calendar application — no month grid, no competition with the one you already use.
The privacy boundary is part of the same list, and it is where the tool holds other people's data:
- Door codes and alarm codes are never stored. A scheduling tool does not need them, so the setup wizard offers a free-text “how to get in” field and explicitly tells the operator not to put a code in it. The export cannot leak what was never written down.
- No addresses ever enter a calendar event. The feed says who and when; where stays on the machine that made it. Event titles can be set to initials for a feed that syncs through someone else's server, because on a subscription the customer's name travels with the file.
- The model never carries the customer list. Names resolve to identifiers locally and resolve before any model call, so what leaves the machine is an identifier, a verbatim date expression and a duration.
- Two outbound calls, both optional and both disclosed: geocoding, which sees addresses, and routing, which sees coordinates only. Both can be pointed at a self-hosted service, and the tool works with neither — it degrades, and labels the result approximate.
- Everything local. One SQLite database in the plugin's own data directory, with a one-command export to CSV and JSON, because a customer list should not be trapped in one program's database.
Facts, in a form you can check
| Language & licence | Python, standard library only — no third-party dependencies · MIT |
|---|---|
| Surface | A Hermes Agent plugin: 14 tools, a slash command, a CLI subcommand, and a bundled agent skill |
| Answer path | The model parses the sentence; every date, distance, filter and score is computed in code |
| Without a model | A deterministic parser handles the whole surface, and doubles as the test oracle |
| Feasibility | Candidate days that fail the timeline inequality are discarded before scoring, never penalised |
| Storage | Local SQLite in the plugin's own data directory · export to CSV and JSON on one command |
| Calendar | A subscribable .ics feed — Apple, Google, Fastmail, Nextcloud, Outlook. No account, no API key |
| Voice | Two Siri Shortcuts; a spoken booking is read back aloud and confirmed before it is written |
| Tests | 226 tests across nine modules, offline and deterministic |
| Distribution | Open source on GitHub, MIT — hermes plugins install aclayton/route-book |
The code is public: github.com/aclayton/route-book — written for a reader rather than for an installer.
Next: Automated bug investigation →