Data loading
EstimateIQ’s Durable Object starts empty. There is no auto-seed and nothing is baked into the Worker image — the DO creates its tables on first run and waits to be loaded. Data goes in explicitly, through the API, from an external dataset. This keeps the deployed artifact free of demo data and lets you load the same dataset (or real data) into any environment.
The admin endpoints
All are guarded by Authorization: Bearer <REVSRC_SECRET_KEY> and handled at the Worker edge
before the Access gate, so automation reaches them without a browser session.
| Method | Path | Effect |
|---|---|---|
POST | /api/admin/clear | Empties every table (FK-safe order). |
POST | /api/admin/load | Clears, then bulk-inserts the posted dataset in FK order. Returns per-table counts. |
POST | /api/admin/seed | Rebuilds the built-in demo generator (dev convenience only). |
POST | /api/admin/reindex | Re-embeds every estimate into Vectorize for semantic search. |
clear and load each write an entry to the audit log (admin.clear,
admin.load).
The dataset
The data lives outside the app in infra/data/dataset.json — a map of table name → rows
(carriers, estimators, estimates, revisions, line items, follow-ups, events, emails, config…),
inserted in dependency order by /api/admin/load. Replace this file with real data, or regenerate it
from the demo generator:
bun run export-dataset # rewrites infra/data/dataset.jsonLoading with Ansible
The load is automated by the Ansible playbook infra/ansible/load.yml, which clears the DO, POSTs
the dataset to /api/admin/load, prints the loaded counts, and verifies estimates came back live:
export REVSRC_ADMIN_TOKEN=<worker REVSRC_SECRET_KEY>bun run load # → esb.guruansible-playbook infra/ansible/load.yml -e api_base=http://localhost:3000bun run load is the shortcut for ansible-playbook infra/ansible/load.yml. Point api_base at any
environment to load the same data anywhere — prod, staging, or local dev.
Reindex search after a load
Semantic search reads a Vectorize index that is not touched by load. After a bulk load (or a
large batch of updates), rebuild it:
curl -X POST https://esb.guru/api/admin/reindex \ -H "Authorization: Bearer $REVSRC_ADMIN_TOKEN"This embeds the full content of every estimate and upserts the vectors, returning { indexed: N }.
See Search.