One run, three outputs, one memory
Every run read live fleet data, produced dashboards and messages, and wrote a JSON snapshot that the next run read back — the only thing that let a stateless twice-daily job behave like it remembered yesterday.
Per run: main ops dashboard · GPS scan map · two partner reports · schedule comparison · worker registry · OOB rebalance worklist (xlsx + self-contained SVG map).
Schedule vs. presence, cross-checked three ways
Every run cross-referenced the official Homebase schedule, a schedule inferred from 14 days of scan patterns, and live scans today. The day was classified 🟢 / 🟡 / 🔴, and only the last two ever triggered an alert.
Auto-generated message
Illustrative — reconstructed from sanitized production message examples. Try the toggle above.
Accountability without adversarial alerts
External operators set their own schedules — a gap on a low-demand day is planned downtime, not a no-show. Alerts were gated on demand context, deduped via a persisted alert_sent_today flag, and never used the words "alert" or "warning" in partner-facing text.
Meaningful gap → sent (demand was real)
Softer signal → heads-up, not an alert
Quiet day, zero bounties → no message at all. The gate is demand, not the gap itself.
Two numbers the whole partnership hinged on
Battery swaps and rebalances completed by external operators, computed daily from task completions, rendered as color-thresholded progress against target.
Marker shows the ≥50% target line — this is the "external rebalance share dipped to 44%" flag from the digest above. See sql/task-completions-external-share.sql.
An exclusion cascade, run twice daily
Every vehicle with a same-day GPS fix passed through three exclusions before landing on a worklist — stale coordinates send field workers to places vehicles no longer are.
Output: an xlsx with per-vehicle deep links, plus a fully self-contained inline-SVG map — no CDN dependencies, so it renders in a chat preview as readily as a browser tab. See sql/fresh-gps-oob-export.sql.
Memory with zero infrastructure
Each dashboard carried a notes widget backed only by localStorage. Notes exported to JSON, and the next run's pre-flight step read them back in as prior-run context — a feedback loop between a human and an autonomous agent with no server at all.
What we learned
Scans are attendance, not performance. One field worker showed 13 scans against 31 confirmed task completions in the same window. Every presence signal was cross-referenced against the task table before any conclusion.
Demand context must gate alerts. Early versions flagged every partner scan gap. That erodes trust fast when the partner simply wasn't scheduled — gating on "was there meaningful work available?" turned the channel from noise into signal.
Distrust convenient documents. Two externally-produced audit spreadsheets proved unreliable — one showed zero activity on a day with confirmed field work. Policy: the warehouse is canonical, missing ranges are flagged as pipeline gaps, never assumed zero.
Identity resolution needs a human channel. Day-of-week inference misbucketed workers; only database email evidence and human confirmation were reliable. The worker registry carried explicit Confirmed / Unconfirmed states.
GPS freshness is correctness. The vehicle query joins the dimension table for the same-day GPS fix rather than trusting the current-state snapshot.
Static HTML + texts beat BI logins. Field operators reliably opened a short link from a text. Nobody logged into a BI tool.
Admin accounts distort field metrics. The ops lead's own account was excluded from every field-action query by standing policy.
Repo map
| Path | Contents |
|---|---|
sql/ | Annotated production queries (Presto dialect) |
snippets/ | Feedback widget, reusable patterns |
examples/ | Sanitized message examples, partner report excerpts, run snapshot schema |
screenshots/ | Dashboard and map captures |
All personal identifiers — names, phone numbers, emails, account UUIDs, internal admin URLs — have been removed or replaced with placeholders. Fleet-level data shown is representative.